From 07525ddf7b91025c56b7b15d27e3af524c120ddd Mon Sep 17 00:00:00 2001 From: "John F. Carr" Date: Thu, 20 Jun 1991 04:15:29 +0000 Subject: POSIX support; add zsub_ prefix where needed. --- clients/zaway/zaway.c | 31 ++++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) (limited to 'clients/zaway') diff --git a/clients/zaway/zaway.c b/clients/zaway/zaway.c index d575da2..67e2656 100644 --- a/clients/zaway/zaway.c +++ b/clients/zaway/zaway.c @@ -20,16 +20,20 @@ #include #ifndef lint -static char rcsid_zaway_c[] = "$Header$"; -#endif lint +static char rcsid_zaway_c[] = "$Id$"; +#endif #define MESSAGE_CLASS "MESSAGE" #define DEFAULT_MSG "I'm sorry, but I am currently away from the terminal and am\nnot able to receive your message.\n" -extern char *getenv(), *malloc(); +#ifdef _POSIX_SOURCE +#include +#else +extern char *getenv(), *malloc(), *realloc(); +#endif extern uid_t getuid(); -#ifdef ULTRIX30 +#if defined(ultrix) || defined(_POSIX_SOURCE) void cleanup(); #else int cleanup(); @@ -44,9 +48,10 @@ main(argc,argv) FILE *fp; ZNotice_t notice; ZSubscription_t sub; - int retval; + register int retval; struct passwd *pw; - char awayfile[BUFSIZ],*ptr,*msg[2],*envptr; + register char *ptr; + char awayfile[BUFSIZ],*msg[2],*envptr; char *find_message(); if ((retval = ZInitialize()) != ZERR_NONE) { @@ -60,9 +65,9 @@ main(argc,argv) exit(1); } - sub.class = MESSAGE_CLASS; - sub.classinst = "*"; - sub.recipient = ZGetSender(); + sub.zsub_class = MESSAGE_CLASS; + sub.zsub_classinst = "*"; + sub.zsub_recipient = ZGetSender(); if (argc > 1) (void) strcpy(awayfile,argv[1]); @@ -139,11 +144,11 @@ main(argc,argv) char *find_message(notice,fp) ZNotice_t *notice; - FILE *fp; + register FILE *fp; { - char bfr[BUFSIZ],*ptr,*ptr2,sender[BUFSIZ]; + register char *ptr,*ptr2; + char bfr[BUFSIZ],sender[BUFSIZ]; int gotone,lastwasnt; - char *realloc(); rewind(fp); @@ -187,7 +192,7 @@ char *find_message(notice,fp) return (ptr); } -#ifdef ULTRIX30 +#if defined(ultrix) || defined(_POSIX_SOURCE) void #else int -- cgit v1.2.3