#include <stdio.h>
#include <string.h>
#include <winsock2.h>
#include <ws2tcpip.h>
#include "syslog.h"
Go to the source code of this file.
◆ SYSLOG_DGRAM_SIZE
#define SYSLOG_DGRAM_SIZE 1024 |
◆ closelog()
Definition at line 153 of file syslog.c.
154{
156 return;
160}
int PASCAL FAR WSACleanup(void)
Referenced by openlog().
◆ init_logger_addr()
static void init_logger_addr |
( |
| ) |
|
|
static |
Definition at line 70 of file syslog.c.
71{
77
80
82 {
83
85 }
86 else
87 {
88
90
98 else
101 }
103 if(
'\\' != *
p &&
'/' != *
p )
104 {
106 }
108
109
112 goto use_default;
113
116 else
117 {
124 }
126
130
132 if( !phe )
133 goto use_default;
134
136
139 else
141 return;
142
143use_default:
146}
UINT32 strtoul(const char *String, char **Terminator, UINT32 Base)
ACPI_SIZE strlen(const char *String)
char * strchr(const char *String, int ch)
PHOSTENT WSAAPI gethostbyname(IN const char FAR *name)
GLdouble GLdouble GLdouble GLdouble q
_Check_return_ _CRTIMP FILE *__cdecl fopen(_In_z_ const char *_Filename, _In_z_ const char *_Mode)
_Check_return_opt_ _CRTIMP char *__cdecl fgets(_Out_writes_z_(_MaxCount) char *_Buf, _In_ int _MaxCount, _Inout_ FILE *_File)
_Check_return_opt_ _CRTIMP int __cdecl fclose(_Inout_ FILE *_File)
#define memcpy(s1, s2, n)
_CRT_RESTORE_GCC_WARNINGS _CRT_DISABLE_GCC_WARNINGS _Check_return_ _CRTIMP _CONST_RETURN char *__cdecl strrchr(_In_z_ const char *_Str, _In_ int _Ch)
static const char * syslog_conf_dir
static SOCKADDR_IN sa_logger
Referenced by openlog().
◆ openlog()
Definition at line 167 of file syslog.c.
168{
174
176 return;
177
179
180
181
184 else
186
187
188
191 goto done;
192
195 goto done;
196 wsa_initialized =
TRUE;
197
199
201 {
204 goto done;
205
209 break;
213 goto done;
215 }
216
217
220 goto done;
222 goto done;
225
227 goto done;
228
232
233done:
234 if( failed )
235 {
238 }
240}
int __cdecl atexit(void(__cdecl *function)(void))
INT WINAPI WSAStartup(IN WORD wVersionRequested, OUT LPWSADATA lpWSAData)
INT WSAAPI getsockopt(IN SOCKET s, IN INT level, IN INT optname, OUT CHAR FAR *optval, IN OUT INT FAR *optlen)
INT WSAAPI bind(IN SOCKET s, IN CONST struct sockaddr *name, IN INT namelen)
SOCKET WSAAPI socket(IN INT af, IN INT type, IN INT protocol)
VOID WINAPI DECLSPEC_HOTPATCH Sleep(IN DWORD dwMilliseconds)
static int syslog_facility
static char local_hostname[MAX_COMPUTERNAME_LENGTH+1]
static void init_logger_addr()
static char datagramm[SYSLOG_DGRAM_SIZE]
static char * syslog_ident
static int datagramm_size
DWORD WINAPI GetCurrentProcessId(void)
_In_ ULONG _In_ ULONG_PTR ident
Referenced by vsyslog().
◆ set_syslog_conf_dir()
◆ setlogmask()
◆ syslog()
Definition at line 261 of file syslog.c.
262{
264
268}
void vsyslog(int pri, char *fmt, va_list ap)
void int int ULONGLONG int va_list * ap
◆ vsyslog()
Definition at line 275 of file syslog.c.
276{
277 static char *
month[] = {
"Jan",
"Feb",
"Mar",
"Apr",
"May",
"Jun",
278 "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" };
282
284 return;
285
288 return;
289
292
295 pri,
305
307}
VOID WINAPI GetLocalTime(OUT LPSYSTEMTIME lpSystemTime)
static const WCHAR month[12][4]
INT WSAAPI sendto(IN SOCKET s, IN CONST CHAR FAR *buf, IN INT len, IN INT flags, IN CONST struct sockaddr *to, IN INT tolen)
#define sprintf(buf, format,...)
void openlog(char *ident, int option, int facility)
Referenced by syslog().
◆ datagramm
◆ datagramm_size
◆ initialized
Definition at line 39 of file syslog.c.
Referenced by __acrt_initialize_multibyte(), _RTC_InitBase(), closelog(), FD31_Init(), gl_init_math(), IDirectSound8_test(), IDirectSound_test(), IDirectSoundCapture_test(), IDirectSoundFullDuplex_test(), msvcrt_mlock_set_entry_initialized(), openlog(), test_external(), and vsyslog().
◆ local_hostname
◆ log_mask
◆ sa_logger
◆ sock
◆ str_pid
◆ syslog_conf_dir
◆ syslog_facility
◆ syslog_ident