diff options
| author | ivost <ivost@3ad0048d-3df7-0310-abae-a5850022a9f2> | 2009-11-01 01:26:13 +0000 |
|---|---|---|
| committer | ivost <ivost@3ad0048d-3df7-0310-abae-a5850022a9f2> | 2009-11-01 01:26:13 +0000 |
| commit | ea47f17c45a1f2136577fc6a052230a18bdb8b89 (patch) | |
| tree | f32d20035c58028f1b076f29ee793f5078f8064e /packages/zorba | |
| parent | 5b23604234919281293cfbedde11d086ac0fdb03 (diff) | |
| download | fpc-ea47f17c45a1f2136577fc6a052230a18bdb8b89.tar.gz | |
* added some new functions to zorba headers
* added an example
git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@13993 3ad0048d-3df7-0310-abae-a5850022a9f2
Diffstat (limited to 'packages/zorba')
| -rw-r--r-- | packages/zorba/examples/simple/simple.lpi | 260 | ||||
| -rw-r--r-- | packages/zorba/examples/simple/simple.lpr | 120 | ||||
| -rw-r--r-- | packages/zorba/src/zorba.inc | 83 |
3 files changed, 425 insertions, 38 deletions
diff --git a/packages/zorba/examples/simple/simple.lpi b/packages/zorba/examples/simple/simple.lpi new file mode 100644 index 0000000000..8126eed21c --- /dev/null +++ b/packages/zorba/examples/simple/simple.lpi @@ -0,0 +1,260 @@ +<?xml version="1.0"?> +<CONFIG> + <ProjectOptions> + <Version Value="7"/> + <General> + <Flags> + <MainUnitHasCreateFormStatements Value="False"/> + <MainUnitHasTitleStatement Value="False"/> + </Flags> + <MainUnit Value="0"/> + <TargetFileExt Value=""/> + <Icon Value="0"/> + <UseXPManifest Value="True"/> + <ActiveEditorIndexAtStart Value="0"/> + </General> + <VersionInfo> + <ProjectVersion Value=""/> + <Language Value=""/> + <CharSet Value=""/> + </VersionInfo> + <PublishOptions> + <Version Value="2"/> + <IgnoreBinaries Value="False"/> + <IncludeFileFilter Value="*.(pas|pp|inc|lfm|lpr|lrs|lpi|lpk|sh|xml)"/> + <ExcludeFileFilter Value="*.(bak|ppu|ppw|o|so);*~;backup"/> + </PublishOptions> + <RunParams> + <local> + <FormatVersion Value="1"/> + <LaunchingApplication PathPlusParams="/usr/X11R6/bin/xterm -T 'Lazarus Run Output' -e $(LazarusDir)/tools/runwait.sh $(TargetCmdLine)"/> + </local> + </RunParams> + <Units Count="9"> + <Unit0> + <Filename Value="simple.lpr"/> + <IsPartOfProject Value="True"/> + <UnitName Value="simple"/> + <CursorPos X="4" Y="69"/> + <TopLine Value="60"/> + <EditorIndex Value="0"/> + <UsageCount Value="20"/> + <Loaded Value="True"/> + </Unit0> + <Unit1> + <Filename Value="../../src/zorba.pas"/> + <UnitName Value="zorba"/> + <CursorPos X="7" Y="3"/> + <TopLine Value="1"/> + <EditorIndex Value="4"/> + <UsageCount Value="10"/> + <Loaded Value="True"/> + </Unit1> + <Unit2> + <Filename Value="../../src/zorba.inc"/> + <CursorPos X="5" Y="937"/> + <TopLine Value="915"/> + <EditorIndex Value="5"/> + <UsageCount Value="10"/> + <Loaded Value="True"/> + </Unit2> + <Unit3> + <Filename Value="../../../../../zorba/zorba/include/simplestore/simplestorec.h"/> + <CursorPos X="1" Y="25"/> + <TopLine Value="1"/> + <UsageCount Value="10"/> + <SyntaxHighlighter Value="C++"/> + </Unit3> + <Unit4> + <Filename Value="../../src/zorba_error.inc"/> + <CursorPos X="5" Y="28"/> + <TopLine Value="6"/> + <EditorIndex Value="3"/> + <UsageCount Value="10"/> + <Loaded Value="True"/> + </Unit4> + <Unit5> + <Filename Value="../../../../../zorba/zorba/include/zorba/zorbac.h"/> + <CursorPos X="17" Y="262"/> + <TopLine Value="312"/> + <EditorIndex Value="7"/> + <UsageCount Value="10"/> + <Loaded Value="True"/> + <SyntaxHighlighter Value="C++"/> + </Unit5> + <Unit6> + <Filename Value="../../src/zorba_options.inc"/> + <CursorPos X="3" Y="104"/> + <TopLine Value="82"/> + <EditorIndex Value="6"/> + <UsageCount Value="10"/> + <Loaded Value="True"/> + </Unit6> + <Unit7> + <Filename Value="../../../../rtl/inc/strings.pp"/> + <UnitName Value="strings"/> + <CursorPos X="1" Y="1"/> + <TopLine Value="1"/> + <EditorIndex Value="2"/> + <UsageCount Value="10"/> + <Loaded Value="True"/> + </Unit7> + <Unit8> + <Filename Value="../../../../rtl/inc/systemh.inc"/> + <CursorPos X="11" Y="513"/> + <TopLine Value="491"/> + <EditorIndex Value="1"/> + <UsageCount Value="10"/> + <Loaded Value="True"/> + </Unit8> + </Units> + <JumpHistory Count="30" HistoryIndex="29"> + <Position1> + <Filename Value="../../src/zorba.inc"/> + <Caret Line="13" Column="53" TopLine="1"/> + </Position1> + <Position2> + <Filename Value="../../src/zorba.inc"/> + <Caret Line="81" Column="39" TopLine="59"/> + </Position2> + <Position3> + <Filename Value="../../src/zorba.inc"/> + <Caret Line="322" Column="45" TopLine="300"/> + </Position3> + <Position4> + <Filename Value="../../src/zorba.inc"/> + <Caret Line="327" Column="39" TopLine="300"/> + </Position4> + <Position5> + <Filename Value="../../src/zorba.inc"/> + <Caret Line="333" Column="111" TopLine="300"/> + </Position5> + <Position6> + <Filename Value="../../src/zorba.inc"/> + <Caret Line="1953" Column="26" TopLine="1931"/> + </Position6> + <Position7> + <Filename Value="../../src/zorba.inc"/> + <Caret Line="1956" Column="19" TopLine="1931"/> + </Position7> + <Position8> + <Filename Value="../../src/zorba.inc"/> + <Caret Line="1961" Column="42" TopLine="1931"/> + </Position8> + <Position9> + <Filename Value="../../src/zorba.inc"/> + <Caret Line="1965" Column="46" TopLine="1931"/> + </Position9> + <Position10> + <Filename Value="../../src/zorba.inc"/> + <Caret Line="1969" Column="73" TopLine="1931"/> + </Position10> + <Position11> + <Filename Value="../../src/zorba.inc"/> + <Caret Line="1972" Column="42" TopLine="1943"/> + </Position11> + <Position12> + <Filename Value="../../src/zorba.inc"/> + <Caret Line="6" Column="1" TopLine="1"/> + </Position12> + <Position13> + <Filename Value="../../src/zorba.inc"/> + <Caret Line="81" Column="39" TopLine="59"/> + </Position13> + <Position14> + <Filename Value="../../src/zorba.inc"/> + <Caret Line="322" Column="45" TopLine="300"/> + </Position14> + <Position15> + <Filename Value="../../src/zorba.inc"/> + <Caret Line="327" Column="39" TopLine="300"/> + </Position15> + <Position16> + <Filename Value="../../src/zorba.inc"/> + <Caret Line="333" Column="111" TopLine="300"/> + </Position16> + <Position17> + <Filename Value="../../src/zorba.inc"/> + <Caret Line="1953" Column="26" TopLine="1931"/> + </Position17> + <Position18> + <Filename Value="../../src/zorba.inc"/> + <Caret Line="1956" Column="19" TopLine="1931"/> + </Position18> + <Position19> + <Filename Value="../../src/zorba.inc"/> + <Caret Line="1961" Column="42" TopLine="1931"/> + </Position19> + <Position20> + <Filename Value="../../src/zorba.inc"/> + <Caret Line="1965" Column="46" TopLine="1931"/> + </Position20> + <Position21> + <Filename Value="../../src/zorba.inc"/> + <Caret Line="1969" Column="73" TopLine="1931"/> + </Position21> + <Position22> + <Filename Value="../../src/zorba.inc"/> + <Caret Line="1972" Column="42" TopLine="1931"/> + </Position22> + <Position23> + <Filename Value="simple.lpr"/> + <Caret Line="16" Column="23" TopLine="2"/> + </Position23> + <Position24> + <Filename Value="simple.lpr"/> + <Caret Line="22" Column="11" TopLine="1"/> + </Position24> + <Position25> + <Filename Value="simple.lpr"/> + <Caret Line="21" Column="20" TopLine="1"/> + </Position25> + <Position26> + <Filename Value="simple.lpr"/> + <Caret Line="20" Column="4" TopLine="1"/> + </Position26> + <Position27> + <Filename Value="simple.lpr"/> + <Caret Line="79" Column="30" TopLine="52"/> + </Position27> + <Position28> + <Filename Value="simple.lpr"/> + <Caret Line="92" Column="5" TopLine="59"/> + </Position28> + <Position29> + <Filename Value="simple.lpr"/> + <Caret Line="83" Column="18" TopLine="59"/> + </Position29> + <Position30> + <Filename Value="simple.lpr"/> + <Caret Line="62" Column="1" TopLine="25"/> + </Position30> + </JumpHistory> + </ProjectOptions> + <CompilerOptions> + <Version Value="8"/> + <Target> + <Filename Value="simple"/> + </Target> + <SearchPaths> + <IncludeFiles Value="$(ProjOutDir)/"/> + <UnitOutputDirectory Value="lib/$(TargetCPU)-$(TargetOS)"/> + </SearchPaths> + <Other> + <CompilerPath Value="$(CompPath)"/> + </Other> + </CompilerOptions> + <Debugging> + <Exceptions Count="3"> + <Item1> + <Name Value="EAbort"/> + </Item1> + <Item2> + <Name Value="ECodetoolError"/> + </Item2> + <Item3> + <Name Value="EFOpenError"/> + </Item3> + </Exceptions> + </Debugging> +</CONFIG> diff --git a/packages/zorba/examples/simple/simple.lpr b/packages/zorba/examples/simple/simple.lpr new file mode 100644 index 0000000000..e9ab34e576 --- /dev/null +++ b/packages/zorba/examples/simple/simple.lpr @@ -0,0 +1,120 @@ +program simple; + +{$mode objfpc}{$H+} + +uses + {$IFDEF UNIX}{$IFDEF UseCThreads} + cthreads, + {$ENDIF}{$ENDIF} + Classes, + zorba, + ctypes; + +{$IFDEF WINDOWS}{$R simple.rc}{$ENDIF} + +procedure stream_write(stream: XQC_OutputStream; const buf: pchar; length: cuint); cdecl; +var + S: String; +begin + SetLength(S, length); + Move(buf^, S[1], length); + WriteLn(S); +end; + +procedure stream_free(stream: XQC_OutputStream); cdecl; +begin +end; + +const + streamdef: XQC_OutputStream_s = ( + write:@stream_write; + free:@stream_free; + data:nil + ); + +var + stream: XQC_OutputStream = @streamdef; + + + + +(** + * A simple C API example + * Compile a query and print the result. No error checking is done. + *) +function example_1(impl: XQC_Implementation): boolean; +var + lXQuery: XQC_Query; +begin + // compile the query + impl^.prepare(impl, '(1+2, 3, 4)', nil, nil, lXQuery); + + // execute it and print the result on standard out + lXQuery^.serialize_stream(lXQuery, nil, stream); + + // release the query + lXQuery^.free(lXQuery); + + Result := True; +end; + + + +(** + * A simple C API example + * Compile a query, iterate over the item sequence, and print the string value for each item. + * No error checking is done. + *) +function example_2(impl: XQC_Implementation): boolean; +var + lXQuery : XQC_Query; + lItem : XQC_Item; + lResult : XQC_Sequence; + lStringValue : pchar; +begin + impl^.create_item(impl, lItem); + + // compile the query and get the result as a sequence + impl^.prepare(impl, 'for $i in 1 to 10 return $i', nil, nil, lXQuery); + + lXQuery^.sequence(lXQuery, lResult); + + while lResult^.next(lResult, lItem) = XQ_NO_ERROR do + begin + lItem^.string_value(lItem, &lStringValue); + write(lStringValue, ' '); + end; + writeln; + + // release all aquired resources + lItem^.free(lItem); + lResult^.free(lResult); + lXQuery^.free(lXQuery); + + Result := True; +end; + + + +var + impl: XQC_Implementation; + store: Pointer; +begin + store := create_simple_store(); + if zorba_implementation(impl, store) <> XQ_NO_ERROR then + Exit; + + writeln('executing PASCAL example 1'); + if not example_1(impl) then + Exit; + writeln; + + writeln('executing PASCAL example 2'); + if not example_2(impl) then + Exit; + writeln; + + impl^.free(impl); + shutdown_simple_store(store); +end. + diff --git a/packages/zorba/src/zorba.inc b/packages/zorba/src/zorba.inc index 72a59470ca..8366f58972 100644 --- a/packages/zorba/src/zorba.inc +++ b/packages/zorba/src/zorba.inc @@ -134,7 +134,7 @@ type * \retval ::XQP0019_INTERNAL_ERROR * \retval An XQuery static or type error (e.g. XPST*, XPTY* ) *) - prepare: function(impl: XQC_Implementation; query_string: pcchar; context: XQC_StaticContext; + prepare: function(impl: XQC_Implementation; query_string: pchar; context: XQC_StaticContext; handler: XQC_ErrorHandler; out query: XQC_Query): XQUERY_ERROR; extdecl; (** @@ -436,7 +436,7 @@ type * \retval ::XQC_NO_ERROR * \retval ::XQC_INTERNAL_ERROR *) - declare_ns: function(context: XQC_StaticContext; const prefix: pcchar; const uri: ppchar): XQUERY_ERROR; extdecl; + declare_ns: function(context: XQC_StaticContext; const prefix: pchar; const uri: ppchar): XQUERY_ERROR; extdecl; (** @@ -449,7 +449,7 @@ type * \retval ::XQC_NO_ERROR * \retval ::XQC_INTERNAL_ERROR *) - get_ns_by_prefix: function(context: XQC_StaticContext; const prefix: pcchar; out result_ns: ppchar): XQUERY_ERROR; extdecl; + get_ns_by_prefix: function(context: XQC_StaticContext; const prefix: pchar; out result_ns: ppchar): XQUERY_ERROR; extdecl; (** @@ -461,7 +461,7 @@ type * \retval ::XQC_NO_ERROR * \retval ::XQC_INTERNAL_ERROR *) - set_default_element_and_type_ns: function(context: XQC_StaticContext; const uri: pcchar): XQUERY_ERROR; extdecl; + set_default_element_and_type_ns: function(context: XQC_StaticContext; const uri: pchar): XQUERY_ERROR; extdecl; (** @@ -473,7 +473,7 @@ type * \retval ::XQC_NO_ERROR * \retval ::XQC_INTERNAL_ERROR *) - get_default_element_and_type_ns: function(context: XQC_StaticContext; out uri: pcchar): XQUERY_ERROR; extdecl; + get_default_element_and_type_ns: function(context: XQC_StaticContext; out uri: pchar): XQUERY_ERROR; extdecl; (** @@ -485,7 +485,7 @@ type * \retval ::XQC_NO_ERROR * \retval ::XQC_INTERNAL_ERROR *) - set_default_function_ns: function(context: XQC_StaticContext; const uri: pcchar): XQUERY_ERROR; extdecl; + set_default_function_ns: function(context: XQC_StaticContext; const uri: pchar): XQUERY_ERROR; extdecl; (** @@ -497,7 +497,7 @@ type * \retval ::XQC_NO_ERROR * \retval ::XQC_INTERNAL_ERROR *) - get_default_function_ns: function(context: XQC_StaticContext; out uri: pcchar): XQUERY_ERROR; extdecl; + get_default_function_ns: function(context: XQC_StaticContext; out uri: pchar): XQUERY_ERROR; extdecl; (** @@ -522,7 +522,7 @@ type * \retval ::XQST0038 * \retval ::XQC_INTERNAL_ERROR *) - add_collation: function(context: XQC_StaticContext; const uri: pcchar): XQUERY_ERROR; extdecl; + add_collation: function(context: XQC_StaticContext; const uri: pchar): XQUERY_ERROR; extdecl; (** @@ -536,7 +536,7 @@ type * \retval ::XQST0038 * \retval ::XQC_INTERNAL_ERROR *) - set_default_collation: function(context: XQC_StaticContext; const uri: pcchar): XQUERY_ERROR; extdecl; + set_default_collation: function(context: XQC_StaticContext; const uri: pchar): XQUERY_ERROR; extdecl; (** @@ -546,7 +546,7 @@ type * \param context The XQC_StaticContext that this function pointer is a member of * \param[out] uri The URI of the default collation that is currently set in the given context. *) - get_default_collation: function(context: XQC_StaticContext; out uri: pcchar): XQUERY_ERROR; extdecl; + get_default_collation: function(context: XQC_StaticContext; out uri: pchar): XQUERY_ERROR; extdecl; (** @@ -731,7 +731,7 @@ type * \retval ::XQC_NO_ERROR * \retval ::XQC_INTERNAL_ERROR *) - set_base_uri: function(context: XQC_StaticContext; const base_uri: pcchar): XQUERY_ERROR; extdecl; + set_base_uri: function(context: XQC_StaticContext; const base_uri: pchar): XQUERY_ERROR; extdecl; (** @@ -745,7 +745,7 @@ type * \retval ::XQC_NO_ERROR * \retval ::XQC_INTERNAL_ERROR *) - get_base_uri: function(context: XQC_StaticContext; out base_uri: pcchar): XQUERY_ERROR; extdecl; + get_base_uri: function(context: XQC_StaticContext; out base_uri: pchar): XQUERY_ERROR; extdecl; (** @@ -768,7 +768,7 @@ type * \retval ::API0019_FUNCTION_ALREADY_REGISTERED, * \retval ::XQC_INTERNAL_ERROR *) - register_external_function: function(context: XQC_StaticContext; const uri, localname: pcchar; init: external_function_init; + register_external_function: function(context: XQC_StaticContext; const uri, localname: pchar; init: external_function_init; next: external_function_next; release: external_function_release; global_user_data: pointer): XQUERY_ERROR; extdecl; @@ -820,7 +820,7 @@ type * \retval ::XQP0017_LOADER_PARSING_ERROR, * \retval ::XQC_INTERNAL_ERROR *) - set_context_document: function(context: XQC_DynamicContext; const doc_uri: pcchar; document: pfile): XQUERY_ERROR; extdecl; + set_context_document: function(context: XQC_DynamicContext; const doc_uri: pchar; document: pfile): XQUERY_ERROR; extdecl; (** @@ -833,7 +833,7 @@ type * \retval ::XQC_NO_ERROR * \retval ::XQC_INTERNAL_ERROR *) - set_variable_item: function(context: XQC_DynamicContext; const qname: pcchar; value: XQC_Item): XQUERY_ERROR; extdecl; + set_variable_item: function(context: XQC_DynamicContext; const qname: pchar; value: XQC_Item): XQUERY_ERROR; extdecl; (** @@ -846,7 +846,7 @@ type * \retval ::XQC_NO_ERROR * \retval ::XQC_INTERNAL_ERROR *) - set_variable_sequence: function(context: XQC_DynamicContext; const qname: pcchar; value: XQC_Sequence): XQUERY_ERROR; extdecl; + set_variable_sequence: function(context: XQC_DynamicContext; const qname: pchar; value: XQC_Sequence): XQUERY_ERROR; extdecl; (** @@ -862,7 +862,7 @@ type * \retval ::XQP0017_LOADER_PARSING_ERROR, * \retval ::XQC_INTERNAL_ERROR *) - set_variable_document: function(context: XQC_DynamicContext; const var_qname, doc_uri: pcchar; document: pfile): XQUERY_ERROR; extdecl; + set_variable_document: function(context: XQC_DynamicContext; const var_qname, doc_uri: pchar; document: pfile): XQUERY_ERROR; extdecl; (** @@ -934,7 +934,7 @@ type * \retval ::XQP0019_INTERNAL_ERROR * \retval ::XQP0024_FUNCTION_NOT_IMPLEMENTED_FOR_ITEMTYPE *) - string_value: function(item: XQC_Item; out string_value: pcchar): XQUERY_ERROR; extdecl; + string_value: function(item: XQC_Item; out string_value: pchar): XQUERY_ERROR; extdecl; (** @@ -949,7 +949,7 @@ type * \retval ::XQP0019_INTERNAL_ERROR * \retval ::XQP0024_FUNCTION_NOT_IMPLEMENTED_FOR_ITEMTYPE *) - prefix: function(item: XQC_Item; out prefix: pcchar): XQUERY_ERROR; extdecl; + prefix: function(item: XQC_Item; out prefix: pchar): XQUERY_ERROR; extdecl; (** @@ -964,7 +964,7 @@ type * \retval ::XQP0019_INTERNAL_ERROR * \retval ::XQP0024_FUNCTION_NOT_IMPLEMENTED_FOR_ITEMTYPE *) - ns: function(item: XQC_Item; out ns: pcchar): XQUERY_ERROR; extdecl; + ns: function(item: XQC_Item; out ns: pchar): XQUERY_ERROR; extdecl; (** @@ -979,7 +979,7 @@ type * \retval ::XQP0019_INTERNAL_ERROR * \retval ::XQP0024_FUNCTION_NOT_IMPLEMENTED_FOR_ITEMTYPE *) - localname: function(item: XQC_Item; out local_name: pcchar): XQUERY_ERROR; extdecl; + localname: function(item: XQC_Item; out local_name: pchar): XQUERY_ERROR; extdecl; (** @@ -1062,7 +1062,7 @@ type * \retval ::XQP0019_INTERNAL_ERROR * \retval ::XQP0025_COULD_NOT_CREATE_ITEM *) - create_string: function(factory: XQC_ItemFactory; const str: pcchar; out item: XQC_Item): XQUERY_ERROR; extdecl; + create_string: function(factory: XQC_ItemFactory; const str: pchar; out item: XQC_Item): XQUERY_ERROR; extdecl; (** @@ -1077,7 +1077,7 @@ type * \retval ::XQP0019_INTERNAL_ERROR * \retval ::XQP0025_COULD_NOT_CREATE_ITEM *) - create_anyuri: function(factory: XQC_ItemFactory; const str: pcchar; out item: XQC_Item): XQUERY_ERROR; extdecl; + create_anyuri: function(factory: XQC_ItemFactory; const str: pchar; out item: XQC_Item): XQUERY_ERROR; extdecl; (** @@ -1093,7 +1093,7 @@ type * \retval ::XQP0019_INTERNAL_ERROR * \retval ::XQP0025_COULD_NOT_CREATE_ITEM *) - create_qname2: function(factory: XQC_ItemFactory; const uri, localname: pcchar; out item: XQC_Item): XQUERY_ERROR; extdecl; + create_qname2: function(factory: XQC_ItemFactory; const uri, localname: pchar; out item: XQC_Item): XQUERY_ERROR; extdecl; (** @@ -1110,7 +1110,7 @@ type * \retval ::XQP0019_INTERNAL_ERROR * \retval ::XQP0025_COULD_NOT_CREATE_ITEM *) - create_qname3: function(factory: XQC_ItemFactory; const uri, prefix, localname: pcchar; out item: XQC_Item): XQUERY_ERROR; extdecl; + create_qname3: function(factory: XQC_ItemFactory; const uri, prefix, localname: pchar; out item: XQC_Item): XQUERY_ERROR; extdecl; (** @@ -1140,7 +1140,7 @@ type * \retval ::XQP0019_INTERNAL_ERROR * \retval ::XQP0025_COULD_NOT_CREATE_ITEM *) - create_ncname: function(factory: XQC_ItemFactory; const ncname: pcchar; out item: XQC_Item): XQUERY_ERROR; extdecl; + create_ncname: function(factory: XQC_ItemFactory; const ncname: pchar; out item: XQC_Item): XQUERY_ERROR; extdecl; (** @@ -1156,7 +1156,7 @@ type * \retval ::XQP0019_INTERNAL_ERROR * \retval ::XQP0025_COULD_NOT_CREATE_ITEM *) - create_base64binary: function(factory: XQC_ItemFactory; const binary_data: pcchar; length: csize_t; out item: XQC_Item): XQUERY_ERROR; extdecl; + create_base64binary: function(factory: XQC_ItemFactory; const binary_data: pchar; length: csize_t; out item: XQC_Item): XQUERY_ERROR; extdecl; (** @@ -1186,7 +1186,7 @@ type * \retval ::XQP0019_INTERNAL_ERROR * \retval ::XQP0025_COULD_NOT_CREATE_ITEM *) - create_decimal_char: function(factory: XQC_ItemFactory; const value: pcchar; out item: XQC_Item): XQUERY_ERROR; extdecl; + create_decimal_char: function(factory: XQC_ItemFactory; const value: pchar; out item: XQC_Item): XQUERY_ERROR; extdecl; (** @@ -1216,7 +1216,7 @@ type * \retval ::XQP0019_INTERNAL_ERROR * \retval ::XQP0025_COULD_NOT_CREATE_ITEM *) - create_integer_char: function(factory: XQC_ItemFactory; const integer_value: pcchar; out item: XQC_Item): XQUERY_ERROR; extdecl; + create_integer_char: function(factory: XQC_ItemFactory; const integer_value: pchar; out item: XQC_Item): XQUERY_ERROR; extdecl; (** @@ -1291,7 +1291,7 @@ type * \retval ::XQP0019_INTERNAL_ERROR * \retval ::XQP0025_COULD_NOT_CREATE_ITEM *) - create_date_char: function(factory: XQC_ItemFactory; const date_value: pcchar; out item: XQC_Item): XQUERY_ERROR; extdecl; + create_date_char: function(factory: XQC_ItemFactory; const date_value: pchar; out item: XQC_Item): XQUERY_ERROR; extdecl; (** @@ -1346,7 +1346,7 @@ type * \retval ::XQP0019_INTERNAL_ERROR * \retval ::XQP0025_COULD_NOT_CREATE_ITEM *) - create_datetime_char: function(factory: XQC_ItemFactory; const datetime_value: pcchar; out item: XQC_Item): XQUERY_ERROR; extdecl; + create_datetime_char: function(factory: XQC_ItemFactory; const datetime_value: pchar; out item: XQC_Item): XQUERY_ERROR; extdecl; (** @@ -1375,7 +1375,7 @@ type * \retval ::XQP0019_INTERNAL_ERROR * \retval ::XQP0025_COULD_NOT_CREATE_ITEM *) - create_double_char: function(factory: XQC_ItemFactory; const value: pcchar; out item: XQC_Item): XQUERY_ERROR; extdecl; + create_double_char: function(factory: XQC_ItemFactory; const value: pchar; out item: XQC_Item): XQUERY_ERROR; extdecl; (** @@ -1411,7 +1411,7 @@ type * \retval ::XQP0019_INTERNAL_ERROR * \retval ::XQP0025_COULD_NOT_CREATE_ITEM *) - create_float: function(factory: XQC_ItemFactory; const value: pcchar; out item: XQC_Item): XQUERY_ERROR; extdecl; + create_float: function(factory: XQC_ItemFactory; const value: pchar; out item: XQC_Item): XQUERY_ERROR; extdecl; (** @@ -1504,7 +1504,7 @@ type * \retval ::XQP0019_INTERNAL_ERROR * \retval ::XQP0025_COULD_NOT_CREATE_ITEM *) - create_hexbinary: function(factory: XQC_ItemFactory; const hex_data: pcchar; size: csize_t; out item: XQC_Item): XQUERY_ERROR; extdecl; + create_hexbinary: function(factory: XQC_ItemFactory; const hex_data: pchar; size: csize_t; out item: XQC_Item): XQUERY_ERROR; extdecl; (** @@ -1579,7 +1579,7 @@ type * \retval ::XQP0019_INTERNAL_ERROR * \retval ::XQP0025_COULD_NOT_CREATE_ITEM *) - create_time_char: function(factory: XQC_ItemFactory; const value: pcchar; out item: XQC_Item): XQUERY_ERROR; extdecl; + create_time_char: function(factory: XQC_ItemFactory; const value: pchar; out item: XQC_Item): XQUERY_ERROR; extdecl; (** @@ -2046,7 +2046,7 @@ type * \param components The column number in the line in the query where the error occured. *) error: procedure(handler: XQC_ErrorHandler; error: XQUERY_ERROR; const local_name, description, - query_uri: pcchar; line, column: cuint); extdecl; + query_uri: pchar; line, column: cuint); extdecl; (** @@ -2069,7 +2069,12 @@ type * \retval ::XQC_NO_ERROR * \retval ::XQP0019_INTERNAL_ERROR *) -{$IFDEF S}function{$ELSE}var{$ENDIF}zorba_implementation{$IFDEF D}: function{$ENDIF}(impl: XQC_Implementation_Ref; store: Pointer): XQUERY_ERROR; extdecl;{$IFDEF S}external zorbalib;{$ENDIF} +{$IFDEF S}function{$ELSE}var{$ENDIF}zorba_implementation{$IFDEF D}: function{$ENDIF}(out impl: XQC_Implementation; store: Pointer): XQUERY_ERROR; extdecl;{$IFDEF S}external zorbalib;{$ENDIF} + + +(* simplestorec.h *) +{$IFDEF S}function{$ELSE}var{$ENDIF}create_simple_store{$IFDEF D}: function{$ENDIF}: Pointer; extdecl;{$IFDEF S}external zorbalib;{$ENDIF} +{$IFDEF S}procedure{$ELSE}var{$ENDIF}shutdown_simple_store{$IFDEF D}: procedure{$ENDIF}(store: Pointer); extdecl;{$IFDEF S}external zorbalib;{$ENDIF} @@ -2086,7 +2091,9 @@ implementation {$IFDEF LOAD_DYNAMICALLY} const - zorba_symbols: array[0..4] of TLibSymbol = ( + zorba_symbols: array[0..6] of TLibSymbol = ( + (pvar:@create_simple_store; name:'create_simple_store'; weak:false), + (pvar:@shutdown_simple_store; name:'shutdown_simple_store'; weak:false), (pvar:@zorba_implementation; name:'zorba_implementation'; weak:false), (pvar:@Zorba_CompilerHints_default; name:'Zorba_CompilerHints_default'; weak:false), (pvar:@Zorba_SerializerOptions_default; name:'Zorba_SerializerOptions_default'; weak:false), |
