Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/libexec/ftpd convert to ANSI C as per style guide



details:   https://anonhg.NetBSD.org/src/rev/c777d5d0c955
branches:  trunk
changeset: 486355:c777d5d0c955
user:      lukem <lukem%NetBSD.org@localhost>
date:      Sat May 20 02:20:18 2000 +0000

description:
convert to ANSI C as per style guide

diffstat:

 libexec/ftpd/conf.c    |   36 +++-----
 libexec/ftpd/extern.h  |   84 ++++++++++----------
 libexec/ftpd/ftpcmd.y  |   43 ++++------
 libexec/ftpd/ftpd.c    |  196 +++++++++++++++---------------------------------
 libexec/ftpd/logutmp.c |    6 +-
 libexec/ftpd/logwtmp.c |    7 +-
 libexec/ftpd/popen.c   |   14 +--
 libexec/ftpd/version.h |    4 +-
 8 files changed, 146 insertions(+), 244 deletions(-)

diffs (truncated from 970 to 300 lines):

diff -r 15e46afde8e2 -r c777d5d0c955 libexec/ftpd/conf.c
--- a/libexec/ftpd/conf.c       Sat May 20 01:52:52 2000 +0000
+++ b/libexec/ftpd/conf.c       Sat May 20 02:20:18 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: conf.c,v 1.29 2000/01/13 00:04:31 lukem Exp $  */
+/*     $NetBSD: conf.c,v 1.30 2000/05/20 02:20:18 lukem Exp $  */
 
 /*-
  * Copyright (c) 1997-2000 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: conf.c,v 1.29 2000/01/13 00:04:31 lukem Exp $");
+__RCSID("$NetBSD: conf.c,v 1.30 2000/05/20 02:20:18 lukem Exp $");
 #endif /* not lint */
 
 #include <sys/types.h>
@@ -67,15 +67,15 @@
 #include "extern.h"
 #include "pathnames.h"
 
-static char *strend __P((const char *, char *));
-static int filetypematch __P((char *, int));
+static char *strend(const char *, char *);
+static int filetypematch(char *, int);
 
 
 /*
  * Initialise curclass to an `empty' state
  */
 void
