jabberd2  2.3.4
Data Structures | Typedefs | Enumerations | Functions
xdata.h File Reference
#include "util.h"

Go to the source code of this file.

Data Structures

struct  _xdata_st
 
struct  _xdata_field_st
 
struct  _xdata_option_st
 
struct  _xdata_item_st
 

Typedefs

typedef struct _xdata_stxdata_t
 
typedef struct _xdata_field_stxdata_field_t
 
typedef struct _xdata_option_stxdata_option_t
 
typedef struct _xdata_item_stxdata_item_t
 

Enumerations

enum  xdata_type_t {
  xd_type_NONE, xd_type_FORM, xd_type_RESULT, xd_type_SUBMIT,
  xd_type_CANCEL
}
 
enum  xdata_field_type_t {
  xd_field_NONE, xd_field_BOOLEAN, xd_field_FIXED, xd_field_HIDDEN,
  xd_field_JID_MULTI, xd_field_JID_SINGLE, xd_field_LIST_MULTI, xd_field_LIST_SINGLE,
  xd_field_TEXT_MULTI, xd_field_TEXT_PRIVATE, xd_field_TEXT_SINGLE
}
 

Functions

JABBERD2_API xdata_t xdata_new (xdata_type_t type, const char *title, const char *instructions)
 creation More...
 
JABBERD2_API xdata_t xdata_parse (nad_t nad, int root)
 parse a nad and build More...
 
JABBERD2_API xdata_field_t xdata_field_new (xdata_t xd, xdata_field_type_t type, const char *var, const char *label, const char *desc, int required)
 new field More...
 
JABBERD2_API xdata_item_t xdata_item_new (xdata_t xd)
 new item More...
 
JABBERD2_API void xdata_add_field (xdata_t xd, xdata_field_t xdf)
 field insertion More...
 
JABBERD2_API void xdata_add_rfield (xdata_t xd, xdata_field_t xdf)
 
JABBERD2_API void xdata_add_field_item (xdata_item_t item, xdata_field_t xdf)
 
JABBERD2_API void xdata_add_item (xdata_t xd, xdata_item_t xdi)
 item insertion More...
 
JABBERD2_API void xdata_add_option (xdata_field_t xdf, const char *value, int lvalue, const char *label, int llabel)
 option insertion More...
 
JABBERD2_API void xdata_add_value (xdata_field_t xdf, const char *value, int vlen)
 value insertion More...
 

Typedef Documentation

typedef struct _xdata_st* xdata_t

Definition at line 28 of file xdata.h.

typedef struct _xdata_field_st* xdata_field_t

Definition at line 29 of file xdata.h.

Definition at line 30 of file xdata.h.

typedef struct _xdata_item_st* xdata_item_t

Definition at line 31 of file xdata.h.

Enumeration Type Documentation

Enumerator
xd_type_NONE 
xd_type_FORM 
xd_type_RESULT 
xd_type_SUBMIT 
xd_type_CANCEL 

Definition at line 33 of file xdata.h.

Enumerator
xd_field_NONE 
xd_field_BOOLEAN 
xd_field_FIXED 
xd_field_HIDDEN 
xd_field_JID_MULTI 
xd_field_JID_SINGLE 
xd_field_LIST_MULTI 
xd_field_LIST_SINGLE 
xd_field_TEXT_MULTI 
xd_field_TEXT_PRIVATE 
xd_field_TEXT_SINGLE 

Definition at line 55 of file xdata.h.

Function Documentation

JABBERD2_API xdata_t xdata_new ( xdata_type_t  type,
const char *  title,
const char *  instructions 
)

creation

Definition at line 26 of file xdata.c.

References _xdata_st::instructions, log_debug, _xdata_st::p, pmalloco(), pool_new, pstrdup(), _xdata_st::title, _xdata_st::type, and ZONE.

Referenced by xdata_parse().

JABBERD2_API xdata_t xdata_parse ( nad_t  nad,
int  root 
)
JABBERD2_API xdata_field_t xdata_field_new ( xdata_t  xd,
xdata_field_type_t  type,
const char *  var,
const char *  label,
const char *  desc,
int  required 
)
JABBERD2_API xdata_item_t xdata_item_new ( xdata_t  xd)

new item

Definition at line 73 of file xdata.c.

References _xdata_st::p, _xdata_item_st::p, and pmalloco().

JABBERD2_API void xdata_add_field ( xdata_t  xd,
xdata_field_t  xdf 
)

field insertion

Definition at line 86 of file xdata.c.

References _xdata_st::fields, _xdata_st::flast, and _xdata_field_st::next.

Referenced by xdata_parse().

JABBERD2_API void xdata_add_rfield ( xdata_t  xd,
xdata_field_t  xdf 
)

Definition at line 98 of file xdata.c.

References _xdata_field_st::next, _xdata_st::rfields, and _xdata_st::rflast.

JABBERD2_API void xdata_add_field_item ( xdata_item_t  item,
xdata_field_t  xdf 
)

Definition at line 110 of file xdata.c.

References _xdata_item_st::fields, _xdata_item_st::flast, and _xdata_field_st::next.

JABBERD2_API void xdata_add_item ( xdata_t  xd,
xdata_item_t  xdi 
)

item insertion

Definition at line 123 of file xdata.c.

References _xdata_st::ilast, _xdata_st::items, and _xdata_item_st::next.

JABBERD2_API void xdata_add_option ( xdata_field_t  xdf,
const char *  value,
int  lvalue,
const char *  label,
int  llabel 
)

option insertion

JABBERD2_API void xdata_add_value ( xdata_field_t  xdf,
const char *  value,
int  vlen 
)

value insertion

Definition at line 160 of file xdata.c.

References _xdata_field_st::nvalues, _xdata_field_st::p, pool_cleanup(), pstrdupx(), and _xdata_field_st::values.

Referenced by _xdata_field_parse().