2
* Copyright 2006-2008 Ondrej Jirman <ondrej.jirman@zonio.net>
4
* This file is part of libxr.
6
* Libxr is free software: you can redistribute it and/or modify it under the
7
* terms of the GNU Lesser General Public License as published by the Free
8
* Software Foundation, either version 2 of the License, or (at your option) any
11
* Libxr is distributed in the hope that it will be useful, but WITHOUT ANY
12
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
13
* A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
16
* You should have received a copy of the GNU Lesser General Public License
17
* along with libxr. If not, see <http://www.gnu.org/licenses/>.
20
#ifndef __XDL_MODEL_H__
21
#define __XDL_MODEL_H__
25
/** @file xdl model header
39
typedef struct _xdl_typedef xdl_typedef;
40
typedef struct _xdl_struct_member xdl_struct_member;
41
typedef struct _xdl_method_param xdl_method_param;
42
typedef struct _xdl_method xdl_method;
43
typedef struct _xdl_servlet xdl_servlet;
44
typedef struct _xdl_model xdl_model;
45
typedef struct _xdl_error_code xdl_error_code;
49
int type; /* typedef node type */
50
char* name; /* name of the type (for use in XDL) */
51
char* cname; /* name of the type (for use in XDL) */
52
char* ctype; /* C type name */
53
char* cnull; /* null value in C for this type */
54
xdl_servlet* servlet; /* servlet owning this type */
61
GSList* struct_members; /* struct memners list */
62
xdl_typedef* item_type; /* array item type */
66
struct _xdl_struct_member
74
struct _xdl_method_param
85
xdl_typedef* return_type;
97
GSList* types; /* servlet types */
98
GSList* methods; /* methods */
106
char* stub_post_call;
110
int stub_header_line;
114
int stub_pre_call_line;
115
int stub_post_call_line;
116
int stub_fallback_line;
117
int stub_download_line;
118
int stub_upload_line;
125
struct _xdl_error_code
128
char* cenum; /* C enum value */
140
GSList* types; /* global types */
143
xdl_servlet* cur_servlet;
146
xdl_model* xdl_new();
148
xdl_model* xdl_parse_string(const char* str, GError** err);
149
xdl_model* xdl_parse_file(const char* str, GError** err);
151
xdl_error_code* xdl_error_new(xdl_model *xdl, xdl_servlet *servlet, char* name, int code);
153
xdl_typedef* xdl_typedef_new_array(xdl_model *xdl, xdl_servlet *servlet, xdl_typedef* item);
154
xdl_typedef* xdl_typedef_new_struct(xdl_model *xdl, xdl_servlet *servlet, char* name);
156
gint xdl_method_compare(xdl_method* m1, xdl_method* m2);
158
xdl_typedef* xdl_typedef_find(xdl_model *xdl, xdl_servlet *servlet, const char* name);
159
char* xdl_typedef_vala_name(xdl_typedef* t);
160
char* xdl_typedef_xdl_name(xdl_typedef* t);
162
void xdl_process(xdl_model *ctx);