summaryrefslogtreecommitdiffstats
path: root/src/bytearray.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/bytearray.h')
-rw-r--r--src/bytearray.h36
1 files changed, 36 insertions, 0 deletions
diff --git a/src/bytearray.h b/src/bytearray.h
new file mode 100644
index 0000000..3e67d7e
--- /dev/null
+++ b/src/bytearray.h
@@ -0,0 +1,36 @@
1/*
2 * bytearray.h
3 * header file for simple byte array implementation
4 *
5 * Copyright (c) 2011 Nikias Bassen, All Rights Reserved.
6 *
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
11 *
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 */
21#ifndef BYTEARRAY_H
22#define BYTEARRAY_H
23#include <stdlib.h>
24#include "common.h"
25
26typedef struct bytearray_t {
27 void *data;
28 size_t len;
29 size_t capacity;
30} bytearray_t;
31
32_PLIST_INTERNAL bytearray_t *byte_array_new();
33_PLIST_INTERNAL void byte_array_free(bytearray_t *ba);
34_PLIST_INTERNAL void byte_array_append(bytearray_t *ba, void *buf, size_t len);
35
36#endif