From: didg Date: Wed, 14 Oct 2009 01:38:28 +0000 (+0000) Subject: remove most sparse warning 'symbol 'xxx' was not declared. Should it be static?' X-Git-Tag: before-ipv6~107 X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?p=netatalk.git;a=commitdiff_plain;h=008eac9cd4113c38090c803b1236335158fcc64c;ds=sidebyside remove most sparse warning 'symbol 'xxx' was not declared. Should it be static?' --- diff --git a/bin/adv1tov2/adv1tov2.c b/bin/adv1tov2/adv1tov2.c index 987599b9..d4a66fba 100644 --- a/bin/adv1tov2/adv1tov2.c +++ b/bin/adv1tov2/adv1tov2.c @@ -1,5 +1,5 @@ /* - * $Id: adv1tov2.c,v 1.4 2005-04-28 20:49:18 bfernhomberg Exp $ + * $Id: adv1tov2.c,v 1.5 2009-10-14 01:38:28 didg Exp $ * v1tov2: given a root directory, run down and convert all the * files/directories into appledouble v2. */ @@ -76,7 +76,7 @@ char *fullpathname(const char *name) #define MAXDESCEND 0xFFFF /* recursively descend subdirectories. * oh the stack space we use up! */ -void descend(DIR *dp) +static void descend(DIR *dp) { DIR *dpnew; struct dirent *de; diff --git a/bin/aecho/aecho.c b/bin/aecho/aecho.c index e1210e66..274421b5 100644 --- a/bin/aecho/aecho.c +++ b/bin/aecho/aecho.c @@ -1,5 +1,5 @@ /* - * $Id: aecho.c,v 1.8 2009-10-13 22:55:36 didg Exp $ + * $Id: aecho.c,v 1.9 2009-10-14 01:38:28 didg Exp $ * * Copyright (c) 1990,1991 Regents of The University of Michigan. * All Rights Reserved. @@ -59,15 +59,15 @@ #define SOCKLEN_T unsigned int #endif /* ! SOCKLEN_T */ -struct sockaddr_at target; -int sock; -unsigned int nsent = 0, nrecv = 0; -time_t totalms = 0, minms = -1, maxms = -1; -unsigned int pings = 0; +static struct sockaddr_at target; +static int sock; +static unsigned int nsent = 0, nrecv = 0; +static time_t totalms = 0, minms = -1, maxms = -1; +static unsigned int pings = 0; -void usage(char *); +static void usage(char *); -void done(int sig _U_) +static void done(int sig _U_) { if ( nsent) { printf( "\n----%d.%d AEP Statistics----\n", @@ -82,7 +82,7 @@ void done(int sig _U_) exit( 0 ); } -void aep_send(int sig _U_) +static void aep_send(int sig _U_) { struct timeval tv; char *p, buf[ 1024 ]; @@ -257,7 +257,7 @@ int main(int ac, char **av) } } -void usage( char * av0 ) +static void usage( char * av0 ) { fprintf( stderr, "usage:\t%s [-A source address ] [-c count] ( addr | nbpname )\n", av0 ); exit( 1 ); diff --git a/bin/afile/achfile.c b/bin/afile/achfile.c index db8bfad3..99133cc9 100644 --- a/bin/afile/achfile.c +++ b/bin/afile/achfile.c @@ -1,5 +1,5 @@ /* - * $Id: achfile.c,v 1.6 2009-10-13 22:55:36 didg Exp $ + * $Id: achfile.c,v 1.7 2009-10-14 01:38:28 didg Exp $ * afile - determine the MacOS creator/type of files @@ -56,18 +56,18 @@ #include "common.h" /* Global Variables */ -const char *type = NULL; -const char *creator = NULL; +static const char *type = NULL; +static const char *creator = NULL; /* Print usage information. */ -void usage(char *prog) +static void usage(char *prog) { fprintf(stderr, "Usage: %s [-t TYPE] [-c CREATOR] FILE ...\n", prog); } /* Print extensive help. */ -void help(char *prog) +static void help(char *prog) { usage(prog); fprintf(stderr, @@ -81,7 +81,7 @@ void help(char *prog) } /* Print the version. */ -void version(void) +static void version(void) { fprintf(stderr, "achfile (netatalk " VERSION ")\n"); } @@ -91,7 +91,7 @@ void version(void) * known long options: --help, --version */ #define OPTSTRING "t:c:hv-:" -const char *get_long_arg(int argc, char *argv[], const char *arg, const char *oa) { +static const char *get_long_arg(int argc, char *argv[], const char *arg, const char *oa) { switch (*oa) { case '=': return &oa[1]; @@ -108,7 +108,7 @@ const char *get_long_arg(int argc, char *argv[], const char *arg, const char *oa } } -int parse_args(int argc, char *argv[]) +static int parse_args(int argc, char *argv[]) { int c; const char *longarg; @@ -178,7 +178,7 @@ int parse_args(int argc, char *argv[]) /* Change the owner/creator of each file specified on the command line. */ -int handle_file(const char *filename) +static int handle_file(const char *filename) { int fd; struct stat statbuf; diff --git a/bin/afile/afile.c b/bin/afile/afile.c index 4cf8a353..e70c8500 100644 --- a/bin/afile/afile.c +++ b/bin/afile/afile.c @@ -1,5 +1,5 @@ /* - * $Id: afile.c,v 1.6 2009-10-13 22:55:36 didg Exp $ + * $Id: afile.c,v 1.7 2009-10-14 01:38:28 didg Exp $ * afile - determine the MacOS creator/type of files @@ -69,17 +69,17 @@ /* Global Variables */ -int showall = 0; +static int showall = 0; /* Print usage information. */ -void usage(char *prog) +static void usage(char *prog) { fprintf(stderr, "Usage: %s [-a] FILE ...\n", prog); } /* Print extensive help. */ -void help(char *prog) +static void help(char *prog) { usage(prog); fprintf(stderr, @@ -92,7 +92,7 @@ void help(char *prog) } /* Print the version. */ -void version(void) +static void version(void) { fprintf(stderr, "afile (netatalk " VERSION ")\n"); } @@ -102,7 +102,7 @@ void version(void) * known long options: --show-all, --help, --version */ #define OPTSTRING "ahv-:" -int parse_args(int argc, char *argv[]) +static int parse_args(int argc, char *argv[]) { int c; @@ -149,13 +149,13 @@ int parse_args(int argc, char *argv[]) /* Print the creator/type as taken from the supplied character stream, which * must be a AppleDouble file header. */ -void print_type(const char *filename, const char *creator, const char *type) +static void print_type(const char *filename, const char *creator, const char *type) { printf("%4.4s %4.4s %s\n", creator, type, filename); } -int handle_ad(struct AFile *rfile) +static int handle_ad(struct AFile *rfile) { int fd; char *dataname; @@ -179,7 +179,7 @@ int handle_ad(struct AFile *rfile) } -int handle_datafile(struct AFile *datafile) +static int handle_datafile(struct AFile *datafile) { int ret; char *adname; @@ -218,7 +218,7 @@ int handle_datafile(struct AFile *datafile) /* Parse a file and its resource fork. Output the file's creator/type. */ -int parse_file(char *filename) +static int parse_file(char *filename) { int ret; struct AFile *afile; diff --git a/bin/cnid/ad_ls.c b/bin/cnid/ad_ls.c index 4b609295..0708c77a 100644 --- a/bin/cnid/ad_ls.c +++ b/bin/cnid/ad_ls.c @@ -1,5 +1,5 @@ /* - $Id: ad_ls.c,v 1.3 2009-10-13 22:55:36 didg Exp $ + $Id: ad_ls.c,v 1.4 2009-10-14 01:38:28 didg Exp $ Copyright (c) 2009 Frank Lahm @@ -407,7 +407,7 @@ static void print_mode(const struct stat *st) #undef TYPE #undef MODE -int ad_print(char *path, const struct stat *st, afpvol_t *vol) +static int ad_print(char *path, const struct stat *st, afpvol_t *vol) { if ( ! ls_l) { printf("%s ", path); @@ -432,7 +432,7 @@ int ad_print(char *path, const struct stat *st, afpvol_t *vol) return 0; } -int ad_ls_r(char *path, afpvol_t *vol) +static int ad_ls_r(char *path, afpvol_t *vol) { int ret = 0, cwd, dirprinted = 0, dirempty; const char *name; diff --git a/bin/getzones/getzones.c b/bin/getzones/getzones.c index 6d8a5eef..b1757109 100644 --- a/bin/getzones/getzones.c +++ b/bin/getzones/getzones.c @@ -1,5 +1,5 @@ /* - * $Id: getzones.c,v 1.8 2009-10-13 22:55:36 didg Exp $ + * $Id: getzones.c,v 1.9 2009-10-14 01:38:28 didg Exp $ */ #ifdef HAVE_CONFIG_H @@ -27,9 +27,9 @@ #include #include -void print_zones(short n, char *buf); +static void print_zones(short n, char *buf); -void usage( char *s) +static void usage( char *s) { fprintf( stderr, "usage:\t%s [-m | -l] [address]\n", s ); exit( 1 ); @@ -147,7 +147,7 @@ int main( int argc, char *argv[]) * n: number of zones in this packet * buf: zone length/name pairs */ -void print_zones( short n, char *buf ) +static void print_zones( short n, char *buf ) { size_t zone_len; char *zone; diff --git a/bin/megatron/asingle.c b/bin/megatron/asingle.c index b9756e82..4fb9a3ea 100644 --- a/bin/megatron/asingle.c +++ b/bin/megatron/asingle.c @@ -1,5 +1,5 @@ /* - * $Id: asingle.c,v 1.12 2009-10-13 22:55:36 didg Exp $ + * $Id: asingle.c,v 1.13 2009-10-14 01:38:28 didg Exp $ */ #ifdef HAVE_CONFIG_H @@ -47,14 +47,14 @@ following globals; therefore this module can only be used for one of the two functions at a time. */ -struct single_file_data { +static struct single_file_data { int filed; char path[ MAXPATHLEN + 1]; struct ad_entry entry[ ADEID_MAX ]; } single; extern char *forkname[]; -u_char header_buf[ AD_HEADER_LEN ]; +static u_char header_buf[ AD_HEADER_LEN ]; /* * single_open must be called first. pass it a filename that is supposed @@ -333,7 +333,7 @@ int single_header_read( struct FHeader *fh, int version) * "Macintosh " (that is seven blanks of padding). */ #define MACINTOSH "Macintosh " -u_char sixteennulls[] = { 0, 0, 0, 0, 0, 0, 0, 0, +static u_char sixteennulls[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; int single_header_test(void) diff --git a/bin/megatron/hqx.c b/bin/megatron/hqx.c index 96561413..8f303b0c 100644 --- a/bin/megatron/hqx.c +++ b/bin/megatron/hqx.c @@ -1,5 +1,5 @@ /* - * $Id: hqx.c,v 1.15 2009-10-13 22:55:36 didg Exp $ + * $Id: hqx.c,v 1.16 2009-10-14 01:38:28 didg Exp $ */ #ifdef HAVE_CONFIG_H @@ -79,7 +79,7 @@ int hqx7_fill(u_char *hqx7_ptr); FILE *rawhex, *expandhex; #endif /* HEXOUTPUT */ -struct hqx_file_data { +static struct hqx_file_data { u_int32_t forklen[ NUMFORKS ]; u_short forkcrc[ NUMFORKS ]; char path[ MAXPATHLEN + 1]; @@ -88,10 +88,10 @@ struct hqx_file_data { } hqx; extern char *forkname[]; -u_char hqx7_buf[8192]; -u_char *hqx7_first; -u_char *hqx7_last; -int first_flag; +static u_char hqx7_buf[8192]; +static u_char *hqx7_first; +static u_char *hqx7_last; +static int first_flag; /* hqx_open must be called first. pass it a filename that is supposed @@ -422,7 +422,7 @@ character that should be skipped, namely '\n', '\r'. 0xFD signals ':'. 0xFC signals a whitespace character. */ -u_char hqxlookup[] = { +static const u_char hqxlookup[] = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0xFE, 0xFF, 0xFF, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, diff --git a/bin/megatron/macbin.c b/bin/megatron/macbin.c index d43bb37d..1b2dd197 100644 --- a/bin/megatron/macbin.c +++ b/bin/megatron/macbin.c @@ -1,5 +1,5 @@ /* - * $Id: macbin.c,v 1.13 2009-10-13 22:55:36 didg Exp $ + * $Id: macbin.c,v 1.14 2009-10-14 01:38:28 didg Exp $ */ #ifdef HAVE_CONFIG_H @@ -53,7 +53,7 @@ following globals; therefore this module can only be used for one of the two functions at a time. */ -struct bin_file_data { +static struct bin_file_data { u_int32_t forklen[ NUMFORKS ]; char path[ MAXPATHLEN + 1]; int filed; @@ -62,7 +62,7 @@ struct bin_file_data { } bin; extern char *forkname[]; -u_char head_buf[HEADBUFSIZ]; +static u_char head_buf[HEADBUFSIZ]; /* * bin_open must be called first. pass it a filename that is supposed diff --git a/bin/megatron/megatron.c b/bin/megatron/megatron.c index 48810abd..6bf52dd4 100644 --- a/bin/megatron/megatron.c +++ b/bin/megatron/megatron.c @@ -1,5 +1,5 @@ /* - * $Id: megatron.c,v 1.11 2009-10-13 22:55:36 didg Exp $ + * $Id: megatron.c,v 1.12 2009-10-14 01:38:28 didg Exp $ */ #ifdef HAVE_CONFIG_H @@ -24,9 +24,9 @@ #include "macbin.h" #include "nad.h" -char forkbuf[8192]; char *forkname[] = { "data", "resource" }; -char *name[] = { "unhex", +static char forkbuf[8192]; +static char *name[] = { "unhex", "unbin", "unsingle", "macbinary", @@ -36,7 +36,7 @@ char *name[] = { "unhex", "binheader", "megatron" }; -int from_open(int un, char *file, struct FHeader *fh, int flags) +static int from_open(int un, char *file, struct FHeader *fh, int flags) { switch ( un ) { case MEGATRON : @@ -61,7 +61,7 @@ int from_open(int un, char *file, struct FHeader *fh, int flags) } } -int from_read(int un, int fork, char *buf, int len) +static int from_read(int un, int fork, char *buf, int len) { switch ( un ) { case MEGATRON : @@ -84,7 +84,7 @@ int from_read(int un, int fork, char *buf, int len) } } -int from_close(int un) +static int from_close(int un) { switch ( un ) { case MEGATRON : @@ -107,7 +107,7 @@ int from_close(int un) } } -int to_open(int to, char *file, struct FHeader *fh, int flags) +static int to_open(int to, char *file, struct FHeader *fh, int flags) { switch ( to ) { case MEGATRON : @@ -127,7 +127,7 @@ int to_open(int to, char *file, struct FHeader *fh, int flags) } } -int to_write(int to, int fork, int bufc) +static int to_write(int to, int fork, int bufc) { switch ( to ) { case MEGATRON : @@ -147,7 +147,7 @@ int to_write(int to, int fork, int bufc) } } -int to_close(int to, int keepflag) +static int to_close(int to, int keepflag) { switch ( to ) { case MEGATRON : @@ -167,7 +167,7 @@ int to_close(int to, int keepflag) } } -int megatron( char *path, int module, char *newname, int flags) +static int megatron( char *path, int module, char *newname, int flags) { struct stat st; struct FHeader fh; diff --git a/bin/megatron/megatron.h b/bin/megatron/megatron.h index 259c2642..c9aa8cee 100644 --- a/bin/megatron/megatron.h +++ b/bin/megatron/megatron.h @@ -1,5 +1,5 @@ /* - * $Id: megatron.h,v 1.4 2009-10-13 22:55:36 didg Exp $ + * $Id: megatron.h,v 1.5 2009-10-14 01:38:28 didg Exp $ */ #ifndef _MEGATRON_H @@ -92,6 +92,7 @@ struct FHeader { # define S_ISDIR(s) (( s & S_IFMT ) == S_IFDIR ) #endif /* ! S_ISDIR */ +extern char *forkname[]; extern char *(*_mtoupath) ( char *); extern char *(*_utompath) ( char *); #define mtoupath(s) (*_mtoupath)(s) diff --git a/bin/megatron/nad.c b/bin/megatron/nad.c index 2e105675..250f51ac 100644 --- a/bin/megatron/nad.c +++ b/bin/megatron/nad.c @@ -1,5 +1,5 @@ /* - * $Id: nad.c,v 1.16 2009-10-13 22:55:36 didg Exp $ + * $Id: nad.c,v 1.17 2009-10-14 01:38:28 didg Exp $ */ #ifdef HAVE_CONFIG_H @@ -27,7 +27,7 @@ #include "megatron.h" #include "nad.h" -struct volinfo vol; +static struct volinfo vol; static char hexdig[] = "0123456789abcdef"; static char mtou_buf[MAXPATHLEN + 1], utom_buf[MAXPATHLEN + 1]; @@ -344,7 +344,7 @@ utompath_error: return(utompathcap( upath )); } -char *mtoupathiconv(char *mpath) +static char *mtoupathiconv(char *mpath) { char *m, *u; size_t inplen; @@ -409,7 +409,7 @@ void select_charset( int options) int hexfork[ NUMFORKS ]; #endif /* HEXOUTPUT */ -struct nad_file_data { +static struct nad_file_data { char macname[ MAXPATHLEN + 1 ]; char adpath[ 2 ][ MAXPATHLEN + 1]; int offset[ NUMFORKS ]; @@ -689,7 +689,7 @@ int nad_header_write(struct FHeader *fh) return( 0 ); } -int forkeid[] = { ADEID_DFORK, ADEID_RFORK }; +static int forkeid[] = { ADEID_DFORK, ADEID_RFORK }; int nad_read(int fork, char *forkbuf, int bufc) { diff --git a/bin/nbp/nbplkup.c b/bin/nbp/nbplkup.c index 821f0e08..2e3850f2 100644 --- a/bin/nbp/nbplkup.c +++ b/bin/nbp/nbplkup.c @@ -1,5 +1,5 @@ /* - * $Id: nbplkup.c,v 1.6 2009-10-13 22:55:36 didg Exp $ + * $Id: nbplkup.c,v 1.7 2009-10-14 01:38:28 didg Exp $ * * Copyright (c) 1990,1991 Regents of The University of Michigan. * All Rights Reserved. @@ -41,11 +41,11 @@ #include -char *Obj = "="; -char *Type = "="; -char *Zone = "*"; +static char *Obj = "="; +static char *Type = "="; +static char *Zone = "*"; -void Usage(char *av0) +static void Usage(char *av0) { char *p; diff --git a/bin/nbp/nbprgstr.c b/bin/nbp/nbprgstr.c index 7b9bd4b0..ab041ba8 100644 --- a/bin/nbp/nbprgstr.c +++ b/bin/nbp/nbprgstr.c @@ -1,5 +1,5 @@ /* - * $Id: nbprgstr.c,v 1.6 2009-10-13 22:55:36 didg Exp $ + * $Id: nbprgstr.c,v 1.7 2009-10-14 01:38:28 didg Exp $ * * Copyright (c) 1990,1993 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. @@ -22,7 +22,7 @@ #include #include -void Usage(char *av0) +static void Usage(char *av0) { char *p; diff --git a/bin/nbp/nbpunrgstr.c b/bin/nbp/nbpunrgstr.c index b9cd2347..d24251a0 100644 --- a/bin/nbp/nbpunrgstr.c +++ b/bin/nbp/nbpunrgstr.c @@ -1,5 +1,5 @@ /* - * $Id: nbpunrgstr.c,v 1.7 2009-10-13 22:55:36 didg Exp $ + * $Id: nbpunrgstr.c,v 1.8 2009-10-14 01:38:28 didg Exp $ * * Copyright (c) 1990,1991 Regents of The University of Michigan. * All Rights Reserved. @@ -41,7 +41,7 @@ #include -void Usage(char *av0) +static void Usage(char *av0) { char *p; diff --git a/bin/pap/pap.c b/bin/pap/pap.c index 3649547f..de707217 100644 --- a/bin/pap/pap.c +++ b/bin/pap/pap.c @@ -1,5 +1,5 @@ /* - * $Id: pap.c,v 1.11 2009-10-13 22:55:36 didg Exp $ + * $Id: pap.c,v 1.12 2009-10-14 01:38:28 didg Exp $ * * Copyright (c) 1990,1994 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. @@ -30,13 +30,13 @@ #define FUCKED #define _PATH_PAPRC ".paprc" -char *nbpfailure = "AppleTalk printer offline"; +static char *nbpfailure = "AppleTalk printer offline"; /* Forward Declarations */ -void updatestatus(char *s, int len); -int send_file(int fd, ATP atp, int lastfile); +static void updatestatus(char *s, int len); +static int send_file(int fd, ATP atp, int lastfile); -void usage(char *path) +static void usage(char *path) { char *p; @@ -62,7 +62,7 @@ void usage(char *path) exit( 2 ); } -char * +static char * paprc(void) { static char s[ 32 + 1 + 32 + 1 + 32 ]; @@ -89,20 +89,20 @@ paprc(void) return( name ); } -char *printer = NULL; -char *status = NULL; -int noeof = 0; -int waitforprinter = 0; +static char *printer = NULL; +static char *status = NULL; +static int noeof = 0; +static int waitforprinter = 0; -unsigned char connid, quantum, oquantum = PAP_MAXQUANTUM; -struct sockaddr_at sat; +static unsigned char connid, quantum, oquantum = PAP_MAXQUANTUM; +static struct sockaddr_at sat; -char cbuf[ 8 ]; -struct nbpnve nn; -ATP satp; +static char cbuf[ 8 ]; +static struct nbpnve nn; +static ATP satp; -char fbuf[ PAP_MAXQUANTUM ][ 4 + PAP_MAXDATA ]; -struct iovec rfiov[ PAP_MAXQUANTUM ] = { +static char fbuf[ PAP_MAXQUANTUM ][ 4 + PAP_MAXDATA ]; +static struct iovec rfiov[ PAP_MAXQUANTUM ] = { { fbuf[ 0 ] + 4, 0 }, { fbuf[ 1 ] + 4, 0 }, { fbuf[ 2 ] + 4, 0 }, @@ -112,7 +112,8 @@ struct iovec rfiov[ PAP_MAXQUANTUM ] = { { fbuf[ 6 ] + 4, 0 }, { fbuf[ 7 ] + 4, 0 }, }; -struct iovec sniov[ PAP_MAXQUANTUM ] = { + +static struct iovec sniov[ PAP_MAXQUANTUM ] = { { fbuf[ 0 ], 0 }, { fbuf[ 1 ], 0 }, { fbuf[ 2 ], 0 }, @@ -123,8 +124,8 @@ struct iovec sniov[ PAP_MAXQUANTUM ] = { { fbuf[ 7 ], 0 }, }; -char nbuf[ PAP_MAXQUANTUM ][ 4 + PAP_MAXDATA ]; -struct iovec rniov[ PAP_MAXQUANTUM ] = { +static char nbuf[ PAP_MAXQUANTUM ][ 4 + PAP_MAXDATA ]; +static struct iovec rniov[ PAP_MAXQUANTUM ] = { { nbuf[ 0 ], 0 }, { nbuf[ 1 ], 0 }, { nbuf[ 2 ], 0 }, @@ -134,7 +135,8 @@ struct iovec rniov[ PAP_MAXQUANTUM ] = { { nbuf[ 6 ], 0 }, { nbuf[ 7 ], 0 }, }; -struct iovec sfiov[ PAP_MAXQUANTUM ] = { + +static struct iovec sfiov[ PAP_MAXQUANTUM ] = { { nbuf[ 0 ] + 4, 0 }, { nbuf[ 1 ] + 4, 0 }, { nbuf[ 2 ] + 4, 0 }, @@ -145,7 +147,7 @@ struct iovec sfiov[ PAP_MAXQUANTUM ] = { { nbuf[ 7 ] + 4, 0 }, }; -int debug; +static int debug; int main( int ac, char **av) { @@ -461,11 +463,11 @@ int main( int ac, char **av) exit( 0 ); } -int data = 0; -unsigned char port; -u_int16_t seq = 0, rseq = 1; +static int data = 0; +static unsigned char port; +static u_int16_t seq = 0, rseq = 1; -int send_file( int fd, ATP atp, int lastfile) +static int send_file( int fd, ATP atp, int lastfile) { struct timeval stv, tv; struct sockaddr_at ssat; @@ -839,7 +841,7 @@ int send_file( int fd, ATP atp, int lastfile) } } -void updatestatus(char *s, int len) +static 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 ed51580a..0ada9c0a 100644 --- a/bin/pap/papstatus.c +++ b/bin/pap/papstatus.c @@ -1,5 +1,5 @@ /* - * $Id: papstatus.c,v 1.6 2009-10-13 22:55:36 didg Exp $ + * $Id: papstatus.c,v 1.7 2009-10-14 01:38:28 didg Exp $ * * Copyright (c) 1990,1991 Regents of The University of Michigan. * All Rights Reserved. @@ -45,9 +45,9 @@ #define _PATH_PAPRC ".paprc" /* Forward Declaration */ -void getstatus(ATP atp, struct sockaddr_at *sat); +static void getstatus(ATP atp, struct sockaddr_at *sat); -void usage(char *path) +static void usage(char *path) { char *p; @@ -61,7 +61,7 @@ void usage(char *path) exit( 1 ); } -char * +static char * paprc(void) { static char s[ 32 + 1 + 32 + 1 + 32 ]; @@ -83,10 +83,10 @@ paprc(void) return( name ); } -char *printer = NULL; +static char *printer = NULL; -char cbuf[ 8 ]; -struct nbpnve nn; +static char cbuf[ 8 ]; +static struct nbpnve nn; int main( int ac, char **av) { @@ -164,7 +164,7 @@ int main( int ac, char **av) return 0; } -void getstatus(ATP atp, struct sockaddr_at *sat) +static void getstatus(ATP atp, struct sockaddr_at *sat) { struct iovec iov; struct atp_block atpb; diff --git a/bin/psorder/psorder.c b/bin/psorder/psorder.c index 37c5fc4a..d2de6c87 100644 --- a/bin/psorder/psorder.c +++ b/bin/psorder/psorder.c @@ -1,5 +1,5 @@ /* - * $Id: psorder.c,v 1.7 2009-10-13 22:55:36 didg Exp $ + * $Id: psorder.c,v 1.8 2009-10-14 01:38:28 didg Exp $ * * Copyright (c) 1990,1991 Regents of The University of Michigan. * All Rights Reserved. @@ -53,11 +53,11 @@ * Global Variables */ -u_char psbuf[ 8192 ]; -struct psinfo_st psinfo; -int orderflag, forceflag; +static u_char psbuf[ 8192 ]; +static struct psinfo_st psinfo; +static int orderflag, forceflag; -void +static void filecleanup( int errorcode, int tfd, char *tfile) { @@ -79,7 +79,7 @@ filecleanup( int errorcode, int tfd, char *tfile) exit( errorcode ); } -void +static void filesetup( char *inputfile, int *infd, char *tfile, int *tfd) { struct stat st; @@ -133,7 +133,7 @@ filesetup( char *inputfile, int *infd, char *tfile, int *tfd) return; } -struct pspage_st +static struct pspage_st *getpspage(off_t off) { struct pspage_st *newpspage; @@ -148,7 +148,7 @@ struct pspage_st return( newpspage ); } -int +static int handletok(off_t count, char *token) { int incdoc = 0; @@ -236,7 +236,7 @@ handletok(off_t count, char *token) return( 0 ); } -void +static void readps(int inputfd, int tempfd, char *tempfile) { off_t ccread = 0; @@ -336,7 +336,7 @@ readps(int inputfd, int tempfd, char *tempfile) return; } -void +static void temp2out(int tempfd, char *tempfile, off_t length) { int ccread; @@ -367,7 +367,7 @@ temp2out(int tempfd, char *tempfile, off_t length) } } -void +static void writelable(int tempfd, char *tempfile, char *lable) { char line[256]; @@ -394,7 +394,7 @@ writelable(int tempfd, char *tempfile, char *lable) } } -void +static void writeps(int tempfd, char *tempfile) { struct stat st; @@ -489,7 +489,7 @@ writeps(int tempfd, char *tempfile) return; } -int +static int psorder(char *path) { int tempfd; diff --git a/etc/afpd/afp_asp.c b/etc/afpd/afp_asp.c index 5a5a0b3f..94a0cd2d 100644 --- a/etc/afpd/afp_asp.c +++ b/etc/afpd/afp_asp.c @@ -1,5 +1,5 @@ /* - * $Id: afp_asp.c,v 1.24 2009-10-13 22:55:36 didg Exp $ + * $Id: afp_asp.c,v 1.25 2009-10-14 01:38:28 didg Exp $ * * Copyright (c) 1997 Adrian Sun (asun@zoology.washington.edu) * Copyright (c) 1990,1993 Regents of The University of Michigan. @@ -43,8 +43,6 @@ #include "uid.h" #endif /* FORCE_UIDGID */ -extern struct oforks *writtenfork; - static AFPObj *child; static void afp_authprint_remove(AFPObj *); diff --git a/etc/afpd/afp_dsi.c b/etc/afpd/afp_dsi.c index 789d81a8..28032363 100644 --- a/etc/afpd/afp_dsi.c +++ b/etc/afpd/afp_dsi.c @@ -1,5 +1,5 @@ /* - * $Id: afp_dsi.c,v 1.38 2009-10-13 22:55:36 didg Exp $ + * $Id: afp_dsi.c,v 1.39 2009-10-14 01:38:28 didg Exp $ * * Copyright (c) 1999 Adrian Sun (asun@zoology.washington.edu) * Copyright (c) 1990,1993 Regents of The University of Michigan. @@ -43,8 +43,6 @@ #include "uid.h" #endif /* FORCE_UIDGID */ -extern struct oforks *writtenfork; - #define CHILD_DIE (1 << 0) #define CHILD_RUNNING (1 << 1) #define CHILD_SLEEPING (1 << 2) diff --git a/etc/afpd/afp_options.c b/etc/afpd/afp_options.c index d1e85bc5..ff48c01a 100644 --- a/etc/afpd/afp_options.c +++ b/etc/afpd/afp_options.c @@ -1,5 +1,5 @@ /* - * $Id: afp_options.c,v 1.46 2009-10-13 22:55:36 didg Exp $ + * $Id: afp_options.c,v 1.47 2009-10-14 01:38:28 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 ) +static void show_version( void ) { printf( "afpd %s - Apple Filing Protocol (AFP) daemon of Netatalk\n\n", VERSION ); @@ -506,7 +506,7 @@ void show_version( void ) * Show extended version information about afpd and Netatalk. * Used by "afp -V". */ -void show_version_extended(void ) +static void show_version_extended(void ) { show_version( ); @@ -570,7 +570,7 @@ void show_version_extended(void ) /* * Display compiled-in default paths */ -void show_paths( void ) +static void show_paths( void ) { printf( " afpd.conf:\t%s\n", _PATH_AFPDCONF ); printf( " AppleVolumes.system:\t%s\n", _PATH_AFPDSYSVOL ); @@ -581,7 +581,7 @@ void show_paths( void ) /* * Display usage information about adpd. */ -void show_usage( char *name ) +static void show_usage( char *name ) { fprintf( stderr, "Usage:\t%s [-dDIptTu] [-c maxconnections] [-f defaultvolumes] [-F config]\n", name ); fprintf( stderr, "\t [-g guest] [-L message] [-m umask][-n nbpname] [-P pidfile]\n" ); diff --git a/etc/afpd/afp_util.c b/etc/afpd/afp_util.c index 6189201b..f32ed772 100644 --- a/etc/afpd/afp_util.c +++ b/etc/afpd/afp_util.c @@ -1,5 +1,5 @@ /* - * $Id: afp_util.c,v 1.6 2009-09-28 11:59:44 franklahm Exp $ + * $Id: afp_util.c,v 1.7 2009-10-14 01:38:28 didg Exp $ * * Copyright (c) 1999 Adrian Sun (asun@zoology.washington.edu) * Copyright (c) 1990,1993 Regents of The University of Michigan. @@ -15,6 +15,7 @@ #endif /* HAVE_CONFIG_H */ #include +#include "globals.h" const char *AfpNum2name(int num) { diff --git a/etc/afpd/catsearch.c b/etc/afpd/catsearch.c index 73a8a94f..a06ecabc 100644 --- a/etc/afpd/catsearch.c +++ b/etc/afpd/catsearch.c @@ -662,7 +662,7 @@ catsearch_end: /* Exiting catsearch: error condition */ } /* catsearch() */ /* -------------------------- */ -int catsearch_afp(AFPObj *obj _U_, char *ibuf, int ibuflen, +static int catsearch_afp(AFPObj *obj _U_, char *ibuf, int ibuflen, char *rbuf, int *rbuflen, int ext) { struct vol *vol; diff --git a/etc/afpd/desktop.c b/etc/afpd/desktop.c index c594480a..0711b568 100644 --- a/etc/afpd/desktop.c +++ b/etc/afpd/desktop.c @@ -1,5 +1,5 @@ /* - * $Id: desktop.c,v 1.38 2009-10-13 22:55:36 didg Exp $ + * $Id: desktop.c,v 1.39 2009-10-14 01:38:28 didg Exp $ * * See COPYRIGHT. * @@ -64,7 +64,7 @@ int afp_closedt(AFPObj *obj _U_, char *ibuf _U_, int ibuflen _U_, char *rbuf _U_ return( AFP_OK ); } -struct savedt si = { { 0, 0, 0, 0 }, -1, 0, 0 }; +static struct savedt si = { { 0, 0, 0, 0 }, -1, 0, 0 }; static char *icon_dtfile(struct vol *vol, u_char creator[ 4 ]) { diff --git a/etc/afpd/file.h b/etc/afpd/file.h index 37c65d03..62acd0b0 100644 --- a/etc/afpd/file.h +++ b/etc/afpd/file.h @@ -1,5 +1,5 @@ /* - * $Id: file.h,v 1.22 2009-10-13 22:55:37 didg Exp $ + * $Id: file.h,v 1.23 2009-10-14 01:38:28 didg Exp $ * * Copyright (c) 1990,1991 Regents of The University of Michigan. * All Rights Reserved. @@ -119,6 +119,9 @@ extern int renamefile (const struct vol *, char *, char *, char *, struct adou extern int copyfile (const struct vol *, const struct vol *, char *, char *, char *, struct adouble *); extern int deletefile (const struct vol *, char *, int); +extern int getmetadata (struct vol *vol, u_int16_t bitmap, struct path *path, + struct dir *dir, char *buf, int *buflen, struct adouble *adp); + extern void *get_finderinfo (const struct vol *, const char *, struct adouble *, void *); extern size_t mtoUTF8 (const struct vol *, const char *, size_t , char *, size_t ); diff --git a/etc/afpd/fork.c b/etc/afpd/fork.c index 5e58b326..e1ade8d1 100644 --- a/etc/afpd/fork.c +++ b/etc/afpd/fork.c @@ -1,5 +1,5 @@ /* - * $Id: fork.c,v 1.63 2009-10-13 22:55:37 didg Exp $ + * $Id: fork.c,v 1.64 2009-10-14 01:38:28 didg Exp $ * * Copyright (c) 1990,1993 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. @@ -44,11 +44,9 @@ #define Debug(a) (0) #endif -struct ofork *writtenfork; -extern int getmetadata(struct vol *vol, - u_int16_t bitmap, - struct path *path, struct dir *dir, char *buf, - int *buflen, struct adouble *adp); +#ifdef AFS +struct ofork *writtenfork; +#endif static int getforkparams(struct ofork *ofork, u_int16_t bitmap, char *buf, int *buflen) { diff --git a/etc/afpd/fork.h b/etc/afpd/fork.h index 267c184d..7d693376 100644 --- a/etc/afpd/fork.h +++ b/etc/afpd/fork.h @@ -1,5 +1,5 @@ /* - * $Id: fork.h,v 1.14 2009-10-13 22:55:37 didg Exp $ + * $Id: fork.h,v 1.15 2009-10-14 01:38:28 didg Exp $ * * Copyright (c) 1990,1993 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. @@ -51,6 +51,10 @@ struct ofork { #define AFPFORK_ACCWR (1<<5) #define AFPFORK_ACCMASK (AFPFORK_ACCRD | AFPFORK_ACCWR) +#ifdef AFS +extern struct ofork *writtenfork; +#endif + #define of_name(a) (a)->of_ad->ad_m_name /* in ofork.c */ extern struct ofork *of_alloc (struct vol *, struct dir *, diff --git a/etc/atalkd/config.c b/etc/atalkd/config.c index b456cc4e..fb19303d 100644 --- a/etc/atalkd/config.c +++ b/etc/atalkd/config.c @@ -1,5 +1,5 @@ /* - * $Id: config.c,v 1.17 2009-10-13 22:55:37 didg Exp $ + * $Id: config.c,v 1.18 2009-10-14 01:38:28 didg Exp $ * * Copyright (c) 1990,1993 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. @@ -92,7 +92,7 @@ static const struct param { #define ARGV_CHUNK_SIZE 128 #define MAXLINELEN 2048 -char **parseline(const char *line) +static char **parseline(const char *line) { const char *p; int argc = 0; @@ -172,7 +172,7 @@ char **parseline(const char *line) return argv; } -void freeline( char **argv ) +static void freeline( char **argv ) { char **tmp = argv; diff --git a/etc/atalkd/main.c b/etc/atalkd/main.c index 7f437e29..01eb92a0 100644 --- a/etc/atalkd/main.c +++ b/etc/atalkd/main.c @@ -1,5 +1,5 @@ /* - * $Id: main.c,v 1.20 2009-10-13 22:55:37 didg Exp $ + * $Id: main.c,v 1.21 2009-10-14 01:38:28 didg Exp $ * * Copyright (c) 1990,1993 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. @@ -102,6 +102,8 @@ int ifconfig(const char *iname, unsigned long cmd, struct sockaddr_at *sa); extern int aep_packet(struct atport *ap, struct sockaddr_at *from, char *data, int len); int rtfd; +int transition = 0; +int stabletimer, newrtmpdata = 0; static struct atserv atserv[] = { { "rtmp", 1, rtmp_packet }, /* 0 */ @@ -113,17 +115,17 @@ static int atservNATSERV = elements( atserv ); struct interface *interfaces = NULL, *ciface = NULL; -int debug = 0, quiet = 0, chatty = 0; -char *configfile = NULL; -int ziptimeout = 0, transition = 0; -int stabletimer, stable = 0, newrtmpdata = 0, noparent = 0; -static int ninterfaces; -int defphase = IFACE_PHASE2; -int nfds = 0; -fd_set fds; -char Packet[ PKTSZ ]; -char *version = VERSION; -static char *pidfile = _PATH_ATALKDLOCK; +static int debug = 0, quiet = 0, chatty = 0; +static char *configfile = NULL; +static int ziptimeout = 0; +static int stable = 0, noparent = 0; +static int ninterfaces; +static int defphase = IFACE_PHASE2; +static int nfds = 0; +static fd_set fds; +static char Packet[ PKTSZ ]; +static char *version = VERSION; +static char *pidfile = _PATH_ATALKDLOCK; /* from config.c */ @@ -712,7 +714,7 @@ consistency() } #endif /* DEBUG */ -void +static void as_debug(int sig _U_) { struct interface *iface; @@ -814,7 +816,7 @@ as_debug(int sig _U_) /* * Called when SIGTERM is recieved. Remove all routes and then exit. */ -void +static void as_down(int sig _U_) { struct interface *iface; diff --git a/etc/atalkd/main.h b/etc/atalkd/main.h index cc028b68..39e6b520 100644 --- a/etc/atalkd/main.h +++ b/etc/atalkd/main.h @@ -1,5 +1,5 @@ /* - * $Id: main.h,v 1.5 2009-10-13 22:55:37 didg Exp $ + * $Id: main.h,v 1.6 2009-10-14 01:38:28 didg Exp $ */ #ifndef ATALKD_MAIN_H @@ -8,6 +8,9 @@ #include #include "config.h" +extern int transition; +extern int stabletimer, newrtmpdata; + 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 ); diff --git a/etc/atalkd/multicast.c b/etc/atalkd/multicast.c index e95acce1..3b7785ce 100644 --- a/etc/atalkd/multicast.c +++ b/etc/atalkd/multicast.c @@ -1,5 +1,5 @@ /* - * $Id: multicast.c,v 1.12 2009-10-13 22:55:37 didg Exp $ + * $Id: multicast.c,v 1.13 2009-10-14 01:38:28 didg Exp $ * * Copyright (c) 1990,1993 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. @@ -41,6 +41,7 @@ #include "rtmp.h" #include "zip.h" #include "main.h" +#include "multicast.h" static const unsigned char ethermulti[ 6 ] = { diff --git a/etc/atalkd/multicast.h b/etc/atalkd/multicast.h index d8ef3347..988b189f 100644 --- a/etc/atalkd/multicast.h +++ b/etc/atalkd/multicast.h @@ -1,5 +1,5 @@ /* - * $Id: multicast.h,v 1.4 2009-10-13 22:55:37 didg Exp $ + * $Id: multicast.h,v 1.5 2009-10-14 01:38:28 didg Exp $ * * Copyright (c) 1990,1997 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. @@ -11,9 +11,6 @@ #include #include "zip.h" -extern unsigned char ethermultitab[ 253 ][ 6 ]; -extern unsigned char ethermulti[ 6 ]; - int addmulti (const char *, const unsigned char *); int zone_bcast (struct ziptab *); diff --git a/etc/cnid_dbd/cmd_dbd.c b/etc/cnid_dbd/cmd_dbd.c index 33b0b72f..62df7c01 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.12 2009-10-13 22:55:37 didg Exp $ + $Id: cmd_dbd.c,v 1.13 2009-10-14 01:38:28 didg Exp $ Copyright (c) 2009 Frank Lahm @@ -131,7 +131,7 @@ static void sig_handler(int signo) return; } -void set_signal(void) +static void set_signal(void) { struct sigaction sv; @@ -165,7 +165,7 @@ void set_signal(void) } } -int get_lock(const char *dbpath) +static int get_lock(const char *dbpath) { int lockfd; char lockpath[PATH_MAX]; @@ -215,7 +215,7 @@ int get_lock(const char *dbpath) return lockfd; } -void free_lock(int lockfd) +static void free_lock(int lockfd) { struct flock lock; diff --git a/etc/cnid_dbd/cmd_dbd_lookup.c b/etc/cnid_dbd/cmd_dbd_lookup.c index 1a12c6de..93866e2c 100644 --- a/etc/cnid_dbd/cmd_dbd_lookup.c +++ b/etc/cnid_dbd/cmd_dbd_lookup.c @@ -1,5 +1,5 @@ /* - * $Id: cmd_dbd_lookup.c,v 1.2 2009-07-12 09:21:34 franklahm Exp $ + * $Id: cmd_dbd_lookup.c,v 1.3 2009-10-14 01:38:28 didg Exp $ * * Copyright (C) Frank Lahm 2009 * All Rights Reserved. See COPYING. @@ -30,10 +30,6 @@ */ -/* Pull these in from dbd_add.c */ -extern int add_cnid(DBD *dbd, struct cnid_dbd_rqst *rqst, struct cnid_dbd_rply *rply); -extern int get_cnid(DBD *dbd, struct cnid_dbd_rply *rply); - /* * This returns the CNID corresponding to a particular file and logs any inconsitencies. * If roflags == 1 we only scan, if roflag == 0, we modify i.e. call dbd_update diff --git a/etc/cnid_dbd/cmd_dbd_scanvol.c b/etc/cnid_dbd/cmd_dbd_scanvol.c index f1d54ceb..1d6d6a92 100644 --- a/etc/cnid_dbd/cmd_dbd_scanvol.c +++ b/etc/cnid_dbd/cmd_dbd_scanvol.c @@ -1,5 +1,5 @@ /* - $Id: cmd_dbd_scanvol.c,v 1.9 2009-10-12 11:30:52 franklahm Exp $ + $Id: cmd_dbd_scanvol.c,v 1.10 2009-10-14 01:38:28 didg Exp $ Copyright (c) 2009 Frank Lahm @@ -680,7 +680,7 @@ static int scanvol(struct volinfo *vi, dbd_flags_t flags) /* Remove all CNIDs from dbd that are not in dbd_rebuild */ -void delete_orphaned_cnids(DBD *dbd, DBD *dbd_rebuild, dbd_flags_t flags) +static void delete_orphaned_cnids(DBD *dbd, DBD *dbd_rebuild, dbd_flags_t flags) { int ret, deleted = 0; cnid_t dbd_cnid = 0, rebuild_cnid = 0; diff --git a/etc/cnid_dbd/cnid_metad.c b/etc/cnid_dbd/cnid_metad.c index ecc5045d..709e694f 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.15 2009-10-13 22:55:37 didg Exp $ + * $Id: cnid_metad.c,v 1.16 2009-10-14 01:38:28 didg Exp $ * * Copyright (C) Joerg Lenneis 2003 * All Rights Reserved. See COPYING. @@ -107,7 +107,7 @@ static int srvfd; static int rqstfd; -volatile sig_atomic_t alarmed = 0; +static volatile sig_atomic_t alarmed = 0; #define MAXSPAWN 3 /* Max times respawned in.. */ #define TESTTIME 42 /* this much seconds apfd client tries to * @@ -343,7 +343,7 @@ static int set_dbdir(char *dbdir, int len) } /* ------------------ */ -uid_t user_to_uid (char *username) +static uid_t user_to_uid (char *username) { struct passwd *this_passwd; @@ -362,7 +362,7 @@ uid_t user_to_uid (char *username) } /* ------------------ */ -gid_t group_to_gid ( char *group) +static gid_t group_to_gid ( char *group) { struct group *this_group; @@ -381,7 +381,7 @@ gid_t group_to_gid ( char *group) } /* ------------------ */ -void catch_alarm(int sig _U_) { +static void catch_alarm(int sig _U_) { alarmed = 1; } diff --git a/etc/cnid_dbd/dbd.h b/etc/cnid_dbd/dbd.h index 6dd54701..cca91c6e 100644 --- a/etc/cnid_dbd/dbd.h +++ b/etc/cnid_dbd/dbd.h @@ -1,5 +1,5 @@ /* - * $Id: dbd.h,v 1.5 2009-07-12 09:21:34 franklahm Exp $ + * $Id: dbd.h,v 1.6 2009-10-14 01:38:28 didg Exp $ * * Copyright (C) Joerg Lenneis 2003 * Copyright (C) Frank Lahm 2009 @@ -11,6 +11,9 @@ #include +extern int add_cnid(DBD *dbd, struct cnid_dbd_rqst *rqst, struct cnid_dbd_rply *rply); +extern int get_cnid(DBD *dbd, struct cnid_dbd_rply *rply); + extern int dbd_stamp(DBD *dbd); extern int dbd_add(DBD *dbd, struct cnid_dbd_rqst *, struct cnid_dbd_rply *); extern int dbd_get(DBD *dbd, struct cnid_dbd_rqst *, struct cnid_dbd_rply *); diff --git a/etc/cnid_dbd/dbif.c b/etc/cnid_dbd/dbif.c index b1b3599a..cb155c03 100644 --- a/etc/cnid_dbd/dbif.c +++ b/etc/cnid_dbd/dbif.c @@ -1,5 +1,5 @@ /* - * $Id: dbif.c,v 1.15 2009-10-13 22:55:37 didg Exp $ + * $Id: dbif.c,v 1.16 2009-10-14 01:38:28 didg Exp $ * * Copyright (C) Joerg Lenneis 2003 * Copyright (C) Frank Lahm 2009 @@ -399,7 +399,7 @@ int dbif_open(DBD *dbd, struct db_param *dbp _U_, int reindex) } /* ------------------------ */ -int dbif_closedb(DBD *dbd) +static int dbif_closedb(DBD *dbd) { int i; int ret; diff --git a/etc/cnid_dbd/main.c b/etc/cnid_dbd/main.c index fc3af820..95a0946d 100644 --- a/etc/cnid_dbd/main.c +++ b/etc/cnid_dbd/main.c @@ -1,5 +1,5 @@ /* - * $Id: main.c,v 1.10 2009-09-03 08:35:15 franklahm Exp $ + * $Id: main.c,v 1.11 2009-10-14 01:38:28 didg Exp $ * * Copyright (C) Joerg Lenneis 2003 * Copyright (c) Frank Lahm 2009 @@ -238,7 +238,7 @@ static void switch_to_user(char *dir) } /* ------------------------ */ -int get_lock(void) +static int get_lock(void) { int lockfd; struct flock lock; @@ -266,7 +266,7 @@ int get_lock(void) } /* ----------------------- */ -void set_signal(void) +static void set_signal(void) { struct sigaction sv; @@ -288,7 +288,7 @@ void set_signal(void) } /* ----------------------- */ -void free_lock(int lockfd) +static void free_lock(int lockfd) { struct flock lock; diff --git a/etc/papd/lp.c b/etc/papd/lp.c index dec0b53d..017cee89 100644 --- a/etc/papd/lp.c +++ b/etc/papd/lp.c @@ -1,5 +1,5 @@ /* - * $Id: lp.c,v 1.28 2009-10-13 22:55:37 didg Exp $ + * $Id: lp.c,v 1.29 2009-10-14 01:38:28 didg Exp $ * * Copyright (c) 1990,1994 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. @@ -92,11 +92,11 @@ int lp_disconn_inet( int ); int lp_conn_unix(); int lp_disconn_unix( int ); -char hostname[ MAXHOSTNAMELEN ]; +static char hostname[ MAXHOSTNAMELEN ]; extern struct sockaddr_at *sat; -struct lp { +static struct lp { int lp_flags; FILE *lp_stream; int lp_seq; diff --git a/etc/papd/main.c b/etc/papd/main.c index 6fac410f..66859483 100644 --- a/etc/papd/main.c +++ b/etc/papd/main.c @@ -1,5 +1,5 @@ /* - * $Id: main.c,v 1.27 2009-10-13 22:55:37 didg Exp $ + * $Id: main.c,v 1.28 2009-10-14 01:38:28 didg Exp $ * * Copyright (c) 1990,1995 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. @@ -104,7 +104,7 @@ static void papd_exit(const int i) exit(i); } -void +static void die(int n) { struct printer *pr; @@ -133,7 +133,7 @@ die(int n) papd_exit( n ); } -void +static void reap(int sig _U_) { int status; @@ -159,7 +159,7 @@ reap(int sig _U_) return; } -char rbuf[ 255 + 1 + 8 ]; +static char rbuf[ 255 + 1 + 8 ]; int main(int ac, char **av) { diff --git a/etc/papd/session.c b/etc/papd/session.c index 3dcb3a4c..4da0b27e 100644 --- a/etc/papd/session.c +++ b/etc/papd/session.c @@ -1,5 +1,5 @@ /* - * $Id: session.c,v 1.17 2009-10-13 22:55:37 didg Exp $ + * $Id: session.c,v 1.18 2009-10-14 01:38:28 didg Exp $ * * Copyright (c) 1990,1994 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. @@ -35,8 +35,8 @@ int ps(struct papfile *infile, struct papfile *outfile, struct sockaddr_at *sat) extern unsigned char connid, quantum, oquantum; -char buf[ PAP_MAXQUANTUM ][ 4 + PAP_MAXDATA ]; -struct iovec niov[ PAP_MAXQUANTUM ] = { +static char buf[ PAP_MAXQUANTUM ][ 4 + PAP_MAXDATA ]; +static struct iovec niov[ PAP_MAXQUANTUM ] = { { buf[ 0 ], 0 }, { buf[ 1 ], 0 }, { buf[ 2 ], 0 }, @@ -46,7 +46,7 @@ struct iovec niov[ PAP_MAXQUANTUM ] = { { buf[ 6 ], 0 }, { buf[ 7 ], 0 }, }; -struct iovec iov[ PAP_MAXQUANTUM ] = { +static struct iovec iov[ PAP_MAXQUANTUM ] = { { buf[ 0 ] + 4, 0 }, { buf[ 1 ] + 4, 0 }, { buf[ 2 ] + 4, 0 }, diff --git a/etc/psf/psf.c b/etc/psf/psf.c index 94d95d82..7498b93d 100644 --- a/etc/psf/psf.c +++ b/etc/psf/psf.c @@ -1,5 +1,5 @@ /* - * $Id: psf.c,v 1.10 2009-10-13 22:55:37 didg Exp $ + * $Id: psf.c,v 1.11 2009-10-14 01:38:28 didg Exp $ * * Copyright (c) 1990,1995 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. @@ -55,8 +55,8 @@ int pexecv(char *path, char *argv[]); int copyio(); int textps(); -char psapath[] = _PATH_PSA; -char *psaargv[] = { "psa", 0, 0, 0, 0 }; +static char psapath[] = _PATH_PSA; +static char *psaargv[] = { "psa", 0, 0, 0, 0 }; /* * If we're not doing accounting, we just call pap as below. @@ -65,23 +65,23 @@ char *psaargv[] = { "psa", 0, 0, 0, 0 }; * arg 4. The second time, we call it with "-c" in arg 2, pagecount.ps * in arg 3, and 0 in arg 4. */ -char pappath[] = _PATH_PAP; -char *papargv[] = { "pap", "-sstatus", 0, 0, 0, 0, 0, 0 }; +static char pappath[] = _PATH_PAP; +static char *papargv[] = { "pap", "-sstatus", 0, 0, 0, 0, 0, 0 }; -char revpath[] = _PATH_PSORDER; -char *revargv[] = { "psorder", "-d", 0 }; +static char revpath[] = _PATH_PSORDER; +static char *revargv[] = { "psorder", "-d", 0 }; -char *filtargv[] = { 0, 0, 0 }; +static char *filtargv[] = { 0, 0, 0 }; -char inbuf[ 1024 * 8 ]; -int inlen; +static char inbuf[ 1024 * 8 ]; +static int inlen; -FILE *acctfile = NULL; -int literal; -int width = 80, length = 66, indent = 0; -char *prog, *name, *host; +static FILE *acctfile = NULL; +static int literal; +static int width = 80, length = 66, indent = 0; +static char *prog, *name, *host; -struct papersize { +static struct papersize { int width; int length; float win; @@ -458,10 +458,10 @@ notdone: return( 0 ); } -char *font = "Courier"; -int point = 11; +static char *font = "Courier"; +static int point = 11; -char pspro[] = "\ +static char pspro[] = "\ /GSV save def % global VM\n\ /SP {\n\ /SV save def % save vmstate\n\ diff --git a/etc/uams/uams_guest.c b/etc/uams/uams_guest.c index 97c934b0..963c34ee 100644 --- a/etc/uams/uams_guest.c +++ b/etc/uams/uams_guest.c @@ -1,5 +1,5 @@ /* - * $Id: uams_guest.c,v 1.15 2009-10-13 22:55:37 didg Exp $ + * $Id: uams_guest.c,v 1.16 2009-10-14 01:38:28 didg Exp $ * * (c) 2001 (see COPYING) */ @@ -88,7 +88,7 @@ static int noauth_login_ext(void *obj, char *uname _U_, struct passwd **uam_pwd, /* Printer NoAuthUAM Login */ -int noauth_printer(char *start, char *stop, char *username, struct papfile *out) +static int noauth_printer(char *start, char *stop, char *username, struct papfile *out) { char *data, *p, *q; static const char *loginok = "0\r"; diff --git a/etc/uams/uams_pam.c b/etc/uams/uams_pam.c index afa62cd9..ebf483b5 100644 --- a/etc/uams/uams_pam.c +++ b/etc/uams/uams_pam.c @@ -1,5 +1,5 @@ /* - * $Id: uams_pam.c,v 1.19 2009-10-13 22:55:37 didg Exp $ + * $Id: uams_pam.c,v 1.20 2009-10-14 01:38:28 didg Exp $ * * Copyright (c) 1990,1993 Regents of The University of Michigan. * Copyright (c) 1999 Adrian Sun (asun@u.washington.edu) @@ -343,7 +343,7 @@ static int pam_changepw(void *obj _U_, char *username, /* Printer ClearTxtUAM login */ -int pam_printer(char *start, char *stop, char *username, struct papfile *out) +static int pam_printer(char *start, char *stop, char *username, struct papfile *out) { int PAM_error; char *data, *p, *q; diff --git a/include/atalk/adouble.h b/include/atalk/adouble.h index a9cd08bd..bc6bb196 100644 --- a/include/atalk/adouble.h +++ b/include/atalk/adouble.h @@ -1,5 +1,5 @@ /* - * $Id: adouble.h,v 1.44 2009-10-13 22:55:37 didg Exp $ + * $Id: adouble.h,v 1.45 2009-10-14 01:38:28 didg Exp $ * Copyright (c) 1990,1991 Regents of The University of Michigan. * All Rights Reserved. * @@ -500,6 +500,7 @@ static inline mode_t ad_hf_mode (mode_t mode) } /* ad_read.c/ad_write.c */ +extern int sys_ftruncate(int fd, off_t length); 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); diff --git a/include/atalk/unicode.h b/include/atalk/unicode.h index b24ee4a5..bd2b897c 100644 --- a/include/atalk/unicode.h +++ b/include/atalk/unicode.h @@ -96,14 +96,16 @@ 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 int isupper_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 ucs2_t *strcasechr_w (const ucs2_t *s, ucs2_t c); 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 *strstr_w (const ucs2_t *s, const ucs2_t *ins); 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 *); diff --git a/libatalk/atp/atp_rsel.c b/libatalk/atp/atp_rsel.c index 92f97868..bc6ec56c 100644 --- a/libatalk/atp/atp_rsel.c +++ b/libatalk/atp/atp_rsel.c @@ -1,5 +1,5 @@ /* - * $Id: atp_rsel.c,v 1.5 2009-10-13 22:55:37 didg Exp $ + * $Id: atp_rsel.c,v 1.6 2009-10-14 01:38:28 didg Exp $ * * Copyright (c) 1990,1997 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. @@ -31,7 +31,7 @@ static int release_count = 0; #endif /* DROP_ATPTREL */ -int +static int resend_request(ATP ah) { /* diff --git a/libatalk/cnid/cdb/cnid_cdb_add.c b/libatalk/cnid/cdb/cnid_cdb_add.c index e48ed5b4..ca3447f7 100644 --- a/libatalk/cnid/cdb/cnid_cdb_add.c +++ b/libatalk/cnid/cdb/cnid_cdb_add.c @@ -1,5 +1,5 @@ /* - * $Id: cnid_cdb_add.c,v 1.4 2008-12-03 18:35:44 didg Exp $ + * $Id: cnid_cdb_add.c,v 1.5 2009-10-14 01:38:28 didg Exp $ * * Copyright (c) 1999. Adrian Sun (asun@zoology.washington.edu) * All Rights Reserved. See COPYRIGHT. @@ -72,7 +72,7 @@ unsigned char *make_cnid_data(const struct stat *st,const cnid_t did, } /* --------------- */ -int db_stamp(void *buffer, size_t size) +static int db_stamp(void *buffer, size_t size) { time_t t; memset(buffer, 0, size); diff --git a/libatalk/dsi/dsi_stream.c b/libatalk/dsi/dsi_stream.c index fbbfbcc9..6c8ffcd9 100644 --- a/libatalk/dsi/dsi_stream.c +++ b/libatalk/dsi/dsi_stream.c @@ -1,5 +1,5 @@ /* - * $Id: dsi_stream.c,v 1.12 2005-04-28 20:50:02 bfernhomberg Exp $ + * $Id: dsi_stream.c,v 1.13 2009-10-14 01:38:28 didg Exp $ * * Copyright (c) 1998 Adrian Sun (asun@zoology.washington.edu) * All rights reserved. See COPYRIGHT. @@ -51,7 +51,7 @@ /* ------------------------- * we don't use a circular buffer. */ -void dsi_buffer(DSI *dsi) +static void dsi_buffer(DSI *dsi) { fd_set readfds, writefds; int len; diff --git a/libatalk/tdb/tdb.c b/libatalk/tdb/tdb.c index 369bf04b..70255d45 100644 --- a/libatalk/tdb/tdb.c +++ b/libatalk/tdb/tdb.c @@ -1975,12 +1975,12 @@ int tdb_chainunlock(TDB_CONTEXT *tdb, TDB_DATA key) return tdb_unlock(tdb, BUCKET(tdb_hash(&key)), F_WRLCK); } -int tdb_chainlock_read(TDB_CONTEXT *tdb, TDB_DATA key) +static int tdb_chainlock_read(TDB_CONTEXT *tdb, TDB_DATA key) { return tdb_lock(tdb, BUCKET(tdb_hash(&key)), F_RDLCK); } -int tdb_chainunlock_read(TDB_CONTEXT *tdb, TDB_DATA key) +static int tdb_chainunlock_read(TDB_CONTEXT *tdb, TDB_DATA key) { return tdb_unlock(tdb, BUCKET(tdb_hash(&key)), F_RDLCK); } diff --git a/libatalk/unicode/charcnv.c b/libatalk/unicode/charcnv.c index f560ad08..9429bb61 100644 --- a/libatalk/unicode/charcnv.c +++ b/libatalk/unicode/charcnv.c @@ -170,7 +170,7 @@ if (ch == CH_UNIX) ret = NULL; return ret; } -struct charset_functions* get_charset_functions (charset_t ch) +static struct charset_functions* get_charset_functions (charset_t ch) { if (charsets[ch] != NULL) return charsets[ch]; @@ -181,7 +181,7 @@ struct charset_functions* get_charset_functions (charset_t ch) } -void lazy_initialize_conv(void) +static void lazy_initialize_conv(void) { static int initialized = 0; diff --git a/libatalk/unicode/iconv.c b/libatalk/unicode/iconv.c index 4df0e93d..17125004 100644 --- a/libatalk/unicode/iconv.c +++ b/libatalk/unicode/iconv.c @@ -157,7 +157,7 @@ int atalk_register_charset(struct charset_functions *funcs) return 0; } -void lazy_initialize_iconv(void) +static void lazy_initialize_iconv(void) { static int initialized = 0; int i; diff --git a/libatalk/unicode/util_unistr.c b/libatalk/unicode/util_unistr.c index ab169464..45ffcd93 100644 --- a/libatalk/unicode/util_unistr.c +++ b/libatalk/unicode/util_unistr.c @@ -334,7 +334,7 @@ ucs2_t *strcat_w(ucs2_t *dest, const ucs2_t *src) /* ------------------------ */ -ucs2_t do_precomposition(unsigned int base, unsigned int comb) +static ucs2_t do_precomposition(unsigned int base, unsigned int comb) { int min = 0; int max = sizeof(precompositions) / sizeof(precompositions[0]) - 1; @@ -358,7 +358,7 @@ ucs2_t do_precomposition(unsigned int base, unsigned int comb) } /* -------------------------- */ -u_int32_t do_decomposition(ucs2_t base) +static u_int32_t do_decomposition(ucs2_t base) { int min = 0; int max = sizeof(decompositions) / sizeof(decompositions[0]) - 1; diff --git a/libatalk/util/locking.c b/libatalk/util/locking.c index f42edac8..7fdb5d81 100644 --- a/libatalk/util/locking.c +++ b/libatalk/util/locking.c @@ -1,5 +1,5 @@ /* - $Id: locking.c,v 1.1 2009-10-02 09:32:41 franklahm Exp $ + $Id: locking.c,v 1.2 2009-10-14 01:38:29 didg Exp $ Copyright (c) 2009 Frank Lahm This program is free software; you can redistribute it and/or modify @@ -15,6 +15,7 @@ #include #include +#include /* * Function: lock_reg diff --git a/libatalk/util/logger.c b/libatalk/util/logger.c index 7aef01a6..132662b5 100644 --- a/libatalk/util/logger.c +++ b/libatalk/util/logger.c @@ -208,7 +208,7 @@ static void generate_message_details(char *message_details_buffer, strncat(ptr, "): ", len); } -int get_syslog_equivalent(enum loglevels loglevel) +static int get_syslog_equivalent(enum loglevels loglevel) { switch (loglevel) { diff --git a/libatalk/util/server_ipc.c b/libatalk/util/server_ipc.c index dadeda6a..03195416 100644 --- a/libatalk/util/server_ipc.c +++ b/libatalk/util/server_ipc.c @@ -1,5 +1,5 @@ /* - * $Id: server_ipc.c,v 1.2 2005-04-28 20:50:05 bfernhomberg Exp $ + * $Id: server_ipc.c,v 1.3 2009-10-14 01:38:29 didg Exp $ * * All rights reserved. See COPYRIGHT. * @@ -56,7 +56,7 @@ int server_ipc_parent(void *obj _U_) } /* ----------------- */ -int ipc_kill_token (struct ipc_header *ipc, server_child *children) +static int ipc_kill_token (struct ipc_header *ipc, server_child *children) { pid_t pid; @@ -72,7 +72,7 @@ int ipc_kill_token (struct ipc_header *ipc, server_child *children) } /* ----------------- */ -int ipc_get_session (struct ipc_header *ipc, server_child *children) +static int ipc_get_session (struct ipc_header *ipc, server_child *children) { u_int32_t boottime; u_int32_t idlen; diff --git a/libatalk/vfs/vfs.c b/libatalk/vfs/vfs.c index d8e01804..0dc4df4e 100644 --- a/libatalk/vfs/vfs.c +++ b/libatalk/vfs/vfs.c @@ -113,7 +113,7 @@ static int RF_chown_adouble(const struct vol *vol, const char *path, uid_t uid, } /* ----------------- */ -int RF_renamedir_adouble(const struct vol *vol _U_, const char *oldpath _U_, const char *newpath _U_) +static int RF_renamedir_adouble(const struct vol *vol _U_, const char *oldpath _U_, const char *newpath _U_) { return 0; } @@ -273,7 +273,7 @@ static int RF_deletefile_adouble(const struct vol *vol, const char *file ) } /* ----------------- */ -int RF_renamefile_adouble(const struct vol *vol, const char *src, const char *dst) +static int RF_renamefile_adouble(const struct vol *vol, const char *src, const char *dst) { char adsrc[ MAXPATHLEN + 1]; int err = 0; @@ -658,7 +658,7 @@ static int RF_deletefile_ads(const struct vol *vol, const char *file ) } /* --------------------------- */ -int RF_renamefile_ads(const struct vol *vol, const char *src, const char *dst) +static int RF_renamefile_ads(const struct vol *vol, const char *src, const char *dst) { char adsrc[ MAXPATHLEN + 1]; int err = 0; @@ -714,7 +714,7 @@ static int validupath_osx(const struct vol *vol, const char *name) } /* ---------------- */ -int RF_renamedir_osx(const struct vol *vol, const char *oldpath, const char *newpath) +static int RF_renamedir_osx(const struct vol *vol, const char *oldpath, const char *newpath) { /* We simply move the corresponding ad file as well */ char tempbuf[258]="._"; @@ -722,7 +722,7 @@ int RF_renamedir_osx(const struct vol *vol, const char *oldpath, const char *new } /* ---------------- */ -int RF_deletecurdir_osx(const struct vol *vol) +static int RF_deletecurdir_osx(const struct vol *vol) { return netatalk_unlink( vol->vfs->ad_path(".",0) ); } @@ -748,7 +748,7 @@ RF_setdirowner_osx(const struct vol *vol _U_, const char *path _U_, uid_t uid _U } /* ---------------- */ -int RF_renamefile_osx(const struct vol *vol, const char *src, const char *dst) +static int RF_renamefile_osx(const struct vol *vol, const char *src, const char *dst) { char adsrc[ MAXPATHLEN + 1]; int err = 0; @@ -767,7 +767,7 @@ int RF_renamefile_osx(const struct vol *vol, const char *src, const char *dst) return 0; } -struct vfs_ops netatalk_adouble = { +static struct vfs_ops netatalk_adouble = { /* ad_path: */ ad_path, /* validupath: */ validupath_adouble, /* rf_chown: */ RF_chown_adouble, @@ -785,7 +785,7 @@ struct vfs_ops netatalk_adouble = { #endif }; -struct vfs_ops netatalk_adouble_osx = { +static struct vfs_ops netatalk_adouble_osx = { /* ad_path: */ ad_path_osx, /* validupath: */ validupath_osx, /* rf_chown: */ RF_chown_adouble, @@ -800,7 +800,7 @@ struct vfs_ops netatalk_adouble_osx = { }; /* samba sfm format. ad_path shouldn't be set her */ -struct vfs_ops netatalk_adouble_sfm = { +static struct vfs_ops netatalk_adouble_sfm = { /* ad_path: */ ad_path_sfm, /* validupath: */ validupath_adouble, /* rf_chown: */ RF_chown_ads,