[BACK]Return to load.c CVS log [TXT][DIR] Up to [local] / OpenXM_contrib2 / asir2000 / parse

Diff for /OpenXM_contrib2/asir2000/parse/load.c between version 1.7 and 1.8

version 1.7, 2001/08/20 09:14:14 version 1.8, 2001/10/09 01:36:24
Line 45 
Line 45 
  * DEVELOPER SHALL HAVE NO LIABILITY IN CONNECTION WITH THE USE,   * DEVELOPER SHALL HAVE NO LIABILITY IN CONNECTION WITH THE USE,
  * PERFORMANCE OR NON-PERFORMANCE OF THE SOFTWARE.   * PERFORMANCE OR NON-PERFORMANCE OF THE SOFTWARE.
  *   *
  * $OpenXM: OpenXM_contrib2/asir2000/parse/load.c,v 1.6 2001/08/20 09:03:27 noro Exp $   * $OpenXM: OpenXM_contrib2/asir2000/parse/load.c,v 1.7 2001/08/20 09:14:14 noro Exp $
 */  */
 #include "ca.h"  #include "ca.h"
 #include "parse.h"  #include "parse.h"
Line 74 
Line 74 
 #include <io.h>  #include <io.h>
 #endif  #endif
   
   #ifdef MALLOC
 #undef MALLOC  #undef MALLOC
 #define MALLOC(x) GC_malloc((x)+4)  #define MALLOC(x) GC_malloc((x)+4)
   #endif
   
 char *ASIRLOADPATH[32];  char *ASIRLOADPATH[32];
   
 void encrypt_file(char *,char *);  
 void decrypt_file(char *,char *);  
   
 #if defined(VISUAL)  #if defined(VISUAL)
 #define ENVDELIM ';'  #define ENVDELIM ';'
 #define MORE "more < "  #define MORE "more < "
Line 95  void decrypt_file(char *,char *);
Line 94  void decrypt_file(char *,char *);
 #endif  #endif
   
 char *getenv();  char *getenv();
   void Pget_rootdir();
   
 extern char *asir_libdir;  extern char *asir_libdir;
 extern char *asir_pager;  extern char *asir_pager;
 extern int read_exec_file;  extern int read_exec_file;
Line 141  void env_init() {
Line 142  void env_init() {
         ASIRLOADPATH[i] = asir_libdir;          ASIRLOADPATH[i] = asir_libdir;
 }  }
   
 void searchasirpath(name,pathp)  void searchasirpath(char *name,char **pathp)
 char *name;  
 char **pathp;  
 {  {
         char **p;          char **p;
         char *q;          char *q;
Line 195  char **pathp;
Line 194  char **pathp;
   
 #define DELIM '/'  #define DELIM '/'
   
 void Eungetc(int,FILE *);  void loadasirfile(char *name0)
   
 void loadasirfile(name0)  
 char *name0;  
 {  {
         FILE *in;          FILE *in;
         IN t;          INFILE t;
         extern char cppname[];          extern char cppname[];
 #if defined(VISUAL)  #if defined(VISUAL)
         char ibuf1[BUFSIZ],ibuf2[BUFSIZ];          char ibuf1[BUFSIZ],ibuf2[BUFSIZ];
         int ac;          int ac;
         char *av[BUFSIZ];          char *av[BUFSIZ];
         char *p,*c;          char *p;
         FILE *fp;          FILE *fp;
         char dname[BUFSIZ],tname0[BUFSIZ];          char dname[BUFSIZ],tname0[BUFSIZ];
         char *name,*tname;          char *name,*tname;
Line 217  char *name0;
Line 213  char *name0;
         char CppExe[BUFSIZ];          char CppExe[BUFSIZ];
         char nbuf[BUFSIZ],tnbuf[BUFSIZ];          char nbuf[BUFSIZ],tnbuf[BUFSIZ];
         STRING rootdir;          STRING rootdir;
           void call_exe(char *,char **);
   
         /* create the unique prefix */          /* create the unique prefix */
         if ( !prefix[0] )          if ( !prefix[0] )
Line 280  char *name0;
Line 277  char *name0;
                 perror("fopen");                  perror("fopen");
                 error("load : failed");                  error("load : failed");
         }          }
         t = (IN)MALLOC(sizeof(struct oIN));          t = (INFILE)MALLOC(sizeof(struct oINFILE));
         t->name = (char *)MALLOC(strlen(name0)+1); strcpy(t->name,name0);          t->name = (char *)MALLOC(strlen(name0)+1); strcpy(t->name,name0);
         t->tname = (char *)MALLOC(strlen(tname)+1); strcpy(t->tname,tname); free(tname);          t->tname = (char *)MALLOC(strlen(tname)+1); strcpy(t->tname,tname); free(tname);
         t->encoded = encoded;          t->encoded = encoded;
Line 292  char *name0;
Line 289  char *name0;
                 perror("popen");                  perror("popen");
                 error("load : failed");                  error("load : failed");
         }          }
         t = (IN)MALLOC(sizeof(struct oIN));          t = (INFILE)MALLOC(sizeof(struct oINFILE));
         t->name = (char *)MALLOC(strlen(name0)+1); strcpy(t->name,name0);          t->name = (char *)MALLOC(strlen(name0)+1); strcpy(t->name,name0);
 #endif  #endif
         t->fp = in; t->ln = 1; t->next = asir_infile; asir_infile = t;          t->fp = in; t->ln = 1; t->next = asir_infile; asir_infile = t;
