Loading a mapfile from a string...

Daniel Morissette dmorissette at MAPGEARS.COM
Fri Apr 27 10:18:43 EDT 2007


OOpps... I meant to reply that a RFC might not be required, but we 
should definitely have a ticket for this. I guess it's too late to ask, 
but has this been documented in a ticket (with ref to the ticket in CVS 
commit message)?

About the flex version requirement, do you know how far back in time we 
can go to have the required yylex_destroy in a flex release? If it's a 
couple of years ago then it is probably safe to require this new 
version. Ideally we should determine the minimum version and check for 
it in the configure script (and document all that in a ticket for the 
posterity).

Daniel

Steve Lime wrote:
> Only one comment (and positive at that) so... this has been commited. One caveat is that to avoid leaking memory yylex_destroy is being used to clean things up. Apparently this is available in newer versions of flex. May actually be there in old versions but only if a reentrant scanner is being built. Presents a small problem. We can control the distributions by using a newish version of flex when building things for users. Requiring developers to use version x.x.x (I'm at 2.5.31) doesn't seem to big a hardship. Thoughts?
> 
> Steve
> 
>>>> Steve Lime <Steve.Lime at DNR.STATE.MN.US> 04/17/07 11:28 PM >>>
> Hi Folks: I've been screwing around with getting mapserver to ingest a mapfile stored in a string buffer rather than a file. In theory you could build up a configuration from text snippets or database output rather than manipulating objects directly. The code could almost do this in the past but needed some reorganization to re-use as much as possible. The result is a new function called msLoadMapFromString. I took the opportunity to fix some naming wierdness in mapfile.c and to clean up lexer initialization a bit. In otherwords I'm sitting on a fair number of minor changes to mapfile.c and maplexer.l (with a few other small edits elsewhere). Is this a big enough deal to warrant a RFC or can I just commit?
> 
> Steve
> 
> BTW A sample perl snippet might look like (mapscript integration isn't part of these changes other than exposing the function):
> 
> $buffer = "MAP ... END";
> $map = $mapscript::msLoadMapFromString($buffer, undef); # takes the buffer and an optional directory (location of symbols...)


-- 
Daniel Morissette
http://www.mapgears.com/



More information about the mapserver-dev mailing list