RETVAL_STRINGL((STR)->data, (STR)->used, (dup)); \
FREE_PHPSTR((free), (STR));
-struct _phpstr {
+typedef struct {
size_t size;
char *data;
size_t used;
size_t free;
-};
-typedef struct _phpstr phpstr;
+} phpstr;
-enum _phpstr_free {
+typedef enum {
PHPSTR_FREE_NOT = 0,
PHPSTR_FREE_PTR, /* efree() */
PHPSTR_FREE_VAL, /* phpstr_dtor() */
PHPSTR_FREE_ALL /* phpstr_free() */
-};
-typedef enum _phpstr_free phpstr_free_t;
+} phpstr_free_t;
#define PHPSTR_ALL_FREE(STR) PHPSTR_FREE_ALL,(STR)
#define PHPSTR_PTR_FREE(STR) PHPSTR_FREE_PTR,(STR)
PHPSTR_API phpstr *phpstr_sub(const phpstr *buf, size_t offset, size_t len);
/* remove a substring */
-PHPSTR_API ssize_t phpstr_cut(phpstr *buf, size_t offset, size_t length);
+PHPSTR_API size_t phpstr_cut(phpstr *buf, size_t offset, size_t length);
/* get a complete phpstr duplicate */
PHPSTR_API phpstr *phpstr_dup(const phpstr *buf);