zorba_options.inc 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. (*
  2. * Copyright 2006-2008 The FLWOR Foundation.
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. *)
  16. type
  17. (** \brief The optimization level used for optimizing the query. *)
  18. Zorba_opt_level_t = (
  19. ZORBA_OPT_LEVEL_O0, (**< Don't use any optimization. *)
  20. ZORBA_OPT_LEVEL_O1 (**< Use basic optimizations
  21. (e.g.\ removing sorting, removing duplicate elimination,
  22. or constant folding). *)
  23. );
  24. (** \brief Set of hints that can be passed to the query compiler.
  25. *
  26. * An instance of this class can be passed to the compileQuery function
  27. * of the Zorba class or the compile function of this class.
  28. * The members of this class represent hints that are passed to the
  29. * query compiler. For example, whether optimization of the query
  30. * should be done (O1) or not (O0).
  31. *
  32. * example_6 in file \link simple.cpp \endlink shows an example
  33. * how CompilerHints can be used.
  34. *)
  35. pZorba_CompilerHints_t = ^Zorba_CompilerHints_t;
  36. Zorba_CompilerHints_t = record
  37. (** \brief The optimization level that is used *)
  38. opt_level: Zorba_opt_level_t;
  39. (** \brief Treat the query as a library module *)
  40. lib_module: cbool;
  41. end;
  42. Zorba_serialization_method_t = (
  43. ZORBA_SERIALIZATION_METHOD_XML,
  44. ZORBA_SERIALIZATION_METHOD_HTML,
  45. ZORBA_SERIALIZATION_METHOD_XHTML,
  46. ZORBA_SERIALIZATION_METHOD_TEXT,
  47. ZORBA_SERIALIZATION_METHOD_JSON,
  48. ZORBA_SERIALIZATION_METHOD_JSONML
  49. );
  50. Zorba_byte_order_mark_t = (
  51. ZORBA_BYTE_ORDER_MARK_YES,
  52. ZORBA_BYTE_ORDER_MARK_NO
  53. );
  54. Zorba_escape_uri_attributes_t = (
  55. ZORBA_ESCAPE_URI_ATTRIBUTES_YES,
  56. ZORBA_ESCAPE_URI_ATTRIBUTES_NO
  57. );
  58. Zorba_include_content_type_t = (
  59. ZORBA_INCLUDE_CONTENT_TYPE_YES,
  60. ZORBA_INCLUDE_CONTENT_TYPE_NO
  61. );
  62. Zorba_indent_t = (
  63. ZORBA_INDENT_YES,
  64. ZORBA_INDENT_NO
  65. );
  66. Zorba_normalization_form_t = (
  67. ZORBA_NORMALIZATION_FORM_NFC,
  68. ZORBA_NORMALIZATION_FORM_NFD,
  69. ZORBA_NORMALIZATION_FORM_NFKC,
  70. ZORBA_NORMALIZATION_FORM_NFKD,
  71. ZORBA_NORMALIZATION_FORM_FULLY_normalized,
  72. ZORBA_NORMALIZATION_FORM_NONE
  73. );
  74. Zorba_omit_xml_declaration_t = (
  75. ZORBA_OMIT_XML_DECLARATION_YES,
  76. ZORBA_OMIT_XML_DECLARATION_NO
  77. );
  78. Zorba_standalone_t = (
  79. ZORBA_STANDALONE_YES,
  80. ZORBA_STANDALONE_NO,
  81. ZORBA_STANDALONE_OMIT
  82. );
  83. Zorba_undeclare_prefixes_t = (
  84. ZORBA_UNDECLARE_PREFIXES_YES,
  85. ZORBA_UNDECLARE_PREFIXES_NO
  86. );
  87. Zorba_binary_plan_format_t = (
  88. ZORBA_USE_BINARY_ARCHIVE,
  89. ZORBA_USE_XML_ARCHIVE
  90. );
  91. pZorba_SerializerOptions_t = ^Zorba_SerializerOptions_t;
  92. Zorba_SerializerOptions_t = record end;
  93. (** \brief Helper function for C to set default values ComplilerHints struct.
  94. *
  95. * \retval Zorba_CompilerHints_t with default member values
  96. *)
  97. {$IFDEF S}procedure{$ELSE}var{$ENDIF}Zorba_CompilerHints_default{$IFDEF D}: procedure{$ENDIF}
  98. (p: pZorba_CompilerHints_t); extdecl;{$IFDEF S}external zorbalib;{$ENDIF}
  99. (** \brief Helper function to create a Zorba_SerializerOptions_t struct because
  100. * of missing default constructor. C++ code can delete the
  101. * returned Zorba_SerializerOptions_t* struct, while C code
  102. * must call Zorba_SerializerOptions_free().
  103. *
  104. * \retval Zorba_CompilerHints_t with default member values
  105. *)
  106. {$IFDEF S}function{$ELSE}var{$ENDIF}Zorba_SerializerOptions_default{$IFDEF D}: function{$ENDIF}:
  107. pZorba_SerializerOptions_t; extdecl;{$IFDEF S}external zorbalib;{$ENDIF}
  108. (** \brief Helper function to delete a Zorba_SerializerOptions_t struct
  109. *
  110. * \retval Zorba_CompilerHints_t with default member values
  111. *)
  112. {$IFDEF S}procedure{$ELSE}var{$ENDIF}Zorba_SerializerOptions_free{$IFDEF D}: procedure{$ENDIF}
  113. (serializerOptions: pZorba_SerializerOptions_t); extdecl;{$IFDEF S}external zorbalib;{$ENDIF}
  114. (** \brief Helper function to set an option in a Zorba_SerializerOptions_t structure
  115. *
  116. * \param parameter the serializer parameter to be configured
  117. * \param value the value to which the parameter should be set
  118. * \retval Zorba_CompilerHints_t with default member values
  119. *)
  120. {$IFDEF S}procedure{$ELSE}var{$ENDIF}Zorba_SerializerOptions_set{$IFDEF D}: procedure{$ENDIF}
  121. (serializerOptions: pZorba_SerializerOptions_t; const parameter: pcchar; const value: pcchar); extdecl;{$IFDEF S}external zorbalib;{$ENDIF}