Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #ifndef ZORBA_OPTIONS_H
00017 #define ZORBA_OPTIONS_H
00018 #include <zorba/config.h>
00019
00020 #ifdef __cplusplus
00021 #include <vector>
00022 #include <zorba/zorba_string.h>
00023 #endif
00024
00025
00026
00027 typedef enum {
00028 ZORBA_OPT_LEVEL_O0,
00029 ZORBA_OPT_LEVEL_O1,
00030
00031
00032 ZORBA_OPT_LEVEL_O2
00033
00034
00035
00036
00037 } Zorba_opt_level_t;
00038
00039 #if !defined(__cplusplus)
00040 typedef enum { false = 0, true = 1 } bool;
00041 #endif
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054 typedef struct Zorba_CompilerHints {
00055
00056 Zorba_opt_level_t opt_level;
00057
00058 bool lib_module;
00059 #ifdef __cplusplus
00060
00061
00062
00063
00064
00065
00066 ZORBA_DLL_PUBLIC Zorba_CompilerHints();
00067 #endif
00068 } Zorba_CompilerHints_t;
00069
00070 typedef enum {
00071 ZORBA_SERIALIZATION_METHOD_XML,
00072 ZORBA_SERIALIZATION_METHOD_HTML,
00073 ZORBA_SERIALIZATION_METHOD_XHTML,
00074 ZORBA_SERIALIZATION_METHOD_TEXT,
00075 ZORBA_SERIALIZATION_METHOD_BINARY
00076 } Zorba_serialization_method_t;
00077
00078 typedef enum {
00079 ZORBA_BYTE_ORDER_MARK_YES,
00080 ZORBA_BYTE_ORDER_MARK_NO
00081 } Zorba_byte_order_mark_t;
00082
00083 typedef enum {
00084 ZORBA_ESCAPE_URI_ATTRIBUTES_YES,
00085 ZORBA_ESCAPE_URI_ATTRIBUTES_NO
00086 } Zorba_escape_uri_attributes_t;
00087
00088 typedef enum {
00089 ZORBA_INCLUDE_CONTENT_TYPE_YES,
00090 ZORBA_INCLUDE_CONTENT_TYPE_NO
00091 } Zorba_include_content_type_t;
00092
00093 typedef enum {
00094 ZORBA_INDENT_YES,
00095 ZORBA_INDENT_NO
00096 } Zorba_indent_t;
00097
00098 typedef enum {
00099 ZORBA_NORMALIZATION_FORM_NFC,
00100 ZORBA_NORMALIZATION_FORM_NFD,
00101 ZORBA_NORMALIZATION_FORM_NFKC,
00102 ZORBA_NORMALIZATION_FORM_NFKD,
00103 ZORBA_NORMALIZATION_FORM_FULLY_normalized,
00104 ZORBA_NORMALIZATION_FORM_NONE
00105 } Zorba_normalization_form_t;
00106
00107 typedef enum {
00108 ZORBA_OMIT_XML_DECLARATION_YES,
00109 ZORBA_OMIT_XML_DECLARATION_NO
00110 } Zorba_omit_xml_declaration_t;
00111
00112 typedef enum {
00113 ZORBA_STANDALONE_YES,
00114 ZORBA_STANDALONE_NO,
00115 ZORBA_STANDALONE_OMIT
00116 } Zorba_standalone_t;
00117
00118 typedef enum {
00119 ZORBA_UNDECLARE_PREFIXES_YES,
00120 ZORBA_UNDECLARE_PREFIXES_NO
00121 } Zorba_undeclare_prefixes_t;
00122
00123 typedef enum {
00124 ZORBA_ENCODING_UTF8,
00125 ZORBA_ENCODING_UTF16
00126 } Zorba_encoding_t;
00127
00128 typedef enum {
00129 ZORBA_USE_BINARY_ARCHIVE,
00130 ZORBA_USE_XML_ARCHIVE
00131 } Zorba_binary_plan_format_t;
00132
00133 typedef enum {
00134 DONT_SAVE_UNUSED_FUNCTIONS = 0,
00135 SAVE_UNUSED_FUNCTIONS = 1
00136 } Zorba_save_plan_options_t;
00137
00138
00139
00140
00141
00142
00143
00144
00145
00146 #ifdef __cplusplus
00147 typedef struct ZORBA_DLL_PUBLIC Zorba_SerializerOptions
00148 {
00149 Zorba_serialization_method_t ser_method;
00150 Zorba_byte_order_mark_t byte_order_mark;
00151 Zorba_escape_uri_attributes_t escape_uri_attributes;
00152 Zorba_include_content_type_t include_content_type;
00153 Zorba_indent_t indent;
00154 Zorba_normalization_form_t normalization_form;
00155 Zorba_omit_xml_declaration_t omit_xml_declaration;
00156 Zorba_standalone_t standalone;
00157 Zorba_undeclare_prefixes_t undeclare_prefixes;
00158 Zorba_encoding_t encoding;
00159
00160 zorba::String media_type;
00161 zorba::String doctype_system;
00162 zorba::String doctype_public;
00163 zorba::String cdata_section_elements;
00164 zorba::String version;
00165
00166
00167
00168
00169
00170
00171
00172
00173
00174
00175
00176
00177
00178
00179
00180
00181
00182 Zorba_SerializerOptions();
00183
00184
00185
00186
00187
00188
00189 void SetSerializerOption(const char* parameter, const char* value);
00190
00191
00192
00193
00194
00195
00196 static Zorba_SerializerOptions SerializerOptionsFromStringParams(const std::vector<std::pair<std::string,std::string> >& params);
00197
00198 } Zorba_SerializerOptions_t;
00199 #endif
00200
00201
00202 #ifndef __cplusplus
00203 struct Zorba_SerializerOptions;
00204 typedef struct Zorba_SerializerOptions Zorba_SerializerOptions_t;
00205 #endif
00206
00207
00208 #ifdef __cplusplus
00209 extern "C" {
00210 #endif
00211
00212
00213
00214
00215
00216 ZORBA_DLL_PUBLIC void Zorba_CompilerHints_default(Zorba_CompilerHints_t*);
00217
00218
00219
00220
00221
00222
00223
00224
00225 ZORBA_DLL_PUBLIC Zorba_SerializerOptions_t* Zorba_SerializerOptions_default();
00226
00227
00228
00229
00230
00231 ZORBA_DLL_PUBLIC void Zorba_SerializerOptions_free(Zorba_SerializerOptions_t* serializerOptions);
00232
00233
00234
00235
00236
00237
00238
00239
00240 ZORBA_DLL_PUBLIC void Zorba_SerializerOptions_set(Zorba_SerializerOptions_t* serializerOptions, const char* parameter, const char* value);
00241
00242
00243 #ifdef __cplusplus
00244 }
00245 #endif
00246
00247 #endif
00248
00249