#include <stdio.h>#include <string.h>Include dependency graph for Gensosce.c:

Go to the source code of this file.
Functions | |
| int | main (int argc, argv) |
Definition at line 8 of file Gensosce.c.
References file, fname, j, and NULL.
00010 { 00011 char nam1[256]; char fname[256]; char nam2[256]; 00012 FILE *file,*filei1,*filei2; 00013 00014 /* ***********Open Xfilename2************* */ 00015 strcpy(fname,argv[2]); 00016 fname[strlen(fname)]= '\0'; 00020 if (NULL == (filei2=fopen(fname+1,"r"))) return 1; 00021 /* nam2 = the library name; nam1 (tmp) = nam2.sce = name of script file */ 00022 fscanf(filei2,"%s",nam2); strcpy(nam1,nam2); strcat(nam1,".sce"); 00023 fclose(filei2); 00024 if (NULL == (file = fopen (nam1, "w"))) return 1; 00025 00026 /* ***********Open Xfilename1************* */ 00027 strcpy(fname,argv[1]); 00028 fname[strlen(fname)]= '\0'; 00031 /********* scilab_functions *************/ 00032 if (NULL == (filei1=fopen(fname+1,"r"))) return 1; 00033 00034 fprintf(file, "scilab_functions=[... \n"); 00035 /* loop */ 00036 while (1) 00037 { 00038 int j; 00039 if ( fscanf(filei1,"%s",nam1) == EOF ) break; 00040 j= strlen(nam1); 00041 while ( j != 0 && nam1[j] != '/' ) j--; 00042 nam1[j]= '\0'; 00043 fprintf(file, "\"%s\";\n",nam1); 00044 } 00045 /* end loop */ 00046 fprintf(file," ]; \n"); 00047 fprintf(file, " \n"); 00048 fclose(filei1); 00049 /* ends with addinter stuff 00050 fprintf(file, "addinter(\"./%s.so\",\"%s_gateway\",scilab_functions); \n",nam2,nam2); */ 00051 fclose (file) ; return 0; 00052 }
1.5.1