-init_curclass()
+init_curclass(void)
 {
        struct ftpconv  *conv, *cnext;
 
@@ -115,8 +115,7 @@
  * define curclass to contain the appropriate settings.
  */
 void
-parse_conf(findclass)
-       char *findclass;
+parse_conf(const char *findclass)
 {
        FILE            *f;
        char            *buf, *p;
@@ -459,8 +458,7 @@
  * responses with the prefix `code' + "-".
  */
 void
-show_chdir_messages(code)
-       int     code;
+show_chdir_messages(int code)
 {
        static StringList *slist = NULL;
 
@@ -527,9 +525,7 @@
 }
 
 int
-format_file(file, code)
-       const char *file;
-       int code;
+format_file(const char *file, int code)
 {
        FILE   *f;
        char   *buf, *p, *cwd;
@@ -637,9 +633,7 @@
  * not including) s2, otherwise returns NULL.
  */
 static char *
-strend(s1, s2)
-       const char *s1;
-       char *s2;
+strend(const char *s1, char *s2)
 {
        static  char buf[MAXPATHLEN];
 
@@ -663,9 +657,7 @@
 }
 
 static int
-filetypematch(types, mode)
-       char    *types;
-       int     mode;
+filetypematch(char *types, int mode)
 {
        for ( ; types[0] != '\0'; types++)
                switch (*types) {
@@ -691,8 +683,7 @@
  * multi-threaded ftpd, and that's not likely for a while...
  */
 char **
-do_conversion(fname)
-       const char *fname;
+do_conversion(const char *fname)
 {
        struct ftpconv  *cp;
        struct stat      st;
@@ -765,8 +756,7 @@
  * (`b', `k', `m', `g'). Returns the number for success, -1 otherwise.
  */
 int
-strsuftoi(arg)
-       const char *arg;
+strsuftoi(const char *arg)
 {
        char *cp;
        long val;
@@ -810,7 +800,7 @@
  * if possible.
  */ 
 void
-count_users()
+count_users(void)
 {
        char    fn[MAXPATHLEN];
        int     fd, i, last;
diff -r 15e46afde8e2 -r c777d5d0c955 libexec/ftpd/extern.h
--- a/libexec/ftpd/extern.h     Sat May 20 01:52:52 2000 +0000
+++ b/libexec/ftpd/extern.h     Sat May 20 02:20:18 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: extern.h,v 1.25 2000/03/05 06:12:19 lukem Exp $        */
+/*     $NetBSD: extern.h,v 1.26 2000/05/20 02:20:18 lukem Exp $        */
 
 /*-
  * Copyright (c) 1992, 1993
@@ -100,45 +100,45 @@
  * SUCH DAMAGE.
  */
 
-void   blkfree __P((char **));
-char   *conffilename __P((const char *));
-char  **copyblk __P((char **));
-void   count_users __P((void));
-void   cwd __P((const char *));
-void   delete __P((const char *));
-char  **do_conversion __P((const char *));
-void   dologout __P((int));
-void   fatal __P((const char *));
-int    format_file __P((const char *, int));
-int    ftpd_pclose __P((FILE *));
-FILE   *ftpd_popen __P((char *[], const char *, int));
-char   *getline __P((char *, int, FILE *));
-void   init_curclass __P((void));
-void   logcmd __P((const char *, off_t, const char *, const char *,
-           const struct timeval *, const char *));
-void   logwtmp __P((const char *, const char *, const char *));
-void   lreply __P((int, const char *, ...));
-void   makedir __P((const char *));
-void   parse_conf __P((char *));
-void   pass __P((const char *));
-void   passive __P((void));
-void   long_passive __P((char *, int));
-void   perror_reply __P((int, const char *));
-void   pwd __P((void));
-void   removedir __P((const char *));
-void   renamecmd __P((const char *, const char *));
-char   *renamefrom __P((char *));
-void   reply __P((int, const char *, ...));
-void   retrieve __P((char *[], const char *));
-void   send_file_list __P((const char *));
-void   show_chdir_messages __P((int));
-void   statcmd __P((void));
-void   statfilecmd __P((const char *));
-void   store __P((const char *, const char *, int));
-int    strsuftoi __P((const char *));
-void   user __P((const char *));
-char   *xstrdup __P((const char *));
-void   yyerror __P((char *));
+void   blkfree(char **);
+char   *conffilename(const char *);
+char  **copyblk(char **);
+void   count_users(void);
+void   cwd(const char *);
+void   delete(const char *);
+char  **do_conversion(const char *);
+void   dologout(int);
+void   fatal(const char *);
+int    format_file(const char *, int);
+int    ftpd_pclose(FILE *);
+FILE   *ftpd_popen(char *[], const char *, int);
+char   *getline(char *, int, FILE *);
+void   init_curclass(void);
+void   logcmd(const char *, off_t, const char *, const char *,
+           const struct timeval *, const char *);
+void   logwtmp(const char *, const char *, const char *);
+void   lreply(int, const char *, ...);
+void   makedir(const char *);
+void   parse_conf(const char *);
+void   pass(const char *);
+void   passive(void);
+void   long_passive(char *, int);
+void   perror_reply(int, const char *);
+void   pwd(void);
+void   removedir(const char *);
+void   renamecmd(const char *, const char *);
+char   *renamefrom(const char *);
+void   reply(int, const char *, ...);
+void   retrieve(char *[], const char *);
+void   send_file_list(const char *);
+void   show_chdir_messages(int);
+void   statcmd(void);
+void   statfilecmd(const char *);
+void   store(const char *, const char *, int);
+int    strsuftoi(const char *);
+void   user(const char *);
+char   *xstrdup(const char *);
+void   yyerror(char *);
 
 typedef long long qdfmt_t;
 typedef unsigned long long qufmt_t;
@@ -198,7 +198,7 @@
 #define su_family      su_si.si_family
 #define su_port                su_si.si_port
 
-extern  int            yyparse __P((void));
+extern  int            yyparse(void);
 
 #ifndef        GLOBAL
 #define        GLOBAL  extern
@@ -250,6 +250,6 @@
                                (W) = strsep(&(P), " \t"); \
                        } while ((W) != NULL && *(W) == '\0')
 #define PLURAL(s)      ((s) == 1 ? "" : "s")
-#define REASSIGN(X,Y)  do { if (X) free(X); (X)=(Y); } while (0)
+#define REASSIGN(X,Y)  do { if (X) free(X); (X)=(Y); } while (/*CONSTCOND*/0)
 
 #define        INTERNAL_LS     "/bin/ls"
diff -r 15e46afde8e2 -r c777d5d0c955 libexec/ftpd/ftpcmd.y
--- a/libexec/ftpd/ftpcmd.y     Sat May 20 01:52:52 2000 +0000
+++ b/libexec/ftpd/ftpcmd.y     Sat May 20 02:20:18 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ftpcmd.y,v 1.45 2000/03/05 06:12:19 lukem Exp $        */
+/*     $NetBSD: ftpcmd.y,v 1.46 2000/05/20 02:20:18 lukem Exp $        */
 
 /*-
  * Copyright (c) 1997-1999 The NetBSD Foundation, Inc.
@@ -83,7 +83,7 @@
 #if 0
 static char sccsid[] = "@(#)ftpcmd.y   8.3 (Berkeley) 4/6/94";
 #else
-__RCSID("$NetBSD: ftpcmd.y,v 1.45 2000/03/05 06:12:19 lukem Exp $");
+__RCSID("$NetBSD: ftpcmd.y,v 1.46 2000/05/20 02:20:18 lukem Exp $");
 #endif
 #endif /* not lint */
 
@@ -1468,19 +1468,17 @@
        { NULL,    0,     0,    0, 0,   0 }
 };
 
-static void            help __P((struct tab *, char *));
-static struct tab     *lookup __P((struct tab *, const char *));
-static void            opts __P((const char *));
-static void            sizecmd __P((char *));
-static void            toolong __P((int));
-static int             yylex __P((void));
+static void            help(struct tab *, const char *);
+static struct tab     *lookup(struct tab *, const char *);
+static void            opts(const char *);
+static void            sizecmd(char *);
+static void            toolong(int);
+static int             yylex(void);
 
 extern int epsvall;
 
 static struct tab *
-lookup(p, cmd)
-       struct tab *p;
-       const char *cmd;
+lookup(struct tab *p, const char *cmd)
 {
 
        for (; p->name != NULL; p++)
@@ -1495,10 +1493,7 @@
  * getline - a hacked up version of fgets to ignore TELNET escape codes.
  */
 char *
-getline(s, n, iop)
-       char *s;
-       int n;
-       FILE *iop;
+getline(char *s, int n, FILE *iop)
 {
        off_t b;
        int c;
@@ -1585,8 +1580,7 @@
 }
 
 static void
-toolong(signo)
-       int signo;
+toolong(int signo)
 {
 
        reply(421,
@@ -1599,7 +1593,7 @@
 }
 



Home | Main Index | Thread Index | Old Index