/*
- * $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.
void usage(char *);
-void done()
+void done(int sig _U_)
{
if ( nsent) {
printf( "\n----%d.%d AEP Statistics----\n",
exit( 0 );
}
-void aep_send()
+void aep_send(int sig _U_)
{
struct timeval tv;
char *p, buf[ 1024 ];
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;
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);
}
}
/*
- * $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
}
/* Print the version. */
-void version()
+void version(void)
{
fprintf(stderr, "achfile (netatalk " VERSION ")\n");
}
/*
- * $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
}
/* Print the version. */
-void version()
+void version(void)
{
fprintf(stderr, "afile (netatalk " VERSION ")\n");
}
/*
- $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 <franklahm@gmail.com>
#include <atalk/volinfo.h>
#include "ad.h"
-static void usage_main()
+static void usage_main(void)
{
/*
printf("Usage: ad ls|rm|cp|mv|set [file|dir, ...]\n");
/*
- $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 <franklahm@gmail.com>
}
-static void usage_cp()
+static void usage_cp(void)
{
printf(
"Usage: ad cp [-R [-L | -P]] [-pv] <source_file> <target_file>\n"
/*
- $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 <franklahm@gmail.com>
}
-static void usage_ls()
+static void usage_ls(void)
{
printf(
"Usage: ad ls [-dRl[u]] [file|dir, ...]\n\n"
/*
- * $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
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;
/*
- * $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
* 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;
* 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 ));
* 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
*
*/
-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;
/*
- * $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
#include "megatron.h"
#include "nad.h"
#include "hqx.h"
+#include "updcrc.h"
#define HEXOUTPUT 0
#define BHH_CRCSIZ 2
#define BHH_HEADSIZ 21
-u_short updcrc();
-
/* Forward declarations.
*/
int skip_junk(int line);
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;
* 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 ));
* 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;
* 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;
* hqx_header_write.
*/
-int hqx_header_write( fh )
- struct FHeader *fh _U_;
+int hqx_header_write(struct FHeader *fh _U_)
{
return( -1 );
}
* 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;
* OTHER when looking for any subsequent line.
*/
-int skip_junk( line )
-int line;
+int skip_junk(int line)
{
int found = NOWAY;
int stopflag;
* 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;
/*
- * $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
#include <netatalk/endian.h>
#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
* 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;
* 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" );
* 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;
* 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;
* 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;
* 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;
/*
- * $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
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 */
/*
- * $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
"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 :
}
}
-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 :
}
}
-int from_close( un )
- int un;
+int from_close(int un)
{
switch ( un ) {
case MEGATRON :
}
}
-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 :
}
}
-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 :
}
}
-int to_close( to, keepflag )
- int to;
- int keepflag;
+int to_close(int to, int keepflag)
{
switch ( to ) {
case MEGATRON :
}
}
-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;
return( from_close( module ));
}
-int main( argc, argv )
- int argc;
- char **argv;
+int main(int argc, char **argv)
{
int rc, c;
int rv = 0;
/*
- * $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
# 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)
/*
- * $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
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;
#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;
}
-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;
}
}
-int nad_header_read( fh )
- struct FHeader *fh;
+int nad_header_read(struct FHeader *fh)
{
u_int32_t temptime;
struct stat st;
}
-int nad_header_write( fh )
- struct FHeader *fh;
+int nad_header_write(struct FHeader *fh)
{
u_int32_t temptime;
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;
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;
return( bufc );
}
-int nad_close( status )
-int status;
+int nad_close(int status)
{
int rv;
if ( status == KEEP ) {
/*
- * $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
*
#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
#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
} ;
WTYPE
-updcrc( icrc, icp, icnt )
- WTYPE icrc;
- unsigned char *icp;
- int icnt;
+updcrc(WTYPE icrc, unsigned char *icp, int icnt)
{
register WTYPE crc = icrc;
register unsigned char *cp = icp;
#ifdef MAKETAB
#include <stdio.h>
-main()
+int main(void)
{
initcrctab();
}
-initcrctab()
+void initcrctab(void)
{
register int b, i;
WTYPE v;
-main( ac, av )
- int ac; char **av;
+main( int ac, char **av)
{
int fd;
int nr;
--- /dev/null
+/*
+ * $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 */
/*
- * $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.
char *Type = "=";
char *Zone = "*";
-void Usage( av0 )
- char *av0;
+void Usage(char *av0)
{
char *p;
exit( 1 );
}
-int main( ac, av )
- int ac;
- char **av;
+int main(int ac, char **av)
{
struct nbpnve *nn;
char *name;
/*
- * $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.
#include <atalk/util.h>
#include <atalk/unicode.h>
-void Usage( av0 )
- char *av0;
+void Usage(char *av0)
{
char *p;
exit( 1 );
}
-int main( ac, av )
- int ac;
- char **av;
+int main(int ac, char **av)
{
struct sockaddr_at addr;
struct at_addr ataddr;
/*
- * $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.
#include <atalk/unicode.h>
-void Usage( av0 )
- char *av0;
+void Usage(char *av0)
{
char *p;
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;
/*
- * $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.
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;
}
char *
-paprc()
+paprc(void)
{
static char s[ 32 + 1 + 32 + 1 + 32 ];
char *name = NULL;
int debug;
-int main( ac, av )
- int ac;
- char **av;
+int main( int ac, char **av)
{
ATP atp;
struct atp_block atpb;
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;
}
}
-void updatestatus( s, len )
- char *s;
- int len;
+void updatestatus(char *s, int len)
{
int fd = -1;
struct iovec iov[ 3 ];
/*
- * $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.
/* Forward Declaration */
void getstatus(ATP atp, struct sockaddr_at *sat);
-void usage( path )
- char *path;
+void usage(char *path)
{
char *p;
}
char *
-paprc()
+paprc(void)
{
static char s[ 32 + 1 + 32 + 1 + 32 ];
char *name = 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;
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;
/*
- * $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.
#include "pa.h"
-pa_buf_t *pa_init( fd )
- int fd;
+pa_buf_t *pa_init(int fd)
{
pa_buf_t *h;
int rc;
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);
return( h->mark );
}
-char _pa_fixbuf( h )
- pa_buf_t *h;
+char _pa_fixbuf(pa_buf_t *h)
{
int rc;
char *t;
/*
- * $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.
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))))
/*
- * $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.
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;
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;
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;
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 );
-}
/*
- * $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.
struct pages_st pages;
};
-int
-psorder();
-
-void
-filesetup();
-
-void
-readps();
-
-int
-handletok();
-
-void
-writeps();
-
-void
-writelable();
-
-void
-temp2out();
-
-struct pspage_st
-*getpspage();
-
-void
-filecleanup();
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");
/*
- * $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.
/* -----------------------------
* SIGUSR1
*/
-static void afp_asp_timedown()
+static void afp_asp_timedown(int sig _U_)
{
struct sigaction sv;
struct itimerval it;
*/
extern volatile int reload_request;
-static void afp_asp_reload()
+static void afp_asp_reload(int sig _U_)
{
reload_request = 1;
}
/*
- * $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
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
/*
- * $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.
}
/* ------------------- */
-static void afp_dsi_timedown()
+static void afp_dsi_timedown(int sig _U_)
{
struct sigaction sv;
struct itimerval it;
*/
volatile int reload_request = 0;
-static void afp_dsi_reload()
+static void afp_dsi_reload(int sig _U_)
{
reload_request = 1;
}
}
#endif /* SERVERTEXT */
-static void alarm_handler()
+static void alarm_handler(int sig _U_)
{
int err;
/*
- * $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.
* 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 );
* Show extended version information about afpd and Netatalk.
* Used by "afp -V".
*/
-void show_version_extended( )
+void show_version_extended(void )
{
show_version( );
/*
- * $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.
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;
/*
* 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;
* 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;
}
-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;
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;
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;
/*
- * $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.
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;
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 );
}
/* ---------------------- */
-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;
/* ---------------------- */
-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;
}
/* ---------------------- */
-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;
}
/* ---------------------- */
-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;
}
/* ---------------------- */
-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;
}
/* ---------------------- */
-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;
}
/* ---------------------- */
-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;
}
-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();
* 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;
/* 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;
}
/* get rid of all of the uams */
-void auth_unload()
+void auth_unload(void)
{
struct uam_mod *mod, *prev, *start = &uam_modules;
/*
- * $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.
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 */
}
/* 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) {
}
/* Clears directory stack. */
-static void clearstack()
+static void clearstack(void)
{
save_cidx = -1;
while (dsidx > 0) {
/*
- * $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.
*
#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;
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 );
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;
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
};
#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 ];
}
-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;
}
/* ----------------------------- */
-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;
}
/* -------------------- */
-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;
}
/* ----------------------- */
-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;
/*
- * $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.
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
/*
- * $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.
* 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;
* 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;
/* --------------------------- */
/* 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;
/* 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;
#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;
* 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 */
}
/* ------------------------------------ */
-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;
* 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;
/* --- 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;
/* ---------------------------- */
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;
free(dir->d_m_name);
}
-void dirfree( dir )
-struct dir *dir;
+void dirfree(struct dir *dir)
{
if (!dir || (dir == SENTINEL))
return;
*/
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];
/*
* 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;
}
/* ----------------------------- */
-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;
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;
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;
* 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;
}
/* delete an empty directory */
-int deletecurdir( vol)
-const struct vol *vol;
+int deletecurdir(const struct vol *vol)
{
struct dirent *de;
struct stat st;
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;
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;
/* ------------------------------------
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;
/* 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;
/*
- * $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.
#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
/*
- * $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.
#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;
}
/* ----------------------------- */
-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);
}
/*
- * $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.
}
/* ----------------------------- */
-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;
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;
* 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;
/* -----------------------------------
*/
-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;
* 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;
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;
/* ------------------------------------ */
/* 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;
/* ------------------------------
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;
}
/* ------------------------------ */
-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;
#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;
/*
- * $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.
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
/*
- * $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.
#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 */
}
#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;
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;
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;
}
/* -------------------------------------------- */
-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;
}
/* ------------------------------- */
-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;
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];
/* ------------------------
* 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;
/*
- * $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
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
/*
- * $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.
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;
}
/* ---------------------------- */
-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;
}
/* ---------------------- */
-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;
}
/* ----------------------- */
-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;
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;
/* ---------------------- */
-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;
}
/* --------------------------- */
-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);
}
#undef UNLOCKBIT
/* --------------------------- */
-static int crlf( of )
-struct ofork *of;
+static int crlf(struct ofork *of)
{
struct extmap *em;
*
* 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;
}
/* ---------------------- */
-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;
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;
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;
}
/* this is very similar to closefork */
-int flushfork( ofork )
-struct ofork *ofork;
+int flushfork(struct ofork *ofork)
{
struct timeval tv;
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;
/* 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;
}
/* ---------------------------- */
-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);
}
/* ----------------------------
* 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;
/*
- * $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.
#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
/*
- * $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.
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;
#define ST_BEGIN 2
int
-parseline( len, token )
-int len;
-char *token;
+parseline(int len, char *token)
{
char *p, *e;
int state;
}
#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;
/*
- * $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.
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 */
/*
- * $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.
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;
/*
- * $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 $
*
*/
#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 */
/*
- * $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.
strlcpy(servermesg, message, MAXMESGSIZE);
}
-void readmessage(obj)
-AFPObj *obj;
+void readmessage(AFPObj *obj)
{
/* Read server message from file defined as SERVERTEXT */
#ifdef SERVERTEXT
#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;
/*
- * $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
/* 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 */
/*
- * $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:
/* 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;
/*
- * $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.
}
#ifdef DEBUG1
-void of_pforkdesc( f )
-FILE *f;
+void of_pforkdesc( FILE *f)
{
int ofrefnum;
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;
#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;
return NULL;
}
-void of_dealloc( of )
-struct ofork *of;
+void of_dealloc( struct ofork *of)
{
if (!oforks)
return;
/*
- * $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.
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
** 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;
* 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;
*/
static char *
-special( file, nfs )
-char *file;
-int *nfs;
+special( char *file, int *nfs)
{
static struct fs_data fsd;
#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;
#else /* BSD4_4 */
static char *
-special( file, nfs )
-char *file;
-int *nfs;
+special(char *file, int *nfs)
{
struct stat sb;
FILE *mtab;
#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;
}
-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;
#endif /* TRU64 */
}
-static int overquota( dqblk )
-struct dqblk *dqblk;
+static int overquota( struct dqblk *dqblk)
{
struct timeval tv;
#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;
/*
- * $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.
/* ---------------------
*/
-void status_reset()
+void status_reset(void)
{
Id = 0;
}
}
/* 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;
/*
- * $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
#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
/*
- * $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.
#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;
/*
- * $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.
#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
/*
- * $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.
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;
};
(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 */
/*
- * $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.
/*
* 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);
return( AFP_OK );
}
-static int utombits( bits )
-mode_t bits;
+static int utombits(mode_t bits)
{
int mbits;
/* --------------------------------
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;
*
* 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;
#endif
}
-int gmem( gid )
-const gid_t gid;
+int gmem(const gid_t gid)
{
int i;
return( 0 );
}
-static mode_t mtoubits( bits )
-u_char bits;
+static mode_t mtoubits(u_char bits)
{
mode_t mode;
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;
#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;
}
/* --------------------- */
-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);
/* --------------------- */
-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);
}
/* --------------------- */
-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;
}
/* ----------------------------- */
-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;
}
/* ----------------------------- */
-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) {
* 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;
/*
- * $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
#if defined(linux) || defined(ultrix) || defined(HAVE_QUOTA_H)
#ifndef NEED_QUOTACTL_WRAPPER
/*#include <sys/quota.h>*/
-/*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 <asm/types.h>
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
/*
- * $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.
#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);
}
/* ---------------- */
-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;
#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;
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;
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;
* [codepage:<file>] [casefold:<num>]
* <extension> 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],
}
}
-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;
}
/* ----------------------- */
-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;
}
/* ------------------------------- */
-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;
/* -------------------------
* 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;
}
/* ------------------------- */
-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;
/* --------------------------
poll if a volume is changed by other processes.
*/
-int pollvoltime(obj)
-AFPObj *obj;
+int pollvoltime(AFPObj *obj)
{
struct vol *vol;
struct timeval tv;
}
/* ------------------------- */
-void setvoltime(obj, vol )
-AFPObj *obj;
-struct vol *vol;
+void setvoltime(AFPObj *obj, struct vol *vol)
{
struct timeval tv;
}
/* ------------------------- */
-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;
}
/* ------------------------- */
-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;
/*
- * $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.
#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
/*
- * $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.
#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;
/*
- * $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
/*
- * $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.
#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 },
}
}
-int writeconf( cf )
- char *cf;
+int writeconf(char *cf)
{
struct stat st;
char *path, *p, newpath[ MAXPATHLEN ], line[ MAXLINELEN ];
* 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;
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;
}
/*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) {
}
/*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) {
}
/*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
return( 1 );
}
-int phase( iface, av )
- struct interface *iface;
- char **av;
+int phase(struct interface *iface, char **av)
{
int n;
char *pnum;
return( 2 );
}
-int net( iface, av )
- struct interface *iface;
- char **av;
+int net(struct interface *iface, char **av)
{
char *nrange;
char *stop;
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" );
return( 2 );
}
-int zone( iface, av )
- struct interface *iface;
- char **av;
+int zone(struct interface *iface, char **av)
{
struct ziptab *zt;
char *zname;
* 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;
* the interface structure and have it updated nicely.
*/
-struct interface *newiface( name )
- const char *name;
+struct interface *newiface( const char *name)
{
struct interface *niface;
}
#ifdef __svr4__
-int plumb()
+int plumb(void)
{
struct interface *iface;
char device[ MAXPATHLEN + 1], *p, *t;
/*
- * $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.
*/
extern struct interface *interfaces;
extern struct interface *ciface;
-struct interface *newiface __P((const char *));
+struct interface *newiface (const char *);
#endif /* ATALKD_INTERFACE_H */
/*
- * $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.
#include <atalk/compat.h>
#include <atalk/zip.h>
#include <atalk/rtmp.h>
+#include <atalk/nbp.h>
#include <atalk/ddp.h>
#include <atalk/atp.h>
#include <atalk/paths.h>
#include "list.h"
#include "rtmp.h"
#include "zip.h"
+#include "nbp.h"
#include "atserv.h"
#include "main.h"
#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;
}
#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;
/*
* 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;
atalkd_exit( 0 );
}
-int main( ac, av )
- int ac;
- char **av;
+int main( int ac, char **av)
{
extern char *optarg;
extern int optind;
* 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;
nfds++;
}
-int ifsetallmulti ( iname, set )
-const char *iname;
-int set;
+int ifsetallmulti (const char *iname, int set)
{
int sock;
struct ifreq ifr;
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;
return( 0 );
}
-void dumpconfig( iface )
- struct interface *iface;
+void dumpconfig( struct interface *iface)
{
struct list *l;
}
#ifdef DEBUG
-void dumproutes()
+void dumproutes(void)
{
struct interface *iface;
struct rtmptab *rtmp;
fflush( stdout );
}
-void dumpzones()
+void dumpzones(void)
{
struct interface *iface;
struct rtmptab *rtmp;
/*
- * $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
#include <sys/cdefs.h>
#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 */
/*
- * $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.
}
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;
* alike.)
*/
int
-zone_bcast( zt )
- struct ziptab *zt;
+zone_bcast( struct ziptab *zt)
{
u_char uname[ 32 ];
u_int16_t cksum;
/*
- * $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.
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 */
/*
- * $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.
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 ];
}
}
-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;
/*
- * $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;
};
extern struct nbptab *nbptab;
+
+int nbp_packet(struct atport *ap, struct sockaddr_at *from, char *data, int len);
+
+#endif
/*
- * $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.
#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;
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;
/*
- * $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
#include <sys/cdefs.h>
#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 */
/*
- * $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.
#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;
/*
* 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;
* 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;
/*
* 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;
* 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;
* 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;
* 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;
}
-static int rtmp_new( rtmp )
- struct rtmptab *rtmp;
+static int rtmp_new(struct rtmptab *rtmp)
{
struct interface *i;
struct rtmptab *r;
}
-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;
return 0;
}
-int rtmp_request( iface )
- struct interface *iface;
+int rtmp_request( struct interface *iface)
{
struct sockaddr_at sat;
struct atport *ap;
}
-int looproute( iface, cmd )
- struct interface *iface;
- unsigned int cmd;
+int looproute(struct interface *iface, unsigned int cmd)
{
struct sockaddr_at dst, loop;
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;
/*
- * $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.
*
#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 */
/*
- * $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.
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;
}
-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;
return 0;
}
-int zip_getnetinfo( iface )
- struct interface *iface;
+int zip_getnetinfo(struct interface *iface)
{
struct atport *ap;
struct ziphdr zh;
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;
* 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;
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;
/*
- * $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.
};
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 */
/*
- $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 <franklahm@gmail.com>
close(lockfd);
}
-static void usage ()
+static void usage (void)
{
printf("Usage: dbd [-e|-v|-x] -d [-i] | -s [-n]| -r [-f] | -u <path to netatalk volume>\n"
"dbd can dump, scan, reindex and rebuild Netatalk dbd CNID databases.\n"
/*
- * $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.
}
/* ------------------ */
-uid_t user_to_uid ( username )
- char *username;
+uid_t user_to_uid (char *username)
{
struct passwd *this_passwd;
}
/* ------------------ */
-gid_t group_to_gid ( group )
- char *group;
+gid_t group_to_gid ( char *group)
{
struct group *this_group;
/*
- * $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.
* 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;
/*
- * $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.
#include <atalk/cnid_dbd_private.h>
-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 */
/*
- * $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
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;
/*
- * $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.
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 */
/*
- * $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
static char *old_dbfiles[] = {"cnid.db", NULL};
/* --------------- */
-static int upgrade_required()
+static int upgrade_required(void)
{
int i;
int found = 0;
/*
- * $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.
}
/* --------------- */
-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;
}
/* --------------- */
-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;
/*
- * $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.
#include <atalk/cnid_dbd_private.h>
-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)
/*
- * $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.
}
/* get rid of all of the uams */
-void auth_unload()
+void auth_unload(void)
{
struct uam_mod *mod, *prev, *start = &uam_modules;
/*
- * $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.
free( cs );
}
-void compush( comment )
- struct papd_comment *comment;
+void compush(struct papd_comment *comment)
{
struct comstate *cs;
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;
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;
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;
}
}
-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();
/*
- * $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.
*/
#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 */
/*
- * $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.
/*
*/
-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;
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;
}
-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)) {
}
-void spoolerror( out, str )
- struct papfile *out;
- char *str;
+void spoolerror(struct papfile *out, char *str)
{
char *pserr1 = "%%[ Error: ";
char *pserr2 = " ]%%\n";
/*
- * $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.
#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 */
/*
- * $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.
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;
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;
}
-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;
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;
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;
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;
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;
/*
- * $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.
}
-void lp_person( person )
- char *person;
+void lp_person(char *person)
{
if ( lp.lp_person != NULL ) {
free( lp.lp_person );
}
#ifdef ABS_PRINT
-int lp_pagecost()
+int lp_pagecost(void)
{
char cost[ 22 ];
char balance[ 22 ];
}
#endif /* ABS_PRINT */
-void lp_host( host )
- char *host;
+void lp_host( char *host)
{
if ( lp.lp_host != NULL ) {
free( lp.lp_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 );
}
-void lp_for ( lpfor )
- char *lpfor;
+void lp_for (char *lpfor)
{
if ( lp.lp_created_for != NULL ) {
free( lp.lp_created_for );
}
-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
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;
return( 0 );
}
-int lp_close()
+int lp_close(void)
{
if (( lp.lp_flags & LP_INIT ) == 0 || ( lp.lp_flags & LP_OPEN ) == 0 ) {
return 0;
-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];
return( 0 );
}
-int lp_cancel()
+int lp_cancel(void)
{
char name[ MAXPATHLEN ];
char letter;
*
* XXX piped?
*/
-int lp_print()
+int lp_print(void)
{
#ifndef HAVE_CUPS
char buf[ MAXPATHLEN ];
return( close( fd ));
}
-int lp_conn_unix()
+int lp_conn_unix(void)
{
int s;
struct sockaddr_un saun;
return( close( fd ));
}
-int lp_conn_inet()
+int lp_conn_inet(void)
{
int privfd, port = IPPORT_RESERVED - 1;
struct sockaddr_in sin;
return( privfd );
}
-int lp_rmjob( job )
- int job;
+int lp_rmjob( int job)
{
char buf[ 1024 ];
int n, s;
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;
/*
- * $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
#include <sys/cdefs.h>
#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 */
/*
- * $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.
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;
}
}
-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;
}
}
-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;
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;
/*
- * $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.
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;
papd_exit( n );
}
-#if !defined( ibm032 ) && !defined( _IBMR2 )
- void
-#endif /* ! ibm032 && ! _IBMR2 */
-reap()
+void
+reap(int sig _U_)
{
int status;
int pid;
char rbuf[ 255 + 1 + 8 ];
-int main( ac, av )
- int ac;
- char **av;
+int main(int ac, char **av)
{
extern char *optarg;
* 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
#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;
}
}
-int rprintcap( pr )
- struct printer *pr;
+int rprintcap( struct printer *pr)
{
#ifdef HAVE_CUPS
/*
- * $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.
#ifndef SHOWPPD
static int ppd_inited;
-static void ppd_init()
+static void ppd_init(void)
{
if (ppd_inited)
return;
/* 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;
return buf;
}
-static struct ppdent *getppdent( stream )
- FILE *stream;
+static struct ppdent *getppdent( FILE *stream)
{
static char buf[ 1024 ];
static struct ppdent ppdent;
return( NULL );
}
-int read_ppd( file, fcnt )
- char *file;
- int fcnt;
+int read_ppd(char *file, int fcnt)
{
FILE *ppdfile;
struct ppdent *pe;
return( 0 );
}
-struct ppd_font *ppd_font( font )
- char *font;
+struct ppd_font *ppd_font( char *font)
{
struct ppd_font *pfo;
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 ];
/*
- * $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.
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 */
/*
- * $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.
*
static void cups_free_printer ( struct printer *pr);
-char * cups_get_language ()
+char * cups_get_language (void)
{
cups_lang_t *language;
char * status_message;\r
};\r
\r
-int cups_printername_ok __P((char * ));\r
-const char * cups_get_printer_ppd __P(( char * ));\r
-int cups_get_printer_status __P((struct printer *pr));\r
-int cups_print_job __P(( char *, char *, char *, char *, char *));\r
-struct printer * cups_autoadd_printers __P(( struct printer *, struct printer *));\r
-int cups_check_printer __P(( struct printer *, struct printer *, int));\r
-char *cups_get_language __P(());\r
+int cups_printername_ok (char * );\r
+const char * cups_get_printer_ppd ( char * );\r
+int cups_get_printer_status (struct printer *pr);\r
+int cups_print_job ( char *, char *, char *, char *, char *);\r
+struct printer * cups_autoadd_printers ( struct printer *, struct printer *);\r
+int cups_check_printer ( struct printer *, struct printer *, int);\r
+char *cups_get_language ( void );\r
#endif /* HAVE_CUPS */\r
#endif /* PAPD_CUPS_H */\r
/*
- * $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.
#include <ctype.h>
#include <stdio.h>
#include <string.h>
+#include <stdlib.h>
+
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif /* HAVE_UNISTD_H */
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
* 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;
}
}
-void endprent()
+void endprent(void)
{
if (pfp != NULL)
fclose(pfp);
* 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;
* 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 */
* 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;
* 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 != ':')
* 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;
* 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;
}
}
-/*
- * 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;
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;
}
char *
-getpname( area, bufsize )
- char **area;
- int bufsize;
+getpname(char **area, int bufsize)
{
return( decodename( tbuf, area, bufsize));
}
/*
- * $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
#include <sys/cdefs.h>
-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 */
/*
- * $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.
-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;
#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;
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;
}
#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 );
}
}
-int gq_pagecost( out )
- struct papfile *out;
+int gq_pagecost( struct papfile *out)
{
char cost[ 60 ];
}
#ifdef ABS_PRINT
-int gq_balance( out )
- struct papfile *out;
+int gq_balance( struct papfile *out)
{
char balance[ 60 ];
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);
static const char *nouams = "*\n";
-int gq_rbiuamlist( out )
- struct papfile *out;
+int gq_rbiuamlist( struct papfile *out)
{
char uamnames[128] = "\0";
{ 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;
}
}
-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;
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;
}
}
-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;
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;
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;
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;
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;
/*
- * $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.
* 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;
/*
- * $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.
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;
/*
- * $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.
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;
};
(((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 */
/*
- * $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.
#include <stdlib.h>
#include <string.h>
-int main( ac, av )
- int ac;
- char **av;
+int main( int ac, char **av)
{
FILE *af;
char *acc, *user, *host;
/*
- * $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.
{ 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
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
/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;
* 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;
/*
- * $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)
/* logout */
-static void pam_logout() {
+static void pam_logout(void) {
pam_close_session(pamh, 0);
pam_end(pamh, 0);
pamh = NULL;
/*
- * $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)
}
/* logout */
-static void pam_logout() {
+static void pam_logout(void) {
pam_close_session(pamh, 0);
pam_end(pamh, 0);
pamh = NULL;
/*
- * $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)
*/
#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,
/* 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";
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");
/*
- * $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)
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
}
/* logout */
-static void pam_logout() {
+static void pam_logout(void) {
pam_close_session(pamh, 0);
pam_end(pamh, 0);
pamh = NULL;
/* 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;
/*
- * $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)
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,
/* 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
/*
- * $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.
*
#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))
}
/* 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 */
#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
/*
- * $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.
#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
#include <netinet/in.h>
#include <arpa/inet.h>
-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
#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
#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)
#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++)
#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
/*
- * $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.
#include <sys/socket.h>
#include <netatalk/at.h>
-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 <unistd.h>
} 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
};
/* 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
};
/* 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);
/*
- * $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
#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[];
#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 <dlfcn.h>
#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)
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 */
/*
/*
- * $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.
}
-int ad_flush( ad )
- struct adouble *ad;
+int ad_flush( struct adouble *ad)
{
int len;
}
/* 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;
/*
- * $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.
* 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];
*
*/
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];
#define DEFMASK 07700 /* be conservative */
char
-*ad_dir(path)
- const char *path;
+*ad_dir(const char *path)
{
static char modebuf[ MAXPATHLEN + 1];
char *slash;
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);
* 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;
* 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;
/*
- * $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.
/* 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;
/*
- * $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.
}
/* 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;
}
/* ------------------------ */
-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 ) {
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;
/*
- * $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.
#include <atalk/atp.h>
#include <atalk/asp.h>
-int asp_close( asp )
- ASP asp;
+int asp_close(ASP asp)
{
struct atp_block atpb;
struct iovec iov[ 1 ];
/*
- * $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.
#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;
/*
- * $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.
* + space: if actual connections < potential
* - space: actual connections ~ potential
*/
-static void tickle_handler()
+static void tickle_handler(int sig _U_)
{
int sid;
/*
- * $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.
#include <stdio.h>
#include <stdlib.h>
-ASP asp_init( atp )
- ATP atp;
+ASP asp_init(ATP atp)
{
ASP asp;
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;
/*
- * $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.
#include <atalk/atp.h>
#include <atalk/asp.h>
-int asp_shutdown( asp )
- ASP asp;
+int asp_shutdown(ASP asp)
{
struct atp_block atpb;
struct iovec iov;
/*
- * $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.
#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;
}
-int atp_free_buf( bp )
- struct atpbuf *bp;
+int atp_free_buf(struct atpbuf *bp)
{
if ( bp == NULL ) {
return -1;
/*
- * $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.
#include <stdio.h>
#endif /* EBUG */
-int atp_close( ah )
- ATP ah;
+int atp_close(ATP ah)
{
struct atpbuf *cq;
int i;
/*
- * $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.
#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 */
/*
- * $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.
#ifdef EBUG
#include <stdio.h>
-static void print_func( ctrlinfo )
- u_int8_t ctrlinfo;
+static void print_func(u_int8_t ctrlinfo)
{
switch ( ctrlinfo & ATP_FUNCMASK ) {
case ATP_TREQ:
}
}
-static void dump_packet( buf, len )
- char *buf;
- int len;
+static void dump_packet(char *buf, int len)
{
int i;
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." ) :
}
-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.
/*
- * $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.
/* 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 */
/*
- * $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.
#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;
/*
- * $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.
int
-resend_request( ah )
- ATP ah;
+resend_request(ATP ah)
{
/*
* update bitmap and send request packet
}
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;
/*
- * $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.
/* 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;
/* 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 */
/*
- * $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.
}
/* --------------- */
-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;
}
/* --------------- */
-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;
/*
- * $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
*/
/* 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 */
/*
- * $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 <rlewczuk@pronet.pl>
extern struct _cnid_module cnid_tdb_module;
#endif
-void cnid_init()
+void cnid_init(void)
{
#ifdef CNID_BACKEND_DB3
cnid_register(&cnid_db3_module);
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 */
/*
- * $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.
#include <atalk/cnid.h>
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 */
/* 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 */
};
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 */
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 */
/* 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,
/*
- * $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.
#include <sys/types.h>
#include <netatalk/endian.h>
-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 */
/*
- * $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.
}
/* 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);
/*
- * $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.
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 */
/*
- * $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.
#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;
/*
- * $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.
#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;
/*
- * $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.
#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;
/*
- * $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.
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;
#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;
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;
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);
* 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;
* 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;
arr_loglevel_strings[loglevel]);
}
-void log_close()
+void log_close(void)
{
}