buf.h
00001
00002
00003 #ifndef _U_LIBU_BUF_H_
00004 #define _U_LIBU_BUF_H_
00005
00006 #include <stdlib.h>
00007 #include <unistd.h>
00008 #include <stdio.h>
00009 #include <stdarg.h>
00010
00011 #ifdef __cplusplus
00012 extern "C" {
00013 #endif
00014
00015
00016 struct u_buf_s;
00017
00028 typedef struct u_buf_s u_buf_t;
00029
00030 int u_buf_append (u_buf_t *buf, const void *data, size_t size);
00031 int u_buf_clear (u_buf_t *buf);
00032 int u_buf_create (u_buf_t **pbuf);
00033 int u_buf_detach (u_buf_t *buf);
00034 int u_buf_free (u_buf_t *buf);
00035 int u_buf_load (u_buf_t *buf, const char *fqn);
00036 int u_buf_printf (u_buf_t *ubuf, const char *fmt, ...);
00037 int u_buf_reserve (u_buf_t *buf, size_t size);
00038 int u_buf_save (u_buf_t *ubuf, const char *filename);
00039 int u_buf_set (u_buf_t *buf, const void *data, size_t size);
00040 ssize_t u_buf_len (u_buf_t *buf);
00041 ssize_t u_buf_size (u_buf_t *ubuf);
00042 void *u_buf_ptr (u_buf_t *buf);
00043 int u_buf_shrink(u_buf_t *ubuf, size_t newlen);
00044
00049 #ifdef __cplusplus
00050 }
00051 #endif
00052
00053 #endif