Initial import of libucore
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
#ifndef UCORE_BUFFER_H_
|
||||
#define UCORE_BUFFER_H_
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct GBuf GBuf;
|
||||
struct GBuf {
|
||||
size_t len;
|
||||
size_t used;
|
||||
size_t ref_cnt;
|
||||
void *buf;
|
||||
};
|
||||
|
||||
GBuf*
|
||||
uc_new_gbuf(size_t initsz);
|
||||
|
||||
void
|
||||
uc_gbuf_ref(GBuf *buf);
|
||||
|
||||
void
|
||||
uc_gbuf_unref(GBuf *buf);
|
||||
|
||||
int
|
||||
uc_gbuf_append(GBuf *buf,void *data,size_t len);
|
||||
|
||||
int
|
||||
uc_grow_gbuf(GBuf *buf, size_t addlen);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user