X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=string.h;h=561ff4e8705c4d20baf0b01999503f725cadb820;hp=84101a873f66437c2304fa1af8f2b4ecadf385cc;hb=a98d8715828261927da6705321a8b1a31d23c6d4;hpb=4f0d81d30685a98ec5b1058c09be8833e7fd147f diff --git a/string.h b/string.h index 84101a87..561ff4e8 100644 --- a/string.h +++ b/string.h @@ -12,8 +12,18 @@ struct para_buffer { char *buf; /** The size of \a buf. */ size_t size; + /** The maximal size this buffer may grow. Zero means unlimited. */ + size_t max_size; /** The next para_printf() will write at this offset. */ size_t offset; + /** + * If an attempt to print into this buffer is made that would need to + * grow \a buf to a size larger than \a max_size, then this function is + * called. + */ + int (*max_size_handler)(char *buf, size_t size, void *private_data); + /** Passed to max_size_handler(). */ + void *private_data; }; __must_check __malloc void *para_realloc(void *p, size_t size);