- a service implemented with libxmlrpc-c3 chokes on a request content type
[m6w6/ext-http] / phpstr / phpstr.h
index 9b6628e75a7bb1b92059fd13871463d358559b66..259cab2b9def7feb619d6519dae51070a0bb3540 100644 (file)
@@ -10,6 +10,8 @@
 #      define PHPSTR_DEFAULT_SIZE 256
 #endif
 
+#define PHPSTR_NOMEM ((size_t) -1)
+
 #ifndef STR_SET
 #      define STR_SET(STR, SET) \
        { \
        RETVAL_STRINGL((STR)->data, (STR)->used, (dup)); \
        FREE_PHPSTR((free), (STR));
 
-typedef struct {
-       size_t size;
+typedef struct _phpstr_t {
        char  *data;
        size_t used;
        size_t free;
-       int    pmem;
+       size_t size;
+       unsigned pmem:1;
+       unsigned reserved:31;
 } phpstr;
 
-typedef enum {
+typedef enum _phpstr_free_t {
        PHPSTR_FREE_NOT = 0,
        PHPSTR_FREE_PTR,        /* pefree() */
        PHPSTR_FREE_VAL,        /* phpstr_dtor() */
@@ -104,8 +107,8 @@ PHPSTR_API phpstr *phpstr_init_ex(phpstr *buf, size_t chunk_size, int flags);
 PHPSTR_API phpstr *phpstr_from_string_ex(phpstr *buf, const char *string, size_t length);
 
 /* usually only called from within the internal functions */
-#define phpstr_resize(b, s) phpstr_resize_ex((b), (s), 0)
-PHPSTR_API size_t phpstr_resize_ex(phpstr *buf, size_t len, size_t override_size);
+#define phpstr_resize(b, s) phpstr_resize_ex((b), (s), 0, 0)
+PHPSTR_API size_t phpstr_resize_ex(phpstr *buf, size_t len, size_t override_size, int allow_error);
 
 /* shrink memory chunk to actually used size (+1) */
 PHPSTR_API size_t phpstr_shrink(phpstr *buf);