sipxtacklib  Version 3.3
utilNT.h
Go to the documentation of this file.
1 #ifndef _UTILNT_H
2 #define _UTILNT_H
3 
4 char *strtok_r(char *s1, char *s2, char **lasts);
5 double drand48();
6 int getopt(int nargc, char * const *nargv, const char *ostr);
7 
8 /*
9  * gettimeofday() function
10  * Used in gettimeofdayf.c, error.c
11  */
12 int gettimeofday(struct timeval *tp, void * );
13 
14 /*
15  * For syslog, openlog, closelog functions
16  * Used in error.c
17  */
18 #define LOG_ERR 3 /* error conditions */
19 #define LOG_PID 0x01 /* log the pid with each message */
20 #define LOG_DAEMON (3<<3) /* system daemons */
21 
22 void closelog(void);
23 void openlog(const char *ident, int logopt, int facility);
24 void syslog(int priority, const char *message, ... /* arguments */);
25 
26 /*
27  * struct group *getgrnam(const char *name) funciton
28  * Used in gname2id.c
29  */
30 #ifndef _WIN32 /* Conflicts with glib under windows */
31 typedef long pid_t; /* PID type */
32 #endif
33 typedef long uid_t; /* UID type */
34 typedef uid_t gid_t; /* GID type */
35 
36 struct group { /* see getgrent(3) */
37  char *gr_name;
38  char *gr_passwd;
40  char **gr_mem;
41 };
42 
43 int uname(struct utsname *name);
44 
45 long gethostid(void);
46 
47 long getuid(void);
48 
49 long getgid(void);
50 
51 int pthread_create(HANDLE *new_thread_ID, const void *attr, void * (*start_func)(void *), void *arg);
52 
53 struct group *getgrnam(const char *name);
54 
55 struct passwd *getpwnam(const char *name);
56 
57 struct passwd *getpwuid(uid_t uid);
58 
59 /*
60  * char *strptime(const char *buf, const char *format, struct tm *tm);
61  * used in http.c
62  */
63 
64 /*-
65  * Copyright (c) 1997 FreeBSD Inc.
66  * All rights reserved.
67  *
68  * Redistribution and use in source and binary forms, with or without
69  * modification, are permitted provided that the following conditions
70  * are met:
71  * 1. Redistributions of source code must retain the above copyright
72  * notice, this list of conditions and the following disclaimer.
73  * 2. Redistributions in binary form must reproduce the above copyright
74  * notice, this list of conditions and the following disclaimer in the
75  * documentation and/or other materials provided with the distribution.
76  *
77  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
78  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
79  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
80  * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
81  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
82  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
83  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
84  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
85  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
86  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
87  * SUCH DAMAGE.
88  *
89  *
90  */
91 
92 /*
93  * Private header file for the strftime and strptime localization
94  * stuff.
95  */
96 struct lc_time_T {
97  const char * mon[12];
98  const char * month[12];
99  const char * wday[7];
100  const char * weekday[7];
101  const char * X_fmt;
102  const char * x_fmt;
103  const char * c_fmt;
104  const char * am;
105  const char * pm;
106  const char * date_fmt;
107 };
108 
109 extern struct lc_time_T _time_localebuf; /* extern added by n-kns10 */
110 
111 extern int _time_using_locale;
112 extern const struct lc_time_T _C_time_locale;
113 
114 #define Locale (_time_using_locale ? &_time_localebuf : &_C_time_locale)
115 
116 char *strptime(const char *buf, const char *format, struct tm *tm)
117 #ifdef __GNUC__
118  // with the -Wformat switch, this enables format string checking
119  __attribute__ ((format (strftime, 2, 3)))
120 #endif
121 ;
122 
123 
124 #endif
gid_t gr_gid
Definition: utilNT.h:39
int pthread_create(HANDLE *new_thread_ID, const void *attr, void *(*start_func)(void *), void *arg)
long getgid(void)
double drand48()
char ** gr_mem
Definition: utilNT.h:40
int uname(struct utsname *name)
const char * am
Definition: utilNT.h:104
const char * date_fmt
Definition: utilNT.h:106
int gettimeofday(struct timeval *tp, void *)
void openlog(const char *ident, int logopt, int facility)
char * strtok_r(char *s1, char *s2, char **lasts)
void closelog(void)
char * gr_passwd
Definition: utilNT.h:38
const char * c_fmt
Definition: utilNT.h:103
char * strptime(const char *buf, const char *format, struct tm *tm)
long uid_t
Definition: utilNT.h:33
const char * pm
Definition: utilNT.h:105
void syslog(int priority, const char *message,...)
long getuid(void)
long gethostid(void)
Definition: utilNT.h:96
int _time_using_locale
char * gr_name
Definition: utilNT.h:37
uid_t gid_t
Definition: utilNT.h:34
struct passwd * getpwnam(const char *name)
Definition: utilNT.h:36
const struct lc_time_T _C_time_locale
int getopt(int nargc, char *const *nargv, const char *ostr)
const char * x_fmt
Definition: utilNT.h:102
struct group * getgrnam(const char *name)
struct lc_time_T _time_localebuf
long pid_t
Definition: utilNT.h:31
const char * X_fmt
Definition: utilNT.h:101
struct passwd * getpwuid(uid_t uid)

sipXtackLib home page