diff -Nru mapserver-7.0.7+6/debian/changelog mapserver-7.2.0+1/debian/changelog --- mapserver-7.0.7+6/debian/changelog 2018-07-30 20:30:12.000000000 +0000 +++ mapserver-7.2.0+1/debian/changelog 2018-07-30 22:04:02.000000000 +0000 @@ -1,8 +1,14 @@ -mapserver (7.0.7+6-0trusty1) trusty; urgency=medium +mapserver (7.2.0+1-0trusty1) trusty; urgency=medium + + * 50ff0ee - Dmitry Baryshnikov : Add missed files + + -- Dmitry Baryshnikov Mon, 30 Jul 2018 22:04:02 +0000 + +mapserver (7.0.7+6-0unstable1) unstable; urgency=medium * 8c08937 - Dmitry Baryshnikov : Update to mapserver 7.2 - -- Dmitry Baryshnikov Mon, 30 Jul 2018 20:30:12 +0000 + -- Dmitry Baryshnikov Mon, 30 Jul 2018 20:30:54 +0000 mapserver (7.0.7+5-0unstable1) unstable; urgency=medium diff -Nru mapserver-7.0.7+6/debian/control mapserver-7.2.0+1/debian/control --- mapserver-7.0.7+6/debian/control 2018-07-30 20:29:51.000000000 +0000 +++ mapserver-7.2.0+1/debian/control 2018-07-30 22:03:42.000000000 +0000 @@ -36,7 +36,7 @@ docbook-xsl, docbook-xml, xsltproc, - libprotobuf-c-dev, + libprotobuf-c0-dev | libprotobuf-c-dev, protobuf-c-compiler Build-Conflicts: libcurl3-openssl-dev XS-Ruby-Versions: all diff -Nru mapserver-7.0.7+6/mapfile.dtd mapserver-7.2.0+1/mapfile.dtd --- mapserver-7.0.7+6/mapfile.dtd 1970-01-01 00:00:00.000000000 +0000 +++ mapserver-7.2.0+1/mapfile.dtd 2018-07-30 22:03:46.000000000 +0000 @@ -0,0 +1,244 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff -Nru mapserver-7.0.7+6/maplexer.l mapserver-7.2.0+1/maplexer.l --- mapserver-7.0.7+6/maplexer.l 1970-01-01 00:00:00.000000000 +0000 +++ mapserver-7.2.0+1/maplexer.l 2018-07-30 22:03:46.000000000 +0000 @@ -0,0 +1,766 @@ +%{ +/* +** READ ME FIRST! +** +** When this file is altered, it is necessary to do "make lexer". Due to +** problems detailed in #2310 the lexer is no longer automatically rebuilt +** when maplexer.l is altered. +*/ + +#define YY_NO_INPUT + +/* C declarations */ +#include +#include +#include +#include + +#include + +#include "mapserver.h" +#include "maperror.h" +#include "mapfile.h" +#include "maptime.h" +#include "mapsymbol.h" +#include "mapparser.h" +#include "mapprimitive.h" + +/* msyylineno is required for flex 2.5.4 and older, but is already defined by + * flex 2.5.31 (bug 975). + * Unfortunately there is no clean way to differenciate the two versions, + * so we use the symbol YY_CURRENT_BUFFER_LVALUE to base our test since it + * was not present in 2.5.4 and is present in 2.5.31. Hopefully that won't + * put us in trouble with other versions. If that happens then we can + * switch to using autoconf to detect the version. + */ +#ifndef YY_CURRENT_BUFFER_LVALUE +int msyylineno = 1; +#endif + +#define YY_NO_INPUT + +int msyysource=MS_STRING_TOKENS; +double msyynumber; +int msyystate=MS_TOKENIZE_DEFAULT; +char *msyystring=NULL; +char *msyybasepath=NULL; +char *msyystring_buffer_ptr; +int msyystring_buffer_size = 256; +int msyystring_size; +char msyystring_begin; +char *msyystring_buffer = NULL; +int msyystring_icase = MS_FALSE; +int msyystring_return_state; +int msyystring_begin_state; +int msyystring_size_tmp; + +int msyyreturncomments = 0; + +#define MS_LEXER_STRING_REALLOC(string, string_size, max_size, string_ptr) \ + if (string_size >= max_size) { \ + msyystring_size_tmp = max_size; \ + max_size = ((max_size*2) > string_size) ? max_size*2 : string_size+1; \ + string = (char *) msSmallRealloc(string, sizeof(char *) * max_size); \ + string_ptr = string; \ + string_ptr += msyystring_size_tmp; \ + } + +#define MS_LEXER_RETURN_TOKEN(token) \ + MS_LEXER_STRING_REALLOC(msyystring_buffer, strlen(msyytext), \ + msyystring_buffer_size, msyystring_buffer_ptr); \ + strcpy(msyystring_buffer, msyytext); \ + return(token); + +#define MAX_INCLUDE_DEPTH 5 +YY_BUFFER_STATE include_stack[MAX_INCLUDE_DEPTH]; +int include_lineno[MAX_INCLUDE_DEPTH]; +int include_stack_ptr = 0; +char path[MS_MAXPATHLEN]; + +%} + +%s URL_VARIABLE +%s URL_STRING +%s EXPRESSION_STRING +%s INCLUDE +%s MSSTRING +%s MULTILINE_COMMENT + +%% + if (msyystring_buffer == NULL) + msyystring_buffer = (char*) msSmallMalloc(sizeof(char) * msyystring_buffer_size); + + msyystring_buffer[0] = '\0'; + msyystring_buffer_size = 0; + switch(msyystate) { + case(MS_TOKENIZE_DEFAULT): + break; + case(MS_TOKENIZE_FILE): + BEGIN(INITIAL); + msyystring_begin_state = INITIAL; + msyysource=MS_FILE_TOKENS; + msyystate=MS_TOKENIZE_DEFAULT; + msyystring=NULL; + msyyreturncomments=0; + include_stack_ptr=0; + return(0); + break; + case(MS_TOKENIZE_STRING): + BEGIN(INITIAL); + msyystring_begin_state = INITIAL; + msyy_delete_buffer(YY_CURRENT_BUFFER); + msyy_scan_string(msyystring); + msyysource=MS_STRING_TOKENS; + msyystate=MS_TOKENIZE_DEFAULT; + msyyin=NULL; + msyyreturncomments=0; + include_stack_ptr=0; + return(0); + break; + case(MS_TOKENIZE_URL_VARIABLE): + BEGIN(URL_VARIABLE); + msyystring_begin_state = URL_VARIABLE; + msyy_delete_buffer(YY_CURRENT_BUFFER); + msyy_scan_string(msyystring); + msyysource=MS_URL_TOKENS; + msyystate=MS_TOKENIZE_DEFAULT; + msyyreturncomments=0; + (void) yyunput; /* just to avoid warning about it being unrefed */ + break; + case(MS_TOKENIZE_URL_STRING): + BEGIN(URL_STRING); + msyystring_begin_state = URL_STRING; + msyy_delete_buffer(YY_CURRENT_BUFFER); + msyy_scan_string(msyystring); + msyysource=MS_URL_TOKENS; + msyystate=MS_TOKENIZE_DEFAULT; + msyyin=NULL; + msyyreturncomments=0; + return(0); + break; + case(MS_TOKENIZE_EXPRESSION): + BEGIN(EXPRESSION_STRING); + msyystring_begin_state = EXPRESSION_STRING; + msyy_delete_buffer(YY_CURRENT_BUFFER); + msyy_scan_string(msyystring); + msyystate=MS_TOKENIZE_DEFAULT; + msyyreturncomments=0; + break; + case(99): + BEGIN(INITIAL); /* may not need this one */ + msyystring_begin_state = INITIAL; + msyy_delete_buffer(YY_CURRENT_BUFFER); + msyystate=MS_TOKENIZE_DEFAULT; + msyystring=NULL; + msyyreturncomments=0; + return(0); + break; + default: + break; + } + +[ \t\r]+ ; + +(\/\/|#).* { if (msyyreturncomments) return(MS_COMMENT); } + +\/\* { BEGIN(MULTILINE_COMMENT); } +\*\/ { BEGIN(INITIAL); } +[^*\n]+ ; +\* ; +\n { msyylineno++; } + +_|\. ; + +or|\|\| { MS_LEXER_RETURN_TOKEN(MS_TOKEN_LOGICAL_OR); } +and|&& { MS_LEXER_RETURN_TOKEN(MS_TOKEN_LOGICAL_AND); } +not|! { MS_LEXER_RETURN_TOKEN(MS_TOKEN_LOGICAL_NOT); } +eq|=|== { MS_LEXER_RETURN_TOKEN(MS_TOKEN_COMPARISON_EQ); } +ne|!= { MS_LEXER_RETURN_TOKEN(MS_TOKEN_COMPARISON_NE); } +gt|> { MS_LEXER_RETURN_TOKEN(MS_TOKEN_COMPARISON_GT); } +lt|< { MS_LEXER_RETURN_TOKEN(MS_TOKEN_COMPARISON_LT); } +ge|>= { MS_LEXER_RETURN_TOKEN(MS_TOKEN_COMPARISON_GE); } +le|<= { MS_LEXER_RETURN_TOKEN(MS_TOKEN_COMPARISON_LE); } +~ { MS_LEXER_RETURN_TOKEN(MS_TOKEN_COMPARISON_RE); } + +=\* { MS_LEXER_RETURN_TOKEN(MS_TOKEN_COMPARISON_IEQ); } +~\* { MS_LEXER_RETURN_TOKEN(MS_TOKEN_COMPARISON_IRE); } + +in { MS_LEXER_RETURN_TOKEN(IN); } + +area { MS_LEXER_RETURN_TOKEN(MS_TOKEN_FUNCTION_AREA); } +length { MS_LEXER_RETURN_TOKEN(MS_TOKEN_FUNCTION_LENGTH); } +tostring { MS_LEXER_RETURN_TOKEN(MS_TOKEN_FUNCTION_TOSTRING); } +commify { MS_LEXER_RETURN_TOKEN(MS_TOKEN_FUNCTION_COMMIFY); } +round { MS_LEXER_RETURN_TOKEN(MS_TOKEN_FUNCTION_ROUND); } +upper { MS_LEXER_RETURN_TOKEN(MS_TOKEN_FUNCTION_UPPER); } +lower { MS_LEXER_RETURN_TOKEN(MS_TOKEN_FUNCTION_LOWER); } +initcap { MS_LEXER_RETURN_TOKEN(MS_TOKEN_FUNCTION_INITCAP); } +firstcap { MS_LEXER_RETURN_TOKEN(MS_TOKEN_FUNCTION_FIRSTCAP); } + +buffer { MS_LEXER_RETURN_TOKEN(MS_TOKEN_FUNCTION_BUFFER); } +difference { MS_LEXER_RETURN_TOKEN(MS_TOKEN_FUNCTION_DIFFERENCE); } +simplify { MS_LEXER_RETURN_TOKEN(MS_TOKEN_FUNCTION_SIMPLIFY); } +simplifypt { MS_LEXER_RETURN_TOKEN(MS_TOKEN_FUNCTION_SIMPLIFYPT); } +generalize { MS_LEXER_RETURN_TOKEN(MS_TOKEN_FUNCTION_GENERALIZE); } +smoothsia { MS_LEXER_RETURN_TOKEN(MS_TOKEN_FUNCTION_SMOOTHSIA); } +javascript { MS_LEXER_RETURN_TOKEN(MS_TOKEN_FUNCTION_JAVASCRIPT); } + +intersects { MS_LEXER_RETURN_TOKEN(MS_TOKEN_COMPARISON_INTERSECTS); } +disjoint { MS_LEXER_RETURN_TOKEN(MS_TOKEN_COMPARISON_DISJOINT); } +touches { MS_LEXER_RETURN_TOKEN(MS_TOKEN_COMPARISON_TOUCHES); } +overlaps { MS_LEXER_RETURN_TOKEN(MS_TOKEN_COMPARISON_OVERLAPS); } +crosses { MS_LEXER_RETURN_TOKEN(MS_TOKEN_COMPARISON_CROSSES); } +within { MS_LEXER_RETURN_TOKEN(MS_TOKEN_COMPARISON_WITHIN); } +contains { MS_LEXER_RETURN_TOKEN(MS_TOKEN_COMPARISON_CONTAINS); } +equals { MS_LEXER_RETURN_TOKEN(MS_TOKEN_COMPARISON_EQUALS); } +beyond { MS_LEXER_RETURN_TOKEN(MS_TOKEN_COMPARISON_BEYOND); } +dwithin { MS_LEXER_RETURN_TOKEN(MS_TOKEN_COMPARISON_DWITHIN); } + +fromtext { MS_LEXER_RETURN_TOKEN(MS_TOKEN_FUNCTION_FROMTEXT); } + +true { msyynumber=MS_TRUE; return(MS_TOKEN_LITERAL_BOOLEAN); } +false { msyynumber=MS_FALSE; return(MS_TOKEN_LITERAL_BOOLEAN); } + +colorrange { MS_LEXER_RETURN_TOKEN(COLORRANGE); } +datarange { MS_LEXER_RETURN_TOKEN(DATARANGE); } +rangeitem { MS_LEXER_RETURN_TOKEN(RANGEITEM); } + +align { MS_LEXER_RETURN_TOKEN(ALIGN); } +anchorpoint { MS_LEXER_RETURN_TOKEN(ANCHORPOINT); } +angle { MS_LEXER_RETURN_TOKEN(ANGLE); } +antialias { MS_LEXER_RETURN_TOKEN(ANTIALIAS); } +backgroundcolor { MS_LEXER_RETURN_TOKEN(BACKGROUNDCOLOR); } +bandsitem { MS_LEXER_RETURN_TOKEN(BANDSITEM); } +bindvals { MS_LEXER_RETURN_TOKEN(BINDVALS); } +\xEF\xBB\xBF { MS_LEXER_RETURN_TOKEN(BOM); } +browseformat { MS_LEXER_RETURN_TOKEN(BROWSEFORMAT); } +buffer { MS_LEXER_RETURN_TOKEN(BUFFER); } +character { MS_LEXER_RETURN_TOKEN(CHARACTER); } +class { MS_LEXER_RETURN_TOKEN(CLASS); } +classitem { MS_LEXER_RETURN_TOKEN(CLASSITEM); } +classgroup { MS_LEXER_RETURN_TOKEN(CLASSGROUP); } +cluster { MS_LEXER_RETURN_TOKEN(CLUSTER); } +color { MS_LEXER_RETURN_TOKEN(COLOR); } +compfilter { MS_LEXER_RETURN_TOKEN(COMPFILTER); } +composite { MS_LEXER_RETURN_TOKEN(COMPOSITE); } +compop { MS_LEXER_RETURN_TOKEN(COMPOP); } +config { MS_LEXER_RETURN_TOKEN(CONFIG); } +connection { MS_LEXER_RETURN_TOKEN(CONNECTION); } +connectiontype { MS_LEXER_RETURN_TOKEN(CONNECTIONTYPE); } +data { MS_LEXER_RETURN_TOKEN(DATA); } +datapattern { MS_LEXER_RETURN_TOKEN(DATAPATTERN); } +debug { MS_LEXER_RETURN_TOKEN(DEBUG); } +driver { MS_LEXER_RETURN_TOKEN(DRIVER); } +dump { MS_LEXER_RETURN_TOKEN(DUMP); } +empty { MS_LEXER_RETURN_TOKEN(EMPTY); } +encoding { MS_LEXER_RETURN_TOKEN(ENCODING); } +end { MS_LEXER_RETURN_TOKEN(END); } +error { MS_LEXER_RETURN_TOKEN(ERROR); } +expression { MS_LEXER_RETURN_TOKEN(EXPRESSION); } +extent { MS_LEXER_RETURN_TOKEN(EXTENT); } +extension { MS_LEXER_RETURN_TOKEN(EXTENSION); } +feature { MS_LEXER_RETURN_TOKEN(FEATURE); } +filled { MS_LEXER_RETURN_TOKEN(FILLED); } +filter { MS_LEXER_RETURN_TOKEN(FILTER); } +filteritem { MS_LEXER_RETURN_TOKEN(FILTERITEM); } +footer { MS_LEXER_RETURN_TOKEN(FOOTER); } +font { MS_LEXER_RETURN_TOKEN(FONT); } +fontset { MS_LEXER_RETURN_TOKEN(FONTSET); } +force { MS_LEXER_RETURN_TOKEN(FORCE); } +formatoption { MS_LEXER_RETURN_TOKEN(FORMATOPTION); } +from { MS_LEXER_RETURN_TOKEN(FROM); } +gap { MS_LEXER_RETURN_TOKEN(GAP); } +geomtransform { MS_LEXER_RETURN_TOKEN(GEOMTRANSFORM); } +grid { MS_LEXER_RETURN_TOKEN(GRID); } +gridstep { MS_LEXER_RETURN_TOKEN(GRIDSTEP); } +graticule { MS_LEXER_RETURN_TOKEN(GRATICULE); } +group { MS_LEXER_RETURN_TOKEN(GROUP); } +header { MS_LEXER_RETURN_TOKEN(HEADER); } +image { MS_LEXER_RETURN_TOKEN(IMAGE); } +imagecolor { MS_LEXER_RETURN_TOKEN(IMAGECOLOR); } +imagetype { MS_LEXER_RETURN_TOKEN(IMAGETYPE); } +imagequality { MS_LEXER_RETURN_TOKEN(IMAGEQUALITY); } +imagemode { MS_LEXER_RETURN_TOKEN(IMAGEMODE); } +imagepath { MS_LEXER_RETURN_TOKEN(IMAGEPATH); } +temppath { MS_LEXER_RETURN_TOKEN(TEMPPATH); } +imageurl { MS_LEXER_RETURN_TOKEN(IMAGEURL); } +include { BEGIN(INCLUDE); } +index { MS_LEXER_RETURN_TOKEN(INDEX); } +initialgap { MS_LEXER_RETURN_TOKEN(INITIALGAP); } +interlace { MS_LEXER_RETURN_TOKEN(INTERLACE); } +intervals { MS_LEXER_RETURN_TOKEN(INTERVALS); } +join { MS_LEXER_RETURN_TOKEN(JOIN); } +keyimage { MS_LEXER_RETURN_TOKEN(KEYIMAGE); } +keysize { MS_LEXER_RETURN_TOKEN(KEYSIZE); } +keyspacing { MS_LEXER_RETURN_TOKEN(KEYSPACING); } +label { MS_LEXER_RETURN_TOKEN(LABEL); } +labelcache { MS_LEXER_RETURN_TOKEN(LABELCACHE); } +labelformat { MS_LEXER_RETURN_TOKEN(LABELFORMAT); } +labelitem { MS_LEXER_RETURN_TOKEN(LABELITEM); } +labelmaxscale { MS_LEXER_RETURN_TOKEN(LABELMAXSCALE); } +labelmaxscaledenom { MS_LEXER_RETURN_TOKEN(LABELMAXSCALEDENOM); } +labelminscale { MS_LEXER_RETURN_TOKEN(LABELMINSCALE); } +labelminscaledenom { MS_LEXER_RETURN_TOKEN(LABELMINSCALEDENOM); } +labelrequires { MS_LEXER_RETURN_TOKEN(LABELREQUIRES); } +latlon { MS_LEXER_RETURN_TOKEN(LATLON); } +layer { MS_LEXER_RETURN_TOKEN(LAYER); } +leader { MS_LEXER_RETURN_TOKEN(LEADER); } +legend { MS_LEXER_RETURN_TOKEN(LEGEND); } +legendformat { MS_LEXER_RETURN_TOKEN(LEGENDFORMAT); } +linecap { MS_LEXER_RETURN_TOKEN(LINECAP); } +linejoin { MS_LEXER_RETURN_TOKEN(LINEJOIN); } +linejoinmaxsize { MS_LEXER_RETURN_TOKEN(LINEJOINMAXSIZE); } +log { MS_LEXER_RETURN_TOKEN(LOG); } +map { MS_LEXER_RETURN_TOKEN(MAP); } +marker { MS_LEXER_RETURN_TOKEN(MARKER); } +markersize { MS_LEXER_RETURN_TOKEN(MARKERSIZE); } +mask { MS_LEXER_RETURN_TOKEN(MASK); } +maxarcs { MS_LEXER_RETURN_TOKEN(MAXARCS); } +maxboxsize { MS_LEXER_RETURN_TOKEN(MAXBOXSIZE); } +maxdistance { MS_LEXER_RETURN_TOKEN(MAXDISTANCE); } +maxfeatures { MS_LEXER_RETURN_TOKEN(MAXFEATURES); } +maxinterval { MS_LEXER_RETURN_TOKEN(MAXINTERVAL); } +maxscale { MS_LEXER_RETURN_TOKEN(MAXSCALE); } +maxscaledenom { MS_LEXER_RETURN_TOKEN(MAXSCALEDENOM); } +maxgeowidth { MS_LEXER_RETURN_TOKEN(MAXGEOWIDTH); } +maxlength { MS_LEXER_RETURN_TOKEN(MAXLENGTH); } +maxsize { MS_LEXER_RETURN_TOKEN(MAXSIZE); } +maxsubdivide { MS_LEXER_RETURN_TOKEN(MAXSUBDIVIDE); } +maxtemplate { MS_LEXER_RETURN_TOKEN(MAXTEMPLATE); } +maxwidth { MS_LEXER_RETURN_TOKEN(MAXWIDTH); } +metadata { MS_LEXER_RETURN_TOKEN(METADATA); } +mimetype { MS_LEXER_RETURN_TOKEN(MIMETYPE); } +minarcs { MS_LEXER_RETURN_TOKEN(MINARCS); } +minboxsize { MS_LEXER_RETURN_TOKEN(MINBOXSIZE); } +mindistance { MS_LEXER_RETURN_TOKEN(MINDISTANCE); } +repeatdistance { MS_LEXER_RETURN_TOKEN(REPEATDISTANCE); } +maxoverlapangle { MS_LEXER_RETURN_TOKEN(MAXOVERLAPANGLE); } +minfeaturesize { MS_LEXER_RETURN_TOKEN(MINFEATURESIZE); } +mininterval { MS_LEXER_RETURN_TOKEN(MININTERVAL); } +minscale { MS_LEXER_RETURN_TOKEN(MINSCALE); } +minscaledenom { MS_LEXER_RETURN_TOKEN(MINSCALEDENOM); } +mingeowidth { MS_LEXER_RETURN_TOKEN(MINGEOWIDTH); } +minlength { MS_LEXER_RETURN_TOKEN(MINLENGTH); } +minsize { MS_LEXER_RETURN_TOKEN(MINSIZE); } +minsubdivide { MS_LEXER_RETURN_TOKEN(MINSUBDIVIDE); } +mintemplate { MS_LEXER_RETURN_TOKEN(MINTEMPLATE); } +minwidth { MS_LEXER_RETURN_TOKEN(MINWIDTH); } +name { MS_LEXER_RETURN_TOKEN(NAME); } +offset { MS_LEXER_RETURN_TOKEN(OFFSET); } +offsite { MS_LEXER_RETURN_TOKEN(OFFSITE); } +opacity { MS_LEXER_RETURN_TOKEN(OPACITY); } +outlinecolor { MS_LEXER_RETURN_TOKEN(OUTLINECOLOR); } +outlinewidth { MS_LEXER_RETURN_TOKEN(OUTLINEWIDTH); } +outputformat { MS_LEXER_RETURN_TOKEN(OUTPUTFORMAT); } +overlaybackgroundcolor { MS_LEXER_RETURN_TOKEN(OVERLAYBACKGROUNDCOLOR); } +overlaycolor { MS_LEXER_RETURN_TOKEN(OVERLAYCOLOR); } +overlaymaxsize { MS_LEXER_RETURN_TOKEN(OVERLAYMAXSIZE); } +overlayminsize { MS_LEXER_RETURN_TOKEN(OVERLAYMINSIZE); } +overlayoutlinecolor { MS_LEXER_RETURN_TOKEN(OVERLAYOUTLINECOLOR); } +overlaysize { MS_LEXER_RETURN_TOKEN(OVERLAYSIZE); } +overlaysymbol { MS_LEXER_RETURN_TOKEN(OVERLAYSYMBOL); } +partials { MS_LEXER_RETURN_TOKEN(PARTIALS); } +pattern { MS_LEXER_RETURN_TOKEN(PATTERN); } +points { MS_LEXER_RETURN_TOKEN(POINTS); } +items { MS_LEXER_RETURN_TOKEN(ITEMS); } +position { MS_LEXER_RETURN_TOKEN(POSITION); } +postlabelcache { MS_LEXER_RETURN_TOKEN(POSTLABELCACHE); } +priority { MS_LEXER_RETURN_TOKEN(PRIORITY); } +processing { MS_LEXER_RETURN_TOKEN(PROCESSING); } +projection { MS_LEXER_RETURN_TOKEN(PROJECTION); } +queryformat { MS_LEXER_RETURN_TOKEN(QUERYFORMAT); } +querymap { MS_LEXER_RETURN_TOKEN(QUERYMAP); } +reference { MS_LEXER_RETURN_TOKEN(REFERENCE); } +region { MS_LEXER_RETURN_TOKEN(REGION); } +relativeto { MS_LEXER_RETURN_TOKEN(RELATIVETO); } +requires { MS_LEXER_RETURN_TOKEN(REQUIRES); } +resolution { MS_LEXER_RETURN_TOKEN(RESOLUTION); } +defresolution { MS_LEXER_RETURN_TOKEN(DEFRESOLUTION); } +scale { MS_LEXER_RETURN_TOKEN(SCALE); } +scaledenom { MS_LEXER_RETURN_TOKEN(SCALEDENOM); } +scalebar { MS_LEXER_RETURN_TOKEN(SCALEBAR); } +scaletoken { MS_LEXER_RETURN_TOKEN(SCALETOKEN); } +shadowcolor { MS_LEXER_RETURN_TOKEN(SHADOWCOLOR); } +shadowsize { MS_LEXER_RETURN_TOKEN(SHADOWSIZE); } +shapepath { MS_LEXER_RETURN_TOKEN(SHAPEPATH); } +size { MS_LEXER_RETURN_TOKEN(SIZE); } +sizeunits { MS_LEXER_RETURN_TOKEN(SIZEUNITS); } +status { MS_LEXER_RETURN_TOKEN(STATUS); } +style { MS_LEXER_RETURN_TOKEN(STYLE); } +styleitem { MS_LEXER_RETURN_TOKEN(STYLEITEM); } +symbol { MS_LEXER_RETURN_TOKEN(SYMBOL); } +symbolscale { MS_LEXER_RETURN_TOKEN(SYMBOLSCALE); } +symbolscaledenom { MS_LEXER_RETURN_TOKEN(SYMBOLSCALEDENOM); } +symbolset { MS_LEXER_RETURN_TOKEN(SYMBOLSET); } +table { MS_LEXER_RETURN_TOKEN(TABLE); } +template { MS_LEXER_RETURN_TOKEN(TEMPLATE); } +templatepattern { MS_LEXER_RETURN_TOKEN(TEMPLATEPATTERN); } +text { MS_LEXER_RETURN_TOKEN(TEXT); } +tileindex { MS_LEXER_RETURN_TOKEN(TILEINDEX); } +tileitem { MS_LEXER_RETURN_TOKEN(TILEITEM); } +tilesrs { MS_LEXER_RETURN_TOKEN(TILESRS); } +title { MS_LEXER_RETURN_TOKEN(TITLE); } +to { MS_LEXER_RETURN_TOKEN(TO); } +tolerance { MS_LEXER_RETURN_TOKEN(TOLERANCE); } +toleranceunits { MS_LEXER_RETURN_TOKEN(TOLERANCEUNITS); } +transparency { MS_LEXER_RETURN_TOKEN(TRANSPARENCY); } +transparent { MS_LEXER_RETURN_TOKEN(TRANSPARENT); } +transform { MS_LEXER_RETURN_TOKEN(TRANSFORM); } +type { MS_LEXER_RETURN_TOKEN(TYPE); } +units { MS_LEXER_RETURN_TOKEN(UNITS); } +utfdata { MS_LEXER_RETURN_TOKEN(UTFDATA); } +utfitem { MS_LEXER_RETURN_TOKEN(UTFITEM); } +validation { MS_LEXER_RETURN_TOKEN(VALIDATION); } +values { MS_LEXER_RETURN_TOKEN(VALUES); } +web { MS_LEXER_RETURN_TOKEN(WEB); } +width { MS_LEXER_RETURN_TOKEN(WIDTH); } +wkt { MS_LEXER_RETURN_TOKEN(WKT); } +wrap { MS_LEXER_RETURN_TOKEN(WRAP); } + +annotation { MS_LEXER_RETURN_TOKEN(MS_LAYER_ANNOTATION); } +auto { MS_LEXER_RETURN_TOKEN(MS_AUTO); } +auto2 { MS_LEXER_RETURN_TOKEN(MS_AUTO2); } +bevel { MS_LEXER_RETURN_TOKEN(MS_CJC_BEVEL); } +bitmap { MS_LEXER_RETURN_TOKEN(MS_BITMAP); } +butt { MS_LEXER_RETURN_TOKEN(MS_CJC_BUTT); } +cc { MS_LEXER_RETURN_TOKEN(MS_CC); } +center { MS_LEXER_RETURN_TOKEN(MS_ALIGN_CENTER); } +chart { MS_LEXER_RETURN_TOKEN(MS_LAYER_CHART); } +circle { MS_LEXER_RETURN_TOKEN(MS_LAYER_CIRCLE); } +cl { MS_LEXER_RETURN_TOKEN(MS_CL); } +cr { MS_LEXER_RETURN_TOKEN(MS_CR); } +csv { MS_LEXER_RETURN_TOKEN(MS_DB_CSV); } +postgresql { MS_LEXER_RETURN_TOKEN(MS_DB_POSTGRES); } +mysql { MS_LEXER_RETURN_TOKEN(MS_DB_MYSQL); } +default { MS_LEXER_RETURN_TOKEN(MS_DEFAULT); } +dd { MS_LEXER_RETURN_TOKEN(MS_DD); } +ellipse { MS_LEXER_RETURN_TOKEN(MS_SYMBOL_ELLIPSE); } +embed { MS_LEXER_RETURN_TOKEN(MS_EMBED); } +false { MS_LEXER_RETURN_TOKEN(MS_FALSE); } +feet { MS_LEXER_RETURN_TOKEN(MS_FEET); } +follow { MS_LEXER_RETURN_TOKEN(MS_FOLLOW); } +giant { MS_LEXER_RETURN_TOKEN(MS_GIANT); } +hatch { MS_LEXER_RETURN_TOKEN(MS_SYMBOL_HATCH); } +kerneldensity { MS_LEXER_RETURN_TOKEN(MS_KERNELDENSITY); } +hilite { MS_LEXER_RETURN_TOKEN(MS_HILITE); } +inches { MS_LEXER_RETURN_TOKEN(MS_INCHES); } +kilometers { MS_LEXER_RETURN_TOKEN(MS_KILOMETERS); } +large { MS_LEXER_RETURN_TOKEN(MS_LARGE); } +lc { MS_LEXER_RETURN_TOKEN(MS_LC); } +left { MS_LEXER_RETURN_TOKEN(MS_ALIGN_LEFT); } +line { MS_LEXER_RETURN_TOKEN(MS_LAYER_LINE); } +ll { MS_LEXER_RETURN_TOKEN(MS_LL); } +lr { MS_LEXER_RETURN_TOKEN(MS_LR); } +medium { MS_LEXER_RETURN_TOKEN(MS_MEDIUM); } +meters { MS_LEXER_RETURN_TOKEN(MS_METERS); } +nauticalmiles { MS_LEXER_RETURN_TOKEN(MS_NAUTICALMILES); } +miles { MS_LEXER_RETURN_TOKEN(MS_MILES); } +miter { MS_LEXER_RETURN_TOKEN(MS_CJC_MITER); } +multiple { MS_LEXER_RETURN_TOKEN(MS_MULTIPLE); } +none { MS_LEXER_RETURN_TOKEN(MS_CJC_NONE); } +normal { MS_LEXER_RETURN_TOKEN(MS_NORMAL); } +off { MS_LEXER_RETURN_TOKEN(MS_OFF); } +ogr { MS_LEXER_RETURN_TOKEN(MS_OGR); } +on { MS_LEXER_RETURN_TOKEN(MS_ON); } +one-to-one { MS_LEXER_RETURN_TOKEN(MS_JOIN_ONE_TO_ONE); } +one-to-many { MS_LEXER_RETURN_TOKEN(MS_JOIN_ONE_TO_MANY); } +oraclespatial { MS_LEXER_RETURN_TOKEN(MS_ORACLESPATIAL); } +percentages { MS_LEXER_RETURN_TOKEN(MS_PERCENTAGES); } +pixmap { MS_LEXER_RETURN_TOKEN(MS_SYMBOL_PIXMAP); } +pixels { MS_LEXER_RETURN_TOKEN(MS_PIXELS); } +point { MS_LEXER_RETURN_TOKEN(MS_LAYER_POINT); } +polygon { MS_LEXER_RETURN_TOKEN(MS_LAYER_POLYGON); } +postgis { MS_LEXER_RETURN_TOKEN(MS_POSTGIS); } +plugin { MS_LEXER_RETURN_TOKEN(MS_PLUGIN); } +query { MS_LEXER_RETURN_TOKEN(MS_LAYER_QUERY); } +raster { MS_LEXER_RETURN_TOKEN(MS_LAYER_RASTER); } +right { MS_LEXER_RETURN_TOKEN(MS_ALIGN_RIGHT); } +round { MS_LEXER_RETURN_TOKEN(MS_CJC_ROUND); } +selected { MS_LEXER_RETURN_TOKEN(MS_SELECTED); } +simple { MS_LEXER_RETURN_TOKEN(MS_SYMBOL_SIMPLE); } +single { MS_LEXER_RETURN_TOKEN(MS_SINGLE); } +small { MS_LEXER_RETURN_TOKEN(MS_SMALL); } +square { MS_LEXER_RETURN_TOKEN(MS_CJC_SQUARE); } +svg { MS_LEXER_RETURN_TOKEN(MS_SYMBOL_SVG); } +polaroffset { MS_LEXER_RETURN_TOKEN(POLAROFFSET); } +tiny { MS_LEXER_RETURN_TOKEN(MS_TINY); } +triangle { MS_LEXER_RETURN_TOKEN(MS_CJC_TRIANGLE); } +true { MS_LEXER_RETURN_TOKEN(MS_TRUE); } +truetype { MS_LEXER_RETURN_TOKEN(MS_TRUETYPE); } +uc { MS_LEXER_RETURN_TOKEN(MS_UC); } +ul { MS_LEXER_RETURN_TOKEN(MS_UL); } +ur { MS_LEXER_RETURN_TOKEN(MS_UR); } +union { MS_LEXER_RETURN_TOKEN(MS_UNION); } +uvraster { MS_LEXER_RETURN_TOKEN(MS_UVRASTER); } +contour { MS_LEXER_RETURN_TOKEN(MS_CONTOUR); } +vector { MS_LEXER_RETURN_TOKEN(MS_SYMBOL_VECTOR); } +wfs { MS_LEXER_RETURN_TOKEN(MS_WFS); } +wms { MS_LEXER_RETURN_TOKEN(MS_WMS); } + +\[[a-z/\.][a-z0-9/:\.\-\=_ ]*\] { + msyytext++; + msyytext[strlen(msyytext)-1] = '\0'; + MS_LEXER_STRING_REALLOC(msyystring_buffer, strlen(msyytext), + msyystring_buffer_size, msyystring_buffer_ptr); + strcpy(msyystring_buffer,msyytext); + return(MS_STRING); + } +\[[0-9]*\] { + msyytext++; + msyytext[strlen(msyytext)-1] = '\0'; + MS_LEXER_STRING_REALLOC(msyystring_buffer, strlen(msyytext), + msyystring_buffer_size, msyystring_buffer_ptr); + strcpy(msyystring_buffer,msyytext); + msyynumber = atof(msyytext); + return(MS_NUMBER); + } + +\[[^\]]*\] { + msyytext++; + msyytext[strlen(msyytext)-1] = '\0'; + MS_LEXER_STRING_REALLOC(msyystring_buffer, strlen(msyytext), + msyystring_buffer_size, msyystring_buffer_ptr); + strcpy(msyystring_buffer,msyytext); + return(MS_BINDING); + } + +\[shape\] { + /* attribute binding - shape (fixed value) */ + return(MS_TOKEN_BINDING_SHAPE); +} +\[map_cellsize\] { + /* attribute binding - map cellsize */ + return(MS_TOKEN_BINDING_MAP_CELLSIZE); +} +\[data_cellsize\] { + /* attribute binding - data cellsize */ + return(MS_TOKEN_BINDING_DATA_CELLSIZE); +} +\[[^\]]*\] { + /* attribute binding - numeric (no quotes) */ + msyytext++; + msyytext[strlen(msyytext)-1] = '\0'; + MS_LEXER_STRING_REALLOC(msyystring_buffer, strlen(msyytext), + msyystring_buffer_size, msyystring_buffer_ptr); + strcpy(msyystring_buffer, msyytext); + return(MS_TOKEN_BINDING_DOUBLE); +} +\"\[[^\"]*\]\"|\'\[[^\']*\]\' { + /* attribute binding - string (single or double quotes) */ + msyytext+=2; + msyytext[strlen(msyytext)-2] = '\0'; + MS_LEXER_STRING_REALLOC(msyystring_buffer, strlen(msyytext), + msyystring_buffer_size, msyystring_buffer_ptr); + strcpy(msyystring_buffer, msyytext); + return(MS_TOKEN_BINDING_STRING); +} +\`\[[^\`]*\]\` { + /* attribute binding - time */ + msyytext+=2; + msyytext[strlen(msyytext)-2] = '\0'; + MS_LEXER_STRING_REALLOC(msyystring_buffer, strlen(msyytext), + msyystring_buffer_size, msyystring_buffer_ptr); + strcpy(msyystring_buffer, msyytext); + return(MS_TOKEN_BINDING_TIME); +} + +-?[0-9]+|-?[0-9]+\.[0-9]*|-?\.[0-9]*|-?[0-9]+[eE][+-]?[0-9]+|-?[0-9]+\.[0-9]*[eE][+-]?[0-9]+|-?\.[0-9]*[eE][+-]?[0-9]+ { + MS_LEXER_STRING_REALLOC(msyystring_buffer, strlen(msyytext), + msyystring_buffer_size, msyystring_buffer_ptr); + strcpy(msyystring_buffer,msyytext); + msyynumber = atof(msyytext); + return(MS_NUMBER); +} + +-?[0-9]+|-?[0-9]+\.[0-9]*|-?\.[0-9]*|-?[0-9]+[eE][+-]?[0-9]+|-?[0-9]+\.[0-9]*[eE][+-]?[0-9]+|-?\.[0-9]*[eE][+-]?[0-9]+ { + MS_LEXER_STRING_REALLOC(msyystring_buffer, strlen(msyytext), + msyystring_buffer_size, msyystring_buffer_ptr); + strcpy(msyystring_buffer,msyytext); + msyynumber = atof(msyytext); + return(MS_TOKEN_LITERAL_NUMBER); +} + +\`[^\`]*\` { + msyytext++; + msyytext[strlen(msyytext)-1] = '\0'; + MS_LEXER_STRING_REALLOC(msyystring_buffer, strlen(msyytext), + msyystring_buffer_size, msyystring_buffer_ptr); + strcpy(msyystring_buffer, msyytext); + return(MS_TOKEN_LITERAL_TIME); +} + +\/[^\/*]*\/i { + msyytext++; + msyytext[strlen(msyytext)-2] = '\0'; + MS_LEXER_STRING_REALLOC(msyystring_buffer, strlen(msyytext), + msyystring_buffer_size, msyystring_buffer_ptr); + strcpy(msyystring_buffer, msyytext); + return(MS_IREGEX); + } + +\/[^\/*]*\/ { + msyytext++; + msyytext[strlen(msyytext)-1] = '\0'; + MS_LEXER_STRING_REALLOC(msyystring_buffer, strlen(msyytext), + msyystring_buffer_size, msyystring_buffer_ptr); + strcpy(msyystring_buffer, msyytext); + return(MS_REGEX); + } + +\(.*\) { + msyytext++; + msyytext[strlen(msyytext)-1] = '\0'; + MS_LEXER_STRING_REALLOC(msyystring_buffer, strlen(msyytext), + msyystring_buffer_size, msyystring_buffer_ptr); + strcpy(msyystring_buffer, msyytext); + return(MS_EXPRESSION); + } + +\{.*\} { + msyytext++; + msyytext[strlen(msyytext)-1] = '\0'; + MS_LEXER_STRING_REALLOC(msyystring_buffer, strlen(msyytext), + msyystring_buffer_size, msyystring_buffer_ptr); + strcpy(msyystring_buffer, msyytext); + return(MS_LIST); + } + +\'|\" { + msyystring_return_state = MS_STRING; + msyystring_begin = msyytext[0]; + msyystring_size = 0; + msyystring_buffer_ptr = msyystring_buffer; + BEGIN(MSSTRING); + } + +\'|\"|\"i|\'i { + MS_LEXER_STRING_REALLOC(msyystring_buffer, msyystring_size, + msyystring_buffer_size, msyystring_buffer_ptr); + if (msyystring_begin == msyytext[0]) { + BEGIN(msyystring_begin_state); + + *msyystring_buffer_ptr = '\0'; + + if (msyystring_return_state == MS_STRING) { + if (msyystring_icase && strlen(msyytext)==2) { + msyystring_icase = MS_FALSE; // reset + return MS_ISTRING; + } else + return MS_STRING; + } + return msyystring_return_state; + + } + else { + ++msyystring_size; + *msyystring_buffer_ptr++ = *msyytext; + if (strlen(msyytext)==2) { + MS_LEXER_STRING_REALLOC(msyystring_buffer, msyystring_size, + msyystring_buffer_size, msyystring_buffer_ptr); + ++msyystring_size; + *msyystring_buffer_ptr++ = msyytext[1]; + } + } + } + +\\\'|\\\"|\\\\|\\ { + MS_LEXER_STRING_REALLOC(msyystring_buffer, msyystring_size, + msyystring_buffer_size, msyystring_buffer_ptr); + + ++msyystring_size; + if (strlen(msyytext) == 2) + *msyystring_buffer_ptr++ = msyytext[1]; + else + *msyystring_buffer_ptr++ = msyytext[0]; + } + +[^\\\'\\\"]+ { + char *yptr = msyytext; + while ( *yptr ) { + MS_LEXER_STRING_REALLOC(msyystring_buffer, msyystring_size, + msyystring_buffer_size, msyystring_buffer_ptr); + ++msyystring_size; + *msyystring_buffer_ptr++ = *yptr++; + } + } + +\"[^\"]*\"|\'[^\']*\' { + msyytext++; + msyytext[strlen(msyytext)-1] = '\0'; + + if(include_stack_ptr >= MAX_INCLUDE_DEPTH) { + msSetError(MS_IOERR, "Includes nested to deeply.", "msyylex()"); + return(-1); + } + + include_stack[include_stack_ptr] = YY_CURRENT_BUFFER; /* save state */ + include_lineno[include_stack_ptr] = msyylineno; + include_stack_ptr++; + + msyyin = fopen(msBuildPath(path, msyybasepath, msyytext), "r"); + if(!msyyin) { + msSetError(MS_IOERR, "Error opening included file \"%s\".", "msyylex()", msyytext); + msyyin = YY_CURRENT_BUFFER->yy_input_file; + return(-1); + } + + msyy_switch_to_buffer( msyy_create_buffer(msyyin, YY_BUF_SIZE) ); + msyylineno = 1; + + BEGIN(INITIAL); + } + +\'|\" { + msyystring_return_state = MS_TOKEN_LITERAL_STRING; + msyystring_begin = msyytext[0]; + msyystring_size = 0; + msyystring_buffer_ptr = msyystring_buffer; + BEGIN(MSSTRING); + } + +[a-z/\.][a-z0-9/\._\-\=]* { + MS_LEXER_STRING_REALLOC(msyystring_buffer, strlen(msyytext), + msyystring_buffer_size, msyystring_buffer_ptr); + strcpy(msyystring_buffer, msyytext); + return(MS_STRING); + } + +\n { msyylineno++; } + +<> { + if( --include_stack_ptr < 0 ) + return(EOF); /* end of main file */ + else { + fclose(YY_CURRENT_BUFFER->yy_input_file); + msyy_delete_buffer( YY_CURRENT_BUFFER ); + msyy_switch_to_buffer(include_stack[include_stack_ptr]); + msyylineno = include_lineno[include_stack_ptr]; + } + } + +[\r|\n|\0] { + return(0); +} + +. { + MS_LEXER_STRING_REALLOC(msyystring_buffer, strlen(msyytext), + msyystring_buffer_size, msyystring_buffer_ptr); + strcpy(msyystring_buffer, msyytext); + return(0); + } +. { return(msyytext[0]); } +%% + +/* +** Any extra C functions +*/ + +int msyywrap() /* override */ +{ + return(1); +} + +int msyyerror(char *s) { + msSetError(MS_PARSEERR, "%s", "msyyparse()", s); + return(0); +} diff -Nru mapserver-7.0.7+6/mapparser.y mapserver-7.2.0+1/mapparser.y --- mapserver-7.0.7+6/mapparser.y 1970-01-01 00:00:00.000000000 +0000 +++ mapserver-7.2.0+1/mapparser.y 2018-07-30 22:03:46.000000000 +0000 @@ -0,0 +1,912 @@ +/* +** Parser for the mapserver +*/ + +%{ +/* C declarations */ +#include +#include +#include +#include +#include + +#include "mapserver.h" /* for TRUE/FALSE and REGEX includes */ +#include "maptime.h" /* for time comparison routines */ +#include "mapprimitive.h" /* for shapeObj */ + +#include "mapparser.h" /* for YYSTYPE in the function prototype for yylex() */ + +int yylex(YYSTYPE *, parseObj *); /* prototype functions, defined after the grammar */ +int yyerror(parseObj *, const char *); +%} + +/* Bison/Yacc declarations */ + +/* %define api.pure */ +%pure_parser +%parse-param {parseObj *p} +%lex-param {parseObj *p} + +%union { + double dblval; + int intval; + char *strval; + struct tm tmval; + shapeObj *shpval; +} + +%token BOOLEAN +%token NUMBER +%token STRING +%token TIME +%token SHAPE + +%left OR +%left AND +%left NOT +%left RE EQ NE LT GT LE GE IN IEQ IRE +%left INTERSECTS DISJOINT TOUCHES OVERLAPS CROSSES WITHIN CONTAINS EQUALS BEYOND DWITHIN +%left AREA LENGTH COMMIFY ROUND +%left UPPER LOWER INITCAP FIRSTCAP +%left TOSTRING +%left YYBUFFER DIFFERENCE SIMPLIFY SIMPLIFYPT GENERALIZE SMOOTHSIA JAVASCRIPT +%left '+' '-' +%left '*' '/' '%' +%left NEG +%right '^' + +%type logical_exp +%type math_exp +%type string_exp +%type time_exp +%type shape_exp + +/* Bison/Yacc grammar */ + +%% + +input: /* empty string */ + | logical_exp { + switch(p->type) { + case(MS_PARSE_TYPE_BOOLEAN): + p->result.intval = $1; + break; + case(MS_PARSE_TYPE_STRING): + if($1) + p->result.strval = msStrdup("true"); + else + p->result.strval = msStrdup("false"); + break; + } + } + | math_exp { + switch(p->type) { + case(MS_PARSE_TYPE_BOOLEAN): + if($1 != 0) + p->result.intval = MS_TRUE; + else + p->result.intval = MS_FALSE; + break; + case(MS_PARSE_TYPE_STRING): + p->result.strval = (char *)malloc(64); /* large enough for a double */ + snprintf(p->result.strval, 64, "%g", $1); + break; + } + } + | string_exp { + switch(p->type) { + case(MS_PARSE_TYPE_BOOLEAN): + if($1) /* string is not NULL */ + p->result.intval = MS_TRUE; + else + p->result.intval = MS_FALSE; + break; + case(MS_PARSE_TYPE_STRING): + p->result.strval = $1; // msStrdup($1); + break; + } + } + | shape_exp { + switch(p->type) { + case(MS_PARSE_TYPE_SHAPE): + p->result.shpval = $1; + p->result.shpval->scratch = MS_FALSE; + break; + } + } +; + +logical_exp: BOOLEAN + | '(' logical_exp ')' { $$ = $2; } + | logical_exp EQ logical_exp { + $$ = MS_FALSE; + if($1 == $3) $$ = MS_TRUE; + } + | logical_exp OR logical_exp { + if($1 == MS_TRUE) + $$ = MS_TRUE; + else if($3 == MS_TRUE) + $$ = MS_TRUE; + else + $$ = MS_FALSE; + } + | logical_exp AND logical_exp { + if($1 == MS_TRUE) { + if($3 == MS_TRUE) + $$ = MS_TRUE; + else + $$ = MS_FALSE; + } else + $$ = MS_FALSE; + } + | logical_exp OR math_exp { + if($1 == MS_TRUE) + $$ = MS_TRUE; + else if($3 != 0) + $$ = MS_TRUE; + else + $$ = MS_FALSE; + } + | logical_exp AND math_exp { + if($1 == MS_TRUE) { + if($3 != 0) + $$ = MS_TRUE; + else + $$ = MS_FALSE; + } else + $$ = MS_FALSE; + } + | math_exp OR logical_exp { + if($1 != 0) + $$ = MS_TRUE; + else if($3 == MS_TRUE) + $$ = MS_TRUE; + else + $$ = MS_FALSE; + } + | math_exp AND logical_exp { + if($1 != 0) { + if($3 == MS_TRUE) + $$ = MS_TRUE; + else + $$ = MS_FALSE; + } else + $$ = MS_FALSE; + } + | math_exp OR math_exp { + if($1 != 0) + $$ = MS_TRUE; + else if($3 != 0) + $$ = MS_TRUE; + else + $$ = MS_FALSE; + } + | math_exp AND math_exp { + if($1 != 0) { + if($3 != 0) + $$ = MS_TRUE; + else + $$ = MS_FALSE; + } else + $$ = MS_FALSE; + } + | NOT logical_exp { $$ = !$2; } + | NOT math_exp { $$ = !$2; } + | string_exp RE string_exp { + ms_regex_t re; + + if(MS_STRING_IS_NULL_OR_EMPTY($1) == MS_TRUE) { + $$ = MS_FALSE; + } else { + if(ms_regcomp(&re, $3, MS_REG_EXTENDED|MS_REG_NOSUB) != 0) { + $$ = MS_FALSE; + } else { + if(ms_regexec(&re, $1, 0, NULL, 0) == 0) + $$ = MS_TRUE; + else + $$ = MS_FALSE; + ms_regfree(&re); + } + } + + free($1); + free($3); + } + | string_exp IRE string_exp { + ms_regex_t re; + + if(MS_STRING_IS_NULL_OR_EMPTY($1) == MS_TRUE) { + $$ = MS_FALSE; + } else { + if(ms_regcomp(&re, $3, MS_REG_EXTENDED|MS_REG_NOSUB|MS_REG_ICASE) != 0) { + $$ = MS_FALSE; + } else { + if(ms_regexec(&re, $1, 0, NULL, 0) == 0) + $$ = MS_TRUE; + else + $$ = MS_FALSE; + ms_regfree(&re); + } + } + + free($1); + free($3); + } + | math_exp EQ math_exp { + if($1 == $3) + $$ = MS_TRUE; + else + $$ = MS_FALSE; + } + | math_exp NE math_exp { + if($1 != $3) + $$ = MS_TRUE; + else + $$ = MS_FALSE; + } + | math_exp GT math_exp { + if($1 > $3) + $$ = MS_TRUE; + else + $$ = MS_FALSE; + } + | math_exp LT math_exp { + if($1 < $3) + $$ = MS_TRUE; + else + $$ = MS_FALSE; + } + | math_exp GE math_exp { + if($1 >= $3) + $$ = MS_TRUE; + else + $$ = MS_FALSE; + } + | math_exp LE math_exp { + if($1 <= $3) + $$ = MS_TRUE; + else + $$ = MS_FALSE; + } + | string_exp EQ string_exp { + if(strcmp($1, $3) == 0) + $$ = MS_TRUE; + else + $$ = MS_FALSE; + free($1); + free($3); + } + | string_exp NE string_exp { + if(strcmp($1, $3) != 0) + $$ = MS_TRUE; + else + $$ = MS_FALSE; + free($1); + free($3); + } + | string_exp GT string_exp { + if(strcmp($1, $3) > 0) + $$ = MS_TRUE; + else + $$ = MS_FALSE; + free($1); + free($3); + } + | string_exp LT string_exp { + if(strcmp($1, $3) < 0) + $$ = MS_TRUE; + else + $$ = MS_FALSE; + free($1); + free($3); + } + | string_exp GE string_exp { + if(strcmp($1, $3) >= 0) + $$ = MS_TRUE; + else + $$ = MS_FALSE; + free($1); + free($3); + } + | string_exp LE string_exp { + if(strcmp($1, $3) <= 0) + $$ = MS_TRUE; + else + $$ = MS_FALSE; + free($1); + free($3); + } + | time_exp EQ time_exp { + if(msTimeCompare(&($1), &($3)) == 0) + $$ = MS_TRUE; + else + $$ = MS_FALSE; + } + | time_exp NE time_exp { + if(msTimeCompare(&($1), &($3)) != 0) + $$ = MS_TRUE; + else + $$ = MS_FALSE; + } + | time_exp GT time_exp { + if(msTimeCompare(&($1), &($3)) > 0) + $$ = MS_TRUE; + else + $$ = MS_FALSE; + } + | time_exp LT time_exp { + if(msTimeCompare(&($1), &($3)) < 0) + $$ = MS_TRUE; + else + $$ = MS_FALSE; + } + | time_exp GE time_exp { + if(msTimeCompare(&($1), &($3)) >= 0) + $$ = MS_TRUE; + else + $$ = MS_FALSE; + } + | time_exp LE time_exp { + if(msTimeCompare(&($1), &($3)) <= 0) + $$ = MS_TRUE; + else + $$ = MS_FALSE; + } + | string_exp IN string_exp { + char *delim, *bufferp; + + $$ = MS_FALSE; + bufferp=$3; + + while((delim=strchr(bufferp,',')) != NULL) { + *delim='\0'; + if(strcmp($1,bufferp) == 0) { + $$ = MS_TRUE; + break; + } + *delim=','; + bufferp=delim+1; + } + + if($$ == MS_FALSE && strcmp($1,bufferp) == 0) // test for last (or only) item + $$ = MS_TRUE; + free($1); + free($3); + } + | math_exp IN string_exp { + char *delim,*bufferp; + + $$ = MS_FALSE; + bufferp=$3; + + while((delim=strchr(bufferp,',')) != NULL) { + *delim='\0'; + if($1 == atof(bufferp)) { + $$ = MS_TRUE; + break; + } + *delim=','; + bufferp=delim+1; + } + + if($1 == atof(bufferp)) // is this test necessary? + $$ = MS_TRUE; + free($3); + } + | math_exp IEQ math_exp { + if($1 == $3) + $$ = MS_TRUE; + else + $$ = MS_FALSE; + } + | string_exp IEQ string_exp { + if(strcasecmp($1, $3) == 0) + $$ = MS_TRUE; + else + $$ = MS_FALSE; + free($1); + free($3); + } + | time_exp IEQ time_exp { + if(msTimeCompare(&($1), &($3)) == 0) + $$ = MS_TRUE; + else + $$ = MS_FALSE; + } + | shape_exp EQ shape_exp { + int rval; + rval = msGEOSEquals($1, $3); + if($1->scratch == MS_TRUE) msFreeShape($1); + if($3->scratch == MS_TRUE) msFreeShape($3); + if(rval == -1) { + yyerror(p, "Equals (EQ or ==) operator failed."); + return(-1); + } else + $$ = rval; + } + | EQUALS '(' shape_exp ',' shape_exp ')' { + int rval; + rval = msGEOSEquals($3, $5); + if($3->scratch == MS_TRUE) msFreeShape($3); + if($5->scratch == MS_TRUE) msFreeShape($5); + if(rval == -1) { + yyerror(p, "Equals function failed."); + return(-1); + } else + $$ = rval; + } + | INTERSECTS '(' shape_exp ',' shape_exp ')' { + int rval; + rval = msGEOSIntersects($3, $5); + if($3->scratch == MS_TRUE) msFreeShape($3); + if($5->scratch == MS_TRUE) msFreeShape($5); + if(rval == -1) { + yyerror(p, "Intersects function failed."); + return(-1); + } else + $$ = rval; + } + | shape_exp INTERSECTS shape_exp { + int rval; + rval = msGEOSIntersects($1, $3); + if($1->scratch == MS_TRUE) msFreeShape($1); + if($3->scratch == MS_TRUE) msFreeShape($3); + if(rval == -1) { + yyerror(p, "Intersects operator failed."); + return(-1); + } else + $$ = rval; + } + | DISJOINT '(' shape_exp ',' shape_exp ')' { + int rval; + rval = msGEOSDisjoint($3, $5); + if($3->scratch == MS_TRUE) msFreeShape($3); + if($5->scratch == MS_TRUE) msFreeShape($5); + if(rval == -1) { + yyerror(p, "Disjoint function failed."); + return(-1); + } else + $$ = rval; + } + | shape_exp DISJOINT shape_exp { + int rval; + rval = msGEOSDisjoint($1, $3); + if($1->scratch == MS_TRUE) msFreeShape($1); + if($3->scratch == MS_TRUE) msFreeShape($3); + if(rval == -1) { + yyerror(p, "Disjoint operator failed."); + return(-1); + } else + $$ = rval; + } + | TOUCHES '(' shape_exp ',' shape_exp ')' { + int rval; + rval = msGEOSTouches($3, $5); + if($3->scratch == MS_TRUE) msFreeShape($3); + if($5->scratch == MS_TRUE) msFreeShape($5); + if(rval == -1) { + yyerror(p, "Touches function failed."); + return(-1); + } else + $$ = rval; + } + | shape_exp TOUCHES shape_exp { + int rval; + rval = msGEOSTouches($1, $3); + if($1->scratch == MS_TRUE) msFreeShape($1); + if($3->scratch == MS_TRUE) msFreeShape($3); + if(rval == -1) { + yyerror(p, "Touches operator failed."); + return(-1); + } else + $$ = rval; + } + | OVERLAPS '(' shape_exp ',' shape_exp ')' { + int rval; + rval = msGEOSOverlaps($3, $5); + if($3->scratch == MS_TRUE) msFreeShape($3); + if($5->scratch == MS_TRUE) msFreeShape($5); + if(rval == -1) { + yyerror(p, "Overlaps function failed."); + return(-1); + } else + $$ = rval; + } + | shape_exp OVERLAPS shape_exp { + int rval; + rval = msGEOSOverlaps($1, $3); + if($1->scratch == MS_TRUE) msFreeShape($1); + if($3->scratch == MS_TRUE) msFreeShape($3); + if(rval == -1) { + yyerror(p, "Overlaps operator failed."); + return(-1); + } else + $$ = rval; + } + | CROSSES '(' shape_exp ',' shape_exp ')' { + int rval; + rval = msGEOSCrosses($3, $5); + if($3->scratch == MS_TRUE) msFreeShape($3); + if($5->scratch == MS_TRUE) msFreeShape($5); + if(rval == -1) { + yyerror(p, "Crosses function failed."); + return(-1); + } else + $$ = rval; + } + | shape_exp CROSSES shape_exp { + int rval; + rval = msGEOSCrosses($1, $3); + if($1->scratch == MS_TRUE) msFreeShape($1); + if($3->scratch == MS_TRUE) msFreeShape($3); + if(rval == -1) { + yyerror(p, "Crosses operator failed."); + return(-1); + } else + $$ = rval; + } + | WITHIN '(' shape_exp ',' shape_exp ')' { + int rval; + rval = msGEOSWithin($3, $5); + if($3->scratch == MS_TRUE) msFreeShape($3); + if($5->scratch == MS_TRUE) msFreeShape($5); + if(rval == -1) { + yyerror(p, "Within function failed."); + return(-1); + } else + $$ = rval; + } + | shape_exp WITHIN shape_exp { + int rval; + rval = msGEOSWithin($1, $3); + if($1->scratch == MS_TRUE) msFreeShape($1); + if($3->scratch == MS_TRUE) msFreeShape($3); + if(rval == -1) { + yyerror(p, "Within operator failed."); + return(-1); + } else + $$ = rval; + } + | CONTAINS '(' shape_exp ',' shape_exp ')' { + int rval; + rval = msGEOSContains($3, $5); + if($3->scratch == MS_TRUE) msFreeShape($3); + if($5->scratch == MS_TRUE) msFreeShape($5); + if(rval == -1) { + yyerror(p, "Contains function failed."); + return(-1); + } else + $$ = rval; + } + | shape_exp CONTAINS shape_exp { + int rval; + rval = msGEOSContains($1, $3); + if($1->scratch == MS_TRUE) msFreeShape($1); + if($3->scratch == MS_TRUE) msFreeShape($3); + if(rval == -1) { + yyerror(p, "Contains operator failed."); + return(-1); + } else + $$ = rval; + } + | DWITHIN '(' shape_exp ',' shape_exp ',' math_exp ')' { + double d; + d = msGEOSDistance($3, $5); + if($3->scratch == MS_TRUE) msFreeShape($3); + if($5->scratch == MS_TRUE) msFreeShape($5); + if(d <= $7) + $$ = MS_TRUE; + else + $$ = MS_FALSE; + } + | BEYOND '(' shape_exp ',' shape_exp ',' math_exp ')' { + double d; + d = msGEOSDistance($3, $5); + if($3->scratch == MS_TRUE) msFreeShape($3); + if($5->scratch == MS_TRUE) msFreeShape($5); + if(d > $7) + $$ = MS_TRUE; + else + $$ = MS_FALSE; + } +; + +math_exp: NUMBER + | '(' math_exp ')' { $$ = $2; } + | math_exp '+' math_exp { $$ = $1 + $3; } + | math_exp '-' math_exp { $$ = $1 - $3; } + | math_exp '*' math_exp { $$ = $1 * $3; } + | math_exp '%' math_exp { $$ = (int)$1 % (int)$3; } + | math_exp '/' math_exp { + if($3 == 0.0) { + yyerror(p, "Division by zero."); + return(-1); + } else + $$ = $1 / $3; + } + | '-' math_exp %prec NEG { $$ = $2; } + | math_exp '^' math_exp { $$ = pow($1, $3); } + | LENGTH '(' string_exp ')' { $$ = strlen($3); } + | AREA '(' shape_exp ')' { + if($3->type != MS_SHAPE_POLYGON) { + yyerror(p, "Area can only be computed for polygon shapes."); + return(-1); + } + $$ = msGetPolygonArea($3); + if($3->scratch == MS_TRUE) msFreeShape($3); + } + | ROUND '(' math_exp ',' math_exp ')' { $$ = (MS_NINT($3/$5))*$5; } +; + +shape_exp: SHAPE + | '(' shape_exp ')' { $$ = $2; } + | YYBUFFER '(' shape_exp ',' math_exp ')' { + shapeObj *s; + s = msGEOSBuffer($3, $5); + if(!s) { + yyerror(p, "Executing buffer failed."); + return(-1); + } + s->scratch = MS_TRUE; + $$ = s; + } + | DIFFERENCE '(' shape_exp ',' shape_exp ')' { + shapeObj *s; + s = msGEOSDifference($3, $5); + if(!s) { + yyerror(p, "Executing difference failed."); + return(-1); + } + s->scratch = MS_TRUE; + $$ = s; + } + | SIMPLIFY '(' shape_exp ',' math_exp ')' { + shapeObj *s; + s = msGEOSSimplify($3, $5); + if(!s) { + yyerror(p, "Executing simplify failed."); + return(-1); + } + s->scratch = MS_TRUE; + $$ = s; + } + | SIMPLIFYPT '(' shape_exp ',' math_exp ')' { + shapeObj *s; + s = msGEOSTopologyPreservingSimplify($3, $5); + if(!s) { + yyerror(p, "Executing simplifypt failed."); + return(-1); + } + s->scratch = MS_TRUE; + $$ = s; + } + | GENERALIZE '(' shape_exp ',' math_exp ')' { + shapeObj *s; + s = msGeneralize($3, $5); + if(!s) { + yyerror(p, "Executing generalize failed."); + return(-1); + } + s->scratch = MS_TRUE; + $$ = s; + } + | SMOOTHSIA '(' shape_exp ')' { + shapeObj *s; + s = msSmoothShapeSIA($3, 3, 1, NULL); + if(!s) { + yyerror(p, "Executing smoothsia failed."); + return(-1); + } + s->scratch = MS_TRUE; + $$ = s; + } + | SMOOTHSIA '(' shape_exp ',' math_exp ')' { + shapeObj *s; + s = msSmoothShapeSIA($3, $5, 1, NULL); + if(!s) { + yyerror(p, "Executing smoothsia failed."); + return(-1); + } + s->scratch = MS_TRUE; + $$ = s; + } + | SMOOTHSIA '(' shape_exp ',' math_exp ',' math_exp ')' { + shapeObj *s; + s = msSmoothShapeSIA($3, $5, $7, NULL); + if(!s) { + yyerror(p, "Executing smoothsia failed."); + return(-1); + } + s->scratch = MS_TRUE; + $$ = s; + } + | SMOOTHSIA '(' shape_exp ',' math_exp ',' math_exp ',' string_exp ')' { + shapeObj *s; + s = msSmoothShapeSIA($3, $5, $7, $9); + free($9); + if(!s) { + yyerror(p, "Executing smoothsia failed."); + return(-1); + } + s->scratch = MS_TRUE; + $$ = s; + } + | JAVASCRIPT '(' shape_exp ',' string_exp ')' { +#ifdef USE_V8_MAPSCRIPT + shapeObj *s; + s = msV8TransformShape($3, $5); + free($5); + if(!s) { + yyerror(p, "Executing javascript failed."); + return(-1); + } + s->scratch = MS_TRUE; + $$ = s; +#else + yyerror(p, "Javascript support not compiled in"); + return(-1); +#endif + } +; + +string_exp: STRING + | '(' string_exp ')' { $$ = $2; } + | string_exp '+' string_exp { + $$ = (char *)malloc(strlen($1) + strlen($3) + 1); + sprintf($$, "%s%s", $1, $3); free($1); free($3); + } + | TOSTRING '(' math_exp ',' string_exp ')' { + $$ = (char *) malloc(strlen($5) + 64); /* Plenty big? Should use snprintf below... */ + sprintf($$, $5, $3); + } + | COMMIFY '(' string_exp ')' { + $3 = msCommifyString($3); + $$ = $3; + } + | UPPER '(' string_exp ')' { + msStringToUpper($3); + $$ = $3; + } + | LOWER '(' string_exp ')' { + msStringToLower($3); + $$ = $3; + } + | INITCAP '(' string_exp ')' { + msStringInitCap($3); + $$ = $3; + } + | FIRSTCAP '(' string_exp ')' { + msStringFirstCap($3); + $$ = $3; + } +; + +time_exp: TIME + | '(' time_exp ')' { $$ = $2; } +; + +%% + +/* +** Any extra C functions +*/ + +int yylex(YYSTYPE *lvalp, parseObj *p) +{ + int token; + + if(p->expr->curtoken == NULL) return(0); /* done */ + + // fprintf(stderr, "in yylex() - curtoken=%d...\n", p->expr->curtoken->token); + + token = p->expr->curtoken->token; /* may override */ + switch(p->expr->curtoken->token) { + case MS_TOKEN_LITERAL_BOOLEAN: + token = BOOLEAN; + (*lvalp).intval = p->expr->curtoken->tokenval.dblval; + break; + case MS_TOKEN_LITERAL_NUMBER: + token = NUMBER; + (*lvalp).dblval = p->expr->curtoken->tokenval.dblval; + break; + case MS_TOKEN_LITERAL_SHAPE: + token = SHAPE; + // fprintf(stderr, "token value = %s\n", msShapeToWKT(p->expr->curtoken->tokenval.shpval)); + (*lvalp).shpval = p->expr->curtoken->tokenval.shpval; + break; + case MS_TOKEN_LITERAL_STRING: + // printf("token value = %s\n", p->expr->curtoken->tokenval.strval); + token = STRING; + (*lvalp).strval = msStrdup(p->expr->curtoken->tokenval.strval); + break; + case MS_TOKEN_LITERAL_TIME: + token = TIME; + (*lvalp).tmval = p->expr->curtoken->tokenval.tmval; + break; + + case MS_TOKEN_COMPARISON_EQ: token = EQ; break; + case MS_TOKEN_COMPARISON_IEQ: token = IEQ; break; + case MS_TOKEN_COMPARISON_NE: token = NE; break; + case MS_TOKEN_COMPARISON_LT: token = LT; break; + case MS_TOKEN_COMPARISON_GT: token = GT; break; + case MS_TOKEN_COMPARISON_LE: token = LE; break; + case MS_TOKEN_COMPARISON_GE: token = GE; break; + case MS_TOKEN_COMPARISON_RE: token = RE; break; + case MS_TOKEN_COMPARISON_IRE: token = IRE; break; + + case MS_TOKEN_COMPARISON_INTERSECTS: token = INTERSECTS; break; + case MS_TOKEN_COMPARISON_DISJOINT: token = DISJOINT; break; + case MS_TOKEN_COMPARISON_TOUCHES: token = TOUCHES; break; + case MS_TOKEN_COMPARISON_OVERLAPS: token = OVERLAPS; break; + case MS_TOKEN_COMPARISON_CROSSES: token = CROSSES; break; + case MS_TOKEN_COMPARISON_WITHIN: token = WITHIN; break; + case MS_TOKEN_COMPARISON_CONTAINS: token = CONTAINS; break; + case MS_TOKEN_COMPARISON_EQUALS: token = EQUALS; break; + case MS_TOKEN_COMPARISON_BEYOND: token = BEYOND; break; + case MS_TOKEN_COMPARISON_DWITHIN: token = DWITHIN; break; + + case MS_TOKEN_LOGICAL_AND: token = AND; break; + case MS_TOKEN_LOGICAL_OR: token = OR; break; + case MS_TOKEN_LOGICAL_NOT: token = NOT; break; + + case MS_TOKEN_BINDING_DOUBLE: + case MS_TOKEN_BINDING_INTEGER: + token = NUMBER; + (*lvalp).dblval = atof(p->shape->values[p->expr->curtoken->tokenval.bindval.index]); + break; + case MS_TOKEN_BINDING_STRING: + token = STRING; + (*lvalp).strval = msStrdup(p->shape->values[p->expr->curtoken->tokenval.bindval.index]); + break; + case MS_TOKEN_BINDING_SHAPE: + token = SHAPE; + // fprintf(stderr, "token value = %s\n", msShapeToWKT(p->shape)); + (*lvalp).shpval = p->shape; + break; + case MS_TOKEN_BINDING_MAP_CELLSIZE: + token = NUMBER; + (*lvalp).dblval = p->dblval; + break; + case MS_TOKEN_BINDING_DATA_CELLSIZE: + token = NUMBER; + (*lvalp).dblval = p->dblval2; + break; + case MS_TOKEN_BINDING_TIME: + token = TIME; + msTimeInit(&((*lvalp).tmval)); + if(msParseTime(p->shape->values[p->expr->curtoken->tokenval.bindval.index], &((*lvalp).tmval)) != MS_TRUE) { + yyerror(p, "Parsing time value failed."); + return(-1); + } + break; + + case MS_TOKEN_FUNCTION_AREA: token = AREA; break; + case MS_TOKEN_FUNCTION_LENGTH: token = LENGTH; break; + case MS_TOKEN_FUNCTION_TOSTRING: token = TOSTRING; break; + case MS_TOKEN_FUNCTION_COMMIFY: token = COMMIFY; break; + case MS_TOKEN_FUNCTION_UPPER: token = UPPER; break; + case MS_TOKEN_FUNCTION_LOWER: token = LOWER; break; + case MS_TOKEN_FUNCTION_INITCAP: token = INITCAP; break; + case MS_TOKEN_FUNCTION_FIRSTCAP: token = FIRSTCAP; break; + case MS_TOKEN_FUNCTION_ROUND: token = ROUND; break; + + case MS_TOKEN_FUNCTION_BUFFER: token = YYBUFFER; break; + case MS_TOKEN_FUNCTION_DIFFERENCE: token = DIFFERENCE; break; + case MS_TOKEN_FUNCTION_SIMPLIFY: token = SIMPLIFY; break; + case MS_TOKEN_FUNCTION_SIMPLIFYPT: token = SIMPLIFYPT; break; + case MS_TOKEN_FUNCTION_GENERALIZE: token = GENERALIZE; break; + case MS_TOKEN_FUNCTION_SMOOTHSIA: token = SMOOTHSIA; break; + case MS_TOKEN_FUNCTION_JAVASCRIPT: token = JAVASCRIPT; break; + + default: + break; + } + + p->expr->curtoken = p->expr->curtoken->next; /* re-position */ + return(token); +} + +int yyerror(parseObj *p, const char *s) { + msSetError(MS_PARSEERR, "%s", "yyparse()", s); + return(0); +} diff -Nru mapserver-7.0.7+6/mapscript/python/pygdioctx/pygdioctx.c mapserver-7.2.0+1/mapscript/python/pygdioctx/pygdioctx.c --- mapserver-7.0.7+6/mapscript/python/pygdioctx/pygdioctx.c 2018-05-22 17:19:30.000000000 +0000 +++ mapserver-7.2.0+1/mapscript/python/pygdioctx/pygdioctx.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,161 +0,0 @@ -/****************************************************************************** - * $Id$ - * - * Project: MapServer - * Purpose: Interface Python file-like objects with GD through IOCtx - * Author: Sean Gillies, sgillies@frii.com - * - ****************************************************************************** - * The PyFileIfaceObj_IOCtx API is - * - * Copyright 1995 Richard Jones, Bureau of Meteorology Australia. - * richard@bofh.asn.au - * - * Current maintainer is - * Chris Gonnerman - * Please direct all questions and problems to me. - * - ****************************************************************************** - * GDMODULE LICENSE: - * gdmodule - Python GD module Copyright (c) 1995 Richard Jones All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. Neither the name of the Bureau of Meteorology - * Australia nor the names of its contributors may be used to endorse - * or promote products derived from this software without specific - * prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * ***************************************************************************/ - -#ifdef USE_GD - -#include "pygdioctx.h" - -int PyFileIfaceObj_IOCtx_GetC(msIOCtx *ctx) -{ - struct PyFileIfaceObj_gdIOCtx *pctx = (struct PyFileIfaceObj_gdIOCtx *)ctx; - if (pctx->strObj) { - Py_DECREF(pctx->strObj); - pctx->strObj = NULL; - } - pctx->strObj = PyObject_CallMethod(pctx->fileIfaceObj, "read", "i", 1); - if (!pctx->strObj || !PyString_Check(pctx->strObj)) { - return EOF; - } - if (PyString_GET_SIZE(pctx->strObj) == 1) { - return (int)(unsigned char)PyString_AS_STRING(pctx->strObj)[0]; - } - return EOF; -} - -int PyFileIfaceObj_IOCtx_GetBuf(msIOCtx *ctx, void *data, int size) -{ - int err; - char *value; - struct PyFileIfaceObj_gdIOCtx *pctx = (struct PyFileIfaceObj_gdIOCtx *)ctx; - if (pctx->strObj) { - Py_DECREF(pctx->strObj); - pctx->strObj = NULL; - } - pctx->strObj = PyObject_CallMethod(pctx->fileIfaceObj, "read", "i", size); - if (!pctx->strObj) { - return 0; - } - err = PyString_AsStringAndSize(pctx->strObj, &value, &size); - if (err < 0) { - /* this throws away the python exception since the gd library - * won't pass it up properly. gdmodule should create its own - * since the "file" couldn't be read properly. */ - PyErr_Clear(); - return 0; - } - memcpy(data, value, size); - return size; -} - -void PyFileIfaceObj_IOCtx_Free(msIOCtx *ctx) -{ - struct PyFileIfaceObj_gdIOCtx *pctx = (struct PyFileIfaceObj_gdIOCtx *)ctx; - if (pctx->strObj) { - Py_DECREF(pctx->strObj); - pctx->strObj = NULL; - } - if (pctx->fileIfaceObj) { - Py_DECREF(pctx->fileIfaceObj); - pctx->fileIfaceObj = NULL; - } - /* NOTE: we leave deallocation of the ctx structure itself to outside - * code for memory allocation symmetry. This function is safe to - * call multiple times (gd should call it + we call it to be safe). */ -} - -struct PyFileIfaceObj_gdIOCtx * alloc_PyFileIfaceObj_IOCtx(PyObject *fileIfaceObj) { - struct PyFileIfaceObj_gdIOCtx *pctx; - pctx = calloc(1, sizeof(struct PyFileIfaceObj_gdIOCtx)); - if (!pctx) - return NULL; - pctx->ctx.getC = PyFileIfaceObj_IOCtx_GetC; - pctx->ctx.getBuf = PyFileIfaceObj_IOCtx_GetBuf; - pctx->ctx.gd_free = PyFileIfaceObj_IOCtx_Free; - Py_INCREF(fileIfaceObj); - pctx->fileIfaceObj = fileIfaceObj; - return pctx; -} - -void free_PyFileIfaceObj_IOCtx(struct PyFileIfaceObj_gdIOCtx *pctx) -{ - if (!pctx) - return; - assert(pctx->ctx.gd_free != NULL); - pctx->ctx.gd_free((gdIOCtxPtr)pctx); - free(pctx); -} - -/* =========================================================================== - * Mapserver function createImageObjFromPyFile by Sean Gillies, - * - * ======================================================================== */ - -imageObj *createImageObjFromPyFile(PyObject *file, const char *driver) -{ - imageObj *image=NULL; - struct PyFileIfaceObj_gdIOCtx *pctx; - - if (file == Py_None) { - msSetError(MS_IMGERR, "NULL file object", - "createImageObjFromPyFile()"); - return NULL; - } else if (!driver) { - msSetError(MS_IMGERR, "NULL or invalid driver string", - "createImageObjFromPyFile()"); - return NULL; - } else { - pctx = alloc_PyFileIfaceObj_IOCtx(file); - //image = msImageLoadGDCtx((gdIOCtx *) pctx, driver); - free_PyFileIfaceObj_IOCtx(pctx); - return image; - } -} - -#endif - diff -Nru mapserver-7.0.7+6/mapscript/python/pygdioctx/pygdioctx.h mapserver-7.2.0+1/mapscript/python/pygdioctx/pygdioctx.h --- mapserver-7.0.7+6/mapscript/python/pygdioctx/pygdioctx.h 2018-05-22 17:19:30.000000000 +0000 +++ mapserver-7.2.0+1/mapscript/python/pygdioctx/pygdioctx.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,80 +0,0 @@ -/****************************************************************************** - * $Id$ - * - * Project: MapServer - * Purpose: Interface Python file-like objects with GD through IOCtx - * Author: Sean Gillies, sgillies@frii.com - * - ****************************************************************************** - * The PyFileIfaceObj_IOCtx API is - * - * Copyright 1995 Richard Jones, Bureau of Meteorology Australia. - * richard@bofh.asn.au - * - * Current maintainer is - * Chris Gonnerman - * Please direct all questions and problems to me. - * - ***************************************************************************** - * GDMODULE LICENSE: - * gdmodule - Python GD module Copyright (c) 1995 Richard Jones All rights - * reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. Neither the name of the Bureau of Meteorology - * Australia nor the names of its contributors may be used to endorse - * or promote products derived from this software without specific - * prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * ***************************************************************************/ - -#ifdef USE_GD - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "../../../mapserver.h" - -/* -** Code to act as a gdIOCtx wrapper for a python file object -** (read-only; write support would not be difficult to add) -*/ - -struct PyFileIfaceObj_gdIOCtx { - gdIOCtx ctx; - PyObject *fileIfaceObj; - PyObject *strObj; -}; - -struct PyFileIfaceObj_gdIOCtx * alloc_PyFileIfaceObj_IOCtx(PyObject *fileIfaceObj); -void free_PyFileIfaceObj_IOCtx(struct PyFileIfaceObj_gdIOCtx *pctx); -imageObj *createImageObjFromPyFile(PyObject *file, const char *driver); - -#endif - diff -Nru mapserver-7.0.7+6/opt/folders.csv mapserver-7.2.0+1/opt/folders.csv --- mapserver-7.0.7+6/opt/folders.csv 2018-05-22 17:19:30.000000000 +0000 +++ mapserver-7.2.0+1/opt/folders.csv 2018-07-30 22:03:46.000000000 +0000 @@ -1,4 +1,4 @@ -.,.,,"README,h,c,cpp,hpp,WIN32,in,HISTORY.TXT,MIGRATION_GUIDE.txt" +.,.,,"README,h,c,cpp,hpp,WIN32,in,HISTORY.TXT,MIGRATION_GUIDE.txt,y,l,dtd" apache,apache,,c cmake,cmake,skip, fonts,fonts,,example @@ -11,7 +11,6 @@ mapscript/php,mapscript/php,skip, mapscript/python,mapscript/python,,"i,cfg,py,txt" mapscript/python/examples,mapscript/python/examples,,py -mapscript/python/pygdioctx,mapscript/python/pygdioctx,,"c,h" mapscript/python/tests,mapscript/python/tests,skip, mapscript/ruby,mapscript/ruby,skip, mapscript/swiginc,mapscript/swiginc,,i @@ -22,6 +21,7 @@ renderers/agg/include,renderers/agg/include,,"h,hpp" renderers/agg/include/util,renderers/agg/include/util,,h renderers/agg/src,renderers/agg/src,,cpp +renderers/mvt,renderers/mvt,,proto scripts,scripts,skip, symbols,symbols,,"map,sym" tests,tests,skip, diff -Nru mapserver-7.0.7+6/README.md mapserver-7.2.0+1/README.md --- mapserver-7.0.7+6/README.md 2018-05-22 19:18:30.000000000 +0000 +++ mapserver-7.2.0+1/README.md 2018-07-30 22:03:46.000000000 +0000 @@ -5,4 +5,4 @@ # Version -7.0.7-6 +7.2.0-0 diff -Nru mapserver-7.0.7+6/renderers/mvt/vector_tile.proto mapserver-7.2.0+1/renderers/mvt/vector_tile.proto --- mapserver-7.0.7+6/renderers/mvt/vector_tile.proto 1970-01-01 00:00:00.000000000 +0000 +++ mapserver-7.2.0+1/renderers/mvt/vector_tile.proto 2018-07-30 22:03:46.000000000 +0000 @@ -0,0 +1,78 @@ +package vector_tile; + +option optimize_for = LITE_RUNTIME; + +message Tile { + + // GeomType is described in section 4.3.4 of the specification + enum GeomType { + UNKNOWN = 0; + POINT = 1; + LINESTRING = 2; + POLYGON = 3; + } + + // Variant type encoding + // The use of values is described in section 4.1 of the specification + message Value { + // Exactly one of these values must be present in a valid message + optional string string_value = 1; + optional float float_value = 2; + optional double double_value = 3; + optional int64 int_value = 4; + optional uint64 uint_value = 5; + optional sint64 sint_value = 6; + optional bool bool_value = 7; + + extensions 8 to max; + } + + // Features are described in section 4.2 of the specification + message Feature { + optional uint64 id = 1 [ default = 0 ]; + + // Tags of this feature are encoded as repeated pairs of + // integers. + // A detailed description of tags is located in sections + // 4.2 and 4.4 of the specification + repeated uint32 tags = 2 [ packed = true ]; + + // The type of geometry stored in this feature. + optional GeomType type = 3 [ default = UNKNOWN ]; + + // Contains a stream of commands and parameters (vertices). + // A detailed description on geometry encoding is located in + // section 4.3 of the specification. + repeated uint32 geometry = 4 [ packed = true ]; + } + + // Layers are described in section 4.1 of the specification + message Layer { + // Any compliant implementation must first read the version + // number encoded in this message and choose the correct + // implementation for this version number before proceeding to + // decode other parts of this message. + required uint32 version = 15 [ default = 1 ]; + + required string name = 1; + + // The actual features in this tile. + repeated Feature features = 2; + + // Dictionary encoding for keys + repeated string keys = 3; + + // Dictionary encoding for values + repeated Value values = 4; + + // Although this is an "optional" field it is required by the specification. + // See https://github.com/mapbox/vector-tile-spec/issues/47 + optional uint32 extent = 5 [ default = 4096 ]; + + extensions 16 to max; + } + + repeated Layer layers = 3; + + extensions 16 to 8191; +}