-#include <stdio.h>
-#include <ac/ctype.h>
-#include <ac/string.h>
-extern char *strdup (const char *);
+#ifndef FAX500_H
+#define FAX500_H 1
/* in faxtotpc.c */
void strip_nonnum ( char *str );
char *remove_parens( char *ibuf, char *obuf );
char *munge_phone ( char *ibuf, char *obuf );
char *faxtotpc ( char *phone, char *userinfo );
+
+#endif
*/
#include "portable.h"
-#include "fax500.h"
+
+#include <stdio.h>
#include <sys/types.h>
+#include <ac/ctype.h>
+#include <ac/string.h>
+
+#include "fax500.h"
+
#define TPCDOMAIN "tpc.int"
/*
*/
#include "portable.h"
-#include "fax500.h"
+#include <stdio.h>
#include <stdlib.h>
#include <ac/socket.h>
+#include <ac/string.h>
#include <ac/syslog.h>
#include <ac/time.h>
#include <ac/wait.h>
#include <ac/unistd.h>
#include <ac/errno.h>
-extern int optind, errno;
-extern char *optarg;
#ifdef HAVE_SYS_PARAM_H
#include <sys/param.h>
#endif
-
+#ifdef HAVE_SYS_RESOURCE_H
#include <sys/resource.h>
+#endif
+
#include <sysexits.h>
#include "lber.h"
#include "ldap.h"
+#include "fax500.h"
+
#include <ldapconfig.h>
#define USER 0
*/
#include "portable.h"
-#include "fax500.h"
#include <stdlib.h>
-#include <signal.h>
+#include <ac/signal.h>
#include <ac/socket.h>
+#include <ac/string.h>
#include <ac/syslog.h>
#include <ac/time.h>
+#include <ac/unistd.h>
#include <ac/wait.h>
+#ifdef HAVE_SYS_RESOURCE_H
#include <sys/resource.h>
+#endif
#include <lber.h>
#include <ldap.h>
+#include "fax500.h"
+
#include <ldapconfig.h>
#define DEFAULT_PORT 79
static char *attrs[] = { "title", "o", "ou", "postalAddress",
"telephoneNumber", "mail",
"facsimileTelephoneNumber", NULL };
- extern char *optarg;
- extern int optind;
while ( (i = getopt( argc, argv, "ab:d:f:x:z:" )) != EOF ) {
switch( i ) {
#include <stdio.h>
#include <stdlib.h>
-#include <ctype.h>
-#include <signal.h>
+#include <ac/ctype.h>
+#include <ac/signal.h>
#include <ac/socket.h>
#include <ac/string.h>
#include <ac/syslog.h>
#include <ac/time.h>
#include <ac/unistd.h>
#include <ac/wait.h>
-extern char *strdup (const char *);
-extern int strcasecmp(const char *, const char *);
+#ifdef HAVE_SYS_RESOURCE_H
#include <sys/resource.h>
+#endif
#include "lber.h"
#include "ldap.h"
struct sockaddr_in peername;
int peernamelen;
int interactive = 0;
- extern char *optarg;
deref = FINGER_DEREF;
while ( (i = getopt( argc, argv, "f:ilp:t:x:p:c:" )) != EOF ) {
#include <ac/time.h>
#include <ac/unistd.h>
#include <ac/wait.h>
-extern char *strdup (const char *);
-extern int strcasecmp(const char *, const char *);
-extern int gethostname (char *, int);
#include <ac/setproctitle.h>
#include <sys/param.h>
#endif
+#ifdef HAVE_SYS_RESOURCE_H
#include <sys/resource.h>
+#endif
#include "ldapconfig.h"
#include "lber.h"
struct hostent *hp;
struct sockaddr_in from;
int fromlen;
- extern char *optarg;
#if defined( LDAP_PROCTITLE ) && !defined( HAVE_SETPROCTITLE )
/* for setproctitle */
static int
entry2textwrite( void *fp, char *buf, int len )
{
- return( fwrite( buf, len, 1, (FILE *)fp ) == 0 ? -1 : len );
+ return( fwrite( buf, len, 1, (FILE *)fp ) == 0 ? -1 : len );
}
static void
#include <ac/time.h>
#include <ac/unistd.h>
#include <ac/wait.h>
-extern int strcasecmp(const char *, const char *);
#include <ac/setproctitle.h>
-#include <sys/resource.h>
-
#ifdef HAVE_SYS_PARAM_H
#include <sys/param.h>
#endif
+#ifdef HAVE_SYS_RESOURCE_H
+#include <sys/resource.h>
+#endif
+
+
#include "lber.h"
#include "ldap.h"
#include "ldap_log.h"
struct hostent *hp;
struct sockaddr_in from;
int fromlen;
- extern char *optarg;
#if defined( LDAP_PROCTITLE ) && !defined( HAVE_SETPROCTITLE )
/* for setproctitle */
#include <stdio.h>
#include <stdlib.h>
-#include <ctype.h>
+#include <ac/ctype.h>
#include <ac/string.h>
#include <ac/syslog.h>
#include <ac/time.h>
#include <ac/wait.h>
#include <ac/unistd.h>
-extern char *strdup (const char *);
-extern int optind, errno;
-extern char *optarg;
#ifdef HAVE_SYS_PARAM_H
#include <sys/param.h>
#endif
+#ifdef HAVE_SYS_RESOURCE_H
#include <sys/resource.h>
+#endif
#include <sysexits.h>
static char *canonical( char *s );
static int connect_to_x500( void );
-void do_group_errors( LDAPMessage *e, char *dn, char ***to, int *nto, Error **err, int *nerr );
-void do_group_request( LDAPMessage *e, char *dn, char ***to, int *nto, Error **err, int *nerr );
-void do_group_owner( LDAPMessage *e, char *dn, char ***to, int *nto, Error **err, int *nerr );
-void add_member( char *gdn, char *dn, char ***to, int *nto, Group **togroups, int *ngroups, Error **err, int *nerr, char **suppress );
+static void do_group_errors( LDAPMessage *e, char *dn, char ***to, int *nto, Error **err, int *nerr );
+static void do_group_request( LDAPMessage *e, char *dn, char ***to, int *nto, Error **err, int *nerr );
+static void do_group_owner( LDAPMessage *e, char *dn, char ***to, int *nto, Error **err, int *nerr );
+static void add_member( char *gdn, char *dn, char ***to, int *nto, Group **togroups, int *ngroups, Error **err, int *nerr, char **suppress );
int
main ( int argc, char **argv )
}
}
-void
+static void
add_member(
char *gdn,
char *dn,
free( ndn );
}
-void
+static void
do_group_request(
LDAPMessage *e,
char *dn,
}
}
-void
+static void
do_group_errors(
LDAPMessage *e,
char *dn,
}
}
-void
+static void
do_group_owner(
LDAPMessage *e,
char *dn,
#include <ac/ctype.h>
#include <ac/string.h>
#include <ac/syslog.h>
-extern char *strdup (const char *);
-extern char *strstr (const char *, const char *);
+#include <ac/unistd.h>
#include "ldapconfig.h"
#include "rcpt500.h"
int c, errflg;
char *replytext;
- extern int optind;
- extern char *optarg;
-
*reply = '\0';
if (( prog = strrchr( argv[ 0 ], '/' )) == NULL ) {
#include <stdio.h>
#include <stdlib.h>
-#include <ctype.h>
+#include <ac/ctype.h>
#include <ac/string.h>
#include <ac/syslog.h>
#include <ac/time.h>
-extern int strcasecmp(const char *, const char *);
#include "lber.h"
#include "ldap.h"
#include <ac/string.h>
#include <ac/unistd.h>
-extern char *strdup (const char *);
#include <lber.h>
#include <ldap.h>
FILE *fp;
int i, rc, kerberos, authmethod;
- extern char *optarg;
- extern int optind;
-
kerberos = not = verbose = contoper = 0;
fp = NULL;
#include <ac/ctype.h>
#include <ac/string.h>
#include <ac/unistd.h>
-extern char *strdup (const char *);
#include <sys/stat.h>
int rc, i, kerberos, use_ldif, authmethod;
char *usage = "usage: %s [-abcknrvF] [-d debug-level] [-h ldaphost] [-p ldapport] [-D binddn] [-w passwd] [ -f file | < entryfile ]\n";
- extern char *optarg;
- extern int optind;
-
if (( prog = strrchr( argv[ 0 ], '/' )) == NULL ) {
prog = argv[ 0 ];
} else {
#include <ac/ctype.h>
#include <ac/string.h>
#include <ac/unistd.h>
-extern char *strdup (const char *);
#include <lber.h>
#include <ldap.h>
FILE *fp;
int rc, i, kerberos, remove, havedn, authmethod;
- extern char *optarg;
- extern int optind;
-
infile = NULL;
kerberos = not = contoper = verbose = remove = 0;
#include <ac/ctype.h>
#include <ac/string.h>
#include <ac/unistd.h>
-extern char *strdup (const char *);
-extern int strcasecmp(const char *, const char *);
-extern char *mktemp(char *);
#include <lber.h>
#include <ldap.h>
int rc, i, first, scope, kerberos, deref, attrsonly;
int referrals, timelimit, sizelimit, authmethod;
LDAP *ld;
- extern char *optarg;
- extern int optind;
infile = NULL;
deref = verbose = allow_binary = not = kerberos = vals2tmp =
#include <ac/string.h>
#include <ac/time.h>
#include <ac/unistd.h>
-extern char *strdup (const char *);
#ifdef HAVE_PWD_H
#include <pwd.h>
#include <ac/time.h>
#include <ac/wait.h>
#include <ac/unistd.h>
-extern char *strdup (const char *);
-extern char * mktemp(char *);
#ifdef HAVE_SYS_RESOURCE_H
#include <sys/resource.h>
#include <ac/ctype.h>
#include <ac/string.h>
#include <ac/time.h>
-extern char *strdup (const char *);
#include <lber.h>
#include <ldap.h>
#include <ac/ctype.h>
#include <ac/time.h>
#include <ac/unistd.h>
-extern char *strdup (const char *);
#include <lber.h>
#include <ldap.h>
#include <stdio.h>
#include <stdlib.h>
#include <setjmp.h>
-extern char *strdup (const char *);
-extern char *getenv(const char *);
#ifdef HAVE_PWD_H
#include <pwd.h>
int
main( int argc, char **argv )
{
- extern char *optarg; /* for parsing argv */
register int c; /* for parsing argv */
register char *cp; /* for parsing Version */
#include <ac/ctype.h>
#include <ac/string.h>
#include <ac/time.h>
-extern char *strdup (const char *);
#include <lber.h>
#include <ldap.h>
int strcmp(), strncmp();
int strcasecmp(), strncasecmp();
char *strdup();
+ char *strtok();
+ char *strpbrk();
int memcmp();
# endif
#if HAVE_UNISTD_H
# include <unistd.h>
+#else
+ /* we really should test for these */
+ char *crypt();
+ char *gethostname();
+ char *getenv();
+ long *random();
+ int flock();
#endif
/* getopt() defines may be in separate include file */
#if HAVE_GETOPT_H
-# include <getopt.h>
+# include <getopt.h>
+
+#elif !defined(HAVE_GETOPT)
+ /* no getopt, assume we need getopt-compat.h */
+# include <getopt-compat.h>
+
+#else
+ /* assume we need to declare these externs */
+ extern char *optarg;
+ extern int optind, opterr, optopt;
#endif
-#ifndef HAVE_GETOPT
-/* no getopt, assume we need getopt-compat.h */
-# include <getopt-compat.h>
+#ifndef HAVE_TEMPNAM
+ extern char *tempnam(const char *tmpdir, const char *prefix);
+#endif
+#ifndef HAVE_MKTEMP
+ extern char *mktemp(char *);
#endif
/* use _POSIX_VERSION for POSIX.1 code */
/* passwd.c */
LDAP_F int lutil_passwd LDAP_P((const char *cred, const char *passwd));
-/* strdup.c */
-#ifndef HAVE_STRDUP
-char *strdup (); /* No prototype, might conflict with someone else''s */
-#endif
-
-/* tempnam.c */
-#ifndef HAVE_TEMPNAM
-LDAP_F char *tempnam (); /* No prototype, might conflict with someone else''s */
-#endif
-
LDAP_END_DECL
#endif /* _LUTIL_H */
#include <ac/string.h>
#include <sys/types.h>
-extern char *strdup (const char *);
#include "avl.h"
#include <ac/string.h>
#include <ac/socket.h>
+#include <ac/unistd.h>
#ifdef HAVE_CONSOLE_H
#include <console.h>
int tag;
BerElement ber;
Sockbuf sb;
- extern char *optarg;
#ifdef HAVE_CONSOLE_H
ccommand( &argv );
#include <ac/socket.h>
#include <ac/string.h>
+#include <ac/unistd.h>
#ifdef HAVE_CONSOLE_H
#include <console.h>
Seqorset *sos = NULLSEQORSET;
BerElement *ber;
Sockbuf sb;
- extern char *optarg;
if ( argc < 2 ) {
usage( argv[0] );
unsigned long tag = 0, netlen, toread;
unsigned char lc;
long rc;
- unsigned int noctets, diff;
+ int noctets;
+ unsigned int diff;
#ifdef LDAP_DEBUG
if ( lber_debug )
#include <ac/string.h>
#include <ac/time.h>
#include <ac/unistd.h>
-extern char *strdup (const char *);
#ifdef HAVE_SYS_FILE_H
#include <sys/file.h>
#include <ac/ctype.h>
#include <ac/string.h>
#include <ac/time.h>
-extern char *strdup (const char *);
#ifdef HAVE_SYS_FILE_H
#include <sys/file.h>
#include <ac/socket.h>
#include <ac/string.h>
#include <ac/time.h>
-extern char *strdup (const char *);
#include "ldap-int.h"
#include <ac/socket.h>
#include <ac/string.h>
#include <ac/time.h>
-extern char *strdup (const char *);
-extern char *strtok (char *, const char *);
#include "ldap-int.h"
#include <ac/string.h>
#include <ac/ctype.h>
#include <ac/time.h>
-extern char *strdup (const char *);
#include "ldap-int.h"
#include "ldapconfig.h"
#include <ac/socket.h>
#include <ac/string.h>
-extern char *strdup (const char *);
#include "ldap-int.h"
#include <ac/string.h>
#include <ac/time.h>
#include <ac/unistd.h>
-extern char *strdup (const char *);
#include "ldap-int.h"
if ( ber_flush( lc->lconn_sb, ber, 0 ) != 0 ) {
#ifdef notyet
- extern int errno;
-
if ( errno == EWOULDBLOCK ) {
/* need to continue write later */
lr->lr_status = LDAP_REQST_WRITING;
#include <ac/socket.h>
#include <ac/string.h>
#include <ac/time.h>
-extern char *strdup (const char *);
#include "ldap-int.h"
#include <ac/string.h>
#include <ac/time.h>
#include <ac/unistd.h>
-extern char *strdup (const char *);
#include <sys/stat.h>
int copyoptions = 0;
LDAPURLDesc *ludp;
- extern char *optarg;
- extern int optind;
-
host = NULL;
port = LDAP_PORT;
dnsuffix = "";
#include <ac/socket.h>
#include <ac/time.h>
-extern char *strdup (const char *);
#include "ldap-int.h"
#include "ldapconfig.h"
#include <ac/socket.h>
#include <ac/string.h>
#include <ac/time.h>
-extern char *strdup (const char *);
#include "ldap-int.h"
#include "lutil_md5.h"
#include "lutil_sha1.h"
#include "lutil.h"
-extern char *crypt (const char *, const char *);
/*
*/
#ifndef HAVE_TEMPNAM
-#include <stdlib.h>
+#include <stdio.h>
#include <stdlib.h>
#include <ac/string.h>
-extern char *mktemp (char *);
+#include <ac/unistd.h>
#include "lutil.h"
char *
-tempnam( char *dir, char *pfx )
+tempnam( const char *dir, const char *pfx )
{
char *s;
return( s );
}
-#endif /* nextstep */
+#endif /* TEMPNAM */
#include <ac/socket.h>
#include <ac/string.h>
#include <ac/time.h>
-extern int errno;
#include <quipu/commonarg.h>
#include <quipu/ds_error.h>
#ifdef LDAP_PROCTITLE
char title[80];
#endif
- extern char *optarg;
- extern int optind;
#ifdef VMS
/* Pick up socket from inetd-type server on VMS */
#endif
#include <ac/ctype.h>
+#include <ac/errno.h>
#include <ac/socket.h>
#include <ac/string.h>
#include <ac/time.h>
#include "slap.h"
-extern int errno;
-
void
attr_free( Attribute *a )
{
#include <ac/socket.h>
#include <ac/string.h>
#include <ac/unistd.h>
-extern char *crypt ();
#include "slap.h"
#include "back-ldbm.h"
#include <ac/socket.h>
#include <ac/time.h>
#include <ac/unistd.h>
-extern int flock ();
#include <sys/file.h>
#include <sys/param.h>
char *myname;
Backend *be = NULL;
FILE *fp = NULL;
- extern char *optarg;
configfile = SLAPD_DEFAULT_CONFIGFILE;
port = LDAP_PORT;
#include <stdio.h>
#include <stdlib.h>
-#include <pwd.h>
#include <ac/string.h>
+#include <ac/unistd.h>
+
+#include <pwd.h>
#include <lber.h>
#include <ldap.h>
{
int c, errflg;
struct ldop op;
- extern int optind;
- extern char *optarg;
if (( progname = strrchr( argv[ 0 ], '/' )) == NULL ) {
progname = estrdup( argv[ 0 ] );
#include <stdio.h>
-#ifdef STDC_HEADERS
#include <stdlib.h>
-#include <stdarg.h>
-#else
-#include <varargs.h>
-#endif
+#include <ac/stdarg.h>
#include <pwd.h>
-#include <ac/string.h>
#include <ac/ctype.h>
-extern long int random (void);
+#include <ac/string.h>
#include <lber.h>
#include <ldap.h>
#include <ac/string.h>
#include <ac/time.h>
#include <ac/unistd.h> /* get link(), unlink() */
-extern char *strdup (const char *);
-extern char *strtok (char *, const char *);
-extern char *strpbrk (const char *, const char *);
#include <lber.h>
#include <ldap.h>
char buf[BUFSIZ];
int i, j, k, count;
char *s;
- extern int optind;
- extern char *optarg;
ldapsrcurl = NULL;
ldapdesturl = NULL;
#include <stdlib.h>
#include <ac/ctype.h>
+#include <ac/errno.h>
#include <ac/dirent.h>
#include <ac/string.h>
+#include <ac/unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
char *usage = "usage: %s [-d] [-o] [-r] [-v] [-b basedn] [-a addvalsfile] [-f fileattrdir] [-i ignoreattr...] [edbfile...]\n";
char edbfile[ MAXNAMLEN ], *basedn;
int c, rc, errflg, ignore_count, recurse;
- extern int optind;
- extern char *optarg;
extern char dsa_mode;
#ifdef HAVE_FILE_ATTR_DIR
extern char *file_attr_directory;
static void
print_err( char *msg )
{
- extern int sys_nerr;
- extern char *sys_errlist[];
- extern int errno;
-
#ifdef LDAP_DEBUG
if ( debugflg ) {
fprintf( stderr, "print_err( \"%s\" )\n", msg );
#include <sys/resource.h>
#include <sys/param.h>
#include <sys/stat.h>
-extern int mkstemp (char *);
#ifdef HAVE_FCNTL_H
#include <fcntl.h>
IDList *idl;
Backend *tbe;
int i;
- extern char *optarg;
#ifdef HAVE_BERKELEY_DB2
DBC *cursorp;
#include <ac/string.h>
#include <ac/socket.h>
+#include <ac/unistd.h>
#include "ldapconfig.h"
#include "../slap.h"
struct berval bv;
struct berval *vals[2];
Avlnode *avltypes = NULL;
- extern char *optarg;
tailorfile = SLAPD_DEFAULT_CONFIGFILE;
dbnum = -1;
#include <ac/string.h>
#include <ac/socket.h>
-extern int strcasecmp(const char *, const char *);
+#include <ac/unistd.h>
#include "ldapconfig.h"
#include "../slap.h"
struct berval *vals[2];
Avlnode *avltypes = NULL;
FILE *fp;
- extern char *optarg;
tailorfile = SLAPD_DEFAULT_CONFIGFILE;
dbnum = -1;
#include <ac/string.h>
#include <ac/socket.h>
+#include <ac/unistd.h>
#include "../slap.h"
#include "../back-ldbm/back-ldbm.h"
Backend *be = NULL;
struct berval bv;
struct berval *vals[2];
- extern char *optarg;
inputfile = NULL;
tailorfile = SLAPD_DEFAULT_CONFIGFILE;
struct berval bv;
struct berval *vals[2];
Avlnode *avltypes = NULL;
- extern char *optarg;
sbindir = DEFAULT_SBINDIR;
tailorfile = SLAPD_DEFAULT_CONFIGFILE;
#include <ac/string.h>
#include <ac/time.h>
+#include <ac/unistd.h>
#include <lber.h>
#include <ldap.h>
)
{
int i;
- extern char *optarg;
int rflag = 0;
if ( (g->myname = strrchr( argv[0], '/' )) == NULL ) {
#include <ac/socket.h>
#include <ac/time.h>
#include <ac/unistd.h>
-extern int flock ();
#include <sys/file.h>
#include <sys/param.h>
-#include "slurp.h" /* Was ../slapd/slap.h */
+#include "slurp.h"
FILE *