#include "machine.h"Include dependency graph for loadversion.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.
Functions | |
| BOOL | getversionmodule (char *modulename, int *sci_version_major, int *sci_version_minor, int *sci_version_maintenance, char *sci_version_string, int *sci_version_revision) |
| BOOL getversionmodule | ( | char * | modulename, | |
| int * | sci_version_major, | |||
| int * | sci_version_minor, | |||
| int * | sci_version_maintenance, | |||
| char * | sci_version_string, | |||
| int * | sci_version_revision | |||
| ) |
Definition at line 22 of file loadversion.c.
References FALSE, FileExist(), FORMATFILENAMEVERSION, FREE, getSCIpath(), j, len, LineMaxSize, MALLOC, NULL, retval(), SCI_VERSION_MAINTENANCE_keyword, SCI_VERSION_MAJOR_keyword, SCI_VERSION_MINOR_keyword, SCI_VERSION_REVISION_keyword, SCI_VERSION_STRING_keyword, TRUE, and with_module().
Referenced by getversion_one_rhs(), and getversion_two_rhs().
00028 { 00029 BOOL bOK=FALSE; 00030 00031 00032 if (with_module(modulename)) 00033 { 00034 char *filename_VERSION_module=NULL; 00035 char *SciPath=NULL; 00036 int len=0; 00037 00038 SciPath=getSCIpath(); 00039 len=strlen(FORMATFILENAMEVERSION)+strlen(SciPath)+strlen(modulename)+1; 00040 filename_VERSION_module=(char*)MALLOC(sizeof(char)*len); 00041 sprintf(filename_VERSION_module,FORMATFILENAMEVERSION,SciPath,modulename); 00042 00043 if (FileExist(filename_VERSION_module)) 00044 { 00045 #define LineMaxSize 1024 00046 char Line[LineMaxSize]; 00047 FILE *pFile; 00048 00049 pFile=fopen(filename_VERSION_module,"rt"); 00050 while (fgets(Line, LineMaxSize,pFile)) 00051 { 00052 int retval=0; 00053 char SCI_VERSION_TYPE[32]; 00054 00055 retval=sscanf(Line,"%s",SCI_VERSION_TYPE); 00056 00057 if ( strcmp(SCI_VERSION_TYPE,SCI_VERSION_MAJOR_keyword) == 0 ) 00058 { 00059 retval=sscanf(Line,"%s %d",SCI_VERSION_TYPE,sci_version_major); 00060 } 00061 else if ( strcmp(SCI_VERSION_TYPE,SCI_VERSION_MINOR_keyword) == 0 ) 00062 { 00063 retval=sscanf(Line,"%s %d",SCI_VERSION_TYPE,sci_version_minor); 00064 } 00065 else if ( strcmp(SCI_VERSION_TYPE,SCI_VERSION_MAINTENANCE_keyword) == 0 ) 00066 { 00067 retval=sscanf(Line,"%s %d",SCI_VERSION_TYPE,sci_version_maintenance); 00068 } 00069 else if ( strcmp(SCI_VERSION_TYPE,SCI_VERSION_STRING_keyword) == 0 ) 00070 { 00071 int j=0; 00072 strncpy(sci_version_string,&Line[strlen(SCI_VERSION_STRING_keyword)],LineMaxSize); 00073 for (j=strlen(sci_version_string);j>0;j--) 00074 { 00075 if (sci_version_string[j] == '\n') 00076 { 00077 sci_version_string[j]='\0'; 00078 break; 00079 } 00080 } 00081 } 00082 else if ( strcmp(SCI_VERSION_TYPE,SCI_VERSION_REVISION_keyword) == 0 ) 00083 { 00084 retval=sscanf(Line,"%s %d",SCI_VERSION_TYPE,sci_version_revision); 00085 } 00086 } 00087 fclose(pFile); 00088 bOK=TRUE; 00089 } 00090 if (SciPath){FREE(SciPath);SciPath=NULL;} 00091 if (filename_VERSION_module) {FREE(filename_VERSION_module);filename_VERSION_module=NULL;} 00092 } 00093 return bOK; 00094 }
Here is the call graph for this function:

Here is the caller graph for this function:

1.5.1