Look up a module-level string constant by name. URL-builder entries share the * map but are not constants: a bare `thingPath` reference is the function, not * the URL it would build (issue #1009). */
| 33 | * map but are not constants: a bare `thingPath` reference is the function, not |
| 34 | * the URL it would build (issue #1009). */ |
| 35 | static const char *lookup_string_constant(const CBMExtractCtx *ctx, const char *name) { |
| 36 | if (!name || !name[0]) { |
| 37 | return NULL; |
| 38 | } |
| 39 | const CBMStringConstantMap *map = &ctx->string_constants; |
| 40 | for (int i = 0; i < map->count; i++) { |
| 41 | if (!map->is_url_builder[i] && strcmp(map->names[i], name) == 0) { |
| 42 | return map->values[i]; |
| 43 | } |
| 44 | } |
| 45 | return NULL; |
| 46 | } |
| 47 | |
| 48 | static const char *lookup_url_builder(const CBMExtractCtx *ctx, const char *name) { |
| 49 | if (!name || !name[0]) { |
no outgoing calls
no test coverage detected