1 /* Macros for general use HTUtils.h
3 ** See also: the system dependent file "tcp.h"
6 /* extern void *malloc(size_t size); */
12 #define WWW_TraceFlag HTTrFlag
15 /* Debug message control.
24 #define TRACE (WWW_TraceFlag)
25 #define PROGRESS(str) printf(str)
26 extern int WWW_TraceFlag;
29 #define PROGRESS(str) /* nothing for now */
31 #define CTRACE if(TRACE)fprintf
34 /* Standard C library for malloc() etc
38 #define ultrix /* Assume vax+unix=ultrix */
45 #include <libc.h> /* NeXT */
47 #ifndef MACH /* Vincent.Cate@furmint.nectar.cs.cmu.edu */
48 #include <stdlib.h> /* ANSI */
51 #include <malloc.h> /* ultrix */
61 #define PUBLIC /* Accessible outside this module */
62 #define PRIVATE static /* Accessible only within this module */
65 #define CONST const /* "const" only exists in STDC */
66 #define NOPARAMS (void)
67 #define PARAMS(parameter_list) parameter_list
71 #define ARGS2(t,a,u,b) \
73 #define ARGS3(t,a,u,b,v,c) \
75 #define ARGS4(t,a,u,b,v,c,w,d) \
77 #define ARGS5(t,a,u,b,v,c,w,d,x,e) \
78 (t a, u b, v c, w d, x e)
79 #define ARGS6(t,a,u,b,v,c,w,d,x,e,y,f) \
80 (t a, u b, v c, w d, x e, y f)
81 #define ARGS7(t,a,u,b,v,c,w,d,x,e,y,f,z,g) \
82 (t a, u b, v c, w d, x e, y f, z g)
83 #define ARGS8(t,a,u,b,v,c,w,d,x,e,y,f,z,g,s,h) \
84 (t a, u b, v c, w d, x e, y f, z g, s h)
85 #define ARGS9(t,a,u,b,v,c,w,d,x,e,y,f,z,g,s,h,r,i) \
86 (t a, u b, v c, w d, x e, y f, z g, s h, r i)
92 #define PARAMS(parameter_list) ()
94 #define ARGS1(t,a) (a) \
96 #define ARGS2(t,a,u,b) (a,b) \
98 #define ARGS3(t,a,u,b,v,c) (a,b,c) \
100 #define ARGS4(t,a,u,b,v,c,w,d) (a,b,c,d) \
102 #define ARGS5(t,a,u,b,v,c,w,d,x,e) (a,b,c,d,e) \
103 t a; u b; v c; w d; x e;
104 #define ARGS6(t,a,u,b,v,c,w,d,x,e,y,f) (a,b,c,d,e,f) \
105 t a; u b; v c; w d; x e; y f;
106 #define ARGS7(t,a,u,b,v,c,w,d,x,e,y,f,z,g) (a,b,c,d,e,f,g) \
107 t a; u b; v c; w d; x e; y f; z g;
108 #define ARGS8(t,a,u,b,v,c,w,d,x,e,y,f,z,g,s,h) (a,b,c,d,e,f,g,h) \
109 t a; u b; v c; w d; x e; y f; z g; s h;
110 #define ARGS9(t,a,u,b,v,c,w,d,x,e,y,f,z,g,s,h,r,i) (a,b,c,d,e,f,g,h,i) \
111 t a; u b; v c; w d; x e; y f; z g; s h; r i;
113 #endif /* __STDC__ (ANSI) */
116 #define NULL ((void *)0)
120 /* Note: GOOD and BAD are already defined (differently) on RS6000 aix */
121 /* #define GOOD(status) ((status)&1) VMS style status: test bit 0 */
122 /* #define BAD(status) (!GOOD(status)) Bit 0 set if OK, otherwise clear */
124 #ifndef BOOLEAN_DEFINED
125 typedef char BOOLEAN; /* Logical value */
128 #define TRUE (BOOLEAN)1
129 #define FALSE (BOOLEAN)0
132 #define BOOLEAN_DEFINED
139 #define YES (BOOLEAN)1
140 #define NO (BOOLEAN)0
143 #define TCP_PORT 2784 /* 80 Allocated by Jon Postel/ISI 24-Jan-92 */
145 /* Is character c white space? */
148 #define WHITE(c) (((unsigned char)(c))<=' ') /* Assumes ASCII but faster */
150 #define WHITE(c) ( ((c)==' ') || ((c)=='\t') || ((c)=='\n') || ((c)=='\r') )
153 #define HT_LOADED (29999) /* Instead of a socket */
155 #include "HTString.h" /* String utilities */
171 extern WINDOW *w_top, *w_text, *w_prompt;
172 extern void user_message PARAMS((const char *fmt, ...));
173 extern void prompt_set PARAMS((CONST char * msg));
174 extern void prompt_count PARAMS((long kb));
176 #define user_message printf
179 /* Out Of Memory checking for malloc() return:
186 #define outofmem(file, func) \
187 { fprintf(stderr, "%s %s: out of memory.\nProgram aborted.\n", file, func); \
189 /* extern void outofmem PARAMS((const char *fname, const char *func)); */
192 extern void msg_init PARAMS((int height));
193 extern void msg_printf PARAMS((int y, const char *fmt, ...));
194 extern void msg_exit PARAMS((int wait_for_key));
196 #endif /* HTUTILS_H */