extended version information from Mapserver

Brent Fraser bfraser at GEOANALYTIC.COM
Thu Feb 23 11:06:17 EST 2006


Frank,

  One of the posts to the Mapserver Users list last nite involved a question
about how to get ECW files working with Mapserver.  It would be nice to have
a way to check the capabilities of the GDAL (and other options?) linked to
MapServer.  Last month I had a similar need and wrote a function (for v4.8)
to include in maperror.c:

/* -------------------------------------------------------------------- */
/*      Detailed information about the various options compiled in:     */
/* -------------------------------------------------------------------- */
char *msGetVersionDetailed() {
  static char version[2048];
  long iDr=0;

  strcat(version, "Version Details:\n");

#ifdef USE_GDAL
    strcat(version, "    " );
    strcat(version, GDALVersionInfo( "--version" ) );
    strcat(version, ":\n" );

    GDALAllRegister();
    for( iDr = 0; iDr < GDALGetDriverCount(); iDr++ )
    {
        GDALDriverH hDriver = GDALGetDriver(iDr);

        strcat(version, "        " );
        strcat(version, GDALGetDriverShortName( hDriver ) );
        strcat(version, ": ");
        strcat(version, GDALGetDriverLongName( hDriver ) );
        strcat(version, "\n" );
    }
   GDALDestroyDriverManager();
#endif

  return(version);
}
====================

I also added (to my version only) a new command line parameter to the arg
processing of mapserv.c:

        if( strcmp(argv[iArg],"-d") == 0 ) {
            printf("%s\n", msGetVersionDetailed());
            fflush(stdout);
            exit(0);
        }

This would prevent the "details" from being written to every web page as the
"-v" results are now.

So now the questions:
1. Could you check the code in (if you think it's reasonable)?  I'll file a
bug report to track the change.
2. Are there any immediate ramifications with respect to the plug-in
architecture (RFC 8)?

Thanks!
Brent Fraser
GeoAnalytic Inc.
Calgary, Alberta



More information about the mapserver-dev mailing list