/* 
aux.h - header for all source files
distributed as part of _ s u l a _

*/




#ifndef _sula_aux_h
#define _sula_aux_h
#include <sys/time.h>
#include <sys/param.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <sys/stat.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
#include <signal.h>
#include <setjmp.h>
#include <sys/times.h>
#include <assert.h>
#include <errno.h>

#ifndef INADDR_NONE
#define INADDR_NONE	0xffffffff
#endif
#ifdef MAXLINE
#undef MAXLINE
#endif
#define MAXLINE		2048
typedef void Sigfunc(int);
#if     defined(SIG_IGN) && !defined(SIG_ERR)
#define SIG_ERR         ((Sigfunc *)-1)
#endif
Sigfunc *Signal(int, Sigfunc *);
#define FILE_MODE       (S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH)
#define DIR_MODE        (FILE_MODE | S_IXUSR | S_IXGRP | S_IXOTH)

/*when we connect anywhere */
/*struct sockaddr_in	tcp_rem_addr;*/	/*moved to netc.c*/
char *tcp_err_msg;	/* error in last connection attempt */

char    host[MAXHOSTNAMELEN + 1];	/* our host name */
struct sockaddr_in me;			/* our internet socket address */



ssize_t	readn(int, void *, size_t);
ssize_t	writen(int,const void *, size_t);

extern int tcp_create_server(void);
extern int tcp_open(char *, unsigned long, char *, int, u_int);

extern void TELL_WAIT(void);
extern void  TELL_CHILD(pid_t);
extern void  WAIT_PARENT(void);
#endif


