. service tells you which device it couldn't stat
[minix3.git] / lib / ack / libp / string.c
bloba36f608a0a6f691243fbca0dad96ba48b05065c3
1 /* $Header$ */
2 /*
3 * (c) copyright 1983 by the Vrije Universiteit, Amsterdam, The Netherlands.
5 * This product is part of the Amsterdam Compiler Kit.
7 * Permission to use, sell, duplicate or disclose this software must be
8 * obtained in writing. Requests for such permissions may be sent to
10 * Dr. Andrew S. Tanenbaum
11 * Wiskundig Seminarium
12 * Vrije Universiteit
13 * Postbox 7161
14 * 1007 MC Amsterdam
15 * The Netherlands
19 /* function strbuf(var b:charbuf):string; */
21 char *strbuf(s) char *s; {
22 return(s);
25 /* function strtobuf(s:string; var b:charbuf; blen:integer):integer; */
27 int strtobuf(s,b,l) char *s,*b; {
28 int i;
30 i = 0;
31 while (--l>=0) {
32 if ((*b++ = *s++) == 0)
33 break;
34 i++;
36 return(i);
39 /* function strlen(s:string):integer; */
41 int strlen(s) char *s; {
42 int i;
44 i = 0;
45 while (*s++)
46 i++;
47 return(i);
50 /* function strfetch(s:string; i:integer):char; */
52 int strfetch(s,i) char *s; {
53 return(s[i-1]);
56 /* procedure strstore(s:string; i:integer; c:char); */
58 strstore(s,i,c) char *s; {
59 s[i-1] = c;