00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #include "config_express.h"
00021 #include "datagram.h"
00022 #include "referenceCount.h"
00023 #include "textEncoder.h"
00024 #include "thread.h"
00025 #include "typedObject.h"
00026 #include "typedReferenceCount.h"
00027 #include "virtualFile.h"
00028 #include "virtualFileComposite.h"
00029 #include "virtualFileMount.h"
00030 #include "virtualFileMountMultifile.h"
00031 #include "virtualFileMountSystem.h"
00032 #include "virtualFileSimple.h"
00033
00034 #include <dconfig.h>
00035
00036 ConfigureDef(config_express);
00037 NotifyCategoryDef(express, "");
00038 NotifyCategoryDef(thread, "");
00039
00040 extern void init_system_type_handles();
00041
00042 ConfigureFn(config_express) {
00043 init_libexpress();
00044 }
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054 void
00055 init_libexpress() {
00056 static bool initialized = false;
00057 if (initialized) {
00058 return;
00059 }
00060 initialized = true;
00061
00062 Datagram::init_type();
00063 ReferenceCount::init_type();
00064 TextEncoder::init_type();
00065 Thread::init_type();
00066 TypedObject::init_type();
00067 TypedReferenceCount::init_type();
00068 VirtualFile::init_type();
00069 VirtualFileComposite::init_type();
00070 VirtualFileMount::init_type();
00071 VirtualFileMountMultifile::init_type();
00072 VirtualFileMountSystem::init_type();
00073 VirtualFileSimple::init_type();
00074
00075 init_system_type_handles();
00076
00077 string text_encoding = config_express.GetString("text-encoding", "iso8859");
00078 if (text_encoding == "iso8859") {
00079 TextEncoder::set_default_encoding(TextEncoder::E_iso8859);
00080 } else if (text_encoding == "utf8") {
00081 TextEncoder::set_default_encoding(TextEncoder::E_utf8);
00082 } else if (text_encoding == "unicode") {
00083 TextEncoder::set_default_encoding(TextEncoder::E_unicode);
00084 } else {
00085 express_cat.error()
00086 << "Invalid text-encoding: " << text_encoding << "\n";
00087 }
00088 }
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098 bool
00099 get_leak_memory() {
00100 static bool got_leak_memory = false;
00101 static bool leak_memory;
00102
00103 if (!got_leak_memory) {
00104 leak_memory = config_express.GetBool("leak-memory", false);
00105 got_leak_memory = true;
00106 }
00107
00108 return leak_memory;
00109 }
00110
00111
00112
00113
00114
00115
00116
00117
00118
00119 bool
00120 get_never_destruct() {
00121 static bool got_never_destruct = false;
00122 static bool never_destruct;
00123
00124 if (!got_never_destruct) {
00125 never_destruct = config_express.GetBool("never-destruct", false);
00126 got_never_destruct = true;
00127 }
00128
00129 return never_destruct;
00130 }
00131
00132
00133
00134
00135
00136 bool
00137 get_use_high_res_clock() {
00138 return config_express.GetBool("use-high-res-clock", true);
00139 }
00140
00141
00142
00143
00144 bool
00145 get_paranoid_clock() {
00146 return config_express.GetBool("paranoid-clock", false);
00147 }
00148
00149
00150
00151
00152 bool
00153 get_paranoid_inheritance() {
00154 return config_express.GetBool("paranoid-inheritance", true);
00155 }
00156
00157
00158
00159
00160 bool
00161 get_verify_dcast() {
00162 static bool got_verify_dcast = false;
00163 static bool verify_dcast;
00164
00165 if (!got_verify_dcast) {
00166 verify_dcast = config_express.GetBool("verify-dcast", true);
00167 got_verify_dcast = true;
00168 }
00169
00170 return verify_dcast;
00171 }
00172
00173 const int patchfile_window_size =
00174 config_express.GetInt("patchfile-window-size", 16);
00175
00176 const int patchfile_increment_size =
00177 config_express.GetInt("patchfile-increment-size", 8);
00178
00179 const int patchfile_buffer_size =
00180 config_express.GetInt("patchfile-buffer-size", 4096);
00181
00182 const int patchfile_zone_size =
00183 config_express.GetInt("patchfile-zone-size", 10000);
00184
00185
00186
00187
00188 const bool keep_temporary_files =
00189 config_express.GetBool("keep-temporary-files", false);
00190
00191
00192
00193
00194
00195 const bool use_vfs = config_express.GetBool("use-vfs", true);
00196
00197
00198
00199
00200
00201 const bool collect_tcp = config_express.GetBool("collect-tcp", false);
00202 const double collect_tcp_interval = config_express.GetDouble("collect-tcp-interval", 0.2);
00203
00204
00205
00206 ConfigExpress &
00207 get_config_express() {
00208 return config_express;
00209 }
00210