| 4503 | } |
| 4504 | |
| 4505 | int msUpdateLegendFromString(legendObj *legend, char *string, int url_string) |
| 4506 | { |
| 4507 | if(!legend || !string) return MS_FAILURE; |
| 4508 | |
| 4509 | msAcquireLock( TLOCK_PARSER ); |
| 4510 | |
| 4511 | if(url_string) |
| 4512 | msyystate = MS_TOKENIZE_URL_STRING; |
| 4513 | else |
| 4514 | msyystate = MS_TOKENIZE_STRING; |
| 4515 | msyystring = string; |
| 4516 | msyylex(); /* sets things up, but doesn't process any tokens */ |
| 4517 | |
| 4518 | msyylineno = 1; /* start at line 1 */ |
| 4519 | |
| 4520 | if(loadLegend(legend, legend->map) == -1) { |
| 4521 | msReleaseLock( TLOCK_PARSER ); |
| 4522 | return MS_FAILURE; /* parse error */; |
| 4523 | } |
| 4524 | msReleaseLock( TLOCK_PARSER ); |
| 4525 | |
| 4526 | msyylex_destroy(); |
| 4527 | return MS_SUCCESS; |
| 4528 | } |
| 4529 | |
| 4530 | static void writeLegend(FILE *stream, int indent, legendObj *legend) |
| 4531 | { |
no test coverage detected