1 /* ========================================================================
2  * Copyright 2008-2010 Mark Crispin
3  * ========================================================================
4  */
5 
6 /*
7  * Program:	DOS environment routines
8  *
9  * Author:	Mark Crispin
10  *
11  * Date:	1 August 1988
12  * Last Edited:	15 November 2010
13  *
14  * Previous versions of this file were:
15  *
16  * Copyright 1988-2006 University of Washington
17  *
18  * Licensed under the Apache License, Version 2.0 (the "License");
19  * you may not use this file except in compliance with the License.
20  * You may obtain a copy of the License at
21  *
22  *     http://www.apache.org/licenses/LICENSE-2.0
23  *
24  *
25  */
26 
27 
28 #define SUBSCRIPTIONFILE(t) sprintf (t,"%s/MAILBOX.LST",myhomedir ())
29 #define SUBSCRIPTIONTEMP(t) sprintf (t,"%s/MAILBOX.TMP",myhomedir ())
30 
31 #define L_SET SEEK_SET
32 
33 /* Function prototypes */
34 
35 #include "env.h"
36 
37 char *dos_default_gets (readfn_t f,void *stream,unsigned long size,
38 			GETS_DATA *md);
39 long safe_write (int fd,char *buf,long nbytes);
40 long random (void);
41 #if _MSC_VER < 700
42 #define getpid random
43 #endif
44 
45 
46 /* syslog() emulation */
47 
48 #define LOG_MAIL	(2<<3)	/* mail system */
49 #define LOG_DAEMON	(3<<3)	/* system daemons */
50 #define LOG_AUTH	(4<<3)	/* security/authorization messages */
51 #define LOG_EMERG	0	/* system is unusable */
52 #define LOG_ALERT	1	/* action must be taken immediately */
53 #define LOG_CRIT	2	/* critical conditions */
54 #define LOG_ERR		3	/* error conditions */
55 #define LOG_WARNING	4	/* warning conditions */
56 #define LOG_NOTICE	5	/* normal but signification condition */
57 #define LOG_INFO	6	/* informational */
58 #define LOG_DEBUG	7	/* debug-level messages */
59 #define LOG_PID		0x01	/* log the pid with each message */
60 #define LOG_CONS	0x02	/* log on the console if errors in sending */
61 #define LOG_ODELAY	0x04	/* delay open until syslog() is called */
62 #define LOG_NDELAY	0x08	/* don't delay open */
63 #define LOG_NOWAIT	0x10	/* if forking to log on console, don't wait() */
64 
65 void openlog (const char *ident,int logopt,int facility);
66 void syslog (int priority,const char *message,...);
67