Changeset 712 for trunk/zoo-project


Ignore:
Timestamp:
Jun 30, 2015, 4:49:08 PM (9 years ago)
Author:
knut
Message:

Added snprintf for Visual Studio compiler. In readVSIFile(), changed type of file_status variable to VSIStatBufL. Some minor changes neccessary for building on Windows, particularly in service_internal_php.c. Added PHP support in Windows makefile.

Location:
trunk/zoo-project
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/zoo-project/zoo-kernel/makefile.vc

    r680 r712  
    8686        $(CPP) /EHsc /c $(CFLAGS) zoo_loader.c
    8787
     88service_internal_php.obj: service_internal_php.c service_internal_php.h service.h
     89        $(CPP) /c $(CFLAGS) $(PHP_CFLAGS) service_internal_php.c
    8890
    8991$(LIBZOO_SERVICE): service_internal.obj service.obj sqlapi.obj
    9092        link /dll /out:$(LIBZOO_SERVICE) ./service.obj ./service_internal.obj ./sqlapi.obj $(LDFLAGS) /FORCE:MULTIPLE
    9193
    92 $(PROGRAMNAME): version.h $(LIBZOO_SERVICE) zoo_loader.obj zoo_service_loader.obj service_internal.obj $(PY_FILE) $(JAVA_FILE) $(MS_FILE) $(JS_FILE) $(RUBY_FILE) ulinet.obj lex.cr.obj lex.sr.obj service_conf.tab.obj main_conf_read.tab.obj request_parser.obj response_print.obj server_internal.obj caching.obj
    93         link zoo_loader.obj request_parser.obj response_print.obj server_internal.obj caching.obj $(PY_FILE) $(JAVA_FILE) $(MS_FILE) $(JS_FILE) $(RUBY_FILE) ulinet.obj main_conf_read.tab.obj lex.cr.obj service_conf.tab.obj lex.sr.obj  zoo_service_loader.obj ./libzoo_service.lib /out:$(PROGRAMNAME) $(LDFLAGS) $(LDFLAGSCGI)
     94$(PROGRAMNAME): version.h $(LIBZOO_SERVICE) zoo_loader.obj zoo_service_loader.obj service_internal.obj $(PY_FILE) $(JAVA_FILE) $(MS_FILE) $(JS_FILE) $(RUBY_FILE) $(PHP_FILE) ulinet.obj lex.cr.obj lex.sr.obj service_conf.tab.obj main_conf_read.tab.obj request_parser.obj response_print.obj server_internal.obj caching.obj
     95        link zoo_loader.obj request_parser.obj response_print.obj server_internal.obj caching.obj $(PY_FILE) $(JAVA_FILE) $(MS_FILE) $(JS_FILE) $(RUBY_FILE) $(PHP_FILE) ulinet.obj main_conf_read.tab.obj lex.cr.obj service_conf.tab.obj lex.sr.obj  zoo_service_loader.obj ./libzoo_service.lib /out:$(PROGRAMNAME) $(LDFLAGS) $(LDFLAGSCGI)
    9496
    9597zcfg2yaml: version.h zcfg2yaml.obj zoo_service_loader.obj service_internal.obj $(PY_FILE) $(JAVA_FILE) $(MS_FILE) $(JS_FILE) $(RUBY_FILE) ulinet.obj lex.cr.obj lex.sr.obj service_conf.tab.obj main_conf_read.tab.obj
    96         link zcfg2yaml.obj server_internal.obj $(PY_FILE) $(JAVA_FILE) $(MS_FILE) $(JS_FILE) $(RUBY_FILE) ulinet.obj response_print.obj main_conf_read.tab.obj lex.cr.obj service_conf.tab.obj lex.sr.obj ./libzoo_service.lib /out:zcfg2yaml.exe $(LDFLAGS) $(LDFLAGSCGI)
     98        link zcfg2yaml.obj server_internal.obj $(PY_FILE) $(JAVA_FILE) $(MS_FILE) $(JS_FILE) $(RUBY_FILE) $(PHP_FILE) ulinet.obj response_print.obj main_conf_read.tab.obj lex.cr.obj service_conf.tab.obj lex.sr.obj ./libzoo_service.lib /out:zcfg2yaml.exe $(LDFLAGS) $(LDFLAGSCGI)
    9799
    98100clean:
  • trunk/zoo-project/zoo-kernel/nmake.opt

    r680 r712  
    44CC=cl $(CFLAGS)
    55CPP=cl /TP $(CFLAGS)
     6
     7#PY_DIR=C:/"Program Files (x86)"/Python3.3
     8#PY_LIB=$(PY_DIR)/libs/python33.lib
     9
     10#PHP_DIR=C:\php-sdk\phpdev\vc12\x86\php-5.5.10-src
     11#PHP_LIB=$(PHP_DIR)\Release_TS\php5embed.lib
    612
    713!IF DEFINED(MS_DIR)
     
    3238PY_LDFLAGS=$(PY_LIBRARY)
    3339PY_FILE=service_internal_python.obj
     40!ENDIF
     41
     42!IFDEF PHP_DIR
     43PHP_LIB=$(PHP_DIR)\Release_TS\php5embed.lib
     44PHP_CURL_LIB=$(PHP_DIR)\Release_TS\php_curl.lib
     45PHP_SRC=$(PHP_DIR)
     46PHP_LDFLAGS=$(PHP_LIB) $(PHP_CURL_LIB)
     47PHP_FILE=service_internal_php.obj
     48PHP_CFLAGS=-I$(PHP_SRC) -I$(PHP_SRC)\Zend -I$(PHP_SRC)\TSRM /DPHP_WIN32 /DZEND_WIN32 /DWIN32 /D_USE_32BIT_TIME_T /DZTS /DUSE_PHP
    3449!ENDIF
    3550
     
    6984!ENDIF
    7085
    71 CFLAGS= $(DB_FLAGS) $(MS_DEFS) $(INCLUDES) $(CFLAGS1) /nologo /MD /W3 /EHsc /Ox /D_CRT_SECURE_NO_WARNINGS /DWIN32 /DPROGRAMNAME=\"$(PROGRAMNAME)\" $(CJFLAGS) -I$(ZOOK_DIR) $(RUBY_CFLAGS) -I./ $(JAVA_CFLAGS) $(MS_CFLAGS) -I$(TROOT)\..\..\thirds\dirent-win32 -I$(INTL_DIR) -I$(CURL_DIR)\include -I$(XML2_DIR)\include -I$(GDAL_DIR)\port $(JS_CFLAGS) -I$(GDAL_DIR)\ogr -I$(GDAL_DIR)\gcore -I$(GD_DIR) -I$(ICONV_DIR) -I$(TROOT)\..\..\thirds\include -I$(TROOT)\..\..\thirds\cgic206 -I$(PYTHON_CPATH)\include -I$(SSL_DIR)/inc32 -I$(FCGI_DIR)\include $(PY_CFLAGS) -DLINUX_FREE_ISSUE #-DDEBUG #-DDEBUG_SERVICE_CONF
     86CFLAGS= $(DB_FLAGS) $(MS_DEFS) $(INCLUDES) $(CFLAGS1) /nologo /MD /W3 /EHsc /Ox /D_CRT_SECURE_NO_WARNINGS /DWIN32 /DPROGRAMNAME=\"$(PROGRAMNAME)\" $(CJFLAGS) -I$(ZOOK_DIR) $(RUBY_CFLAGS) -I./ $(JAVA_CFLAGS) $(MS_CFLAGS) -I$(TROOT)\..\..\thirds\dirent-win32 -I$(INTL_DIR) -I$(CURL_DIR)\include -I$(XML2_DIR)\include -I$(GDAL_DIR)\port $(JS_CFLAGS) -I$(GDAL_DIR)\ogr -I$(GDAL_DIR)\gcore -I$(GD_DIR) -I$(ICONV_DIR) -I$(TROOT)\..\..\thirds\include -I$(TROOT)\..\..\thirds\cgic206 -I$(PYTHON_CPATH)\include -I$(SSL_DIR)/inc32 -I$(FCGI_DIR)\include $(PY_CFLAGS) $(PHP_CFLAGS) -DLINUX_FREE_ISSUE #-DDEBUG #-DDEBUG_SERVICE_CONF
    7287
    7388LDFLAGSCGI=$(TROOT)/../../thirds/cgic206/libcgic.lib
    74 LDFLAGS=$(FCGI_DIR)/libfcgi/Release/libfcgi.lib $(CURL_LIBRARY) $(PY_LDFLAGS) $(XML2_LIBRARY) $(SSL_DIR)/out32dll/libeay32.lib $(JAVA_LDFLAGS) $(SSL_DIR)/out32dll/ssleay32.lib $(MS_LDFLAGS) $(INTL_DIR)/intl.lib $(XML2_DIR)/win32/bin.msvc/libxml2.lib $(GDAL_DIR)/gdal_i.lib $(CURL_DIR)/lib/libcurl.lib $(JS_LDFLAGS) $(RUBY_LDFLAGS) /machine:i386
     89LDFLAGS=$(FCGI_DIR)/libfcgi/Release/libfcgi.lib $(CURL_LIBRARY) $(PY_LDFLAGS) $(XML2_LIBRARY) $(SSL_DIR)/out32dll/libeay32.lib $(JAVA_LDFLAGS) $(SSL_DIR)/out32dll/ssleay32.lib $(MS_LDFLAGS) $(INTL_DIR)/intl.lib $(XML2_DIR)/win32/bin.msvc/libxml2.lib $(GDAL_DIR)/gdal_i.lib $(CURL_DIR)/lib/libcurl.lib $(JS_LDFLAGS) $(RUBY_LDFLAGS) $(PHP_LDFLAGS) /machine:i386
  • trunk/zoo-project/zoo-kernel/service.c

    r682 r712  
    2424
    2525#include "service.h"
     26
     27#ifdef _MSC_VER
     28#include <stdarg.h>
     29/**
     30 * snprintf for Visual Studio compiler.
     31 *
     32 * See https://dxr.mozilla.org/mozilla-central/source/media/mtransport/third_party/nrappkit/src/util/util.c
     33 */
     34int snprintf(char *buffer, size_t n, const char *format, ...)
     35{
     36  va_list argp;
     37  int ret;
     38  va_start(argp, format);
     39  ret = _vscprintf(format, argp);
     40  vsnprintf_s(buffer, n, _TRUNCATE, format, argp);
     41  va_end(argp);
     42  return ret;
     43}
     44#endif
    2645
    2746/**
  • trunk/zoo-project/zoo-kernel/service.h

    r682 r712  
    3838#define strncasecmp _strnicmp
    3939#define strcasecmp _stricmp
    40 #else
    41 #define snprintf sprintf_s
     40//#else
     41//#define snprintf sprintf_s
    4242#endif
    4343#define zStrdup _strdup
     
    6464  return 0; // The gettimeofday() function shall return 0 on success
    6565}
     66
    6667#else
    6768/**
     
    106107#include <stdlib.h>
    107108#include <ctype.h>
    108 #ifndef WIN32
     109
    109110#include <stdio.h>
    110 #endif
     111
    111112#include <string.h>
    112113#ifndef WIN32
     
    323324  ZOO_DLL_EXPORT void mapsToCharXXX(maps*,char***);
    324325  ZOO_DLL_EXPORT void charxxxToMaps(char***,maps**);
    325 
     326#ifdef _MSC_VER
     327  // snprintf for Visual Studio compiler;
     328  // it is also used by services (e.g., GetStatus), therefore exported to shared library
     329  ZOO_DLL_EXPORT int snprintf(char *buffer, size_t n, const char *format, ...);
     330#endif 
    326331#ifdef __cplusplus
    327332}
  • trunk/zoo-project/zoo-kernel/service_internal.c

    r703 r712  
    686686char *readVSIFile(maps* conf,const char* dataSource){
    687687    VSILFILE * fichier=VSIFOpenL(dataSource,"rb");
    688     VSIStatBuf file_status;
     688    //VSIStatBuf file_status;
     689        VSIStatBufL file_status;
    689690    VSIStatL(dataSource, &file_status);
    690691    if(fichier==NULL){
  • trunk/zoo-project/zoo-kernel/service_internal_php.c

    r607 r712  
    3030  #define ZEND_DEBUG 0
    3131#endif 
    32  
    33 #include "service_internal_php.h"
    3432
    3533#include <sapi/embed/php_embed.h>
    3634#include <zend_stream.h>
     35
     36#include "service_internal_php.h"
     37#include "response_print.h"
    3738
    3839zval *php_Array_from_maps(maps* t);
     
    187188  getcwd(ntmp,1024);
    188189   
    189   map* libp = getMapFromMaps(m, "main", "libPath"); // KLa
     190  map* libp = getMapFromMaps(m, "main", "libPath");
    190191  int res=SERVICE_FAILED;
    191192
  • trunk/zoo-project/zoo-kernel/zoo_service_loader.c

    r705 r712  
    394394
    395395  map* libp = getMapFromMaps(m, "main", "libPath");
    396  
     396
    397397  if (strlen (r_inputs->value) == 1
    398398      && strncasecmp (r_inputs->value, "C", 1) == 0)
     
    604604  else
    605605#endif
    606 
    607606#ifdef USE_PYTHON
    608607  if (strncasecmp (r_inputs->value, "PYTHON", 6) == 0)
    609     {
     608    {     
    610609      *eres =
    611610        zoo_python_support (&m, request_inputs, s1,
  • trunk/zoo-project/zoo-services/utils/status/service.c

    r680 r712  
    5151   * return the final ExecuteResponse stored on the Server file system.
    5252   */
    53   ZOO_DLL_EXPORT int GetStatus(maps*& conf,maps*& inputs,maps*& outputs){
     53  ZOO_DLL_EXPORT int GetStatus(maps*& conf,maps*& inputs,maps*& outputs){         
    5454    const char *params[4 + 1];
    5555    int xmlLoadExtDtdDefaultValue;
Note: See TracChangeset for help on using the changeset viewer.

Search

Context Navigation

ZOO Sponsors

http://www.zoo-project.org/trac/chrome/site/img/geolabs-logo.pnghttp://www.zoo-project.org/trac/chrome/site/img/neogeo-logo.png http://www.zoo-project.org/trac/chrome/site/img/apptech-logo.png http://www.zoo-project.org/trac/chrome/site/img/3liz-logo.png http://www.zoo-project.org/trac/chrome/site/img/gateway-logo.png

Become a sponsor !

Knowledge partners

http://www.zoo-project.org/trac/chrome/site/img/ocu-logo.png http://www.zoo-project.org/trac/chrome/site/img/gucas-logo.png http://www.zoo-project.org/trac/chrome/site/img/polimi-logo.png http://www.zoo-project.org/trac/chrome/site/img/fem-logo.png http://www.zoo-project.org/trac/chrome/site/img/supsi-logo.png http://www.zoo-project.org/trac/chrome/site/img/cumtb-logo.png

Become a knowledge partner

Related links

http://zoo-project.org/img/ogclogo.png http://zoo-project.org/img/osgeologo.png