/
| 41 | |
| 42 | /**************************************************************************************/ |
| 43 | static paralist *string_to_paralist(PJ_CONTEXT *ctx, char *definition) { |
| 44 | /*************************************************************************************** |
| 45 | Convert a string (presumably originating from get_init_string) to a |
| 46 | paralist. |
| 47 | ***************************************************************************************/ |
| 48 | const char *c = definition; |
| 49 | paralist *first = nullptr, *last = nullptr; |
| 50 | |
| 51 | while (*c) { |
| 52 | /* Keep a handle to the start of the list, so we have something to |
| 53 | * return */ |
| 54 | auto param = pj_mkparam_ws(c, &c); |
| 55 | if (nullptr == param) { |
| 56 | free_params(ctx, first, PROJ_ERR_OTHER /*ENOMEM*/); |
| 57 | return nullptr; |
| 58 | } |
| 59 | if (nullptr == last) { |
| 60 | first = param; |
| 61 | } else { |
| 62 | last->next = param; |
| 63 | } |
| 64 | last = param; |
| 65 | } |
| 66 | return first; |
| 67 | } |
| 68 | |
| 69 | /**************************************************************************************/ |
| 70 | static char *get_init_string(PJ_CONTEXT *ctx, const char *name) { |
no test coverage detected