Changeset 649 for trunk/zoo-project
- Timestamp:
- May 29, 2015, 1:31:23 PM (10 years ago)
- Location:
- trunk/zoo-project/zoo-kernel
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/zoo-project/zoo-kernel/Makefile.in
r640 r649 94 94 95 95 libzoo_service.${EXT}: version.h service_internal.o service.o 96 gcc -shared ${DEFAULT_OPTS} -fpic -o libzoo_service.${EXT} ${CFLAGS} service_internal.o service.o -lfcgi96 gcc -shared ${GDAL_CFLAGS} ${DEFAULT_OPTS} -fpic -o libzoo_service.${EXT} ${CFLAGS} service_internal.o service.o -lfcgi ${GDAL_LIBS} 97 97 98 98 zoo_loader.cgi: version.h libzoo_service.${EXT} zoo_loader.c zoo_service_loader.o ulinet.o service.h lex.sr.o service_conf.tab.o service_conf.y ulinet.o main_conf_read.tab.o lex.cr.o request_parser.o sqlapi.o response_print.o server_internal.o caching.o ${MS_FILE} ${PYTHON_FILE} ${PHP_FILE} ${JAVA_FILE} ${JS_FILE} ${PERL_FILE} ${RUBY_FILE} ${YAML_FILE} ${OTB_FILE} ${SAGA_FILE} -
trunk/zoo-project/zoo-kernel/server_internal.c
r642 r649 28 28 #ifndef WIN32 29 29 #include <dlfcn.h> 30 #endif31 32 #ifdef USE_MS33 #include "service_internal_ms.h"34 #else35 #include "cpl_vsi.h"36 30 #endif 37 31 … … 767 761 } 768 762 769 /** 770 * Read a file using the GDAL VSI API 771 * 772 * @param conf the maps containing the settings of the main.cfg file 773 * @param dataSource the datasource name to read 774 * @warning make sure to free ressources returned by this function 775 */ 776 char *readVSIFile(maps* conf,const char* dataSource){ 777 VSILFILE * fichier=VSIFOpenL(dataSource,"rb"); 778 VSIStatBufL file_status; 779 VSIStatL(dataSource, &file_status); 780 if(fichier==NULL){ 781 char tmp[1024]; 782 sprintf(tmp,"Failed to open file %s for reading purpose. File seems empty %lld.", 783 dataSource,file_status.st_size); 784 setMapInMaps(conf,"lenv","message",tmp); 785 return NULL; 786 } 787 char *res1=(char *)malloc(file_status.st_size*sizeof(char)); 788 VSIFReadL(res1,1,file_status.st_size*sizeof(char),fichier); 789 res1[file_status.st_size-1]=0; 790 VSIFCloseL(fichier); 791 VSIUnlink(dataSource); 792 return res1; 793 } 794 795 763 764 -
trunk/zoo-project/zoo-kernel/server_internal.h
r642 r649 49 49 char* addDefaultValues(maps**,elements*,maps*,int,map**); 50 50 char* getEncoding(maps*); 51 char *readVSIFile(maps*,const char*);52 51 void parseIdentifier(maps*,char*,char*,char*); 53 52 void dumpMapsValuesToFiles(maps**,maps**); -
trunk/zoo-project/zoo-kernel/service_internal.c
r640 r649 25 25 #include "fcgi_stdio.h" 26 26 #include "service_internal.h" 27 #ifdef USE_MS 28 #include "service_internal_ms.h" 29 #else 30 #include "cpl_vsi.h" 31 #endif 27 32 28 33 #ifndef TRUE … … 606 611 607 612 /** 613 * Read a file using the GDAL VSI API 614 * 615 * @param conf the maps containing the settings of the main.cfg file 616 * @param dataSource the datasource name to read 617 * @warning make sure to free ressources returned by this function 618 */ 619 char *readVSIFile(maps* conf,const char* dataSource){ 620 VSILFILE * fichier=VSIFOpenL(dataSource,"rb"); 621 VSIStatBufL file_status; 622 VSIStatL(dataSource, &file_status); 623 if(fichier==NULL){ 624 char tmp[1024]; 625 sprintf(tmp,"Failed to open file %s for reading purpose. File seems empty %lld.", 626 dataSource,file_status.st_size); 627 setMapInMaps(conf,"lenv","message",tmp); 628 return NULL; 629 } 630 char *res1=(char *)malloc(file_status.st_size*sizeof(char)); 631 VSIFReadL(res1,1,file_status.st_size*sizeof(char),fichier); 632 res1[file_status.st_size-1]=0; 633 VSIFCloseL(fichier); 634 VSIUnlink(dataSource); 635 return res1; 636 } 637 638 /** 608 639 * Set an output value 609 640 * -
trunk/zoo-project/zoo-kernel/service_internal.h
r640 r649 94 94 #endif 95 95 96 char *readVSIFile(maps*,const char*); 96 97 int setOutputValue( maps*, const char*, char*, size_t); 97 98 char* getInputValue( maps*,const char*,size_t*);
Note: See TracChangeset
for help on using the changeset viewer.