** Load a string from the map file. A "string" is defined in lexer.l. */
| 198 | ** Load a string from the map file. A "string" is defined in lexer.l. |
| 199 | */ |
| 200 | int getString(char **s) { |
| 201 | /* if (*s) |
| 202 | msSetError(MS_SYMERR, "Duplicate item (%s):(line %d)", "getString()", msyystring_buffer, msyylineno); |
| 203 | return(MS_FAILURE); |
| 204 | } else */ |
| 205 | if(msyylex() == MS_STRING) { |
| 206 | if(*s) free(*s); /* avoid leak */ |
| 207 | *s = msStrdup(msyystring_buffer); |
| 208 | if (*s == NULL) { |
| 209 | msSetError(MS_MEMERR, NULL, "getString()"); |
| 210 | return(MS_FAILURE); |
| 211 | } |
| 212 | return(MS_SUCCESS); |
| 213 | } |
| 214 | |
| 215 | msSetError(MS_SYMERR, "Parsing error near (%s):(line %d)", "getString()", msyystring_buffer, msyylineno); |
| 216 | return(MS_FAILURE); |
| 217 | } |
| 218 | |
| 219 | /* |
| 220 | ** Load a floating point number from the map file. (see lexer.l) |
no test coverage detected