7 * DIGITAL EQUIPMENT CORPORATION
8 * MAYNARD, MASSACHUSETTS
11 * THE INFORMATION IN THIS SOFTWARE IS SUBJECT TO CHANGE WITHOUT NOTICE AND
12 * SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT CORPORATION.
13 * DIGITAL MAKES NO REPRESENTATIONS ABOUT THE SUITABILITY OF THIS SOFTWARE
14 * FOR ANY PURPOSE. IT IS SUPPLIED "AS IS" WITHOUT EXPRESS OR IMPLIED
17 * IF THE SOFTWARE IS MODIFIED IN A MANNER CREATING DERIVATIVE COPYRIGHT
18 * RIGHTS, APPROPRIATE LEGENDS MAY BE PLACED ON THE DERIVATIVE WORK IN
19 * ADDITION TO THAT SET FORTH ABOVE.
21 * Permission to use, copy, modify, and distribute this software and its
22 * documentation for any purpose and without fee is hereby granted, provided
23 * that the above copyright notice appear in all copies and that both that
24 * copyright notice and this permission notice appear in supporting
25 * documentation, and that the name of Digital Equipment Corporation not be
26 * used in advertising or publicity pertaining to distribution of the
27 * software without specific, written prior permission.
30 /***====================================================================***/
33 #include <X11/Xdefs.h>
34 #include <X11/Xfuncproto.h>
41 recalloc(void * old, unsigned nOld, unsigned nNew, unsigned newSize);
43 #define uTypedAlloc(t) ((t *)malloc((unsigned)sizeof(t)))
44 #define uTypedCalloc(n,t) ((t *)calloc((unsigned)n,(unsigned)sizeof(t)))
45 #define uTypedRealloc(pO,n,t) ((t *)realloc(pO,((unsigned)n)*sizeof(t)))
46 #define uTypedRecalloc(pO,o,n,t) ((t *)recalloc(pO,((unsigned)o),((unsigned)n),sizeof(t)))
48 /***====================================================================***/
51 uSetErrorFile(char *name);
54 #define INFO uInformation
56 extern _X_ATTRIBUTE_PRINTF(1, 2) void
57 uInformation(const char *s, ...);
59 #define ACTION uAction
61 extern _X_ATTRIBUTE_PRINTF(1, 2) void
62 uAction(const char *s, ...);
66 extern _X_ATTRIBUTE_PRINTF(1, 2) void
67 uWarning(const char *s, ...);
71 extern _X_ATTRIBUTE_PRINTF(1, 2) void
72 uError(const char *s, ...);
74 #define FATAL uFatalError
76 extern _X_ATTRIBUTE_PRINTF(1, 2) _X_NORETURN void
77 uFatalError(const char *s, ...);
79 /* WSGO stands for "Weird Stuff Going On" (wtf???) */
80 #define WSGO uInternalError
82 extern _X_ATTRIBUTE_PRINTF(1, 2) void
83 uInternalError(const char *s, ...);
85 /***====================================================================***/
87 #define uStringText(s) ((s) == NULL ? "<NullString>" : (s))
88 #define uStringEqual(s1,s2) (strcmp(s1,s2) == 0)
89 #define uStringPrefix(p,s) (strncmp(p,s,strlen(p))==0)
90 #define uStrCaseCmp(s1,s2) (strcasecmp(s1,s2))
91 #define uStrCasePrefix(p,s) (strncasecmp(p,s,strlen(p))==0)