    /*
     * call-seq: max_nesting=(depth)
     *
     * This sets the maximum level of data structure nesting in the generated JSON
     * to the integer depth, max_nesting = 0 if no maximum should be checked.
     */
    static VALUE cState_max_nesting_set(VALUE self, VALUE depth)
    {
        GET_STATE(self);
        Check_Type(depth, T_FIXNUM);
        return state->max_nesting = FIX2LONG(depth);
    }