1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #include <libxml/tree.h>
25 #include <libxml/xpath.h>
26 #include <libxml/xpathInternals.h>
27 
28 /*
29    entry functions for libxml xpath engine
30 
31 */
32 
33 /**
34  * xmlXPathParserContext:
35  *
36  * An XPath parser context. It contains pure parsing informations,
37  * an xmlXPathContext, and the stack of objects.
38  */
39 #if 0
40 // for reference from xpath.h
41 struct _xmlXPathParserContext {
42     const xmlChar *cur;         /* the current char being parsed */
43     const xmlChar *base;            /* the full expression */
44 
45     int error;              /* error code */
46 
47     xmlXPathContextPtr  context;    /* the evaluation context */
48     xmlXPathObjectPtr     value;    /* the current value */
49     int                 valueNr;    /* number of values stacked */
50     int                valueMax;    /* max number of values stacked */
51     xmlXPathObjectPtr *valueTab;    /* stack of values */
52 
53     xmlXPathCompExprPtr comp;       /* the precompiled expression */
54     int xptr;               /* it this an XPointer expression */
55     xmlNodePtr         ancestor;    /* used for walking preceding axis */
56 };
57 
58 #endif
59 
60 extern "C"
61 {
62 
63 // XForms
64 /*
65 void xforms_getInstanceDocumentFunction(xmlXPathParserContextPtr ctxt, int nargs);
66 void xforms_rebuildFunction(xmlXPathParserContextPtr ctxt, int nargs);
67 void xforms_recalculateFunction(xmlXPathParserContextPtr ctxt, int nargs);
68 void xforms_revalidateFunction(xmlXPathParserContextPtr ctxt, int nargs);
69 void xforms_refreshFunction(xmlXPathParserContextPtr ctxt, int nargs);
70 */
71 
72 // XForms Core Functions
73 // boolean functions
74 void xforms_booleanFromStringFunction(xmlXPathParserContextPtr ctxt, int nargs);
75 void xforms_ifFunction(xmlXPathParserContextPtr ctxt, int nargs);
76 
77 // Number Functions
78 void xforms_avgFunction(xmlXPathParserContextPtr ctxt, int nargs);
79 void xforms_minFunction(xmlXPathParserContextPtr ctxt, int nargs);
80 void xforms_maxFunction(xmlXPathParserContextPtr ctxt, int nargs);
81 void xforms_countNonEmptyFunction(xmlXPathParserContextPtr ctxt, int nargs);
82 void xforms_indexFunction(xmlXPathParserContextPtr ctxt, int nargs);
83 
84 // String Functions
85 void xforms_propertyFunction(xmlXPathParserContextPtr ctxt, int nargs);
86 void xforms_versionFunction(xmlXPathParserContextPtr ctxt, int nargs);
87 
88 // Date and Time Functions
89 void xforms_nowFunction(xmlXPathParserContextPtr ctxt, int nargs);
90 void xforms_daysFromDateFunction(xmlXPathParserContextPtr ctxt, int nargs);
91 void xforms_secondsFromDateTimeFunction(xmlXPathParserContextPtr ctxt, int nargs);
92 void xforms_secondsFuction(xmlXPathParserContextPtr ctxt, int nargs);
93 void xforms_monthsFuction(xmlXPathParserContextPtr ctxt, int nargs);
94 
95 // Node-set Functions
96 void xforms_instanceFuction(xmlXPathParserContextPtr ctxt, int nargs);
97 
98 // Node-set Functions; XForms 1.1
99 void xforms_currentFunction(xmlXPathParserContextPtr ctxt, int nargs);
100 
101 // --- lookup ---
102 xmlXPathFunction xforms_lookupFunc(void *ctxt, const xmlChar *name, const xmlChar *ns_uri);
103 
104 }
105