1 | /***********************************************************
|
---|
2 |
|
---|
3 | Copyright 1987, 1998 The Open Group
|
---|
4 |
|
---|
5 | Permission to use, copy, modify, distribute, and sell this software and its
|
---|
6 | documentation for any purpose is hereby granted without fee, provided that
|
---|
7 | the above copyright notice appear in all copies and that both that
|
---|
8 | copyright notice and this permission notice appear in supporting
|
---|
9 | documentation.
|
---|
10 |
|
---|
11 | The above copyright notice and this permission notice shall be included in
|
---|
12 | all copies or substantial portions of the Software.
|
---|
13 |
|
---|
14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
---|
15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
---|
16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
---|
17 | OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
|
---|
18 | AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
---|
19 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
---|
20 |
|
---|
21 | Except as contained in this notice, the name of The Open Group shall not be
|
---|
22 | used in advertising or otherwise to promote the sale, use or other dealings
|
---|
23 | in this Software without prior written authorization from The Open Group.
|
---|
24 |
|
---|
25 |
|
---|
26 | Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
|
---|
27 |
|
---|
28 | All Rights Reserved
|
---|
29 |
|
---|
30 | Permission to use, copy, modify, and distribute this software and its
|
---|
31 | documentation for any purpose and without fee is hereby granted,
|
---|
32 | provided that the above copyright notice appear in all copies and that
|
---|
33 | both that copyright notice and this permission notice appear in
|
---|
34 | supporting documentation, and that the name of Digital not be
|
---|
35 | used in advertising or publicity pertaining to distribution of the
|
---|
36 | software without specific, written prior permission.
|
---|
37 |
|
---|
38 | DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
|
---|
39 | ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
|
---|
40 | DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
|
---|
41 | ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
|
---|
42 | WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
|
---|
43 | ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
|
---|
44 | SOFTWARE.
|
---|
45 |
|
---|
46 | ******************************************************************/
|
---|
47 |
|
---|
48 |
|
---|
49 | #ifndef OS_H
|
---|
50 | #define OS_H
|
---|
51 |
|
---|
52 | #include "misc.h"
|
---|
53 | #define ALLOCATE_LOCAL_FALLBACK(_size) Xalloc((unsigned long)(_size))
|
---|
54 | #define DEALLOCATE_LOCAL_FALLBACK(_ptr) Xfree((pointer)(_ptr))
|
---|
55 | #include <X11/Xalloca.h>
|
---|
56 | #include <stdarg.h>
|
---|
57 |
|
---|
58 | #define NullFID ((FID) 0)
|
---|
59 |
|
---|
60 | #define SCREEN_SAVER_ON 0
|
---|
61 | #define SCREEN_SAVER_OFF 1
|
---|
62 | #define SCREEN_SAVER_FORCER 2
|
---|
63 | #define SCREEN_SAVER_CYCLE 3
|
---|
64 |
|
---|
65 | #ifndef MAX_REQUEST_SIZE
|
---|
66 | #define MAX_REQUEST_SIZE 65535
|
---|
67 | #endif
|
---|
68 | #ifndef MAX_BIG_REQUEST_SIZE
|
---|
69 | #define MAX_BIG_REQUEST_SIZE 4194303
|
---|
70 | #endif
|
---|
71 |
|
---|
72 | typedef pointer FID;
|
---|
73 | typedef struct _FontPathRec *FontPathPtr;
|
---|
74 | typedef struct _NewClientRec *NewClientPtr;
|
---|
75 |
|
---|
76 | #ifndef xalloc
|
---|
77 | #define xnfalloc(size) XNFalloc((unsigned long)(size))
|
---|
78 | #define xnfcalloc(_num, _size) XNFcalloc((unsigned long)(_num)*(unsigned long)(_size))
|
---|
79 | #define xnfrealloc(ptr, size) XNFrealloc((pointer)(ptr), (unsigned long)(size))
|
---|
80 |
|
---|
81 | #define xalloc(size) Xalloc((unsigned long)(size))
|
---|
82 | #define xcalloc(_num, _size) Xcalloc((unsigned long)(_num)*(unsigned long)(_size))
|
---|
83 | #define xrealloc(ptr, size) Xrealloc((pointer)(ptr), (unsigned long)(size))
|
---|
84 | #define xfree(ptr) Xfree((pointer)(ptr))
|
---|
85 | #define xstrdup(s) Xstrdup(s)
|
---|
86 | #define xnfstrdup(s) XNFstrdup(s)
|
---|
87 | #endif
|
---|
88 |
|
---|
89 | #include <stdio.h>
|
---|
90 | #include <stdarg.h>
|
---|
91 |
|
---|
92 | /* have to put $(SIGNAL_DEFINES) in DEFINES in Imakefile to get this right */
|
---|
93 | #ifdef SIGNALRETURNSINT
|
---|
94 | #define SIGVAL int
|
---|
95 | #else
|
---|
96 | #define SIGVAL void
|
---|
97 | #endif
|
---|
98 |
|
---|
99 | extern Bool OsDelayInitColors;
|
---|
100 | extern void (*OsVendorVErrorFProc)(const char *, va_list args);
|
---|
101 |
|
---|
102 | extern int WaitForSomething(
|
---|
103 | int* /*pClientsReady*/
|
---|
104 | );
|
---|
105 |
|
---|
106 | extern int ReadRequestFromClient(ClientPtr /*client*/);
|
---|
107 |
|
---|
108 | extern Bool InsertFakeRequest(
|
---|
109 | ClientPtr /*client*/,
|
---|
110 | char* /*data*/,
|
---|
111 | int /*count*/);
|
---|
112 |
|
---|
113 | extern void ResetCurrentRequest(ClientPtr /*client*/);
|
---|
114 |
|
---|
115 | extern void FlushAllOutput(void);
|
---|
116 |
|
---|
117 | extern void FlushIfCriticalOutputPending(void);
|
---|
118 |
|
---|
119 | extern void SetCriticalOutputPending(void);
|
---|
120 |
|
---|
121 | extern int WriteToClient(ClientPtr /*who*/, int /*count*/, char* /*buf*/);
|
---|
122 |
|
---|
123 | extern void ResetOsBuffers(void);
|
---|
124 |
|
---|
125 | extern void InitConnectionLimits(void);
|
---|
126 |
|
---|
127 | extern void CreateWellKnownSockets(void);
|
---|
128 |
|
---|
129 | extern void ResetWellKnownSockets(void);
|
---|
130 |
|
---|
131 | extern void CloseWellKnownConnections(void);
|
---|
132 |
|
---|
133 | extern XID AuthorizationIDOfClient(ClientPtr /*client*/);
|
---|
134 |
|
---|
135 | extern char *ClientAuthorized(
|
---|
136 | ClientPtr /*client*/,
|
---|
137 | unsigned int /*proto_n*/,
|
---|
138 | char* /*auth_proto*/,
|
---|
139 | unsigned int /*string_n*/,
|
---|
140 | char* /*auth_string*/);
|
---|
141 |
|
---|
142 | extern Bool EstablishNewConnections(
|
---|
143 | ClientPtr /*clientUnused*/,
|
---|
144 | pointer /*closure*/);
|
---|
145 |
|
---|
146 | extern void CheckConnections(void);
|
---|
147 |
|
---|
148 | extern void CloseDownConnection(ClientPtr /*client*/);
|
---|
149 |
|
---|
150 | extern void AddGeneralSocket(int /*fd*/);
|
---|
151 |
|
---|
152 | extern void RemoveGeneralSocket(int /*fd*/);
|
---|
153 |
|
---|
154 | extern void AddEnabledDevice(int /*fd*/);
|
---|
155 |
|
---|
156 | extern void RemoveEnabledDevice(int /*fd*/);
|
---|
157 |
|
---|
158 | extern void OnlyListenToOneClient(ClientPtr /*client*/);
|
---|
159 |
|
---|
160 | extern void ListenToAllClients(void);
|
---|
161 |
|
---|
162 | extern void IgnoreClient(ClientPtr /*client*/);
|
---|
163 |
|
---|
164 | extern void AttendClient(ClientPtr /*client*/);
|
---|
165 |
|
---|
166 | extern void MakeClientGrabImpervious(ClientPtr /*client*/);
|
---|
167 |
|
---|
168 | extern void MakeClientGrabPervious(ClientPtr /*client*/);
|
---|
169 |
|
---|
170 | extern void AvailableClientInput(ClientPtr /* client */);
|
---|
171 |
|
---|
172 | extern CARD32 GetTimeInMillis(void);
|
---|
173 |
|
---|
174 | extern void AdjustWaitForDelay(
|
---|
175 | pointer /*waitTime*/,
|
---|
176 | unsigned long /*newdelay*/);
|
---|
177 |
|
---|
178 | typedef struct _OsTimerRec *OsTimerPtr;
|
---|
179 |
|
---|
180 | typedef CARD32 (*OsTimerCallback)(
|
---|
181 | OsTimerPtr /* timer */,
|
---|
182 | CARD32 /* time */,
|
---|
183 | pointer /* arg */);
|
---|
184 |
|
---|
185 | extern void TimerInit(void);
|
---|
186 |
|
---|
187 | extern Bool TimerForce(OsTimerPtr /* timer */);
|
---|
188 |
|
---|
189 | #define TimerAbsolute (1<<0)
|
---|
190 | #define TimerForceOld (1<<1)
|
---|
191 |
|
---|
192 | extern OsTimerPtr TimerSet(
|
---|
193 | OsTimerPtr /* timer */,
|
---|
194 | int /* flags */,
|
---|
195 | CARD32 /* millis */,
|
---|
196 | OsTimerCallback /* func */,
|
---|
197 | pointer /* arg */);
|
---|
198 |
|
---|
199 | extern void TimerCheck(void);
|
---|
200 | extern void TimerCancel(OsTimerPtr /* pTimer */);
|
---|
201 | extern void TimerFree(OsTimerPtr /* pTimer */);
|
---|
202 |
|
---|
203 | extern void SetScreenSaverTimer(void);
|
---|
204 | extern void FreeScreenSaverTimer(void);
|
---|
205 |
|
---|
206 | extern SIGVAL AutoResetServer(int /*sig*/);
|
---|
207 |
|
---|
208 | extern SIGVAL GiveUp(int /*sig*/);
|
---|
209 |
|
---|
210 | extern void UseMsg(void);
|
---|
211 |
|
---|
212 | extern void InitGlobals(void);
|
---|
213 |
|
---|
214 | extern void ProcessCommandLine(int /*argc*/, char* /*argv*/[]);
|
---|
215 |
|
---|
216 | extern int set_font_authorizations(
|
---|
217 | char ** /* authorizations */,
|
---|
218 | int * /*authlen */,
|
---|
219 | pointer /* client */);
|
---|
220 |
|
---|
221 | #ifndef _HAVE_XALLOC_DECLS
|
---|
222 | #define _HAVE_XALLOC_DECLS
|
---|
223 | extern pointer Xalloc(unsigned long /*amount*/);
|
---|
224 | extern pointer Xcalloc(unsigned long /*amount*/);
|
---|
225 | extern pointer Xrealloc(pointer /*ptr*/, unsigned long /*amount*/);
|
---|
226 | extern void Xfree(pointer /*ptr*/);
|
---|
227 | #endif
|
---|
228 |
|
---|
229 | extern pointer XNFalloc(unsigned long /*amount*/);
|
---|
230 | extern pointer XNFcalloc(unsigned long /*amount*/);
|
---|
231 | extern pointer XNFrealloc(pointer /*ptr*/, unsigned long /*amount*/);
|
---|
232 |
|
---|
233 | extern void OsInitAllocator(void);
|
---|
234 |
|
---|
235 | extern char *Xstrdup(const char *s);
|
---|
236 | extern char *XNFstrdup(const char *s);
|
---|
237 | extern char *Xprintf(const char *fmt, ...);
|
---|
238 | extern char *Xvprintf(const char *fmt, va_list va);
|
---|
239 | extern char *XNFprintf(const char *fmt, ...);
|
---|
240 | extern char *XNFvprintf(const char *fmt, va_list va);
|
---|
241 |
|
---|
242 | typedef SIGVAL (*OsSigHandlerPtr)(int /* sig */);
|
---|
243 |
|
---|
244 | extern OsSigHandlerPtr OsSignal(int /* sig */, OsSigHandlerPtr /* handler */);
|
---|
245 |
|
---|
246 | extern int auditTrailLevel;
|
---|
247 |
|
---|
248 | #ifdef SERVER_LOCK
|
---|
249 | extern void LockServer(void);
|
---|
250 | extern void UnlockServer(void);
|
---|
251 | #endif
|
---|
252 |
|
---|
253 | extern int OsLookupColor(
|
---|
254 | int /*screen*/,
|
---|
255 | char * /*name*/,
|
---|
256 | unsigned /*len*/,
|
---|
257 | unsigned short * /*pred*/,
|
---|
258 | unsigned short * /*pgreen*/,
|
---|
259 | unsigned short * /*pblue*/);
|
---|
260 |
|
---|
261 | extern void OsInit(void);
|
---|
262 |
|
---|
263 | extern void OsCleanup(Bool);
|
---|
264 |
|
---|
265 | extern void OsVendorFatalError(void);
|
---|
266 |
|
---|
267 | extern void OsVendorInit(void);
|
---|
268 |
|
---|
269 | extern int OsInitColors(void);
|
---|
270 |
|
---|
271 | void OsBlockSignals (void);
|
---|
272 |
|
---|
273 | void OsReleaseSignals (void);
|
---|
274 |
|
---|
275 | #if !defined(WIN32)
|
---|
276 | extern int System(char *);
|
---|
277 | extern pointer Popen(char *, char *);
|
---|
278 | extern int Pclose(pointer);
|
---|
279 | extern pointer Fopen(char *, char *);
|
---|
280 | extern int Fclose(pointer);
|
---|
281 | #else
|
---|
282 | #define System(a) system(a)
|
---|
283 | #define Popen(a,b) popen(a,b)
|
---|
284 | #define Pclose(a) pclose(a)
|
---|
285 | #define Fopen(a,b) fopen(a,b)
|
---|
286 | #define Fclose(a) fclose(a)
|
---|
287 | #endif
|
---|
288 |
|
---|
289 | extern void CheckUserParameters(int argc, char **argv, char **envp);
|
---|
290 | extern void CheckUserAuthorization(void);
|
---|
291 |
|
---|
292 | extern int AddHost(
|
---|
293 | ClientPtr /*client*/,
|
---|
294 | int /*family*/,
|
---|
295 | unsigned /*length*/,
|
---|
296 | pointer /*pAddr*/);
|
---|
297 |
|
---|
298 | extern Bool ForEachHostInFamily (
|
---|
299 | int /*family*/,
|
---|
300 | Bool (* /*func*/ )(
|
---|
301 | unsigned char * /* addr */,
|
---|
302 | short /* len */,
|
---|
303 | pointer /* closure */),
|
---|
304 | pointer /*closure*/);
|
---|
305 |
|
---|
306 | extern int RemoveHost(
|
---|
307 | ClientPtr /*client*/,
|
---|
308 | int /*family*/,
|
---|
309 | unsigned /*length*/,
|
---|
310 | pointer /*pAddr*/);
|
---|
311 |
|
---|
312 | extern int GetHosts(
|
---|
313 | pointer * /*data*/,
|
---|
314 | int * /*pnHosts*/,
|
---|
315 | int * /*pLen*/,
|
---|
316 | BOOL * /*pEnabled*/);
|
---|
317 |
|
---|
318 | typedef struct sockaddr * sockaddrPtr;
|
---|
319 |
|
---|
320 | extern int InvalidHost(sockaddrPtr /*saddr*/, int /*len*/, ClientPtr client);
|
---|
321 |
|
---|
322 | extern int LocalClient(ClientPtr /* client */);
|
---|
323 |
|
---|
324 | extern int LocalClientCred(ClientPtr, int *, int *);
|
---|
325 |
|
---|
326 | extern int ChangeAccessControl(ClientPtr /*client*/, int /*fEnabled*/);
|
---|
327 |
|
---|
328 | extern int GetAccessControl(void);
|
---|
329 |
|
---|
330 |
|
---|
331 | extern void AddLocalHosts(void);
|
---|
332 |
|
---|
333 | extern void ResetHosts(char *display);
|
---|
334 |
|
---|
335 | extern void EnableLocalHost(void);
|
---|
336 |
|
---|
337 | extern void DisableLocalHost(void);
|
---|
338 |
|
---|
339 | extern void AccessUsingXdmcp(void);
|
---|
340 |
|
---|
341 | extern void DefineSelf(int /*fd*/);
|
---|
342 |
|
---|
343 | extern void AugmentSelf(pointer /*from*/, int /*len*/);
|
---|
344 |
|
---|
345 | extern void InitAuthorization(char * /*filename*/);
|
---|
346 |
|
---|
347 | /* extern int LoadAuthorization(void); */
|
---|
348 |
|
---|
349 | extern void RegisterAuthorizations(void);
|
---|
350 |
|
---|
351 | extern int AuthorizationFromID (
|
---|
352 | XID id,
|
---|
353 | unsigned short *name_lenp,
|
---|
354 | char **namep,
|
---|
355 | unsigned short *data_lenp,
|
---|
356 | char **datap);
|
---|
357 |
|
---|
358 | extern XID CheckAuthorization(
|
---|
359 | unsigned int /*namelength*/,
|
---|
360 | char * /*name*/,
|
---|
361 | unsigned int /*datalength*/,
|
---|
362 | char * /*data*/,
|
---|
363 | ClientPtr /*client*/,
|
---|
364 | char ** /*reason*/
|
---|
365 | );
|
---|
366 |
|
---|
367 | extern void ResetAuthorization(void);
|
---|
368 |
|
---|
369 | extern int RemoveAuthorization (
|
---|
370 | unsigned short name_length,
|
---|
371 | char *name,
|
---|
372 | unsigned short data_length,
|
---|
373 | char *data);
|
---|
374 |
|
---|
375 | extern int AddAuthorization(
|
---|
376 | unsigned int /*name_length*/,
|
---|
377 | char * /*name*/,
|
---|
378 | unsigned int /*data_length*/,
|
---|
379 | char * /*data*/);
|
---|
380 |
|
---|
381 | extern XID GenerateAuthorization(
|
---|
382 | unsigned int /* name_length */,
|
---|
383 | char * /* name */,
|
---|
384 | unsigned int /* data_length */,
|
---|
385 | char * /* data */,
|
---|
386 | unsigned int * /* data_length_return */,
|
---|
387 | char ** /* data_return */);
|
---|
388 |
|
---|
389 | #ifdef COMMANDLINE_CHALLENGED_OPERATING_SYSTEMS
|
---|
390 | extern void ExpandCommandLine(int * /*pargc*/, char *** /*pargv*/);
|
---|
391 | #endif
|
---|
392 |
|
---|
393 | extern void ddxInitGlobals(void);
|
---|
394 |
|
---|
395 | extern int ddxProcessArgument(int /*argc*/, char * /*argv*/ [], int /*i*/);
|
---|
396 |
|
---|
397 | extern void ddxUseMsg(void);
|
---|
398 |
|
---|
399 | /* int ReqLen(xReq *req, ClientPtr client)
|
---|
400 | * Given a pointer to a *complete* request, return its length in bytes.
|
---|
401 | * Note that if the request is a big request (as defined in the Big
|
---|
402 | * Requests extension), the macro lies by returning 4 less than the
|
---|
403 | * length that it actually occupies in the request buffer. This is so you
|
---|
404 | * can blindly compare the length with the various sz_<request> constants
|
---|
405 | * in Xproto.h without having to know/care about big requests.
|
---|
406 | */
|
---|
407 | #define ReqLen(_pxReq, _client) \
|
---|
408 | ((_pxReq->length ? \
|
---|
409 | (_client->swapped ? lswaps(_pxReq->length) : _pxReq->length) \
|
---|
410 | : ((_client->swapped ? \
|
---|
411 | lswapl(((CARD32*)_pxReq)[1]) : ((CARD32*)_pxReq)[1])-1) \
|
---|
412 | ) << 2)
|
---|
413 |
|
---|
414 | /* otherReqTypePtr CastxReq(xReq *req, otherReqTypePtr)
|
---|
415 | * Cast the given request to one of type otherReqTypePtr to access
|
---|
416 | * fields beyond the length field.
|
---|
417 | */
|
---|
418 | #define CastxReq(_pxReq, otherReqTypePtr) \
|
---|
419 | (_pxReq->length ? (otherReqTypePtr)_pxReq \
|
---|
420 | : (otherReqTypePtr)(((CARD32*)_pxReq)+1))
|
---|
421 |
|
---|
422 | /* stuff for SkippedRequestsCallback */
|
---|
423 | extern CallbackListPtr SkippedRequestsCallback;
|
---|
424 | typedef struct {
|
---|
425 | xReqPtr req;
|
---|
426 | ClientPtr client;
|
---|
427 | int numskipped;
|
---|
428 | } SkippedRequestInfoRec;
|
---|
429 |
|
---|
430 | /* stuff for ReplyCallback */
|
---|
431 | extern CallbackListPtr ReplyCallback;
|
---|
432 | typedef struct {
|
---|
433 | ClientPtr client;
|
---|
434 | pointer replyData;
|
---|
435 | unsigned long dataLenBytes;
|
---|
436 | unsigned long bytesRemaining;
|
---|
437 | Bool startOfReply;
|
---|
438 | } ReplyInfoRec;
|
---|
439 |
|
---|
440 | /* stuff for FlushCallback */
|
---|
441 | extern CallbackListPtr FlushCallback;
|
---|
442 |
|
---|
443 | extern void AbortDDX(void);
|
---|
444 | extern void ddxGiveUp(void);
|
---|
445 | extern int TimeSinceLastInputEvent(void);
|
---|
446 |
|
---|
447 | /* Logging. */
|
---|
448 | typedef enum _LogParameter {
|
---|
449 | XLOG_FLUSH,
|
---|
450 | XLOG_SYNC,
|
---|
451 | XLOG_VERBOSITY,
|
---|
452 | XLOG_FILE_VERBOSITY
|
---|
453 | } LogParameter;
|
---|
454 |
|
---|
455 | /* Flags for log messages. */
|
---|
456 | typedef enum {
|
---|
457 | X_PROBED, /* Value was probed */
|
---|
458 | X_CONFIG, /* Value was given in the config file */
|
---|
459 | X_DEFAULT, /* Value is a default */
|
---|
460 | X_CMDLINE, /* Value was given on the command line */
|
---|
461 | X_NOTICE, /* Notice */
|
---|
462 | X_ERROR, /* Error message */
|
---|
463 | X_WARNING, /* Warning message */
|
---|
464 | X_INFO, /* Informational message */
|
---|
465 | X_NONE, /* No prefix */
|
---|
466 | X_NOT_IMPLEMENTED, /* Not implemented */
|
---|
467 | X_UNKNOWN = -1 /* unknown -- this must always be last */
|
---|
468 | } MessageType;
|
---|
469 |
|
---|
470 | /* XXX Need to check which GCC versions have the format(printf) attribute. */
|
---|
471 | #if defined(__GNUC__) && \
|
---|
472 | ((__GNUC__ > 2) || ((__GNUC__ == 2) && (__GNUC_MINOR__ > 4)))
|
---|
473 | #define _printf_attribute(a,b) __attribute((format(__printf__,a,b)))
|
---|
474 | #else
|
---|
475 | #define _printf_attribute(a,b) /**/
|
---|
476 | #endif
|
---|
477 |
|
---|
478 | extern const char *LogInit(const char *fname, const char *backup);
|
---|
479 | extern void LogClose(void);
|
---|
480 | extern Bool LogSetParameter(LogParameter param, int value);
|
---|
481 | extern void LogVWrite(int verb, const char *f, va_list args);
|
---|
482 | extern void LogWrite(int verb, const char *f, ...) _printf_attribute(2,3);
|
---|
483 | extern void LogVMessageVerb(MessageType type, int verb, const char *format,
|
---|
484 | va_list args);
|
---|
485 | extern void LogMessageVerb(MessageType type, int verb, const char *format,
|
---|
486 | ...) _printf_attribute(3,4);
|
---|
487 | extern void LogMessage(MessageType type, const char *format, ...)
|
---|
488 | _printf_attribute(2,3);
|
---|
489 | extern void FreeAuditTimer(void);
|
---|
490 | extern void AuditF(const char *f, ...) _printf_attribute(1,2);
|
---|
491 | extern void VAuditF(const char *f, va_list args);
|
---|
492 | extern void FatalError(const char *f, ...) _printf_attribute(1,2)
|
---|
493 | #if defined(__GNUC__) && \
|
---|
494 | ((__GNUC__ > 2) || ((__GNUC__ == 2) && (__GNUC_MINOR__ > 4)))
|
---|
495 | __attribute((noreturn))
|
---|
496 | #endif
|
---|
497 | ;
|
---|
498 |
|
---|
499 | #ifdef DEBUG
|
---|
500 | #define DebugF ErrorF
|
---|
501 | #else
|
---|
502 | #define DebugF(x, ...) /* */
|
---|
503 | #endif
|
---|
504 |
|
---|
505 | extern void VErrorF(const char *f, va_list args);
|
---|
506 | extern void ErrorF(const char *f, ...) _printf_attribute(1,2);
|
---|
507 | extern void Error(char *str);
|
---|
508 | extern void LogPrintMarkers(void);
|
---|
509 |
|
---|
510 | #endif /* OS_H */
|
---|