PostGIS 3.7.0dev-r@@SVN_REVISION@@
Loading...
Searching...
No Matches

◆ rt_pg_vsi_check_options()

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

Definition at line 420 of file rtpostgis.c.

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