summaryrefslogtreecommitdiff
path: root/clients
diff options
context:
space:
mode:
authorGravatar Karl Ramm <kcr@mit.edu>2008-01-20 20:46:45 +0000
committerGravatar Karl Ramm <kcr@mit.edu>2008-01-20 20:46:45 +0000
commitfc8abb852f17e00ed7fd265e8e448e6e9537bab7 (patch)
tree77499715261118d5d09ced011fc4a0a7887b3cc1 /clients
parent938001f468fd4b17efa90c423720b950c7d9d05a (diff)
de K&Rify; drop xzwrite, zmailnotify && zpopnotify from Makefile
Diffstat (limited to 'clients')
-rw-r--r--clients/Makefile.in4
-rw-r--r--clients/zaway/zaway.c25
-rw-r--r--clients/zctl/zctl.c109
-rw-r--r--clients/zleave/zleave.c39
-rw-r--r--clients/zlocate/zlocate.c18
-rw-r--r--clients/znol/znol.c6
-rw-r--r--clients/zshutdown_notify/zshutdown_notify.c7
-rw-r--r--clients/zstat/zstat.c25
-rw-r--r--clients/zwrite/zwrite.c30
9 files changed, 123 insertions, 140 deletions
diff --git a/clients/Makefile.in b/clients/Makefile.in
index 42732e9..2ae4614 100644
--- a/clients/Makefile.in
+++ b/clients/Makefile.in
@@ -1,7 +1,7 @@
SHELL = /bin/sh
-SUBDIRS=@XCLIENTS@ zaway zctl zleave zlocate zmailnotify znol \
- zpopnotify zshutdown_notify zstat zwrite
+SUBDIRS=zaway zctl zleave zlocate znol \
+ zshutdown_notify zstat zwrite
all:
for i in ${SUBDIRS}; do (cd $$i; ${MAKE} $@) || exit 1; done
diff --git a/clients/zaway/zaway.c b/clients/zaway/zaway.c
index c8a5f58..67ff10a 100644
--- a/clients/zaway/zaway.c
+++ b/clients/zaway/zaway.c
@@ -24,11 +24,11 @@ static const char rcsid_zaway_c[] = "$Id$";
#define DEFAULT_MSG "I'm sorry, but I am currently away from the terminal and am\nnot able to receive your message.\n"
#define RESPONSE_OPCODE ""
-RETSIGTYPE cleanup();
+RETSIGTYPE cleanup(int);
u_short port;
-void usage(name)
- char *name;
+void
+usage(char *name)
{
printf("Usage: %s [OPTIONS] [FILE]\n"
"\n"
@@ -38,9 +38,9 @@ void usage(name)
name);
}
-int main(argc,argv)
- int argc;
- char *argv[];
+int
+main(int argc,
+ char *argv[])
{
FILE *fp;
ZNotice_t notice;
@@ -52,7 +52,7 @@ int main(argc,argv)
int optchar, watch_location;
char *cmdline_msg;
int nlocs;
- char *find_message();
+ char *find_message(ZNotice_t *, FILE *);
#ifdef _POSIX_VERSION
struct sigaction sa;
#endif
@@ -203,11 +203,11 @@ int main(argc,argv)
}
}
-char *find_message(notice,fp)
- ZNotice_t *notice;
- register FILE *fp;
+char *
+find_message(ZNotice_t *notice,
+ FILE *fp)
{
- register char *ptr,*ptr2;
+ char *ptr,*ptr2;
char bfr[BUFSIZ],sender[BUFSIZ];
int gotone,lastwasnt;
@@ -253,7 +253,8 @@ char *find_message(notice,fp)
return (ptr);
}
-RETSIGTYPE cleanup()
+RETSIGTYPE
+cleanup(int ignored)
{
ZCancelSubscriptions(port);
exit(1);
diff --git a/clients/zctl/zctl.c b/clients/zctl/zctl.c
index b1359be..de96d16 100644
--- a/clients/zctl/zctl.c
+++ b/clients/zctl/zctl.c
@@ -40,7 +40,6 @@ static const char *rcsid_zctl_c = "$Id$";
#define ERR (-1)
#define NOT_REMOVED 0
#define REMOVED 1
-int purge_subs();
int sci_idx;
char subsname[BUFSIZ];
@@ -48,11 +47,15 @@ char ourhost[MAXHOSTNAMELEN],ourhostcanon[MAXHOSTNAMELEN];
extern ss_request_table zctl_cmds;
-void add_file(), del_file(), fix_macros(), fix_macros2();
+int purge_subs(register ZSubscription_t *, int);
+void add_file(short, ZSubscription_t *, int);
+void del_file(short, ZSubscription_t *, int);
+void fix_macros(ZSubscription_t *, ZSubscription_t *, int);
+void fix_macros2(char *, char **);
-main(argc,argv)
- int argc;
- char *argv[];
+int
+main(int argc,
+ char *argv[])
{
struct passwd *pwd;
struct hostent *hent;
@@ -146,9 +149,8 @@ main(argc,argv)
}
void
-set_file(argc,argv)
- int argc;
- char *argv[];
+set_file(int argc,
+ char *argv[])
{
if (argc > 2) {
fprintf(stderr,"Usage: %s filename\n",argv[0]);
@@ -162,9 +164,8 @@ set_file(argc,argv)
}
void
-flush_locations(argc,argv)
- int argc;
- char *argv[];
+flush_locations(int argc,
+ char *argv[])
{
int retval;
@@ -178,9 +179,8 @@ flush_locations(argc,argv)
}
void
-wgc_control(argc,argv)
- int argc;
- register char **argv;
+wgc_control(int argc,
+ char *argv[])
{
int retval;
short newport;
@@ -239,9 +239,8 @@ wgc_control(argc,argv)
}
void
-hm_control(argc,argv)
- int argc;
- char *argv[];
+hm_control(int argc,
+ char *argv[])
{
int retval;
ZNotice_t notice;
@@ -276,9 +275,8 @@ hm_control(argc,argv)
}
void
-show_var(argc,argv)
- int argc;
- char *argv[];
+show_var(int argc,
+ char *argv[])
{
int i;
char *value;
@@ -298,9 +296,7 @@ show_var(argc,argv)
}
void
-set_var(argc,argv)
- int argc;
- register char **argv;
+set_var(int argc, char *argv[])
{
int retval,setting_exp,i;
char *exp_level,*newargv[1];
@@ -378,9 +374,8 @@ set_var(argc,argv)
}
void
-do_hide(argc,argv)
- int argc;
- char *argv[];
+do_hide(int argc,
+ char *argv[])
{
char *exp_level = NULL;
Code_t retval;
@@ -399,9 +394,8 @@ do_hide(argc,argv)
}
void
-unset_var(argc,argv)
- int argc;
- char *argv[];
+unset_var(int argc,
+ char *argv[])
{
int retval,i;
@@ -418,9 +412,8 @@ unset_var(argc,argv)
}
void
-cancel_subs(argc,argv)
- int argc;
- char *argv[];
+cancel_subs(int argc,
+ char *argv[])
{
int retval;
short wgport;
@@ -439,9 +432,8 @@ cancel_subs(argc,argv)
}
void
-subscribe(argc,argv)
- int argc;
- char *argv[];
+subscribe(int argc,
+ char *argv[])
{
int retval;
short wgport;
@@ -472,9 +464,8 @@ subscribe(argc,argv)
}
void
-sub_file(argc,argv)
- int argc;
- char *argv[];
+sub_file(int argc,
+ char *argv[])
{
ZSubscription_t sub;
short wgport;
@@ -523,10 +514,9 @@ sub_file(argc,argv)
}
void
-add_file(wgport,subs,unsub)
-short wgport;
-ZSubscription_t *subs;
-int unsub;
+add_file(short wgport,
+ ZSubscription_t *subs,
+ int unsub)
{
FILE *fp;
char errbuf[BUFSIZ];
@@ -557,10 +547,9 @@ int unsub;
}
void
-del_file(wgport,subs,unsub)
-short wgport;
-register ZSubscription_t *subs;
-int unsub;
+del_file(short wgport,
+ register ZSubscription_t *subs,
+ int unsub)
{
ZSubscription_t sub2;
int retval;
@@ -582,9 +571,8 @@ int unsub;
}
int
-purge_subs(subs,which)
-register ZSubscription_t *subs;
-int which;
+purge_subs(register ZSubscription_t *subs,
+ int which)
{
FILE *fp,*fpout;
char errbuf[BUFSIZ],subline[BUFSIZ];
@@ -665,9 +653,8 @@ int which;
}
void
-load_subs(argc,argv)
- int argc;
- char *argv[];
+load_subs(int argc,
+ char *argv[])
{
ZSubscription_t subs[SUBSATONCE],subs2[SUBSATONCE],unsubs[SUBSATONCE];
FILE *fp;
@@ -843,9 +830,8 @@ cleanup:
}
void
-current(argc,argv)
- int argc;
- char *argv[];
+current(int argc,
+ char *argv[])
{
FILE *fp;
char errbuf[BUFSIZ];
@@ -940,8 +926,7 @@ current(argc,argv)
}
int
-make_exist(filename)
- char *filename;
+make_exist(char *filename)
{
char errbuf[BUFSIZ];
FILE *fpout;
@@ -964,9 +949,9 @@ make_exist(filename)
}
void
-fix_macros(subs,subs2,num)
- ZSubscription_t *subs,*subs2;
- int num;
+fix_macros(ZSubscription_t *subs,
+ ZSubscription_t *subs2,
+ int num)
{
int i;
@@ -979,9 +964,7 @@ fix_macros(subs,subs2,num)
}
void
-fix_macros2(src,dest)
- register char *src;
- char **dest;
+fix_macros2(char *src, char **dest)
{
if (!strcmp(src,TOKEN_HOSTNAME)) {
*dest = ourhost;
diff --git a/clients/zleave/zleave.c b/clients/zleave/zleave.c
index 91e8c14..4483138 100644
--- a/clients/zleave/zleave.c
+++ b/clients/zleave/zleave.c
@@ -52,23 +52,27 @@ char copyright[] =
*/
char origlogin[20];
char tempfile[40];
-char *getlogin();
char *whenleave;
char *reminder_message = NULL;
char buff[100];
int use_zephyr=1, oldpid;
-void usage(), doalarm(), bother(), delay();
+void usage(void);
+void doalarm(long);
+void bother(long, char *);
+void delay(long);
+int gethm(char *, int *, int*);
-main(argc, argv)
-char **argv;
+int
+main(int argc,
+ char **argv)
{
time_t now;
- long when, diff, hours, minutes;
+ long when, diff;
+ int hours, minutes;
char *cp;
FILE *fp;
struct tm *nv;
- int gethm();
int port, c;
ZSubscription_t sub;
@@ -180,7 +184,7 @@ char **argv;
}
void
-usage()
+usage(void)
{
fprintf(stderr, "usage: zleave [[+]hhmm [-m \"Reminder Message\"]]\n\
\tor: zleave can[cel]\n");
@@ -188,12 +192,12 @@ usage()
}
int
-gethm(cp, hp, mp)
-register char *cp;
-int *hp, *mp;
+gethm(char *cp,
+ int *hp,
+ int *mp)
{
- register char c;
- register int tod;
+ char c;
+ int tod;
tod = 0;
while ((c = *cp++) != '\0') {
@@ -207,8 +211,7 @@ int *hp, *mp;
}
void
-doalarm(nmins)
-long nmins;
+doalarm(long nmins)
{
time_t daytime;
char *msg1, *msg2, *msg3, *msg4;
@@ -309,9 +312,8 @@ long nmins;
}
void
-bother(slp, msg)
-long slp;
-char *msg;
+bother(long slp,
+ char *msg)
{
ZNotice_t notice;
ZNotice_t retnotice;
@@ -384,8 +386,7 @@ char *msg;
* knows what zero means.
*/
void
-delay(secs)
-long secs;
+delay(long secs)
{
long n;
register char *l;
diff --git a/clients/zlocate/zlocate.c b/clients/zlocate/zlocate.c
index 4469565..9f048f3 100644
--- a/clients/zlocate/zlocate.c
+++ b/clients/zlocate/zlocate.c
@@ -21,21 +21,23 @@ static const char rcsid_zlocate_c[] = "$Id$";
int numusers=0, numleft=0, parallel=0, oneline=0;
char *whoami;
-RETSIGTYPE timeout(sig)
+RETSIGTYPE
+timeout(int sig)
{
fprintf (stderr, "%s: no response from server\n", whoami);
exit(1);
}
-void usage()
+void
+usage(void)
{
printf("Usage: %s [ -a | -d ] [ -p ] [ -1 ] user ... \n",whoami);
exit(1);
}
-void print_locs(user,nlocs)
- char *user;
- int nlocs;
+void
+print_locs(char *user,
+ int nlocs)
{
int one = 1, retval;
ZLocations_t locations;
@@ -65,9 +67,9 @@ void print_locs(user,nlocs)
}
/*ARGSUSED*/
-main(argc,argv)
- int argc;
- char *argv[];
+int
+main(int argc,
+ char *argv[])
{
char user[BUFSIZ],*whichuser;
ZAsyncLocateData_t ald;
diff --git a/clients/znol/znol.c b/clients/znol/znol.c
index 53fd47c..cdb0349 100644
--- a/clients/znol/znol.c
+++ b/clients/znol/znol.c
@@ -23,9 +23,9 @@ static const char rcsid_znol_c[] = "$Id$";
#define ON 1
#define OFF 0
-main(argc,argv)
- int argc;
- register char *argv[];
+int
+main(int argc,
+ char *argv[])
{
register char *cp;
ZSubscription_t subs[SUBSATONCE];
diff --git a/clients/zshutdown_notify/zshutdown_notify.c b/clients/zshutdown_notify/zshutdown_notify.c
index 4db5a32..f2b4932 100644
--- a/clients/zshutdown_notify/zshutdown_notify.c
+++ b/clients/zshutdown_notify/zshutdown_notify.c
@@ -41,9 +41,9 @@ static const char *rcsid_zshutdown_notify_c =
static char warning[] = "Please detach any filesystems you may have\nattached from this host by typing detach -host %s";
/*ARGSUSED*/
-main(argc,argv)
- int argc;
- char *argv[];
+int
+main(int argc,
+ char *argv[])
{
ZNotice_t notice;
struct hostent *hp;
@@ -57,7 +57,6 @@ main(argc,argv)
char rlm[REALM_SZ];
char hn2[MAXHOSTNAMELEN];
char *cp;
- extern char *krb_get_phost();
#endif
if (gethostname(hostname, MAXHOSTNAMELEN) < 0) {
diff --git a/clients/zstat/zstat.c b/clients/zstat/zstat.c
index 0c034f9..04951cc 100644
--- a/clients/zstat/zstat.c
+++ b/clients/zstat/zstat.c
@@ -47,16 +47,18 @@ int outoftime = 0;
int serveronly = 0,hmonly = 0;
u_short srv_port;
-void usage(), do_stat();
+void usage(char *);
+void do_stat(char *);
-RETSIGTYPE timeout()
+RETSIGTYPE
+timeout(int ignored)
{
outoftime = 1;
}
-main(argc, argv)
- int argc;
- char *argv[];
+int
+main(int argc,
+ char *argv[])
{
Code_t ret;
char hostname[MAXHOSTNAMELEN];
@@ -114,8 +116,7 @@ main(argc, argv)
}
void
-do_stat(host)
- char *host;
+do_stat(char *host)
{
char srv_host[MAXHOSTNAMELEN];
@@ -132,8 +133,8 @@ do_stat(host)
}
int
-hm_stat(host,server)
- char *host,*server;
+hm_stat(char *host,
+ char *server)
{
struct in_addr inaddr;
Code_t code;
@@ -196,8 +197,7 @@ hm_stat(host,server)
}
int
-srv_stat(host)
- char *host;
+srv_stat(char *host)
{
char *line[20],*mp;
int sock,i,nf,ret;
@@ -308,8 +308,7 @@ srv_stat(host)
}
void
-usage(s)
- char *s;
+usage(char *s)
{
fprintf(stderr,"usage: %s [-s] [-h] [host ...]\n",s);
exit(1);
diff --git a/clients/zwrite/zwrite.c b/clients/zwrite/zwrite.c
index f5dba36..a7f1fc4 100644
--- a/clients/zwrite/zwrite.c
+++ b/clients/zwrite/zwrite.c
@@ -31,14 +31,15 @@ static const char rcsid_zwrite_c[] = "$Id$";
int nrecips, msgarg, verbose, quiet, nodot, cc;
char *whoami, *inst, *class, *opcode, *realm, *recips[MAXRECIPS];
Z_AuthProc auth;
-void un_tabify();
+void un_tabify(char **, int *);
-char *fix_filsrv_inst();
-void usage(), send_off();
+char *fix_filsrv_inst(char *);
+void usage(char *);
+void send_off(ZNotice_t *, int);
-main(argc, argv)
- int argc;
- char *argv[];
+int
+main(int argc,
+ char *argv[])
{
int retval, arg, nocheck, nchars, msgsize, filsys, tabexpand;
char *message, *signature = NULL, *format = NULL;
@@ -338,9 +339,8 @@ main(argc, argv)
}
void
-send_off(notice, real)
- ZNotice_t *notice;
- int real;
+send_off(ZNotice_t *notice,
+ int real)
{
int i, success, retval;
char bfr[BUFSIZ], realm_recip[BUFSIZ], dest[3 * BUFSIZ], *cp;
@@ -445,8 +445,7 @@ send_off(notice, real)
}
void
-usage(s)
- char *s;
+usage(char *s)
{
fprintf(stderr,
"Usage: %s [-a] [-o] [-d] [-v] [-q] [-n] [-t] [-u] [-l]\n\
@@ -466,8 +465,8 @@ usage(s)
name returned by gethostbyname(hostname)
*/
-char *fix_filsrv_inst(str)
-char *str;
+char *
+fix_filsrv_inst(char *str)
{
static char fsinst[BUFSIZ];
char *ptr;
@@ -500,9 +499,8 @@ char *str;
#endif /* ! TABSTOP */
void
-un_tabify(bufp, sizep)
-char **bufp;
-register int *sizep;
+un_tabify(char **bufp,
+ int *sizep)
{
register char *cp, *cp2;
char *cp3;