Lib.c

Go to the documentation of this file.
00001 #include <stdio.h>
00002 #include <stdlib.h>
00003 #include <string.h>
00004 
00005 
00006 /* 
00007    Lib file or Lib file 
00008    Lib File : generates : tmp_Macros tmp_Bin 
00009 */
00010 
00011 int main(int argc,char *argv[])
00012 {
00013   char name[256];
00014   char fname[256];
00015   FILE *filei,*fileo2,*fileo3;
00016   strcpy(fname,argv[1]);
00017   fname[strlen(fname)]= '\0';
00020   if (NULL == (filei=fopen(fname+1,"r")))
00021     return 1;
00022   /**********************/
00023   if (NULL == (fileo2 = fopen ("tmp_Macros", "w")))   return 1;
00024   if (NULL == (fileo3 = fopen ("tmp_Bin", "w")))   return 1;
00025   fprintf(fileo2,"mode(0);\n");
00026   while (1)
00027     {
00028       int j;
00029       if ( fscanf(filei,"%s",name) == EOF ) break;
00030       j= strlen(name);
00031       while ( j != 0 && name[j] != '.' ) j--; 
00032       name[j]= '\0';
00033       fprintf(fileo2,"getf('%s.sci'),save('%s.bin'),clear ;\n",name,name);
00034       fprintf(fileo3,"%s.bin\n",name);
00035       fprintf(stdout,"Processing file %s.sci\n",name);
00036     }
00037   fprintf(fileo2,"exit;\n");
00038   fclose (fileo2) ;
00039   fclose (fileo3) ;
00040   return 0;
00041 }
00042 
00043 
00044 
00045 

Generated on Sun Mar 4 15:04:01 2007 for Scilab [trunk] by  doxygen 1.5.1