pike.git / src / builtin.cmod

version» Context lines:

pike.git/src/builtin.cmod:3430:    push_object(res);    }    else    push_undefined();    }       /*! @decl void clear()    *!    *! Empty the buffer, and don't care about the old content.    *! -  *! @note -  *! This function was not available in Pike 7.8 and earlier. -  *! +     *! @seealso    *! @[get()], @[cut()]    */    PIKEFUN void clear()    { -  /* FIXME: Support resetting the initial size? */ +     struct Buffer_struct *str = THIS; -  if (str->str.s) { -  /* FIXME: There's also the alternative of using -  * reset_string_builder() here. -  */ -  free_string_builder(&str->str); -  str->str.s = NULL; +  if (str->str.s) +  reset_string_builder(&str->str);    } -  } +        /*! @decl int _sizeof()    *!    *! Returns the size of the buffer.    */    PIKEFUN int _sizeof()    {    struct Buffer_struct *str = THIS;    RETURN str->str.s ? str->str.s->len : 0;    }