]> git.ozlabs.org Git - ppp.git/blobdiff - pppdump/bsd-comp.c
Convert to ANSI C
[ppp.git] / pppdump / bsd-comp.c
index 966e958a1aa8bdd183ece8d384c3621b326026f0..9d45f0bf610d8aa3a1da7e6f0c2f254bb1745578 100644 (file)
@@ -124,15 +124,15 @@ struct bsd_db {
 #define BSD_OVHD       2               /* BSD compress overhead/packet */
 #define BSD_INIT_BITS  BSD_MIN_BITS
 
-static void    *bsd_decomp_alloc __P((u_char *options, int opt_len));
-static void    bsd_free __P((void *state));
-static int     bsd_decomp_init __P((void *state, u_char *options, int opt_len,
-                                    int unit, int hdrlen, int mru, int debug));
-static void    bsd_incomp __P((void *state, u_char *dmsg, int len));
-static int     bsd_decompress __P((void *state, u_char *cmp, int inlen,
-                                   u_char *dmp, int *outlen));
-static void    bsd_reset __P((void *state));
-static void    bsd_comp_stats __P((void *state, struct compstat *stats));
+static void    *bsd_decomp_alloc(u_char *options, int opt_len);
+static void    bsd_free(void *state);
+static int     bsd_decomp_init(void *state, u_char *options, int opt_len,
+                               int unit, int hdrlen, int mru, int debug);
+static void    bsd_incomp(void *state, u_char *dmsg, int len);
+static int     bsd_decompress(void *state, u_char *cmp, int inlen,
+                              u_char *dmp, int *outlen);
+static void    bsd_reset(void *state);
+static void    bsd_comp_stats(void *state, struct compstat *stats);
 
 /*
  * Exported procedures.
@@ -174,8 +174,7 @@ struct compressor ppp_bsd_compress = {
  * clear the dictionary
  */
 static void
-bsd_clear(db)
-    struct bsd_db *db;
+bsd_clear(struct bsd_db *db)
 {
     db->clear_count++;
     db->max_ent = FIRST-1;
@@ -200,8 +199,7 @@ bsd_clear(db)
  * must compute the same ratio.
  */
 static int                             /* 1=output CLEAR */
-bsd_check(db)
-    struct bsd_db *db;
+bsd_check(struct bsd_db *db)
 {
     u_int new_ratio;
 
@@ -241,9 +239,7 @@ bsd_check(db)
  * Return statistics.
  */
 static void
-bsd_comp_stats(state, stats)
-    void *state;
-    struct compstat *stats;
+bsd_comp_stats(void *state, struct compstat *stats)
 {
     struct bsd_db *db = (struct bsd_db *) state;
     u_int out;
@@ -268,8 +264,7 @@ bsd_comp_stats(state, stats)
  * Reset state, as on a CCP ResetReq.
  */
 static void
-bsd_reset(state)
-    void *state;
+bsd_reset(void *state)
 {
     struct bsd_db *db = (struct bsd_db *) state;
 
@@ -282,9 +277,7 @@ bsd_reset(state)
  * Allocate space for a (de) compressor.
  */
 static void *
-bsd_alloc(options, opt_len, decomp)
-    u_char *options;
-    int opt_len, decomp;
+bsd_alloc(u_char *options, int opt_len, int decomp)
 {
     int bits;
     u_int newlen, hsize, hshift, maxmaxcode;
@@ -350,8 +343,7 @@ bsd_alloc(options, opt_len, decomp)
 }
 
 static void
-bsd_free(state)
-    void *state;
+bsd_free(void *state)
 {
     struct bsd_db *db = (struct bsd_db *) state;
 
@@ -361,9 +353,7 @@ bsd_free(state)
 }
 
 static void *
-bsd_decomp_alloc(options, opt_len)
-    u_char *options;
-    int opt_len;
+bsd_decomp_alloc(u_char *options, int opt_len)
 {
     return bsd_alloc(options, opt_len, 1);
 }
@@ -372,10 +362,8 @@ bsd_decomp_alloc(options, opt_len)
  * Initialize the database.
  */
 static int
-bsd_init(db, options, opt_len, unit, hdrlen, mru, debug, decomp)
-    struct bsd_db *db;
-    u_char *options;
-    int opt_len, unit, hdrlen, mru, debug, decomp;
+bsd_init(struct bsd_db *db, u_char *options, int opt_len, int unit,
+        int hdrlen, int mru, int debug, int decomp)
 {
     int i;
 
@@ -409,10 +397,8 @@ bsd_init(db, options, opt_len, unit, hdrlen, mru, debug, decomp)
 }
 
 static int
-bsd_decomp_init(state, options, opt_len, unit, hdrlen, mru, debug)
-    void *state;
-    u_char *options;
-    int opt_len, unit, hdrlen, mru, debug;
+bsd_decomp_init(void *state, u_char *options, int opt_len,
+               int unit, int hdrlen, int mru, int debug)
 {
     return bsd_init((struct bsd_db *) state, options, opt_len,
                    unit, hdrlen, mru, debug, 1);
@@ -424,10 +410,7 @@ bsd_decomp_init(state, options, opt_len, unit, hdrlen, mru, debug)
  * incompressible data by pretending to compress the incoming data.
  */
 static void
-bsd_incomp(state, dmsg, mlen)
-    void *state;
-    u_char *dmsg;
-    int mlen;
+bsd_incomp(void *state, u_char *dmsg, int mlen)
 {
     struct bsd_db *db = (struct bsd_db *) state;
     u_int hshift = db->hshift;
@@ -544,10 +527,7 @@ bsd_incomp(state, dmsg, mlen)
  * compression, even though they are detected by inspecting the input.
  */
 static int
-bsd_decompress(state, cmsg, inlen, dmp, outlenp)
-    void *state;
-    u_char *cmsg, *dmp;
-    int inlen, *outlenp;
+bsd_decompress(void *state, u_char *cmsg, int inlen, u_char *dmp, int *outlenp)
 {
     struct bsd_db *db = (struct bsd_db *) state;
     u_int max_ent = db->max_ent;