274{
275 size_t sz;
277
279 char input[128];
280 memset(olist, 0, sizeof(olist));
281
282 strcpy(input, "key1=value1 key2=value2 ");
284
286
291 CU_ASSERT_EQUAL(NULL, value);
292
294 CU_ASSERT_EQUAL(4, sz);
295
296 memset(olist, 0, sizeof(olist));
297 strcpy(input, " ");
300 CU_ASSERT_EQUAL(NULL, value);
301
302 memset(olist, 0, sizeof(olist));
303 strcpy(input, " key3= ");
306 CU_ASSERT_EQUAL(2, sz);
307
308 strcpy(input, " key1=value1 key2='value2 value3' ");
309 memset(olist, 0, sizeof(olist));
312 CU_ASSERT_EQUAL(2, sz);
315}
#define ASSERT_STRING_EQUAL(o, e)
const char * option_list_search(char **olist, const char *key)
Returns null if the key cannot be found.
void option_list_gdal_parse(char *input, char **olist)
size_t option_list_length(char **olist)
Returns the total number of keys and values in the list.
void option_list_parse(char *input, char **olist)
option_list is a null-terminated list of strings, where every odd string is a key and every even stri...