Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 157 lines (124 sloc) 3.983 kb
3051b96 @dwight dos2unix
dwight authored
1 // stdafx.h : include file for standard system include files,
2 // or project specific include files that are used frequently, but
3 // are changed infrequently
4 //
5
d27c850 @RedBeard0531 all client files now marked as Apache 2.0. SERVER-329.
RedBeard0531 authored
6 /* Copyright 2009 10gen Inc.
7 *
8 * Licensed under the Apache License, Version 2.0 (the "License");
9 * you may not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
11 *
12 * http://www.apache.org/licenses/LICENSE-2.0
13 *
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
19 */
50e8a1a @erh added AGPL License Header to every file
erh authored
20
3051b96 @dwight dos2unix
dwight authored
21 #pragma once
22
0b9aa26 @erh hack to try to fix windows MINOR
erh authored
23 #include <string>
24
ad1f6b3 @astaple Put our code in 'mongo' namespace
astaple authored
25 namespace mongo {
26
14cd718 @metagoto quick fix for global namespace pollution (mostly client)
metagoto authored
27 using namespace std;
28
50f1c26 @astaple Try to fix windows compile
astaple authored
29 #define NOMINMAX
30
3051b96 @dwight dos2unix
dwight authored
31 #if defined(_WIN32)
90d4523 @astaple Indent all lines within namespaces one level
astaple authored
32 const bool debug=true;
3051b96 @dwight dos2unix
dwight authored
33 #else
90d4523 @astaple Indent all lines within namespaces one level
astaple authored
34 const bool debug=false;
3051b96 @dwight dos2unix
dwight authored
35 #endif
36
5895a4d @astaple add version and system info to http interface
astaple authored
37 // pdfile versions
38 const int VERSION = 4;
be79e2a @erh bump pdfile version to 4.5
erh authored
39 const int VERSION_MINOR = 5;
5895a4d @astaple add version and system info to http interface
astaple authored
40
3224ad2 @alanw Moved implementation code from stdafx to correct pre-compiled headers
alanw authored
41 // mongo version
42 extern const char versionString[];
abb40a5 @erh got rid of exit() calls
erh authored
43
79be4b6 @erh clean up dbexit with an ExitCode enum SERVER-183
erh authored
44 enum ExitCode {
45 EXIT_CLEAN = 0 ,
46 EXIT_BADOPTIONS = 2 ,
47 EXIT_REPLICATION_ERROR = 3 ,
17dcc31 @erh new exit code MINOR
erh authored
48 EXIT_NEED_UPGRADE = 4 ,
79be4b6 @erh clean up dbexit with an ExitCode enum SERVER-183
erh authored
49 EXIT_KILL = 12 ,
50 EXIT_ABRUBT = 14 ,
51 EXIT_NTSERVICE_ERROR = 20 ,
52 EXIT_JAVA = 21 ,
53 EXIT_OOM_MALLOC = 42 ,
54 EXIT_OOM_REALLOC = 43 ,
55 EXIT_FS = 45 ,
abb40a5 @erh got rid of exit() calls
erh authored
56 EXIT_POSSIBLE_CORRUPTION = 60 , // this means we detected a possible corruption situation, like a buf overflow
57 EXIT_UNCAUGHT = 100 , // top level exception that wasn't caught
58 EXIT_TEST = 101 ,
59
79be4b6 @erh clean up dbexit with an ExitCode enum SERVER-183
erh authored
60 };
61
62 void dbexit( ExitCode returnCode, const char *whyMsg = "");
abb40a5 @erh got rid of exit() calls
erh authored
63
64 /**
65 this is here so you can't just type exit() to quit the program
66 you should either use dbexit to shutdown cleanly, or ::exit to tell the system to quiy
67 if you use this, you'll get a link error since mongo::exit isn't defined
68 */
69 void exit( ExitCode returnCode );
4880869 @erh inShutdown() method so spider monkey can shutdown cleanly
erh authored
70 bool inShutdown();
716a7b4 @astaple add 'buildinfo' command to get mongod compile information
astaple authored
71
ad1f6b3 @astaple Put our code in 'mongo' namespace
astaple authored
72 } // namespace mongo
73
3224ad2 @alanw Moved implementation code from stdafx to correct pre-compiled headers
alanw authored
74 #include <memory>
1d4379a @dwight dbgrid.cpp added; return $err on assert
dwight authored
75 #include <string>
3051b96 @dwight dos2unix
dwight authored
76 #include <iostream>
77 #include <fstream>
78 #include <map>
79 #include <vector>
80 #include <set>
3224ad2 @alanw Moved implementation code from stdafx to correct pre-compiled headers
alanw authored
81 #include <stdio.h>
82 #include <stdlib.h>
83 #include <sstream>
84 #include <signal.h>
ad1f6b3 @astaple Put our code in 'mongo' namespace
astaple authored
85
3224ad2 @alanw Moved implementation code from stdafx to correct pre-compiled headers
alanw authored
86 #include "targetver.h"
87 #include "time.h"
88 #include "string.h"
89 #include "limits.h"
cb18407 @dwight replay better
dwight authored
90
14cd718 @metagoto quick fix for global namespace pollution (mostly client)
metagoto authored
91 ///using namespace std;
ad1f6b3 @astaple Put our code in 'mongo' namespace
astaple authored
92
26dea1f @dwight db.dropDatabase();
dwight authored
93 #undef yassert
6a4de72 @astaple Add non-Strict mode for Dbref, use base64 encoding for bindata
astaple authored
94 #include <boost/archive/iterators/base64_from_binary.hpp>
dacc872 @astaple Enhance json parser
astaple authored
95 #include <boost/archive/iterators/binary_from_base64.hpp>
6a4de72 @astaple Add non-Strict mode for Dbref, use base64 encoding for bindata
astaple authored
96 #include <boost/archive/iterators/transform_width.hpp>
dacc872 @astaple Enhance json parser
astaple authored
97 #include <boost/filesystem/convenience.hpp>
98 #include <boost/filesystem/operations.hpp>
ad1f6b3 @astaple Put our code in 'mongo' namespace
astaple authored
99 #include <boost/program_options.hpp>
d91a66e @astaple Free bson builders if unable to parse
astaple authored
100 #include <boost/shared_ptr.hpp>
df348ee @dwight fix assert macro definition after a boost include (ugly at the moment)
dwight authored
101 #include <boost/smart_ptr.hpp>
dacc872 @astaple Enhance json parser
astaple authored
102 #define BOOST_SPIRIT_THREADSAFE
507261e @solatis added preprocessor check to avoid deprecation warnings introduced in boo...
solatis authored
103
104 #include <boost/version.hpp>
105
106 #if BOOST_VERSION >= 103800
6f3e4cd @solatis fixed namespace issue when using boost.spirit classic interface
solatis authored
107 #define BOOST_SPIRIT_USE_OLD_NAMESPACE
507261e @solatis added preprocessor check to avoid deprecation warnings introduced in boo...
solatis authored
108 #include <boost/spirit/include/classic_core.hpp>
109 #include <boost/spirit/include/classic_loops.hpp>
d5231d7 @RedBeard0531 Use boost's list_p in the json parser. SUPPORT-11 SERVER-443
RedBeard0531 authored
110 #include <boost/spirit/include/classic_lists.hpp>
507261e @solatis added preprocessor check to avoid deprecation warnings introduced in boo...
solatis authored
111 #else
dacc872 @astaple Enhance json parser
astaple authored
112 #include <boost/spirit/core.hpp>
113 #include <boost/spirit/utility/loops.hpp>
d5231d7 @RedBeard0531 Use boost's list_p in the json parser. SUPPORT-11 SERVER-443
RedBeard0531 authored
114 #include <boost/spirit/utility/lists.hpp>
507261e @solatis added preprocessor check to avoid deprecation warnings introduced in boo...
solatis authored
115 #endif
116
b039c1f @astaple add reads/writes to dbtop
astaple authored
117 #include <boost/tuple/tuple.hpp>
6e3a37e @erh moving some includes around
erh authored
118 #include <boost/thread/thread.hpp>
119 #include <boost/thread/condition.hpp>
120 #include <boost/thread/recursive_mutex.hpp>
121 #include <boost/thread/xtime.hpp>
26dea1f @dwight db.dropDatabase();
dwight authored
122 #undef assert
123 #define assert xassert
124 #define yassert 1
14cd718 @metagoto quick fix for global namespace pollution (mostly client)
metagoto authored
125
126 namespace mongo {
127 using namespace boost::filesystem;
128 }
d3e3876 @dwight stack traces
dwight authored
129
3224ad2 @alanw Moved implementation code from stdafx to correct pre-compiled headers
alanw authored
130 #include "util/debug_util.h"
d3e3876 @dwight stack traces
dwight authored
131 #include "util/goodies.h"
ee68a8e @dwight --nocursors
dwight authored
132 #include "util/log.h"
3224ad2 @alanw Moved implementation code from stdafx to correct pre-compiled headers
alanw authored
133 #include "util/allocator.h"
134 #include "util/assert_util.h"
135
136 namespace mongo {
137
138 void sayDbContext(const char *msg = 0);
139 void rawOut( const string &s );
f2b9332 @astaple when exhaust disk space, delete file and exit immediately
astaple authored
140
3224ad2 @alanw Moved implementation code from stdafx to correct pre-compiled headers
alanw authored
141 } // namespace mongo
142
143 namespace mongo {
144
145 const char * gitVersion();
146 const char * sysInfo();
147 string mongodVersion();
148
149 void printGitVersion();
150 void printSysInfo();
151
152 typedef char _TCHAR;
153
154 #define null (0)
155
156 } // namespace mongo
Something went wrong with that request. Please try again.