Lib.c File Reference

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

Include dependency graph for Lib.c:

Go to the source code of this file.

Functions

int main (int argc, char *argv[])


Function Documentation

int main ( int  argc,
char *  argv[] 
)

Definition at line 11 of file Lib.c.

References fname, j, name, and NULL.

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 }


Generated on Sun Mar 4 16:14:19 2007 for Scilab [trunk] by  doxygen 1.5.1