Line 302  char *name0;
Line 299  char *name0;
                 reallocarray((char **)&EPVS->va,(int *)&EPVS->asize,(int *)&EPVS->n,(int)sizeof(struct oPV));                  reallocarray((char **)&EPVS->va,(int *)&EPVS->asize,(int *)&EPVS->n,(int)sizeof(struct oPV));
 }  }
   
 void execasirfile(name)  void execasirfile(char *name)
 char *name;  
 {  {
         loadasirfile(name);          loadasirfile(name);
         read_exec_file = 1;          read_exec_file = 1;
Line 311  char *name;
Line 307  char *name;
         read_exec_file = 0;          read_exec_file = 0;
 }  }
   
 void load_and_execfile(name)  void load_and_execfile(char *name)
 char *name;  
 {  {
         FILE *fp;          FILE *fp;
         IN save_asir_infile;          INFILE save_asir_infile;
         int save_prresult;          int save_prresult;
         extern prresult;          extern prresult;
   
Line 338  char *name;
Line 333  char *name;
   
 static NODE objfile = 0;  static NODE objfile = 0;
   
 int loadfile(s)  int loadfile(char *s)
 char *s;  
 {  {
         FILE *in;          FILE *in;
   
Line 351  char *s;
Line 345  char *s;
                 return 0;                  return 0;
 }  }
   
 int loadfiles(node) NODE node; { return 0; }  int loadfiles(NODE node) { return 0; }
   
 static unsigned char encrypt_tab[128][2] = {  static unsigned char encrypt_tab[128][2] = {
 {137,40},{1,194},{133,79},{48,20},{254,76},{98,17},{110,233},{19,231},  {137,40},{1,194},{133,79},{48,20},{254,76},{98,17},{110,233},{19,231},
Line 401  unsigned char decrypt_char(unsigned char c)
Line 395  unsigned char decrypt_char(unsigned char c)
         return decrypt_tab[c];          return decrypt_tab[c];
 }  }
   
 void encrypt_file(in,out)  void encrypt_file(char *in,char *out)
 char *in,*out;  
 {  {
         FILE *infp,*outfp;          FILE *infp,*outfp;
         int c;          int c;
Line 413  char *in,*out;
Line 406  char *in,*out;
                 c = getc(infp);                  c = getc(infp);
                 if ( c == EOF )                  if ( c == EOF )
                         break;                          break;
                 putc(encrypt_char(c),outfp);                  putc(encrypt_char((unsigned char)c),outfp);
         }          }
         fclose(infp); fclose(outfp);          fclose(infp); fclose(outfp);
 }  }
   
 void decrypt_file(in,out)  void decrypt_file(char *in,char *out)
 char *in,*out;  
 {  {
         FILE *infp,*outfp;          FILE *infp,*outfp;
         int c;          int c;
Line 432  char *in,*out;
Line 424  char *in,*out;
                 c = getc(infp);                  c = getc(infp);
                 if ( c == EOF )                  if ( c == EOF )
                         break;                          break;
                 putc(decrypt_char(c),outfp);                  putc(decrypt_char((unsigned char)c),outfp);
         }          }
         fclose(infp); fclose(outfp);          fclose(infp); fclose(outfp);
 }  }

Legend:
Removed from v.1.7  
changed lines
  Added in v.1.8

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>