PostGIS  3.3.9dev-r@@SVN_REVISION@@

◆ rt_pg_vsi_load_options()

static void rt_pg_vsi_load_options ( const char *  vsiname,
stringlist_t s 
)
static

Definition at line 345 of file rtpostgis.c.

346 {
347  CPLXMLNode *root, *optNode;
348  const char *xml = VSIGetFileSystemOptions(vsiname);
349  if (!xml) return;
350 
351  root = CPLParseXMLString(xml);
352  if (!root) {
353  elog(ERROR, "%s: Unable to read options for VSI %s", __func__, vsiname);
354  return;
355  }
356  optNode = CPLSearchXMLNode(root, "Option");
357  if (!optNode) {
358  CPLDestroyXMLNode(root);
359  elog(ERROR, "%s: Unable to find <Option> in VSI XML %s", __func__, vsiname);
360  return;
361  }
362  while(optNode)
363  {
364  const char *option = CPLGetXMLValue(optNode, "name", NULL);
365  if (option) {
366  char *optionstr = pstrdup(option);
367  char *ptr = optionstr;
368  /* The options parser used in rt_util_gdal_open()
369  lowercases keys, so we'll lower case our list
370  of options before storing them in the stringlist. */
371  while (*ptr) {
372  *ptr = tolower(*ptr);
373  ptr++;
374  }
375  elog(DEBUG4, "GDAL %s option: %s", vsiname, optionstr);
376  stringlist_add_string_nosort(s, optionstr);
377  }
378  optNode = optNode->psNext;
379  }
380  CPLDestroyXMLNode(root);
381 }
char * s
Definition: cu_in_wkt.c:23
void stringlist_add_string_nosort(stringlist_t *s, const char *string)
Definition: stringlist.c:117

References s, and stringlist_add_string_nosort().

Referenced by rt_pg_vsi_load_all_options().

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