diff --git a/modules/src/print/doprnt.c b/modules/src/print/doprnt.c index 6fb10a6ac..aa4bb9bc4 100644 --- a/modules/src/print/doprnt.c +++ b/modules/src/print/doprnt.c @@ -5,7 +5,7 @@ /* $Header$ */ #include -#include +#include "print.h" #include "param.h" /*FORMAT1 $ @@ -15,7 +15,7 @@ %[uxbo] = unsigned int %d = int $ */ -/*VARARGS2*/ +void doprnt(fp, fmt, argp) File *fp; char *fmt; diff --git a/modules/src/print/format.c b/modules/src/print/format.c index 1a2c7fd66..6b91effce 100644 --- a/modules/src/print/format.c +++ b/modules/src/print/format.c @@ -4,7 +4,8 @@ */ /* $Header$ */ -#include +#include +#include "print.h" extern char *long2str(); @@ -33,7 +34,6 @@ integral(c) %[uxbo] = unsigned int %d = int $ */ -/*VARARGS2*/ int _format(buf, fmt, argp) char *buf, *fmt; diff --git a/modules/src/print/fprint.c b/modules/src/print/fprint.c index aa2be85d8..86cd1bec1 100644 --- a/modules/src/print/fprint.c +++ b/modules/src/print/fprint.c @@ -4,8 +4,8 @@ */ /* $Header$ */ -#include #include +#include "print.h" #include "param.h" /*FORMAT1v $ @@ -16,18 +16,28 @@ %d = int $ */ /*VARARGS*/ -fprint(va_alist) +void +fprint +#if __STDC__ + (File *fp, char *fmt, ...) +{ +#else + (va_alist) va_dcl { File *fp; char *fmt; +#endif va_list args; - char buf[SSIZE]; +#if __STDC__ + va_start(args, fmt); +#else va_start(args); fp = va_arg(args, File *); fmt = va_arg(args, char *); +#endif sys_write(fp, buf, _format(buf, fmt, args)); va_end(args); } diff --git a/modules/src/print/print.3 b/modules/src/print/print.3 index 77288a32d..33d880705 100644 --- a/modules/src/print/print.3 +++ b/modules/src/print/print.3 @@ -5,19 +5,19 @@ print, fprint, sprint, doprnt -- very simple formatted-output routines .SH SYNOPSIS .nf .B #include -.B #include +.B #include .PP -.B print(format [, arg] ... ) +.B void print(format [, arg] ... ) .B char *format; .PP -.B fprint(filep, format [, arg] ... ) +.B void fprint(filep, format [, arg] ... ) .B File *filep; .B char *format; .PP .B char *sprint(s, format [, arg] ... ) .B char *s, *format; .PP -.B doprnt(filep, format, args) +.B void doprnt(filep, format, args) .B File *filep; .B char *format; .B va_list args; @@ -106,29 +106,6 @@ length of the string. takes .I args as the address of the arguments of the format string. -This allows routines, e.g. -.IR print , -to be defined as follows: -.br -.RS -.nf -#include -#include - -/*VARARGS*/ -print(va_alist) - va_dcl -{ - char *fmt; - va_list args; - - va_start(args); - fmt = va_arg(args, char *); - doprnt(STDOUT, fmt, args); - va_end(args); -} -.fi -.RE .SH FILES .nf ~em/modules/lib/libprint.a diff --git a/modules/src/print/print.c b/modules/src/print/print.c index 135b131ce..82590bd10 100644 --- a/modules/src/print/print.c +++ b/modules/src/print/print.c @@ -4,8 +4,8 @@ */ /* $Header$ */ -#include #include +#include "print.h" #include "param.h" /*FORMAT0v $ @@ -16,15 +16,26 @@ %d = int $ */ /*VARARGS*/ -print(va_alist) +void +print +#if __STDC__ + (char *fmt, ...) +{ +#else + (va_alist) va_dcl { char *fmt; +#endif va_list args; char buf[SSIZE]; +#if __STDC__ + va_start(args, fmt); +#else va_start(args); fmt = va_arg(args, char *); +#endif sys_write(STDOUT, buf, _format(buf, fmt, args)); va_end(args); } diff --git a/modules/src/print/print.h b/modules/src/print/print.h index ff82fe401..04a52c773 100644 --- a/modules/src/print/print.h +++ b/modules/src/print/print.h @@ -4,12 +4,20 @@ */ /* $Header$ */ -#define stdin STDIN -#define stdout STDOUT -#define stderr STDERR +#ifndef __PRINT_INCLUDED__ +#define __PRINT_INCLUDED__ -#define printf print -#define sprintf sprint -#define fprintf fprint +#include +#if __STDC__ +#include +#else +#include +#endif -#define FILE File +_PROTOTYPE(void print, (char *fmt, ...)); +_PROTOTYPE(void fprint, (File *f, char *fmt, ...)); +_PROTOTYPE(void doprnt, (File *f, char *fmt, va_list ap)); +_PROTOTYPE(int _format, (char *buf, char *fmt, va_list ap)); +_PROTOTYPE(char *sprint, (char *buf, char *fmt, ...)); + +#endif /* __PRINT_INCLUDED__ */ diff --git a/modules/src/print/proto.make b/modules/src/print/proto.make index ad71aa0bb..e878d9b4d 100644 --- a/modules/src/print/proto.make +++ b/modules/src/print/proto.make @@ -21,16 +21,18 @@ $(LIBPRINT): $(OBJ) $(RANLIB) $(LIBPRINT) install: all + -mkdir $(MOD_DIR)/lib + -mkdir $(MOD_DIR)/h cp $(LIBPRINT) $(MOD_DIR)/lib/$(LIBPRINT) $(RANLIB) $(MOD_DIR)/lib/$(LIBPRINT) - cp $(SRC_DIR)/print.3 $(MOD_DIR)/man/print.3 + cp $(SRC_DIR)/print.h $(MOD_DIR)/h/print.h if [ $(DO_MACHINE_INDEP) = y ] ; \ then mk_manpage $(SRC_DIR)/print.3 $(TARGET_HOME) ; \ fi cmp: all -cmp $(LIBPRINT) $(MOD_DIR)/lib/$(LIBPRINT) - -cmp $(SRC_DIR)/print.3 $(MOD_DIR)/man/print.3 + -cmp $(SRC_DIR)/print.h $(MOD_DIR)/h/print.h pr: @pr $(SRC_DIR)/proto.make $(SRC) diff --git a/modules/src/print/sprint.c b/modules/src/print/sprint.c index 9d87703c6..868e0b76f 100644 --- a/modules/src/print/sprint.c +++ b/modules/src/print/sprint.c @@ -4,8 +4,8 @@ */ /* $Header$ */ -#include #include +#include "print.h" #include "param.h" /*FORMAT1v $ @@ -17,15 +17,25 @@ $ */ /*VARARGS*/ char * -sprint(va_alist) +sprint +#if __STDC__ + (char *buf, char *fmt, ...) +{ +#else + (va_alist) va_dcl { char *buf, *fmt; +#endif va_list args; +#if __STDC__ + va_start(args, fmt); +#else va_start(args); buf = va_arg(args, char *); fmt = va_arg(args, char *); +#endif buf[_format(buf, fmt, args)] = '\0'; va_end(args); return buf; diff --git a/modules/src/read_em/em_comp.h b/modules/src/read_em/em_comp.h index 2e160b681..f11859e82 100644 --- a/modules/src/read_em/em_comp.h +++ b/modules/src/read_em/em_comp.h @@ -6,6 +6,8 @@ #ifndef __EMCOMP_INCLUDED__ #define __EMCOMP_INCLUDED__ +#include + struct e_arg { int ema_argtype; /* type of this argument */ union e_simple_arg { @@ -44,6 +46,11 @@ struct e_instr { struct e_arg em_arg; }; +_PROTOTYPE(int EM_open, (char *)); +_PROTOTYPE(void EM_close, (void)); +_PROTOTYPE(int EM_getinstr, (struct e_instr *)); +_PROTOTYPE(int EM_mkcalls, (struct e_instr *)); + extern arith EM_holsize; #define EM_bsssize EM_holsize diff --git a/modules/src/read_em/mkcalls.c b/modules/src/read_em/mkcalls.c index b42db72d0..4adc5144a 100644 --- a/modules/src/read_em/mkcalls.c +++ b/modules/src/read_em/mkcalls.c @@ -31,7 +31,7 @@ static int listtype = 0; /* indicates pseudo when generating code for The argument must be of a type allowed by "typset". Return a pointer to the next argument. */ -PRIVATE +PRIVATE int checkarg(arg, typset) register struct e_arg *arg; { @@ -58,7 +58,7 @@ checkarg(arg, typset) /* EM_doinstr: An EM instruction */ -PRIVATE +PRIVATE void EM_doinstr(p) register struct e_instr *p; { @@ -94,7 +94,7 @@ EM_doinstr(p) #include "C_mnem" } -PRIVATE +PRIVATE void EM_dopseudo(p) register struct e_instr *p; { @@ -326,7 +326,7 @@ EM_dopseudo(p) } } -PRIVATE +PRIVATE void EM_docon(p) register struct e_instr *p; { @@ -365,7 +365,7 @@ EM_docon(p) } } -PRIVATE +PRIVATE void EM_dostartmes(p) register struct e_instr *p; { diff --git a/modules/src/read_em/proto.make b/modules/src/read_em/proto.make index b10e3d49b..9e1957532 100644 --- a/modules/src/read_em/proto.make +++ b/modules/src/read_em/proto.make @@ -6,7 +6,7 @@ SRC_DIR = $(SRC_HOME)/modules/src/read_em MOD_DIR = $(TARGET_HOME)/modules EM_TABLE = $(SRC_HOME)/etc/em_table INCLUDES = -I$(TARGET_HOME)/h -I$(MOD_DIR)/h -I$(SRC_DIR) -I. -DEFINES = -DPRIVATE=static -DEXPORT= +DEFINES = -DPRIVATE=static -DEXPORT= -DNDEBUG CFLAGS = $(INCLUDES) $(DEFINES) $(COPTIONS) TARGETS = libread_emk.$(LIBSUF) \ @@ -35,8 +35,9 @@ K_OFILES = read_emk.$(SUF) makecalls.$(SUF) EM_vars.$(SUF) all: $(TARGETS) install: all + -mkdir $(MOD_DIR)/lib + -mkdir $(MOD_DIR)/h cp $(SRC_DIR)/em_comp.h $(MOD_DIR)/h/em_comp.h - cp $(SRC_DIR)/read_em.3 $(MOD_DIR)/man/read_em.3 cp libread_emk.$(LIBSUF) $(MOD_DIR)/lib/libread_emk.$(LIBSUF) $(RANLIB) $(MOD_DIR)/lib/libread_emk.$(LIBSUF) cp libread_emkV.$(LIBSUF) $(MOD_DIR)/lib/libread_emkV.$(LIBSUF) @@ -52,7 +53,6 @@ cmp: all -cmp libread_emk.$(LIBSUF) $(MOD_DIR)/lib/libread_emk.$(LIBSUF) -cmp libread_emkV.$(LIBSUF) $(MOD_DIR)/lib/libread_emkV.$(LIBSUF) -cmp libread_emeV.$(LIBSUF) $(MOD_DIR)/lib/libread_emeV.$(LIBSUF) - -cmp $(SRC_DIR)/read_em.3 $(MOD_DIR)/man/read_em.3 pr: @pr $(SRC_DIR)/proto.make $(SRC_DIR)/m_C_mnem $(SRC_DIR)/m_C_mnem_na $(SRC_DIR)/argtype $(SRCFILES) diff --git a/modules/src/read_em/read_em.3 b/modules/src/read_em/read_em.3 index 4bc86edd4..d7f041dc9 100644 --- a/modules/src/read_em/read_em.3 +++ b/modules/src/read_em/read_em.3 @@ -20,10 +20,10 @@ EM_mkcalls\ \-\ a module to read EM assembly code .PP .B int EM_open(filename) .br -.B EM_close() -.br .B char *filename; .PP +.B void EM_close() +.PP .B int EM_getinstr(instr) .B struct e_instr *instr; .PP diff --git a/modules/src/read_em/read_em.c b/modules/src/read_em/read_em.c index 3857cebbb..e0fcadbfe 100644 --- a/modules/src/read_em/read_em.c +++ b/modules/src/read_em/read_em.c @@ -99,7 +99,7 @@ static char *argrange = "Argument range error"; /* Error handling */ -PRIVATE +PRIVATE void xerror(s) char *s; { @@ -108,7 +108,7 @@ xerror(s) } #ifdef COMPACT -PRIVATE +PRIVATE void xfatal(s) char *s; { @@ -157,7 +157,7 @@ EM_open(filename) /* EM_close: Close input file */ -EXPORT +EXPORT void EM_close() { @@ -175,7 +175,7 @@ EM_close() again, but also to deliver the arguments on next calls to EM_getinstr. This is indicated by the variable "argp". */ -PRIVATE +PRIVATE void startmes(p) register struct e_instr *p; { diff --git a/modules/src/read_em/reade.c b/modules/src/read_em/reade.c index 46a278e3a..5a79db27b 100644 --- a/modules/src/read_em/reade.c +++ b/modules/src/read_em/reade.c @@ -43,7 +43,7 @@ hash(s) return h; } -PRIVATE +PRIVATE void pre_hash(i, s) char *s; { @@ -66,7 +66,7 @@ pre_hash(i, s) extern char em_mnem[][4]; extern char em_pseu[][4]; -PRIVATE +PRIVATE void inithash() { register int i; @@ -103,7 +103,7 @@ nospace() /* syntax: Put an error message in EM_error and skip to the end of the line */ -PRIVATE +PRIVATE void syntax(s) char *s; { @@ -117,7 +117,7 @@ syntax(s) /* checkeol: check that we have a complete line (except maybe for spaces) */ -PRIVATE +PRIVATE void checkeol() { @@ -251,7 +251,7 @@ getstring() return s; } -PRIVATE gettyp(); +PRIVATE void gettyp(); PRIVATE int offsetted(argtyp, ap) @@ -446,7 +446,7 @@ get15u() return (int) (dummy.ema_cst); } -PRIVATE +PRIVATE void gettyp(typset, ap) register struct e_arg *ap; { @@ -520,10 +520,9 @@ gettyp(typset, ap) if (argtyp == sp_cend) { ap->ema_argtype = 0; } - return; } -PRIVATE +PRIVATE void getarg(typset, ap) struct e_arg *ap; { @@ -533,19 +532,19 @@ getarg(typset, ap) if ((c = nospace()) != ',') { if (c != '\n') { syntax("comma expected"); - return 0; + return; } ungetbyte(c); } } argnum++; - return gettyp(typset, ap); + gettyp(typset, ap); } /* getmnem: We found the start of either an instruction or a pseudo. get the rest of it */ -PRIVATE +PRIVATE void getmnem(c, p) register struct e_instr *p; { @@ -587,7 +586,7 @@ getmnem(c, p) } } -PRIVATE +PRIVATE void line_line() { static char filebuf[256 + 1]; @@ -601,7 +600,7 @@ line_line() EM_filename = filebuf; } -PRIVATE +PRIVATE void getlabel(c, p) register struct e_instr *p; { @@ -624,7 +623,7 @@ getlabel(c, p) checkeol(); } -PRIVATE +PRIVATE void gethead(p) register struct e_instr *p; { diff --git a/modules/src/read_em/readk.c b/modules/src/read_em/readk.c index 919ab5cef..c1894f525 100644 --- a/modules/src/read_em/readk.c +++ b/modules/src/read_em/readk.c @@ -41,7 +41,7 @@ PRIVATE struct string *getstring(); /* getarg : read an argument of any type, and check it against "typset" if neccesary. Put result in "ap". */ -PRIVATE +PRIVATE void getarg(typset, ap) register struct e_arg *ap; { @@ -259,7 +259,7 @@ getstring(isident) /* gethead: read the start of an EM-line */ -PRIVATE +PRIVATE void gethead(p) register struct e_instr *p; { diff --git a/modules/src/string/.distr b/modules/src/string/.distr index 6611c280a..a44d0db73 100644 --- a/modules/src/string/.distr +++ b/modules/src/string/.distr @@ -18,3 +18,4 @@ strncmp.c strncpy.c strrindex.c strzero.c +ack_string.h diff --git a/modules/src/string/ack_string.h b/modules/src/string/ack_string.h new file mode 100644 index 000000000..97c666e9c --- /dev/null +++ b/modules/src/string/ack_string.h @@ -0,0 +1,31 @@ +/* + * (c) copyright 1993 by the Vrije Universiteit, Amsterdam, The Netherlands. + * See the copyright notice in the ACK home directory, in the file "Copyright". + */ +/* RCS: $Header: */ + +#ifndef __ACK_STRING_INCLUDED__ +#define __ACK_STRING_INCLUDED__ + +#include + +_PROTOTYPE(char *strcpy, (char *s1, const char *s2)); +_PROTOTYPE(char *strncpy, (char *s1, const char *s2, size_t n)); +_PROTOTYPE(char *strcat, (char *s1, const char *s2)); +_PROTOTYPE(char *strncat, (char *s1, const char *s2, size_t n)); +_PROTOTYPE(int strcmp, (const char *s1, const char *s2)); +_PROTOTYPE(int strncmp, (const char *s1, const char *s2, size_t n)); +_PROTOTYPE(_SIZET strlen, (const char *s)); +_PROTOTYPE(char *strindex, (char *s, int c)); +_PROTOTYPE(char *strrindex, (char *s, int c)); +_PROTOTYPE(char *strzero, (char *s)); +_PROTOTYPE(char *str2bts, (char *s, char *b, int *n)); +_PROTOTYPE(char *long2str, (long l, int b)); +_PROTOTYPE(long str2long, (char *s, int b)); +_PROTOTYPE(char *btscpy, (char *s1, char *s2, int n)); +_PROTOTYPE(char *btscat, (char *s1, int n1, char *s2, int n2)); +_PROTOTYPE(int btscmp, (char *s1, int n1, char *s2, int n2)); +_PROTOTYPE(char *btszero, (char *b, int n)); +_PROTOTYPE(char *bts2str, (char *b, int n, char *s)); + +#endif /* __ACK_STRING_INCLUDED__ */ diff --git a/modules/src/string/bts2str.c b/modules/src/string/bts2str.c index a529de264..db7d6326c 100644 --- a/modules/src/string/bts2str.c +++ b/modules/src/string/bts2str.c @@ -8,6 +8,8 @@ 86/03/17 EHB */ +#include "ack_string.h" + #define is_print(c) ((unsigned)((c) - ' ') <= '~' - ' ') char * diff --git a/modules/src/string/btscat.c b/modules/src/string/btscat.c index eaa2df65f..fe056592c 100644 --- a/modules/src/string/btscat.c +++ b/modules/src/string/btscat.c @@ -6,6 +6,8 @@ /* btscat() */ +#include "ack_string.h" + char * btscat(b1, n1, b2, n2) char *b1; diff --git a/modules/src/string/btscmp.c b/modules/src/string/btscmp.c index 90b28ad8f..acea25b58 100644 --- a/modules/src/string/btscmp.c +++ b/modules/src/string/btscmp.c @@ -6,6 +6,8 @@ /* btscmp() */ +#include "ack_string.h" + int btscmp(b1, n1, b2, n2) register char *b1, *b2; diff --git a/modules/src/string/btscpy.c b/modules/src/string/btscpy.c index dff4b8f85..feac89195 100644 --- a/modules/src/string/btscpy.c +++ b/modules/src/string/btscpy.c @@ -6,6 +6,8 @@ /* btscpy() */ +#include "ack_string.h" + char * btscpy(b1, b2, n) register char *b1, *b2; diff --git a/modules/src/string/btszero.c b/modules/src/string/btszero.c index dfdfcb650..533b4054e 100644 --- a/modules/src/string/btszero.c +++ b/modules/src/string/btszero.c @@ -6,6 +6,8 @@ /* btszero() */ +#include "ack_string.h" + char * btszero(b, n) char *b; diff --git a/modules/src/string/long2str.c b/modules/src/string/long2str.c index 7052ecaec..d89a428ef 100644 --- a/modules/src/string/long2str.c +++ b/modules/src/string/long2str.c @@ -10,6 +10,8 @@ (1985, EHB) */ +#include "ack_string.h" + #define MAXWIDTH 32 char * diff --git a/modules/src/string/proto.make b/modules/src/string/proto.make index 4fd502139..f46fa67ab 100644 --- a/modules/src/string/proto.make +++ b/modules/src/string/proto.make @@ -18,7 +18,7 @@ OBJ = bts2str.$(SUF) btscat.$(SUF) btscmp.$(SUF) btscpy.$(SUF) \ strlen.$(SUF) strncat.$(SUF) strncmp.$(SUF) strncpy.$(SUF) \ strrindex.$(SUF) strzero.$(SUF) -INCLUDES = -I$(SRC_DIR) +INCLUDES = -I$(SRC_DIR) -I$(MOD_DIR)/h CFLAGS = $(COPTIONS) $(INCLUDES) LIBSTRING = libstring.$(LIBSUF) @@ -30,16 +30,18 @@ $(LIBSTRING): $(OBJ) $(RANLIB) $(LIBSTRING) install: all + -mkdir $(MOD_DIR)/lib + -mkdir $(MOD_DIR)/h cp $(LIBSTRING) $(MOD_DIR)/lib/$(LIBSTRING) $(RANLIB) $(MOD_DIR)/lib/$(LIBSTRING) - cp $(SRC_DIR)/string.3 $(MOD_DIR)/man/string.3 + cp $(SRC_DIR)/ack_string.h $(MOD_DIR)/h/ack_string.h if [ $(DO_MACHINE_INDEP) = y ] ; \ then mk_manpage $(SRC_DIR)/string.3 $(TARGET_HOME) ; \ fi cmp: all -cmp $(LIBSTRING) $(MOD_DIR)/lib/$(LIBSTRING) - -cmp $(SRC_DIR)/string.3 $(MOD_DIR)/man/string.3 + -cmp $(SRC_DIR)/ack_string.h $(MOD_DIR)/h/ack_string.h pr: @pr $(SRC_DIR)/proto.make $(SRC) diff --git a/modules/src/string/str2bts.c b/modules/src/string/str2bts.c index 4b9abd0b7..733bfec81 100644 --- a/modules/src/string/str2bts.c +++ b/modules/src/string/str2bts.c @@ -5,6 +5,9 @@ */ /* str2bts -- (1985, EHB) */ + +#include "ack_string.h" + static is_oct(c) char c; diff --git a/modules/src/string/str2long.c b/modules/src/string/str2long.c index 294042496..e3d82ee7e 100644 --- a/modules/src/string/str2long.c +++ b/modules/src/string/str2long.c @@ -6,6 +6,8 @@ /* str2long() */ +#include "ack_string.h" + value(c, b) char c; int b; diff --git a/modules/src/string/strcat.c b/modules/src/string/strcat.c index f3f84fdc0..85f6fd8c7 100644 --- a/modules/src/string/strcat.c +++ b/modules/src/string/strcat.c @@ -5,9 +5,13 @@ */ /* append t to s */ + +#include "ack_string.h" + char * strcat(s, t) - register char *s, *t; + register char *s; + register _CONST char *t; { register char *b = s; diff --git a/modules/src/string/strcmp.c b/modules/src/string/strcmp.c index facc6616d..8d8e6fc43 100644 --- a/modules/src/string/strcmp.c +++ b/modules/src/string/strcmp.c @@ -6,9 +6,12 @@ /* return negative, zero or positive value if resp. s < t, s == t or s > t */ + +#include "ack_string.h" + int strcmp(s, t) - register char *s, *t; + register _CONST char *s, *t; { while (*s == *t++) if (*s++ == '\0') diff --git a/modules/src/string/strcpy.c b/modules/src/string/strcpy.c index 83744b985..375aabc0f 100644 --- a/modules/src/string/strcpy.c +++ b/modules/src/string/strcpy.c @@ -5,9 +5,13 @@ */ /* Copy t into s */ + +#include "ack_string.h" + char * strcpy(s, t) - register char *s, *t; + register char *s; + register _CONST char *t; { register char *b = s; diff --git a/modules/src/string/strindex.c b/modules/src/string/strindex.c index 0da1f791d..bacb6959b 100644 --- a/modules/src/string/strindex.c +++ b/modules/src/string/strindex.c @@ -6,9 +6,12 @@ /* strindex() -- (86/03/18 EHB) */ +#include "ack_string.h" + char * strindex(s, c) - register char *s, c; + register char *s; + int c; { while (*s) if (*s++ == c) diff --git a/modules/src/string/string.3 b/modules/src/string/string.3 index 7884eb00c..22bfd71a9 100644 --- a/modules/src/string/string.3 +++ b/modules/src/string/string.3 @@ -8,6 +8,8 @@ btscpy, btscat, btscmp, btszero, bts2str \- operations on and conversions between strings and row of bytes .SH SYNOPSIS .nf +.B #include +.PP .B char *strcpy(s1, s2) .B char *s1, *s2; .PP diff --git a/modules/src/string/strlen.c b/modules/src/string/strlen.c index b6e4b8370..d5c7ee042 100644 --- a/modules/src/string/strlen.c +++ b/modules/src/string/strlen.c @@ -5,11 +5,14 @@ */ /* return length of s */ -int + +#include "ack_string.h" + +_SIZET strlen(s) - char *s; + _CONST char *s; { - register char *b = s; + register _CONST char *b = s; while (*b++) ; diff --git a/modules/src/string/strncat.c b/modules/src/string/strncat.c index 25375ed7e..d4d5458df 100644 --- a/modules/src/string/strncat.c +++ b/modules/src/string/strncat.c @@ -5,10 +5,14 @@ */ /* append t to s, upto n characters */ + +#include "ack_string.h" + char * strncat(s, t, n) - register char *s, *t; - register int n; + register char *s; + register _CONST char *t; + register _SIZET n; { register char *b = s; diff --git a/modules/src/string/strncmp.c b/modules/src/string/strncmp.c index bfa77e889..a547754d2 100644 --- a/modules/src/string/strncmp.c +++ b/modules/src/string/strncmp.c @@ -6,10 +6,13 @@ /* return negative, zero or positive value if resp. s < t, s == t or s > t; compare at most n characters */ + +#include "ack_string.h" + int strncmp(s, t, n) - register char *s, *t; - register int n; + register _CONST char *s, *t; + register _SIZET n; { while (n-- > 0) { if (*s == *t++) { diff --git a/modules/src/string/strncpy.c b/modules/src/string/strncpy.c index ddd4e5069..a43c9b4f1 100644 --- a/modules/src/string/strncpy.c +++ b/modules/src/string/strncpy.c @@ -5,10 +5,14 @@ */ /* Copy t into s, upto n characters */ + +#include "ack_string.h" + char * strncpy(s, t, n) - register char *s, *t; - register int n; + register char *s; + register _CONST char *t; + register _SIZET n; { register char *b = s; diff --git a/modules/src/string/strrindex.c b/modules/src/string/strrindex.c index a10f4f76f..c352bb1bd 100644 --- a/modules/src/string/strrindex.c +++ b/modules/src/string/strrindex.c @@ -3,9 +3,13 @@ * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands. * See the copyright notice in the ACK home directory, in the file "Copyright". */ + +#include "ack_string.h" + char * strrindex(str, chr) - register char *str, chr; + register char *str; + int chr; { register char *retptr = 0; diff --git a/modules/src/string/strzero.c b/modules/src/string/strzero.c index f122cc579..e3e9dc0a0 100644 --- a/modules/src/string/strzero.c +++ b/modules/src/string/strzero.c @@ -6,6 +6,8 @@ /* strzero() */ +#include "ack_string.h" + char * strzero(s) char *s;