Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 37 lines (28 sloc) 0.857 kB
f98a9c9 @BohuTANG change the storage engine to LSM-Tree storage engine
authored
1 /*
2 * LSM-Tree storage engine
3 * Copyright (c) 2011, BohuTANG <overred.shuttler at gmail dot com>
4 * All rights reserved.
5 * Code is licensed with BSD. See COPYING.BSD file.
6 *
7 */
8
e641fee @BohuTANG Add: LSM-Tree for records insert
authored
9 #ifndef _BUF_H
10 #define _BUF_H
11
43b5d99 @BohuTANG Change: UINT to uint64_t and add a funy logo
authored
12 #include <stdint.h>
13
e641fee @BohuTANG Add: LSM-Tree for records insert
authored
14 struct buffer {
15 char *buf;
16 int NUL;
17 int buflen;
18 };
19
20 struct buffer *buffer_new(size_t reserve);
21 void buffer_free(struct buffer *b);
22
23 void buffer_clear(struct buffer *b);
24 char *buffer_detach(struct buffer *b);
25
26 void buffer_putc(struct buffer *b, const char c);
27 void buffer_putstr(struct buffer *b, const char *str);
28 void buffer_putnstr(struct buffer *b, const char *str, size_t n);
f98a9c9 @BohuTANG change the storage engine to LSM-Tree storage engine
authored
29 void buffer_putint(struct buffer *b, int val);
43b5d99 @BohuTANG Change: UINT to uint64_t and add a funy logo
authored
30 void buffer_putlong(struct buffer *b, uint64_t val);
f98a9c9 @BohuTANG change the storage engine to LSM-Tree storage engine
authored
31 uint32_t buffer_getint(unsigned char *buf);
32 uint64_t buffer_getlong(unsigned char *buf);
e641fee @BohuTANG Add: LSM-Tree for records insert
authored
33
34 void buffer_dump(struct buffer *b);
35
36 #endif
Something went wrong with that request. Please try again.