codegen: Replace get_unref_expression_ with destroy_variable
[vala-lang.git] / vapi / rasqal.vapi
blobe9f78068bad86ceaafd25f3030fac80a3642165c
1 /* rasqal.vapi
2  *
3  * Copyright (C) 2008  Nokia
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  * Lesser General Public License for more details.
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
18  *
19  * Author:
20  *      Jürg Billeter <j@bitron.ch>
21  */
23 [CCode (cheader_filename = "rasqal.h")]
24 namespace Rasqal {
25         public void init ();
26         public void finish ();
28         [Compact]
29         [CCode (cname = "rasqal_graph_pattern")]
30         public class GraphPattern {
31                 public enum Operator {
32                         BASIC,
33                         OPTIONAL,
34                         UNION,
35                         GROUP,
36                         GRAPH
37                 }
39                 public Operator get_operator ();
40                 public unowned Triple get_triple (int idx);
41                 public void print (GLib.FileStream fh);
42         }
44         [CCode (cprefix = "RASQAL_EXPR_")]
45         public enum Op {
46                 AND,
47                 OR,
48                 LITERAL,
49                 ORDER_COND_ASC,
50                 ORDER_COND_DESC,
51                 GROUP_COND_ASC,
52                 GROUP_COND_DESC,
53                 COUNT,
54                 VARSTAR
55         }
57         [Compact]
58         [CCode (cname = "rasqal_expression", free_function = "rasqal_free_expression")]
59         public class Expression {
60                 public Op op;
61                 public Expression? arg1;
62                 public Expression? arg2;
63                 public Expression? arg3;
64                 public Literal? literal;
65         }
67         [Compact]
68         [CCode (cname = "rasqal_literal", free_function = "rasqal_free_literal")]
69         public class Literal {
70                 [CCode (cprefix = "RASQAL_LITERAL_")]
71                 public enum Type {
72                         BLANK,
73                         URI,
74                         STRING,
75                         BOOLEAN,
76                         INTEGER,
77                         DOUBLE,
78                         FLOAT,
79                         DECIMAL,
80                         DATETIME,
81                         PATTERN,
82                         QNAME,
83                         VARIABLE
84                 }
86                 public Type type;
88                 public unowned string? as_string ();
89                 public unowned Variable? as_variable ();
90         }
92         [Compact]
93         [CCode (cname = "rasqal_query", free_function = "rasqal_free_query")]
94         public class Query {
95                 [CCode (cname = "rasqal_new_query")]
96                 public Query (string? name, string? uri);
97                 public bool get_distinct ();
98                 public int get_limit ();
99                 public int get_offset ();
100                 public unowned Expression? get_group_condition (int idx);
101                 public unowned Expression? get_order_condition (int idx);
102                 public unowned GraphPattern get_query_graph_pattern ();
103                 public unowned Variable? get_variable (int idx);
104                 public int prepare (string? query_string, Raptor.Uri? base_uri);
105         }
107         [Compact]
108         [CCode (cname = "rasqal_triple", free_function = "rasqal_free_triple")]
109         public class Triple {
110                 public Literal subject;
111                 public Literal predicate;
112                 public Literal object;
113                 public Literal origin;
115                 public void print (GLib.FileStream fh);
116         }
118         [Compact]
119         [CCode (cname = "rasqal_variable", free_function = "rasqal_free_variable")]
120         public class Variable {
121                 public weak string? name;
122                 public Expression? expression;
123         }