diff options
author | John Mark Bell <jmb@netsurf-browser.org> | 2008-12-01 03:14:37 +0000 |
---|---|---|
committer | John Mark Bell <jmb@netsurf-browser.org> | 2008-12-01 03:14:37 +0000 |
commit | ce2b034ae9dcad49d8c2721494830c3731a60ff8 (patch) | |
tree | dc88943dc1614b0f9e7c080e605307d6863732ca /include/parserutils/utils | |
parent | da18d0ce1b4ea9231243e52b3e81a6a5b026b879 (diff) | |
download | libparserutils-ce2b034ae9dcad49d8c2721494830c3731a60ff8.tar.gz libparserutils-ce2b034ae9dcad49d8c2721494830c3731a60ff8.tar.bz2 |
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
Diffstat (limited to 'include/parserutils/utils')
-rw-r--r-- | include/parserutils/utils/hash.h | 6 |
1 files changed, 3 insertions, 3 deletions
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 <parserutils/functypes.h> 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 |