4 * Copyright (c) 2013 project bchan
6 * This software is provided 'as-is', without any express or implied
7 * warranty. In no event will the authors be held liable for any damages
8 * arising from the use of this software.
10 * Permission is granted to anyone to use this software for any purpose,
11 * including commercial applications, and to alter it and redistribute it
12 * freely, subject to the following restrictions:
14 * 1. The origin of this software must not be misrepresented; you must not
15 * claim that you wrote the original software. If you use this software
16 * in a product, an acknowledgment in the product documentation would be
17 * appreciated but is not required.
19 * 2. Altered source versions must be plainly marked as such, and must not be
20 * misrepresented as being the original software.
22 * 3. This notice may not be removed or altered from any source
28 /* Functionality name: bytearray */
33 #ifndef __BYTEARRAY_H__
34 #define __BYTEARRAY_H__
36 /* Functionality name: bytearray */
42 typedef struct bytearray_t_ bytearray_t;
44 /* Functionality name: bytearray */
45 /* Detail name: cursor */
46 struct bytearray_cursor_t_ {
50 typedef struct bytearray_cursor_t_ bytearray_cursor_t;
52 IMPORT W bytearray_initialize(bytearray_t *bytearray);
53 IMPORT VOID bytearray_finalize(bytearray_t *bytearray);
54 IMPORT UB* bytearray_getbuffer(bytearray_t *bytearray);
55 IMPORT W bytearray_getlength(bytearray_t *bytearray);
56 IMPORT W bytearray_pushback(bytearray_t *bytearray, UB val);
57 IMPORT W bytearray_popback(bytearray_t *bytearray);
59 IMPORT VOID bytearray_cursor_initialize(bytearray_cursor_t *cursor, bytearray_t *bytearray);
60 IMPORT VOID bytearray_cursor_finalize(bytearray_cursor_t *cursor);
61 IMPORT W bytearray_cursor_move(bytearray_cursor_t *cursor, W diff);
62 IMPORT W bytearray_cursor_erase(bytearray_cursor_t *cursor, W len);
63 IMPORT W bytearray_cursor_insert(bytearray_cursor_t *cursor, UB *data, W len);
64 IMPORT Bool bytearray_cursor_isend(bytearray_cursor_t *cursor);
65 IMPORT W bytearray_cursor_getB(bytearray_cursor_t *cursor, B *p);
66 IMPORT W bytearray_cursor_getH(bytearray_cursor_t *cursor, H *p);
67 IMPORT W bytearray_cursor_getW(bytearray_cursor_t *cursor, W *p);
68 IMPORT W bytearray_cursor_getUB(bytearray_cursor_t *cursor, UB *p);
69 IMPORT W bytearray_cursor_getUH(bytearray_cursor_t *cursor, UH *p);
70 IMPORT W bytearray_cursor_getUW(bytearray_cursor_t *cursor, UW *p);