From ce2b034ae9dcad49d8c2721494830c3731a60ff8 Mon Sep 17 00:00:00 2001 From: John Mark Bell Date: Mon, 1 Dec 2008 03:14:37 +0000 Subject: Chunked arrays: Pack length of entries into array as a prefix to the data. Limit maximum length of data items stored in hash/chunked array to 2^16-1. svn path=/trunk/libparserutils/; revision=5858 --- include/parserutils/utils/hash.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'include/parserutils') diff --git a/include/parserutils/utils/hash.h b/include/parserutils/utils/hash.h index 129c6f6..92f0236 100644 --- a/include/parserutils/utils/hash.h +++ b/include/parserutils/utils/hash.h @@ -12,8 +12,8 @@ #include typedef struct parserutils_hash_entry { - size_t len; - const uint8_t *data; + uint16_t len; + const uint8_t data[]; } parserutils_hash_entry; struct parserutils_hash; @@ -24,7 +24,7 @@ parserutils_error parserutils_hash_create(parserutils_alloc alloc, void *pw, parserutils_error parserutils_hash_destroy(parserutils_hash *hash); parserutils_error parserutils_hash_insert(parserutils_hash *hash, - const uint8_t *data, size_t len, + const uint8_t *data, uint16_t len, const parserutils_hash_entry **inserted); #endif -- cgit v1.2.3