|
|
1.1 root 1: /* Copyright Bell Telephone Laboratories Whippany, N.J.
2:
3: * ***********************************
4: * ***********************************
5: * ************** LOAD ***************
6: * *** R. B. Drake WH 8C-005 X4163 ***
7: * **** Sun Aug 26 10:48:06 1979 *****
8: * ***********************************
9: * ***********************************
10: * This routine is used to load "BITE" programs form a UNIX file
11: * the filenames must be suffixed ".b" which is appended automatically
12: * by the "save" routine if the user leaves it off
13:
14: */
15: /* "@(#) load.c: V 1.1 12/21/80" */
16:
17: #include "bas.h"
18:
19:
20: char filnam[40];
21: load()
22: {
23: FILE *fp,*pathopen();
24: if(expr[0] == '\0' && filnam[0] == '\0')
25: getfnam();
26: if(expr[0] != 0)
27: {
28: if(strlen(expr) > 40)
29: {
30: error(inst.thing.linno,4);
31: return(-1);
32: }
33: strcpy(filnam,expr);
34:
35: }
36: postb(filnam); /* attach .b postfix if not there */
37: if((fp = pathopen(filnam)) == 0)
38: return(-1);
39:
40: while(bed(fp) == 0);
41: fclose(fp);
42: fetch(0,&lbdptr); /* set txtbuf to first line */
43: return(0);
44: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.