Added prototyping stuff
authorceriel <none@none>
Wed, 10 Nov 1993 12:09:49 +0000 (12:09 +0000)
committerceriel <none@none>
Wed, 10 Nov 1993 12:09:49 +0000 (12:09 +0000)
37 files changed:
modules/src/print/doprnt.c
modules/src/print/format.c
modules/src/print/fprint.c
modules/src/print/print.3
modules/src/print/print.c
modules/src/print/print.h
modules/src/print/proto.make
modules/src/print/sprint.c
modules/src/read_em/em_comp.h
modules/src/read_em/mkcalls.c
modules/src/read_em/proto.make
modules/src/read_em/read_em.3
modules/src/read_em/read_em.c
modules/src/read_em/reade.c
modules/src/read_em/readk.c
modules/src/string/.distr
modules/src/string/ack_string.h [new file with mode: 0644]
modules/src/string/bts2str.c
modules/src/string/btscat.c
modules/src/string/btscmp.c
modules/src/string/btscpy.c
modules/src/string/btszero.c
modules/src/string/long2str.c
modules/src/string/proto.make
modules/src/string/str2bts.c
modules/src/string/str2long.c
modules/src/string/strcat.c
modules/src/string/strcmp.c
modules/src/string/strcpy.c
modules/src/string/strindex.c
modules/src/string/string.3
modules/src/string/strlen.c
modules/src/string/strncat.c
modules/src/string/strncmp.c
modules/src/string/strncpy.c
modules/src/string/strrindex.c
modules/src/string/strzero.c

index 6fb10a6..aa4bb9b 100644 (file)
@@ -5,7 +5,7 @@
 /* $Header$ */
 
 #include <system.h>
-#include <varargs.h>
+#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;
index 1a2c7fd..6b91eff 100644 (file)
@@ -4,7 +4,8 @@
  */
 /* $Header$ */
 
-#include <varargs.h>
+#include <system.h>
+#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;
index aa2be85..86cd1be 100644 (file)
@@ -4,8 +4,8 @@
  */
 /* $Header$ */
 
-#include <varargs.h>
 #include <system.h>
+#include "print.h"
 #include "param.h"
 
 /*FORMAT1v $
        %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);
 }
index 77288a3..33d8807 100644 (file)
@@ -5,19 +5,19 @@ print, fprint, sprint, doprnt -- very simple formatted-output routines
 .SH SYNOPSIS
 .nf
 .B #include <system.h>
-.B #include <varargs.h>
+.B #include <print.h>
 .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 <varargs.h>
-#include <system.h>
-
-/*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
index 135b131..82590bd 100644 (file)
@@ -4,8 +4,8 @@
  */
 /* $Header$ */
 
-#include <varargs.h>
 #include <system.h>
+#include "print.h"
 #include "param.h"
 
 /*FORMAT0v $
        %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);
 }
index ff82fe4..04a52c7 100644 (file)
@@ -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 <ansi.h>
+#if __STDC__
+#include <stdarg.h>
+#else
+#include <varargs.h>
+#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__ */
index ad71aa0..e878d9b 100644 (file)
@@ -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)
index 9d87703..868e0b7 100644 (file)
@@ -4,8 +4,8 @@
  */
 /* $Header$ */
 
-#include <varargs.h>
 #include <system.h>
+#include "print.h"
 #include "param.h"
 
 /*FORMAT1v $
 $ */
 /*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;
index 2e160b6..f11859e 100644 (file)
@@ -6,6 +6,8 @@
 #ifndef __EMCOMP_INCLUDED__
 #define __EMCOMP_INCLUDED__
 
+#include <ansi.h>
+
 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
index b42db72..4adc514 100644 (file)
@@ -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;
 {
index b10e3d4..9e19575 100644 (file)
@@ -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)
index 4bc86ed..d7f041d 100644 (file)
@@ -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
index 3857ceb..e0fcadb 100644 (file)
@@ -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;
 {
index 46a278e..5a79db2 100644 (file)
@@ -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;
 {
index 919ab5c..c1894f5 100644 (file)
@@ -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;
 {
index 6611c28..a44d0db 100644 (file)
@@ -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 (file)
index 0000000..97c666e
--- /dev/null
@@ -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 <ansi.h>
+
+_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__ */
index a529de2..db7d632 100644 (file)
@@ -8,6 +8,8 @@
        86/03/17 EHB
 */
 
+#include "ack_string.h"
+
 #define is_print(c)    ((unsigned)((c) - ' ') <= '~' - ' ')
 
 char *
index eaa2df6..fe05659 100644 (file)
@@ -6,6 +6,8 @@
 /* btscat()
 */
 
+#include "ack_string.h"
+
 char *
 btscat(b1, n1, b2, n2)
        char *b1;
index 90b28ad..acea25b 100644 (file)
@@ -6,6 +6,8 @@
 /* btscmp()
 */
 
+#include "ack_string.h"
+
 int
 btscmp(b1, n1, b2, n2)
        register char *b1, *b2;
index dff4b8f..feac891 100644 (file)
@@ -6,6 +6,8 @@
 /* btscpy()
 */
 
+#include "ack_string.h"
+
 char *
 btscpy(b1, b2, n)
        register char *b1, *b2;
index dfdfcb6..533b405 100644 (file)
@@ -6,6 +6,8 @@
 /* btszero()
 */
 
+#include "ack_string.h"
+
 char *
 btszero(b, n)
        char *b;
index 7052eca..d89a428 100644 (file)
@@ -10,6 +10,8 @@
        (1985, EHB)
 */
 
+#include "ack_string.h"
+
 #define MAXWIDTH 32
 
 char *
index 4fd5021..f46fa67 100644 (file)
@@ -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)
index 4b9abd0..733bfec 100644 (file)
@@ -5,6 +5,9 @@
  */
 /* str2bts -- (1985, EHB)
 */
+
+#include "ack_string.h"
+
 static
 is_oct(c)
        char c;
index 2940424..e3d82ee 100644 (file)
@@ -6,6 +6,8 @@
 /* str2long()
 */
 
+#include "ack_string.h"
+
 value(c, b)
        char c;
        int b;
index f3f84fd..85f6fd8 100644 (file)
@@ -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;
 
index facc661..8d8e6fc 100644 (file)
@@ -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')
index 83744b9..375aabc 100644 (file)
@@ -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;
 
index 0da1f79..bacb695 100644 (file)
@@ -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)
index 7884eb0..22bfd71 100644 (file)
@@ -8,6 +8,8 @@ btscpy, btscat, btscmp, btszero, bts2str \- operations on and
 conversions between strings and row of bytes
 .SH SYNOPSIS
 .nf
+.B #include <ack_string.h>
+.PP
 .B char *strcpy(s1, s2)
 .B char *s1, *s2;
 .PP
index b6e4b83..d5c7ee0 100644 (file)
@@ -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++)
                ;
index 25375ed..d4d5458 100644 (file)
@@ -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;
 
index bfa77e8..a547754 100644 (file)
@@ -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++) {
index ddd4e50..a43c9b4 100644 (file)
@@ -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;
 
index a10f4f7..c352bb1 100644 (file)
@@ -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;
 
index f122cc5..e3e9dc0 100644 (file)
@@ -6,6 +6,8 @@
 /* strzero()
 */
 
+#include "ack_string.h"
+
 char *
 strzero(s)
        char *s;