added files
[bcm963xx.git] / userapps / opensource / net-snmp / include / net-snmp / library / system.h
1 #ifndef SNMP_SYSTEM_H
2 #define SNMP_SYSTEM_H
3
4 #ifdef __cplusplus
5 extern          "C" {
6 #endif
7
8 /***********************************************************
9         Copyright 1993 by Carnegie Mellon University
10
11                       All Rights Reserved
12
13 Permission to use, copy, modify, and distribute this software and its
14 documentation for any purpose and without fee is hereby granted,
15 provided that the above copyright notice appear in all copies and that
16 both that copyright notice and this permission notice appear in
17 supporting documentation, and that the name of CMU not be
18 used in advertising or publicity pertaining to distribution of the
19 software without specific, written prior permission.
20
21 CMU DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
22 ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
23 CMU BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
24 ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
25 WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
26 ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
27 SOFTWARE.
28 ******************************************************************/
29     /*
30      * Definitions for the system dependent library file
31      */
32 #ifdef WIN32
33
34     /*
35      * structure of a directory entry 
36      */
37     typedef struct direct {
38         long            d_ino;  /* inode number (not used by MS-DOS) */
39         int             d_namlen;       /* Name length */
40         char            d_name[257];    /* file name */
41     } _DIRECT;
42
43     /*
44      * structure for dir operations 
45      */
46     typedef struct _dir_struc {
47         char           *start;  /* Starting position */
48         char           *curr;   /* Current position */
49         long            size;   /* Size of string table */
50         long            nfiles; /* number if filenames in table */
51         struct direct   dirstr; /* Directory structure to return */
52     } DIR;
53
54     DIR            *opendir(const char *filename);
55     struct direct  *readdir(DIR * dirp);
56     int             closedir(DIR * dirp);
57
58 #ifndef HAVE_GETTIMEOFDAY
59     int             gettimeofday(struct timeval *, struct timezone *tz);
60 #endif
61 #ifndef HAVE_STRCASECMP
62     int             strcasecmp(const char *s1, const char *s2);
63 #endif
64 #ifndef HAVE_STRNCASECMP
65     int             strncasecmp(const char *s1, const char *s2, size_t n);
66 #endif
67
68     char           *winsock_startup(void);
69     void            winsock_cleanup(void);
70
71 #define SOCK_STARTUP winsock_startup()
72 #define SOCK_CLEANUP winsock_cleanup()
73
74 #else                           /* !WIN32 */
75
76 #define SOCK_STARTUP
77 #define SOCK_CLEANUP
78
79 #endif                          /* WIN32 */
80
81 #include <net-snmp/types.h>     /* For definition of in_addr_t */
82
83     in_addr_t       get_myaddr(void);
84     long            get_uptime(void);
85
86 #ifndef HAVE_STRDUP
87     char           *strdup(const char *);
88 #endif
89 #ifndef HAVE_SETENV
90     int             setenv(const char *, const char *, int);
91 #endif
92
93     int             calculate_time_diff(struct timeval *,
94                                         struct timeval *);
95
96 #ifndef HAVE_STRCASESTR
97     char           *strcasestr(const char *, const char *);
98 #endif
99 #ifndef HAVE_STRTOL
100     long            strtol(const char *, char **, int);
101 #endif
102 #ifndef HAVE_STRTOUL
103     unsigned long   strtoul(const char *, char **, int);
104 #endif
105 #ifndef HAVE_SNPRINTF
106     int             snprintf(char *, size_t, const char *, ...);
107 #endif
108
109     int             mkdirhier(const char *pathname, mode_t mode,
110                               int skiplast);
111
112 #ifdef __cplusplus
113 }
114 #endif
115 #endif                          /* SNMP_SYSTEM_H */