PostGIS  3.4.0dev-r@@SVN_REVISION@@

◆ option_list_search()

const char* option_list_search ( char **  olist,
const char *  key 
)

Returns null if the key cannot be found.

Only use fully lowercase keys, because we lowercase keys when we parse the olist

Definition at line 54 of file optionlist.c.

55 {
56  size_t i = 0;
57  if (!olist) return NULL;
58  if (!key) return NULL;
59  while (olist[i]) {
60  // Even entries are keys
61  if (!(i % 2)) {
62  // Does this key match ours?
63  if (strcmp(olist[i], key) == 0) {
64  return olist[i+1];
65  }
66  }
67  i++;
68  }
69  return NULL;
70 }

Referenced by lwgeom_make_valid_params(), and test_optionlist().

Here is the caller graph for this function: