jabberd2
2.2.17
Main Page
Data Structures
Files
File List
Globals
util
xdata.h
Go to the documentation of this file.
1
/*
2
* jabberd - Jabber Open Source Server
3
* Copyright (c) 2002-2003 Jeremie Miller, Thomas Muldowney,
4
* Ryan Eatmon, Robert Norris
5
*
6
* This program is free software; you can redistribute it and/or modify
7
* it under the terms of the GNU General Public License as published by
8
* the Free Software Foundation; either version 2 of the License, or
9
* (at your option) any later version.
10
*
11
* This program is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the
14
* GNU General Public License for more details.
15
*
16
* You should have received a copy of the GNU General Public License
17
* along with this program; if not, write to the Free Software
18
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA02111-1307USA
19
*/
20
21
/* prototypes for xdata */
22
23
#ifndef INCL_XDATA_H
24
#define INCL_XDATA_H
25
26
#include "
util.h
"
27
28
typedef
struct
_xdata_st
*
xdata_t
;
29
typedef
struct
_xdata_field_st
*
xdata_field_t
;
30
typedef
struct
_xdata_option_st
*
xdata_option_t
;
31
typedef
struct
_xdata_item_st
*
xdata_item_t
;
32
33
typedef
enum
{
34
xd_type_NONE
,
35
xd_type_FORM
,
36
xd_type_RESULT
,
37
xd_type_SUBMIT
,
38
xd_type_CANCEL
39
}
xdata_type_t
;
40
41
struct
_xdata_st
{
42
pool_t
p
;
43
44
xdata_type_t
type
;
45
46
char
*
title
;
47
char
*
instructions
;
48
49
xdata_field_t
fields
,
flast
;
50
xdata_field_t
rfields
,
rflast
;
/* reported fields */
51
52
xdata_item_t
items
,
ilast
;
53
};
54
55
typedef
enum
{
56
xd_field_NONE
,
57
xd_field_BOOLEAN
,
58
xd_field_FIXED
,
59
xd_field_HIDDEN
,
60
xd_field_JID_MULTI
,
61
xd_field_JID_SINGLE
,
62
xd_field_LIST_MULTI
,
63
xd_field_LIST_SINGLE
,
64
xd_field_TEXT_MULTI
,
65
xd_field_TEXT_PRIVATE
,
66
xd_field_TEXT_SINGLE
67
}
xdata_field_type_t
;
68
69
struct
_xdata_field_st
{
70
pool_t
p
;
71
72
xdata_field_type_t
type
;
73
74
char
*
var
;
75
76
char
*
label
;
77
78
char
*
desc
;
79
80
int
required
;
81
82
char
**
values
;
83
int
nvalues
;
84
85
xdata_option_t
options
,
olast
;
86
87
xdata_field_t
next
;
88
};
89
90
struct
_xdata_option_st
{
91
pool_t
p
;
92
93
char
*
label
;
94
char
*
value
;
95
96
xdata_option_t
next
;
97
};
98
99
struct
_xdata_item_st
{
100
pool_t
p
;
101
102
xdata_field_t
fields
,
flast
;
103
104
xdata_item_t
next
;
105
};
106
108
JABBERD2_API
xdata_t
xdata_new
(
xdata_type_t
type,
char
*title,
char
*instructions);
109
JABBERD2_API
xdata_t
xdata_parse
(
nad_t
nad,
int
root);
110
112
JABBERD2_API
xdata_field_t
xdata_field_new
(xdata_t xd,
xdata_field_type_t
type,
char
*var,
char
*label,
char
*desc,
int
required);
113
115
JABBERD2_API
xdata_item_t
xdata_item_new
(xdata_t xd);
116
118
JABBERD2_API
void
xdata_add_field
(xdata_t xd, xdata_field_t xdf);
119
JABBERD2_API
void
xdata_add_rfield
(xdata_t xd, xdata_field_t xdf);
120
JABBERD2_API
void
xdata_add_field_item
(xdata_item_t item, xdata_field_t xdf);
121
123
JABBERD2_API
void
xdata_add_item
(xdata_t xd, xdata_item_t xdi);
124
126
JABBERD2_API
void
xdata_add_option
(xdata_field_t xdf,
char
*value,
int
lvalue,
char
*label,
int
llabel);
127
129
JABBERD2_API
void
xdata_add_value
(xdata_field_t xdf,
char
*value,
int
vlen);
130
131
#endif
Generated by
1.8.1.1