PostGIS  3.3.9dev-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 413 of file rtpostgis.c.

414 {
415  size_t olist_sz, i;
416  char *olist[OPTION_LIST_SIZE];
417  const char *found = NULL;
418  char *newoptions;
419 
420  memset(olist, 0, sizeof(olist));
421  if (!newval || !*newval)
422  return false;
423  newoptions = pstrdup(*newval);
424 
425  /* Cache the legal options if they aren't already loaded */
428 
429  elog(DEBUG5, "%s: processing VSI options: %s", __func__, newoptions);
430  option_list_parse(newoptions, olist);
431  olist_sz = option_list_length(olist);
432  if (olist_sz % 2 != 0)
433  return false;
434 
435  for (i = 0; i < olist_sz; i += 2)
436  {
437  found = stringlist_find(vsi_option_stringlist, olist[i]);
438  if (!found)
439  {
440  elog(WARNING, "'%s' is not a legal VSI network file option", olist[i]);
441  pfree(newoptions);
442  return false;
443  }
444  }
445  return true;
446 }
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:262
static void rt_pg_vsi_load_all_options(void)
Definition: rtpostgis.c:384
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: