| 4649 | } |
| 4650 | |
| 4651 | int msUpdateScalebarFromString(scalebarObj *scalebar, char *string, int url_string) |
| 4652 | { |
| 4653 | if(!scalebar || !string) return MS_FAILURE; |
| 4654 | |
| 4655 | msAcquireLock( TLOCK_PARSER ); |
| 4656 | |
| 4657 | if(url_string) |
| 4658 | msyystate = MS_TOKENIZE_URL_STRING; |
| 4659 | else |
| 4660 | msyystate = MS_TOKENIZE_STRING; |
| 4661 | msyystring = string; |
| 4662 | msyylex(); /* sets things up, but doesn't process any tokens */ |
| 4663 | |
| 4664 | msyylineno = 1; /* start at line 1 */ |
| 4665 | |
| 4666 | if(loadScalebar(scalebar) == -1) { |
| 4667 | msReleaseLock( TLOCK_PARSER ); |
| 4668 | return MS_FAILURE; /* parse error */; |
| 4669 | } |
| 4670 | msReleaseLock( TLOCK_PARSER ); |
| 4671 | |
| 4672 | msyylex_destroy(); |
| 4673 | return MS_SUCCESS; |
| 4674 | } |
| 4675 | |
| 4676 | static void writeScalebar(FILE *stream, int indent, scalebarObj *scalebar) |
| 4677 | { |
no test coverage detected