* Generate key-value arrays which include only libpq options from the * given list (which can contain any kind of options). Caller must have * allocated large-enough arrays. Returns number of options found. */
| 369 | * allocated large-enough arrays. Returns number of options found. |
| 370 | */ |
| 371 | int |
| 372 | ExtractConnectionOptions(List *defelems, const char **keywords, |
| 373 | const char **values) |
| 374 | { |
| 375 | ListCell *lc; |
| 376 | int i; |
| 377 | |
| 378 | /* Build our options lists if we didn't yet. */ |
| 379 | InitPgFdwOptions(); |
| 380 | |
| 381 | i = 0; |
| 382 | foreach(lc, defelems) |
| 383 | { |
| 384 | DefElem *d = (DefElem *) lfirst(lc); |
| 385 | |
| 386 | if (is_libpq_option(d->defname)) |
| 387 | { |
| 388 | keywords[i] = d->defname; |
| 389 | values[i] = defGetString(d); |
| 390 | i++; |
| 391 | } |
| 392 | } |
| 393 | return i; |
| 394 | } |
| 395 | |
| 396 | /* |
| 397 | * Parse a comma-separated string and return a List of the OIDs of the |
no test coverage detected