00001 /* $Header$ */ 00002 /* 00003 * (c) copyright 1983 by the Vrije Universiteit, Amsterdam, The Netherlands. 00004 * 00005 * This product is part of the Amsterdam Compiler Kit. 00006 * 00007 * Permission to use, sell, duplicate or disclose this software must be 00008 * obtained in writing. Requests for such permissions may be sent to 00009 * 00010 * Dr. Andrew S. Tanenbaum 00011 * Wiskundig Seminarium 00012 * Vrije Universiteit 00013 * Postbox 7161 00014 * 1007 MC Amsterdam 00015 * The Netherlands 00016 * 00017 */ 00018 00019 /* function strbuf(var b:charbuf):string; */ 00020 00021 char *strbuf(s) char *s; { 00022 return(s); 00023 } 00024 00025 /* function strtobuf(s:string; var b:charbuf; blen:integer):integer; */ 00026 00027 int strtobuf(s,b,l) char *s,*b; { 00028 int i; 00029 00030 i = 0; 00031 while (--l>=0) { 00032 if ((*b++ = *s++) == 0) 00033 break; 00034 i++; 00035 } 00036 return(i); 00037 } 00038 00039 /* function strlen(s:string):integer; */ 00040 00041 int strlen(s) char *s; { 00042 int i; 00043 00044 i = 0; 00045 while (*s++) 00046 i++; 00047 return(i); 00048 } 00049 00050 /* function strfetch(s:string; i:integer):char; */ 00051 00052 int strfetch(s,i) char *s; { 00053 return(s[i-1]); 00054 } 00055 00056 /* procedure strstore(s:string; i:integer; c:char); */ 00057 00058 strstore(s,i,c) char *s; { 00059 s[i-1] = c; 00060 }
1.5.8