SNAP Library 4.0, Developer Reference
2017-07-27 13:18:06
SNAP, a general purpose, high performance system for analysis and manipulation of large networks
Main Page
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
base.h
Go to the documentation of this file.
1
#ifndef base_h
2
#define base_h
3
5
// Environment defines
6
#if defined (_WIN32)
7
#define GLib_WIN
8
#define GLib_WIN32
9
#elif defined (__WIN64)
10
#define GLib_WIN
11
#define GLib_WIN64
12
#elif defined(__linux__)
13
#define GLib_UNIX
14
#define GLib_LINUX __linux__
15
#elif defined(__sun__)
16
#define GLib_UNIX
17
#define GLib_SOLARIS __sun__
18
// !bn: defined in ctype_iso.h but apears as a parameter in GLib
19
#undef _C
20
#elif defined(__FreeBSD__)
21
#define GLib_UNIX
22
#define GLib_BSD __FreeBSD__
23
#elif defined(__CYGWIN__)
24
#define GLib_UNIX
25
#define GLib_CYGWIN
26
#elif (defined(__APPLE__) && defined(__MACH__))
27
#define GLib_UNIX
28
#define GLib_MACOSX
29
#endif
30
31
#define _CMPWARN
32
// compiler
33
#if defined (_MSC_VER)
34
#define GLib_MSC _MSC_VER
35
#endif
36
#if defined (__BCPLUSPLUS__)
37
#define GLib_BCB __BCPLUSPLUS__
38
#endif
39
#if defined (__GNUC__)
40
#define GLib_GCC __GNUC__
41
// !bn: to bo not samo dokler ne ugotovim kje so primerjave problematicne
42
#ifdef FLTWARN
43
#undef _CMPWARN
44
#define _CMPWARN __attribute__ ((deprecated))
45
#endif
46
#endif
47
48
// includes
49
#if defined (GLib_WIN32)
50
#define WIN32_LEAN_AND_MEAN
51
#include <windows.h>
52
#if !defined(_WINSOCKAPI_) && !defined(_WINSOCK2API_)
53
#include <winsock2.h>
54
#endif
55
#include <oleauto.h>
56
#include <shellapi.h>
57
#endif
58
59
#if defined(GLib_UNIX)
60
#undef __STDC_LIMIT_MACROS
61
#define __STDC_LIMIT_MACROS
62
#include <stdint.h>
63
#include <stdarg.h>
64
#include <errno.h>
65
#include <fcntl.h>
66
#include <dirent.h>
67
#include <unistd.h>
68
#include <signal.h>
69
#include <sys/poll.h>
70
#include <sys/socket.h>
71
#include <sys/stat.h>
72
#include <sys/time.h>
73
#include <sys/types.h>
74
#include <sys/wait.h>
75
#include <sys/resource.h>
76
#include <netdb.h>
77
#include <arpa/inet.h>
78
#include <netinet/in.h>
79
#endif
80
81
#if defined(WIN32_LEAN_AND_MEAN)
82
#include <stdint.h>
83
84
int
gettimeofday(
struct
timeval * tp,
struct
timezone * tzp);
85
#endif
86
87
// word size
88
#if __WORDSIZE == 32 || defined(GLib_WIN32) || defined(__CYGWIN32__)
89
#define GLib_32Bit
90
#elif __WORDSIZE == 64 || defined(GLib_WIN64) || defined(__CYGWIN64__)
91
#define GLib_64Bit
92
#else
93
#error "Undefined word size"
94
#endif
95
96
#if defined(GLib_UNIX)
97
#ifndef _environ
98
#if defined(GLib_MACOSX)
99
#include <crt_externs.h>
100
#define _environ (*_NSGetEnviron())
101
#elif !defined(GLib_CYGWIN)
102
#define _environ __environ
103
extern
int
_daylight;
104
#else
105
#define _environ environ
106
#endif
107
#endif
108
#ifndef __stdcall
109
#define __stdcall
110
#endif
111
#endif
112
113
#if defined(GLib_LINUX)
114
#include <sys/epoll.h>
115
#endif
116
117
#if defined(GLib_SOLARIS)
118
#include <ieeefp.h>
119
#endif
120
121
#if defined (__GLIBC__)
122
#define GLib_GLIBC __GLIBC__
123
#endif
124
125
#if defined (__USE_XOPEN2K)
126
#define GLib_POSIX_1j "1003.1j"
127
#endif
128
129
#include <ctype.h>
130
#include <float.h>
131
#include <limits.h>
132
#include <math.h>
133
#include <stdio.h>
134
#include <stdlib.h>
135
#include <string.h>
136
#include <time.h>
137
#include <typeinfo>
138
#include <stdexcept>
139
140
#ifdef GLib_CYGWIN
141
#define timezone _timezone
142
#endif
143
144
//#ifdef GLib_MACOSX
145
// #undef _POSIX_MONOTONIC_CLOCK
146
//#endif
147
148
//
149
// OpenMP directives
150
//
151
152
#if defined(_OPENMP) && !defined(GLib_WIN)
153
// main OpenMP flag
154
#define USE_OPENMP
155
#define CHUNKS_PER_THREAD 10
156
#include <omp.h>
157
#if defined(GLib_GCC)
158
// use of __sync_... GCC atomic primitves
159
#define GCC_ATOMIC
160
#endif
161
#endif
162
163
// for Snapworld, switch is defined to include util.h:WriteN()
164
//#if (defined(GLib_UNIX) && !defined(SWIG)) || (defined(SWIG_SW))
165
#if defined(SWIG_SW)
166
#define SW_WRITEN
167
#endif
168
169
// for backtrace dump in G++, change SW_TRACE to 1
170
#define SW_TRACE 0
171
172
// for Snap.py, switch 'no abort' is defined and NDEBUG is turned off
173
#if defined(SW_SNAPPY)
174
#define SW_NOABORT
175
#undef NDEBUG
176
#endif
177
178
#include "
bd.h
"
179
#include "
fl.h
"
180
#include "
dt.h
"
181
#include "
ut.h
"
182
#include "
ds.h
"
183
#include "
bits.h
"
184
#include "
hash.h
"
185
#include "
hashmp.h
"
186
#include "
xml.h
"
187
188
#include "
xmath.h
"
189
#include "
xmlser.h
"
190
191
#include "
unicode.h
"
192
#include "
unicodestring.h
"
193
#include "
tm.h
"
194
#include "
shash.h
"
195
#include "
os.h
"
196
197
#include "
env.h
"
198
#include "
wch.h
"
199
#include "
xfl.h
"
200
201
#include "
blobbs.h
"
202
#include "
lx.h
"
203
#include "
url.h
"
204
205
#include "
http.h
"
206
#include "
html.h
"
207
#include "
md5.h
"
208
#include "
ss.h
"
209
#include "
ssmp.h
"
210
#include "
json.h
"
211
//#include "prolog.h"
212
213
#include "
zipfl.h
"
214
215
void
BaseTralala
();
216
217
#endif
ut.h
unicode.h
ds.h
BaseTralala
void BaseTralala()
Definition:
base.cpp:5
html.h
bd.h
hash.h
wch.h
ssmp.h
env.h
fl.h
xfl.h
xmlser.h
http.h
unicodestring.h
json.h
xml.h
os.h
hashmp.h
xmath.h
tm.h
shash.h
lx.h
bits.h
ss.h
zipfl.h
md5.h
url.h
blobbs.h
dt.h
glib-core
base.h
Generated on Thu Jul 27 2017 13:18:08 for SNAP Library 4.0, Developer Reference by
1.8.7