PostGIS  3.4.0dev-r@@SVN_REVISION@@

◆ rt_pg_vsi_check_options()

static bool rt_pg_vsi_check_options ( char **  newval,
void **  extra,
GucSource  source 
)
static

Definition at line 421 of file rtpostgis.c.

422 {
423  size_t olist_sz, i;
424  char *olist[OPTION_LIST_SIZE];
425  const char *found = NULL;
426  char *newoptions;
427 
428  memset(olist, 0, sizeof(olist));
429  if (!newval || !*newval)
430  return false;
431  newoptions = pstrdup(*newval);
432 
433  /* Cache the legal options if they aren't already loaded */
436 
437  elog(DEBUG5, "%s: processing VSI options: %s", __func__, newoptions);
438  option_list_parse(newoptions, olist);
439  olist_sz = option_list_length(olist);
440  if (olist_sz % 2 != 0)
441  return false;
442 
443  for (i = 0; i < olist_sz; i += 2)
444  {
445  found = stringlist_find(vsi_option_stringlist, olist[i]);
446  if (!found)
447  {
448  elog(WARNING, "'%s' is not a legal VSI network file option", olist[i]);
449  pfree(newoptions);
450  return false;
451  }
452  }
453  return true;
454 }
size_t option_list_length(char **olist)
Returns the total number of keys and values in the list.
Definition: optionlist.c:73
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...
Definition: optionlist.c:86
#define OPTION_LIST_SIZE
Definition: optionlist.h:31
stringlist_t * vsi_option_stringlist
Definition: rtpostgis.c:270
static void rt_pg_vsi_load_all_options(void)
Definition: rtpostgis.c:281
const char * stringlist_find(stringlist_t *s, const char *key)
Definition: stringlist.c:129

References option_list_length(), option_list_parse(), OPTION_LIST_SIZE, rt_pg_vsi_load_all_options(), stringlist_find(), and vsi_option_stringlist.

Referenced by _PG_init().

Here is the call graph for this function:
Here is the caller graph for this function: