- use size_t and return 0 on fail
[m6w6/ext-http] / phpstr / phpstr.h
index 50d9c283c14616a619ce72ee1cf93131dc4f4a67..c53d311f2b532dabb0dcaed462d370f7ee1e1a5d 100644 (file)
        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)
@@ -100,7 +98,7 @@ PHPSTR_API phpstr *phpstr_right(const phpstr *buf, size_t length);
 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);