1 /* Generic Communication Code HTTCP.h
2 ** ==========================
8 #define HTInetStatus HTInStat
9 #define HTInetString HTInStri
10 #define HTParseInet HTPaInet
14 /* Produce a string for an internet address
15 ** ---------------------------------------
18 ** returns a pointer to a static string which must be copied if
22 extern const char * HTInetString(struct sockaddr_in* sin);
24 extern char * HTInetString();
28 /* Encode INET status (as in sys/errno.h) inet_status()
32 ** where gives a description of what caused the error
33 ** global errno gives the error number in the unix way.
36 ** returns a negative status in the unix way.
39 extern int HTInetStatus(char *where);
41 extern int HTInetStatus();
44 /* Publicly accesible variables
46 /* extern struct sockaddr_in HTHostAddress; */
47 /* The internet address of the host */
48 /* Valid after call to HTHostName() */
51 /* Parse a cardinal value parse_cardinal()
52 ** ----------------------
55 ** *pp points to first character to be interpreted, terminated by
57 ** *pstatus points to status already valid
58 ** maxvalue gives the largest allowable value.
61 ** *pp points to first unread character
62 ** *pstatus points to status updated iff bad
65 extern unsigned int HTCardinal(int *pstatus,
67 unsigned int max_value);
69 extern unsigned int HTCardinal();
72 /* Parse an internet node address and port
73 ** ---------------------------------------
76 ** str points to a string with a node name or number,
77 ** with optional trailing colon and port number.
78 ** sin points to the binary internet address field.
81 ** *sin is filled in. If no port is specified in str, that
82 ** field is left unchanged in *sin.
85 extern int HTParseInet(struct sockaddr_in* sin, const char *str);
87 extern int HTParseInet();
90 /* Get Name of This Machine
91 ** ------------------------
95 extern const char * HTHostName(void);
97 extern char * HTHostName();