SNAP Library 6.0, User Reference  2020-12-09 16:24:20
SNAP, a general purpose, high performance system for analysis and manipulation of large networks
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, void *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  #define _OPENMP
143 #endif
144 
145 //#ifdef GLib_MACOSX
146 // #undef _POSIX_MONOTONIC_CLOCK
147 //#endif
148 
149 //
150 // OpenMP directives
151 //
152 
153 #if defined(_OPENMP) && !defined(GLib_WIN)
154  // main OpenMP flag
155  #define USE_OPENMP
156  #define CHUNKS_PER_THREAD 10
157  #include <omp.h>
158  #if defined(GLib_GCC)
159  // use of __sync_... GCC atomic primitves
160  #define GCC_ATOMIC
161  #endif
162 #endif
163 
164 // for Snapworld, switch is defined to include util.h:WriteN()
165 //#if (defined(GLib_UNIX) && !defined(SWIG)) || (defined(SWIG_SW))
166 #if defined(SWIG_SW)
167  #define SW_WRITEN
168 #endif
169 
170 // for backtrace dump in G++, change SW_TRACE to 1
171 #define SW_TRACE 0
172 
173 // for Snap.py, switch 'no abort' is defined and NDEBUG is turned off
174 #if defined(SW_SNAPPY)
175  #define SW_NOABORT
176  #undef NDEBUG
177 #endif
178 
179 #include "bd.h"
180 #include "fl.h"
181 #include "dt.h"
182 #include "ut.h"
183 #include "ds.h"
184 #include "bits.h"
185 #include "hash.h"
186 #include "hashmp.h"
187 #include "xml.h"
188 
189 #include "xmath.h"
190 #include "xmlser.h"
191 
192 #include "unicode.h"
193 #include "unicodestring.h"
194 #include "tm.h"
195 #include "shash.h"
196 #include "os.h"
197 
198 #include "env.h"
199 #include "wch.h"
200 #include "xfl.h"
201 
202 #include "blobbs.h"
203 #include "lx.h"
204 #include "url.h"
205 
206 #include "http.h"
207 #include "html.h"
208 #include "md5.h"
209 #include "ss.h"
210 #include "ssmp.h"
211 #include "json.h"
212 //#include "prolog.h"
213 
214 #include "zipfl.h"
215 
216 void BaseTralala();
217 
218 #endif
void BaseTralala()
Definition: base.cpp:5