Multi-user chat program

D'Arcy J.M. Cain darcy at druid.uucp
Wed Oct 24 03:53:27 AEST 1990


In article <1990Oct22.172500.26286 at agate.berkeley.edu> vreed at sandstorm.Berkeley.EDU (Vincent Reed) writes:
>I grabbed your Multi-User Chat to use on our system, but we are missing a few 
>of the header files necessary. Could you please send me your stdlib.h process.h
>and getopt.h header files? The copies of these we do have seem to be program 
>specific. I'm posting this to the net because I was unable to get mail 
>directly to you.
>
I assumed these were ANSI standard header files but except for stdlib.h I
can't find mention of them in my K&R2.  On my system, stdlib.h is just a
link to unistd.h.  That file is obviously OS specific so I try to avoid it.
I can't send you a copy because it is copyright AT&T.  Your best bet is to
remove the include directive for this and see what prototypes you are
missing.

I would think that getopt.h would be obvious from the name but here it is:

------------------------- getopt.h -------------------------------
/*
declarations for getopt
*/

#ifndef		_GETOPT_H
#define		_GETOPT_H

extern int getopt(int argc, char **argv, const char *opts);
extern int optind, opterr;
extern char *optarg;

#endif
------------------------ end of getopt.h ----------------------------

The file process.h holds mainly prototypes fork() and exec() calls as well
as wait().  I have built up this file from various files and although I
have modified it to an unrecognizable form I hesitate to send out the whole
thing.  Here are the relevant prototypes:

---------------------------- process.h -------------------------------
/*
	process.h
*/

#ifndef		_PROCESS_H
#define		_PROCESS_H

int		execlp(const char *path, const char *arg0, ...);
int		fork(void);
int		getpid(void);
int		system(const char *command);
int		wait(int *stat_loc);

#endif
--------------------------- end of process.h -------------------------

Was I wrong to assume that these files would be available under a standard
compiler?

BTW:  This belongs in alt.sources.d where followups are directed.

-- 
D'Arcy J.M. Cain (darcy at druid)     |
D'Arcy Cain Consulting             |   I support gun control.
West Hill, Ontario, Canada         |   Let's start with the government!
+ 416 281 6094                     |



More information about the Alt.sources.d mailing list