From 815d557e167e76015934397dffbfa869180dcdbc Mon Sep 17 00:00:00 2001 From: didg Date: Tue, 13 Oct 2009 22:55:36 +0000 Subject: [PATCH] remove pre ansi declarations --- bin/aecho/aecho.c | 14 +- bin/afile/achfile.c | 4 +- bin/afile/afile.c | 4 +- bin/cnid/ad.c | 4 +- bin/cnid/ad_cp.c | 4 +- bin/cnid/ad_ls.c | 4 +- bin/getzones/getzones.c | 9 +- bin/megatron/asingle.c | 19 +- bin/megatron/hqx.c | 34 +- bin/megatron/macbin.c | 28 +- bin/megatron/macbin.h | 3 +- bin/megatron/megatron.c | 38 +- bin/megatron/megatron.h | 6 +- bin/megatron/nad.c | 32 +- bin/megatron/updcrc.c | 25 +- bin/megatron/updcrc.h | 19 + bin/nbp/nbplkup.c | 9 +- bin/nbp/nbprgstr.c | 9 +- bin/nbp/nbpunrgstr.c | 9 +- bin/pap/pap.c | 20 +- bin/pap/papstatus.c | 15 +- bin/psorder/pa.c | 11 +- bin/psorder/pa.h | 8 +- bin/psorder/psorder.c | 447 +++++++++++------------- bin/psorder/psorder.h | 28 +- bin/uniconv/uniconv.c | 4 +- etc/afpd/afp_asp.c | 6 +- etc/afpd/afp_config.h | 12 +- etc/afpd/afp_dsi.c | 8 +- etc/afpd/afp_options.c | 6 +- etc/afpd/appl.c | 41 +-- etc/afpd/auth.c | 74 ++-- etc/afpd/auth.h | 20 +- etc/afpd/catsearch.c | 4 +- etc/afpd/desktop.c | 48 +-- etc/afpd/desktop.h | 30 +- etc/afpd/directory.c | 102 ++---- etc/afpd/directory.h | 90 ++--- etc/afpd/enumerate.c | 32 +- etc/afpd/file.c | 53 +-- etc/afpd/file.h | 44 +-- etc/afpd/filedir.c | 52 +-- etc/afpd/filedir.h | 30 +- etc/afpd/fork.c | 106 ++---- etc/afpd/fork.h | 60 ++-- etc/afpd/gettok.c | 13 +- etc/afpd/globals.h | 28 +- etc/afpd/main.c | 8 +- etc/afpd/mangle.h | 8 +- etc/afpd/messages.c | 10 +- etc/afpd/misc.h | 10 +- etc/afpd/nfsquota.c | 11 +- etc/afpd/ofork.c | 33 +- etc/afpd/quota.c | 48 +-- etc/afpd/status.c | 9 +- etc/afpd/status.h | 14 +- etc/afpd/switch.c | 7 +- etc/afpd/switch.h | 4 +- etc/afpd/uam_auth.h | 34 +- etc/afpd/unix.c | 63 +--- etc/afpd/unix.h | 34 +- etc/afpd/volume.c | 76 +--- etc/afpd/volume.h | 26 +- etc/atalkd/aep.c | 12 +- etc/atalkd/atserv.h | 19 +- etc/atalkd/config.c | 58 ++- etc/atalkd/interface.h | 4 +- etc/atalkd/main.c | 44 +-- etc/atalkd/main.h | 14 +- etc/atalkd/multicast.c | 9 +- etc/atalkd/multicast.h | 6 +- etc/atalkd/nbp.c | 14 +- etc/atalkd/nbp.h | 9 +- etc/atalkd/route.c | 12 +- etc/atalkd/route.h | 6 +- etc/atalkd/rtmp.c | 44 +-- etc/atalkd/rtmp.h | 20 +- etc/atalkd/zip.c | 29 +- etc/atalkd/zip.h | 9 +- etc/cnid_dbd/cmd_dbd.c | 4 +- etc/cnid_dbd/cnid_metad.c | 8 +- etc/cnid_dbd/comm.c | 4 +- etc/cnid_dbd/comm.h | 10 +- etc/cnid_dbd/db_param.c | 4 +- etc/cnid_dbd/db_param.h | 4 +- etc/cnid_dbd/dbif.c | 4 +- etc/cnid_dbd/pack.c | 12 +- etc/cnid_dbd/usockfd.h | 8 +- etc/papd/auth.c | 4 +- etc/papd/comment.c | 20 +- etc/papd/comment.h | 14 +- etc/papd/file.c | 21 +- etc/papd/file.h | 10 +- etc/papd/headers.c | 23 +- etc/papd/lp.c | 45 +-- etc/papd/lp.h | 28 +- etc/papd/magics.c | 21 +- etc/papd/main.c | 31 +- etc/papd/ppd.c | 23 +- etc/papd/ppd.h | 8 +- etc/papd/print_cups.c | 4 +- etc/papd/print_cups.h | 14 +- etc/papd/printcap.c | 104 +++--- etc/papd/printcap.h | 16 +- etc/papd/queries.c | 51 +-- etc/papd/session.c | 6 +- etc/papd/showppd.c | 6 +- etc/papd/uam_auth.h | 32 +- etc/psf/psa.c | 6 +- etc/psf/psf.c | 13 +- etc/uams/uams_dhx2_pam.c | 4 +- etc/uams/uams_dhx_pam.c | 4 +- etc/uams/uams_guest.c | 12 +- etc/uams/uams_pam.c | 12 +- etc/uams/uams_passwd.c | 10 +- include/atalk/adouble.h | 106 +++--- include/atalk/asp.h | 24 +- include/atalk/atp.h | 20 +- include/atalk/compat.h | 10 +- include/atalk/dsi.h | 48 +-- include/atalk/nbp.h | 14 +- include/atalk/netddp.h | 12 +- include/atalk/server_child.h | 26 +- include/atalk/uam.h | 24 +- include/atalk/unicode.h | 104 +++--- include/atalk/util.h | 36 +- libatalk/adouble/ad_flush.c | 9 +- libatalk/adouble/ad_open.c | 26 +- libatalk/adouble/ad_read.c | 9 +- libatalk/adouble/ad_write.c | 18 +- libatalk/asp/asp_close.c | 5 +- libatalk/asp/asp_cmdreply.c | 6 +- libatalk/asp/asp_getsess.c | 4 +- libatalk/asp/asp_init.c | 10 +- libatalk/asp/asp_shutdown.c | 5 +- libatalk/atp/atp_bufs.c | 9 +- libatalk/atp/atp_close.c | 5 +- libatalk/atp/atp_internals.h | 26 +- libatalk/atp/atp_packet.c | 19 +- libatalk/atp/atp_rreq.c | 8 +- libatalk/atp/atp_rresp.c | 8 +- libatalk/atp/atp_rsel.c | 13 +- libatalk/atp/atp_sresp.c | 8 +- libatalk/cnid/cdb/cnid_cdb.h | 34 +- libatalk/cnid/cdb/cnid_cdb_open.c | 12 +- libatalk/cnid/cdb/cnid_cdb_private.h | 6 +- libatalk/cnid/cnid_init.c | 4 +- libatalk/cnid/db3/cnid_db3.h | 28 +- libatalk/cnid/dbd/cnid_dbd.h | 30 +- libatalk/cnid/hash/cnid_hash.h | 22 +- libatalk/cnid/last/cnid_last.h | 20 +- libatalk/cnid/mtab/cnid_mtab.h | 20 +- libatalk/cnid/tdb/cnid_tdb.h | 22 +- libatalk/dsi/dsi_private.h | 6 +- libatalk/dsi/dsi_tcp.c | 4 +- libatalk/nbp/nbp_conf.h | 6 +- libatalk/nbp/nbp_lkup.c | 10 +- libatalk/nbp/nbp_rgstr.c | 6 +- libatalk/nbp/nbp_unrgstr.c | 6 +- libatalk/nbp/nbp_util.c | 15 +- libatalk/unicode/charsets/generic_cjk.h | 18 +- libatalk/util/atalk_addr.c | 4 +- libatalk/util/getiface.c | 2 +- libatalk/util/logger.c | 2 +- 164 files changed, 1546 insertions(+), 2313 deletions(-) create mode 100644 bin/megatron/updcrc.h diff --git a/bin/aecho/aecho.c b/bin/aecho/aecho.c index fef8bc2b..e1210e66 100644 --- a/bin/aecho/aecho.c +++ b/bin/aecho/aecho.c @@ -1,5 +1,5 @@ /* - * $Id: aecho.c,v 1.7 2005-04-28 20:49:18 bfernhomberg Exp $ + * $Id: aecho.c,v 1.8 2009-10-13 22:55:36 didg Exp $ * * Copyright (c) 1990,1991 Regents of The University of Michigan. * All Rights Reserved. @@ -67,7 +67,7 @@ unsigned int pings = 0; void usage(char *); -void done() +void done(int sig _U_) { if ( nsent) { printf( "\n----%d.%d AEP Statistics----\n", @@ -82,7 +82,7 @@ void done() exit( 0 ); } -void aep_send() +void aep_send(int sig _U_) { struct timeval tv; char *p, buf[ 1024 ]; @@ -108,12 +108,10 @@ void aep_send() exit( 1 ); } nsent++; - if (pings && nsent > pings) done(); + if (pings && nsent > pings) done(0); } -int main( ac, av ) - int ac; - char **av; +int main(int ac, char **av) { struct servent *se; struct sigaction sv; @@ -255,7 +253,7 @@ int main( ac, av ) printf( "%d bytes from %u.%u: aep_seq=%d. time=%ld. ms\n", cc, ntohs( sat.sat_addr.s_net ), sat.sat_addr.s_node, seq, ms ); - if (pings && seq + 1 >= pings) done(); + if (pings && seq + 1 >= pings) done(0); } } diff --git a/bin/afile/achfile.c b/bin/afile/achfile.c index 31fc3be8..db8bfad3 100644 --- a/bin/afile/achfile.c +++ b/bin/afile/achfile.c @@ -1,5 +1,5 @@ /* - * $Id: achfile.c,v 1.5 2001-10-19 02:39:07 jmarcus Exp $ + * $Id: achfile.c,v 1.6 2009-10-13 22:55:36 didg Exp $ * afile - determine the MacOS creator/type of files @@ -81,7 +81,7 @@ void help(char *prog) } /* Print the version. */ -void version() +void version(void) { fprintf(stderr, "achfile (netatalk " VERSION ")\n"); } diff --git a/bin/afile/afile.c b/bin/afile/afile.c index 2a7bbbad..4cf8a353 100644 --- a/bin/afile/afile.c +++ b/bin/afile/afile.c @@ -1,5 +1,5 @@ /* - * $Id: afile.c,v 1.5 2001-09-05 18:38:23 srittau Exp $ + * $Id: afile.c,v 1.6 2009-10-13 22:55:36 didg Exp $ * afile - determine the MacOS creator/type of files @@ -92,7 +92,7 @@ void help(char *prog) } /* Print the version. */ -void version() +void version(void) { fprintf(stderr, "afile (netatalk " VERSION ")\n"); } diff --git a/bin/cnid/ad.c b/bin/cnid/ad.c index a569659c..95faece7 100644 --- a/bin/cnid/ad.c +++ b/bin/cnid/ad.c @@ -1,5 +1,5 @@ /* - $Id: ad.c,v 1.1 2009-09-01 14:28:07 franklahm Exp $ + $Id: ad.c,v 1.2 2009-10-13 22:55:36 didg Exp $ Copyright (c) 2009 Frank Lahm @@ -32,7 +32,7 @@ #include #include "ad.h" -static void usage_main() +static void usage_main(void) { /* printf("Usage: ad ls|rm|cp|mv|set [file|dir, ...]\n"); diff --git a/bin/cnid/ad_cp.c b/bin/cnid/ad_cp.c index e2f2472b..ae158361 100644 --- a/bin/cnid/ad_cp.c +++ b/bin/cnid/ad_cp.c @@ -1,5 +1,5 @@ /* - $Id: ad_cp.c,v 1.1 2009-09-01 14:28:07 franklahm Exp $ + $Id: ad_cp.c,v 1.2 2009-10-13 22:55:36 didg Exp $ Copyright (c) 2009 Frank Lahm @@ -73,7 +73,7 @@ static const char *check_netatalk_dirs(const char *name) } -static void usage_cp() +static void usage_cp(void) { printf( "Usage: ad cp [-R [-L | -P]] [-pv] \n" diff --git a/bin/cnid/ad_ls.c b/bin/cnid/ad_ls.c index ab1385a6..4b609295 100644 --- a/bin/cnid/ad_ls.c +++ b/bin/cnid/ad_ls.c @@ -1,5 +1,5 @@ /* - $Id: ad_ls.c,v 1.2 2009-09-14 01:24:40 didg Exp $ + $Id: ad_ls.c,v 1.3 2009-10-13 22:55:36 didg Exp $ Copyright (c) 2009 Frank Lahm @@ -88,7 +88,7 @@ static const char *check_netatalk_dirs(const char *name) } -static void usage_ls() +static void usage_ls(void) { printf( "Usage: ad ls [-dRl[u]] [file|dir, ...]\n\n" diff --git a/bin/getzones/getzones.c b/bin/getzones/getzones.c index 7b717386..6d8a5eef 100644 --- a/bin/getzones/getzones.c +++ b/bin/getzones/getzones.c @@ -1,5 +1,5 @@ /* - * $Id: getzones.c,v 1.7 2005-04-28 20:49:19 bfernhomberg Exp $ + * $Id: getzones.c,v 1.8 2009-10-13 22:55:36 didg Exp $ */ #ifdef HAVE_CONFIG_H @@ -29,16 +29,13 @@ void print_zones(short n, char *buf); -void usage( s ) - char *s; +void usage( char *s) { fprintf( stderr, "usage:\t%s [-m | -l] [address]\n", s ); exit( 1 ); } -int main( argc, argv ) - int argc; - char *argv[]; +int main( int argc, char *argv[]) { struct atp_handle *ah; struct atp_block atpb; diff --git a/bin/megatron/asingle.c b/bin/megatron/asingle.c index 818c198a..b9756e82 100644 --- a/bin/megatron/asingle.c +++ b/bin/megatron/asingle.c @@ -1,5 +1,5 @@ /* - * $Id: asingle.c,v 1.11 2006-02-26 22:45:05 didg Exp $ + * $Id: asingle.c,v 1.12 2009-10-13 22:55:36 didg Exp $ */ #ifdef HAVE_CONFIG_H @@ -62,10 +62,7 @@ u_char header_buf[ AD_HEADER_LEN ]; * somewhat initialized; single_filed is set. */ -int single_open( singlefile, flags, fh, options ) - char *singlefile; - int flags, options _U_; - struct FHeader *fh; +int single_open(char *singlefile, int flags, struct FHeader *fh, int options _U_) { int rc; @@ -96,8 +93,7 @@ int single_open( singlefile, flags, fh, options ) * Otherwise, a value of -1 is returned. */ -int single_close( keepflag ) - int keepflag; +int single_close( int keepflag) { if ( keepflag == KEEP ) { return( close( single.filed )); @@ -116,9 +112,7 @@ int single_close( keepflag ) * bytes of the other two forks can be read, as well. */ -int single_header_read( fh, version ) - struct FHeader *fh; - int version; +int single_header_read( struct FHeader *fh, int version) { /* * entry_buf is used for reading in entry descriptors, and for reading in @@ -395,10 +389,7 @@ int single_header_test(void) * */ -int single_read( fork, buffer, length ) - int fork; - char *buffer; - u_int32_t length; +int single_read( int fork, char *buffer, u_int32_t length) { u_int32_t entry_id; char *buf_ptr; diff --git a/bin/megatron/hqx.c b/bin/megatron/hqx.c index 3f0406d5..96561413 100644 --- a/bin/megatron/hqx.c +++ b/bin/megatron/hqx.c @@ -1,5 +1,5 @@ /* - * $Id: hqx.c,v 1.14 2005-04-28 20:49:19 bfernhomberg Exp $ + * $Id: hqx.c,v 1.15 2009-10-13 22:55:36 didg Exp $ */ #ifdef HAVE_CONFIG_H @@ -30,6 +30,7 @@ #include "megatron.h" #include "nad.h" #include "hqx.h" +#include "updcrc.h" #define HEXOUTPUT 0 @@ -65,8 +66,6 @@ #define BHH_CRCSIZ 2 #define BHH_HEADSIZ 21 -u_short updcrc(); - /* Forward declarations. */ int skip_junk(int line); @@ -101,10 +100,7 @@ somewhat initialized; hqx_fd is set. skip_junk is called from here; skip_junk leaves hqx7_first and hqx7_last set. */ -int hqx_open( hqxfile, flags, fh, options ) - char *hqxfile; - int flags, options; - struct FHeader *fh; +int hqx_open(char *hqxfile, int flags, struct FHeader *fh, int options) { int maxlen; @@ -166,8 +162,7 @@ int hqx_open( hqxfile, flags, fh, options ) * Otherwise, a value of -1 is returned. */ -int hqx_close( keepflag ) - int keepflag; +int hqx_close(int keepflag) { if ( keepflag == KEEP ) { return( close( hqx.filed )); @@ -188,10 +183,7 @@ int hqx_close( keepflag ) * return zero and no more than that. */ -int hqx_read( fork, buffer, length ) - int fork; - char *buffer; - int length; +int hqx_read(int fork, char *buffer, int length) { u_short storedcrc; int readlen; @@ -258,8 +250,7 @@ int hqx_read( fork, buffer, length ) * to fill the hqx_header fields. */ -int hqx_header_read( fh ) - struct FHeader *fh; +int hqx_header_read(struct FHeader *fh) { char *headerbuf, *headerptr; u_int32_t time_seconds; @@ -392,8 +383,7 @@ int hqx_header_read( fh ) * hqx_header_write. */ -int hqx_header_write( fh ) - struct FHeader *fh _U_; +int hqx_header_write(struct FHeader *fh _U_) { return( -1 ); } @@ -405,8 +395,7 @@ int hqx_header_write( fh ) * it sets the pointers to the hqx7 buffer up to point to the valid data. */ -int hqx7_fill( hqx7_ptr ) - u_char *hqx7_ptr; +int hqx7_fill(u_char *hqx7_ptr) { int cc; int cs; @@ -476,8 +465,7 @@ u_char hqxlookup[] = { * OTHER when looking for any subsequent line. */ -int skip_junk( line ) -int line; +int skip_junk(int line) { int found = NOWAY; int stopflag; @@ -578,9 +566,7 @@ int line; * file is reached. */ -int hqx_7tobin( outbuf, datalen ) - char *outbuf; - int datalen; +int hqx_7tobin( char *outbuf, int datalen) { static u_char hqx8[3]; static int hqx8i; diff --git a/bin/megatron/macbin.c b/bin/megatron/macbin.c index bf85a080..d43bb37d 100644 --- a/bin/megatron/macbin.c +++ b/bin/megatron/macbin.c @@ -1,5 +1,5 @@ /* - * $Id: macbin.c,v 1.12 2005-04-28 20:49:19 bfernhomberg Exp $ + * $Id: macbin.c,v 1.13 2009-10-13 22:55:36 didg Exp $ */ #ifdef HAVE_CONFIG_H @@ -26,6 +26,7 @@ #include #include "megatron.h" #include "macbin.h" +#include "updcrc.h" /* This allows megatron to generate .bin files that won't choke other well-known converter apps. It also makes sure that checksums @@ -69,10 +70,7 @@ u_char head_buf[HEADBUFSIZ]; * somewhat initialized; bin_filed is set. */ -int bin_open( binfile, flags, fh, options ) - char *binfile; - int flags, options; - struct FHeader *fh; +int bin_open(char *binfile, int flags, struct FHeader *fh, int options) { int maxlen; int rc; @@ -145,8 +143,7 @@ int bin_open( binfile, flags, fh, options ) * Otherwise, a value of -1 is returned. */ -int bin_close( keepflag ) - int keepflag; +int bin_close(int keepflag) { #if DEBUG fprintf( stderr, "entering bin_close\n" ); @@ -170,10 +167,7 @@ int bin_close( keepflag ) * return zero and no more than that. */ -int bin_read( fork, buffer, length ) - int fork; - char *buffer; - int length; +int bin_read( int fork, char *buffer, int length) { char *buf_ptr; int readlen; @@ -242,10 +236,7 @@ int bin_read( fork, buffer, length ) * bin_write */ -int bin_write( fork, buffer, length ) - int fork; - char *buffer; - int length; +int bin_write(int fork, char *buffer, int length) { char *buf_ptr; int writelen; @@ -329,9 +320,7 @@ int bin_write( fork, buffer, length ) * of the bytes of the other two forks can be read, as well. */ -int bin_header_read( fh, revision ) - struct FHeader *fh; - int revision; +int bin_header_read(struct FHeader *fh, int revision) { u_short mask; @@ -431,8 +420,7 @@ int bin_header_read( fh, revision ) * bin_header_write and bin_header_read are opposites. */ -int bin_header_write( fh ) - struct FHeader *fh; +int bin_header_write(struct FHeader *fh) { char *write_ptr; u_int32_t t; diff --git a/bin/megatron/macbin.h b/bin/megatron/macbin.h index d84f7411..e9ec2834 100644 --- a/bin/megatron/macbin.h +++ b/bin/megatron/macbin.h @@ -1,5 +1,5 @@ /* - * $Id: macbin.h,v 1.2 2001-06-29 14:14:46 rufustfirefly Exp $ + * $Id: macbin.h,v 1.3 2009-10-13 22:55:36 didg Exp $ */ #ifndef _MACBIN_H @@ -15,6 +15,5 @@ int bin_write(int fork, char *buffer, int length); int bin_header_read(struct FHeader *fh, int revision); int bin_header_write(struct FHeader *fh); int test_header(void); -u_short updcrc(); #endif /* _MACBIN_H */ diff --git a/bin/megatron/megatron.c b/bin/megatron/megatron.c index 09035f4c..48810abd 100644 --- a/bin/megatron/megatron.c +++ b/bin/megatron/megatron.c @@ -1,5 +1,5 @@ /* - * $Id: megatron.c,v 1.10 2005-04-28 20:49:20 bfernhomberg Exp $ + * $Id: megatron.c,v 1.11 2009-10-13 22:55:36 didg Exp $ */ #ifdef HAVE_CONFIG_H @@ -36,10 +36,7 @@ char *name[] = { "unhex", "binheader", "megatron" }; -int from_open( un, file, fh, flags ) - int un, flags; - char *file; - struct FHeader *fh; +int from_open(int un, char *file, struct FHeader *fh, int flags) { switch ( un ) { case MEGATRON : @@ -64,11 +61,7 @@ int from_open( un, file, fh, flags ) } } -int from_read( un, fork, buf, len ) - int un; - int fork; - char *buf; - int len; +int from_read(int un, int fork, char *buf, int len) { switch ( un ) { case MEGATRON : @@ -91,8 +84,7 @@ int from_read( un, fork, buf, len ) } } -int from_close( un ) - int un; +int from_close(int un) { switch ( un ) { case MEGATRON : @@ -115,10 +107,7 @@ int from_close( un ) } } -int to_open( to, file, fh, flags ) - int to, flags; - char *file; - struct FHeader *fh; +int to_open(int to, char *file, struct FHeader *fh, int flags) { switch ( to ) { case MEGATRON : @@ -138,10 +127,7 @@ int to_open( to, file, fh, flags ) } } -int to_write( to, fork, bufc ) - int to; - int fork; - int bufc; +int to_write(int to, int fork, int bufc) { switch ( to ) { case MEGATRON : @@ -161,9 +147,7 @@ int to_write( to, fork, bufc ) } } -int to_close( to, keepflag ) - int to; - int keepflag; +int to_close(int to, int keepflag) { switch ( to ) { case MEGATRON : @@ -183,9 +167,7 @@ int to_close( to, keepflag ) } } -int megatron( path, module, newname, flags ) - char *path, *newname; - int module, flags; +int megatron( char *path, int module, char *newname, int flags) { struct stat st; struct FHeader fh; @@ -293,9 +275,7 @@ int megatron( path, module, newname, flags ) return( from_close( module )); } -int main( argc, argv ) - int argc; - char **argv; +int main(int argc, char **argv) { int rc, c; int rv = 0; diff --git a/bin/megatron/megatron.h b/bin/megatron/megatron.h index ec36053b..259c2642 100644 --- a/bin/megatron/megatron.h +++ b/bin/megatron/megatron.h @@ -1,5 +1,5 @@ /* - * $Id: megatron.h,v 1.3 2002-04-29 01:52:50 morgana Exp $ + * $Id: megatron.h,v 1.4 2009-10-13 22:55:36 didg Exp $ */ #ifndef _MEGATRON_H @@ -92,8 +92,8 @@ struct FHeader { # define S_ISDIR(s) (( s & S_IFMT ) == S_IFDIR ) #endif /* ! S_ISDIR */ -extern char *(*_mtoupath) __P(( char *)); -extern char *(*_utompath) __P(( char *)); +extern char *(*_mtoupath) ( char *); +extern char *(*_utompath) ( char *); #define mtoupath(s) (*_mtoupath)(s) #define utompath(s) (*_utompath)(s) diff --git a/bin/megatron/nad.c b/bin/megatron/nad.c index f9aab5d5..2e105675 100644 --- a/bin/megatron/nad.c +++ b/bin/megatron/nad.c @@ -1,5 +1,5 @@ /* - * $Id: nad.c,v 1.15 2006-09-29 09:39:16 didg Exp $ + * $Id: nad.c,v 1.16 2009-10-13 22:55:36 didg Exp $ */ #ifdef HAVE_CONFIG_H @@ -31,8 +31,7 @@ struct volinfo vol; static char hexdig[] = "0123456789abcdef"; static char mtou_buf[MAXPATHLEN + 1], utom_buf[MAXPATHLEN + 1]; -static char *mtoupathcap( mpath ) - char *mpath; +static char *mtoupathcap(char *mpath) { char *m, *u, *umax; int i = 0; @@ -67,8 +66,7 @@ static char *mtoupathcap( mpath ) #define hextoint( c ) ( isdigit( c ) ? c - '0' : c + 10 - 'a' ) #define islxdigit(x) (!isupper(x)&&isxdigit(x)) -static char *utompathcap( upath ) - char *upath; +static char *utompathcap( char *upath) { char *m, *u; int h; @@ -431,10 +429,7 @@ static void initvol(char *path) } -int nad_open( path, openflags, fh, options ) - char *path; - int openflags, options; - struct FHeader *fh; +int nad_open( char *path, int openflags, struct FHeader *fh, int options) { struct stat st; int fork; @@ -499,8 +494,7 @@ int nad_open( path, openflags, fh, options ) } } -int nad_header_read( fh ) - struct FHeader *fh; +int nad_header_read(struct FHeader *fh) { u_int32_t temptime; struct stat st; @@ -611,8 +605,7 @@ int nad_header_read( fh ) } -int nad_header_write( fh ) - struct FHeader *fh; +int nad_header_write(struct FHeader *fh) { u_int32_t temptime; @@ -698,10 +691,7 @@ int nad_header_write( fh ) int forkeid[] = { ADEID_DFORK, ADEID_RFORK }; -int nad_read( fork, forkbuf, bufc ) - int fork; - char *forkbuf; - int bufc; +int nad_read(int fork, char *forkbuf, int bufc) { int cc = 0; @@ -723,10 +713,7 @@ int nad_read( fork, forkbuf, bufc ) return( cc ); } -int nad_write( fork, forkbuf, bufc ) - int fork; - char *forkbuf; - int bufc; +int nad_write(int fork, char *forkbuf, int bufc) { char *buf_ptr; int writelen; @@ -758,8 +745,7 @@ int nad_write( fork, forkbuf, bufc ) return( bufc ); } -int nad_close( status ) -int status; +int nad_close(int status) { int rv; if ( status == KEEP ) { diff --git a/bin/megatron/updcrc.c b/bin/megatron/updcrc.c index 25090505..d327571d 100644 --- a/bin/megatron/updcrc.c +++ b/bin/megatron/updcrc.c @@ -1,5 +1,5 @@ /* - * $Id: updcrc.c,v 1.4 2001-06-29 14:14:46 rufustfirefly Exp $ + * $Id: updcrc.c,v 1.5 2009-10-13 22:55:36 didg Exp $ * * updcrc(3), crc(1) - calculate crc polynomials * @@ -32,6 +32,8 @@ #include "config.h" #endif /* HAVE_CONFIG_H */ +#include "updcrc.h" + /* The CRC polynomial. * These 4 values define the crc-polynomial. * If you change them, you must change crctab[]'s initial value to what is @@ -43,15 +45,6 @@ #if 0 #define SWAPPED /* bit order: undef defined defined */ #endif /* 0 */ -#define W 16 /* bits in CRC:16 16 16 */ - - /* data type that holds a W-bit unsigned integer */ -#if W <= 16 -# define WTYPE unsigned short -#else /* W <= 16 */ -# define WTYPE u_int32_t -#endif /* W <= 16 */ - /* the number of bits per char: don't change it. */ #define B 8 @@ -91,10 +84,7 @@ static WTYPE crctab[1< -main() +int main(void) { initcrctab(); } -initcrctab() +void initcrctab(void) { register int b, i; WTYPE v; @@ -153,8 +143,7 @@ initcrctab() -main( ac, av ) - int ac; char **av; +main( int ac, char **av) { int fd; int nr; diff --git a/bin/megatron/updcrc.h b/bin/megatron/updcrc.h new file mode 100644 index 00000000..0b6039e5 --- /dev/null +++ b/bin/megatron/updcrc.h @@ -0,0 +1,19 @@ +/* + * $Id: updcrc.h,v 1.1 2009-10-13 22:55:36 didg Exp $ + */ + +#ifndef _UPDCRC_H +#define _UPDCRC_H 1 + +#define W 16 /* bits in CRC:16 16 16 */ + + /* data type that holds a W-bit unsigned integer */ +#if W <= 16 +# define WTYPE unsigned short +#else /* W <= 16 */ +# define WTYPE u_int32_t +#endif /* W <= 16 */ + +WTYPE updcrc(WTYPE icrc, unsigned char *icp, int icnt); + +#endif /* _UPDCRC_H */ diff --git a/bin/nbp/nbplkup.c b/bin/nbp/nbplkup.c index 932b9e0f..821f0e08 100644 --- a/bin/nbp/nbplkup.c +++ b/bin/nbp/nbplkup.c @@ -1,5 +1,5 @@ /* - * $Id: nbplkup.c,v 1.5 2005-04-28 20:49:20 bfernhomberg Exp $ + * $Id: nbplkup.c,v 1.6 2009-10-13 22:55:36 didg Exp $ * * Copyright (c) 1990,1991 Regents of The University of Michigan. * All Rights Reserved. @@ -45,8 +45,7 @@ char *Obj = "="; char *Type = "="; char *Zone = "*"; -void Usage( av0 ) - char *av0; +void Usage(char *av0) { char *p; @@ -60,9 +59,7 @@ void Usage( av0 ) exit( 1 ); } -int main( ac, av ) - int ac; - char **av; +int main(int ac, char **av) { struct nbpnve *nn; char *name; diff --git a/bin/nbp/nbprgstr.c b/bin/nbp/nbprgstr.c index ca740577..7b9bd4b0 100644 --- a/bin/nbp/nbprgstr.c +++ b/bin/nbp/nbprgstr.c @@ -1,5 +1,5 @@ /* - * $Id: nbprgstr.c,v 1.5 2005-04-28 20:49:20 bfernhomberg Exp $ + * $Id: nbprgstr.c,v 1.6 2009-10-13 22:55:36 didg Exp $ * * Copyright (c) 1990,1993 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. @@ -22,8 +22,7 @@ #include #include -void Usage( av0 ) - char *av0; +void Usage(char *av0) { char *p; @@ -37,9 +36,7 @@ void Usage( av0 ) exit( 1 ); } -int main( ac, av ) - int ac; - char **av; +int main(int ac, char **av) { struct sockaddr_at addr; struct at_addr ataddr; diff --git a/bin/nbp/nbpunrgstr.c b/bin/nbp/nbpunrgstr.c index aa69ae3b..b9cd2347 100644 --- a/bin/nbp/nbpunrgstr.c +++ b/bin/nbp/nbpunrgstr.c @@ -1,5 +1,5 @@ /* - * $Id: nbpunrgstr.c,v 1.6 2005-04-28 20:49:20 bfernhomberg Exp $ + * $Id: nbpunrgstr.c,v 1.7 2009-10-13 22:55:36 didg Exp $ * * Copyright (c) 1990,1991 Regents of The University of Michigan. * All Rights Reserved. @@ -41,8 +41,7 @@ #include -void Usage( av0 ) - char *av0; +void Usage(char *av0) { char *p; @@ -56,9 +55,7 @@ void Usage( av0 ) exit( 1 ); } -int main( ac, av ) - int ac; - char **av; +int main(int ac, char **av) { char *Obj = 0, *Type = 0, *Zone = 0; char *convname = 0; diff --git a/bin/pap/pap.c b/bin/pap/pap.c index 9679614d..3649547f 100644 --- a/bin/pap/pap.c +++ b/bin/pap/pap.c @@ -1,5 +1,5 @@ /* - * $Id: pap.c,v 1.10 2005-04-28 20:49:20 bfernhomberg Exp $ + * $Id: pap.c,v 1.11 2009-10-13 22:55:36 didg Exp $ * * Copyright (c) 1990,1994 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. @@ -36,8 +36,7 @@ char *nbpfailure = "AppleTalk printer offline"; void updatestatus(char *s, int len); int send_file(int fd, ATP atp, int lastfile); -void usage( path ) - char *path; +void usage(char *path) { char *p; @@ -64,7 +63,7 @@ void usage( path ) } char * -paprc() +paprc(void) { static char s[ 32 + 1 + 32 + 1 + 32 ]; char *name = NULL; @@ -148,9 +147,7 @@ struct iovec sfiov[ PAP_MAXQUANTUM ] = { int debug; -int main( ac, av ) - int ac; - char **av; +int main( int ac, char **av) { ATP atp; struct atp_block atpb; @@ -468,10 +465,7 @@ int data = 0; unsigned char port; u_int16_t seq = 0, rseq = 1; -int send_file( fd, atp, lastfile ) - int fd; - ATP atp; - int lastfile; +int send_file( int fd, ATP atp, int lastfile) { struct timeval stv, tv; struct sockaddr_at ssat; @@ -845,9 +839,7 @@ int send_file( fd, atp, lastfile ) } } -void updatestatus( s, len ) - char *s; - int len; +void updatestatus(char *s, int len) { int fd = -1; struct iovec iov[ 3 ]; diff --git a/bin/pap/papstatus.c b/bin/pap/papstatus.c index 940463aa..ed51580a 100644 --- a/bin/pap/papstatus.c +++ b/bin/pap/papstatus.c @@ -1,5 +1,5 @@ /* - * $Id: papstatus.c,v 1.5 2005-04-28 20:49:20 bfernhomberg Exp $ + * $Id: papstatus.c,v 1.6 2009-10-13 22:55:36 didg Exp $ * * Copyright (c) 1990,1991 Regents of The University of Michigan. * All Rights Reserved. @@ -47,8 +47,7 @@ /* Forward Declaration */ void getstatus(ATP atp, struct sockaddr_at *sat); -void usage( path ) - char *path; +void usage(char *path) { char *p; @@ -63,7 +62,7 @@ void usage( path ) } char * -paprc() +paprc(void) { static char s[ 32 + 1 + 32 + 1 + 32 ]; char *name = NULL; @@ -89,9 +88,7 @@ char *printer = NULL; char cbuf[ 8 ]; struct nbpnve nn; -int main( ac, av ) - int ac; - char **av; +int main( int ac, char **av) { ATP atp; int wait, c, err = 0; @@ -167,9 +164,7 @@ int main( ac, av ) return 0; } -void getstatus( atp, sat ) - ATP atp; - struct sockaddr_at *sat; +void getstatus(ATP atp, struct sockaddr_at *sat) { struct iovec iov; struct atp_block atpb; diff --git a/bin/psorder/pa.c b/bin/psorder/pa.c index f5a25ece..ef72fd5d 100644 --- a/bin/psorder/pa.c +++ b/bin/psorder/pa.c @@ -1,5 +1,5 @@ /* - * $Id: pa.c,v 1.4 2001-06-29 14:14:46 rufustfirefly Exp $ + * $Id: pa.c,v 1.5 2009-10-13 22:55:36 didg Exp $ * * Copyright (c) 1990,1991 Regents of The University of Michigan. * All Rights Reserved. @@ -37,8 +37,7 @@ #include "pa.h" -pa_buf_t *pa_init( fd ) - int fd; +pa_buf_t *pa_init(int fd) { pa_buf_t *h; int rc; @@ -59,8 +58,7 @@ pa_buf_t *pa_init( fd ) return( h ); } -char *pa_gettok( h ) - pa_buf_t *h; +char *pa_gettok(pa_buf_t *h) { h->state = PA_NORMAL; h->tmp = *(h->cur); @@ -68,8 +66,7 @@ char *pa_gettok( h ) return( h->mark ); } -char _pa_fixbuf( h ) - pa_buf_t *h; +char _pa_fixbuf(pa_buf_t *h) { int rc; char *t; diff --git a/bin/psorder/pa.h b/bin/psorder/pa.h index e8663676..78399705 100644 --- a/bin/psorder/pa.h +++ b/bin/psorder/pa.h @@ -1,5 +1,5 @@ /* - * $Id: pa.h,v 1.2 2001-06-29 14:14:46 rufustfirefly Exp $ + * $Id: pa.h,v 1.3 2009-10-13 22:55:36 didg Exp $ * * Copyright (c) 1990,1991 Regents of The University of Michigan. * All Rights Reserved. @@ -63,9 +63,9 @@ typedef struct pa_buf_t { char tmp; } pa_buf_t; -extern pa_buf_t *pa_init(); -extern char _pa_fixbuf(); -extern char *pa_gettok(); +extern pa_buf_t *pa_init(int fd); +extern char _pa_fixbuf(pa_buf_t *h); +extern char *pa_gettok(pa_buf_t *h); #define pa_getchar(h) (((h)->cur==(h)->end)?(_pa_fixbuf(h)):\ (*(++((h)->cur)))) diff --git a/bin/psorder/psorder.c b/bin/psorder/psorder.c index 7d514862..37c5fc4a 100644 --- a/bin/psorder/psorder.c +++ b/bin/psorder/psorder.c @@ -1,5 +1,5 @@ /* - * $Id: psorder.c,v 1.6 2008-12-03 18:35:44 didg Exp $ + * $Id: psorder.c,v 1.7 2009-10-13 22:55:36 didg Exp $ * * Copyright (c) 1990,1991 Regents of The University of Michigan. * All Rights Reserved. @@ -57,70 +57,30 @@ u_char psbuf[ 8192 ]; struct psinfo_st psinfo; int orderflag, forceflag; -int main( argc, argv ) - int argc; - char **argv; +void +filecleanup( int errorcode, int tfd, char *tfile) { - extern int optind; - char *progname; - int errflag = 0; - int c; - while (( c = getopt( argc, argv, OPTSTR )) != -1 ) { - switch ( c ) { - case REVCHAR: - if ( orderflag ) errflag++; - else orderflag = REVERSE; - break; - case FORWCHAR: - if ( orderflag ) errflag++; - else orderflag = FORWARD; - break; - case FORCECHAR: - if ( forceflag ) errflag++; - else forceflag++; - break; - } - } - if ( errflag ) { - if (( progname = strrchr( argv[ 0 ], '/' )) == NULL ) { - progname = argv[ 0 ]; - } else progname++; - fprintf( stderr, "usage: %s [-duf] [sourcefile]\n", progname ); - return( -1 ); - } else if ( !orderflag ) orderflag = FORWARD; +/* + Close and unlink the temporary file. + */ - if ( optind >= argc ) { - return( psorder( STDIN )); + if ( tfd != 0 ) { + if ( close( tfd ) != 0 ) { + perror( tfile ); + exit( errorcode ); + } + if ( unlink( tfile ) != 0 ) { + perror( tfile ); + exit( errorcode ); + } } - return( psorder( argv[ optind ] )); -} - -int -psorder( path ) - char *path; -{ - int tempfd; - int inputfd; - char tempfile[MAXNAMLEN]; - filesetup( path, &inputfd, tempfile, &tempfd ); - readps( inputfd, tempfd, tempfile ); - if ( lseek( tempfd, REWIND, SEEK_SET ) < 0 ) { - perror( tempfile ); - filecleanup( -1, tempfd, tempfile ); - } - writeps( tempfd, tempfile ); - filecleanup( 0, tempfd, tempfile ); - return( 0 ); + exit( errorcode ); } void -filesetup( inputfile, infd, tfile, tfd ) - char *inputfile; - int *infd; - char *tfile; - int *tfd; +filesetup( char *inputfile, int *infd, char *tfile, int *tfd) { struct stat st; char *template = _PATH_TMPPAGEORDER; @@ -173,11 +133,111 @@ filesetup( inputfile, infd, tfile, tfd ) return; } +struct pspage_st +*getpspage(off_t off) +{ + struct pspage_st *newpspage; + + newpspage = (struct pspage_st *)malloc( sizeof( struct pspage_st )); + if ( newpspage != NULL ) { + newpspage->offset = off; + newpspage->nextpage = NULL; + *newpspage->lable = '\0'; + *newpspage->ord = '\0'; + } + return( newpspage ); +} + +int +handletok(off_t count, char *token) +{ + int incdoc = 0; + struct pspage_st *newpage; + char *tmp; + + if (( strncmp( PENDDOC, token, strlen( PENDDOC )) == 0 ) && incdoc ) { + incdoc--; +#if DEBUG + fprintf( stderr, "found an EndDoc\n" ); +#endif /* DEBUG */ + + } else if ( strncmp( PBEGINDOC, token, strlen( PBEGINDOC )) == 0 ) { + incdoc++; +#if DEBUG + fprintf( stderr, "found a BeginDoc\n" ); +#endif /* DEBUG */ + + } else if ( !incdoc && + ( strncmp( PPAGE, token, strlen( PPAGE )) == 0 )) { +#if DEBUG + fprintf( stderr, "found a Page\n" ); +#endif /* DEBUG */ + if (( newpage = getpspage( count )) == NULL ) { + return( -1 ); + } + if ( psinfo.firstpage == NULL ) { + newpage->prevpage = NULL; + psinfo.firstpage = newpage; + } else { + newpage->prevpage = psinfo.lastpage; + psinfo.lastpage->nextpage = newpage; + } + psinfo.lastpage = newpage; + while ( *token++ != ':' ); + if (( tmp = strtok( token, WHITESPACE )) != NULL ) { + (void)strncpy( newpage->lable, tmp, NUMLEN ); + if (( tmp = strtok( NULL, WHITESPACE )) != NULL ) { + (void)strncpy( newpage->ord, tmp, ORDLEN ); + } + } +#if DEBUG + fprintf( stderr, "page lable %s, page ord %s\n", newpage->lable, + newpage->ord ); +#endif /* DEBUG */ + + } else if ( !incdoc && + ( strncmp( PPAGES, token, strlen( PPAGES )) == 0 )) { +#if DEBUG + fprintf( stderr, "found a Pages\n" ); +#endif /* DEBUG */ + psinfo.pages.offset = count; + psinfo.pages.end = strlen( token ) + count; + while ( *token++ != ':' ); + while ( isspace( *token )) token++; + if ( strncmp( ATEND, token, strlen( ATEND )) == 0 ) { +#if DEBUG + fprintf( stderr, "it is a Pages: (atend)\n" ); +#endif /* DEBUG */ + psinfo.pages.offset = 0; + psinfo.pages.end = 0; + } else { + if (( tmp = strtok( token, WHITESPACE )) != NULL ) { + (void)strncpy( psinfo.pages.num, tmp, NUMLEN ); + if (( tmp = strtok( NULL, WHITESPACE )) != NULL ) { + (void)strncpy( psinfo.pages.order, tmp, ORDERLEN ); + } + } +#if DEBUG + fprintf( stderr, "number of pages %s\n", psinfo.pages.num ); + fprintf( stderr, "order control number %s\n", psinfo.pages.order ); +#endif /* DEBUG */ + } + + } else if ( !incdoc && + ( strncmp( PTRAILER, token, strlen( PTRAILER )) == 0 )) { +#if DEBUG + fprintf( stderr, "found the Trailer\n" ); +#endif /* DEBUG */ + if ( psinfo.trailer == 0 ) { + psinfo.trailer = count; + } + } + + return( 0 ); +} + void -readps( inputfd, tempfd, tempfile ) - int inputfd; - int tempfd; - char *tempfile; +readps(int inputfd, int tempfd, char *tempfile) { off_t ccread = 0; off_t ccmatch; @@ -276,100 +336,66 @@ readps( inputfd, tempfd, tempfile ) return; } -int -handletok( count, token ) - off_t count; - char *token; +void +temp2out(int tempfd, char *tempfile, off_t length) { - int incdoc = 0; - struct pspage_st *newpage; - char *tmp; - - if (( strncmp( PENDDOC, token, strlen( PENDDOC )) == 0 ) && incdoc ) { - incdoc--; -#if DEBUG - fprintf( stderr, "found an EndDoc\n" ); -#endif /* DEBUG */ - - } else if ( strncmp( PBEGINDOC, token, strlen( PBEGINDOC )) == 0 ) { - incdoc++; -#if DEBUG - fprintf( stderr, "found a BeginDoc\n" ); -#endif /* DEBUG */ - - } else if ( !incdoc && - ( strncmp( PPAGE, token, strlen( PPAGE )) == 0 )) { -#if DEBUG - fprintf( stderr, "found a Page\n" ); -#endif /* DEBUG */ - if (( newpage = getpspage( count )) == NULL ) { - return( -1 ); - } - if ( psinfo.firstpage == NULL ) { - newpage->prevpage = NULL; - psinfo.firstpage = newpage; - } else { - newpage->prevpage = psinfo.lastpage; - psinfo.lastpage->nextpage = newpage; - } - psinfo.lastpage = newpage; - while ( *token++ != ':' ); - if (( tmp = strtok( token, WHITESPACE )) != NULL ) { - (void)strncpy( newpage->lable, tmp, NUMLEN ); - if (( tmp = strtok( NULL, WHITESPACE )) != NULL ) { - (void)strncpy( newpage->ord, tmp, ORDLEN ); - } - } -#if DEBUG - fprintf( stderr, "page lable %s, page ord %s\n", newpage->lable, - newpage->ord ); -#endif /* DEBUG */ + int ccread; + int ccwrite; + int size; - } else if ( !incdoc && - ( strncmp( PPAGES, token, strlen( PPAGES )) == 0 )) { -#if DEBUG - fprintf( stderr, "found a Pages\n" ); -#endif /* DEBUG */ - psinfo.pages.offset = count; - psinfo.pages.end = strlen( token ) + count; - while ( *token++ != ':' ); - while ( isspace( *token )) token++; - if ( strncmp( ATEND, token, strlen( ATEND )) == 0 ) { -#if DEBUG - fprintf( stderr, "it is a Pages: (atend)\n" ); -#endif /* DEBUG */ - psinfo.pages.offset = 0; - psinfo.pages.end = 0; - } else { - if (( tmp = strtok( token, WHITESPACE )) != NULL ) { - (void)strncpy( psinfo.pages.num, tmp, NUMLEN ); - if (( tmp = strtok( NULL, WHITESPACE )) != NULL ) { - (void)strncpy( psinfo.pages.order, tmp, ORDERLEN ); + while ( length > 0 ) { + if ( length > sizeof( psbuf )) { + size = sizeof( psbuf ); + } else size = length; + if (( ccread = read( tempfd, psbuf, size )) > 0 ) { + size = ccread; + while ( ccread > 0 ) { + ccwrite = write( 1, psbuf, ccread ); + if ( ccwrite < 0 ) { + perror( "stdout" ); + filecleanup( ccwrite, tempfd, tempfile ); + } else { + ccread -= ccwrite; } } -#if DEBUG - fprintf( stderr, "number of pages %s\n", psinfo.pages.num ); - fprintf( stderr, "order control number %s\n", psinfo.pages.order ); -#endif /* DEBUG */ } - - } else if ( !incdoc && - ( strncmp( PTRAILER, token, strlen( PTRAILER )) == 0 )) { -#if DEBUG - fprintf( stderr, "found the Trailer\n" ); -#endif /* DEBUG */ - if ( psinfo.trailer == 0 ) { - psinfo.trailer = count; + if ( ccread < 0 ) { + perror( "temporary file" ); + filecleanup( ccread, tempfd, tempfile ); } + length -= size; } +} - return( 0 ); +void +writelable(int tempfd, char *tempfile, char *lable) +{ + char line[256]; + int ccwrite; + int linelen; + char *argone; + char *argtwo; + + if ( strcmp( lable, PPAGES ) == 0 ) { + argone = psinfo.pages.num; + argtwo = psinfo.pages.order; + } else { + argone = argtwo = NULL; + } + (void)sprintf( line, "%s %s %s", lable, argone, argtwo ); + linelen = strlen( line ); + + ccwrite = write( 1, line, linelen ); + if ( ccwrite < 0 ) { + perror( "stdout" ); + filecleanup( ccwrite, tempfd, tempfile ); + } else { + linelen -= ccwrite; + } } void -writeps( tempfd, tempfile ) - int tempfd; - char *tempfile; +writeps(int tempfd, char *tempfile) { struct stat st; off_t endofpage; @@ -463,107 +489,58 @@ writeps( tempfd, tempfile ) return; } -void -writelable( tempfd, tempfile, lable ) - int tempfd; - char *tempfile; - char *lable; +int +psorder(char *path) { - char line[256]; - int ccwrite; - int linelen; - char *argone; - char *argtwo; - - if ( strcmp( lable, PPAGES ) == 0 ) { - argone = psinfo.pages.num; - argtwo = psinfo.pages.order; - } else { - argone = argtwo = NULL; - } - (void)sprintf( line, "%s %s %s", lable, argone, argtwo ); - linelen = strlen( line ); + int tempfd; + int inputfd; + char tempfile[MAXNAMLEN]; - ccwrite = write( 1, line, linelen ); - if ( ccwrite < 0 ) { - perror( "stdout" ); - filecleanup( ccwrite, tempfd, tempfile ); - } else { - linelen -= ccwrite; + filesetup( path, &inputfd, tempfile, &tempfd ); + readps( inputfd, tempfd, tempfile ); + if ( lseek( tempfd, REWIND, SEEK_SET ) < 0 ) { + perror( tempfile ); + filecleanup( -1, tempfd, tempfile ); } + writeps( tempfd, tempfile ); + filecleanup( 0, tempfd, tempfile ); + return( 0 ); } -void -temp2out( tempfd, tempfile, length ) - int tempfd; - char *tempfile; - off_t length; +int main(int argc, char **argv) { - int ccread; - int ccwrite; - int size; + extern int optind; + char *progname; + int errflag = 0; + int c; - while ( length > 0 ) { - if ( length > sizeof( psbuf )) { - size = sizeof( psbuf ); - } else size = length; - if (( ccread = read( tempfd, psbuf, size )) > 0 ) { - size = ccread; - while ( ccread > 0 ) { - ccwrite = write( 1, psbuf, ccread ); - if ( ccwrite < 0 ) { - perror( "stdout" ); - filecleanup( ccwrite, tempfd, tempfile ); - } else { - ccread -= ccwrite; - } - } - } - if ( ccread < 0 ) { - perror( "temporary file" ); - filecleanup( ccread, tempfd, tempfile ); + while (( c = getopt( argc, argv, OPTSTR )) != -1 ) { + switch ( c ) { + case REVCHAR: + if ( orderflag ) errflag++; + else orderflag = REVERSE; + break; + case FORWCHAR: + if ( orderflag ) errflag++; + else orderflag = FORWARD; + break; + case FORCECHAR: + if ( forceflag ) errflag++; + else forceflag++; + break; } - length -= size; } -} - -struct pspage_st -*getpspage( off ) - off_t off; -{ - struct pspage_st *newpspage; + if ( errflag ) { + if (( progname = strrchr( argv[ 0 ], '/' )) == NULL ) { + progname = argv[ 0 ]; + } else progname++; + fprintf( stderr, "usage: %s [-duf] [sourcefile]\n", progname ); + return( -1 ); + } else if ( !orderflag ) orderflag = FORWARD; - newpspage = (struct pspage_st *)malloc( sizeof( struct pspage_st )); - if ( newpspage != NULL ) { - newpspage->offset = off; - newpspage->nextpage = NULL; - *newpspage->lable = '\0'; - *newpspage->ord = '\0'; + if ( optind >= argc ) { + return( psorder( STDIN )); } - return( newpspage ); + return( psorder( argv[ optind ] )); } -void -filecleanup( errorcode, tfd, tfile ) - int errorcode; - int tfd; - char *tfile; -{ - -/* - Close and unlink the temporary file. - */ - - if ( tfd != 0 ) { - if ( close( tfd ) != 0 ) { - perror( tfile ); - exit( errorcode ); - } - if ( unlink( tfile ) != 0 ) { - perror( tfile ); - exit( errorcode ); - } - } - - exit( errorcode ); -} diff --git a/bin/psorder/psorder.h b/bin/psorder/psorder.h index bc09943b..5d810b45 100644 --- a/bin/psorder/psorder.h +++ b/bin/psorder/psorder.h @@ -1,5 +1,5 @@ /* - * $Id: psorder.h,v 1.2 2001-06-29 14:14:46 rufustfirefly Exp $ + * $Id: psorder.h,v 1.3 2009-10-13 22:55:36 didg Exp $ * * Copyright (c) 1990,1991 Regents of The University of Michigan. * All Rights Reserved. @@ -77,29 +77,3 @@ struct psinfo_st { struct pages_st pages; }; -int -psorder(); - -void -filesetup(); - -void -readps(); - -int -handletok(); - -void -writeps(); - -void -writelable(); - -void -temp2out(); - -struct pspage_st -*getpspage(); - -void -filecleanup(); diff --git a/bin/uniconv/uniconv.c b/bin/uniconv/uniconv.c index f75225b9..081c4493 100644 --- a/bin/uniconv/uniconv.c +++ b/bin/uniconv/uniconv.c @@ -411,12 +411,12 @@ static void usage( char * name ) exit( 1 ); } -static void print_version () +static void print_version (void) { fprintf( stderr, "uniconv - Netatalk %s\n", VERSION ); } -static void help () +static void help (void) { fprintf (stdout, "\nuniconv, a tool to convert between various Netatalk volume encodings\n"); fprintf (stdout, "\nUsage: uniconv [-ndv] -c cnid -f fromcode -t tocode [-m maccode] path\n\n"); diff --git a/etc/afpd/afp_asp.c b/etc/afpd/afp_asp.c index cb40d1d5..5a5a0b3f 100644 --- a/etc/afpd/afp_asp.c +++ b/etc/afpd/afp_asp.c @@ -1,5 +1,5 @@ /* - * $Id: afp_asp.c,v 1.23 2008-12-03 18:35:44 didg Exp $ + * $Id: afp_asp.c,v 1.24 2009-10-13 22:55:36 didg Exp $ * * Copyright (c) 1997 Adrian Sun (asun@zoology.washington.edu) * Copyright (c) 1990,1993 Regents of The University of Michigan. @@ -145,7 +145,7 @@ static void afp_asp_die(const int sig) /* ----------------------------- * SIGUSR1 */ -static void afp_asp_timedown() +static void afp_asp_timedown(int sig _U_) { struct sigaction sv; struct itimerval it; @@ -189,7 +189,7 @@ static void afp_asp_timedown() */ extern volatile int reload_request; -static void afp_asp_reload() +static void afp_asp_reload(int sig _U_) { reload_request = 1; } diff --git a/etc/afpd/afp_config.h b/etc/afpd/afp_config.h index cb54af02..1a0d08ef 100644 --- a/etc/afpd/afp_config.h +++ b/etc/afpd/afp_config.h @@ -1,5 +1,5 @@ /* - * $Id: afp_config.h,v 1.4 2005-04-28 20:49:39 bfernhomberg Exp $ + * $Id: afp_config.h,v 1.5 2009-10-13 22:55:36 didg Exp $ */ #ifndef AFPD_CONFIG_H @@ -19,13 +19,13 @@ typedef struct AFPConfig { unsigned char *optcount; char status[1400]; const void *defoptions, *signature; - int (*server_start) __P((struct AFPConfig *, struct AFPConfig *, - server_child *)); - void (*server_cleanup) __P((const struct AFPConfig *)); + int (*server_start) (struct AFPConfig *, struct AFPConfig *, + server_child *); + void (*server_cleanup) (const struct AFPConfig *); struct AFPConfig *next; } AFPConfig; -extern AFPConfig *configinit __P((struct afp_options *)); -extern void configfree __P((AFPConfig *, const AFPConfig *)); +extern AFPConfig *configinit (struct afp_options *); +extern void configfree (AFPConfig *, const AFPConfig *); #endif diff --git a/etc/afpd/afp_dsi.c b/etc/afpd/afp_dsi.c index b9f45706..789d81a8 100644 --- a/etc/afpd/afp_dsi.c +++ b/etc/afpd/afp_dsi.c @@ -1,5 +1,5 @@ /* - * $Id: afp_dsi.c,v 1.37 2009-07-21 13:41:16 didg Exp $ + * $Id: afp_dsi.c,v 1.38 2009-10-13 22:55:36 didg Exp $ * * Copyright (c) 1999 Adrian Sun (asun@zoology.washington.edu) * Copyright (c) 1990,1993 Regents of The University of Michigan. @@ -108,7 +108,7 @@ static void afp_dsi_sleep(void) } /* ------------------- */ -static void afp_dsi_timedown() +static void afp_dsi_timedown(int sig _U_) { struct sigaction sv; struct itimerval it; @@ -156,7 +156,7 @@ static void afp_dsi_timedown() */ volatile int reload_request = 0; -static void afp_dsi_reload() +static void afp_dsi_reload(int sig _U_) { reload_request = 1; } @@ -170,7 +170,7 @@ static void afp_dsi_getmesg (int sig _U_) } #endif /* SERVERTEXT */ -static void alarm_handler() +static void alarm_handler(int sig _U_) { int err; diff --git a/etc/afpd/afp_options.c b/etc/afpd/afp_options.c index c078108c..d1e85bc5 100644 --- a/etc/afpd/afp_options.c +++ b/etc/afpd/afp_options.c @@ -1,5 +1,5 @@ /* - * $Id: afp_options.c,v 1.45 2009-09-04 15:27:21 franklahm Exp $ + * $Id: afp_options.c,v 1.46 2009-10-13 22:55:36 didg Exp $ * * Copyright (c) 1997 Adrian Sun (asun@zoology.washington.edu) * Copyright (c) 1990,1993 Regents of The University of Michigan. @@ -448,7 +448,7 @@ int afp_options_parseline(char *buf, struct afp_options *options) * Show version information about afpd. * Used by "afp -v". */ -void show_version( ) +void show_version( void ) { printf( "afpd %s - Apple Filing Protocol (AFP) daemon of Netatalk\n\n", VERSION ); @@ -506,7 +506,7 @@ void show_version( ) * Show extended version information about afpd and Netatalk. * Used by "afp -V". */ -void show_version_extended( ) +void show_version_extended(void ) { show_version( ); diff --git a/etc/afpd/appl.c b/etc/afpd/appl.c index 3189ab5f..16a268ca 100644 --- a/etc/afpd/appl.c +++ b/etc/afpd/appl.c @@ -1,5 +1,5 @@ /* - * $Id: appl.c,v 1.16 2008-12-03 18:35:44 didg Exp $ + * $Id: appl.c,v 1.17 2009-10-13 22:55:36 didg Exp $ * * Copyright (c) 1990,1993 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. @@ -29,20 +29,12 @@ static struct savedt sa = { { 0, 0, 0, 0 }, -1, 0, 0}; -static int pathcmp( p, plen, q, qlen ) -char *p; -int plen; -char *q; -int qlen; +static int pathcmp(char *p, int plen, char *q, int qlen) { return (( plen == qlen && memcmp( p, q, plen ) == 0 ) ? 0 : 1 ); } -static int applopen( vol, creator, flags, mode ) -struct vol *vol; -u_char creator[ 4 ]; -int flags; -int mode; +static int applopen(struct vol *vol, u_char creator[ 4 ], int flags, int mode) { char *dtf, *adt, *adts; @@ -89,11 +81,7 @@ int mode; /* * copy appls to new file, deleting any matching (old) appl entries */ -static int copyapplfile( sfd, dfd, mpath, mplen ) -int sfd; -int dfd; -char *mpath; -u_short mplen; +static int copyapplfile(int sfd, int dfd, char *mpath, u_short mplen) { int cc; char *p; @@ -134,11 +122,7 @@ u_short mplen; * See afp_getappl() for the backward compatiblity code. */ static char * -makemacpath( mpath, mpathlen, dir, path ) -char *mpath; -int mpathlen; -struct dir *dir; -char *path; +makemacpath(char *mpath, int mpathlen, struct dir *dir, char *path) { char *p; @@ -159,10 +143,7 @@ char *path; } -int afp_addappl(obj, ibuf, ibuflen, rbuf, rbuflen ) -AFPObj *obj; -char *ibuf, *rbuf _U_; -int ibuflen _U_, *rbuflen; +int afp_addappl(AFPObj *obj, char *ibuf, int ibuflen _U_, char *rbuf _U_, int *rbuflen) { struct vol *vol; struct dir *dir; @@ -249,10 +230,7 @@ int ibuflen _U_, *rbuflen; return( AFP_OK ); } -int afp_rmvappl(obj, ibuf, ibuflen, rbuf, rbuflen ) -AFPObj *obj; -char *ibuf, *rbuf _U_; -int ibuflen _U_, *rbuflen; +int afp_rmvappl(AFPObj *obj, char *ibuf, int ibuflen _U_, char *rbuf _U_, int *rbuflen) { struct vol *vol; struct dir *dir; @@ -323,10 +301,7 @@ int ibuflen _U_, *rbuflen; return( AFP_OK ); } -int afp_getappl(obj, ibuf, ibuflen, rbuf, rbuflen ) -AFPObj *obj; -char *ibuf, *rbuf; -int ibuflen _U_, *rbuflen; +int afp_getappl(AFPObj *obj, char *ibuf, int ibuflen _U_, char *rbuf, int *rbuflen) { struct vol *vol; char *p, *q; diff --git a/etc/afpd/auth.c b/etc/afpd/auth.c index e86e0ffd..eee06dfe 100644 --- a/etc/afpd/auth.c +++ b/etc/afpd/auth.c @@ -1,5 +1,5 @@ /* - * $Id: auth.c,v 1.66 2009-10-02 09:32:40 franklahm Exp $ + * $Id: auth.c,v 1.67 2009-10-13 22:55:36 didg Exp $ * * Copyright (c) 1990,1993 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. @@ -94,8 +94,7 @@ static struct uam_obj uam_changepw = {"", "", 0, {{NULL, NULL, NULL, NULL}}, &ua static struct uam_obj *afp_uam = NULL; -void status_versions( data ) - char *data; +void status_versions( char *data) { char *start = data; u_int16_t status; @@ -159,19 +158,13 @@ static int send_reply(const AFPObj *obj, const int err) return AFP_OK; } -static int afp_errpwdexpired(obj, ibuf, ibuflen, rbuf, rbuflen ) - AFPObj *obj _U_; - char *ibuf _U_, *rbuf _U_; - int ibuflen _U_, *rbuflen; +static int afp_errpwdexpired(AFPObj *obj _U_, char *ibuf _U_, int ibuflen _U_, char *rbuf _U_, int *rbuflen) { *rbuflen = 0; return AFPERR_PWDEXPR; } -static int afp_null_nolog(obj, ibuf, ibuflen, rbuf, rbuflen ) - AFPObj *obj _U_; - char *ibuf _U_, *rbuf _U_; - int ibuflen _U_, *rbuflen; +static int afp_null_nolog(AFPObj *obj _U_, char *ibuf _U_, int ibuflen _U_, char *rbuf _U_, int *rbuflen) { *rbuflen = 0; return( AFPERR_NOOP ); @@ -401,10 +394,10 @@ static int login(AFPObj *obj, struct passwd *pwd, void (*logout)(void), int expi } /* ---------------------- */ -int afp_zzz (obj, ibuf, ibuflen, rbuf, rbuflen ) /* Function 122 */ - AFPObj *obj; - char *ibuf _U_, *rbuf; - unsigned int ibuflen _U_, *rbuflen; +int afp_zzz ( /* Function 122 */ + AFPObj *obj, + char *ibuf _U_, unsigned int ibuflen _U_, + char *rbuf, unsigned int *rbuflen) { u_int32_t retdata; @@ -459,10 +452,10 @@ static int create_session_key(AFPObj *obj) /* ---------------------- */ -int afp_getsession(obj, ibuf, ibuflen, rbuf, rbuflen ) - AFPObj *obj; - char *ibuf, *rbuf; - unsigned int ibuflen, *rbuflen; +int afp_getsession( + AFPObj *obj, + char *ibuf, unsigned int ibuflen, + char *rbuf, unsigned int *rbuflen) { u_int16_t type; u_int32_t idlen = 0; @@ -553,10 +546,7 @@ int afp_getsession(obj, ibuf, ibuflen, rbuf, rbuflen ) } /* ---------------------- */ -int afp_disconnect(obj, ibuf, ibuflen, rbuf, rbuflen ) - AFPObj *obj _U_; - char *ibuf, *rbuf _U_; - int ibuflen _U_, *rbuflen; +int afp_disconnect(AFPObj *obj _U_, char *ibuf, int ibuflen _U_, char *rbuf _U_, int *rbuflen) { u_int16_t type; @@ -608,11 +598,7 @@ int afp_disconnect(obj, ibuf, ibuflen, rbuf, rbuflen ) } /* ---------------------- */ -static int get_version(obj, ibuf, ibuflen, len) - AFPObj *obj; - char *ibuf; - int ibuflen; - int len; +static int get_version(AFPObj *obj, char *ibuf, int ibuflen, int len) { int num,i; @@ -643,10 +629,7 @@ static int get_version(obj, ibuf, ibuflen, len) } /* ---------------------- */ -int afp_login(obj, ibuf, ibuflen, rbuf, rbuflen ) - AFPObj *obj; - char *ibuf, *rbuf; - int ibuflen, *rbuflen; +int afp_login(AFPObj *obj, char *ibuf, int ibuflen, char *rbuf, int *rbuflen) { struct passwd *pwd = NULL; int len, i; @@ -696,10 +679,7 @@ int afp_login(obj, ibuf, ibuflen, rbuf, rbuflen ) } /* ---------------------- */ -int afp_login_ext(obj, ibuf, ibuflen, rbuf, rbuflen ) - AFPObj *obj; - char *ibuf, *rbuf; - unsigned int ibuflen, *rbuflen; +int afp_login_ext(AFPObj *obj, char *ibuf, unsigned int ibuflen, char *rbuf, unsigned int *rbuflen) { struct passwd *pwd = NULL; unsigned int len; @@ -826,10 +806,7 @@ int afp_login_ext(obj, ibuf, ibuflen, rbuf, rbuflen ) } /* ---------------------- */ -int afp_logincont(obj, ibuf, ibuflen, rbuf, rbuflen) - AFPObj *obj; - char *ibuf, *rbuf; - int ibuflen, *rbuflen; +int afp_logincont(AFPObj *obj, char *ibuf, int ibuflen, char *rbuf, int *rbuflen) { struct passwd *pwd = NULL; int err; @@ -849,10 +826,7 @@ int afp_logincont(obj, ibuf, ibuflen, rbuf, rbuflen) } -int afp_logout(obj, ibuf, ibuflen, rbuf, rbuflen) - AFPObj *obj; - char *ibuf _U_, *rbuf _U_; - int ibuflen _U_, *rbuflen _U_; +int afp_logout(AFPObj *obj, char *ibuf _U_, int ibuflen _U_, char *rbuf _U_, int *rbuflen _U_) { LOG(log_info, logtype_afpd, "logout %s", obj->username); close_all_vol(); @@ -867,10 +841,7 @@ int afp_logout(obj, ibuf, ibuflen, rbuf, rbuflen) * to work. this also does a little pre-processing before it hands * it off to the uam. */ -int afp_changepw(obj, ibuf, ibuflen, rbuf, rbuflen ) - AFPObj *obj; - char *ibuf, *rbuf; - int ibuflen, *rbuflen; +int afp_changepw(AFPObj *obj, char *ibuf, int ibuflen, char *rbuf, int *rbuflen) { char username[MACFILELEN + 1], *start = ibuf; struct uam_obj *uam; @@ -937,10 +908,7 @@ int afp_changepw(obj, ibuf, ibuflen, rbuf, rbuflen ) /* FPGetUserInfo */ -int afp_getuserinfo(obj, ibuf, ibuflen, rbuf, rbuflen ) - AFPObj *obj _U_; - char *ibuf, *rbuf; - int ibuflen _U_, *rbuflen; +int afp_getuserinfo(AFPObj *obj _U_, char *ibuf, int ibuflen _U_, char *rbuf, int *rbuflen) { u_int8_t thisuser; u_int32_t id; @@ -1091,7 +1059,7 @@ int auth_load(const char *path, const char *list) } /* get rid of all of the uams */ -void auth_unload() +void auth_unload(void) { struct uam_mod *mod, *prev, *start = &uam_modules; diff --git a/etc/afpd/auth.h b/etc/afpd/auth.h index a473757d..69ed23f7 100644 --- a/etc/afpd/auth.h +++ b/etc/afpd/auth.h @@ -1,5 +1,5 @@ /* - * $Id: auth.h,v 1.7 2009-02-02 11:55:00 franklahm Exp $ + * $Id: auth.h,v 1.8 2009-10-13 22:55:36 didg Exp $ * * Copyright (c) 1990,1993 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. @@ -38,14 +38,14 @@ extern gid_t *groups; extern int ngroups; /* FP functions */ -extern int afp_login __P((AFPObj *, char *, int, char *, int *)); -extern int afp_login_ext __P((AFPObj *, char *, unsigned int, char *, unsigned int *)); -extern int afp_logincont __P((AFPObj *, char *, int, char *, int *)); -extern int afp_changepw __P((AFPObj *, char *, int, char *, int *)); -extern int afp_logout __P((AFPObj *, char *, int, char *, int *)); -extern int afp_getuserinfo __P((AFPObj *, char *, int, char *, int *)); -extern int afp_getsession __P((AFPObj *, char *, unsigned int, char *, unsigned int *)); -extern int afp_disconnect __P((AFPObj *, char *, int, char *, int *)); -extern int afp_zzz __P((AFPObj *, char *, unsigned int, char *, unsigned int *)); +extern int afp_login (AFPObj *, char *, int, char *, int *); +extern int afp_login_ext (AFPObj *, char *, unsigned int, char *, unsigned int *); +extern int afp_logincont (AFPObj *, char *, int, char *, int *); +extern int afp_changepw (AFPObj *, char *, int, char *, int *); +extern int afp_logout (AFPObj *, char *, int, char *, int *); +extern int afp_getuserinfo (AFPObj *, char *, int, char *, int *); +extern int afp_getsession (AFPObj *, char *, unsigned int, char *, unsigned int *); +extern int afp_disconnect (AFPObj *, char *, int, char *, int *); +extern int afp_zzz (AFPObj *, char *, unsigned int, char *, unsigned int *); #endif /* auth.h */ diff --git a/etc/afpd/catsearch.c b/etc/afpd/catsearch.c index 99636cba..73a8a94f 100644 --- a/etc/afpd/catsearch.c +++ b/etc/afpd/catsearch.c @@ -160,7 +160,7 @@ static int addstack(char *uname, struct dir *dir, int pidx) } /* Removes checked items from top of directory stack. Returns index of the first unchecked elements or -1. */ -static int reducestack() +static int reducestack(void) { int r; if (save_cidx != -1) { @@ -180,7 +180,7 @@ static int reducestack() } /* Clears directory stack. */ -static void clearstack() +static void clearstack(void) { save_cidx = -1; while (dsidx > 0) { diff --git a/etc/afpd/desktop.c b/etc/afpd/desktop.c index 927be9d4..c594480a 100644 --- a/etc/afpd/desktop.c +++ b/etc/afpd/desktop.c @@ -1,5 +1,5 @@ /* - * $Id: desktop.c,v 1.37 2006-09-29 09:39:16 didg Exp $ + * $Id: desktop.c,v 1.38 2009-10-13 22:55:36 didg Exp $ * * See COPYRIGHT. * @@ -40,10 +40,7 @@ #include "mangle.h" -int afp_opendt(obj, ibuf, ibuflen, rbuf, rbuflen ) -AFPObj *obj _U_; -char *ibuf, *rbuf; -int ibuflen _U_, *rbuflen; +int afp_opendt(AFPObj *obj _U_, char *ibuf, int ibuflen _U_, char *rbuf, int *rbuflen) { struct vol *vol; u_int16_t vid; @@ -61,10 +58,7 @@ int ibuflen _U_, *rbuflen; return( AFP_OK ); } -int afp_closedt(obj, ibuf, ibuflen, rbuf, rbuflen ) -AFPObj *obj _U_; -char *ibuf _U_, *rbuf _U_; -int ibuflen _U_, *rbuflen; +int afp_closedt(AFPObj *obj _U_, char *ibuf _U_, int ibuflen _U_, char *rbuf _U_, int *rbuflen) { *rbuflen = 0; return( AFP_OK ); @@ -77,11 +71,7 @@ static char *icon_dtfile(struct vol *vol, u_char creator[ 4 ]) return dtfile( vol, creator, ".icon" ); } -static int iconopen( vol, creator, flags, mode ) -struct vol *vol; -u_char creator[ 4 ]; -int flags; -int mode; +static int iconopen(struct vol *vol, u_char creator[ 4 ], int flags, int mode) { char *dtf, *adt, *adts; @@ -126,10 +116,7 @@ int mode; return 0; } -int afp_addicon(obj, ibuf, ibuflen, rbuf, rbuflen) -AFPObj *obj; -char *ibuf, *rbuf; -int ibuflen _U_, *rbuflen; +int afp_addicon(AFPObj *obj, char *ibuf, int ibuflen _U_, char *rbuf, int *rbuflen) { struct vol *vol; #ifndef NO_DDP @@ -353,10 +340,7 @@ static const u_char uicon[] = { }; #endif -int afp_geticoninfo(obj, ibuf, ibuflen, rbuf, rbuflen ) -AFPObj *obj _U_; -char *ibuf, *rbuf; -int ibuflen _U_, *rbuflen; +int afp_geticoninfo(AFPObj *obj _U_, char *ibuf, int ibuflen _U_, char *rbuf, int *rbuflen) { struct vol *vol; u_char fcreator[ 4 ], ih[ 12 ]; @@ -427,10 +411,7 @@ int ibuflen _U_, *rbuflen; } -int afp_geticon(obj, ibuf, ibuflen, rbuf, rbuflen ) -AFPObj *obj; -char *ibuf, *rbuf; -int ibuflen _U_, *rbuflen; +int afp_geticon(AFPObj *obj, char *ibuf, int ibuflen _U_, char *rbuf, int *rbuflen) { struct vol *vol; off_t offset; @@ -765,10 +746,7 @@ static int ad_addcomment(struct vol *vol, struct path *path, char *ibuf) } /* ----------------------------- */ -int afp_addcomment(obj, ibuf, ibuflen, rbuf, rbuflen ) -AFPObj *obj _U_; -char *ibuf, *rbuf _U_; -int ibuflen _U_, *rbuflen; +int afp_addcomment(AFPObj *obj _U_, char *ibuf, int ibuflen _U_, char *rbuf _U_, int *rbuflen) { struct vol *vol; struct dir *dir; @@ -846,10 +824,7 @@ static int ad_getcomment(struct vol *vol, struct path *path, char *rbuf, int *rb } /* -------------------- */ -int afp_getcomment(obj, ibuf, ibuflen, rbuf, rbuflen ) -AFPObj *obj _U_; -char *ibuf, *rbuf; -int ibuflen _U_, *rbuflen; +int afp_getcomment(AFPObj *obj _U_, char *ibuf, int ibuflen _U_, char *rbuf, int *rbuflen) { struct vol *vol; struct dir *dir; @@ -919,10 +894,7 @@ static int ad_rmvcomment(struct vol *vol, struct path *path) } /* ----------------------- */ -int afp_rmvcomment(obj, ibuf, ibuflen, rbuf, rbuflen ) -AFPObj *obj _U_; -char *ibuf, *rbuf _U_; -int ibuflen _U_, *rbuflen; +int afp_rmvcomment(AFPObj *obj _U_, char *ibuf, int ibuflen _U_, char *rbuf _U_, int *rbuflen) { struct vol *vol; struct dir *dir; diff --git a/etc/afpd/desktop.h b/etc/afpd/desktop.h index 3f80b9f7..fdd290e7 100644 --- a/etc/afpd/desktop.h +++ b/etc/afpd/desktop.h @@ -1,5 +1,5 @@ /* - * $Id: desktop.h,v 1.4 2005-04-28 20:49:41 bfernhomberg Exp $ + * $Id: desktop.h,v 1.5 2009-10-13 22:55:36 didg Exp $ * * Copyright (c) 1990,1991 Regents of The University of Michigan. * All Rights Reserved. @@ -39,21 +39,21 @@ struct savedt { typedef unsigned char CreatorType[4]; -extern char *dtfile __P((const struct vol *, u_char [], char *)); -extern char *mtoupath __P((const struct vol *, char *, cnid_t, int utf8)); -extern char *utompath __P((const struct vol *, char *, cnid_t, int utf8)); +extern char *dtfile (const struct vol *, u_char [], char *); +extern char *mtoupath (const struct vol *, char *, cnid_t, int utf8); +extern char *utompath (const struct vol *, char *, cnid_t, int utf8); /* FP functions */ -extern int afp_opendt __P((AFPObj *, char *, int, char *, int *)); -extern int afp_addcomment __P((AFPObj *, char *, int, char *, int *)); -extern int afp_getcomment __P((AFPObj *, char *, int, char *, int *)); -extern int afp_rmvcomment __P((AFPObj *, char *, int, char *, int *)); -extern int afp_addappl __P((AFPObj *, char *, int, char *, int *)); -extern int afp_rmvappl __P((AFPObj *, char *, int, char *, int *)); -extern int afp_getappl __P((AFPObj *, char *, int, char *, int *)); -extern int afp_closedt __P((AFPObj *, char *, int, char *, int *)); -extern int afp_addicon __P((AFPObj *, char *, int, char *, int *)); -extern int afp_geticoninfo __P((AFPObj *, char *, int, char *, int *)); -extern int afp_geticon __P((AFPObj *, char *, int, char *, int *)); +extern int afp_opendt (AFPObj *, char *, int, char *, int *); +extern int afp_addcomment (AFPObj *, char *, int, char *, int *); +extern int afp_getcomment (AFPObj *, char *, int, char *, int *); +extern int afp_rmvcomment (AFPObj *, char *, int, char *, int *); +extern int afp_addappl (AFPObj *, char *, int, char *, int *); +extern int afp_rmvappl (AFPObj *, char *, int, char *, int *); +extern int afp_getappl (AFPObj *, char *, int, char *, int *); +extern int afp_closedt (AFPObj *, char *, int, char *, int *); +extern int afp_addicon (AFPObj *, char *, int, char *, int *); +extern int afp_geticoninfo (AFPObj *, char *, int, char *, int *); +extern int afp_geticon (AFPObj *, char *, int, char *, int *); #endif diff --git a/etc/afpd/directory.c b/etc/afpd/directory.c index e847a9d7..148ec217 100644 --- a/etc/afpd/directory.c +++ b/etc/afpd/directory.c @@ -1,5 +1,5 @@ /* - * $Id: directory.c,v 1.105 2009-10-02 09:32:40 franklahm Exp $ + * $Id: directory.c,v 1.106 2009-10-13 22:55:36 didg Exp $ * * Copyright (c) 1990,1993 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. @@ -95,9 +95,7 @@ static struct dir rootpar = { SENTINEL, SENTINEL, NULL, 0, * how exciting. */ struct dir * - dirsearch( vol, did ) - const struct vol *vol; -u_int32_t did; + dirsearch(const struct vol *vol, u_int32_t did) { struct dir *dir; @@ -169,9 +167,7 @@ struct dir *dir = NULL; * and we are really bad in this case. */ struct dir * - dirlookup( vol, did ) - const struct vol *vol; -u_int32_t did; + dirlookup( const struct vol *vol, u_int32_t did) { struct dir *ret; char *upath; @@ -285,9 +281,7 @@ static void dirchildremove(struct dir *a,struct dir *b) /* --------------------------- */ /* rotate the tree to the left */ -static void dir_leftrotate(vol, dir) -struct vol *vol; -struct dir *dir; +static void dir_leftrotate(struct vol *vol, struct dir *dir) { struct dir *right = dir->d_right; @@ -316,9 +310,7 @@ struct dir *dir; /* rotate the tree to the right */ -static void dir_rightrotate(vol, dir) -struct vol *vol; -struct dir *dir; +static void dir_rightrotate(struct vol *vol, struct dir *dir) { struct dir *left = dir->d_left; @@ -346,9 +338,7 @@ struct dir *dir; #if 0 /* recolor after a removal */ -static struct dir *dir_rmrecolor(vol, dir) - struct vol *vol; -struct dir *dir; +static struct dir *dir_rmrecolor(struct vol *vol, struct dir *dir) { struct dir *leaf; @@ -552,9 +542,7 @@ static void dir_remove( const struct vol *vol _U_, struct dir *dir) * process. It's fixable within afpd if fnctl_lock, doable with smb and * next to impossible for nfs and local filesystem access. */ -static void dir_invalidate( vol, dir ) -const struct vol *vol; -struct dir *dir; +static void dir_invalidate( const struct vol *vol, struct dir *dir) { if (curdir == dir) { /* v_root can't be deleted */ @@ -568,9 +556,7 @@ struct dir *dir; } /* ------------------------------------ */ -static struct dir *dir_insert(vol, dir) - const struct vol *vol; -struct dir *dir; +static struct dir *dir_insert(const struct vol *vol, struct dir *dir) { struct dir *pdir; @@ -683,10 +669,7 @@ caseenumerate(const struct vol *vol, struct path *path, struct dir *dir) * as a side-effect, movecwd to that point and return the new dir */ static struct dir * - extenddir( vol, dir, path ) -struct vol *vol; -struct dir *dir; -struct path *path; + extenddir(struct vol *vol, struct dir *dir, struct path *path) { path->d_dir = NULL; @@ -887,9 +870,7 @@ copydir_done: /* --- public functions follow --- */ /* NOTE: we start off with at least one node (the root directory). */ -static struct dir *dirinsert( vol, dir ) - struct vol *vol; -struct dir *dir; +static struct dir *dirinsert(struct vol *vol, struct dir *dir) { struct dir *node; @@ -947,10 +928,7 @@ struct dir *dir; /* ---------------------------- */ struct dir * - adddir( vol, dir, path) -struct vol *vol; -struct dir *dir; -struct path *path; + adddir(struct vol *vol, struct dir *dir, struct path *path) { struct dir *cdir, *edir; int upathlen; @@ -1034,8 +1012,7 @@ void dirfreename(struct dir *dir) free(dir->d_m_name); } -void dirfree( dir ) -struct dir *dir; +void dirfree(struct dir *dir) { if (!dir || (dir == SENTINEL)) return; @@ -1207,10 +1184,7 @@ static struct path *invalidate (const struct vol *vol, struct dir *dir, struct p */ struct path * -cname( vol, dir, cpath ) -const struct vol *vol; -struct dir *dir; -char **cpath; +cname(const struct vol *vol, struct dir *dir, char **cpath) { struct dir *cdir, *scdir=NULL; static char path[ MAXPATHLEN + 1]; @@ -1444,9 +1418,7 @@ noucsfallback: /* * Move curdir to dir, with a possible chdir() */ -int movecwd( vol, dir) -const struct vol *vol; -struct dir *dir; +int movecwd(const struct vol *vol, struct dir *dir) { char path[MAXPATHLEN + 1]; struct dir *d; @@ -1825,10 +1797,7 @@ int path_error(struct path *path, int error) } /* ----------------------------- */ -int afp_setdirparams(obj, ibuf, ibuflen, rbuf, rbuflen ) -AFPObj *obj; -char *ibuf, *rbuf _U_; -int ibuflen _U_, *rbuflen; +int afp_setdirparams(AFPObj *obj, char *ibuf, int ibuflen _U_, char *rbuf _U_, int *rbuflen) { struct vol *vol; struct dir *dir; @@ -2246,10 +2215,7 @@ setdirparam_done: return err; } -int afp_syncdir(obj, ibuf, ibuflen, rbuf, rbuflen ) -AFPObj *obj _U_; -char *ibuf, *rbuf _U_; -int ibuflen _U_, *rbuflen; +int afp_syncdir(AFPObj *obj _U_, char *ibuf, int ibuflen _U_, char *rbuf _U_, int *rbuflen) { #ifdef HAVE_DIRFD DIR *dp; @@ -2339,10 +2305,7 @@ int ibuflen _U_, *rbuflen; return ( AFP_OK ); } -int afp_createdir(obj, ibuf, ibuflen, rbuf, rbuflen ) -AFPObj *obj; -char *ibuf, *rbuf; -int ibuflen _U_, *rbuflen; +int afp_createdir(AFPObj *obj, char *ibuf, int ibuflen _U_, char *rbuf, int *rbuflen) { struct adouble ad; struct vol *vol; @@ -2430,10 +2393,10 @@ createdir_done: * newparent curdir * */ -int renamedir(vol, src, dst, dir, newparent, newname) -const struct vol *vol; -char *src, *dst, *newname; -struct dir *dir, *newparent; +int renamedir(const struct vol *vol, char *src, char *dst, + struct dir *dir, + struct dir *newparent, + char *newname) { struct adouble ad; struct dir *parent; @@ -2530,8 +2493,7 @@ struct dir *dir, *newparent; } /* delete an empty directory */ -int deletecurdir( vol) -const struct vol *vol; +int deletecurdir(const struct vol *vol) { struct dirent *de; struct stat st; @@ -2603,10 +2565,7 @@ delete_done: return err; } -int afp_mapid(obj, ibuf, ibuflen, rbuf, rbuflen ) -AFPObj *obj; -char *ibuf, *rbuf; -int ibuflen _U_, *rbuflen; +int afp_mapid(AFPObj *obj, char *ibuf, int ibuflen _U_, char *rbuf, int *rbuflen) { struct passwd *pw; struct group *gr; @@ -2719,10 +2678,7 @@ int ibuflen _U_, *rbuflen; return( AFP_OK ); } -int afp_mapname(obj, ibuf, ibuflen, rbuf, rbuflen ) -AFPObj *obj _U_; -char *ibuf, *rbuf; -int ibuflen _U_, *rbuflen; +int afp_mapname(AFPObj *obj _U_, char *ibuf, int ibuflen _U_, char *rbuf, int *rbuflen) { struct passwd *pw; struct group *gr; @@ -2814,10 +2770,7 @@ int ibuflen _U_, *rbuflen; /* ------------------------------------ variable DID support */ -int afp_closedir(obj, ibuf, ibuflen, rbuf, rbuflen ) -AFPObj *obj _U_; -char *ibuf _U_, *rbuf _U_; -int ibuflen _U_, *rbuflen; +int afp_closedir(AFPObj *obj _U_, char *ibuf _U_, int ibuflen _U_, char *rbuf _U_, int *rbuflen) { #if 0 struct vol *vol; @@ -2853,10 +2806,7 @@ int ibuflen _U_, *rbuflen; /* did creation gets done automatically * there's a pb again with case but move it to cname */ -int afp_opendir(obj, ibuf, ibuflen, rbuf, rbuflen ) -AFPObj *obj _U_; -char *ibuf, *rbuf; -int ibuflen _U_, *rbuflen; +int afp_opendir(AFPObj *obj _U_, char *ibuf, int ibuflen _U_, char *rbuf, int *rbuflen) { struct vol *vol; struct dir *parentdir; diff --git a/etc/afpd/directory.h b/etc/afpd/directory.h index 5d0b75f4..ee8978d6 100644 --- a/etc/afpd/directory.h +++ b/etc/afpd/directory.h @@ -1,5 +1,5 @@ /* - * $Id: directory.h,v 1.28 2009-10-02 09:32:40 franklahm Exp $ + * $Id: directory.h,v 1.29 2009-10-13 22:55:36 didg Exp $ * * Copyright (c) 1990,1991 Regents of The University of Michigan. * All Rights Reserved. @@ -113,63 +113,63 @@ struct maccess { #define AR_UWRITE (1<<2) #define AR_UOWN (1<<7) -extern struct dir *dirnew __P((const char *, const char *)); -extern void dirfreename __P((struct dir *)); -extern void dirfree __P((struct dir *)); -extern struct dir *dirsearch __P((const struct vol *, u_int32_t)); -extern struct dir *dirlookup __P((const struct vol *, u_int32_t)); -extern struct dir *dirsearch_byname __P((const struct vol *, struct dir *,char *)); - -extern struct dir *adddir __P((struct vol *, struct dir *, - struct path *)); - -extern int movecwd __P((const struct vol *, struct dir *)); -extern int deletecurdir __P((const struct vol *)); -extern struct path *cname __P((const struct vol *, struct dir *, - char **)); -extern mode_t mtoumode __P((struct maccess *)); -extern void utommode __P((struct stat *, struct maccess *)); -extern int getdirparams __P((const struct vol *, u_int16_t, struct path *, - struct dir *, char *, int *)); -extern int setdirparams __P((const struct vol *, struct path *, u_int16_t, char *)); -extern int renamedir __P((const struct vol *, char *, char *, struct dir *, - struct dir *, char *)); -extern int path_error __P((struct path *, int error)); - -extern void setdiroffcnt __P((struct dir *dir, struct stat *st, u_int32_t count)); -extern int dirreenumerate __P((struct dir *dir, struct stat *st)); +extern struct dir *dirnew (const char *, const char *); +extern void dirfreename (struct dir *); +extern void dirfree (struct dir *); +extern struct dir *dirsearch (const struct vol *, u_int32_t); +extern struct dir *dirlookup (const struct vol *, u_int32_t); +extern struct dir *dirsearch_byname (const struct vol *, struct dir *,char *); + +extern struct dir *adddir (struct vol *, struct dir *, + struct path *); + +extern int movecwd (const struct vol *, struct dir *); +extern int deletecurdir (const struct vol *); +extern struct path *cname (const struct vol *, struct dir *, + char **); +extern mode_t mtoumode (struct maccess *); +extern void utommode (struct stat *, struct maccess *); +extern int getdirparams (const struct vol *, u_int16_t, struct path *, + struct dir *, char *, int *); +extern int setdirparams (const struct vol *, struct path *, u_int16_t, char *); +extern int renamedir (const struct vol *, char *, char *, struct dir *, + struct dir *, char *); +extern int path_error (struct path *, int error); + +extern void setdiroffcnt (struct dir *dir, struct stat *st, u_int32_t count); +extern int dirreenumerate (struct dir *dir, struct stat *st); typedef int (*dir_loop)(struct dirent *, char *, void *); -extern int for_each_dirent __P((const struct vol *, char *, dir_loop , void *)); +extern int for_each_dirent (const struct vol *, char *, dir_loop , void *); -extern int check_access __P((char *name , int mode)); -extern int file_access __P((struct path *path, int mode)); +extern int check_access (char *name , int mode); +extern int file_access (struct path *path, int mode); -extern int netatalk_unlink __P((const char *name)); +extern int netatalk_unlink (const char *name); -extern int caseenumerate __P((const struct vol *, struct path *, struct dir *)); +extern int caseenumerate (const struct vol *, struct path *, struct dir *); -extern hash_t *dirhash __P((void)); +extern hash_t *dirhash (void); /* from enumerate.c */ -extern char *check_dirent __P((const struct vol *, char *)); +extern char *check_dirent (const struct vol *, char *); /* FP functions */ -extern int afp_createdir __P((AFPObj *, char *, int, char *, int *)); -extern int afp_opendir __P((AFPObj *, char *, int, char *, int *)); -extern int afp_setdirparams __P((AFPObj *, char *, int, char *, int *)); -extern int afp_closedir __P((AFPObj *, char *, int, char *, int *)); -extern int afp_mapid __P((AFPObj *, char *, int, char *, int *)); -extern int afp_mapname __P((AFPObj *, char *, int, char *, int *)); -extern int afp_syncdir __P((AFPObj *, char *, int, char *, int *)); +extern int afp_createdir (AFPObj *, char *, int, char *, int *); +extern int afp_opendir (AFPObj *, char *, int, char *, int *); +extern int afp_setdirparams (AFPObj *, char *, int, char *, int *); +extern int afp_closedir (AFPObj *, char *, int, char *, int *); +extern int afp_mapid (AFPObj *, char *, int, char *, int *); +extern int afp_mapname (AFPObj *, char *, int, char *, int *); +extern int afp_syncdir (AFPObj *, char *, int, char *, int *); /* from enumerate.c */ -extern int afp_enumerate __P((AFPObj *, char *, unsigned int, char *, unsigned int *)); -extern int afp_enumerate_ext __P((AFPObj *, char *, unsigned int, char *, unsigned int *)); -extern int afp_enumerate_ext2 __P((AFPObj *, char *, unsigned int, char *, unsigned int *)); +extern int afp_enumerate (AFPObj *, char *, unsigned int, char *, unsigned int *); +extern int afp_enumerate_ext (AFPObj *, char *, unsigned int, char *, unsigned int *); +extern int afp_enumerate_ext2 (AFPObj *, char *, unsigned int, char *, unsigned int *); /* from catsearch.c */ -extern int afp_catsearch __P((AFPObj *, char *, int, char *, int *)); -extern int afp_catsearch_ext __P((AFPObj *, char *, int, char *, int *)); +extern int afp_catsearch (AFPObj *, char *, int, char *, int *); +extern int afp_catsearch_ext (AFPObj *, char *, int, char *, int *); #endif diff --git a/etc/afpd/enumerate.c b/etc/afpd/enumerate.c index c994f03c..e029a877 100644 --- a/etc/afpd/enumerate.c +++ b/etc/afpd/enumerate.c @@ -1,5 +1,5 @@ /* - * $Id: enumerate.c,v 1.44 2009-10-02 09:32:40 franklahm Exp $ + * $Id: enumerate.c,v 1.45 2009-10-13 22:55:36 didg Exp $ * * Copyright (c) 1990,1993 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. @@ -155,11 +155,10 @@ for_each_dirent(const struct vol *vol, char *name, dir_loop fn, void *data) #define REPLY_PARAM_MAXLEN (4 + 104 + 1 + MACFILELEN + 4 + 2 + 255 + 1) /* ----------------------------- */ -static int enumerate(obj, ibuf, ibuflen, rbuf, rbuflen, ext ) -AFPObj *obj _U_; -char *ibuf, *rbuf; -unsigned int ibuflen _U_, *rbuflen; -int ext; +static int enumerate(AFPObj *obj _U_, char *ibuf, unsigned int ibuflen _U_, + char *rbuf, + unsigned int *rbuflen, + int ext) { static struct savedir sd = { 0, 0, 0, NULL, NULL, 0 }; struct vol *vol; @@ -451,28 +450,25 @@ int ext; } /* ----------------------------- */ -int afp_enumerate(obj, ibuf, ibuflen, rbuf, rbuflen ) -AFPObj *obj; -char *ibuf, *rbuf; -unsigned int ibuflen, *rbuflen; +int afp_enumerate(AFPObj *obj, char *ibuf, unsigned int ibuflen, + char *rbuf, + unsigned int *rbuflen) { return enumerate(obj, ibuf,ibuflen ,rbuf,rbuflen , 0); } /* ----------------------------- */ -int afp_enumerate_ext(obj, ibuf, ibuflen, rbuf, rbuflen ) -AFPObj *obj; -char *ibuf, *rbuf; -unsigned int ibuflen, *rbuflen; +int afp_enumerate_ext(AFPObj *obj, char *ibuf, unsigned int ibuflen, + char *rbuf, + unsigned int *rbuflen) { return enumerate(obj, ibuf,ibuflen ,rbuf,rbuflen , 1); } /* ----------------------------- */ -int afp_enumerate_ext2(obj, ibuf, ibuflen, rbuf, rbuflen ) -AFPObj *obj; -char *ibuf, *rbuf; -unsigned int ibuflen, *rbuflen; +int afp_enumerate_ext2(AFPObj *obj, char *ibuf, unsigned int ibuflen, + char *rbuf, + unsigned int *rbuflen) { return enumerate(obj, ibuf,ibuflen ,rbuf,rbuflen , 2); } diff --git a/etc/afpd/file.c b/etc/afpd/file.c index f2b97209..a7498983 100644 --- a/etc/afpd/file.c +++ b/etc/afpd/file.c @@ -1,5 +1,5 @@ /* - * $Id: file.c,v 1.111 2009-10-02 09:32:40 franklahm Exp $ + * $Id: file.c,v 1.112 2009-10-13 22:55:36 didg Exp $ * * Copyright (c) 1990,1993 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. @@ -563,10 +563,7 @@ int getfilparams(struct vol *vol, } /* ----------------------------- */ -int afp_createfile(obj, ibuf, ibuflen, rbuf, rbuflen ) -AFPObj *obj; -char *ibuf, *rbuf _U_; -int ibuflen _U_, *rbuflen; +int afp_createfile(AFPObj *obj, char *ibuf, int ibuflen _U_, char *rbuf _U_, int *rbuflen) { struct adouble ad, *adp; struct vol *vol; @@ -689,10 +686,7 @@ createfile_done: return (retvalue); } -int afp_setfilparams(obj, ibuf, ibuflen, rbuf, rbuflen ) -AFPObj *obj; -char *ibuf, *rbuf _U_; -int ibuflen _U_, *rbuflen; +int afp_setfilparams(AFPObj *obj, char *ibuf, int ibuflen _U_, char *rbuf _U_, int *rbuflen) { struct vol *vol; struct dir *dir; @@ -1007,10 +1001,7 @@ setfilparam_done: * adp adouble struct of src file, if open, or & zeroed one * */ -int renamefile(vol, src, dst, newname, adp ) -const struct vol *vol; -char *src, *dst, *newname; -struct adouble *adp; +int renamefile(const struct vol *vol, char *src, char *dst, char *newname, struct adouble *adp) { int rc; @@ -1155,10 +1146,7 @@ u_int32_t hint; /* ----------------------------------- */ -int afp_copyfile(obj, ibuf, ibuflen, rbuf, rbuflen ) -AFPObj *obj; -char *ibuf, *rbuf _U_; -int ibuflen _U_, *rbuflen; +int afp_copyfile(AFPObj *obj, char *ibuf, int ibuflen _U_, char *rbuf _U_, int *rbuflen) { struct vol *s_vol, *d_vol; struct dir *dir; @@ -1382,10 +1370,8 @@ static int copy_fork(int eid, struct adouble *add, struct adouble *ads) * because we are doing it elsewhere. * currently if newname is NULL then adp is NULL. */ -int copyfile(s_vol, d_vol, src, dst, newname, adp ) -const struct vol *s_vol, *d_vol; -char *src, *dst, *newname; -struct adouble *adp; +int copyfile(const struct vol *s_vol, const struct vol*d_vol, + char *src, char *dst, char *newname, struct adouble *adp) { struct adouble ads, add; int err = 0; @@ -1522,10 +1508,7 @@ u_int16_t bshort = 0; return 0; } -int deletefile( vol, file, checkAttrib ) -const struct vol *vol; -char *file; -int checkAttrib; +int deletefile(const struct vol *vol, char *file, int checkAttrib) { struct adouble ad; struct adouble *adp = &ad; @@ -1610,10 +1593,7 @@ int checkAttrib; /* ------------------------------------ */ /* return a file id */ -int afp_createid(obj, ibuf, ibuflen, rbuf, rbuflen ) -AFPObj *obj _U_; -char *ibuf, *rbuf; -int ibuflen _U_, *rbuflen; +int afp_createid(AFPObj *obj _U_, char *ibuf, int ibuflen _U_, char *rbuf, int *rbuflen) { struct stat *st; struct vol *vol; @@ -1774,10 +1754,7 @@ reenumerate_id(struct vol *vol, char *name, struct dir *dir) /* ------------------------------ resolve a file id */ -int afp_resolveid(obj, ibuf, ibuflen, rbuf, rbuflen ) -AFPObj *obj _U_; -char *ibuf, *rbuf; -int ibuflen _U_, *rbuflen; +int afp_resolveid(AFPObj *obj _U_, char *ibuf, int ibuflen _U_, char *rbuf, int *rbuflen) { struct vol *vol; struct dir *dir; @@ -1890,10 +1867,7 @@ retry: } /* ------------------------------ */ -int afp_deleteid(obj, ibuf, ibuflen, rbuf, rbuflen ) -AFPObj *obj _U_; -char *ibuf, *rbuf _U_; -int ibuflen _U_, *rbuflen; +int afp_deleteid(AFPObj *obj _U_, char *ibuf, int ibuflen _U_, char *rbuf _U_, int *rbuflen) { struct stat st; struct vol *vol; @@ -2027,10 +2001,7 @@ static struct adouble *find_adouble(struct path *path, struct ofork **of, struct #define APPLETEMP ".AppleTempXXXXXX" -int afp_exchangefiles(obj, ibuf, ibuflen, rbuf, rbuflen ) -AFPObj *obj; -char *ibuf, *rbuf _U_ ; -int ibuflen _U_, *rbuflen; +int afp_exchangefiles(AFPObj *obj, char *ibuf, int ibuflen _U_, char *rbuf _U_, int *rbuflen) { struct stat srcst, destst; struct vol *vol; diff --git a/etc/afpd/file.h b/etc/afpd/file.h index f0aa5084..37c65d03 100644 --- a/etc/afpd/file.h +++ b/etc/afpd/file.h @@ -1,5 +1,5 @@ /* - * $Id: file.h,v 1.21 2009-06-10 08:37:25 franklahm Exp $ + * $Id: file.h,v 1.22 2009-10-13 22:55:37 didg Exp $ * * Copyright (c) 1990,1991 Regents of The University of Michigan. * All Rights Reserved. @@ -106,34 +106,34 @@ typedef enum { kTextEncodingMacKeyboardGlyphs = 41, } kTextEncoding_t; -extern char *set_name __P((const struct vol *, char *, cnid_t, char *, cnid_t, u_int32_t ) ); +extern char *set_name (const struct vol *, char *, cnid_t, char *, cnid_t, u_int32_t ); -extern struct extmap *getextmap __P((const char *)); -extern struct extmap *getdefextmap __P((void)); +extern struct extmap *getextmap (const char *); +extern struct extmap *getdefextmap (void); -extern int getfilparams __P((struct vol *, u_int16_t, struct path *, - struct dir *, char *buf, int *)); +extern int getfilparams (struct vol *, u_int16_t, struct path *, + struct dir *, char *buf, int *); -extern int setfilparams __P((struct vol *, struct path *, u_int16_t, char *)); -extern int renamefile __P((const struct vol *, char *, char *, char *, struct adouble *)); -extern int copyfile __P((const struct vol *, const struct vol *, char *, char *, char *, struct adouble *)); -extern int deletefile __P((const struct vol *, char *, int)); +extern int setfilparams (struct vol *, struct path *, u_int16_t, char *); +extern int renamefile (const struct vol *, char *, char *, char *, struct adouble *); +extern int copyfile (const struct vol *, const struct vol *, char *, char *, char *, struct adouble *); +extern int deletefile (const struct vol *, char *, int); -extern void *get_finderinfo __P((const struct vol *, const char *, struct adouble *, void *)); +extern void *get_finderinfo (const struct vol *, const char *, struct adouble *, void *); -extern size_t mtoUTF8 __P((const struct vol *, const char *, size_t , char *, size_t )); -extern int copy_path_name __P((const struct vol *, char *, char *i)); +extern size_t mtoUTF8 (const struct vol *, const char *, size_t , char *, size_t ); +extern int copy_path_name (const struct vol *, char *, char *i); -extern u_int32_t get_id __P((struct vol *, struct adouble *, const struct stat *, - const cnid_t , char *, const int )); +extern u_int32_t get_id (struct vol *, struct adouble *, const struct stat *, + const cnid_t , char *, const int ); /* FP functions */ -extern int afp_exchangefiles __P((AFPObj *, char *, int, char *, int *)); -extern int afp_setfilparams __P((AFPObj *, char *, int, char *, int *)); -extern int afp_copyfile __P((AFPObj *, char *, int, char *, int *)); -extern int afp_createfile __P((AFPObj *, char *, int, char *, int *)); -extern int afp_createid __P((AFPObj *, char *, int, char *, int *)); -extern int afp_resolveid __P((AFPObj *, char *, int, char *, int *)); -extern int afp_deleteid __P((AFPObj *, char *, int, char *, int *)); +extern int afp_exchangefiles (AFPObj *, char *, int, char *, int *); +extern int afp_setfilparams (AFPObj *, char *, int, char *, int *); +extern int afp_copyfile (AFPObj *, char *, int, char *, int *); +extern int afp_createfile (AFPObj *, char *, int, char *, int *); +extern int afp_createid (AFPObj *, char *, int, char *, int *); +extern int afp_resolveid (AFPObj *, char *, int, char *, int *); +extern int afp_deleteid (AFPObj *, char *, int, char *, int *); #endif diff --git a/etc/afpd/filedir.c b/etc/afpd/filedir.c index 8c602b08..ddc2fad6 100644 --- a/etc/afpd/filedir.c +++ b/etc/afpd/filedir.c @@ -1,5 +1,5 @@ /* - * $Id: filedir.c,v 1.55 2009-10-02 09:32:40 franklahm Exp $ + * $Id: filedir.c,v 1.56 2009-10-13 22:55:37 didg Exp $ * * Copyright (c) 1990,1993 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. @@ -50,12 +50,12 @@ char *strchr (), *strrchr (); #include "unix.h" #ifdef DROPKLUDGE -int matchfile2dirperms(upath, vol, did) +int matchfile2dirperms( /* Since it's kinda' big; I decided against an inline function */ -char *upath; -struct vol *vol; -int did; + char *upath, + struct vol *vol, + int did) /* The below code changes the way file ownership is determined in the name of fixing dropboxes. It has known security problem. See the netatalk FAQ for more information */ @@ -130,10 +130,7 @@ more information */ } #endif -int afp_getfildirparams(obj, ibuf, ibuflen, rbuf, rbuflen ) -AFPObj *obj _U_; -char *ibuf, *rbuf; -int ibuflen _U_, *rbuflen; +int afp_getfildirparams(AFPObj *obj _U_, char *ibuf, int ibuflen _U_, char *rbuf, int *rbuflen) { struct stat *st; struct vol *vol; @@ -228,10 +225,7 @@ int ibuflen _U_, *rbuflen; return( AFP_OK ); } -int afp_setfildirparams(obj, ibuf, ibuflen, rbuf, rbuflen ) -AFPObj *obj; -char *ibuf, *rbuf _U_; -int ibuflen _U_, *rbuflen; +int afp_setfildirparams(AFPObj *obj, char *ibuf, int ibuflen _U_, char *rbuf _U_, int *rbuflen) { struct stat *st; struct vol *vol; @@ -333,12 +327,7 @@ int check_name(const struct vol *vol, char *name) special care is needed for lock */ -static int moveandrename(vol, sdir, oldname, newname, isdir) -const struct vol *vol; -struct dir *sdir; -char *oldname; -char *newname; -int isdir; +static int moveandrename(const struct vol *vol, struct dir *sdir, char *oldname, char *newname, int isdir) { char *p; char *upath; @@ -445,10 +434,7 @@ int isdir; } /* -------------------------------------------- */ -int afp_rename(obj, ibuf, ibuflen, rbuf, rbuflen ) -AFPObj *obj; -char *ibuf, *rbuf _U_; -int ibuflen _U_, *rbuflen; +int afp_rename(AFPObj *obj, char *ibuf, int ibuflen _U_, char *rbuf _U_, int *rbuflen) { struct vol *vol; struct dir *sdir; @@ -531,10 +517,7 @@ int ibuflen _U_, *rbuflen; } /* ------------------------------- */ -int afp_delete(obj, ibuf, ibuflen, rbuf, rbuflen ) -AFPObj *obj; -char *ibuf, *rbuf _U_; -int ibuflen _U_, *rbuflen; +int afp_delete(AFPObj *obj, char *ibuf, int ibuflen _U_, char *rbuf _U_, int *rbuflen) { struct vol *vol; struct dir *dir; @@ -594,10 +577,7 @@ int ibuflen _U_, *rbuflen; return( rc ); } /* ------------------------ */ -char *absupath( vol, dir, u ) -const struct vol *vol; -struct dir *dir; -char *u; +char *absupath(const struct vol *vol, struct dir *dir, char *u) { struct dir *d; static char path[ MAXPATHLEN + 1]; @@ -639,19 +619,13 @@ char *u; /* ------------------------ * FIXME dir could be NULL */ -char *ctoupath( vol, dir, name ) -const struct vol *vol; -struct dir *dir; -char *name; +char *ctoupath(const struct vol *vol, struct dir *dir, char *name) { return absupath(vol, dir, mtoupath(vol, name, dir->d_did, utf8_encoding())); } /* ------------------------- */ -int afp_moveandrename(obj, ibuf, ibuflen, rbuf, rbuflen ) -AFPObj *obj; -char *ibuf, *rbuf _U_; -int ibuflen _U_, *rbuflen; +int afp_moveandrename(AFPObj *obj, char *ibuf, int ibuflen _U_, char *rbuf _U_, int *rbuflen) { struct vol *vol; struct dir *sdir, *ddir; diff --git a/etc/afpd/filedir.h b/etc/afpd/filedir.h index 26613edd..bd4da87d 100644 --- a/etc/afpd/filedir.h +++ b/etc/afpd/filedir.h @@ -1,5 +1,5 @@ /* - * $Id: filedir.h,v 1.9 2002-10-11 14:18:32 didg Exp $ + * $Id: filedir.h,v 1.10 2009-10-13 22:55:37 didg Exp $ */ #ifndef AFPD_FILEDIR_H @@ -12,21 +12,21 @@ extern struct afp_options default_options; -extern char *ctoupath __P((const struct vol *, struct dir *, - char *)); -extern char *absupath __P((const struct vol *, struct dir *, - char *)); -extern int veto_file __P((const char *veto_str, const char *path)); -extern int check_name __P((const struct vol *vol, char *name)); +extern char *ctoupath (const struct vol *, struct dir *, + char *); +extern char *absupath (const struct vol *, struct dir *, + char *); +extern int veto_file (const char *veto_str, const char *path); +extern int check_name (const struct vol *vol, char *name); /* FP functions */ -extern int matchfile2dirperms __P((char *, struct vol *, int)); -extern int afp_moveandrename __P((AFPObj *, char *, int, char *, int *)); -extern int afp_rename __P((AFPObj *, char *, int, char *, int *)); -extern int afp_delete __P((AFPObj *, char *, int, char *, int *)); -extern int afp_getfildirparams __P((AFPObj *, char *, int, char *, - int *)); -extern int afp_setfildirparams __P((AFPObj *, char *, int, char *, - int *)); +extern int matchfile2dirperms (char *, struct vol *, int); +extern int afp_moveandrename (AFPObj *, char *, int, char *, int *); +extern int afp_rename (AFPObj *, char *, int, char *, int *); +extern int afp_delete (AFPObj *, char *, int, char *, int *); +extern int afp_getfildirparams (AFPObj *, char *, int, char *, + int *); +extern int afp_setfildirparams (AFPObj *, char *, int, char *, + int *); #endif diff --git a/etc/afpd/fork.c b/etc/afpd/fork.c index 0374601a..5e58b326 100644 --- a/etc/afpd/fork.c +++ b/etc/afpd/fork.c @@ -1,5 +1,5 @@ /* - * $Id: fork.c,v 1.62 2009-09-11 09:14:16 franklahm Exp $ + * $Id: fork.c,v 1.63 2009-10-13 22:55:37 didg Exp $ * * Copyright (c) 1990,1993 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. @@ -50,11 +50,7 @@ extern int getmetadata(struct vol *vol, struct path *path, struct dir *dir, char *buf, int *buflen, struct adouble *adp); -static int getforkparams(ofork, bitmap, buf, buflen ) -struct ofork *ofork; -u_int16_t bitmap; -char *buf; -int *buflen; +static int getforkparams(struct ofork *ofork, u_int16_t bitmap, char *buf, int *buflen) { struct path path; struct stat *st; @@ -105,9 +101,7 @@ int *buflen; } /* ---------------------------- */ -static off_t get_off_t(ibuf, is64) -char **ibuf; -int is64; +static off_t get_off_t(char **ibuf, int is64) { u_int32_t temp; off_t ret; @@ -129,10 +123,7 @@ int is64; } /* ---------------------- */ -static int set_off_t(offset, rbuf, is64) -off_t offset; -char *rbuf; -int is64; +static int set_off_t(off_t offset, char *rbuf, int is64) { u_int32_t temp; int ret; @@ -257,10 +248,7 @@ static int fork_setmode(struct adouble *adp, int eid, int access, int ofrefnum) } /* ----------------------- */ -int afp_openfork(obj, ibuf, ibuflen, rbuf, rbuflen ) -AFPObj *obj _U_; -char *ibuf, *rbuf; -int ibuflen _U_, *rbuflen; +int afp_openfork(AFPObj *obj _U_, char *ibuf, int ibuflen _U_, char *rbuf, int *rbuflen) { struct vol *vol; struct dir *dir; @@ -531,10 +519,7 @@ openfork_err: return ret; } -int afp_setforkparams(obj, ibuf, ibuflen, rbuf, rbuflen ) -AFPObj *obj _U_; -char *ibuf, *rbuf _U_; -int ibuflen, *rbuflen; +int afp_setforkparams(AFPObj *obj _U_, char *ibuf, int ibuflen, char *rbuf _U_, int *rbuflen) { struct ofork *ofork; off_t size; @@ -671,11 +656,7 @@ afp_setfork_err: /* ---------------------- */ -static int byte_lock(obj, ibuf, ibuflen, rbuf, rbuflen, is64 ) -AFPObj *obj _U_; -char *ibuf, *rbuf; -int ibuflen _U_, *rbuflen; -int is64; +static int byte_lock(AFPObj *obj _U_, char *ibuf, int ibuflen _U_, char *rbuf, int *rbuflen, int is64) { struct ofork *ofork; off_t offset, length; @@ -754,19 +735,13 @@ int is64; } /* --------------------------- */ -int afp_bytelock(obj, ibuf, ibuflen, rbuf, rbuflen ) -AFPObj *obj; -char *ibuf, *rbuf; -int ibuflen, *rbuflen; +int afp_bytelock(AFPObj *obj, char *ibuf, int ibuflen, char *rbuf, int *rbuflen) { return byte_lock ( obj, ibuf, ibuflen, rbuf, rbuflen , 0); } /* --------------------------- */ -int afp_bytelock_ext(obj, ibuf, ibuflen, rbuf, rbuflen ) -AFPObj *obj; -char *ibuf, *rbuf; -int ibuflen, *rbuflen; +int afp_bytelock_ext(AFPObj *obj, char *ibuf, int ibuflen, char *rbuf, int *rbuflen) { return byte_lock ( obj, ibuf, ibuflen, rbuf, rbuflen , 1); } @@ -774,8 +749,7 @@ int ibuflen, *rbuflen; #undef UNLOCKBIT /* --------------------------- */ -static int crlf( of ) -struct ofork *of; +static int crlf(struct ofork *of) { struct extmap *em; @@ -862,11 +836,7 @@ static ssize_t read_file(struct ofork *ofork, int eid, * * with dsi, should we check that reqcount < server quantum? */ -static int read_fork(obj, ibuf, ibuflen, rbuf, rbuflen, is64) -AFPObj *obj; -char *ibuf, *rbuf; -int ibuflen _U_, *rbuflen; -int is64; +static int read_fork(AFPObj *obj, char *ibuf, int ibuflen _U_, char *rbuf, int *rbuflen, int is64) { struct ofork *ofork; off_t offset, saveoff, reqcount, savereqcount; @@ -1036,28 +1006,19 @@ afp_read_err: } /* ---------------------- */ -int afp_read(obj, ibuf, ibuflen, rbuf, rbuflen) -AFPObj *obj; -char *ibuf, *rbuf; -int ibuflen, *rbuflen; +int afp_read(AFPObj *obj, char *ibuf, int ibuflen, char *rbuf, int *rbuflen) { return read_fork(obj, ibuf, ibuflen, rbuf, rbuflen, 0); } /* ---------------------- */ -int afp_read_ext(obj, ibuf, ibuflen, rbuf, rbuflen) -AFPObj *obj; -char *ibuf, *rbuf; -int ibuflen, *rbuflen; +int afp_read_ext(AFPObj *obj, char *ibuf, int ibuflen, char *rbuf, int *rbuflen) { return read_fork(obj, ibuf, ibuflen, rbuf, rbuflen, 1); } /* ---------------------- */ -int afp_flush(obj, ibuf, ibuflen, rbuf, rbuflen ) -AFPObj *obj _U_; -char *ibuf, *rbuf _U_; -int ibuflen _U_, *rbuflen; +int afp_flush(AFPObj *obj _U_, char *ibuf, int ibuflen _U_, char *rbuf _U_, int *rbuflen) { struct vol *vol; u_int16_t vid; @@ -1074,10 +1035,7 @@ int ibuflen _U_, *rbuflen; return( AFP_OK ); } -int afp_flushfork(obj, ibuf, ibuflen, rbuf, rbuflen ) -AFPObj *obj _U_; -char *ibuf, *rbuf _U_; -int ibuflen _U_, *rbuflen; +int afp_flushfork(AFPObj *obj _U_, char *ibuf, int ibuflen _U_, char *rbuf _U_, int *rbuflen) { struct ofork *ofork; u_int16_t ofrefnum; @@ -1104,10 +1062,7 @@ int ibuflen _U_, *rbuflen; fsync(2) on OSX is implemented differently than on other platforms. see: http://mirror.linux.org.au/pub/linux.conf.au/2007/video/talks/278.pdf. */ -int afp_syncfork(obj, ibuf, ibuflen, rbuf, rbuflen ) - AFPObj *obj _U_; - char *ibuf, *rbuf _U_; - int ibuflen _U_, *rbuflen; +int afp_syncfork(AFPObj *obj _U_, char *ibuf, int ibuflen _U_, char *rbuf _U_, int *rbuflen) { struct ofork *ofork; u_int16_t ofrefnum; @@ -1132,8 +1087,7 @@ int afp_syncfork(obj, ibuf, ibuflen, rbuf, rbuflen ) } /* this is very similar to closefork */ -int flushfork( ofork ) -struct ofork *ofork; +int flushfork(struct ofork *ofork) { struct timeval tv; @@ -1174,10 +1128,7 @@ struct ofork *ofork; return( err ); } -int afp_closefork(obj, ibuf, ibuflen, rbuf, rbuflen ) -AFPObj *obj _U_; -char *ibuf, *rbuf _U_; -int ibuflen _U_, *rbuflen; +int afp_closefork(AFPObj *obj _U_, char *ibuf, int ibuflen _U_, char *rbuf _U_, int *rbuflen) { struct ofork *ofork; u_int16_t ofrefnum; @@ -1239,11 +1190,7 @@ static ssize_t write_file(struct ofork *ofork, int eid, /* FPWrite. NOTE: on an error, we always use afp_write_err as * the client may have sent us a bunch of data that's not reflected * in reqcount et al. */ -static int write_fork(obj, ibuf, ibuflen, rbuf, rbuflen, is64) -AFPObj *obj; -char *ibuf, *rbuf; -int ibuflen _U_, *rbuflen; -int is64; +static int write_fork(AFPObj *obj, char *ibuf, int ibuflen _U_, char *rbuf, int *rbuflen, int is64) { struct ofork *ofork; off_t offset, saveoff, reqcount; @@ -1422,10 +1369,7 @@ afp_write_err: } /* ---------------------------- */ -int afp_write(obj, ibuf, ibuflen, rbuf, rbuflen) -AFPObj *obj; -char *ibuf, *rbuf; -int ibuflen, *rbuflen; +int afp_write(AFPObj *obj, char *ibuf, int ibuflen, char *rbuf, int *rbuflen) { return write_fork(obj, ibuf, ibuflen, rbuf, rbuflen, 0); } @@ -1433,19 +1377,13 @@ int ibuflen, *rbuflen; /* ---------------------------- * FIXME need to deal with SIGXFSZ signal */ -int afp_write_ext(obj, ibuf, ibuflen, rbuf, rbuflen) -AFPObj *obj; -char *ibuf, *rbuf; -int ibuflen, *rbuflen; +int afp_write_ext(AFPObj *obj, char *ibuf, int ibuflen, char *rbuf, int *rbuflen) { return write_fork(obj, ibuf, ibuflen, rbuf, rbuflen, 1); } /* ---------------------------- */ -int afp_getforkparams(obj, ibuf, ibuflen, rbuf, rbuflen ) -AFPObj *obj _U_; -char *ibuf, *rbuf; -int ibuflen _U_, *rbuflen; +int afp_getforkparams(AFPObj *obj _U_, char *ibuf, int ibuflen _U_, char *rbuf, int *rbuflen) { struct ofork *ofork; int buflen, ret; diff --git a/etc/afpd/fork.h b/etc/afpd/fork.h index 3804f742..267c184d 100644 --- a/etc/afpd/fork.h +++ b/etc/afpd/fork.h @@ -1,5 +1,5 @@ /* - * $Id: fork.h,v 1.13 2009-09-11 09:14:16 franklahm Exp $ + * $Id: fork.h,v 1.14 2009-10-13 22:55:37 didg Exp $ * * Copyright (c) 1990,1993 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. @@ -53,41 +53,41 @@ struct ofork { #define of_name(a) (a)->of_ad->ad_m_name /* in ofork.c */ -extern struct ofork *of_alloc __P((struct vol *, struct dir *, +extern struct ofork *of_alloc (struct vol *, struct dir *, char *, u_int16_t *, const int, struct adouble *, - struct stat *)); -extern void of_dealloc __P((struct ofork *)); -extern struct ofork *of_find __P((const u_int16_t)); -extern struct ofork *of_findname __P((struct path *)); -extern int of_rename __P((const struct vol *, + struct stat *); +extern void of_dealloc (struct ofork *); +extern struct ofork *of_find (const u_int16_t); +extern struct ofork *of_findname (struct path *); +extern int of_rename (const struct vol *, struct ofork *, struct dir *, const char *, - struct dir *, const char *)); -extern int of_flush __P((const struct vol *)); -extern void of_pforkdesc __P((FILE *)); -extern int of_stat __P((struct path *)); -extern int of_statdir __P((const struct vol *vol, struct path *)); -extern int of_closefork __P((struct ofork *ofork)); -extern void of_closevol __P((const struct vol *vol)); -extern struct adouble *of_ad __P((const struct vol *, struct path *, struct adouble *)); + struct dir *, const char *); +extern int of_flush (const struct vol *); +extern void of_pforkdesc (FILE *); +extern int of_stat (struct path *); +extern int of_statdir (const struct vol *vol, struct path *); +extern int of_closefork (struct ofork *ofork); +extern void of_closevol (const struct vol *vol); +extern struct adouble *of_ad (const struct vol *, struct path *, struct adouble *); /* in fork.c */ -extern int flushfork __P((struct ofork *)); -extern int getforkmode __P((struct adouble *, int , int )); +extern int flushfork (struct ofork *); +extern int getforkmode (struct adouble *, int , int ); /* FP functions */ -extern int afp_openfork __P((AFPObj *, char *, int, char *, int *)); -extern int afp_bytelock __P((AFPObj *, char *, int, char *, int *)); -extern int afp_getforkparams __P((AFPObj *, char *, int, char *, int *)); -extern int afp_setforkparams __P((AFPObj *, char *, int, char *, int *)); -extern int afp_read __P((AFPObj *, char *, int, char *, int *)); -extern int afp_write __P((AFPObj *, char *, int, char *, int *)); -extern int afp_flushfork __P((AFPObj *, char *, int, char *, int *)); -extern int afp_flush __P((AFPObj *, char *, int, char *, int *)); -extern int afp_closefork __P((AFPObj *, char *, int, char *, int *)); +extern int afp_openfork (AFPObj *, char *, int, char *, int *); +extern int afp_bytelock (AFPObj *, char *, int, char *, int *); +extern int afp_getforkparams (AFPObj *, char *, int, char *, int *); +extern int afp_setforkparams (AFPObj *, char *, int, char *, int *); +extern int afp_read (AFPObj *, char *, int, char *, int *); +extern int afp_write (AFPObj *, char *, int, char *, int *); +extern int afp_flushfork (AFPObj *, char *, int, char *, int *); +extern int afp_flush (AFPObj *, char *, int, char *, int *); +extern int afp_closefork (AFPObj *, char *, int, char *, int *); -extern int afp_bytelock_ext __P((AFPObj *, char *, int, char *, int *)); -extern int afp_read_ext __P((AFPObj *, char *, int, char *, int *)); -extern int afp_write_ext __P((AFPObj *, char *, int, char *, int *)); -extern int afp_syncfork __P((AFPObj *, char *, int, char *, int *)); +extern int afp_bytelock_ext (AFPObj *, char *, int, char *, int *); +extern int afp_read_ext (AFPObj *, char *, int, char *, int *); +extern int afp_write_ext (AFPObj *, char *, int, char *, int *); +extern int afp_syncfork (AFPObj *, char *, int, char *, int *); #endif diff --git a/etc/afpd/gettok.c b/etc/afpd/gettok.c index ce413af3..d4e4d8f5 100644 --- a/etc/afpd/gettok.c +++ b/etc/afpd/gettok.c @@ -1,5 +1,5 @@ /* - * $Id: gettok.c,v 1.5 2001-12-03 05:03:38 jmarcus Exp $ + * $Id: gettok.c,v 1.6 2009-10-13 22:55:37 didg Exp $ * * Copyright (c) 1990,1994 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. @@ -34,9 +34,7 @@ char *strchr (), *strrchr (); static char *l_curr; static char *l_end; -void initline( len, line ) -int len; -char *line; +void initline( int len, char *line) { l_curr = line; l_end = line + len; @@ -47,9 +45,7 @@ char *line; #define ST_BEGIN 2 int -parseline( len, token ) -int len; -char *token; +parseline(int len, char *token) { char *p, *e; int state; @@ -103,8 +99,7 @@ char *token; } #ifdef notdef -void parseline( token, user ) -char *token, *user; +void parseline(char *token, char *user) { char *p = pos, *t = token, *u, *q, buf[ MAXPATHLEN ]; struct passwd *pwent; diff --git a/etc/afpd/globals.h b/etc/afpd/globals.h index d5aa7b61..2439e311 100644 --- a/etc/afpd/globals.h +++ b/etc/afpd/globals.h @@ -1,5 +1,5 @@ /* - * $Id: globals.h,v 1.26 2009-03-16 13:59:12 franklahm Exp $ + * $Id: globals.h,v 1.27 2009-10-13 22:55:37 didg Exp $ * * Copyright (c) 1990,1993 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. @@ -118,25 +118,25 @@ extern char getwdbuf[]; extern char Cnid_srv[MAXHOSTNAMELEN + 1]; extern int Cnid_port; -extern int get_afp_errno __P((const int param)); -extern void afp_options_init __P((struct afp_options *)); -extern int afp_options_parse __P((int, char **, struct afp_options *)); -extern int afp_options_parseline __P((char *, struct afp_options *)); -extern void afp_options_free __P((struct afp_options *, - const struct afp_options *)); -extern void setmessage __P((const char *)); -extern void readmessage __P((AFPObj *)); +extern int get_afp_errno (const int param); +extern void afp_options_init (struct afp_options *); +extern int afp_options_parse (int, char **, struct afp_options *); +extern int afp_options_parseline (char *, struct afp_options *); +extern void afp_options_free (struct afp_options *, + const struct afp_options *); +extern void setmessage (const char *); +extern void readmessage (AFPObj *); /* gettok.c */ -extern void initline __P((int, char *)); -extern int parseline __P((int, char *)); +extern void initline (int, char *); +extern int parseline (int, char *); /* afp_util.c */ -const char *AfpNum2name __P((int )); +const char *AfpNum2name (int ); #ifndef NO_DDP -extern void afp_over_asp __P((AFPObj *)); +extern void afp_over_asp (AFPObj *); #endif /* NO_DDP */ -extern void afp_over_dsi __P((AFPObj *)); +extern void afp_over_dsi (AFPObj *); #endif /* globals.h */ diff --git a/etc/afpd/main.c b/etc/afpd/main.c index f7ec2f68..5fa895c5 100644 --- a/etc/afpd/main.c +++ b/etc/afpd/main.c @@ -1,5 +1,5 @@ /* - * $Id: main.c,v 1.24 2009-02-27 09:14:40 franklahm Exp $ + * $Id: main.c,v 1.25 2009-10-13 22:55:37 didg Exp $ * * Copyright (c) 1990,1993 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. @@ -147,14 +147,12 @@ static void afp_goaway(int sig) return; } -static void child_handler() +static void child_handler(int sig _U_) { server_child_handler(server_children); } -int main( ac, av ) -int ac; -char **av; +int main(int ac, char **av) { AFPConfig *config; fd_set rfds; diff --git a/etc/afpd/mangle.h b/etc/afpd/mangle.h index 8d944d13..6c6ed75d 100644 --- a/etc/afpd/mangle.h +++ b/etc/afpd/mangle.h @@ -1,5 +1,5 @@ /* - * $Id: mangle.h,v 1.6 2005-04-28 20:49:44 bfernhomberg Exp $ + * $Id: mangle.h,v 1.7 2009-10-13 22:55:37 didg Exp $ * */ @@ -24,8 +24,8 @@ #define MANGLE_LENGTH 9 /* #ffffffff This really can't be changed. */ #define MAX_LENGTH MACFILELEN -extern char *mangle __P((const struct vol *, char *, size_t, char *, cnid_t, int)); -extern char *demangle __P((const struct vol *, char *, cnid_t did)); -extern char *demangle_osx __P((const struct vol *, char *, cnid_t did, cnid_t *fileid)); +extern char *mangle (const struct vol *, char *, size_t, char *, cnid_t, int); +extern char *demangle (const struct vol *, char *, cnid_t did); +extern char *demangle_osx (const struct vol *, char *, cnid_t did, cnid_t *fileid); #endif /* AFPD_MANGLE_H */ diff --git a/etc/afpd/messages.c b/etc/afpd/messages.c index 00c6c327..d5afefd9 100644 --- a/etc/afpd/messages.c +++ b/etc/afpd/messages.c @@ -1,5 +1,5 @@ /* - * $Id: messages.c,v 1.18 2005-04-28 20:49:44 bfernhomberg Exp $ + * $Id: messages.c,v 1.19 2009-10-13 22:55:37 didg Exp $ * * Copyright (c) 1997 Adrian Sun (asun@zoology.washington.edu) * All Rights Reserved. See COPYRIGHT. @@ -35,8 +35,7 @@ void setmessage(const char *message) strlcpy(servermesg, message, MAXMESGSIZE); } -void readmessage(obj) -AFPObj *obj; +void readmessage(AFPObj *obj) { /* Read server message from file defined as SERVERTEXT */ #ifdef SERVERTEXT @@ -113,10 +112,7 @@ AFPObj *obj; #endif /* SERVERTEXT */ } -int afp_getsrvrmesg(obj, ibuf, ibuflen, rbuf, rbuflen) -AFPObj *obj; -char *ibuf, *rbuf; -int ibuflen _U_, *rbuflen; +int afp_getsrvrmesg(AFPObj *obj, char *ibuf, int ibuflen _U_, char *rbuf, int *rbuflen) { char *message; u_int16_t type, bitmap; diff --git a/etc/afpd/misc.h b/etc/afpd/misc.h index 2e5c25a6..d5c44007 100644 --- a/etc/afpd/misc.h +++ b/etc/afpd/misc.h @@ -1,5 +1,5 @@ /* - * $Id: misc.h,v 1.3 2001-12-03 05:03:38 jmarcus Exp $ + * $Id: misc.h,v 1.4 2009-10-13 22:55:37 didg Exp $ */ #ifndef AFPD_MISC_H @@ -10,19 +10,19 @@ /* FP functions */ /* messages.c */ -extern int afp_getsrvrmesg __P((AFPObj *, char *, int, char *, int *)); +extern int afp_getsrvrmesg (AFPObj *, char *, int, char *, int *); /* afs.c */ #ifdef AFS -extern int afp_getdiracl __P((AFPObj *, char *, int, char *, int *)); -extern int afp_setdiracl __P((AFPObj *, char *, int, char *, int *)); +extern int afp_getdiracl (AFPObj *, char *, int, char *, int *); +extern int afp_setdiracl (AFPObj *, char *, int, char *, int *); #else /* AFS */ #define afp_getdiracl NULL #define afp_setdiracl NULL #endif /* AFS */ #if defined( AFS ) && defined( UAM_AFSKRB ) -extern int afp_afschangepw __P((AFPObj *, char *, int, char *, int *)); +extern int afp_afschangepw (AFPObj *, char *, int, char *, int *); #else /* AFS && UAM_AFSKRB */ #define afp_afschangepw NULL #endif /* AFS && UAM_AFSKRB */ diff --git a/etc/afpd/nfsquota.c b/etc/afpd/nfsquota.c index d7c11259..e3ad5ddc 100644 --- a/etc/afpd/nfsquota.c +++ b/etc/afpd/nfsquota.c @@ -1,5 +1,5 @@ /* - * $Id: nfsquota.c,v 1.12 2005-04-28 20:49:44 bfernhomberg Exp $ + * $Id: nfsquota.c,v 1.13 2009-10-13 22:55:37 didg Exp $ * * parts of this are lifted from the bsd quota program and are * therefore under the following copyright: @@ -57,11 +57,10 @@ char *strchr (), *strrchr (); /* lifted (with modifications) from the bsd quota program */ static int -callaurpc(vol, prognum, versnum, procnum, inproc, in, outproc, out) -struct vol *vol; -u_long prognum, versnum, procnum; -xdrproc_t inproc, outproc; -char *in, *out; +callaurpc(struct vol *vol, + u_long prognum, u_long versnum, u_long procnum, + xdrproc_t inproc, char *in, + xdrproc_t outproc, char *out) { enum clnt_stat clnt_stat; struct timeval tottimeout; diff --git a/etc/afpd/ofork.c b/etc/afpd/ofork.c index 130a3cfa..fd269e78 100644 --- a/etc/afpd/ofork.c +++ b/etc/afpd/ofork.c @@ -1,5 +1,5 @@ /* - * $Id: ofork.c,v 1.27 2008-12-03 18:35:44 didg Exp $ + * $Id: ofork.c,v 1.28 2009-10-13 22:55:37 didg Exp $ * * Copyright (c) 1996 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. @@ -70,8 +70,7 @@ static void of_unhash(struct ofork *of) } #ifdef DEBUG1 -void of_pforkdesc( f ) -FILE *f; +void of_pforkdesc( FILE *f) { int ofrefnum; @@ -102,11 +101,11 @@ int of_flush(const struct vol *vol) return( 0 ); } -int of_rename(vol, s_of, olddir, oldpath, newdir, newpath) -const struct vol *vol; -struct ofork *s_of; -struct dir *olddir, *newdir; -const char *oldpath _U_, *newpath; +int of_rename( + const struct vol *vol, + struct ofork *s_of, + struct dir *olddir, const char *oldpath _U_, + struct dir *newdir, const char *newpath) { struct ofork *of, *next, *d_ofork; int done = 0; @@ -151,14 +150,13 @@ const char *oldpath _U_, *newpath; #define min(a,b) ((a)<(b)?(a):(b)) struct ofork * - of_alloc(vol, dir, path, ofrefnum, eid, ad, st) -struct vol *vol; -struct dir *dir; -char *path; -u_int16_t *ofrefnum; -const int eid; -struct adouble *ad; -struct stat *st; +of_alloc(struct vol *vol, + struct dir *dir, + char *path, + u_int16_t *ofrefnum, + const int eid, + struct adouble *ad, + struct stat *st) { struct ofork *of, *d_ofork; u_int16_t refnum, of_refnum; @@ -349,8 +347,7 @@ struct ofork * return NULL; } -void of_dealloc( of ) -struct ofork *of; +void of_dealloc( struct ofork *of) { if (!oforks) return; diff --git a/etc/afpd/quota.c b/etc/afpd/quota.c index 39ad23cf..b5d52375 100644 --- a/etc/afpd/quota.c +++ b/etc/afpd/quota.c @@ -1,5 +1,5 @@ /* - * $Id: quota.c,v 1.30 2008-05-16 04:19:41 didg Exp $ + * $Id: quota.c,v 1.31 2009-10-13 22:55:37 didg Exp $ * * Copyright (c) 1990,1993 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. @@ -190,11 +190,7 @@ static int get_linux_quota(int what, char *path, uid_t euser_id, struct dqblk *d Abstract out the XFS Quota Manager quota get call. ****************************************************************************/ -static int get_linux_xfs_quota(what, path, euser_id, dqb) -int what; -char *path; -uid_t euser_id; -struct dqblk *dqb; +static int get_linux_xfs_quota(int what, char *path, uid_t euser_id, struct dqblk *dqb) { int ret = -1; #ifdef HAVE_LINUX_XQM_H @@ -221,11 +217,7 @@ struct dqblk *dqb; ** For API v2 the results are copied back into a v1 structure. ** Taken from quota-1.4.8 perl module */ -static int get_linux_fs_quota( what, path, euser_id, dqb) -int what; -char *path; -uid_t euser_id; -struct dqblk *dqb; +static int get_linux_fs_quota(int what, char *path, uid_t euser_id, struct dqblk *dqb) { int ret; @@ -297,9 +289,7 @@ struct dqblk *dqb; * on which "file" resides. Returns NULL on failure. */ static char * -mountp( file, nfs) -char *file; -int *nfs; +mountp( char *file, int *nfs) { struct stat sb; FILE *mtab; @@ -344,9 +334,7 @@ int *nfs; */ static char * -special( file, nfs ) -char *file; -int *nfs; +special( char *file, int *nfs) { static struct fs_data fsd; @@ -365,9 +353,7 @@ int *nfs; #if (defined(HAVE_SYS_MOUNT_H) && !defined(__linux__)) || defined(BSD4_4) || defined(_IBMR2) static char * -special( file, nfs ) -char *file; -int *nfs; +special(char *file, int *nfs) { static struct statfs sfs; @@ -390,9 +376,7 @@ int *nfs; #else /* BSD4_4 */ static char * -special( file, nfs ) -char *file; -int *nfs; +special(char *file, int *nfs) { struct stat sb; FILE *mtab; @@ -443,10 +427,7 @@ int *nfs; #endif /* __svr4__ */ -static int getfsquota(vol, uid, dq) -struct vol *vol; -const int uid; -struct dqblk *dq; +static int getfsquota(struct vol *vol, const int uid, struct dqblk *dq) { struct dqblk dqg; @@ -560,10 +541,7 @@ struct dqblk *dq; } -static int getquota( vol, dq, bsize) -struct vol *vol; -struct dqblk *dq; -const u_int32_t bsize; +static int getquota( struct vol *vol, struct dqblk *dq, const u_int32_t bsize) { char *p; @@ -646,8 +624,7 @@ const u_int32_t bsize; #endif /* TRU64 */ } -static int overquota( dqblk ) -struct dqblk *dqblk; +static int overquota( struct dqblk *dqblk) { struct timeval tv; @@ -702,10 +679,7 @@ struct dqblk *dqblk; #define tobytes(a, b) dbtob((VolSpace) (a)) #endif -int uquota_getvolspace( vol, bfree, btotal, bsize) -struct vol *vol; -VolSpace *bfree, *btotal; -const u_int32_t bsize; +int uquota_getvolspace( struct vol *vol, VolSpace *bfree, VolSpace *btotal, const u_int32_t bsize) { u_int64_t this_bsize; struct dqblk dqblk; diff --git a/etc/afpd/status.c b/etc/afpd/status.c index 389fdba1..8c61af96 100644 --- a/etc/afpd/status.c +++ b/etc/afpd/status.c @@ -1,5 +1,5 @@ /* - * $Id: status.c,v 1.23 2009-04-05 07:22:06 franklahm Exp $ + * $Id: status.c,v 1.24 2009-10-13 22:55:37 didg Exp $ * * Copyright (c) 1990,1993 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. @@ -471,7 +471,7 @@ static void status_icon(char *data, const unsigned char *icondata, /* --------------------- */ -void status_reset() +void status_reset(void) { Id = 0; } @@ -574,10 +574,7 @@ void status_init(AFPConfig *aspconfig, AFPConfig *dsiconfig, } /* this is the same as asp/dsi_getstatus */ -int afp_getsrvrinfo(obj, ibuf, ibuflen, rbuf, rbuflen ) -AFPObj *obj; -char *ibuf _U_, *rbuf; -int ibuflen _U_, *rbuflen; +int afp_getsrvrinfo(AFPObj *obj, char *ibuf _U_, int ibuflen _U_, char *rbuf, int *rbuflen) { AFPConfig *config = obj->config; diff --git a/etc/afpd/status.h b/etc/afpd/status.h index e67c30a0..4b927fad 100644 --- a/etc/afpd/status.h +++ b/etc/afpd/status.h @@ -1,5 +1,5 @@ /* - * $Id: status.h,v 1.7 2005-04-28 20:49:44 bfernhomberg Exp $ + * $Id: status.h,v 1.8 2009-10-13 22:55:37 didg Exp $ */ #ifndef AFPD_STATUS_H @@ -39,11 +39,11 @@ #define PASSWD_NOSAVE (1 << 1) #define PASSWD_ALL (PASSWD_SET | PASSWD_NOSAVE) -extern void status_versions __P((char * /*status*/)); -extern void status_uams __P((char * /*status*/, const char * /*authlist*/)); -extern void status_reset __P((void )); -extern void status_init __P((AFPConfig *, AFPConfig *, - const struct afp_options *)); -extern int afp_getsrvrinfo __P((AFPObj *, char *, int, char *, int *)); +extern void status_versions (char * /*status*/); +extern void status_uams (char * /*status*/, const char * /*authlist*/); +extern void status_reset (void ); +extern void status_init (AFPConfig *, AFPConfig *, + const struct afp_options *); +extern int afp_getsrvrinfo (AFPObj *, char *, int, char *, int *); #endif diff --git a/etc/afpd/switch.c b/etc/afpd/switch.c index 9e286c72..3a8855da 100644 --- a/etc/afpd/switch.c +++ b/etc/afpd/switch.c @@ -1,5 +1,5 @@ /* - * $Id: switch.c,v 1.17 2009-09-11 09:14:16 franklahm Exp $ + * $Id: switch.c,v 1.18 2009-10-13 22:55:37 didg Exp $ * * Copyright (c) 1990,1991 Regents of The University of Michigan. * All Rights Reserved. @@ -50,10 +50,7 @@ #include "acls.h" #endif -static int afp_null(obj, ibuf, ibuflen, rbuf, rbuflen ) -AFPObj *obj _U_; -char *ibuf, *rbuf _U_; -int ibuflen _U_, *rbuflen; +static int afp_null(AFPObj *obj _U_, char *ibuf, int ibuflen _U_, char *rbuf _U_, int *rbuflen) { LOG(log_info, logtype_afpd, "afp_null handle %d", *ibuf ); *rbuflen = 0; diff --git a/etc/afpd/switch.h b/etc/afpd/switch.h index 27e104f6..3ca8d2a9 100644 --- a/etc/afpd/switch.h +++ b/etc/afpd/switch.h @@ -1,5 +1,5 @@ /* - * $Id: switch.h,v 1.2 2001-06-20 18:33:04 rufustfirefly Exp $ + * $Id: switch.h,v 1.3 2009-10-13 22:55:37 didg Exp $ * * Copyright (c) 1990,1991 Regents of The University of Michigan. * All Rights Reserved. @@ -26,7 +26,7 @@ #ifndef AFPD_SWITCH_H #define AFPD_SWITCH_H 1 -extern int (**afp_switch)(); +extern int (**afp_switch)(AFPObj *, char *ibuf, int ilen, char *rbuf, int *rlen); extern int (*postauth_switch[])(); #endif diff --git a/etc/afpd/uam_auth.h b/etc/afpd/uam_auth.h index 7f663f81..07669b0f 100644 --- a/etc/afpd/uam_auth.h +++ b/etc/afpd/uam_auth.h @@ -1,5 +1,5 @@ /* - * $Id: uam_auth.h,v 1.5 2005-04-28 20:49:45 bfernhomberg Exp $ + * $Id: uam_auth.h,v 1.6 2009-10-13 22:55:37 didg Exp $ * * Copyright (c) 1999 Adrian Sun (asun@zoology.washington.edu) * All Rights Reserved. See COPYRIGHT. @@ -28,16 +28,16 @@ struct uam_obj { int uam_count; union { struct { - int (*login) __P((void *, struct passwd **, - char *, int, char *, int *)); - int (*logincont) __P((void *, struct passwd **, char *, - int, char *, int *)); - void (*logout) __P((void)); - int (*login_ext) __P((void *, char *, struct passwd **, - char *, int, char *, int *)); + int (*login) (void *, struct passwd **, + char *, int, char *, int *); + int (*logincont) (void *, struct passwd **, char *, + int, char *, int *); + void (*logout) (void); + int (*login_ext) (void *, char *, struct passwd **, + char *, int, char *, int *); } uam_login; - int (*uam_changepw) __P((void *, char *, struct passwd *, char *, - int, char *, int *)); + int (*uam_changepw) (void *, char *, struct passwd *, char *, + int, char *, int *); } u; struct uam_obj *uam_prev, *uam_next; }; @@ -54,17 +54,17 @@ struct uam_obj { (a)->uam_next->uam_prev = (a)->uam_prev; \ } while (0) -extern struct uam_mod *uam_load __P((const char *, const char *)); -extern void uam_unload __P((struct uam_mod *)); +extern struct uam_mod *uam_load (const char *, const char *); +extern void uam_unload (struct uam_mod *); /* auth.c */ -int auth_load __P((const char *, const char *)); -int auth_register __P((const int, struct uam_obj *)); +int auth_load (const char *, const char *); +int auth_register (const int, struct uam_obj *); #define auth_unregister(a) uam_detach(a) -struct uam_obj *auth_uamfind __P((const int, const char *, const int)); -void auth_unload __P((void)); +struct uam_obj *auth_uamfind (const int, const char *, const int); +void auth_unload (void); /* uam.c */ -int uam_random_string __P((AFPObj *,char *, int)); +int uam_random_string (AFPObj *,char *, int); #endif /* uam_auth.h */ diff --git a/etc/afpd/unix.c b/etc/afpd/unix.c index ffe594a0..48ece605 100644 --- a/etc/afpd/unix.c +++ b/etc/afpd/unix.c @@ -1,5 +1,5 @@ /* - * $Id: unix.c,v 1.53 2009-10-02 09:32:40 franklahm Exp $ + * $Id: unix.c,v 1.54 2009-10-13 22:55:37 didg Exp $ * * Copyright (c) 1990,1993 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. @@ -54,10 +54,7 @@ extern void acltoownermode(char *path, struct stat *st,uid_t uid, struct maccess /* * Get the free space on a partition. */ -int ustatfs_getvolspace( vol, bfree, btotal, bsize ) -const struct vol *vol; -VolSpace *bfree, *btotal; -u_int32_t *bsize; +int ustatfs_getvolspace(const struct vol *vol, VolSpace *bfree, VolSpace *btotal, u_int32_t *bsize) { VolSpace maxVolSpace = (~(VolSpace)0); @@ -105,8 +102,7 @@ u_int32_t *bsize; return( AFP_OK ); } -static int utombits( bits ) -mode_t bits; +static int utombits(mode_t bits) { int mbits; @@ -123,9 +119,7 @@ mode_t bits; /* -------------------------------- cf AFP 3.0 page 63 */ -void utommode( stat, ma ) -struct stat *stat; -struct maccess *ma; +void utommode(struct stat *stat, struct maccess *ma) { mode_t mode; @@ -178,11 +172,7 @@ mode_t mode; * * dir parameter is used by AFS */ -void accessmode( path, ma, dir, st ) -char *path; -struct maccess *ma; -struct dir *dir _U_; -struct stat *st; +void accessmode(char *path, struct maccess *ma, struct dir *dir _U_, struct stat *st) { struct stat sb; @@ -200,8 +190,7 @@ struct stat sb; #endif } -int gmem( gid ) -const gid_t gid; +int gmem(const gid_t gid) { int i; @@ -213,8 +202,7 @@ const gid_t gid; return( 0 ); } -static mode_t mtoubits( bits ) -u_char bits; +static mode_t mtoubits(u_char bits) { mode_t mode; @@ -233,8 +221,7 @@ u_char bits; and from AFP 3.0 spec page 63 the mac mode should be save somewhere */ -mode_t mtoumode( ma ) -struct maccess *ma; +mode_t mtoumode(struct maccess *ma) { mode_t mode; @@ -252,8 +239,7 @@ struct maccess *ma; #define EXEC_MODE (S_IXGRP | S_IXUSR | S_IXOTH) -int setdeskmode( mode ) -const mode_t mode; +int setdeskmode(const mode_t mode) { char wd[ MAXPATHLEN + 1]; struct stat st; @@ -329,10 +315,7 @@ const mode_t mode; } /* --------------------- */ -int setfilunixmode (vol, path, mode) -const struct vol *vol; -struct path* path; -mode_t mode; +int setfilunixmode (const struct vol *vol, struct path* path, mode_t mode) { if (!path->st_valid) { of_stat(path); @@ -352,10 +335,7 @@ mode_t mode; /* --------------------- */ -int setdirunixmode( vol, name, mode ) -const struct vol *vol; -const char *name; -mode_t mode; +int setdirunixmode(const struct vol *vol, const char *name, mode_t mode) { int dropbox = (vol->v_flags & AFPVOL_DROPBOX); @@ -377,10 +357,7 @@ mode_t mode; } /* --------------------- */ -int setdirmode( vol, name, mode ) -const struct vol *vol; -const char *name; -mode_t mode; +int setdirmode(const struct vol *vol, const char *name, mode_t mode) { struct stat st; struct dirent *dirp; @@ -436,9 +413,7 @@ mode_t mode; } /* ----------------------------- */ -int setdeskowner( uid, gid ) -const uid_t uid; -const gid_t gid; +int setdeskowner(const uid_t uid, const gid_t gid) { char wd[ MAXPATHLEN + 1]; char modbuf[12 + 1], *m; @@ -500,11 +475,7 @@ const gid_t gid; } /* ----------------------------- */ -int setfilowner(vol, uid, gid, path) -const struct vol *vol; -const uid_t uid; -const gid_t gid; -struct path* path; +int setfilowner(const struct vol *vol, const uid_t uid, const gid_t gid, struct path* path) { if (!path->st_valid) { @@ -535,11 +506,7 @@ struct path* path; * that user/group should inherit from other, but that doesn't fit * into the unix permission scheme. we can get around this by * co-opting some bits. */ -int setdirowner(vol, name, uid, gid ) -const struct vol *vol; -const char *name; -const uid_t uid; -const gid_t gid; +int setdirowner(const struct vol *vol, const char *name, const uid_t uid, const gid_t gid) { struct stat st; struct dirent *dirp; diff --git a/etc/afpd/unix.h b/etc/afpd/unix.h index c319bcd6..e6417998 100644 --- a/etc/afpd/unix.h +++ b/etc/afpd/unix.h @@ -1,5 +1,5 @@ /* - * $Id: unix.h,v 1.21 2009-10-02 09:32:40 franklahm Exp $ + * $Id: unix.h,v 1.22 2009-10-13 22:55:37 didg Exp $ */ #ifndef AFPD_UNIX_H @@ -65,8 +65,8 @@ typedef int mode_t; #if defined(linux) || defined(ultrix) || defined(HAVE_QUOTA_H) #ifndef NEED_QUOTACTL_WRAPPER /*#include */ -/*long quotactl __P((int, const char *, unsigned int, caddr_t)); */ -/* extern long quotactl __P((int, const char *, long, caddr_t)); */ +/*long quotactl (int, const char *, unsigned int, caddr_t); */ +/* extern long quotactl (int, const char *, long, caddr_t); */ #else /* ! NEED_QUOTACTL_WRAPPER */ #include @@ -200,30 +200,30 @@ struct dqblk_v1 { time_t dqb_itime; }; -extern long quotactl __P ((unsigned int, const char *, int, caddr_t)); +extern long quotactl (unsigned int, const char *, int, caddr_t); #endif /* linux */ -extern int getnfsquota __P((struct vol *, const int, const u_int32_t, - struct dqblk *)); +extern int getnfsquota (struct vol *, const int, const u_int32_t, + struct dqblk *); -extern int uquota_getvolspace __P((struct vol *, VolSpace *, VolSpace *, - const u_int32_t)); +extern int uquota_getvolspace (struct vol *, VolSpace *, VolSpace *, + const u_int32_t); #endif /* NO_QUOTA_SUPPORT */ extern struct afp_options default_options; -extern int gmem __P((const gid_t)); -extern int setdeskmode __P((const mode_t)); -extern int setdirunixmode __P((const struct vol *, const char *, mode_t)); -extern int setdirmode __P((const struct vol *, const char *, mode_t)); -extern int setdeskowner __P((const uid_t, const gid_t)); -extern int setdirowner __P((const struct vol *, const char *, const uid_t, const gid_t)); -extern int setfilunixmode __P((const struct vol *, struct path*, const mode_t)); -extern int setfilowner __P((const struct vol *, const uid_t, const gid_t, struct path*)); -extern void accessmode __P((char *, struct maccess *, struct dir *, struct stat *)); +extern int gmem (const gid_t); +extern int setdeskmode (const mode_t); +extern int setdirunixmode (const struct vol *, const char *, mode_t); +extern int setdirmode (const struct vol *, const char *, mode_t); +extern int setdeskowner (const uid_t, const gid_t); +extern int setdirowner (const struct vol *, const char *, const uid_t, const gid_t); +extern int setfilunixmode (const struct vol *, struct path*, const mode_t); +extern int setfilowner (const struct vol *, const uid_t, const gid_t, struct path*); +extern void accessmode (char *, struct maccess *, struct dir *, struct stat *); #ifdef AFS #define accessmode afsmode diff --git a/etc/afpd/volume.c b/etc/afpd/volume.c index a8ffaca9..1a6390c6 100644 --- a/etc/afpd/volume.c +++ b/etc/afpd/volume.c @@ -1,5 +1,5 @@ /* - * $Id: volume.c,v 1.91 2009-10-02 09:32:40 franklahm Exp $ + * $Id: volume.c,v 1.92 2009-10-13 22:55:37 didg Exp $ * * Copyright (c) 1990,1993 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. @@ -56,6 +56,8 @@ char *strchr (), *strrchr (); #include "unix.h" #include "mangle.h" #include "fork.h" +#include "hash.h" +#include "afp_vfs.h" extern int afprun(int root, char *cmd, int *outfd); @@ -808,10 +810,7 @@ static int creatvol(AFPObj *obj, struct passwd *pwd, } /* ---------------- */ -static char *myfgets( buf, size, fp ) -char *buf; -int size; -FILE *fp; +static char *myfgets( char *buf, int size, FILE *fp) { char *p; int c; @@ -863,9 +862,7 @@ FILE *fp; #endif -static int accessvol(args, name) -const char *args; -const char *name; +static int accessvol(const char *args, const char *name) { char buf[MAXPATHLEN + 1], *p; struct group *gr; @@ -889,11 +886,7 @@ const char *name; return 0; } -static int hostaccessvol(type, volname, args, obj) -int type; -char *volname; -const char *args; -const AFPObj *obj; +static int hostaccessvol(int type, char *volname, const char *args, const AFPObj *obj) { char buf[MAXPATHLEN + 1], *p, *b; DSI *dsi = obj->handle; @@ -938,9 +931,7 @@ const AFPObj *obj; return 0; } -static void setextmap( ext, type, creator, user) -char *ext, *type, *creator; -int user; +static void setextmap(char *ext, char *type, char *creator, int user) { struct extmap *em; int cnt; @@ -1066,12 +1057,7 @@ static int volfile_changed(struct afp_volume_name *p) * [codepage:] [casefold:] * TYPE [CREATOR] */ -static int readvolfile(obj, p1, p2, user, pwent) -AFPObj *obj; -struct afp_volume_name *p1; -char *p2; -int user; -struct passwd *pwent; +static int readvolfile(AFPObj *obj, struct afp_volume_name *p1, char *p2, int user, struct passwd *pwent) { FILE *fp; char path[ MAXPATHLEN + 1], tmp[ MAXPATHLEN + 1], @@ -1316,10 +1302,9 @@ struct vol *vol, *ovol, *nvol; } } -static int getvolspace( vol, bfree, btotal, xbfree, xbtotal, bsize ) -struct vol *vol; -u_int32_t *bfree, *btotal, *bsize; -VolSpace *xbfree, *xbtotal; +static int getvolspace(struct vol *vol, + u_int32_t *bfree, u_int32_t *btotal, + VolSpace *xbfree, VolSpace *xbtotal, u_int32_t *bsize) { int spaceflag, rc; u_int32_t maxsize; @@ -1389,12 +1374,7 @@ static void vol_setdate(u_int16_t id, struct adouble *adp, time_t date) } /* ----------------------- */ -static int getvolparams( bitmap, vol, st, buf, buflen ) -u_int16_t bitmap; -struct vol *vol; -struct stat *st; -char *buf; -int *buflen; +static int getvolparams( u_int16_t bitmap, struct vol *vol, struct stat *st, char *buf, int *buflen) { struct adouble ad; int bit = 0, isad = 1; @@ -1691,10 +1671,7 @@ void load_volumes(AFPObj *obj) } /* ------------------------------- */ -int afp_getsrvrparms(obj, ibuf, ibuflen, rbuf, rbuflen ) -AFPObj *obj; -char *ibuf _U_, *rbuf; -int ibuflen _U_, *rbuflen; +int afp_getsrvrparms(AFPObj *obj, char *ibuf _U_, int ibuflen _U_, char *rbuf, int *rbuflen) { struct timeval tv; struct stat st; @@ -1772,10 +1749,7 @@ int ibuflen _U_, *rbuflen; /* ------------------------- * we are the user here */ -int afp_openvol(obj, ibuf, ibuflen, rbuf, rbuflen ) -AFPObj *obj; -char *ibuf, *rbuf; -int ibuflen _U_, *rbuflen; +int afp_openvol(AFPObj *obj, char *ibuf, int ibuflen _U_, char *rbuf, int *rbuflen) { struct stat st; char *volname; @@ -2088,10 +2062,7 @@ static void deletevol(struct vol *vol) } /* ------------------------- */ -int afp_closevol(obj, ibuf, ibuflen, rbuf, rbuflen ) -AFPObj *obj _U_; -char *ibuf, *rbuf _U_; -int ibuflen _U_, *rbuflen; +int afp_closevol(AFPObj *obj _U_, char *ibuf, int ibuflen _U_, char *rbuf _U_, int *rbuflen) { struct vol *vol; u_int16_t vid; @@ -2165,8 +2136,7 @@ struct extmap *getdefextmap(void) /* -------------------------- poll if a volume is changed by other processes. */ -int pollvoltime(obj) -AFPObj *obj; +int pollvoltime(AFPObj *obj) { struct vol *vol; struct timeval tv; @@ -2192,9 +2162,7 @@ AFPObj *obj; } /* ------------------------- */ -void setvoltime(obj, vol ) -AFPObj *obj; -struct vol *vol; +void setvoltime(AFPObj *obj, struct vol *vol) { struct timeval tv; @@ -2225,10 +2193,7 @@ struct vol *vol; } /* ------------------------- */ -int afp_getvolparams(obj, ibuf, ibuflen, rbuf, rbuflen ) -AFPObj *obj _U_; -char *ibuf, *rbuf; -int ibuflen _U_, *rbuflen; +int afp_getvolparams(AFPObj *obj _U_, char *ibuf, int ibuflen _U_,char *rbuf, int *rbuflen) { struct vol *vol; u_int16_t vid, bitmap; @@ -2248,10 +2213,7 @@ int ibuflen _U_, *rbuflen; } /* ------------------------- */ -int afp_setvolparams(obj, ibuf, ibuflen, rbuf, rbuflen ) -AFPObj *obj _U_; -char *ibuf, *rbuf _U_; -int ibuflen _U_, *rbuflen; +int afp_setvolparams(AFPObj *obj _U_, char *ibuf, int ibuflen _U_, char *rbuf _U_, int *rbuflen) { struct adouble ad; struct vol *vol; diff --git a/etc/afpd/volume.h b/etc/afpd/volume.h index cc3dfdc9..1cb43993 100644 --- a/etc/afpd/volume.h +++ b/etc/afpd/volume.h @@ -1,5 +1,5 @@ /* - * $Id: volume.h,v 1.34 2009-10-02 09:32:40 franklahm Exp $ + * $Id: volume.h,v 1.35 2009-10-13 22:55:37 didg Exp $ * * Copyright (c) 1990,1994 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. @@ -21,22 +21,22 @@ #include "hash.h" #endif -extern struct vol *getvolbyvid __P((const u_int16_t)); -extern int ustatfs_getvolspace __P((const struct vol *, +extern struct vol *getvolbyvid (const u_int16_t); +extern int ustatfs_getvolspace (const struct vol *, VolSpace *, VolSpace *, - u_int32_t *)); -extern void setvoltime __P((AFPObj *, struct vol *)); -extern int pollvoltime __P((AFPObj *)); -extern void load_volumes __P((AFPObj *obj)); + u_int32_t *); +extern void setvoltime (AFPObj *, struct vol *); +extern int pollvoltime (AFPObj *); +extern void load_volumes (AFPObj *obj); /* FP functions */ -extern int afp_openvol __P((AFPObj *, char *, int, char *, int *)); -extern int afp_getvolparams __P((AFPObj *, char *, int, char *, int *)); -extern int afp_setvolparams __P((AFPObj *, char *, int, char *, int *)); -extern int afp_getsrvrparms __P((AFPObj *, char *, int, char *, int *)); -extern int afp_closevol __P((AFPObj *, char *, int, char *, int *)); +extern int afp_openvol (AFPObj *, char *, int, char *, int *); +extern int afp_getvolparams (AFPObj *, char *, int, char *, int *); +extern int afp_setvolparams (AFPObj *, char *, int, char *, int *); +extern int afp_getsrvrparms (AFPObj *, char *, int, char *, int *); +extern int afp_closevol (AFPObj *, char *, int, char *, int *); /* netatalk functions */ -extern void close_all_vol __P((void)); +extern void close_all_vol (void); #endif diff --git a/etc/atalkd/aep.c b/etc/atalkd/aep.c index bc2cdaaa..6d3ace97 100644 --- a/etc/atalkd/aep.c +++ b/etc/atalkd/aep.c @@ -1,5 +1,5 @@ /* - * $Id: aep.c,v 1.8 2002-09-29 23:24:47 sibaz Exp $ + * $Id: aep.c,v 1.9 2009-10-13 22:55:37 didg Exp $ * * Copyright (c) 1990,1993 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. @@ -21,11 +21,11 @@ #include "atserv.h" -int aep_packet( ap, from, data, len ) - struct atport *ap; - struct sockaddr_at *from; - char *data; - int len; +int aep_packet( + struct atport *ap, + struct sockaddr_at *from, + char *data, + int len) { char *end; diff --git a/etc/atalkd/atserv.h b/etc/atalkd/atserv.h index 8a1368ff..9052ab31 100644 --- a/etc/atalkd/atserv.h +++ b/etc/atalkd/atserv.h @@ -1,21 +1,24 @@ /* - * $Id: atserv.h,v 1.3 2005-04-28 20:49:46 bfernhomberg Exp $ + * $Id: atserv.h,v 1.4 2009-10-13 22:55:37 didg Exp $ * * Copyright (c) 1990,1992 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. */ - -struct atserv { - char *as_name; - u_char as_port; /* Used as a fall back */ - int (*as_packet)(); -}; +#ifndef ATALKD_ATSERV_H +#define ATALKD_ATSERV_H 1 struct atport { int ap_fd; struct atport *ap_next; struct interface *ap_iface; u_char ap_port; - int (*ap_packet)(); + int (*ap_packet)(struct atport *ap, struct sockaddr_at *from, char *data, int len); +}; + +struct atserv { + char *as_name; + u_char as_port; /* Used as a fall back */ + int (*as_packet)(struct atport *ap, struct sockaddr_at *from, char *data, int len); }; +#endif diff --git a/etc/atalkd/config.c b/etc/atalkd/config.c index 700e08f9..b456cc4e 100644 --- a/etc/atalkd/config.c +++ b/etc/atalkd/config.c @@ -1,5 +1,5 @@ /* - * $Id: config.c,v 1.16 2008-12-02 18:18:06 morgana Exp $ + * $Id: config.c,v 1.17 2009-10-13 22:55:37 didg Exp $ * * Copyright (c) 1990,1993 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. @@ -67,11 +67,18 @@ char *strchr (), *strrchr (); #define IFF_SLAVE 0 #endif /* IFF_SLAVE */ -int router(), dontroute(), seed(), phase(), net(), addr(), zone(), noallmulti(); +int router(struct interface *iface, char **av); +int dontroute(struct interface *iface, char **av); +int seed(struct interface *iface, char **av); +int phase(struct interface *iface, char **av); +int net(struct interface *iface, char **av); +int addr(struct interface *iface, char **av); +int zone(struct interface *iface, char **av); +int noallmulti(struct interface *iface, char **av); static const struct param { char *p_name; - int (*p_func)(); + int (*p_func)(struct interface *iface, char **av); } params[] = { { "router", router }, { "dontroute", dontroute }, @@ -178,8 +185,7 @@ void freeline( char **argv ) } } -int writeconf( cf ) - char *cf; +int writeconf(char *cf) { struct stat st; char *path, *p, newpath[ MAXPATHLEN ], line[ MAXLINELEN ]; @@ -321,8 +327,7 @@ int writeconf( cf ) * zone for an interface is the first zone encountered for that * interface. */ -int readconf( cf ) - char *cf; +int readconf(char *cf) { struct ifreq ifr; struct interface *iface, *niface; @@ -474,9 +479,7 @@ read_conf_err: return -1; } -int noallmulti( iface, av ) - struct interface *iface; - char **av _U_; +int noallmulti( struct interface *iface, char **av _U_) { /* Linux specific, no effect on other platforms */ iface->i_flags &= !IFACE_ALLMULTI; @@ -485,9 +488,7 @@ int noallmulti( iface, av ) } /*ARGSUSED*/ -int router( iface, av ) - struct interface *iface; - char **av _U_; +int router(struct interface *iface, char **av _U_) { /* make sure "-router" and "-dontroute" aren't both on the same line. */ if (iface->i_flags & IFACE_DONTROUTE) { @@ -509,9 +510,7 @@ int router( iface, av ) } /*ARGSUSED*/ -int dontroute( iface, av ) - struct interface *iface; - char **av _U_; +int dontroute(struct interface *iface, char **av _U_) { /* make sure "-router" and "-dontroute" aren't both on the same line. */ if (iface->i_flags & IFACE_RSEED) { @@ -524,9 +523,7 @@ int dontroute( iface, av ) } /*ARGSUSED*/ -int seed( iface, av ) - struct interface *iface; - char **av _U_; +int seed( struct interface *iface, char **av _U_) { /* * Check to be sure "-seed" is before "-zone". we keep the old @@ -542,9 +539,7 @@ int seed( iface, av ) return( 1 ); } -int phase( iface, av ) - struct interface *iface; - char **av; +int phase(struct interface *iface, char **av) { int n; char *pnum; @@ -570,9 +565,7 @@ int phase( iface, av ) return( 2 ); } -int net( iface, av ) - struct interface *iface; - char **av; +int net(struct interface *iface, char **av) { char *nrange; char *stop; @@ -640,9 +633,7 @@ int net( iface, av ) return( 2 ); } -int addr( iface, av ) - struct interface *iface; - char **av; +int addr(struct interface *iface, char **av) { if ( av[ 0 ] == NULL ) { fprintf( stderr, "No address.\n" ); @@ -676,9 +667,7 @@ int addr( iface, av ) return( 2 ); } -int zone( iface, av ) - struct interface *iface; - char **av; +int zone(struct interface *iface, char **av) { struct ziptab *zt; char *zname; @@ -724,7 +713,7 @@ int zone( iface, av ) * Get the configuration from the kernel. Only called if there's no * configuration. */ -int getifconf() +int getifconf(void) { struct interface *iface, *niface; struct ifreq ifr; @@ -804,8 +793,7 @@ int getifconf() * the interface structure and have it updated nicely. */ -struct interface *newiface( name ) - const char *name; +struct interface *newiface( const char *name) { struct interface *niface; @@ -829,7 +817,7 @@ struct interface *newiface( name ) } #ifdef __svr4__ -int plumb() +int plumb(void) { struct interface *iface; char device[ MAXPATHLEN + 1], *p, *t; diff --git a/etc/atalkd/interface.h b/etc/atalkd/interface.h index 4fdd1b5f..64888af2 100644 --- a/etc/atalkd/interface.h +++ b/etc/atalkd/interface.h @@ -1,5 +1,5 @@ /* - * $Id: interface.h,v 1.4 2005-04-28 20:49:46 bfernhomberg Exp $ + * $Id: interface.h,v 1.5 2009-10-13 22:55:37 didg Exp $ * Copyright (c) 1990,1992 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. */ @@ -53,6 +53,6 @@ struct interface { extern struct interface *interfaces; extern struct interface *ciface; -struct interface *newiface __P((const char *)); +struct interface *newiface (const char *); #endif /* ATALKD_INTERFACE_H */ diff --git a/etc/atalkd/main.c b/etc/atalkd/main.c index c9ab87f2..7f437e29 100644 --- a/etc/atalkd/main.c +++ b/etc/atalkd/main.c @@ -1,5 +1,5 @@ /* - * $Id: main.c,v 1.19 2009-01-16 18:21:16 morgana Exp $ + * $Id: main.c,v 1.20 2009-10-13 22:55:37 didg Exp $ * * Copyright (c) 1990,1993 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. @@ -55,6 +55,7 @@ #include #include #include +#include #include #include #include @@ -70,6 +71,7 @@ #include "list.h" #include "rtmp.h" #include "zip.h" +#include "nbp.h" #include "atserv.h" #include "main.h" @@ -97,10 +99,7 @@ int ifconfig(const char *iname, unsigned long cmd, struct sockaddr_at *sa); #define PKTSZ 1024 -extern int rtmp_packet(); -extern int nbp_packet(); -extern int aep_packet(); -extern int zip_packet(); +extern int aep_packet(struct atport *ap, struct sockaddr_at *from, char *data, int len); int rtfd; @@ -713,10 +712,8 @@ consistency() } #endif /* DEBUG */ -#if !defined( ibm032 ) && !defined( _IBMR2 ) - void -#endif /* ! ibm032 && ! _IBMR2 */ -as_debug() +void +as_debug(int sig _U_) { struct interface *iface; struct list *l; @@ -817,10 +814,8 @@ as_debug() /* * Called when SIGTERM is recieved. Remove all routes and then exit. */ -#if !defined( ibm032 ) && !defined( _IBMR2 ) - void -#endif /* ! ibm032 && ! _IBMR2 */ -as_down() +void +as_down(int sig _U_) { struct interface *iface; struct gate *gate; @@ -853,9 +848,7 @@ as_down() atalkd_exit( 0 ); } -int main( ac, av ) - int ac; - char **av; +int main( int ac, char **av) { extern char *optarg; extern int optind; @@ -1233,8 +1226,7 @@ int main( ac, av ) * and rtmp_packet()) to set the initial "bootstrapping" address * on an interface. */ -void bootaddr( iface ) - struct interface *iface; +void bootaddr(struct interface *iface) { if ( iface == 0 ) { return; @@ -1406,9 +1398,7 @@ smaller net range.", iface->i_name, ntohs(first), ntohs(last), strerror(errno)); nfds++; } -int ifsetallmulti ( iname, set ) -const char *iname; -int set; +int ifsetallmulti (const char *iname, int set) { int sock; struct ifreq ifr; @@ -1443,10 +1433,7 @@ int set; return (0); } -int ifconfig( iname, cmd, sa ) - const char *iname; - unsigned long cmd; - struct sockaddr_at *sa; +int ifconfig( const char *iname, unsigned long cmd, struct sockaddr_at *sa) { struct ifreq ifr; int s; @@ -1469,8 +1456,7 @@ int ifconfig( iname, cmd, sa ) return( 0 ); } -void dumpconfig( iface ) - struct interface *iface; +void dumpconfig( struct interface *iface) { struct list *l; @@ -1506,7 +1492,7 @@ void dumpconfig( iface ) } #ifdef DEBUG -void dumproutes() +void dumproutes(void) { struct interface *iface; struct rtmptab *rtmp; @@ -1554,7 +1540,7 @@ void dumproutes() fflush( stdout ); } -void dumpzones() +void dumpzones(void) { struct interface *iface; struct rtmptab *rtmp; diff --git a/etc/atalkd/main.h b/etc/atalkd/main.h index 196a6415..cc028b68 100644 --- a/etc/atalkd/main.h +++ b/etc/atalkd/main.h @@ -1,5 +1,5 @@ /* - * $Id: main.h,v 1.4 2005-04-28 20:49:46 bfernhomberg Exp $ + * $Id: main.h,v 1.5 2009-10-13 22:55:37 didg Exp $ */ #ifndef ATALKD_MAIN_H @@ -8,14 +8,14 @@ #include #include "config.h" -int ifconfig __P(( const char *, unsigned long, struct sockaddr_at * )); -void setaddr __P(( struct interface *, u_int8_t, u_int16_t, - u_int8_t, u_int16_t, u_int16_t )); -void bootaddr __P(( struct interface * )); -void dumpconfig __P(( struct interface * )); +int ifconfig ( const char *, unsigned long, struct sockaddr_at * ); +void setaddr ( struct interface *, u_int8_t, u_int16_t, + u_int8_t, u_int16_t, u_int16_t ); +void bootaddr ( struct interface * ); +void dumpconfig ( struct interface * ); #ifdef linux -int ifsetallmulti __P(( const char *, int)); +int ifsetallmulti ( const char *, int); #endif #endif /* ATALKD_MAIN_H */ diff --git a/etc/atalkd/multicast.c b/etc/atalkd/multicast.c index 82769547..e95acce1 100644 --- a/etc/atalkd/multicast.c +++ b/etc/atalkd/multicast.c @@ -1,5 +1,5 @@ /* - * $Id: multicast.c,v 1.11 2003-03-18 23:34:51 srittau Exp $ + * $Id: multicast.c,v 1.12 2009-10-13 22:55:37 didg Exp $ * * Copyright (c) 1990,1993 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. @@ -330,9 +330,7 @@ int addmulti(const char *name, const unsigned char *data) } static u_int16_t -atalk_cksum( data, len ) - u_char *data; - int len; +atalk_cksum( u_char *data, int len) { u_char *end; u_int32_t cksum = 0; @@ -359,8 +357,7 @@ atalk_cksum( data, len ) * alike.) */ int -zone_bcast( zt ) - struct ziptab *zt; +zone_bcast( struct ziptab *zt) { u_char uname[ 32 ]; u_int16_t cksum; diff --git a/etc/atalkd/multicast.h b/etc/atalkd/multicast.h index 5b8ff51f..d8ef3347 100644 --- a/etc/atalkd/multicast.h +++ b/etc/atalkd/multicast.h @@ -1,5 +1,5 @@ /* - * $Id: multicast.h,v 1.3 2003-03-18 23:34:51 srittau Exp $ + * $Id: multicast.h,v 1.4 2009-10-13 22:55:37 didg Exp $ * * Copyright (c) 1990,1997 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. @@ -14,7 +14,7 @@ extern unsigned char ethermultitab[ 253 ][ 6 ]; extern unsigned char ethermulti[ 6 ]; -int addmulti __P((const char *, const unsigned char *)); -int zone_bcast __P((struct ziptab *)); +int addmulti (const char *, const unsigned char *); +int zone_bcast (struct ziptab *); #endif /* atalkd/multicast.h */ diff --git a/etc/atalkd/nbp.c b/etc/atalkd/nbp.c index a01521f7..77194381 100644 --- a/etc/atalkd/nbp.c +++ b/etc/atalkd/nbp.c @@ -1,5 +1,5 @@ /* - * $Id: nbp.c,v 1.11 2005-04-28 20:49:46 bfernhomberg Exp $ + * $Id: nbp.c,v 1.12 2009-10-13 22:55:37 didg Exp $ * * Copyright (c) 1990,1993 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. @@ -46,11 +46,7 @@ extern int transition; struct nbptab *nbptab = NULL; static -void nbp_ack( fd, nh_op, nh_id, to ) - int fd; - int nh_op; - int nh_id; - struct sockaddr_at *to; +void nbp_ack( int fd, int nh_op, int nh_id, struct sockaddr_at *to) { struct nbphdr nh; char *data, packet[ SZ_NBPHDR + 1 ]; @@ -68,11 +64,7 @@ void nbp_ack( fd, nh_op, nh_id, to ) } } -int nbp_packet( ap, from, data, len ) - struct atport *ap; - struct sockaddr_at *from; - char *data; - int len; +int nbp_packet(struct atport *ap, struct sockaddr_at *from, char *data, int len) { struct nbphdr nh; struct nbptuple nt; diff --git a/etc/atalkd/nbp.h b/etc/atalkd/nbp.h index 851146fa..13f511d2 100644 --- a/etc/atalkd/nbp.h +++ b/etc/atalkd/nbp.h @@ -1,10 +1,13 @@ /* - * $Id: nbp.h,v 1.2 2001-06-25 20:13:45 rufustfirefly Exp $ + * $Id: nbp.h,v 1.3 2009-10-13 22:55:37 didg Exp $ * * Copyright (c) 1990,1993 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. */ +#ifndef ATALKD_NBP_H +#define ATALKD_NBP_H 1 + struct nbptab { struct nbptab *nt_prev, *nt_next; struct nbpnve nt_nve; @@ -12,3 +15,7 @@ struct nbptab { }; extern struct nbptab *nbptab; + +int nbp_packet(struct atport *ap, struct sockaddr_at *from, char *data, int len); + +#endif diff --git a/etc/atalkd/route.c b/etc/atalkd/route.c index 215be509..4e7dfac3 100644 --- a/etc/atalkd/route.c +++ b/etc/atalkd/route.c @@ -1,5 +1,5 @@ /* - * $Id: route.c,v 1.7 2005-04-28 20:49:46 bfernhomberg Exp $ + * $Id: route.c,v 1.8 2009-10-13 22:55:37 didg Exp $ * * Copyright (c) 1990,1996 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. @@ -24,10 +24,7 @@ #include "route.h" #ifndef BSD4_4 -int route( message, dst, gate, flags ) - int message; - struct sockaddr *dst, *gate; - int flags; +int route( int message, struct sockaddr *dst, struct sockaddr *gate, int flags) { #ifdef TRU64 struct ortentry rtent; @@ -59,10 +56,7 @@ struct rt_msg_at { struct sockaddr_m rtma_mask; } rtma; -route( message, dst, gate, flags ) - int message; - struct sockaddr_at *dst, *gate; - int flags; +route( int message, struct sockaddr_at *dst, struct sockaddr_at *gate, int flags) { int rc; diff --git a/etc/atalkd/route.h b/etc/atalkd/route.h index 15698c48..5f3c0f90 100644 --- a/etc/atalkd/route.h +++ b/etc/atalkd/route.h @@ -1,5 +1,5 @@ /* - * $Id: route.h,v 1.2 2001-06-19 18:04:39 rufustfirefly Exp $ + * $Id: route.h,v 1.3 2009-10-13 22:55:37 didg Exp $ */ #ifndef ATALKD_ROUTE_H @@ -8,9 +8,9 @@ #include #ifndef BSD4_4 -int route __P(( int, struct sockaddr *, struct sockaddr *, int )); +int route ( int, struct sockaddr *, struct sockaddr *, int ); #else /* BSD4_4 */ -int route __P(( int, struct sockaddr_at *, struct sockaddr_at *, int)); +int route ( int, struct sockaddr_at *, struct sockaddr_at *, int); #endif /* BSD4_4 */ #endif /* ATALKD_ROUTE_H */ diff --git a/etc/atalkd/rtmp.c b/etc/atalkd/rtmp.c index 5af4d1a8..dc615754 100644 --- a/etc/atalkd/rtmp.c +++ b/etc/atalkd/rtmp.c @@ -1,5 +1,5 @@ /* - * $Id: rtmp.c,v 1.14 2008-11-14 10:29:08 didg Exp $ + * $Id: rtmp.c,v 1.15 2009-10-13 22:55:37 didg Exp $ * * Copyright (c) 1990,1993 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. @@ -43,8 +43,7 @@ #include "route.h" #include "main.h" -void rtmp_delzonemap(rtmp) - struct rtmptab *rtmp; +void rtmp_delzonemap(struct rtmptab *rtmp) { struct list *lz, *flz, *lr, *flr; struct ziptab *zt; @@ -97,9 +96,7 @@ void rtmp_delzonemap(rtmp) /* * Complete configuration for phase 1 interface using RTMP information. */ -static int rtmp_config( rh, iface ) - struct rtmp_head *rh; - struct interface *iface; +static int rtmp_config( struct rtmp_head *rh, struct interface *iface) { extern int stabletimer; int cc; @@ -162,8 +159,7 @@ static int rtmp_config( rh, iface ) * Delete rtmp from the per-interface in-use table, remove all * zone references, and remove the route from the kernel. */ -static void rtmp_delinuse( rtmp ) - struct rtmptab *rtmp; +static void rtmp_delinuse(struct rtmptab *rtmp) { struct rtmptab *irt; @@ -197,8 +193,7 @@ static void rtmp_delinuse( rtmp ) /* * Add rtmp to the per-interface in-use table. No verification is done... */ -static void rtmp_addinuse( rtmp ) - struct rtmptab *rtmp; +static void rtmp_addinuse( struct rtmptab *rtmp) { struct rtmptab *irt; @@ -225,8 +220,7 @@ static void rtmp_addinuse( rtmp ) * at this point? What do we do if we get several copies of a route in * an RTMP packet? */ -static int rtmp_copyzones( to, from ) - struct rtmptab *to, *from; +static int rtmp_copyzones( struct rtmptab *to,struct rtmptab *from) { struct list *lz, *lr; @@ -256,8 +250,7 @@ static int rtmp_copyzones( to, from ) * Remove rtmp from the in-use table and the per-gate table. * Free any associated space. */ -void rtmp_free( rtmp ) - struct rtmptab *rtmp; +void rtmp_free( struct rtmptab *rtmp) { struct gate *gate; @@ -294,8 +287,7 @@ void rtmp_free( rtmp ) * Find a replacement for "replace". If we can't find a replacement, * return 1. If we do find a replacement, return 0. -1 on error. */ -int rtmp_replace( replace ) - struct rtmptab *replace; +int rtmp_replace(struct rtmptab *replace) { struct interface *iface; struct gate *gate; @@ -339,8 +331,7 @@ int rtmp_replace( replace ) } -static int rtmp_new( rtmp ) - struct rtmptab *rtmp; +static int rtmp_new(struct rtmptab *rtmp) { struct interface *i; struct rtmptab *r; @@ -403,11 +394,7 @@ static int rtmp_new( rtmp ) } -int rtmp_packet( ap, from, data, len ) - struct atport *ap; - struct sockaddr_at *from; - char *data; - int len; +int rtmp_packet(struct atport *ap, struct sockaddr_at *from, char *data, int len) { struct rtmp_head rh; struct rtmp_tuple rt, xrt; @@ -814,8 +801,7 @@ int rtmp_packet( ap, from, data, len ) return 0; } -int rtmp_request( iface ) - struct interface *iface; +int rtmp_request( struct interface *iface) { struct sockaddr_at sat; struct atport *ap; @@ -857,9 +843,7 @@ int rtmp_request( iface ) } -int looproute( iface, cmd ) - struct interface *iface; - unsigned int cmd; +int looproute(struct interface *iface, unsigned int cmd) { struct sockaddr_at dst, loop; @@ -912,9 +896,7 @@ int looproute( iface, cmd ) return( 0 ); } -int gateroute( command, rtmp ) - unsigned int command; - struct rtmptab *rtmp; +int gateroute(unsigned int command, struct rtmptab *rtmp) { struct sockaddr_at dst, gate; unsigned short net; diff --git a/etc/atalkd/rtmp.h b/etc/atalkd/rtmp.h index 39093bb2..99e15db3 100644 --- a/etc/atalkd/rtmp.h +++ b/etc/atalkd/rtmp.h @@ -1,5 +1,5 @@ /* - * $Id: rtmp.h,v 1.4 2001-08-03 22:12:54 srittau Exp $ + * $Id: rtmp.h,v 1.5 2009-10-13 22:55:37 didg Exp $ * Copyright (c) 1990,1993 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. * @@ -78,13 +78,17 @@ struct rtmp_tuple { #define STARTUP_LASTNET 0xfffe extern int rtfd; -struct rtmptab *newrt __P((const struct interface *)); -void rtmp_delzonemap __P((struct rtmptab *)); +struct rtmptab *newrt (const struct interface *); +void rtmp_delzonemap (struct rtmptab *); -int rtmp_request __P(( struct interface * )); -void rtmp_free __P(( struct rtmptab * )); -int rtmp_replace __P(( struct rtmptab * )); -int looproute __P(( struct interface *, unsigned int )); -int gateroute __P(( unsigned int, struct rtmptab * )); +int rtmp_request ( struct interface * ); +void rtmp_free ( struct rtmptab * ); +int rtmp_replace ( struct rtmptab * ); +int looproute ( struct interface *, unsigned int ); +int gateroute ( unsigned int, struct rtmptab * ); + +struct atport; + +int rtmp_packet(struct atport *ap, struct sockaddr_at *from, char *data, int len); #endif /* atalkd/rtmp.h */ diff --git a/etc/atalkd/zip.c b/etc/atalkd/zip.c index 5efd1c58..ea73c99e 100644 --- a/etc/atalkd/zip.c +++ b/etc/atalkd/zip.c @@ -1,5 +1,5 @@ /* - * $Id: zip.c,v 1.12 2005-04-28 20:49:47 bfernhomberg Exp $ + * $Id: zip.c,v 1.13 2009-10-13 22:55:37 didg Exp $ * * Copyright (c) 1990,1993 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. @@ -48,9 +48,7 @@ struct ziptab *ziptab = NULL, *ziplast = NULL; -static int zonecheck( rtmp, iface ) - struct rtmptab *rtmp; - struct interface *iface; +static int zonecheck(struct rtmptab *rtmp, struct interface *iface) { struct list *l; struct ziptab *czt, *zt; @@ -88,11 +86,7 @@ static int zonecheck( rtmp, iface ) } -int zip_packet( ap, from, data, len ) - struct atport *ap; - struct sockaddr_at *from; - char *data; - int len; +int zip_packet(struct atport *ap,struct sockaddr_at *from, char *data, int len) { struct ziphdr zh; struct atphdr ah; @@ -898,8 +892,7 @@ int zip_packet( ap, from, data, len ) return 0; } -int zip_getnetinfo( iface ) - struct interface *iface; +int zip_getnetinfo(struct interface *iface) { struct atport *ap; struct ziphdr zh; @@ -955,10 +948,7 @@ int zip_getnetinfo( iface ) return 0; } - struct ziptab * -newzt( len, name ) - const int len; - const char *name; +struct ziptab *newzt(const int len, const char *name) { struct ziptab *zt; @@ -981,9 +971,7 @@ newzt( len, name ) * Insert at the end. Return 1 if a mapping already exists, 0 otherwise. * -1 on error. */ -static int add_list( head, data ) - struct list **head; - void *data; +static int add_list(struct list **head, void *data) { struct list *l, *l2; @@ -1012,10 +1000,7 @@ static int add_list( head, data ) return( 0 ); } -int addzone( rt, len, zone ) - struct rtmptab *rt; - int len; - char *zone; +int addzone(struct rtmptab *rt, int len, char *zone) { struct ziptab *zt; int cc, exists = 0; diff --git a/etc/atalkd/zip.h b/etc/atalkd/zip.h index dad0a5cc..e8bf1db3 100644 --- a/etc/atalkd/zip.h +++ b/etc/atalkd/zip.h @@ -1,5 +1,5 @@ /* - * $Id: zip.h,v 1.3 2001-06-25 20:13:45 rufustfirefly Exp $ + * $Id: zip.h,v 1.4 2009-10-13 22:55:37 didg Exp $ * * Copyright (c) 1990,1993 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. @@ -20,9 +20,10 @@ struct ziptab { }; extern struct ziptab *ziptab, *ziplast; -struct ziptab *newzt __P((const int, const char *)); +struct ziptab *newzt (const int, const char *); -int addzone __P(( struct rtmptab *, int, char * )); -int zip_getnetinfo __P(( struct interface * )); +int addzone ( struct rtmptab *, int, char * ); +int zip_getnetinfo ( struct interface * ); +int zip_packet(struct atport *ap,struct sockaddr_at *from, char *data, int len); #endif /* atalkd/zip.h */ diff --git a/etc/cnid_dbd/cmd_dbd.c b/etc/cnid_dbd/cmd_dbd.c index f4f23fb7..33b0b72f 100644 --- a/etc/cnid_dbd/cmd_dbd.c +++ b/etc/cnid_dbd/cmd_dbd.c @@ -1,5 +1,5 @@ /* - $Id: cmd_dbd.c,v 1.11 2009-10-12 13:18:11 franklahm Exp $ + $Id: cmd_dbd.c,v 1.12 2009-10-13 22:55:37 didg Exp $ Copyright (c) 2009 Frank Lahm @@ -227,7 +227,7 @@ void free_lock(int lockfd) close(lockfd); } -static void usage () +static void usage (void) { printf("Usage: dbd [-e|-v|-x] -d [-i] | -s [-n]| -r [-f] | -u \n" "dbd can dump, scan, reindex and rebuild Netatalk dbd CNID databases.\n" diff --git a/etc/cnid_dbd/cnid_metad.c b/etc/cnid_dbd/cnid_metad.c index fec81faa..ecc5045d 100644 --- a/etc/cnid_dbd/cnid_metad.c +++ b/etc/cnid_dbd/cnid_metad.c @@ -1,5 +1,5 @@ /* - * $Id: cnid_metad.c,v 1.14 2009-09-14 00:02:21 didg Exp $ + * $Id: cnid_metad.c,v 1.15 2009-10-13 22:55:37 didg Exp $ * * Copyright (C) Joerg Lenneis 2003 * All Rights Reserved. See COPYING. @@ -343,8 +343,7 @@ static int set_dbdir(char *dbdir, int len) } /* ------------------ */ -uid_t user_to_uid ( username ) - char *username; +uid_t user_to_uid (char *username) { struct passwd *this_passwd; @@ -363,8 +362,7 @@ uid_t user_to_uid ( username ) } /* ------------------ */ -gid_t group_to_gid ( group ) - char *group; +gid_t group_to_gid ( char *group) { struct group *this_group; diff --git a/etc/cnid_dbd/comm.c b/etc/cnid_dbd/comm.c index 853e0e9f..9b3ffad5 100644 --- a/etc/cnid_dbd/comm.c +++ b/etc/cnid_dbd/comm.c @@ -1,5 +1,5 @@ /* - * $Id: comm.c,v 1.3 2009-04-21 08:55:44 franklahm Exp $ + * $Id: comm.c,v 1.4 2009-10-13 22:55:37 didg Exp $ * * Copyright (C) Joerg Lenneis 2003 * All Rights Reserved. See COPYING. @@ -141,7 +141,7 @@ static int recv_cred(int fd) * things and clean up fd_table. The same happens for any read/write errors. */ -static int check_fd() +static int check_fd(void) { int fd; fd_set readfds; diff --git a/etc/cnid_dbd/comm.h b/etc/cnid_dbd/comm.h index beda7705..f604e227 100644 --- a/etc/cnid_dbd/comm.h +++ b/etc/cnid_dbd/comm.h @@ -1,5 +1,5 @@ /* - * $Id: comm.h,v 1.2 2005-04-28 20:49:47 bfernhomberg Exp $ + * $Id: comm.h,v 1.3 2009-10-13 22:55:37 didg Exp $ * * Copyright (C) Joerg Lenneis 2003 * All Rights Reserved. See COPYING. @@ -12,10 +12,10 @@ #include -extern int comm_init __P((struct db_param *, int, int)); -extern int comm_rcv __P((struct cnid_dbd_rqst *)); -extern int comm_snd __P((struct cnid_dbd_rply *)); -extern int comm_nbe __P((void)); +extern int comm_init (struct db_param *, int, int); +extern int comm_rcv (struct cnid_dbd_rqst *); +extern int comm_snd (struct cnid_dbd_rply *); +extern int comm_nbe (void); #endif /* CNID_DBD_COMM_H */ diff --git a/etc/cnid_dbd/db_param.c b/etc/cnid_dbd/db_param.c index 07e79c20..0d23a32a 100644 --- a/etc/cnid_dbd/db_param.c +++ b/etc/cnid_dbd/db_param.c @@ -1,5 +1,5 @@ /* - * $Id: db_param.c,v 1.5 2009-05-06 11:54:24 franklahm Exp $ + * $Id: db_param.c,v 1.6 2009-10-13 22:55:37 didg Exp $ * * Copyright (C) Joerg Lenneis 2003 * Copyright (c) Frank Lahm 2009 @@ -39,7 +39,7 @@ static struct db_param params; static int parse_err; -static size_t usock_maxlen() +static size_t usock_maxlen(void) { struct sockaddr_un addr; return sizeof(addr.sun_path) - 1; diff --git a/etc/cnid_dbd/db_param.h b/etc/cnid_dbd/db_param.h index 18b13b5d..51d12ee9 100644 --- a/etc/cnid_dbd/db_param.h +++ b/etc/cnid_dbd/db_param.h @@ -1,5 +1,5 @@ /* - * $Id: db_param.h,v 1.4 2009-05-06 11:54:24 franklahm Exp $ + * $Id: db_param.h,v 1.5 2009-10-13 22:55:37 didg Exp $ * * Copyright (C) Joerg Lenneis 2003 * All Rights Reserved. See COPYING. @@ -28,7 +28,7 @@ struct db_param { int max_vols; }; -extern struct db_param * db_param_read __P((char *, enum identity)); +extern struct db_param * db_param_read (char *, enum identity); #endif /* CNID_DBD_DB_PARAM_H */ diff --git a/etc/cnid_dbd/dbif.c b/etc/cnid_dbd/dbif.c index b4e2b87f..b1b3599a 100644 --- a/etc/cnid_dbd/dbif.c +++ b/etc/cnid_dbd/dbif.c @@ -1,5 +1,5 @@ /* - * $Id: dbif.c,v 1.14 2009-09-14 03:12:11 didg Exp $ + * $Id: dbif.c,v 1.15 2009-10-13 22:55:37 didg Exp $ * * Copyright (C) Joerg Lenneis 2003 * Copyright (C) Frank Lahm 2009 @@ -32,7 +32,7 @@ static char *old_dbfiles[] = {"cnid.db", NULL}; /* --------------- */ -static int upgrade_required() +static int upgrade_required(void) { int i; int found = 0; diff --git a/etc/cnid_dbd/pack.c b/etc/cnid_dbd/pack.c index 039a79cd..1b4a15be 100644 --- a/etc/cnid_dbd/pack.c +++ b/etc/cnid_dbd/pack.c @@ -1,5 +1,5 @@ /* - * $Id: pack.c,v 1.5 2009-05-04 09:09:43 franklahm Exp $ + * $Id: pack.c,v 1.6 2009-10-13 22:55:37 didg Exp $ * * Copyright (C) Joerg Lenneis 2003 * All Rights Reserved. See COPYING. @@ -49,10 +49,7 @@ static void pack_devino(unsigned char *buf, dev_t dev, ino_t ino) } /* --------------- */ -int didname(dbp, pkey, pdata, skey) -DB *dbp _U_; -const DBT *pkey _U_, *pdata; -DBT *skey; +int didname(DB *dbp _U_, const DBT *pkey _U_, const DBT *pdata, DBT *skey) { int len; @@ -67,10 +64,7 @@ int len; } /* --------------- */ -int devino(dbp, pkey, pdata, skey) -DB *dbp _U_; -const DBT *pkey _U_, *pdata; -DBT *skey; +int devino(DB *dbp _U_, const DBT *pkey _U_, const DBT *pdata, DBT *skey) { memset(skey, 0, sizeof(DBT)); skey->data = (char *)pdata->data + CNID_DEVINO_OFS; diff --git a/etc/cnid_dbd/usockfd.h b/etc/cnid_dbd/usockfd.h index 12de3131..dd14aa96 100644 --- a/etc/cnid_dbd/usockfd.h +++ b/etc/cnid_dbd/usockfd.h @@ -1,5 +1,5 @@ /* - * $Id: usockfd.h,v 1.2 2005-04-28 20:49:49 bfernhomberg Exp $ + * $Id: usockfd.h,v 1.3 2009-10-13 22:55:37 didg Exp $ * * Copyright (C) Joerg Lenneis 2003 * All Rights Reserved. See COPYING. @@ -13,9 +13,9 @@ #include -extern int usockfd_create __P((char *, mode_t, int)); -extern int tsockfd_create __P((char *, u_int16_t, int)); -extern int usockfd_check __P((int, unsigned long)); +extern int usockfd_create (char *, mode_t, int); +extern int tsockfd_create (char *, u_int16_t, int); +extern int usockfd_check (int, unsigned long); #ifndef OSSH_ALIGNBYTES #define OSSH_ALIGNBYTES (sizeof(int) - 1) diff --git a/etc/papd/auth.c b/etc/papd/auth.c index 560f2b01..a8ba6fd6 100644 --- a/etc/papd/auth.c +++ b/etc/papd/auth.c @@ -1,5 +1,5 @@ /* - * $Id: auth.c,v 1.8 2009-02-02 16:04:33 didg Exp $ + * $Id: auth.c,v 1.9 2009-10-13 22:55:37 didg Exp $ * * Copyright (c) 1990,1993 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. @@ -126,7 +126,7 @@ int auth_load(const char *path, const char *list) } /* get rid of all of the uams */ -void auth_unload() +void auth_unload(void) { struct uam_mod *mod, *prev, *start = &uam_modules; diff --git a/etc/papd/comment.c b/etc/papd/comment.c index ee95058b..1a2964d6 100644 --- a/etc/papd/comment.c +++ b/etc/papd/comment.c @@ -1,5 +1,5 @@ /* - * $Id: comment.c,v 1.9 2008-11-14 10:29:08 didg Exp $ + * $Id: comment.c,v 1.10 2009-10-13 22:55:37 didg Exp $ * * Copyright (c) 1990,1994 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. @@ -31,8 +31,7 @@ void compop( void ) free( cs ); } -void compush( comment ) - struct papd_comment *comment; +void compush(struct papd_comment *comment) { struct comstate *cs; @@ -48,9 +47,7 @@ void compush( comment ) comstate = cs; } -int comswitch( comments, handler ) - struct papd_comment *comments; - int (*handler)(); +int comswitch(struct papd_comment *comments, int (*handler)()) { struct papd_comment *c, *comment = NULL; @@ -68,9 +65,7 @@ int comswitch( comments, handler ) return( 0 ); } -int comcmp( start, stop, str, how ) - char *start, *stop, *str; - int how; +int comcmp( char *start, char *stop, char *str,int how) { int cc, len; @@ -89,9 +84,7 @@ int comcmp( start, stop, str, how ) return( 1 ); } -struct papd_comment *commatch( start, stop, comments ) - char *start, *stop; - struct papd_comment comments[]; +struct papd_comment *commatch( char *start, char *stop, struct papd_comment comments[]) { struct papd_comment *comment; @@ -107,8 +100,7 @@ struct papd_comment *commatch( start, stop, comments ) } } -char *comtoken( start, stop, pos, delim ) - char *start, *stop, *pos, *delim; +char *comtoken( char *start, char *stop, char *pos, char *delim) { if ( pos < start || pos > stop ) { abort(); diff --git a/etc/papd/comment.h b/etc/papd/comment.h index 9a793498..1cac2d0d 100644 --- a/etc/papd/comment.h +++ b/etc/papd/comment.h @@ -1,5 +1,5 @@ /* - * $Id: comment.h,v 1.5 2001-06-25 20:13:45 rufustfirefly Exp $ + * $Id: comment.h,v 1.6 2009-10-13 22:55:37 didg Exp $ * * Copyright (c) 1990,1991 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. @@ -54,11 +54,11 @@ extern char *comcont; */ #define CM_NOPRINT (1<<16) /* or print */ -void compop __P(( void )); -void compush __P(( struct papd_comment * )); -int comswitch __P(( struct papd_comment *, int (*)() )); -int comcmp __P(( char *, char *, char *, int )); -struct papd_comment *commatch __P(( char *, char *, struct papd_comment * )); -char *comtoken __P(( char *, char *, char *, char * )); +void compop ( void ); +void compush ( struct papd_comment * ); +int comswitch ( struct papd_comment *, int (*)() ); +int comcmp ( char *, char *, char *, int ); +struct papd_comment *commatch ( char *, char *, struct papd_comment * ); +char *comtoken ( char *, char *, char *, char * ); #endif /* PAPD_COMMENT_H */ diff --git a/etc/papd/file.c b/etc/papd/file.c index aa9daea6..27a17c45 100644 --- a/etc/papd/file.c +++ b/etc/papd/file.c @@ -1,5 +1,5 @@ /* - * $Id: file.c,v 1.10 2009-02-02 10:31:32 didg Exp $ + * $Id: file.c,v 1.11 2009-10-13 22:55:37 didg Exp $ * * Copyright (c) 1990,1994 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. @@ -19,10 +19,7 @@ /* */ -int markline( pf, start, linelength, crlflength ) - char **start; - int *linelength, *crlflength; - struct papfile *pf; +int markline( struct papfile *pf, char **start, int *linelength, int *crlflength ) { char *p; @@ -66,10 +63,7 @@ int markline( pf, start, linelength, crlflength ) return( 1 ); } -void morespace( pf, data, len ) - struct papfile *pf; - const char *data; - int len; +void morespace(struct papfile *pf, const char *data, int len) { char *nbuf; int nsize; @@ -101,10 +95,7 @@ void morespace( pf, data, len ) } -void append(pf, data, len) - struct papfile *pf; - const char *data; - int len; +void append(struct papfile *pf, const char *data, int len) { if ((pf->pf_data + pf->pf_datalen + len) > (pf->pf_buf + pf->pf_bufsize)) { @@ -116,9 +107,7 @@ void append(pf, data, len) } -void spoolerror( out, str ) - struct papfile *out; - char *str; +void spoolerror(struct papfile *out, char *str) { char *pserr1 = "%%[ Error: "; char *pserr2 = " ]%%\n"; diff --git a/etc/papd/file.h b/etc/papd/file.h index a1e2c060..9f1f52d9 100644 --- a/etc/papd/file.h +++ b/etc/papd/file.h @@ -1,5 +1,5 @@ /* - * $Id: file.h,v 1.7 2005-04-28 20:49:49 bfernhomberg Exp $ + * $Id: file.h,v 1.8 2009-10-13 22:55:37 didg Exp $ * * Copyright (c) 1990,1991 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. @@ -36,9 +36,9 @@ struct papfile { #define PF_MORESPACE 1024 -int markline __P(( struct papfile *, char **, int *, int * )); -void morespace __P(( struct papfile *, const char *, int )); -void append __P(( struct papfile *, const char *, int )); -void spoolerror __P(( struct papfile *, char * )); +int markline ( struct papfile *, char **, int *, int * ); +void morespace ( struct papfile *, const char *, int ); +void append ( struct papfile *, const char *, int ); +void spoolerror ( struct papfile *, char * ); #endif /* PAPD_FILE_H */ diff --git a/etc/papd/headers.c b/etc/papd/headers.c index ef671ad9..68e7294c 100644 --- a/etc/papd/headers.c +++ b/etc/papd/headers.c @@ -1,5 +1,5 @@ /* - * $Id: headers.c,v 1.12 2009-02-02 10:31:32 didg Exp $ + * $Id: headers.c,v 1.13 2009-10-13 22:55:37 didg Exp $ * * Copyright (c) 1990,1994 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. @@ -80,8 +80,7 @@ static char *get_text(char *start, int linelength) return ret; } -int ch_for( in, out ) - struct papfile *in, *out _U_; +int ch_for( struct papfile *in, struct papfile *out _U_) { char *start, *cmt; int linelength, crlflength; @@ -112,8 +111,7 @@ int ch_for( in, out ) return( CH_DONE ); } -int ch_title( in, out ) - struct papfile *in, *out _U_; +int ch_title( struct papfile *in, struct papfile *out _U_) { char *start, *cmt; int linelength, crlflength; @@ -159,8 +157,7 @@ static int guess_creator ( char *creator ) } -int ch_creator( in, out ) - struct papfile *in, *out _U_; +int ch_creator( struct papfile *in, struct papfile *out _U_) { char *start, *cmt; int linelength, crlflength; @@ -192,8 +189,7 @@ int ch_creator( in, out ) return( CH_DONE ); } -int ch_endcomm( in, out ) - struct papfile *in, *out _U_; +int ch_endcomm( struct papfile *in, struct papfile *out _U_) { char *start; int linelength, crlflength; @@ -222,8 +218,7 @@ int ch_endcomm( in, out ) return ( CH_DONE); } -int ch_starttranslate(in,out) - struct papfile *in, *out _U_; +int ch_starttranslate( struct papfile *in, struct papfile *out _U_) { char *start; int linelength, crlflength; @@ -250,8 +245,7 @@ int ch_starttranslate(in,out) return ( CH_DONE); } -int ch_endtranslate(in,out) - struct papfile *in, *out _U_; +int ch_endtranslate(struct papfile *in, struct papfile *out _U_) { char *start; int linelength, crlflength; @@ -278,8 +272,7 @@ int ch_endtranslate(in,out) return ( CH_DONE); } -int ch_translateone(in,out) - struct papfile *in, *out _U_; +int ch_translateone( struct papfile *in, struct papfile *out _U_) { char *start; int linelength, crlflength; diff --git a/etc/papd/lp.c b/etc/papd/lp.c index 772250b2..dec0b53d 100644 --- a/etc/papd/lp.c +++ b/etc/papd/lp.c @@ -1,5 +1,5 @@ /* - * $Id: lp.c,v 1.27 2009-07-20 09:06:03 franklahm Exp $ + * $Id: lp.c,v 1.28 2009-10-13 22:55:37 didg Exp $ * * Copyright (c) 1990,1994 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. @@ -304,8 +304,7 @@ static char* pipexlate(char *src) } -void lp_person( person ) - char *person; +void lp_person(char *person) { if ( lp.lp_person != NULL ) { free( lp.lp_person ); @@ -318,7 +317,7 @@ void lp_person( person ) } #ifdef ABS_PRINT -int lp_pagecost() +int lp_pagecost(void) { char cost[ 22 ]; char balance[ 22 ]; @@ -335,8 +334,7 @@ int lp_pagecost() } #endif /* ABS_PRINT */ -void lp_host( host ) - char *host; +void lp_host( char *host) { if ( lp.lp_host != NULL ) { free( lp.lp_host ); @@ -354,8 +352,7 @@ void lp_host( host ) * This should be added. */ -void lp_job( job ) - char *job; +void lp_job(char *job) { if ( lp.lp_job != NULL ) { free( lp.lp_job ); @@ -368,8 +365,7 @@ void lp_job( job ) } -void lp_for ( lpfor ) - char *lpfor; +void lp_for (char *lpfor) { if ( lp.lp_created_for != NULL ) { free( lp.lp_created_for ); @@ -379,9 +375,7 @@ void lp_for ( lpfor ) } -static int lp_init( out, sat ) - struct papfile *out; - struct sockaddr_at *sat; +static int lp_init(struct papfile *out, struct sockaddr_at *sat) { int authenticated = 0; #ifndef HAVE_CUPS @@ -544,9 +538,7 @@ static int lp_init( out, sat ) return( 0 ); } -int lp_open( out, sat ) - struct papfile *out; - struct sockaddr_at *sat; +int lp_open(struct papfile *out, struct sockaddr_at *sat) { char name[ MAXPATHLEN ]; int fd; @@ -646,7 +638,7 @@ int lp_open( out, sat ) return( 0 ); } -int lp_close() +int lp_close(void) { if (( lp.lp_flags & LP_INIT ) == 0 || ( lp.lp_flags & LP_OPEN ) == 0 ) { return 0; @@ -660,10 +652,7 @@ int lp_close() -int lp_write(in, buf, len ) - struct papfile *in; - char *buf; - size_t len; +int lp_write(struct papfile *in, char *buf, size_t len) { #define BUFSIZE 32768 static char tempbuf[BUFSIZE]; @@ -746,7 +735,7 @@ int lp_write(in, buf, len ) return( 0 ); } -int lp_cancel() +int lp_cancel(void) { char name[ MAXPATHLEN ]; char letter; @@ -775,7 +764,7 @@ int lp_cancel() * * XXX piped? */ -int lp_print() +int lp_print(void) { #ifndef HAVE_CUPS char buf[ MAXPATHLEN ]; @@ -899,7 +888,7 @@ int lp_disconn_unix( int fd ) return( close( fd )); } -int lp_conn_unix() +int lp_conn_unix(void) { int s; struct sockaddr_un saun; @@ -926,7 +915,7 @@ int lp_disconn_inet( int fd ) return( close( fd )); } -int lp_conn_inet() +int lp_conn_inet(void) { int privfd, port = IPPORT_RESERVED - 1; struct sockaddr_in sin; @@ -970,8 +959,7 @@ int lp_conn_inet() return( privfd ); } -int lp_rmjob( job ) - int job; +int lp_rmjob( int job) { char buf[ 1024 ]; int n, s; @@ -1010,8 +998,7 @@ char *tag_files = "files: "; char *tag_size = "size: "; char *tag_status = "status: "; -int lp_queue( out ) - struct papfile *out; +int lp_queue( struct papfile *out) { char buf[ 1024 ], *start, *stop, *p, *q; int linelength, crlflength; diff --git a/etc/papd/lp.h b/etc/papd/lp.h index d4ab8423..6a3dd68d 100644 --- a/etc/papd/lp.h +++ b/etc/papd/lp.h @@ -1,5 +1,5 @@ /* - * $Id: lp.h,v 1.5 2009-02-01 18:55:37 didg Exp $ + * $Id: lp.h,v 1.6 2009-10-13 22:55:37 didg Exp $ */ #ifndef PAPD_LP_H @@ -9,24 +9,24 @@ #include #include "file.h" -void lp_person __P(( char * )); -int lp_pagecost __P(( void )); -void lp_host __P(( char * )); -void lp_job __P(( char * )); -void lp_for __P(( char * )); -void lp_origin __P(( int )); -int lp_rmjob __P(( int )); -int lp_queue __P(( struct papfile * )); +void lp_person ( char * ); +int lp_pagecost ( void ); +void lp_host ( char * ); +void lp_job ( char * ); +void lp_for ( char * ); +void lp_origin ( int ); +int lp_rmjob ( int ); +int lp_queue ( struct papfile * ); /* cancel current job */ -int lp_cancel __P(( void )); +int lp_cancel ( void ); /* print current job */ -int lp_print __P(( void )); +int lp_print ( void ); /* open a file for spooling */ -int lp_open __P(( struct papfile *, struct sockaddr_at * )); +int lp_open ( struct papfile *, struct sockaddr_at * ); /* open a buffer to the current open file */ -int lp_write __P(( struct papfile *,char *, size_t )); +int lp_write ( struct papfile *,char *, size_t ); /* close current spooling file */ -int lp_close __P(( void )); +int lp_close ( void ); #endif /* PAPD_LP_H */ diff --git a/etc/papd/magics.c b/etc/papd/magics.c index 29a61543..5e128e56 100644 --- a/etc/papd/magics.c +++ b/etc/papd/magics.c @@ -1,5 +1,5 @@ /* - * $Id: magics.c,v 1.14 2009-02-02 16:04:33 didg Exp $ + * $Id: magics.c,v 1.15 2009-10-13 22:55:37 didg Exp $ * * Copyright (c) 1990,1994 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. @@ -23,17 +23,14 @@ static int state=0; -static void parser_error(outfile) - struct papfile *outfile; +static void parser_error(struct papfile *outfile) { spoolerror( outfile, "Comments error, Ignoring job." ); outfile->pf_state |= PF_EOF; lp_close(); } -int ps( infile, outfile, sat ) - struct papfile *infile, *outfile; - struct sockaddr_at *sat; +int ps( struct papfile *infile, struct papfile *outfile, struct sockaddr_at *sat) { char *start; int linelength, crlflength; @@ -103,9 +100,7 @@ int ps( infile, outfile, sat ) } } -int cm_psquery( in, out, sat ) - struct papfile *in, *out; - struct sockaddr_at *sat _U_; +int cm_psquery( struct papfile *in, struct papfile *out, struct sockaddr_at *sat _U_) { struct papd_comment *comment; char *start; @@ -139,9 +134,7 @@ int cm_psquery( in, out, sat ) } } -int cm_psadobe( in, out, sat ) - struct papfile *in, *out; - struct sockaddr_at *sat _U_; +int cm_psadobe( struct papfile *in, struct papfile *out, struct sockaddr_at *sat _U_) { char *start; int linelength, crlflength; @@ -183,9 +176,7 @@ int cm_psadobe( in, out, sat ) char *Query = "Query"; -int cm_psswitch( in, out, sat ) - struct papfile *in, *out; - struct sockaddr_at *sat _U_; +int cm_psswitch(struct papfile *in, struct papfile *out, struct sockaddr_at *sat _U_) { char *start, *stop, *p; int linelength, crlflength; diff --git a/etc/papd/main.c b/etc/papd/main.c index 3ef3910c..6fac410f 100644 --- a/etc/papd/main.c +++ b/etc/papd/main.c @@ -1,5 +1,5 @@ /* - * $Id: main.c,v 1.26 2009-02-02 08:50:50 didg Exp $ + * $Id: main.c,v 1.27 2009-10-13 22:55:37 didg Exp $ * * Copyright (c) 1990,1995 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. @@ -104,11 +104,8 @@ static void papd_exit(const int i) exit(i); } -#if !defined( ibm032 ) && !defined( _IBMR2 ) - void -#endif /* ! ibm032 && ! _IBMR2 */ -die( n ) - int n; +void +die(int n) { struct printer *pr; struct at_addr addr; @@ -136,10 +133,8 @@ die( n ) papd_exit( n ); } -#if !defined( ibm032 ) && !defined( _IBMR2 ) - void -#endif /* ! ibm032 && ! _IBMR2 */ -reap() +void +reap(int sig _U_) { int status; int pid; @@ -166,9 +161,7 @@ reap() char rbuf[ 255 + 1 + 8 ]; -int main( ac, av ) - int ac; - char **av; +int main(int ac, char **av) { extern char *optarg; @@ -567,9 +560,7 @@ int main( ac, av ) * We assume buf is big enough for 255 bytes of data and a length byte. */ -int getstatus( pr, buf ) - struct printer *pr; - char *buf; +int getstatus(struct printer *pr, char *buf) { #ifdef HAVE_CUPS @@ -612,13 +603,12 @@ int getstatus( pr, buf ) #endif /* HAVE_CUPS */ } -char *pgetstr(); +char *pgetstr(char *id, char **area); char *getpname(char **area, int bufsize); #define PF_CONFBUFFER 1024 -static void getprinters( cf ) - char *cf; +static void getprinters( char *cf) { char buf[ PF_CONFBUFFER ], area[ PF_CONFBUFFER ], *a, *p, *name, *type, *zone; struct printer *pr; @@ -804,8 +794,7 @@ static void getprinters( cf ) } } -int rprintcap( pr ) - struct printer *pr; +int rprintcap( struct printer *pr) { #ifdef HAVE_CUPS diff --git a/etc/papd/ppd.c b/etc/papd/ppd.c index e80b4a77..63bf91b9 100644 --- a/etc/papd/ppd.c +++ b/etc/papd/ppd.c @@ -1,5 +1,5 @@ /* - * $Id: ppd.c,v 1.15 2009-02-02 10:24:28 didg Exp $ + * $Id: ppd.c,v 1.16 2009-10-13 22:55:37 didg Exp $ * * Copyright (c) 1995 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. @@ -53,7 +53,7 @@ struct ppdent { #ifndef SHOWPPD static int ppd_inited; -static void ppd_init() +static void ppd_init(void) { if (ppd_inited) return; @@ -68,10 +68,7 @@ static void ppd_init() /* quick and ugly hack to be able to read ppd files with Mac line ending */ -static char* my_fgets(buf, bufsize, stream) - char *buf; - size_t bufsize; - FILE *stream; +static char* my_fgets(char *buf, size_t bufsize, FILE *stream) { int p; /* uninitialized, OK 310105 */ size_t count = 0; @@ -94,8 +91,7 @@ static char* my_fgets(buf, bufsize, stream) return buf; } -static struct ppdent *getppdent( stream ) - FILE *stream; +static struct ppdent *getppdent( FILE *stream) { static char buf[ 1024 ]; static struct ppdent ppdent; @@ -179,9 +175,7 @@ static struct ppdent *getppdent( stream ) return( NULL ); } -int read_ppd( file, fcnt ) - char *file; - int fcnt; +int read_ppd(char *file, int fcnt) { FILE *ppdfile; struct ppdent *pe; @@ -255,8 +249,7 @@ int read_ppd( file, fcnt ) return( 0 ); } -struct ppd_font *ppd_font( font ) - char *font; +struct ppd_font *ppd_font( char *font) { struct ppd_font *pfo; @@ -274,9 +267,7 @@ struct ppd_font *ppd_font( font ) return( NULL ); } -struct ppd_feature *ppd_feature( feature, len ) - const char *feature; - int len; +struct ppd_feature *ppd_feature( const char *feature, int len) { struct ppd_feature *pfe; char ppd_feature_main[ 256 ]; diff --git a/etc/papd/ppd.h b/etc/papd/ppd.h index 12822977..ad989ddb 100644 --- a/etc/papd/ppd.h +++ b/etc/papd/ppd.h @@ -1,5 +1,5 @@ /* - * $Id: ppd.h,v 1.5 2009-01-21 04:04:20 didg Exp $ + * $Id: ppd.h,v 1.6 2009-10-13 22:55:37 didg Exp $ * * Copyright (c) 1995 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. @@ -20,8 +20,8 @@ struct ppd_feature { char *pd_value; }; -struct ppd_feature *ppd_feature __P((const char *, int)); -struct ppd_font *ppd_font __P((char *)); -int read_ppd __P((char *, int)); +struct ppd_feature *ppd_feature (const char *, int); +struct ppd_font *ppd_font (char *); +int read_ppd (char *, int); #endif /* PAPD_PPD_H */ diff --git a/etc/papd/print_cups.c b/etc/papd/print_cups.c index 86f56af7..1cad95a7 100644 --- a/etc/papd/print_cups.c +++ b/etc/papd/print_cups.c @@ -1,5 +1,5 @@ /* - * $Id: print_cups.c,v 1.3 2008-11-14 10:29:08 didg Exp $ + * $Id: print_cups.c,v 1.4 2009-10-13 22:55:37 didg Exp $ * * Copyright 2004 Bjoern Fernhomberg. * @@ -66,7 +66,7 @@ static int cups_mangle_printer_name ( struct printer *pr, struct printer *print static void cups_free_printer ( struct printer *pr); -char * cups_get_language () +char * cups_get_language (void) { cups_lang_t *language; diff --git a/etc/papd/print_cups.h b/etc/papd/print_cups.h index 2811a845..10a9ca70 100644 --- a/etc/papd/print_cups.h +++ b/etc/papd/print_cups.h @@ -10,12 +10,12 @@ struct cups_status { char * status_message; }; -int cups_printername_ok __P((char * )); -const char * cups_get_printer_ppd __P(( char * )); -int cups_get_printer_status __P((struct printer *pr)); -int cups_print_job __P(( char *, char *, char *, char *, char *)); -struct printer * cups_autoadd_printers __P(( struct printer *, struct printer *)); -int cups_check_printer __P(( struct printer *, struct printer *, int)); -char *cups_get_language __P(()); +int cups_printername_ok (char * ); +const char * cups_get_printer_ppd ( char * ); +int cups_get_printer_status (struct printer *pr); +int cups_print_job ( char *, char *, char *, char *, char *); +struct printer * cups_autoadd_printers ( struct printer *, struct printer *); +int cups_check_printer ( struct printer *, struct printer *, int); +char *cups_get_language ( void ); #endif /* HAVE_CUPS */ #endif /* PAPD_CUPS_H */ diff --git a/etc/papd/printcap.c b/etc/papd/printcap.c index 19ed7883..67304d81 100644 --- a/etc/papd/printcap.c +++ b/etc/papd/printcap.c @@ -1,5 +1,5 @@ /* - * $Id: printcap.c,v 1.10 2005-04-28 20:49:49 bfernhomberg Exp $ + * $Id: printcap.c,v 1.11 2009-10-13 22:55:37 didg Exp $ * * Copyright (c) 1990,1994 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. @@ -43,6 +43,8 @@ #include #include #include +#include + #ifdef HAVE_UNISTD_H #include #endif /* HAVE_UNISTD_H */ @@ -92,10 +94,6 @@ static FILE *pfp = NULL; /* printcap data base file pointer */ static char *tbuf; static int hopcount; /* detect infinite loops in termcap, init 0 */ -static char *tskip(); -char *tgetstr(); -static char *tdecode(); -char *getenv(); /* * Similar to tgetent except it returns the next entry instead of @@ -104,10 +102,7 @@ char *getenv(); * Added a "cap" parameter, so we can use these calls for printcap * and papd.conf. */ -int getprent( cap, bp, bufsize ) - register char *cap; - register char *bp; - register int bufsize; +int getprent( char *cap, char *bp, int bufsize) { register int c, skip = 0, i; @@ -159,7 +154,7 @@ int getprent( cap, bp, bufsize ) } } -void endprent() +void endprent(void) { if (pfp != NULL) fclose(pfp); @@ -173,8 +168,7 @@ void endprent() * Added a "cap" parameter, so we can use these calls for printcap * and papd.conf. */ -int tgetent( cap, bp, name) - char *cap, *bp, *name; +int tgetent(char *cap, char *bp, char *name) { register char *cp; register int c; @@ -270,8 +264,7 @@ int tgetent( cap, bp, name) * Added a "cap" parameter, so we can use these calls for printcap * and papd.conf. */ -int tnchktc( cap ) - char *cap; +int tnchktc( char *cap) { register char *p, *q; char tcname[16]; /* name of similar terminal */ @@ -318,8 +311,7 @@ int tnchktc( cap ) * against each such name. The normal : terminator after the last * name (before the first field) stops us. */ -int tnamatch(np) - char *np; +int tnamatch(char *np) { register char *Np, *Bp; @@ -344,9 +336,7 @@ int tnamatch(np) * knowing about \: escapes or any such. If necessary, :'s can be put * into the termcap file in octal. */ -static char * -tskip(bp) - register char *bp; +static char *tskip(char *bp) { while (*bp && *bp != ':') @@ -364,8 +354,7 @@ tskip(bp) * a # character. If the option is not found we return -1. * Note that we handle octal numbers beginning with 0. */ -int tgetnum(id) - char *id; +int tgetnum(char *id) { register int i, base; register char *bp = tbuf; @@ -397,8 +386,7 @@ int tgetnum(id) * of the buffer. Return 1 if we find the option, or 0 if it is * not given. */ -int tgetflag(id) - char *id; +int tgetflag(char *id) { register char *bp = tbuf; @@ -415,43 +403,12 @@ int tgetflag(id) } } -/* - * Get a string valued option. - * These are given as - * cl=^Z - * Much decoding is done on the strings, and the strings are - * placed in area, which is a ref parameter which is updated. - * No checking on area overflow. - */ -char * -tgetstr(id, area) - char *id, **area; -{ - register char *bp = tbuf; - - for (;;) { - bp = tskip(bp); - if (!*bp) - return (0); - if (*bp++ != id[0] || *bp == 0 || *bp++ != id[1]) - continue; - if (*bp == '@') - return(0); - if (*bp != '=') - continue; - bp++; - return (tdecode(bp, area)); - } -} - /* * Tdecode does the grung work to decode the * string capability escapes. */ static char * -tdecode(str, area) - register char *str; - char **area; +tdecode(char *str, char **area) { register char *cp; register int c; @@ -493,11 +450,36 @@ nextc: return (str); } +/* + * Get a string valued option. + * These are given as + * cl=^Z + * Much decoding is done on the strings, and the strings are + * placed in area, which is a ref parameter which is updated. + * No checking on area overflow. + */ +char * +tgetstr(char *id, char **area) +{ + register char *bp = tbuf; + + for (;;) { + bp = tskip(bp); + if (!*bp) + return (0); + if (*bp++ != id[0] || *bp == 0 || *bp++ != id[1]) + continue; + if (*bp == '@') + return(0); + if (*bp != '=') + continue; + bp++; + return (tdecode(bp, area)); + } +} + static char * -decodename(str, area, bufsize) - register char *str; - char **area; - int bufsize; +decodename(char *str, char **area, int bufsize) { register char *cp; register int c; @@ -540,9 +522,7 @@ nextc: } char * -getpname( area, bufsize ) - char **area; - int bufsize; +getpname(char **area, int bufsize) { return( decodename( tbuf, area, bufsize)); } diff --git a/etc/papd/printcap.h b/etc/papd/printcap.h index b56c9c2d..d300d45f 100644 --- a/etc/papd/printcap.h +++ b/etc/papd/printcap.h @@ -1,5 +1,5 @@ /* - * $Id: printcap.h,v 1.4 2002-08-20 20:25:54 srittau Exp $ + * $Id: printcap.h,v 1.5 2009-10-13 22:55:37 didg Exp $ */ #ifndef PAPD_PRINTCAP_H @@ -7,12 +7,12 @@ #include -int getprent __P(( register char *, register char *, register int )); -int pnchktc __P(( char * )); -int pgetflag __P(( char * )); -void endprent __P(( void )); -int pgetent __P(( char *, char *, char * )); -int pgetnum __P(( char * )); -int pnamatch __P(( char * )); +int getprent ( register char *, register char *, register int ); +int pnchktc ( char * ); +int pgetflag ( char * ); +void endprent ( void ); +int pgetent ( char *, char *, char * ); +int pgetnum ( char * ); +int pnamatch ( char * ); #endif /* PAPD_PRINTCAP_H */ diff --git a/etc/papd/queries.c b/etc/papd/queries.c index c698c2b4..ef1c5a6e 100644 --- a/etc/papd/queries.c +++ b/etc/papd/queries.c @@ -1,5 +1,5 @@ /* - * $Id: queries.c,v 1.21 2009-02-02 16:04:33 didg Exp $ + * $Id: queries.c,v 1.22 2009-10-13 22:55:37 didg Exp $ * * Copyright (c) 1990,1994 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. @@ -57,8 +57,7 @@ int cq_rbilogin( struct papfile *, struct papfile * ); -int cq_default( in, out ) - struct papfile *in, *out; +int cq_default( struct papfile *in, struct papfile *out) { char *start, *stop, *p; int linelength, crlflength; @@ -118,8 +117,7 @@ char *LoginFailed = "LoginFailed\n"; #define h2b(x) (isdigit((x))?(x)-'0':(isupper((x))?(x)-'A':(x)-'a')+10) -int cq_k4login( in, out ) - struct papfile *in, *out; +int cq_k4login( struct papfile *in, struct papfile *out) { char *start, *p; int linelength, crlflength; @@ -175,8 +173,7 @@ int cq_k4login( in, out ) char *uameth = "UMICHKerberosIV\n*\n"; -int cq_uameth( in, out ) - struct papfile *in, *out; +int cq_uameth( struct papfile *in, struct papfile *out) { char *start; int linelength, crlflength; @@ -216,8 +213,7 @@ int cq_uameth( in, out ) } #endif /* KRB */ -int gq_true( out ) - struct papfile *out; +int gq_true( struct papfile *out) { if ( printer->p_flags & P_SPOOLED ) { append( out, "true\n", 5 ); @@ -227,8 +223,7 @@ int gq_true( out ) } } -int gq_pagecost( out ) - struct papfile *out; +int gq_pagecost( struct papfile *out) { char cost[ 60 ]; @@ -250,8 +245,7 @@ int gq_pagecost( out ) } #ifdef ABS_PRINT -int gq_balance( out ) - struct papfile *out; +int gq_balance( struct papfile *out) { char balance[ 60 ]; @@ -271,8 +265,7 @@ int gq_balance( out ) static const char *spoolerid = "(PAPD Spooler) 1.0 (" VERSION ")\n"; -int gq_rbispoolerid( out ) - struct papfile *out; +int gq_rbispoolerid( struct papfile *out) { append( out, spoolerid, strlen( spoolerid )); return(0); @@ -286,8 +279,7 @@ int gq_rbispoolerid( out ) static const char *nouams = "*\n"; -int gq_rbiuamlist( out ) - struct papfile *out; +int gq_rbiuamlist( struct papfile *out) { char uamnames[128] = "\0"; @@ -322,8 +314,7 @@ struct genquery { { NULL, NULL }, }; -int cq_query( in, out ) - struct papfile *in, *out; +int cq_query( struct papfile *in, struct papfile *out) { char *start, *stop, *p, *q; int linelength, crlflength; @@ -392,9 +383,7 @@ int cq_query( in, out ) } } -void cq_font_answer( start, stop, out ) - char *start, *stop; - struct papfile *out; +void cq_font_answer( char *start, char *stop, struct papfile *out) { char *p, *q, buf[ 256 ]; struct ppd_font *pfo; @@ -431,8 +420,7 @@ void cq_font_answer( start, stop, out ) return; } -int cq_font( in, out ) - struct papfile *in, *out; +int cq_font(struct papfile *in, struct papfile *out) { char *start, *stop, *p; int linelength, crlflength; @@ -493,8 +481,7 @@ int cq_font( in, out ) } } -int cq_feature( in, out ) - struct papfile *in, *out; +int cq_feature( struct papfile *in, struct papfile *out) { char *start, *stop, *p; int linelength, crlflength; @@ -555,8 +542,7 @@ int cq_feature( in, out ) static const char *psver = "*PSVersion\n"; static const char *prod = "*Product\n"; -int cq_printer( in, out ) - struct papfile *in, *out; +int cq_printer(struct papfile *in, struct papfile *out) { char *start, *p; int linelength, crlflength; @@ -636,8 +622,7 @@ int cq_printer( in, out ) static const char *rmjobfailed = "Failed\n"; static const char *rmjobok = "Ok\n"; -int cq_rmjob( in, out ) - struct papfile *in, *out; +int cq_rmjob( struct papfile *in, struct papfile *out) { char *start, *stop, *p; int linelength, crlflength; @@ -680,8 +665,7 @@ int cq_rmjob( in, out ) return( CH_DONE ); } -int cq_listq( in, out ) - struct papfile *in, *out; +int cq_listq( struct papfile *in, struct papfile *out) { char *start; int linelength, crlflength; @@ -720,8 +704,7 @@ SecurityViolation: Unknown user, incorrect password or log on is \ disabled ]%%\r%%[Flushing: rest of job (to end-of-file) will be \ ignored ]%%\r"; -int cq_rbilogin( in, out ) - struct papfile *in, *out; +int cq_rbilogin( struct papfile *in, struct papfile *out) { char *start, *stop, *p, *begin; int linelength, crlflength; diff --git a/etc/papd/session.c b/etc/papd/session.c index 9b6b914a..3dcb3a4c 100644 --- a/etc/papd/session.c +++ b/etc/papd/session.c @@ -1,5 +1,5 @@ /* - * $Id: session.c,v 1.16 2008-11-14 10:29:08 didg Exp $ + * $Id: session.c,v 1.17 2009-10-13 22:55:37 didg Exp $ * * Copyright (c) 1990,1994 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. @@ -62,9 +62,7 @@ struct iovec iov[ PAP_MAXQUANTUM ] = { * Read lines of a file, until the client sends eof, after * which we'll send eof also. */ -int session( atp, sat ) - ATP atp; - struct sockaddr_at *sat; +int session(ATP atp, struct sockaddr_at *sat) { struct timeval tv; struct atp_block atpb; diff --git a/etc/papd/showppd.c b/etc/papd/showppd.c index 3485df7b..d0232048 100644 --- a/etc/papd/showppd.c +++ b/etc/papd/showppd.c @@ -1,5 +1,5 @@ /* - * $Id: showppd.c,v 1.6 2005-04-28 20:49:49 bfernhomberg Exp $ + * $Id: showppd.c,v 1.7 2009-10-13 22:55:37 didg Exp $ * * Copyright (c) 1995 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. @@ -26,9 +26,7 @@ extern struct ppd_font *ppd_fonts; extern struct ppd_feature ppd_features[]; -int main( ac, av ) - int ac; - char **av; +int main(int ac, char **av) { struct ppd_feature *pfe; struct ppd_font *pfo; diff --git a/etc/papd/uam_auth.h b/etc/papd/uam_auth.h index 0ae2ddc9..0cc9156a 100644 --- a/etc/papd/uam_auth.h +++ b/etc/papd/uam_auth.h @@ -1,5 +1,5 @@ /* - * $Id: uam_auth.h,v 1.3 2001-06-25 20:13:45 rufustfirefly Exp $ + * $Id: uam_auth.h,v 1.4 2009-10-13 22:55:37 didg Exp $ * * Copyright (c) 1999 Adrian Sun (asun@zoology.washington.edu) * All Rights Reserved. See COPYRIGHT. @@ -29,15 +29,15 @@ struct uam_obj { int uam_count; union { struct { - int (*login) __P((void *, struct passwd **, - char *, int, char *, int *)); - int (*logincont) __P((void *, struct passwd **, char *, - int, char *, int *)); - void (*logout) __P((void)); + int (*login) (void *, struct passwd **, + char *, int, char *, int *); + int (*logincont) (void *, struct passwd **, char *, + int, char *, int *); + void (*logout) (void); } uam_login; - int (*uam_changepw) __P((void *, char *, struct passwd *, char *, - int, char *, int *)); - int (*uam_printer) __P((char *, char *, char *, struct papfile *)); + int (*uam_changepw) (void *, char *, struct passwd *, char *, + int, char *, int *); + int (*uam_printer) (char *, char *, char *, struct papfile *); } u; struct uam_obj *uam_prev, *uam_next; }; @@ -59,15 +59,15 @@ struct uam_obj { (((type) == UAM_SERVER_PRINTAUTH) ? &uam_printer : NULL))) -extern struct uam_mod *uam_load __P((const char *, const char *)); -extern void uam_unload __P((struct uam_mod *)); +extern struct uam_mod *uam_load (const char *, const char *); +extern void uam_unload (struct uam_mod *); /* auth.c */ -int auth_load __P((const char *, const char *)); -int auth_register __P((const int, struct uam_obj *)); +int auth_load (const char *, const char *); +int auth_register (const int, struct uam_obj *); #define auth_unregister(a) uam_detach(a) -struct uam_obj *auth_uamfind __P((const int, const char *, const int)); -void auth_unload __P((void)); -int getuamnames __P((const int, char *)); +struct uam_obj *auth_uamfind (const int, const char *, const int); +void auth_unload (void); +int getuamnames (const int, char *); #endif /* uam_auth.h */ diff --git a/etc/psf/psa.c b/etc/psf/psa.c index 82bc4f21..2606a7c5 100644 --- a/etc/psf/psa.c +++ b/etc/psf/psa.c @@ -1,5 +1,5 @@ /* - * $Id: psa.c,v 1.4 2001-06-25 20:13:45 rufustfirefly Exp $ + * $Id: psa.c,v 1.5 2009-10-13 22:55:37 didg Exp $ * * Copyright (c) 1990,1995 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. @@ -28,9 +28,7 @@ #include #include -int main( ac, av ) - int ac; - char **av; +int main( int ac, char **av) { FILE *af; char *acc, *user, *host; diff --git a/etc/psf/psf.c b/etc/psf/psf.c index c4db9b99..94d95d82 100644 --- a/etc/psf/psf.c +++ b/etc/psf/psf.c @@ -1,5 +1,5 @@ /* - * $Id: psf.c,v 1.9 2005-04-28 20:49:49 bfernhomberg Exp $ + * $Id: psf.c,v 1.10 2009-10-13 22:55:37 didg Exp $ * * Copyright (c) 1990,1995 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. @@ -91,9 +91,7 @@ struct papersize { { 80, 70, 8.27, 11.69 }, /* A4 */ }; -int main( ac, av ) - int ac; - char **av; +int main( int ac, char **av) { int c, rc, children = 0; #ifdef FUCKED @@ -368,7 +366,7 @@ restart: exit( rc ); } -int copyio() +int copyio(void) { /* implement the FSM needed to do the suspend. Note that * the last characters will be \031\001 so don't worry @@ -482,7 +480,7 @@ char pspro[] = "\ /EP { SV restore showpage } bind def\n\ %%EndProlog\n"; -int textps() +int textps(void) { struct papersize papersize; int state = 0, line = 0, col = 0, npages = 0, rc; @@ -691,8 +689,7 @@ out: * Manipulates file descriptors 0, 1, and 2, such that the new child * is reading from the parent's output. */ -int pexecv( path, argv ) - char *path, *argv[]; +int pexecv( char *path, char *argv[]) { int fd[ 2 ], c; diff --git a/etc/uams/uams_dhx2_pam.c b/etc/uams/uams_dhx2_pam.c index 57cc523b..94c3377d 100644 --- a/etc/uams/uams_dhx2_pam.c +++ b/etc/uams/uams_dhx2_pam.c @@ -1,5 +1,5 @@ /* - * $Id: uams_dhx2_pam.c,v 1.6 2009-01-15 04:16:32 didg Exp $ + * $Id: uams_dhx2_pam.c,v 1.7 2009-10-13 22:55:37 didg Exp $ * * Copyright (c) 1990,1993 Regents of The University of Michigan. * Copyright (c) 1999 Adrian Sun (asun@u.washington.edu) @@ -720,7 +720,7 @@ static int pam_logincont(void *obj, struct passwd **uam_pwd, /* logout */ -static void pam_logout() { +static void pam_logout(void) { pam_close_session(pamh, 0); pam_end(pamh, 0); pamh = NULL; diff --git a/etc/uams/uams_dhx_pam.c b/etc/uams/uams_dhx_pam.c index 37e40665..d50950cd 100644 --- a/etc/uams/uams_dhx_pam.c +++ b/etc/uams/uams_dhx_pam.c @@ -1,5 +1,5 @@ /* - * $Id: uams_dhx_pam.c,v 1.29 2008-12-03 19:31:50 didg Exp $ + * $Id: uams_dhx_pam.c,v 1.30 2009-10-13 22:55:37 didg Exp $ * * Copyright (c) 1990,1993 Regents of The University of Michigan. * Copyright (c) 1999 Adrian Sun (asun@u.washington.edu) @@ -554,7 +554,7 @@ logincont_err: } /* logout */ -static void pam_logout() { +static void pam_logout(void) { pam_close_session(pamh, 0); pam_end(pamh, 0); pamh = NULL; diff --git a/etc/uams/uams_guest.c b/etc/uams/uams_guest.c index 0b7f000b..97c934b0 100644 --- a/etc/uams/uams_guest.c +++ b/etc/uams/uams_guest.c @@ -1,5 +1,5 @@ /* - * $Id: uams_guest.c,v 1.14 2009-09-14 00:02:21 didg Exp $ + * $Id: uams_guest.c,v 1.15 2009-10-13 22:55:37 didg Exp $ * * (c) 2001 (see COPYING) */ @@ -38,7 +38,9 @@ char *strchr (), *strrchr (); #define MIN(a,b) ((a) < (b) ? (a) : (b)) #endif /* MIN */ -extern void append(void *, const char *, int); +/*XXX in etc/papd/file.h */ +struct papfile; +extern void append(struct papfile *, const char *, int); /* login and login_ext are almost the same */ static int noauth_login(void *obj, struct passwd **uam_pwd, @@ -86,9 +88,7 @@ static int noauth_login_ext(void *obj, char *uname _U_, struct passwd **uam_pwd, /* Printer NoAuthUAM Login */ -int noauth_printer(start, stop, username, out) - char *start, *stop, *username; - struct papfile *out; +int noauth_printer(char *start, char *stop, char *username, struct papfile *out) { char *data, *p, *q; static const char *loginok = "0\r"; @@ -149,7 +149,7 @@ static int uam_setup(const char *path) return 0; } -static void uam_cleanup() +static void uam_cleanup(void) { uam_unregister(UAM_SERVER_LOGIN, "No User Authent"); uam_unregister(UAM_SERVER_PRINTAUTH, "NoAuthUAM"); diff --git a/etc/uams/uams_pam.c b/etc/uams/uams_pam.c index 2600e798..afa62cd9 100644 --- a/etc/uams/uams_pam.c +++ b/etc/uams/uams_pam.c @@ -1,5 +1,5 @@ /* - * $Id: uams_pam.c,v 1.18 2009-09-14 00:02:21 didg Exp $ + * $Id: uams_pam.c,v 1.19 2009-10-13 22:55:37 didg Exp $ * * Copyright (c) 1990,1993 Regents of The University of Michigan. * Copyright (c) 1999 Adrian Sun (asun@u.washington.edu) @@ -59,7 +59,9 @@ static char *hostname; static char *PAM_username; static char *PAM_password; -extern void append(void *, const char *, int); +/*XXX in etc/papd/file.h */ +struct papfile; +extern void append(struct papfile *, const char *, int); /* PAM conversation function * Here we assume (for now, at least) that echo on means login name, and @@ -274,7 +276,7 @@ static int pam_login_ext(void *obj, char *uname, struct passwd **uam_pwd, } /* logout */ -static void pam_logout() { +static void pam_logout(void) { pam_close_session(pamh, 0); pam_end(pamh, 0); pamh = NULL; @@ -341,9 +343,7 @@ static int pam_changepw(void *obj _U_, char *username, /* Printer ClearTxtUAM login */ -int pam_printer(start, stop, username, out) - char *start, *stop, *username; - struct papfile *out; +int pam_printer(char *start, char *stop, char *username, struct papfile *out) { int PAM_error; char *data, *p, *q; diff --git a/etc/uams/uams_passwd.c b/etc/uams/uams_passwd.c index 5fcdce56..799cdc28 100644 --- a/etc/uams/uams_passwd.c +++ b/etc/uams/uams_passwd.c @@ -1,5 +1,5 @@ /* - * $Id: uams_passwd.c,v 1.25 2009-09-14 00:02:21 didg Exp $ + * $Id: uams_passwd.c,v 1.26 2009-10-13 22:55:37 didg Exp $ * * Copyright (c) 1990,1993 Regents of The University of Michigan. * Copyright (c) 1999 Adrian Sun (asun@u.washington.edu) @@ -71,7 +71,9 @@ char *strchr (), *strrchr (); static char *clientname; #endif /* TRU64 */ -extern void append(void *, const char *, int); +/*XXX in etc/papd/file.h */ +struct papfile; +extern void append(struct papfile *, const char *, int); static int pwd_login(void *obj, char *username, int ulen, struct passwd **uam_pwd, char *ibuf, int ibuflen, @@ -271,9 +273,7 @@ static int passwd_changepw(void *obj, char *username, /* Printer ClearTxtUAM login */ -static int passwd_printer(start, stop, username, out) -char *start, *stop, *username; -struct papfile *out; +static int passwd_printer(char *start, char *stop, char *username, struct papfile *out) { struct passwd *pwd; #ifdef SHADOWPW diff --git a/include/atalk/adouble.h b/include/atalk/adouble.h index 580bff6a..a9cd08bd 100644 --- a/include/atalk/adouble.h +++ b/include/atalk/adouble.h @@ -1,5 +1,5 @@ /* - * $Id: adouble.h,v 1.43 2009-10-02 09:32:40 franklahm Exp $ + * $Id: adouble.h,v 1.44 2009-10-13 22:55:37 didg Exp $ * Copyright (c) 1990,1991 Regents of The University of Michigan. * All Rights Reserved. * @@ -432,42 +432,42 @@ struct adouble_fops { #define ad_get_MD_flags(ad) ((ad)->ad_md->adf_flags) /* ad_flush.c */ -extern int ad_rebuild_adouble_header __P((struct adouble *)); -extern int ad_rebuild_sfm_header __P((struct adouble *)); -extern int ad_copy_header __P((struct adouble *, struct adouble *)); -extern int ad_flush __P((struct adouble *)); -extern int ad_close __P((struct adouble *, int)); +extern int ad_rebuild_adouble_header (struct adouble *); +extern int ad_rebuild_sfm_header (struct adouble *); +extern int ad_copy_header (struct adouble *, struct adouble *); +extern int ad_flush (struct adouble *); +extern int ad_close (struct adouble *, int); /* ad_lock.c */ -extern int ad_fcntl_lock __P((struct adouble *, const u_int32_t /*eid*/, +extern int ad_fcntl_lock (struct adouble *, const u_int32_t /*eid*/, const int /*type*/, const off_t /*offset*/, - const off_t /*len*/, const int /*user*/)); -extern void ad_fcntl_unlock __P((struct adouble *, const int /*user*/)); -extern int ad_fcntl_tmplock __P((struct adouble *, const u_int32_t /*eid*/, + const off_t /*len*/, const int /*user*/); +extern void ad_fcntl_unlock (struct adouble *, const int /*user*/); +extern int ad_fcntl_tmplock (struct adouble *, const u_int32_t /*eid*/, const int /*type*/, const off_t /*offset*/, - const off_t /*len*/, const int /*user*/)); -extern int ad_testlock __P((struct adouble * /*adp*/, int /*eid*/, off_t /*off*/)); -extern int ad_excl_lock __P((struct adouble * /*adp*/, const u_int32_t /*eid*/)); + const off_t /*len*/, const int /*user*/); +extern int ad_testlock (struct adouble * /*adp*/, int /*eid*/, off_t /*off*/); +extern int ad_excl_lock (struct adouble * /*adp*/, const u_int32_t /*eid*/); #define ad_lock ad_fcntl_lock #define ad_tmplock ad_fcntl_tmplock #define ad_unlock ad_fcntl_unlock /* ad_open.c */ -extern int ad_setfuid __P((const uid_t )); -extern uid_t ad_getfuid __P((void )); -extern char *ad_dir __P((const char *)); -extern char *ad_path __P((const char *, int)); -extern char *ad_path_osx __P((const char *, int)); -extern char *ad_path_ads __P((const char *, int)); -extern char *ad_path_sfm __P((const char *, int)); -extern int ad_mode __P((const char *, int)); -extern int ad_mkdir __P((const char *, int)); -extern void ad_init __P((struct adouble *, int, int )); -extern int ad_open __P((const char *, int, int, int, struct adouble *)); -extern int ad_refresh __P((struct adouble *)); -extern int ad_stat __P((const char *, struct stat *)); -extern int ad_metadata __P((const char *, int, struct adouble *)); +extern int ad_setfuid (const uid_t ); +extern uid_t ad_getfuid (void ); +extern char *ad_dir (const char *); +extern char *ad_path (const char *, int); +extern char *ad_path_osx (const char *, int); +extern char *ad_path_ads (const char *, int); +extern char *ad_path_sfm (const char *, int); +extern int ad_mode (const char *, int); +extern int ad_mkdir (const char *, int); +extern void ad_init (struct adouble *, int, int ); +extern int ad_open (const char *, int, int, int, struct adouble *); +extern int ad_refresh (struct adouble *); +extern int ad_stat (const char *, struct stat *); +extern int ad_metadata (const char *, int, struct adouble *); #define ad_open_metadata(name, flags, mode, adp)\ ad_open(name, ADFLAGS_MD|(flags), O_RDWR |(mode), 0666, (adp)) @@ -500,54 +500,54 @@ static inline mode_t ad_hf_mode (mode_t mode) } /* ad_read.c/ad_write.c */ -extern ssize_t ad_read __P((struct adouble *, const u_int32_t, - const off_t, char *, const size_t)); -extern ssize_t ad_pread __P((struct ad_fd *, void *, size_t, off_t)); -extern ssize_t ad_write __P((struct adouble *, const u_int32_t, off_t, - const int, const char *, const size_t)); -extern ssize_t adf_pread __P((struct ad_fd *, void *, size_t, off_t)); -extern ssize_t adf_pwrite __P((struct ad_fd *, const void *, size_t, off_t)); -extern int ad_dtruncate __P((struct adouble *, const off_t)); -extern int ad_rtruncate __P((struct adouble *, const off_t)); +extern ssize_t ad_read (struct adouble *, const u_int32_t, + const off_t, char *, const size_t); +extern ssize_t ad_pread (struct ad_fd *, void *, size_t, off_t); +extern ssize_t ad_write (struct adouble *, const u_int32_t, off_t, + const int, const char *, const size_t); +extern ssize_t adf_pread (struct ad_fd *, void *, size_t, off_t); +extern ssize_t adf_pwrite (struct ad_fd *, const void *, size_t, off_t); +extern int ad_dtruncate (struct adouble *, const off_t); +extern int ad_rtruncate (struct adouble *, const off_t); /* ad_size.c */ -extern off_t ad_size __P((const struct adouble *, const u_int32_t )); +extern off_t ad_size (const struct adouble *, const u_int32_t ); /* ad_mmap.c */ -extern void *ad_mmapread __P((struct adouble *, const u_int32_t, - const off_t, const size_t)); -extern void *ad_mmapwrite __P((struct adouble *, const u_int32_t, - const off_t, const int, const size_t)); +extern void *ad_mmapread (struct adouble *, const u_int32_t, + const off_t, const size_t); +extern void *ad_mmapwrite (struct adouble *, const u_int32_t, + const off_t, const int, const size_t); #define ad_munmap(buf, len) (munmap((buf), (len))) /* ad_date.c */ -extern int ad_setdate __P((const struct adouble *, unsigned int, u_int32_t)); -extern int ad_getdate __P((const struct adouble *, unsigned int, u_int32_t *)); +extern int ad_setdate (const struct adouble *, unsigned int, u_int32_t); +extern int ad_getdate (const struct adouble *, unsigned int, u_int32_t *); /* ad_attr.c */ -extern int ad_setattr __P((const struct adouble *, const u_int16_t)); -extern int ad_getattr __P((const struct adouble *, u_int16_t *)); +extern int ad_setattr (const struct adouble *, const u_int16_t); +extern int ad_getattr (const struct adouble *, u_int16_t *); /* Note: starting with Netatalk 2.1 we do NOT alway set the name */ -extern int ad_setname __P((struct adouble *, const char *)); +extern int ad_setname (struct adouble *, const char *); #if AD_VERSION == AD_VERSION2 -extern int ad_setid __P((struct adouble *, const dev_t dev,const ino_t ino, const u_int32_t, const u_int32_t, const void *)); -extern u_int32_t ad_getid __P((struct adouble *, const dev_t, const ino_t, const cnid_t, const void *)); -extern u_int32_t ad_forcegetid __P((struct adouble *adp)); +extern int ad_setid (struct adouble *, const dev_t dev,const ino_t ino, const u_int32_t, const u_int32_t, const void *); +extern u_int32_t ad_getid (struct adouble *, const dev_t, const ino_t, const cnid_t, const void *); +extern u_int32_t ad_forcegetid (struct adouble *adp); #else #define ad_setid(a, b, c) #endif #ifdef WITH_SENDFILE -extern ssize_t ad_readfile __P((const struct adouble *, const int, - const int, off_t, const size_t)); +extern ssize_t ad_readfile (const struct adouble *, const int, + const int, off_t, const size_t); #endif #if 0 #ifdef HAVE_SENDFILE_WRITE -extern ssize_t ad_writefile __P((struct adouble *, const int, - const int, off_t, const int, const size_t)); +extern ssize_t ad_writefile (struct adouble *, const int, + const int, off_t, const int, const size_t); #endif /* HAVE_SENDFILE_WRITE */ #endif /* 0 */ diff --git a/include/atalk/asp.h b/include/atalk/asp.h index 4db53a40..7c555e48 100644 --- a/include/atalk/asp.h +++ b/include/atalk/asp.h @@ -87,18 +87,18 @@ typedef struct ASP { #define ASPERR_TOOMANY 0xfbce #define ASPERR_NOACK 0xfbcd -extern ASP asp_init __P((ATP)); -extern void asp_setstatus __P((ASP, char *, const int)); -extern ASP asp_getsession __P((ASP, server_child *, const int)); -extern int asp_close __P((ASP)); -extern int asp_shutdown __P((ASP)); -extern int asp_attention __P((ASP, AFPUserBytes)); -extern int asp_getrequest __P((ASP)); -extern int asp_cmdreply __P((ASP, int)); -extern int asp_wrtcont __P((ASP, char *, int *)); +extern ASP asp_init (ATP); +extern void asp_setstatus (ASP, char *, const int); +extern ASP asp_getsession (ASP, server_child *, const int); +extern int asp_close (ASP); +extern int asp_shutdown (ASP); +extern int asp_attention (ASP, AFPUserBytes); +extern int asp_getrequest (ASP); +extern int asp_cmdreply (ASP, int); +extern int asp_wrtcont (ASP, char *, int *); #define asp_wrtreply(a,b) asp_cmdreply((a), (b)) -extern void asp_kill __P((int)); -extern int asp_tickle __P((ASP, const u_int8_t, struct sockaddr_at *)); -extern void asp_stop_tickle __P((void)); +extern void asp_kill (int); +extern int asp_tickle (ASP, const u_int8_t, struct sockaddr_at *); +extern void asp_stop_tickle (void); #endif diff --git a/include/atalk/atp.h b/include/atalk/atp.h index e8593128..48e5dfdd 100644 --- a/include/atalk/atp.h +++ b/include/atalk/atp.h @@ -1,5 +1,5 @@ /* - * $Id: atp.h,v 1.4 2002-02-07 23:35:49 srittau Exp $ + * $Id: atp.h,v 1.5 2009-10-13 22:55:37 didg Exp $ * * Copyright (c) 1990,1991 Regents of The University of Michigan. * All Rights Reserved. @@ -180,14 +180,14 @@ struct atp_block { #define ATP_TRESP (2<<6) /* Trans. RESPonse */ #define ATP_TREL (3<<6) /* Trans. RELease */ -extern ATP atp_open __P((u_int8_t, - const struct at_addr *)); -extern int atp_close __P((ATP)); -extern int atp_sreq __P((ATP, struct atp_block *, int, - u_int8_t)); -extern int atp_rresp __P((ATP, struct atp_block *)); -extern int atp_rsel __P((ATP, struct sockaddr_at *, int)); -extern int atp_rreq __P((ATP, struct atp_block *)); -extern int atp_sresp __P((ATP, struct atp_block *)); +extern ATP atp_open (u_int8_t, + const struct at_addr *); +extern int atp_close (ATP); +extern int atp_sreq (ATP, struct atp_block *, int, + u_int8_t); +extern int atp_rresp (ATP, struct atp_block *); +extern int atp_rsel (ATP, struct sockaddr_at *, int); +extern int atp_rreq (ATP, struct atp_block *); +extern int atp_sresp (ATP, struct atp_block *); #endif diff --git a/include/atalk/compat.h b/include/atalk/compat.h index 7bd9983d..6820f7ba 100644 --- a/include/atalk/compat.h +++ b/include/atalk/compat.h @@ -21,8 +21,8 @@ #include #include -extern int flock __P((int, int)); -extern int inet_aton __P((const char *, struct in_addr *)); +extern int flock (int, int); +extern int inet_aton (const char *, struct in_addr *); #else /* __svr4__ */ #ifdef sun @@ -66,8 +66,8 @@ extern int inet_aton __P((const char *, struct in_addr *)); #define SA_RESTART 0 #endif -extern char *strdup __P((const char *)); -extern int inet_aton __P((const char *, struct in_addr *)); +extern char *strdup (const char *); +extern int inet_aton (const char *, struct in_addr *); #endif /* ultrix */ #ifdef BSD4_4 @@ -77,7 +77,7 @@ extern int inet_aton __P((const char *, struct in_addr *)); #endif /* BSD4_4 */ #if defined(ultrix) || defined(_IBMR2) || defined(NEED_GETUSERSHELL) -extern char *getusershell __P((void)); +extern char *getusershell (void); #endif #if !defined(HAVE_SNPRINTF) || !defined(HAVE_VSNPRINTF) diff --git a/include/atalk/dsi.h b/include/atalk/dsi.h index 13609048..91cee9ba 100644 --- a/include/atalk/dsi.h +++ b/include/atalk/dsi.h @@ -138,47 +138,47 @@ typedef struct DSI { #define DSI_AFPOVERTCP_PORT 548 /* basic initialization: dsi_init.c */ -extern DSI *dsi_init __P((const dsi_proto /*protocol*/, +extern DSI *dsi_init (const dsi_proto /*protocol*/, const char * /*program*/, const char * /*host*/, const char * /*address*/, const int /*port*/, const int /*proxy*/, - const u_int32_t /* server quantum */)); -extern void dsi_setstatus __P((DSI *, char *, const size_t)); + const u_int32_t /* server quantum */); +extern void dsi_setstatus (DSI *, char *, const size_t); /* in dsi_getsess.c */ -extern DSI *dsi_getsession __P((DSI *, server_child *, const int)); -extern void dsi_kill __P((int)); +extern DSI *dsi_getsession (DSI *, server_child *, const int); +extern void dsi_kill (int); /* DSI Commands: individual files */ -extern void dsi_opensession __P((DSI *)); -extern int dsi_attention __P((DSI *, AFPUserBytes)); -extern int dsi_cmdreply __P((DSI *, const int)); -extern int dsi_tickle __P((DSI *)); -extern void dsi_getstatus __P((DSI *)); -extern void dsi_close __P((DSI *)); -extern void dsi_sleep __P((DSI *, const int )); +extern void dsi_opensession (DSI *); +extern int dsi_attention (DSI *, AFPUserBytes); +extern int dsi_cmdreply (DSI *, const int); +extern int dsi_tickle (DSI *); +extern void dsi_getstatus (DSI *); +extern void dsi_close (DSI *); +extern void dsi_sleep (DSI *, const int ); /* set, unset socket blocking mode */ -extern int dsi_block __P((DSI *, const int)); +extern int dsi_block (DSI *, const int); /* low-level stream commands -- in dsi_stream.c */ -extern size_t dsi_stream_write __P((DSI *, void *, const size_t, const int mode)); -extern size_t dsi_stream_read __P((DSI *, void *, const size_t)); -extern int dsi_stream_send __P((DSI *, void *, size_t)); -extern int dsi_stream_receive __P((DSI *, void *, const size_t, size_t *)); +extern size_t dsi_stream_write (DSI *, void *, const size_t, const int mode); +extern size_t dsi_stream_read (DSI *, void *, const size_t); +extern int dsi_stream_send (DSI *, void *, size_t); +extern int dsi_stream_receive (DSI *, void *, const size_t, size_t *); /* client writes -- dsi_write.c */ -extern size_t dsi_writeinit __P((DSI *, void *, const size_t)); -extern size_t dsi_write __P((DSI *, void *, const size_t)); -extern void dsi_writeflush __P((DSI *)); +extern size_t dsi_writeinit (DSI *, void *, const size_t); +extern size_t dsi_write (DSI *, void *, const size_t); +extern void dsi_writeflush (DSI *); #define dsi_wrtreply(a,b) dsi_cmdreply(a,b) /* client reads -- dsi_read.c */ -extern ssize_t dsi_readinit __P((DSI *, void *, const size_t, const size_t, - const int)); -extern ssize_t dsi_read __P((DSI *, void *, const size_t)); -extern void dsi_readdone __P((DSI *)); +extern ssize_t dsi_readinit (DSI *, void *, const size_t, const size_t, + const int); +extern ssize_t dsi_read (DSI *, void *, const size_t); +extern void dsi_readdone (DSI *); /* some useful macros */ #define dsi_serverID(x) ((x)->serverID++) diff --git a/include/atalk/nbp.h b/include/atalk/nbp.h index e917adfa..aa419044 100644 --- a/include/atalk/nbp.h +++ b/include/atalk/nbp.h @@ -84,13 +84,13 @@ struct nbpnve { #define NBPMATCH_NOGLOB (1<<1) #define NBPMATCH_NOZONE (1<<2) -extern int nbp_name __P((const char *, char **, char **, char **)); -extern int nbp_lookup __P((const char *, const char *, const char *, +extern int nbp_name (const char *, char **, char **, char **); +extern int nbp_lookup (const char *, const char *, const char *, struct nbpnve *, const int, - const struct at_addr *)); -extern int nbp_rgstr __P((struct sockaddr_at *, - const char *, const char *, const char *)); -extern int nbp_unrgstr __P((const char *, const char *, const char *, - const struct at_addr *)); + const struct at_addr *); +extern int nbp_rgstr (struct sockaddr_at *, + const char *, const char *, const char *); +extern int nbp_unrgstr (const char *, const char *, const char *, + const struct at_addr *); #endif diff --git a/include/atalk/netddp.h b/include/atalk/netddp.h index 4fa5a582..bf1c9bd3 100644 --- a/include/atalk/netddp.h +++ b/include/atalk/netddp.h @@ -1,5 +1,5 @@ /* - * $Id: netddp.h,v 1.3 2002-02-07 23:35:49 srittau Exp $ + * $Id: netddp.h,v 1.4 2009-10-13 22:55:37 didg Exp $ * * Copyright (c) 1999 Adrian Sun (asun@zoology.washington.edu) * All Rights Reserved. See COPYRIGHT. @@ -18,13 +18,13 @@ #include #include -extern int netddp_open __P((struct sockaddr_at *, struct sockaddr_at *)); +extern int netddp_open (struct sockaddr_at *, struct sockaddr_at *); #if !defined(NO_DDP) && defined(MACOSX_SERVER) -extern int netddp_sendto __P((int, void *, size_t, unsigned int, - const struct sockaddr *, unsigned int)); -extern int netddp_recvfrom __P((int, void *, int, unsigned int, - struct sockaddr *, unsigned int *)); +extern int netddp_sendto (int, void *, size_t, unsigned int, + const struct sockaddr *, unsigned int); +extern int netddp_recvfrom (int, void *, int, unsigned int, + struct sockaddr *, unsigned int *); #define netddp_close(a) ddp_close(a) #else #include diff --git a/include/atalk/server_child.h b/include/atalk/server_child.h index aeee9439..8479367b 100644 --- a/include/atalk/server_child.h +++ b/include/atalk/server_child.h @@ -24,18 +24,18 @@ typedef struct server_child { } server_child; /* server_child.c */ -extern server_child *server_child_alloc __P((const int, const int)); -extern int server_child_add __P((server_child *, const int, const pid_t)); -extern int server_child_remove __P((server_child *, const int, const pid_t)); -extern void server_child_free __P((server_child *)); - -extern void server_child_kill __P((server_child *, const int, const int)); -extern void server_child_kill_one __P((server_child *children, const int forkid, const pid_t, const uid_t)); -extern void server_child_kill_one_by_id __P((server_child *children, const int forkid, const pid_t pid, const uid_t, - const u_int32_t len, char *id, u_int32_t boottime)); - -extern void server_child_setup __P((server_child *, const int, void (*)())); -extern void server_child_handler __P((server_child *)); -extern void server_reset_signal __P((void)); +extern server_child *server_child_alloc (const int, const int); +extern int server_child_add (server_child *, const int, const pid_t); +extern int server_child_remove (server_child *, const int, const pid_t); +extern void server_child_free (server_child *); + +extern void server_child_kill (server_child *, const int, const int); +extern void server_child_kill_one (server_child *children, const int forkid, const pid_t, const uid_t); +extern void server_child_kill_one_by_id (server_child *children, const int forkid, const pid_t pid, const uid_t, + const u_int32_t len, char *id, u_int32_t boottime); + +extern void server_child_setup (server_child *, const int, void (*)(const pid_t)); +extern void server_child_handler (server_child *); +extern void server_reset_signal (void); #endif diff --git a/include/atalk/uam.h b/include/atalk/uam.h index e161b685..ffab8f01 100644 --- a/include/atalk/uam.h +++ b/include/atalk/uam.h @@ -78,29 +78,29 @@ struct session_info { }; /* register and unregister uams with these functions */ -extern int uam_register __P((const int, const char *, const char *, ...)); -extern void uam_unregister __P((const int, const char *)); +extern int uam_register (const int, const char *, const char *, ...); +extern void uam_unregister (const int, const char *); /* helper functions */ -extern struct passwd *uam_getname __P((void*, char *, const int)); -extern int uam_checkuser __P((const struct passwd *)); +extern struct passwd *uam_getname (void*, char *, const int); +extern int uam_checkuser (const struct passwd *); /* afp helper functions */ -extern int uam_afp_read __P((void *, char *, int *, - int (*)(void *, void *, const int))); -extern int uam_afpserver_option __P((void *, const int, void *, int *)); +extern int uam_afp_read (void *, char *, int *, + int (*)(void *, void *, const int)); +extern int uam_afpserver_option (void *, const int, void *, int *); #ifdef TRU64 -extern void uam_afp_getcmdline __P((int *, char ***)); -extern int uam_sia_validate_user __P((sia_collect_func_t *, int, char **, +extern void uam_afp_getcmdline (int *, char ***); +extern int uam_sia_validate_user (sia_collect_func_t *, int, char **, char *, char *, char *, int, char *, - char *)); + char *); #endif /* TRU64 */ /* switch.c */ #define UAM_AFPSERVER_PREAUTH (0) #define UAM_AFPSERVER_POSTAUTH (1 << 0) -extern int uam_afpserver_action __P((const int /*id*/, const int /*switch*/, - int (*)(), int (**)())); +extern int uam_afpserver_action (const int /*id*/, const int /*switch*/, + int (*)(), int (**)()); #endif diff --git a/include/atalk/unicode.h b/include/atalk/unicode.h index e927b5ee..b24ee4a5 100644 --- a/include/atalk/unicode.h +++ b/include/atalk/unicode.h @@ -84,62 +84,62 @@ struct charset_functions { }; /* from iconv.c */ -extern atalk_iconv_t atalk_iconv_open __P((const char *, const char *)); -extern size_t atalk_iconv __P((atalk_iconv_t, const char **, size_t *, char **, size_t *)); -extern int atalk_iconv_close __P((atalk_iconv_t)); -extern struct charset_functions *find_charset_functions __P((const char *)); -extern int atalk_register_charset __P((struct charset_functions *)); +extern atalk_iconv_t atalk_iconv_open (const char *, const char *); +extern size_t atalk_iconv (atalk_iconv_t, const char **, size_t *, char **, size_t *); +extern int atalk_iconv_close (atalk_iconv_t); +extern struct charset_functions *find_charset_functions (const char *); +extern int atalk_register_charset (struct charset_functions *); /* from util_unistr.c */ -extern ucs2_t toupper_w __P((ucs2_t)); -extern ucs2_t tolower_w __P((ucs2_t)); -extern int strupper_w __P((ucs2_t *)); -extern int strlower_w __P((ucs2_t *)); -extern int islower_w __P((ucs2_t)); -extern int islower_w __P((ucs2_t)); -extern size_t strlen_w __P((const ucs2_t *)); -extern size_t strnlen_w __P((const ucs2_t *, size_t)); -extern ucs2_t* strchr_w __P((const ucs2_t *, ucs2_t)); -extern int strcmp_w __P((const ucs2_t *, const ucs2_t *)); -extern int strncmp_w __P((const ucs2_t *, const ucs2_t *, size_t)); -extern int strcasecmp_w __P((const ucs2_t *, const ucs2_t *)); -extern int strncasecmp_w __P((const ucs2_t *, const ucs2_t *, size_t)); -extern ucs2_t *strcasestr_w __P((const ucs2_t *, const ucs2_t *)); -extern ucs2_t *strndup_w __P((const ucs2_t *, size_t)); -extern ucs2_t *strdup_w __P((const ucs2_t *)); -extern ucs2_t *strncpy_w __P((ucs2_t *, const ucs2_t *, const size_t)); -extern ucs2_t *strncat_w __P((ucs2_t *, const ucs2_t *, const size_t)); -extern ucs2_t *strcat_w __P((ucs2_t *, const ucs2_t *)); -extern size_t precompose_w __P((ucs2_t *, size_t, ucs2_t *,size_t *)); -extern size_t decompose_w __P((ucs2_t *, size_t, ucs2_t *,size_t *)); -extern size_t utf8_charlen __P(( char* )); -extern size_t utf8_strlen_validate __P(( char *)); +extern ucs2_t toupper_w (ucs2_t); +extern ucs2_t tolower_w (ucs2_t); +extern int strupper_w (ucs2_t *); +extern int strlower_w (ucs2_t *); +extern int islower_w (ucs2_t); +extern int islower_w (ucs2_t); +extern size_t strlen_w (const ucs2_t *); +extern size_t strnlen_w (const ucs2_t *, size_t); +extern ucs2_t* strchr_w (const ucs2_t *, ucs2_t); +extern int strcmp_w (const ucs2_t *, const ucs2_t *); +extern int strncmp_w (const ucs2_t *, const ucs2_t *, size_t); +extern int strcasecmp_w (const ucs2_t *, const ucs2_t *); +extern int strncasecmp_w (const ucs2_t *, const ucs2_t *, size_t); +extern ucs2_t *strcasestr_w (const ucs2_t *, const ucs2_t *); +extern ucs2_t *strndup_w (const ucs2_t *, size_t); +extern ucs2_t *strdup_w (const ucs2_t *); +extern ucs2_t *strncpy_w (ucs2_t *, const ucs2_t *, const size_t); +extern ucs2_t *strncat_w (ucs2_t *, const ucs2_t *, const size_t); +extern ucs2_t *strcat_w (ucs2_t *, const ucs2_t *); +extern size_t precompose_w (ucs2_t *, size_t, ucs2_t *,size_t *); +extern size_t decompose_w (ucs2_t *, size_t, ucs2_t *,size_t *); +extern size_t utf8_charlen ( char* ); +extern size_t utf8_strlen_validate ( char *); /* from charcnv.c */ -extern void init_iconv __P((void)); -extern size_t convert_string __P((charset_t, charset_t, void const *, size_t, void *, size_t)); -extern size_t convert_string_allocate __P((charset_t, charset_t, void const *, size_t, char **)); -extern size_t utf8_strupper __P((const char *, size_t, char *, size_t)); -extern size_t utf8_strlower __P((const char *, size_t, char *, size_t)); -extern size_t unix_strupper __P((const char *, size_t, char *, size_t)); -extern size_t unix_strlower __P((const char *, size_t, char *, size_t)); -extern size_t charset_strupper __P((charset_t, const char *, size_t, char *, size_t)); -extern size_t charset_strlower __P((charset_t, const char *, size_t, char *, size_t)); - -extern size_t charset_to_ucs2_allocate __P((charset_t, ucs2_t **dest, const char *src)); -extern size_t charset_to_utf8_allocate __P((charset_t, char **dest, const char *src)); -extern size_t ucs2_to_charset_allocate __P((charset_t, char **dest, const ucs2_t *src)); -extern size_t utf8_to_charset_allocate __P((charset_t, char **dest, const char *src)); -extern size_t ucs2_to_charset __P((charset_t, const ucs2_t *src, char *dest, size_t)); - -extern size_t convert_charset __P((charset_t, charset_t, charset_t, char *, size_t, char *, size_t, u_int16_t *)); - -extern size_t charset_precompose __P(( charset_t, char *, size_t, char *, size_t)); -extern size_t charset_decompose __P(( charset_t, char *, size_t, char *, size_t)); -extern size_t utf8_precompose __P(( char *, size_t, char *, size_t)); -extern size_t utf8_decompose __P(( char *, size_t, char *, size_t)); - -extern charset_t add_charset __P((char* name)); +extern void init_iconv (void); +extern size_t convert_string (charset_t, charset_t, void const *, size_t, void *, size_t); +extern size_t convert_string_allocate (charset_t, charset_t, void const *, size_t, char **); +extern size_t utf8_strupper (const char *, size_t, char *, size_t); +extern size_t utf8_strlower (const char *, size_t, char *, size_t); +extern size_t unix_strupper (const char *, size_t, char *, size_t); +extern size_t unix_strlower (const char *, size_t, char *, size_t); +extern size_t charset_strupper (charset_t, const char *, size_t, char *, size_t); +extern size_t charset_strlower (charset_t, const char *, size_t, char *, size_t); + +extern size_t charset_to_ucs2_allocate (charset_t, ucs2_t **dest, const char *src); +extern size_t charset_to_utf8_allocate (charset_t, char **dest, const char *src); +extern size_t ucs2_to_charset_allocate (charset_t, char **dest, const ucs2_t *src); +extern size_t utf8_to_charset_allocate (charset_t, char **dest, const char *src); +extern size_t ucs2_to_charset (charset_t, const ucs2_t *src, char *dest, size_t); + +extern size_t convert_charset (charset_t, charset_t, charset_t, char *, size_t, char *, size_t, u_int16_t *); + +extern size_t charset_precompose ( charset_t, char *, size_t, char *, size_t); +extern size_t charset_decompose ( charset_t, char *, size_t, char *, size_t); +extern size_t utf8_precompose ( char *, size_t, char *, size_t); +extern size_t utf8_decompose ( char *, size_t, char *, size_t); + +extern charset_t add_charset (char* name); diff --git a/include/atalk/util.h b/include/atalk/util.h index 4811b47d..736fab22 100644 --- a/include/atalk/util.h +++ b/include/atalk/util.h @@ -1,5 +1,5 @@ /* - * $Id: util.h,v 1.10 2009-10-02 09:32:40 franklahm Exp $ + * $Id: util.h,v 1.11 2009-10-13 22:55:37 didg Exp $ */ #ifndef _ATALK_UTIL_H @@ -19,10 +19,10 @@ #define EXITERR_SYS 3 /* local system error */ -extern int sys_ftruncate __P((int fd, off_t length)); +extern int sys_ftruncate (int fd, off_t length); #ifdef WITH_SENDFILE -extern ssize_t sys_sendfile __P((int __out_fd, int __in_fd, off_t *__offset,size_t __count)); +extern ssize_t sys_sendfile (int __out_fd, int __in_fd, off_t *__offset,size_t __count); #endif extern const int _diacasemap[], _dialowermap[]; @@ -32,27 +32,27 @@ extern void freeifacelist(char **); #define diatolower(x) _dialowermap[(unsigned char) (x)] #define diatoupper(x) _diacasemap[(unsigned char) (x)] -extern int atalk_aton __P((char *, struct at_addr *)); -extern void bprint __P((char *, int)); -extern int strdiacasecmp __P((const char *, const char *)); -extern int strndiacasecmp __P((const char *, const char *, size_t)); -extern pid_t server_lock __P((char * /*program*/, char * /*file*/, - int /*debug*/)); -extern void fault_setup __P((void (*fn)(void *))); +extern int atalk_aton (char *, struct at_addr *); +extern void bprint (char *, int); +extern int strdiacasecmp (const char *, const char *); +extern int strndiacasecmp (const char *, const char *, size_t); +extern pid_t server_lock (char * /*program*/, char * /*file*/, + int /*debug*/); +extern void fault_setup (void (*fn)(void *)); #define server_unlock(x) (unlink(x)) #ifndef HAVE_STRLCPY -size_t strlcpy __P((char *, const char *, size_t)); +size_t strlcpy (char *, const char *, size_t); #endif #ifndef HAVE_STRLCAT -size_t strlcat __P((char *, const char *, size_t)); +size_t strlcat (char *, const char *, size_t); #endif #ifndef HAVE_DLFCN_H -extern void *mod_open __P((const char *)); -extern void *mod_symbol __P((void *, const char *)); -extern void mod_close __P((void *)); +extern void *mod_open (const char *); +extern void *mod_symbol (void *, const char *); +extern void mod_close (void *); #define mod_error() "" #else /* ! HAVE_DLFCN_H */ #include @@ -75,7 +75,7 @@ extern void mod_close __P((void *)); #ifndef DLSYM_PREPEND_UNDERSCORE #define mod_symbol(a, b) dlsym(a, b) #else /* ! DLSYM_PREPEND_UNDERSCORE */ -extern void *mod_symbol __P((void *, const char *)); +extern void *mod_symbol (void *, const char *); #endif /* ! DLSYM_PREPEND_UNDERSCORE */ #define mod_error() dlerror() #define mod_close(a) dlclose(a) @@ -102,8 +102,8 @@ struct volinfo { int v_dbd_port; }; -extern int loadvolinfo __P((char *path, struct volinfo *vol)); -extern int vol_load_charsets __P(( struct volinfo *vol)); +extern int loadvolinfo (char *path, struct volinfo *vol); +extern int vol_load_charsets ( struct volinfo *vol); #endif /* 0 */ /* diff --git a/libatalk/adouble/ad_flush.c b/libatalk/adouble/ad_flush.c index c3500119..a9383315 100644 --- a/libatalk/adouble/ad_flush.c +++ b/libatalk/adouble/ad_flush.c @@ -1,5 +1,5 @@ /* - * $Id: ad_flush.c,v 1.11 2009-09-14 10:04:16 franklahm Exp $ + * $Id: ad_flush.c,v 1.12 2009-10-13 22:55:37 didg Exp $ * * Copyright (c) 1990,1991 Regents of The University of Michigan. * All Rights Reserved. @@ -168,8 +168,7 @@ int ad_rebuild_sfm_header(struct adouble *ad) } -int ad_flush( ad ) - struct adouble *ad; +int ad_flush( struct adouble *ad) { int len; @@ -195,9 +194,7 @@ int ad_flush( ad ) } /* use refcounts so that we don't have to re-establish fcntl locks. */ -int ad_close( ad, adflags ) - struct adouble *ad; - int adflags; +int ad_close( struct adouble *ad, int adflags) { int err = 0; diff --git a/libatalk/adouble/ad_open.c b/libatalk/adouble/ad_open.c index 6d9bf8f6..0b251664 100644 --- a/libatalk/adouble/ad_open.c +++ b/libatalk/adouble/ad_open.c @@ -1,5 +1,5 @@ /* - * $Id: ad_open.c,v 1.48 2009-10-02 09:32:41 franklahm Exp $ + * $Id: ad_open.c,v 1.49 2009-10-13 22:55:37 didg Exp $ * * Copyright (c) 1999 Adrian Sun (asun@u.washington.edu) * Copyright (c) 1990,1991 Regents of The University of Michigan. @@ -760,9 +760,7 @@ static int ad_header_sfm_read(struct adouble *ad, struct stat *hst) * FIXME: should do something for pathname > MAXPATHLEN */ char * -ad_path( path, adflags ) - const char *path; - int adflags; +ad_path( const char *path, int adflags) { static char pathbuf[ MAXPATHLEN + 1]; char c, *slash, buf[MAXPATHLEN + 1]; @@ -857,9 +855,7 @@ static int ad_mkrf_osx(char *path _U_) * */ char * -ad_path_sfm( path, adflags ) - const char *path; - int adflags; +ad_path_sfm( const char *path, int adflags) { static char pathbuf[ MAXPATHLEN + 1]; char c, *slash, buf[MAXPATHLEN + 1]; @@ -938,8 +934,7 @@ static int ad_mkrf_sfm(char *path) #define DEFMASK 07700 /* be conservative */ char -*ad_dir(path) - const char *path; +*ad_dir(const char *path) { static char modebuf[ MAXPATHLEN + 1]; char *slash; @@ -1051,9 +1046,7 @@ static int ad_mode_st(const char *path, int *mode, struct stat *stbuf) return access right of path parent directory */ int -ad_mode( path, mode ) - const char *path; - int mode; +ad_mode( const char *path, int mode) { struct stat stbuf; ad_mode_st(path, &mode, &stbuf); @@ -1064,9 +1057,7 @@ ad_mode( path, mode ) * Use mkdir() with mode bits taken from ad_mode(). */ int -ad_mkdir( path, mode ) - const char *path; - int mode; +ad_mkdir( const char *path, int mode) { int ret; int st_invalid; @@ -1194,10 +1185,7 @@ void ad_init(struct adouble *ad, int flags, int options) * It's not possible to open the header file O_RDONLY -- the read * will fail and return an error. this refcounts things now. */ -int ad_open( path, adflags, oflags, mode, ad ) - const char *path; - int adflags, oflags, mode; - struct adouble *ad; +int ad_open( const char *path, int adflags, int oflags, int mode, struct adouble *ad) { struct stat st_dir; struct stat st_meta; diff --git a/libatalk/adouble/ad_read.c b/libatalk/adouble/ad_read.c index 9991e3f0..19d6218f 100644 --- a/libatalk/adouble/ad_read.c +++ b/libatalk/adouble/ad_read.c @@ -1,5 +1,5 @@ /* - * $Id: ad_read.c,v 1.8 2009-09-11 13:26:05 franklahm Exp $ + * $Id: ad_read.c,v 1.9 2009-10-13 22:55:37 didg Exp $ * * Copyright (c) 1990,1991 Regents of The University of Michigan. * All Rights Reserved. @@ -59,12 +59,7 @@ ssize_t adf_pread(struct ad_fd *ad_fd, void *buf, size_t count, off_t offset) /* XXX: locks have to be checked before each stream of consecutive * ad_reads to prevent a denial in the middle from causing * problems. */ -ssize_t ad_read( ad, eid, off, buf, buflen) - struct adouble *ad; - const u_int32_t eid; - off_t off; - char *buf; - const size_t buflen; +ssize_t ad_read( struct adouble *ad, const u_int32_t eid, off_t off, char *buf, const size_t buflen) { ssize_t cc; diff --git a/libatalk/adouble/ad_write.c b/libatalk/adouble/ad_write.c index 1331ae04..db542cb1 100644 --- a/libatalk/adouble/ad_write.c +++ b/libatalk/adouble/ad_write.c @@ -1,5 +1,5 @@ /* - * $Id: ad_write.c,v 1.9 2006-09-29 09:39:16 didg Exp $ + * $Id: ad_write.c,v 1.10 2009-10-13 22:55:37 didg Exp $ * * Copyright (c) 1990,1995 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. @@ -47,13 +47,7 @@ ssize_t adf_pwrite(struct ad_fd *ad_fd, const void *buf, size_t count, off_t off } /* end is always 0 */ -ssize_t ad_write( ad, eid, off, end, buf, buflen ) - struct adouble *ad; - const u_int32_t eid; - off_t off; - const int end; - const char *buf; - const size_t buflen; +ssize_t ad_write(struct adouble *ad, const u_int32_t eid, off_t off, const int end, const char *buf, const size_t buflen) { struct stat st; ssize_t cc; @@ -151,9 +145,7 @@ char c = 0; } /* ------------------------ */ -int ad_rtruncate( ad, size ) - struct adouble *ad; - const off_t size; +int ad_rtruncate( struct adouble *ad, const off_t size) { if ( sys_ftruncate( ad_reso_fileno(ad), size + ad->ad_eid[ ADEID_RFORK ].ade_off ) < 0 ) { @@ -164,9 +156,7 @@ int ad_rtruncate( ad, size ) return 0; } -int ad_dtruncate(ad, size) - struct adouble *ad; - const off_t size; +int ad_dtruncate(struct adouble *ad, const off_t size) { if (sys_ftruncate(ad_data_fileno(ad), size) < 0) { return -1; diff --git a/libatalk/asp/asp_close.c b/libatalk/asp/asp_close.c index e3674167..61878259 100644 --- a/libatalk/asp/asp_close.c +++ b/libatalk/asp/asp_close.c @@ -1,5 +1,5 @@ /* - * $Id: asp_close.c,v 1.4 2001-06-29 14:14:46 rufustfirefly Exp $ + * $Id: asp_close.c,v 1.5 2009-10-13 22:55:37 didg Exp $ * * Copyright (c) 1990,1991 Regents of The University of Michigan. * All Rights Reserved. @@ -38,8 +38,7 @@ #include #include -int asp_close( asp ) - ASP asp; +int asp_close(ASP asp) { struct atp_block atpb; struct iovec iov[ 1 ]; diff --git a/libatalk/asp/asp_cmdreply.c b/libatalk/asp/asp_cmdreply.c index e2c8cf9a..f3a3fd1c 100644 --- a/libatalk/asp/asp_cmdreply.c +++ b/libatalk/asp/asp_cmdreply.c @@ -1,5 +1,5 @@ /* - * $Id: asp_cmdreply.c,v 1.4 2001-06-29 14:14:46 rufustfirefly Exp $ + * $Id: asp_cmdreply.c,v 1.5 2009-10-13 22:55:37 didg Exp $ * * Copyright (c) 1990,1991 Regents of The University of Michigan. * All Rights Reserved. @@ -39,9 +39,7 @@ #define memmove(a, b, n) bcopy((b), (a), (n)) #endif /* BSD || BSD4_3 */ -int asp_cmdreply( asp, result) - ASP asp; - int result; +int asp_cmdreply(ASP asp, int result) { struct iovec iov[ ASP_MAXPACKETS ]; struct atp_block atpb; diff --git a/libatalk/asp/asp_getsess.c b/libatalk/asp/asp_getsess.c index 3d04c5fd..51d87846 100644 --- a/libatalk/asp/asp_getsess.c +++ b/libatalk/asp/asp_getsess.c @@ -1,5 +1,5 @@ /* - * $Id: asp_getsess.c,v 1.8 2005-04-28 20:49:55 bfernhomberg Exp $ + * $Id: asp_getsess.c,v 1.9 2009-10-13 22:55:37 didg Exp $ * * Copyright (c) 1990,1996 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. @@ -60,7 +60,7 @@ static struct asp_child **asp_ac = NULL; * + space: if actual connections < potential * - space: actual connections ~ potential */ -static void tickle_handler() +static void tickle_handler(int sig _U_) { int sid; diff --git a/libatalk/asp/asp_init.c b/libatalk/asp/asp_init.c index ef8eaa70..06e77f04 100644 --- a/libatalk/asp/asp_init.c +++ b/libatalk/asp/asp_init.c @@ -1,5 +1,5 @@ /* - * $Id: asp_init.c,v 1.3 2001-06-29 14:14:46 rufustfirefly Exp $ + * $Id: asp_init.c,v 1.4 2009-10-13 22:55:37 didg Exp $ * * Copyright (c) 1990,1991 Regents of The University of Michigan. * All Rights Reserved. @@ -38,8 +38,7 @@ #include #include -ASP asp_init( atp ) - ATP atp; +ASP asp_init(ATP atp) { ASP asp; @@ -66,10 +65,7 @@ ASP asp_init( atp ) return( asp ); } -void asp_setstatus( asp, status, slen ) - ASP asp; - char *status; - const int slen; +void asp_setstatus(ASP asp, char *status, const int slen) { asp->asp_status = status; asp->asp_slen = slen; diff --git a/libatalk/asp/asp_shutdown.c b/libatalk/asp/asp_shutdown.c index 22cb214e..1f77e1f2 100644 --- a/libatalk/asp/asp_shutdown.c +++ b/libatalk/asp/asp_shutdown.c @@ -1,5 +1,5 @@ /* - * $Id: asp_shutdown.c,v 1.3 2001-06-29 14:14:46 rufustfirefly Exp $ + * $Id: asp_shutdown.c,v 1.4 2009-10-13 22:55:37 didg Exp $ * * Copyright (c) 1996 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. @@ -18,8 +18,7 @@ #include #include -int asp_shutdown( asp ) - ASP asp; +int asp_shutdown(ASP asp) { struct atp_block atpb; struct iovec iov; diff --git a/libatalk/atp/atp_bufs.c b/libatalk/atp/atp_bufs.c index 128736fb..9c899e23 100644 --- a/libatalk/atp/atp_bufs.c +++ b/libatalk/atp/atp_bufs.c @@ -1,5 +1,5 @@ /* - * $Id: atp_bufs.c,v 1.4 2001-06-29 14:14:46 rufustfirefly Exp $ + * $Id: atp_bufs.c,v 1.5 2009-10-13 22:55:37 didg Exp $ * * Copyright (c) 1990,1991 Regents of The University of Michigan. * All Rights Reserved. @@ -80,9 +80,7 @@ static int more_bufs(void) #ifdef EBUG -void atp_print_bufuse( ah, s ) - ATP ah; - char *s; +void atp_print_bufuse(ATP ah, char *s) { struct atpbuf *bp; int i, sentcount, incount, respcount; @@ -134,8 +132,7 @@ struct atpbuf *atp_alloc_buf(void) } -int atp_free_buf( bp ) - struct atpbuf *bp; +int atp_free_buf(struct atpbuf *bp) { if ( bp == NULL ) { return -1; diff --git a/libatalk/atp/atp_close.c b/libatalk/atp/atp_close.c index df03b02e..4d31b5f7 100644 --- a/libatalk/atp/atp_close.c +++ b/libatalk/atp/atp_close.c @@ -1,5 +1,5 @@ /* - * $Id: atp_close.c,v 1.4 2001-06-29 14:14:46 rufustfirefly Exp $ + * $Id: atp_close.c,v 1.5 2009-10-13 22:55:37 didg Exp $ * * Copyright (c) 1990,1997 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. @@ -22,8 +22,7 @@ #include #endif /* EBUG */ -int atp_close( ah ) - ATP ah; +int atp_close(ATP ah) { struct atpbuf *cq; int i; diff --git a/libatalk/atp/atp_internals.h b/libatalk/atp/atp_internals.h index 12160167..51d3b8b1 100644 --- a/libatalk/atp/atp_internals.h +++ b/libatalk/atp/atp_internals.h @@ -1,5 +1,5 @@ /* - * $Id: atp_internals.h,v 1.3 2001-08-15 02:17:57 srittau Exp $ + * $Id: atp_internals.h,v 1.4 2009-10-13 22:55:37 didg Exp $ * * Copyright (c) 1990,1991 Regents of The University of Michigan. * All Rights Reserved. @@ -39,23 +39,23 @@ #define ATP_TIDANY 0xffff /* in atp_bufs.c */ -extern struct atpbuf *atp_alloc_buf __P((void)); -extern void atp_print_bufuse __P((ATP, char *)); -extern int atp_free_buf __P((struct atpbuf *)); +extern struct atpbuf *atp_alloc_buf (void); +extern void atp_print_bufuse (ATP, char *); +extern int atp_free_buf (struct atpbuf *); /* in atp_packet.c */ -extern int at_addr_eq __P((struct sockaddr_at *, - struct sockaddr_at *)); -extern void atp_build_req_packet __P((struct atpbuf *, u_int16_t, - u_int8_t, struct atp_block *)); -extern void atp_build_resp_packet __P((struct atpbuf *, u_int16_t, +extern int at_addr_eq (struct sockaddr_at *, + struct sockaddr_at *); +extern void atp_build_req_packet (struct atpbuf *, u_int16_t, + u_int8_t, struct atp_block *); +extern void atp_build_resp_packet (struct atpbuf *, u_int16_t, u_int8_t, struct atp_block *, - u_int8_t)); -extern int atp_recv_atp __P((ATP, struct sockaddr_at *, + u_int8_t); +extern int atp_recv_atp (ATP, struct sockaddr_at *, u_int8_t *, u_int16_t, char *, - int)); + int); #ifdef EBUG -extern void atp_print_addr __P((char *, struct sockaddr_at *)); +extern void atp_print_addr (char *, struct sockaddr_at *); #endif /* EBUG */ #endif /* ATP_INTERNALS_H */ diff --git a/libatalk/atp/atp_packet.c b/libatalk/atp/atp_packet.c index 9659e008..a7fae01b 100644 --- a/libatalk/atp/atp_packet.c +++ b/libatalk/atp/atp_packet.c @@ -1,5 +1,5 @@ /* - * $Id: atp_packet.c,v 1.5 2002-01-17 06:08:55 srittau Exp $ + * $Id: atp_packet.c,v 1.6 2009-10-13 22:55:37 didg Exp $ * * Copyright (c) 1990,1991 Regents of The University of Michigan. * All Rights Reserved. @@ -52,8 +52,7 @@ #ifdef EBUG #include -static void print_func( ctrlinfo ) - u_int8_t ctrlinfo; +static void print_func(u_int8_t ctrlinfo) { switch ( ctrlinfo & ATP_FUNCMASK ) { case ATP_TREQ: @@ -73,9 +72,7 @@ static void print_func( ctrlinfo ) } } -static void dump_packet( buf, len ) - char *buf; - int len; +static void dump_packet(char *buf, int len) { int i; @@ -85,9 +82,7 @@ static void dump_packet( buf, len ) putchar( '\n' ); } -void atp_print_addr( s, saddr ) - char *s; - struct sockaddr_at *saddr; +void atp_print_addr(char *s, struct sockaddr_at *saddr) { printf( "%s ", s ); saddr->sat_family == AF_APPLETALK ? printf( "at." ) : @@ -315,9 +310,9 @@ atp_recv_atp( ATP ah, } -int at_addr_eq( paddr, saddr ) - struct sockaddr_at *paddr; /* primary address */ - struct sockaddr_at *saddr; /* secondary address */ +int at_addr_eq( + struct sockaddr_at *paddr, /* primary address */ + struct sockaddr_at *saddr) /* secondary address */ { /* compare two atalk addresses -- only check the non-zero fields of paddr against saddr. diff --git a/libatalk/atp/atp_rreq.c b/libatalk/atp/atp_rreq.c index 9e46efcf..6736dbd2 100644 --- a/libatalk/atp/atp_rreq.c +++ b/libatalk/atp/atp_rreq.c @@ -1,5 +1,5 @@ /* - * $Id: atp_rreq.c,v 1.3 2001-06-29 14:14:46 rufustfirefly Exp $ + * $Id: atp_rreq.c,v 1.4 2009-10-13 22:55:37 didg Exp $ * * Copyright (c) 1990,1991 Regents of The University of Michigan. * All Rights Reserved. @@ -43,9 +43,9 @@ /* wait for a tranasaction service request */ -int atp_rreq( ah, atpb ) - ATP ah; /* open atp handle */ - struct atp_block *atpb; /* parameter block */ +int atp_rreq( + ATP ah, /* open atp handle */ + struct atp_block *atpb) /* parameter block */ { struct atpbuf *req_buf; /* for receiving request packet */ struct atphdr req_hdr; /* request header overlay */ diff --git a/libatalk/atp/atp_rresp.c b/libatalk/atp/atp_rresp.c index 4ba76d10..ac0a146c 100644 --- a/libatalk/atp/atp_rresp.c +++ b/libatalk/atp/atp_rresp.c @@ -1,5 +1,5 @@ /* - * $Id: atp_rresp.c,v 1.5 2002-01-17 06:08:55 srittau Exp $ + * $Id: atp_rresp.c,v 1.6 2009-10-13 22:55:37 didg Exp $ * * Copyright (c) 1990,1991 Regents of The University of Michigan. * All Rights Reserved. @@ -46,9 +46,9 @@ #include "atp_internals.h" int -atp_rresp( ah, atpb ) - ATP ah; /* open atp handle */ - struct atp_block *atpb; /* parameter block */ +atp_rresp( + ATP ah, /* open atp handle */ + struct atp_block *atpb) /* parameter block */ { int i, rc; size_t len; diff --git a/libatalk/atp/atp_rsel.c b/libatalk/atp/atp_rsel.c index a48d038c..92f97868 100644 --- a/libatalk/atp/atp_rsel.c +++ b/libatalk/atp/atp_rsel.c @@ -1,5 +1,5 @@ /* - * $Id: atp_rsel.c,v 1.4 2002-01-17 06:08:55 srittau Exp $ + * $Id: atp_rsel.c,v 1.5 2009-10-13 22:55:37 didg Exp $ * * Copyright (c) 1990,1997 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. @@ -32,8 +32,7 @@ static int release_count = 0; int -resend_request( ah ) - ATP ah; +resend_request(ATP ah) { /* * update bitmap and send request packet @@ -72,10 +71,10 @@ resend_request( ah ) } int -atp_rsel( ah, faddr, func ) - ATP ah; /* open atp handle */ - struct sockaddr_at *faddr; /* address to receive from */ - int func; /* which function(s) to wait for; +atp_rsel( + ATP ah, /* open atp handle */ + struct sockaddr_at *faddr, /* address to receive from */ + int func) /* which function(s) to wait for; 0 means request or response */ { struct atpbuf *abuf, *pb, *cb; diff --git a/libatalk/atp/atp_sresp.c b/libatalk/atp/atp_sresp.c index 7b13bf4e..781760bb 100644 --- a/libatalk/atp/atp_sresp.c +++ b/libatalk/atp/atp_sresp.c @@ -1,5 +1,5 @@ /* - * $Id: atp_sresp.c,v 1.5 2005-04-28 20:49:56 bfernhomberg Exp $ + * $Id: atp_sresp.c,v 1.6 2009-10-13 22:55:37 didg Exp $ * * Copyright (c) 1990,1991 Regents of The University of Michigan. * All Rights Reserved. @@ -46,9 +46,9 @@ /* send a transaction response */ -int atp_sresp( ah, atpb ) - ATP ah; /* open atp handle */ - struct atp_block *atpb; /* parameter block */ +int atp_sresp( + ATP ah, /* open atp handle */ + struct atp_block *atpb) /* parameter block */ { int i; u_int8_t ctrlinfo; diff --git a/libatalk/cnid/cdb/cnid_cdb.h b/libatalk/cnid/cdb/cnid_cdb.h index e1fc8a58..311fba0d 100644 --- a/libatalk/cnid/cdb/cnid_cdb.h +++ b/libatalk/cnid/cdb/cnid_cdb.h @@ -16,37 +16,37 @@ /* cnid_open.c */ extern struct _cnid_module cnid_cdb_module; -extern struct _cnid_db *cnid_cdb_open __P((const char *, mode_t)); +extern struct _cnid_db *cnid_cdb_open (const char *, mode_t); /* cnid_close.c */ -extern void cnid_cdb_close __P((struct _cnid_db *)); +extern void cnid_cdb_close (struct _cnid_db *); /* cnid_add.c */ -extern cnid_t cnid_cdb_add __P((struct _cnid_db *, const struct stat *, const cnid_t, - char *, const size_t, cnid_t)); -extern int cnid_cdb_getstamp __P((struct _cnid_db *, void *, const size_t )); +extern cnid_t cnid_cdb_add (struct _cnid_db *, const struct stat *, const cnid_t, + char *, const size_t, cnid_t); +extern int cnid_cdb_getstamp (struct _cnid_db *, void *, const size_t ); /* cnid_get.c */ -extern cnid_t cnid_cdb_get __P((struct _cnid_db *, const cnid_t, char *, const size_t)); -extern char *cnid_cdb_resolve __P((struct _cnid_db *, cnid_t *, void *, size_t )); -extern cnid_t cnid_cdb_lookup __P((struct _cnid_db *, const struct stat *, const cnid_t, - char *, const size_t)); +extern cnid_t cnid_cdb_get (struct _cnid_db *, const cnid_t, char *, const size_t); +extern char *cnid_cdb_resolve (struct _cnid_db *, cnid_t *, void *, size_t ); +extern cnid_t cnid_cdb_lookup (struct _cnid_db *, const struct stat *, const cnid_t, + char *, const size_t); /* cnid_update.c */ -extern int cnid_cdb_update __P((struct _cnid_db *, const cnid_t, const struct stat *, - const cnid_t, char *, size_t)); +extern int cnid_cdb_update (struct _cnid_db *, const cnid_t, const struct stat *, + const cnid_t, char *, size_t); /* cnid_delete.c */ -extern int cnid_cdb_delete __P((struct _cnid_db *, const cnid_t)); +extern int cnid_cdb_delete (struct _cnid_db *, const cnid_t); /* cnid_nextid.c */ -extern cnid_t cnid_cdb_nextid __P((struct _cnid_db *)); +extern cnid_t cnid_cdb_nextid (struct _cnid_db *); -extern int cnid_cdb_lock __P((void *)); -extern int cnid_cdb_unlock __P((void *)); +extern int cnid_cdb_lock (void *); +extern int cnid_cdb_unlock (void *); -extern cnid_t cnid_cdb_rebuild_add __P((struct _cnid_db *, const struct stat *, - const cnid_t, char *, const size_t, cnid_t)); +extern cnid_t cnid_cdb_rebuild_add (struct _cnid_db *, const struct stat *, + const cnid_t, char *, const size_t, cnid_t); #endif /* include/atalk/cnid_cdb.h */ diff --git a/libatalk/cnid/cdb/cnid_cdb_open.c b/libatalk/cnid/cdb/cnid_cdb_open.c index f645574d..0a00ec59 100644 --- a/libatalk/cnid/cdb/cnid_cdb_open.c +++ b/libatalk/cnid/cdb/cnid_cdb_open.c @@ -1,6 +1,6 @@ /* - * $Id: cnid_cdb_open.c,v 1.2 2005-04-28 20:49:59 bfernhomberg Exp $ + * $Id: cnid_cdb_open.c,v 1.3 2009-10-13 22:55:37 didg Exp $ * * Copyright (c) 1999. Adrian Sun (asun@zoology.washington.edu) * All Rights Reserved. See COPYRIGHT. @@ -85,10 +85,7 @@ static int my_yield(void) } /* --------------- */ -static int didname(dbp, pkey, pdata, skey) -DB *dbp _U_; -const DBT *pkey _U_, *pdata; -DBT *skey; +static int didname(DB *dbp _U_, const DBT *pkey _U_, const DBT *pdata, DBT *skey) { int len; @@ -100,10 +97,7 @@ int len; } /* --------------- */ -static int devino(dbp, pkey, pdata, skey) -DB *dbp _U_; -const DBT *pkey _U_, *pdata; -DBT *skey; +static int devino(DB *dbp _U_, const DBT *pkey _U_, const DBT *pdata, DBT *skey) { memset(skey, 0, sizeof(DBT)); skey->data = (char *)pdata->data + CNID_DEVINO_OFS; diff --git a/libatalk/cnid/cdb/cnid_cdb_private.h b/libatalk/cnid/cdb/cnid_cdb_private.h index 35dc39e2..4a655580 100644 --- a/libatalk/cnid/cdb/cnid_cdb_private.h +++ b/libatalk/cnid/cdb/cnid_cdb_private.h @@ -1,5 +1,5 @@ /* - * $Id: cnid_cdb_private.h,v 1.4 2008-12-03 18:35:44 didg Exp $ + * $Id: cnid_cdb_private.h,v 1.5 2009-10-13 22:55:37 didg Exp $ */ #ifndef LIBATALK_CDB_PRIVATE_H @@ -169,7 +169,7 @@ typedef struct CNID_private { */ /* construct db_cnid data. NOTE: this is not re-entrant. */ -extern unsigned char *make_cnid_data __P((const struct stat *,const cnid_t , - const char *, const size_t )); +extern unsigned char *make_cnid_data (const struct stat *,const cnid_t , + const char *, const size_t ); #endif /* atalk/cnid/cnid_private.h */ diff --git a/libatalk/cnid/cnid_init.c b/libatalk/cnid/cnid_init.c index b1bfc597..7cc108d3 100644 --- a/libatalk/cnid/cnid_init.c +++ b/libatalk/cnid/cnid_init.c @@ -1,6 +1,6 @@ /* - * $Id: cnid_init.c,v 1.2 2005-04-28 20:49:58 bfernhomberg Exp $ + * $Id: cnid_init.c,v 1.3 2009-10-13 22:55:37 didg Exp $ * * Copyright (c) 2003 the Netatalk Team * Copyright (c) 2003 Rafal Lewczuk @@ -57,7 +57,7 @@ extern struct _cnid_module cnid_dbd_module; extern struct _cnid_module cnid_tdb_module; #endif -void cnid_init() +void cnid_init(void) { #ifdef CNID_BACKEND_DB3 cnid_register(&cnid_db3_module); diff --git a/libatalk/cnid/db3/cnid_db3.h b/libatalk/cnid/db3/cnid_db3.h index 1b01ebe0..2b0a0516 100644 --- a/libatalk/cnid/db3/cnid_db3.h +++ b/libatalk/cnid/db3/cnid_db3.h @@ -53,33 +53,33 @@ static int db3_txn_commit(DB_TXN *db_txn, u_int32_t flags) cnid_open.c */ extern struct _cnid_module cnid_db3_module; -extern struct _cnid_db *cnid_db3_open __P((const char *, mode_t)); +extern struct _cnid_db *cnid_db3_open (const char *, mode_t); /* cnid_close.c */ -extern void cnid_db3_close __P((struct _cnid_db *)); +extern void cnid_db3_close (struct _cnid_db *); /* cnid_add.c */ -extern cnid_t cnid_db3_add __P((struct _cnid_db *, const struct stat *, const cnid_t, - char *, const size_t, cnid_t)); +extern cnid_t cnid_db3_add (struct _cnid_db *, const struct stat *, const cnid_t, + char *, const size_t, cnid_t); /* cnid_get.c */ -extern cnid_t cnid_db3_get __P((struct _cnid_db *, const cnid_t, char *, const size_t)); -extern char *cnid_db3_resolve __P((struct _cnid_db *, cnid_t *, void *, size_t )); -extern cnid_t cnid_db3_lookup __P((struct _cnid_db *, const struct stat *, const cnid_t, - char *, const size_t)); +extern cnid_t cnid_db3_get (struct _cnid_db *, const cnid_t, char *, const size_t); +extern char *cnid_db3_resolve (struct _cnid_db *, cnid_t *, void *, size_t ); +extern cnid_t cnid_db3_lookup (struct _cnid_db *, const struct stat *, const cnid_t, + char *, const size_t); /* cnid_update.c */ -extern int cnid_db3_update __P((struct _cnid_db *, const cnid_t, const struct stat *, - const cnid_t, char *, size_t)); +extern int cnid_db3_update (struct _cnid_db *, const cnid_t, const struct stat *, + const cnid_t, char *, size_t); /* cnid_delete.c */ -extern int cnid_db3_delete __P((struct _cnid_db *, const cnid_t)); +extern int cnid_db3_delete (struct _cnid_db *, const cnid_t); /* cnid_nextid.c */ -extern cnid_t cnid_db3_nextid __P((struct _cnid_db *)); +extern cnid_t cnid_db3_nextid (struct _cnid_db *); -extern int cnid_db3_lock __P((void *)); -extern int cnid_db3_unlock __P((void *)); +extern int cnid_db3_lock (void *); +extern int cnid_db3_unlock (void *); #endif /* include/atalk/cnid_db3.h */ diff --git a/libatalk/cnid/dbd/cnid_dbd.h b/libatalk/cnid/dbd/cnid_dbd.h index e32f1edd..fed486eb 100644 --- a/libatalk/cnid/dbd/cnid_dbd.h +++ b/libatalk/cnid/dbd/cnid_dbd.h @@ -1,5 +1,5 @@ /* - * $Id: cnid_dbd.h,v 1.3 2005-05-03 14:55:14 didg Exp $ + * $Id: cnid_dbd.h,v 1.4 2009-10-13 22:55:37 didg Exp $ * * Copyright (C) Joerg Lenneis 2003 * All Rights Reserved. See COPYING. @@ -18,20 +18,20 @@ #include extern struct _cnid_module cnid_dbd_module; -extern struct _cnid_db *cnid_dbd_open __P((const char *, mode_t)); -extern void cnid_dbd_close __P((struct _cnid_db *)); -extern cnid_t cnid_dbd_add __P((struct _cnid_db *, const struct stat *, const cnid_t, - char *, const size_t, cnid_t)); -extern cnid_t cnid_dbd_get __P((struct _cnid_db *, const cnid_t, char *, const size_t)); -extern char *cnid_dbd_resolve __P((struct _cnid_db *, cnid_t *, void *, size_t )); -extern int cnid_dbd_getstamp __P((struct _cnid_db *, void *, const size_t )); -extern cnid_t cnid_dbd_lookup __P((struct _cnid_db *, const struct stat *, const cnid_t, - char *, const size_t)); -extern int cnid_dbd_update __P((struct _cnid_db *, const cnid_t, const struct stat *, - const cnid_t, char *, size_t)); -extern int cnid_dbd_delete __P((struct _cnid_db *, const cnid_t)); -extern cnid_t cnid_dbd_rebuild_add __P((struct _cnid_db *, const struct stat *, - const cnid_t, char *, const size_t, cnid_t)); +extern struct _cnid_db *cnid_dbd_open (const char *, mode_t); +extern void cnid_dbd_close (struct _cnid_db *); +extern cnid_t cnid_dbd_add (struct _cnid_db *, const struct stat *, const cnid_t, + char *, const size_t, cnid_t); +extern cnid_t cnid_dbd_get (struct _cnid_db *, const cnid_t, char *, const size_t); +extern char *cnid_dbd_resolve (struct _cnid_db *, cnid_t *, void *, size_t ); +extern int cnid_dbd_getstamp (struct _cnid_db *, void *, const size_t ); +extern cnid_t cnid_dbd_lookup (struct _cnid_db *, const struct stat *, const cnid_t, + char *, const size_t); +extern int cnid_dbd_update (struct _cnid_db *, const cnid_t, const struct stat *, + const cnid_t, char *, size_t); +extern int cnid_dbd_delete (struct _cnid_db *, const cnid_t); +extern cnid_t cnid_dbd_rebuild_add (struct _cnid_db *, const struct stat *, + const cnid_t, char *, const size_t, cnid_t); /* FIXME: These functions could be static in cnid_dbd.c */ diff --git a/libatalk/cnid/hash/cnid_hash.h b/libatalk/cnid/hash/cnid_hash.h index f27ef1c2..a3f8e4b8 100644 --- a/libatalk/cnid/hash/cnid_hash.h +++ b/libatalk/cnid/hash/cnid_hash.h @@ -40,28 +40,28 @@ struct _cnid_hash_private { /* cnid_open.c */ extern struct _cnid_module cnid_hash_module; -extern struct _cnid_db *cnid_hash_open __P((const char *, mode_t)); +extern struct _cnid_db *cnid_hash_open (const char *, mode_t); /* cnid_close.c */ -extern void cnid_hash_close __P((struct _cnid_db *)); +extern void cnid_hash_close (struct _cnid_db *); /* cnid_add.c */ -extern cnid_t cnid_hash_add __P((struct _cnid_db *, const struct stat *, const cnid_t, - char *, const int, cnid_t)); +extern cnid_t cnid_hash_add (struct _cnid_db *, const struct stat *, const cnid_t, + char *, const int, cnid_t); /* cnid_get.c */ -extern cnid_t cnid_hash_get __P((struct _cnid_db *, const cnid_t, char *, const int)); -extern char *cnid_hash_resolve __P((struct _cnid_db *, cnid_t *, void *, u_int32_t)); -extern cnid_t cnid_hash_lookup __P((struct _cnid_db *, const struct stat *, const cnid_t, char *, const int)); +extern cnid_t cnid_hash_get (struct _cnid_db *, const cnid_t, char *, const int); +extern char *cnid_hash_resolve (struct _cnid_db *, cnid_t *, void *, u_int32_t); +extern cnid_t cnid_hash_lookup (struct _cnid_db *, const struct stat *, const cnid_t, char *, const int); /* cnid_update.c */ -extern int cnid_hash_update __P((struct _cnid_db *, const cnid_t, const struct stat *, - const cnid_t, char *, int)); +extern int cnid_hash_update (struct _cnid_db *, const cnid_t, const struct stat *, + const cnid_t, char *, int); /* cnid_delete.c */ -extern int cnid_hash_delete __P((struct _cnid_db *, const cnid_t)); +extern int cnid_hash_delete (struct _cnid_db *, const cnid_t); /* cnid_nextid.c */ -extern cnid_t cnid_hash_nextid __P((struct _cnid_db *)); +extern cnid_t cnid_hash_nextid (struct _cnid_db *); #endif /* include/atalk/cnid_hash.h */ diff --git a/libatalk/cnid/last/cnid_last.h b/libatalk/cnid/last/cnid_last.h index 33f561e1..45f6d3b5 100644 --- a/libatalk/cnid/last/cnid_last.h +++ b/libatalk/cnid/last/cnid_last.h @@ -20,15 +20,15 @@ struct _cnid_last_private { }; extern struct _cnid_module cnid_last_module; -extern struct _cnid_db *cnid_last_open __P((const char *, mode_t)); -extern void cnid_last_close __P((struct _cnid_db *)); -extern cnid_t cnid_last_add __P((struct _cnid_db *, const struct stat *, const cnid_t, - char *, const size_t, cnid_t)); -extern cnid_t cnid_last_get __P((struct _cnid_db *, const cnid_t, char *, const size_t)); -extern char *cnid_last_resolve __P((struct _cnid_db *, cnid_t *, void *, size_t)); -extern cnid_t cnid_last_lookup __P((struct _cnid_db *, const struct stat *, const cnid_t, char *, const size_t)); -extern int cnid_last_update __P((struct _cnid_db *, const cnid_t, const struct stat *, - const cnid_t, char *, size_t)); -extern int cnid_last_delete __P((struct _cnid_db *, const cnid_t)); +extern struct _cnid_db *cnid_last_open (const char *, mode_t); +extern void cnid_last_close (struct _cnid_db *); +extern cnid_t cnid_last_add (struct _cnid_db *, const struct stat *, const cnid_t, + char *, const size_t, cnid_t); +extern cnid_t cnid_last_get (struct _cnid_db *, const cnid_t, char *, const size_t); +extern char *cnid_last_resolve (struct _cnid_db *, cnid_t *, void *, size_t); +extern cnid_t cnid_last_lookup (struct _cnid_db *, const struct stat *, const cnid_t, char *, const size_t); +extern int cnid_last_update (struct _cnid_db *, const cnid_t, const struct stat *, + const cnid_t, char *, size_t); +extern int cnid_last_delete (struct _cnid_db *, const cnid_t); #endif /* include/atalk/cnid_last.h */ diff --git a/libatalk/cnid/mtab/cnid_mtab.h b/libatalk/cnid/mtab/cnid_mtab.h index 27d2a7b3..28fe05cf 100644 --- a/libatalk/cnid/mtab/cnid_mtab.h +++ b/libatalk/cnid/mtab/cnid_mtab.h @@ -17,15 +17,15 @@ extern struct _cnid_module cnid_mtab_module; -extern struct _cnid_db *cnid_mtab_open __P((const char *, mode_t)); -extern void cnid_mtab_close __P((struct _cnid_db *)); -extern cnid_t cnid_mtab_add __P((struct _cnid_db *, const struct stat *, const cnid_t, - char *, const int, cnid_t)); -extern cnid_t cnid_mtab_get __P((struct _cnid_db *, const cnid_t, char *, const int)); -extern char *cnid_mtab_resolve __P((struct _cnid_db *, cnid_t *, void *, u_int32_t)); -extern cnid_t cnid_mtab_lookup __P((struct _cnid_db *, const struct stat *, const cnid_t, char *, const int)); -extern int cnid_mtab_update __P((struct _cnid_db *, const cnid_t, const struct stat *, - const cnid_t, char *, int)); -extern int cnid_mtab_delete __P((struct _cnid_db *, const cnid_t)); +extern struct _cnid_db *cnid_mtab_open (const char *, mode_t); +extern void cnid_mtab_close (struct _cnid_db *); +extern cnid_t cnid_mtab_add (struct _cnid_db *, const struct stat *, const cnid_t, + char *, const int, cnid_t); +extern cnid_t cnid_mtab_get (struct _cnid_db *, const cnid_t, char *, const int); +extern char *cnid_mtab_resolve (struct _cnid_db *, cnid_t *, void *, u_int32_t); +extern cnid_t cnid_mtab_lookup (struct _cnid_db *, const struct stat *, const cnid_t, char *, const int); +extern int cnid_mtab_update (struct _cnid_db *, const cnid_t, const struct stat *, + const cnid_t, char *, int); +extern int cnid_mtab_delete (struct _cnid_db *, const cnid_t); #endif /* include/atalk/cnid_mtab.h */ diff --git a/libatalk/cnid/tdb/cnid_tdb.h b/libatalk/cnid/tdb/cnid_tdb.h index f361f5e2..a9fa7628 100644 --- a/libatalk/cnid/tdb/cnid_tdb.h +++ b/libatalk/cnid/tdb/cnid_tdb.h @@ -63,29 +63,29 @@ struct _cnid_tdb_private { /* cnid_open.c */ extern struct _cnid_module cnid_tdb_module; -extern struct _cnid_db *cnid_tdb_open __P((const char *, mode_t)); +extern struct _cnid_db *cnid_tdb_open (const char *, mode_t); /* cnid_close.c */ -extern void cnid_tdb_close __P((struct _cnid_db *)); +extern void cnid_tdb_close (struct _cnid_db *); /* cnid_add.c */ -extern cnid_t cnid_tdb_add __P((struct _cnid_db *, const struct stat *, const cnid_t, - char *, const size_t, cnid_t)); +extern cnid_t cnid_tdb_add (struct _cnid_db *, const struct stat *, const cnid_t, + char *, const size_t, cnid_t); /* cnid_get.c */ -extern cnid_t cnid_tdb_get __P((struct _cnid_db *, const cnid_t, char *, const size_t)); -extern char *cnid_tdb_resolve __P((struct _cnid_db *, cnid_t *, void *, size_t)); -extern cnid_t cnid_tdb_lookup __P((struct _cnid_db *, const struct stat *, const cnid_t, char *, const size_t)); +extern cnid_t cnid_tdb_get (struct _cnid_db *, const cnid_t, char *, const size_t); +extern char *cnid_tdb_resolve (struct _cnid_db *, cnid_t *, void *, size_t); +extern cnid_t cnid_tdb_lookup (struct _cnid_db *, const struct stat *, const cnid_t, char *, const size_t); /* cnid_update.c */ -extern int cnid_tdb_update __P((struct _cnid_db *, const cnid_t, const struct stat *, - const cnid_t, char *, size_t)); +extern int cnid_tdb_update (struct _cnid_db *, const cnid_t, const struct stat *, + const cnid_t, char *, size_t); /* cnid_delete.c */ -extern int cnid_tdb_delete __P((struct _cnid_db *, const cnid_t)); +extern int cnid_tdb_delete (struct _cnid_db *, const cnid_t); /* cnid_nextid.c */ -extern cnid_t cnid_tdb_nextid __P((struct _cnid_db *)); +extern cnid_t cnid_tdb_nextid (struct _cnid_db *); /* construct db_cnid data. NOTE: this is not re-entrant. */ static inline char *make_tdb_data(const struct stat *st, diff --git a/libatalk/dsi/dsi_private.h b/libatalk/dsi/dsi_private.h index a0a589e0..ac16cb68 100644 --- a/libatalk/dsi/dsi_private.h +++ b/libatalk/dsi/dsi_private.h @@ -1,5 +1,5 @@ /* - * $Id: dsi_private.h,v 1.2 2001-06-29 14:14:46 rufustfirefly Exp $ + * $Id: dsi_private.h,v 1.3 2009-10-13 22:55:37 didg Exp $ * * Copyright (c) 1997 Adrian Sun (asun@zoology.washington.edu) * All rights reserved. See COPYRIGHT. @@ -17,9 +17,9 @@ #include #include -extern int dsi_tcp_init __P((DSI *, const char * /*host*/, +extern int dsi_tcp_init (DSI *, const char * /*host*/, const char * /*address*/, const u_int16_t /*port*/, - const int /*proxy*/)); + const int /*proxy*/); #endif /* _DSI_PRIVATE_H */ diff --git a/libatalk/dsi/dsi_tcp.c b/libatalk/dsi/dsi_tcp.c index 7653c6f9..5f6b6eb4 100644 --- a/libatalk/dsi/dsi_tcp.c +++ b/libatalk/dsi/dsi_tcp.c @@ -1,5 +1,5 @@ /* - * $Id: dsi_tcp.c,v 1.14 2009-09-14 00:02:21 didg Exp $ + * $Id: dsi_tcp.c,v 1.15 2009-10-13 22:55:37 didg Exp $ * * Copyright (c) 1997, 1998 Adrian Sun (asun@zoology.washington.edu) * All rights reserved. See COPYRIGHT. @@ -87,7 +87,7 @@ static void dsi_tcp_close(DSI *dsi) } /* alarm handler for tcp_open */ -static void timeout_handler() +static void timeout_handler(int sig _U_) { LOG(log_error, logtype_default, "dsi_tcp_open: connection timed out"); exit(EXITERR_CLNT); diff --git a/libatalk/nbp/nbp_conf.h b/libatalk/nbp/nbp_conf.h index c7bd4035..66029a65 100644 --- a/libatalk/nbp/nbp_conf.h +++ b/libatalk/nbp/nbp_conf.h @@ -1,5 +1,5 @@ /* - * $Id: nbp_conf.h,v 1.2 2001-06-29 14:14:46 rufustfirefly Exp $ + * $Id: nbp_conf.h,v 1.3 2009-10-13 22:55:37 didg Exp $ * * Copyright (c) 1990,1991 Regents of The University of Michigan. * All Rights Reserved. @@ -35,7 +35,7 @@ extern u_char nbp_port; extern unsigned char nbp_id; -int nbp_parse __P((char *, struct nbpnve *, int)); -int nbp_match __P((struct nbpnve *, struct nbpnve *, int)); +int nbp_parse (char *, struct nbpnve *, int); +int nbp_match (struct nbpnve *, struct nbpnve *, int); #endif /* NBP_CONF_H */ diff --git a/libatalk/nbp/nbp_lkup.c b/libatalk/nbp/nbp_lkup.c index d3920ff3..6a991267 100644 --- a/libatalk/nbp/nbp_lkup.c +++ b/libatalk/nbp/nbp_lkup.c @@ -1,5 +1,5 @@ /* - * $Id: nbp_lkup.c,v 1.4 2002-01-17 06:12:02 srittau Exp $ + * $Id: nbp_lkup.c,v 1.5 2009-10-13 22:55:37 didg Exp $ * * Copyright (c) 1990,1997 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. @@ -37,11 +37,9 @@ #define SOCKLEN_T unsigned int #endif /* ! SOCKLEN_T */ -int nbp_lookup( obj, type, zone, nn, nncnt, ataddr ) - const char *obj, *type, *zone; - struct nbpnve *nn; - int nncnt; - const struct at_addr *ataddr; +int nbp_lookup( const char *obj, const char *type, const char *zone, struct nbpnve *nn, + int nncnt, + const struct at_addr *ataddr) { struct sockaddr_at addr, from; struct timeval tv, tv_begin, tv_end; diff --git a/libatalk/nbp/nbp_rgstr.c b/libatalk/nbp/nbp_rgstr.c index b9bc091d..cf5ee999 100644 --- a/libatalk/nbp/nbp_rgstr.c +++ b/libatalk/nbp/nbp_rgstr.c @@ -1,5 +1,5 @@ /* - * $Id: nbp_rgstr.c,v 1.4 2002-01-17 06:12:02 srittau Exp $ + * $Id: nbp_rgstr.c,v 1.5 2009-10-13 22:55:37 didg Exp $ * * Copyright (c) 1990,1993 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. @@ -34,9 +34,7 @@ #define SOCKLEN_T unsigned int #endif /* ! SOCKLEN_T */ -int nbp_rgstr( sat, obj, type, zone ) - struct sockaddr_at *sat; - const char *obj, *type, *zone; +int nbp_rgstr( struct sockaddr_at *sat, const char *obj, const char *type, const char *zone) { struct sockaddr_at to; struct nbpnve nn; diff --git a/libatalk/nbp/nbp_unrgstr.c b/libatalk/nbp/nbp_unrgstr.c index 5aa4a4b7..9a2169b2 100644 --- a/libatalk/nbp/nbp_unrgstr.c +++ b/libatalk/nbp/nbp_unrgstr.c @@ -1,5 +1,5 @@ /* - * $Id: nbp_unrgstr.c,v 1.4 2002-01-17 06:12:02 srittau Exp $ + * $Id: nbp_unrgstr.c,v 1.5 2009-10-13 22:55:37 didg Exp $ * * Copyright (c) 1990,1997 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. @@ -34,9 +34,7 @@ #define SOCKLEN_T unsigned int #endif /* ! SOCKLEN_T */ -int nbp_unrgstr( obj, type, zone, addr ) - const char *obj, *type, *zone; - const struct at_addr *addr; +int nbp_unrgstr(const char *obj,const char *type,const char *zone, const struct at_addr *addr) { struct sockaddr_at to; struct nbphdr nh; diff --git a/libatalk/nbp/nbp_util.c b/libatalk/nbp/nbp_util.c index ba201b1d..4cbea4b9 100644 --- a/libatalk/nbp/nbp_util.c +++ b/libatalk/nbp/nbp_util.c @@ -1,5 +1,5 @@ /* - * $Id: nbp_util.c,v 1.4 2002-01-17 06:12:02 srittau Exp $ + * $Id: nbp_util.c,v 1.5 2009-10-13 22:55:37 didg Exp $ * * Copyright (c) 1990,1997 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. @@ -35,10 +35,7 @@ char nbp_recv[ 1024 ]; u_char nbp_port = 0; unsigned char nbp_id = 0; -int nbp_parse( data, nn, len ) - char *data; - struct nbpnve *nn; - int len; +int nbp_parse(char *data, struct nbpnve *nn, int len) { struct nbptuple nt; @@ -96,9 +93,7 @@ int nbp_parse( data, nn, len ) #define NBPM_TYPE (1<<2) #define NBPM_ZONE (1<<3) -int nbp_match( n1, n2, flags ) - struct nbpnve *n1, *n2; - int flags; +int nbp_match(struct nbpnve *n1, struct nbpnve *n2, int flags) { int match = 0; @@ -137,9 +132,7 @@ int nbp_match( n1, n2, flags ) return( 1 ); } -int nbp_name( name, objp, typep, zonep ) - const char *name; - char **objp, **typep, **zonep; +int nbp_name(const char *name, char **objp,char **typep,char **zonep) { static char buf[ 32 + 1 + 32 + 1 + 32 + 1 ]; char *p; diff --git a/libatalk/unicode/charsets/generic_cjk.h b/libatalk/unicode/charsets/generic_cjk.h index 1f9e2086..8c6cbaaf 100644 --- a/libatalk/unicode/charsets/generic_cjk.h +++ b/libatalk/unicode/charsets/generic_cjk.h @@ -29,14 +29,14 @@ typedef struct { const u_int16_t (*summary)[2]; } cjk_index_t; -extern size_t cjk_generic_push __P((size_t (*)(u_int8_t*, const ucs2_t*, size_t*), - void*, char**, size_t*, char**, size_t*)); -extern size_t cjk_generic_pull __P((size_t (*)(ucs2_t*, const u_int8_t*, size_t*), - void*, char**, size_t*, char**, size_t*)); +extern size_t cjk_generic_push (size_t (*)(u_int8_t*, const ucs2_t*, size_t*), + void*, char**, size_t*, char**, size_t*); +extern size_t cjk_generic_pull (size_t (*)(ucs2_t*, const u_int8_t*, size_t*), + void*, char**, size_t*, char**, size_t*); -extern size_t cjk_char_push __P((u_int16_t, u_int8_t*)); -extern size_t cjk_char_pull __P((ucs2_t, ucs2_t*, const u_int32_t*)); +extern size_t cjk_char_push (u_int16_t, u_int8_t*); +extern size_t cjk_char_pull (ucs2_t, ucs2_t*, const u_int32_t*); -extern u_int16_t cjk_lookup __P((u_int16_t, const cjk_index_t*, const u_int16_t*)); -extern ucs2_t cjk_compose __P((ucs2_t, ucs2_t, const u_int32_t*, size_t)); -extern ucs2_t cjk_compose_seq __P((const ucs2_t*, size_t*, const u_int32_t*, size_t)); +extern u_int16_t cjk_lookup (u_int16_t, const cjk_index_t*, const u_int16_t*); +extern ucs2_t cjk_compose (ucs2_t, ucs2_t, const u_int32_t*, size_t); +extern ucs2_t cjk_compose_seq (const ucs2_t*, size_t*, const u_int32_t*, size_t); diff --git a/libatalk/util/atalk_addr.c b/libatalk/util/atalk_addr.c index 769d4e68..751c68e0 100644 --- a/libatalk/util/atalk_addr.c +++ b/libatalk/util/atalk_addr.c @@ -26,9 +26,7 @@ * 0's. This means that we can't support octal addressing. */ -int atalk_aton( cp, addr ) - char *cp; - struct at_addr *addr; +int atalk_aton(char *cp, struct at_addr *addr) { u_int32_t val, base, n; char c; diff --git a/libatalk/util/getiface.c b/libatalk/util/getiface.c index 33947de7..05af80b1 100644 --- a/libatalk/util/getiface.c +++ b/libatalk/util/getiface.c @@ -117,7 +117,7 @@ static int getifaces(const int sockfd, char ***list) * Get interfaces from the kernel. we keep an extra null entry to signify * the end of the interface list. */ -char **getifacelist() +char **getifacelist(void) { char **list = NULL; /* FIXME */ int i, fd; diff --git a/libatalk/util/logger.c b/libatalk/util/logger.c index 30cc4739..7aef01a6 100644 --- a/libatalk/util/logger.c +++ b/libatalk/util/logger.c @@ -346,7 +346,7 @@ void syslog_setup(int loglevel, enum logtypes logtype _U_, arr_loglevel_strings[loglevel]); } -void log_close() +void log_close(void) { } -- 2.39.2