diff options
author | Daniel Silverstone <dsilvers@netsurf-browser.org> | 2010-03-27 16:30:27 +0000 |
---|---|---|
committer | Daniel Silverstone <dsilvers@netsurf-browser.org> | 2010-03-27 16:30:27 +0000 |
commit | c478a22e917cd68b1adcab7022923479809d9cb0 (patch) | |
tree | 4841a898290678bcb3fa6be4f3796d5ec867d989 /include/libwapcaplet | |
parent | 02fdaeaf41359941559dd63e24805e78a9ee27e5 (diff) | |
download | libwapcaplet-c478a22e917cd68b1adcab7022923479809d9cb0.tar.gz libwapcaplet-c478a22e917cd68b1adcab7022923479809d9cb0.tar.bz2 |
Add simple iteration API and also add brackets in lwc_string_isequal
svn path=/trunk/libwapcaplet/; revision=10163
Diffstat (limited to 'include/libwapcaplet')
-rw-r--r-- | include/libwapcaplet/libwapcaplet.h | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/include/libwapcaplet/libwapcaplet.h b/include/libwapcaplet/libwapcaplet.h index b71306c..e5b1844 100644 --- a/include/libwapcaplet/libwapcaplet.h +++ b/include/libwapcaplet/libwapcaplet.h @@ -29,6 +29,14 @@ typedef void *(*lwc_allocator_fn)(void *ptr, size_t size, void *pw); typedef struct lwc_string_s lwc_string; /** + * String iteration function + * + * @param str A string which has been interned. + * @param pw The private pointer for the allocator. + */ +typedef void (*lwc_iteration_callback_fn)(lwc_string *str, void *pw); + +/** * Result codes which libwapcaplet might return. */ typedef enum lwc_error_e { @@ -149,7 +157,7 @@ extern void lwc_string_unref(lwc_string *str); * by \a ret will not be valid. */ #define lwc_string_isequal(str1, str2, ret) \ - (*ret = (str1 == str2)), lwc_error_ok + ((*(ret) = ((str1) == (str2))), lwc_error_ok) /** * Check if two interned strings are case-insensitively equal. @@ -199,4 +207,12 @@ extern size_t lwc_string_length(lwc_string *str); */ extern uint32_t lwc_string_hash_value(lwc_string *str); +/** + * Iterate the context and return every string in it. + * + * @param cb The callback to give the string to. + * @param pw The private word for the callback. + */ +extern void lwc_iterate_strings(lwc_iteration_callback_fn cb, void *pw); + #endif /* libwapcaplet_h_ */ |