dict_entry
[container]

Collaboration diagram for dict_entry:

Detailed Description

Module for manage EasyDbus Dict Entry.

Functions for manage easydbus dict entry containers

For easydbus developers:
If a container is used for dict_entry data, then:

Dict_Entry Meta Information

Contact:
Daniele Rondina aka Ge@@ru <geaaru@gmail.com>
Status:
EasyDbus Core Library
License:
GPL
Contributor(s):


Functions

int easydbus_dict_entry_add_boolean (EasyDbus_container *container, char boolean)
 Add byte on dict entry container.
int easydbus_dict_entry_add_byte (EasyDbus_container *container, char byte)
 Add byte to dict entry container.
int easydbus_dict_entry_add_double (EasyDbus_container *container, double d)
 Add double to dict entry container.
int easydbus_dict_entry_add_i16 (struct EasyDbus_container *container, short i16)
 Add int16 to dict entry container.
int easydbus_dict_entry_add_i32 (EasyDbus_container *container, int i32)
 Add int32 to dict entry container.
int easydbus_dict_entry_add_i64 (EasyDbus_container *container, long long i64)
 Add int64 to dict entry container.
int easydbus_dict_entry_add_obj_path (EasyDbus_container *container, char *string)
 Add object path string to dict entry container.
int easydbus_dict_entry_add_signature (EasyDbus_container *container, char *string)
 Add signature to dict entry container.
int easydbus_dict_entry_add_string (EasyDbus_container *container, char *string)
 Add string to dict entry container.
int easydbus_dict_entry_add_ui16 (EasyDbus_container *container, unsigned short ui16)
 Add unsigned int16 to dict entry container.
int easydbus_dict_entry_add_ui32 (EasyDbus_container *container, unsigned int ui32)
 Add unsigned int32 to dict entry container.
int easydbus_dict_entry_add_ui64 (EasyDbus_container *container, unsigned long long ui64)
 Add unsigned int64 to dict entry container.
int easydbus_dict_entry_add_variant (EasyDbus_container *dict_entry, EasyDbus_container *variant)
 Add a variant container on a dict_entry.
const EasyDbus_elemeasydbus_dict_entry_get_first_element (EasyDbus_container *dict_entry)
 Get string from dict_entry container.
const EasyDbus_elemeasydbus_dict_entry_get_second_element (EasyDbus_container *dict_entry)
 Get string from dict_entry container.


Function Documentation

int easydbus_dict_entry_add_boolean ( EasyDbus_container container,
char  boolean 
)

Add byte on dict entry container.

If dict entry container is empty then element is inserted as first element of dict entry, else element is inserted as second element of dict entry.

Parameters:
container pointer to dict entry container
boolean boolean value to insert on dict entry.
Returns:
-1 error

0 ok

Definition at line 288 of file dict_entry.c.

References EasyDbus_elem::boolean, EasyDbus_container::container_type, easydbus_elem_create(), EASYDBUS_ELTYPE_BOOLEAN, EASYDBUS_ELTYPE_DICT_ENTRY, EASYDBUS_ELTYPE_INVALID, EasyDbus_container::elem_type, EasyDbus_container::nel, EasyDbus_elem::next, EasyDbus_container::p_data, and EasyDbus_elem::payload.

Referenced by easydbus_dict_entry_build_container().

00290 {
00291    struct EasyDbus_elem *el = NULL;
00292    struct EasyDbus_elem *el2 = NULL;
00293 
00294    if (container == NULL)
00295       return -1;
00296 
00297    if (container->container_type != EASYDBUS_ELTYPE_DICT_ENTRY)
00298       return -1;
00299 
00300    if (container->nel > 1)
00301       return -1;
00302 
00303    el = easydbus_elem_create (EASYDBUS_ELTYPE_BOOLEAN);
00304    if (el == NULL)
00305       return -1;
00306 
00307    el->payload.boolean = boolean;
00308 
00309    if (container->nel) {
00310       el2 = (struct EasyDbus_elem *) container->p_data;
00311       el2->next = el;
00312    }
00313    else {
00314       container->p_data = el;
00315    }
00316    container->nel++;
00317    container->elem_type = EASYDBUS_ELTYPE_INVALID;
00318    return 0;
00319 }

Here is the call graph for this function:

int easydbus_dict_entry_add_byte ( EasyDbus_container container,
char  byte 
)

Add byte to dict entry container.

If dict entry container is empty then element is inserted as first element of dict entry, else element is inserted as second element of dict entry.

Parameters:
container pointer to dict entry container
byte byte value to insert on dict entry.
Returns:
-1 error

0 ok

Definition at line 242 of file dict_entry.c.

References EasyDbus_elem::byte, EasyDbus_container::container_type, easydbus_elem_create(), EASYDBUS_ELTYPE_BYTE, EASYDBUS_ELTYPE_DICT_ENTRY, EASYDBUS_ELTYPE_INVALID, EasyDbus_container::elem_type, EasyDbus_container::nel, EasyDbus_elem::next, EasyDbus_container::p_data, and EasyDbus_elem::payload.

Referenced by easydbus_dict_entry_build_container().

00244 {
00245    struct EasyDbus_elem *el = NULL;
00246    struct EasyDbus_elem *el2 = NULL;
00247 
00248    if (container == NULL)
00249       return -1;
00250 
00251    if (container->container_type != EASYDBUS_ELTYPE_DICT_ENTRY)
00252       return -1;
00253 
00254    if (container->nel > 1)
00255       return -1;
00256 
00257    el = easydbus_elem_create (EASYDBUS_ELTYPE_BYTE);
00258    if (el == NULL)
00259       return -1;
00260 
00261    el->payload.byte = byte;
00262 
00263    if (container->nel) {
00264       el2 = (struct EasyDbus_elem *) container->p_data;
00265       el2->next = el;
00266    }
00267    else {
00268       container->p_data = el;
00269    }
00270    container->nel++;
00271    container->elem_type = EASYDBUS_ELTYPE_INVALID;
00272    return 0;
00273 }

Here is the call graph for this function:

int easydbus_dict_entry_add_double ( EasyDbus_container container,
double  d 
)

Add double to dict entry container.

If dict entry container is empty then element is inserted as first element of dict entry, else element is inserted as second element of dict entry.

Parameters:
container pointer to dict entry container
d double value to insert on dict entry.
Returns:
-1 error

0 ok

Definition at line 383 of file dict_entry.c.

References EasyDbus_container::container_type, EasyDbus_elem::Double, easydbus_elem_create(), EASYDBUS_ELTYPE_DICT_ENTRY, EASYDBUS_ELTYPE_DOUBLE, EASYDBUS_ELTYPE_INVALID, EasyDbus_container::elem_type, EasyDbus_container::nel, EasyDbus_elem::next, EasyDbus_container::p_data, and EasyDbus_elem::payload.

Referenced by easydbus_dict_entry_build_container().

00385 {
00386    struct EasyDbus_elem *el = NULL;
00387    struct EasyDbus_elem *el2 = NULL;
00388 
00389    if (container == NULL)
00390       return -1;
00391 
00392    if (container->container_type != EASYDBUS_ELTYPE_DICT_ENTRY)
00393       return -1;
00394 
00395    if (container->nel > 1)
00396       return -1;
00397 
00398    el = easydbus_elem_create (EASYDBUS_ELTYPE_DOUBLE);
00399    if (el == NULL)
00400       return -1;
00401 
00402    el->payload.Double = d;
00403 
00404    if (container->nel) {
00405       el2 = (struct EasyDbus_elem *) container->p_data;
00406       el2->next = el;
00407    }
00408    else {
00409       container->p_data = el;
00410    }
00411    container->nel++;
00412    container->elem_type = EASYDBUS_ELTYPE_INVALID;
00413    return 0;
00414 }

Here is the call graph for this function:

int easydbus_dict_entry_add_i16 ( struct EasyDbus_container container,
short  i16 
)

Add int16 to dict entry container.

If dict entry container is empty then element is inserted as first element of dict entry, else element is inserted as second element of dict entry.

Parameters:
container pointer to dict entry container
i16 int16 value to insert on dict entry.
Returns:
-1 error

0 ok

Definition at line 476 of file dict_entry.c.

References EasyDbus_container::container_type, easydbus_elem_create(), EASYDBUS_ELTYPE_DICT_ENTRY, EASYDBUS_ELTYPE_INT16, EASYDBUS_ELTYPE_INVALID, EasyDbus_container::elem_type, EasyDbus_elem::i16, EasyDbus_container::nel, EasyDbus_elem::next, EasyDbus_container::p_data, and EasyDbus_elem::payload.

Referenced by easydbus_dict_entry_build_container().

00478 {
00479    struct EasyDbus_elem *el = NULL;
00480    struct EasyDbus_elem *el2 = NULL;
00481 
00482    if (container == NULL)
00483       return -1;
00484 
00485    if (container->container_type != EASYDBUS_ELTYPE_DICT_ENTRY)
00486       return -1;
00487 
00488    if (container->nel > 1)
00489       return -1;
00490 
00491    el = easydbus_elem_create (EASYDBUS_ELTYPE_INT16);
00492    if (el == NULL)
00493       return -1;
00494 
00495    el->payload.i16 = i16;
00496 
00497    if (container->nel) {
00498       el2 = (struct EasyDbus_elem *) container->p_data;
00499       el2->next = el;
00500    }
00501    else {
00502       container->p_data = el;
00503    }
00504    container->nel++;
00505    container->elem_type = EASYDBUS_ELTYPE_INVALID;
00506    return 0;
00507 }

Here is the call graph for this function:

int easydbus_dict_entry_add_i32 ( EasyDbus_container container,
int  i32 
)

Add int32 to dict entry container.

If dict entry container is empty then element is inserted as first element of dict entry, else element is inserted as second element of dict entry.

Parameters:
container pointer to dict entry container
i32 int32 value to insert on dict entry.
Returns:
-1 error

0 ok

Definition at line 522 of file dict_entry.c.

References EasyDbus_container::container_type, easydbus_elem_create(), EASYDBUS_ELTYPE_DICT_ENTRY, EASYDBUS_ELTYPE_INT32, EASYDBUS_ELTYPE_INVALID, EasyDbus_container::elem_type, EasyDbus_elem::i32, EasyDbus_container::nel, EasyDbus_elem::next, EasyDbus_container::p_data, and EasyDbus_elem::payload.

Referenced by easydbus_dict_entry_build_container().

00524 {
00525    struct EasyDbus_elem *el = NULL;
00526    struct EasyDbus_elem *el2 = NULL;
00527 
00528    if (container == NULL)
00529       return -1;
00530 
00531    if (container->container_type != EASYDBUS_ELTYPE_DICT_ENTRY)
00532       return -1;
00533 
00534    if (container->nel > 1)
00535       return -1;
00536 
00537    el = easydbus_elem_create (EASYDBUS_ELTYPE_INT32);
00538    if (el == NULL)
00539       return -1;
00540 
00541    el->payload.i32 = i32;
00542 
00543    if (container->nel) {
00544       el2 = (struct EasyDbus_elem *) container->p_data;
00545       el2->next = el;
00546    }
00547    else {
00548       container->p_data = el;
00549    }
00550    container->nel++;
00551    container->elem_type = EASYDBUS_ELTYPE_INVALID;
00552    return 0;
00553 }

Here is the call graph for this function:

int easydbus_dict_entry_add_i64 ( EasyDbus_container container,
long long  i64 
)

Add int64 to dict entry container.

If dict entry container is empty then element is inserted as first element of dict entry, else element is inserted as second element of dict entry.

Parameters:
container pointer to dict entry container
i64 int64 value to insert on dict entry.
Returns:
-1 error

0 ok

Definition at line 613 of file dict_entry.c.

References EasyDbus_container::container_type, easydbus_elem_create(), EASYDBUS_ELTYPE_DICT_ENTRY, EASYDBUS_ELTYPE_INT64, EASYDBUS_ELTYPE_INVALID, EasyDbus_container::elem_type, EasyDbus_elem::i64, EasyDbus_container::nel, EasyDbus_elem::next, EasyDbus_container::p_data, and EasyDbus_elem::payload.

Referenced by easydbus_dict_entry_build_container().

00615 {
00616    struct EasyDbus_elem *el = NULL;
00617    struct EasyDbus_elem *el2 = NULL;
00618 
00619    if (container == NULL)
00620       return -1;
00621 
00622    if (container->container_type != EASYDBUS_ELTYPE_DICT_ENTRY)
00623       return -1;
00624 
00625    if (container->nel > 1)
00626       return -1;
00627 
00628    el = easydbus_elem_create (EASYDBUS_ELTYPE_INT64);
00629    if (el == NULL)
00630       return -1;
00631 
00632    el->payload.i64 = i64;
00633 
00634    if (container->nel) {
00635       el2 = (struct EasyDbus_elem *) container->p_data;
00636       el2->next = el;
00637    }
00638    else {
00639       container->p_data = el;
00640    }
00641    container->nel++;
00642    container->elem_type = EASYDBUS_ELTYPE_INVALID;
00643    return 0;
00644 }

Here is the call graph for this function:

int easydbus_dict_entry_add_obj_path ( EasyDbus_container container,
char *  string 
)

Add object path string to dict entry container.

If dict entry container is empty then element is inserted as first element of dict entry, else element is inserted as second element of dict entry.

Parameters:
container pointer to dict entry container
string pointer to signature string that must be insert.
Returns:
-1 error

0 ok

Definition at line 64 of file dict_entry.c.

References EasyDbus_container::container_type, easydbus_elem_create(), easydbus_elem_free(), EASYDBUS_ELTYPE_DICT_ENTRY, EASYDBUS_ELTYPE_INVALID, EASYDBUS_ELTYPE_OBJECT_PATH, EASYDBUS_MEMCOPY, EasyDbus_container::elem_type, EasyDbus_container::nel, EasyDbus_elem::next, EasyDbus_container::p_data, EasyDbus_elem::payload, and EasyDbus_elem::string.

Referenced by easydbus_dict_entry_build_container().

00066 {
00067    int string_length = 0;
00068    char *p_string = NULL;
00069    struct EasyDbus_elem *el = NULL;
00070    struct EasyDbus_elem *el2 = NULL;
00071 
00072    if (container == NULL || string == NULL)
00073       return -1;
00074 
00075    if (container->container_type != EASYDBUS_ELTYPE_DICT_ENTRY)
00076       return -1;
00077 
00078    if (container->nel > 1)
00079       return -1;
00080 
00081    el = easydbus_elem_create (EASYDBUS_ELTYPE_OBJECT_PATH);
00082    if (el == NULL)
00083       return -1;
00084 
00085    string_length = strlen (string) + 1;
00086    p_string = malloc (string_length);
00087    if (p_string == NULL)
00088       goto error;
00089 
00090    EASYDBUS_MEMCOPY (p_string, string, string_length);
00091 
00092    el->payload.string = p_string;
00093 
00094    if (container->nel) {
00095       el2 = (struct EasyDbus_elem *) container->p_data;
00096       el2->next = el;
00097    }
00098    else {
00099       container->p_data = el;
00100    }
00101    container->nel++;
00102    container->elem_type = EASYDBUS_ELTYPE_INVALID;
00103    return 0;
00104 
00105  error:
00106    easydbus_elem_free (el);
00107    return -1;
00108 }

Here is the call graph for this function:

int easydbus_dict_entry_add_signature ( EasyDbus_container container,
char *  string 
)

Add signature to dict entry container.

If dict entry container is empty then element is inserted as first element of dict entry, else element is inserted as second element of dict entry.

Parameters:
container pointer to dict entry container
string pointer to signature string that must be insert.
Returns:
-1 error

0 ok

Definition at line 183 of file dict_entry.c.

References EasyDbus_container::container_type, easydbus_elem_create(), easydbus_elem_free(), EASYDBUS_ELTYPE_DICT_ENTRY, EASYDBUS_ELTYPE_INVALID, EASYDBUS_ELTYPE_SIGNATURE, EASYDBUS_MEMCOPY, EasyDbus_container::elem_type, EasyDbus_container::nel, EasyDbus_elem::next, EasyDbus_container::p_data, EasyDbus_elem::payload, and EasyDbus_elem::string.

Referenced by easydbus_dict_entry_build_container().

00185 {
00186    int string_length = 0;
00187    char *p_string = NULL;
00188    struct EasyDbus_elem *el = NULL;
00189    struct EasyDbus_elem *el2 = NULL;
00190 
00191    if (container == NULL || string == NULL)
00192       return -1;
00193 
00194    if (container->container_type != EASYDBUS_ELTYPE_DICT_ENTRY)
00195       return -1;
00196 
00197    if (container->nel > 1)
00198       return -1;
00199 
00200    el = easydbus_elem_create (EASYDBUS_ELTYPE_SIGNATURE);
00201    if (el == NULL)
00202       return -1;
00203 
00204    string_length = strlen (string) + 1;
00205    p_string = malloc (string_length);
00206    if (p_string == NULL)
00207       goto error;
00208 
00209    EASYDBUS_MEMCOPY (p_string, string, string_length);
00210 
00211    el->payload.string = p_string;
00212 
00213    if (container->nel) {
00214       el2 = (struct EasyDbus_elem *) container->p_data;
00215       el2->next = el;
00216    }
00217    else {
00218       container->p_data = el;
00219    }
00220    container->nel++;
00221    container->elem_type = EASYDBUS_ELTYPE_INVALID;
00222    return 0;
00223 
00224  error:
00225    easydbus_elem_free (el);
00226    return -1;
00227 }

Here is the call graph for this function:

int easydbus_dict_entry_add_string ( EasyDbus_container container,
char *  string 
)

Add string to dict entry container.

If dict entry container is empty then element is inserted as first element of dict entry, else element is inserted as second element of dict entry.

Parameters:
container pointer to dict entry container
string pointer to string that must be insert.
Returns:
-1 error

0 ok

Definition at line 123 of file dict_entry.c.

References EasyDbus_container::container_type, easydbus_elem_create(), easydbus_elem_free(), EASYDBUS_ELTYPE_DICT_ENTRY, EASYDBUS_ELTYPE_INVALID, EASYDBUS_ELTYPE_STRING, EASYDBUS_MEMCOPY, EasyDbus_container::elem_type, EasyDbus_container::nel, EasyDbus_elem::next, EasyDbus_container::p_data, EasyDbus_elem::payload, and EasyDbus_elem::string.

Referenced by easydbus_dict_entry_build_container().

00125 {
00126    int string_length = 0;
00127    char *p_string = NULL;
00128    struct EasyDbus_elem *el = NULL;
00129    struct EasyDbus_elem *el2 = NULL;
00130 
00131    if (container == NULL || string == NULL)
00132       return -1;
00133 
00134    if (container->container_type != EASYDBUS_ELTYPE_DICT_ENTRY)
00135       return -1;
00136 
00137    if (container->nel > 1)
00138       return -1;
00139 
00140    el = easydbus_elem_create (EASYDBUS_ELTYPE_STRING);
00141    if (el == NULL)
00142       return -1;
00143 
00144    string_length = strlen (string) + 1;
00145    p_string = malloc (string_length);
00146    if (p_string == NULL)
00147       goto error;
00148 
00149    EASYDBUS_MEMCOPY (p_string, string, string_length);
00150 
00151    el->payload.string = p_string;
00152 
00153    if (container->nel) {
00154       el2 = (struct EasyDbus_elem *) container->p_data;
00155       el2->next = el;
00156    }
00157    else {
00158       container->p_data = el;
00159    }
00160    container->nel++;
00161    container->elem_type = EASYDBUS_ELTYPE_INVALID;
00162    return 0;
00163 
00164  error:
00165    easydbus_elem_free (el);
00166    return -1;
00167 }

Here is the call graph for this function:

int easydbus_dict_entry_add_ui16 ( EasyDbus_container container,
unsigned short  ui16 
)

Add unsigned int16 to dict entry container.

If dict entry container is empty then element is inserted as first element of dict entry, else element is inserted as second element of dict entry.

Parameters:
container pointer to dict entry container
ui16 unsigned int16 value to insert on dict entry.
Returns:
-1 error

0 ok

Definition at line 568 of file dict_entry.c.

References EasyDbus_container::container_type, easydbus_elem_create(), EASYDBUS_ELTYPE_DICT_ENTRY, EASYDBUS_ELTYPE_INVALID, EASYDBUS_ELTYPE_UINT16, EasyDbus_container::elem_type, EasyDbus_container::nel, EasyDbus_elem::next, EasyDbus_container::p_data, EasyDbus_elem::payload, and EasyDbus_elem::ui16.

Referenced by easydbus_dict_entry_build_container().

00570 {
00571    struct EasyDbus_elem *el = NULL;
00572    struct EasyDbus_elem *el2 = NULL;
00573 
00574    if (container == NULL)
00575       return -1;
00576 
00577    if (container->container_type != EASYDBUS_ELTYPE_DICT_ENTRY)
00578       return -1;
00579 
00580    if (container->nel > 1)
00581       return -1;
00582 
00583    el = easydbus_elem_create (EASYDBUS_ELTYPE_UINT16);
00584    if (el == NULL)
00585       return -1;
00586 
00587    el->payload.ui16 = ui16;
00588 
00589    if (container->nel) {
00590       el2 = (struct EasyDbus_elem *) container->p_data;
00591       el2->next = el;
00592    }
00593    else {
00594       container->p_data = el;
00595    }
00596    container->nel++;
00597    container->elem_type = EASYDBUS_ELTYPE_INVALID;
00598    return 0;
00599 }

Here is the call graph for this function:

int easydbus_dict_entry_add_ui32 ( EasyDbus_container container,
unsigned int  ui32 
)

Add unsigned int32 to dict entry container.

If dict entry container is empty then element is inserted as first element of dict entry, else element is inserted as second element of dict entry.

Parameters:
container pointer to dict entry container
ui32 unsigned int32 value to insert on dict entry.
Returns:
-1 error

0 ok

Definition at line 430 of file dict_entry.c.

References EasyDbus_container::container_type, easydbus_elem_create(), EASYDBUS_ELTYPE_DICT_ENTRY, EASYDBUS_ELTYPE_INVALID, EASYDBUS_ELTYPE_UINT32, EasyDbus_container::elem_type, EasyDbus_container::nel, EasyDbus_elem::next, EasyDbus_container::p_data, EasyDbus_elem::payload, and EasyDbus_elem::ui32.

Referenced by easydbus_dict_entry_build_container().

00432 {
00433    struct EasyDbus_elem *el = NULL;
00434    struct EasyDbus_elem *el2 = NULL;
00435 
00436    if (container == NULL)
00437       return -1;
00438 
00439    if (container->container_type != EASYDBUS_ELTYPE_DICT_ENTRY)
00440       return -1;
00441 
00442    if (container->nel > 1)
00443       return -1;
00444 
00445    el = easydbus_elem_create (EASYDBUS_ELTYPE_UINT32);
00446    if (el == NULL)
00447       return -1;
00448 
00449    el->payload.ui32 = ui32;
00450 
00451    if (container->nel) {
00452       el2 = (struct EasyDbus_elem *) container->p_data;
00453       el2->next = el;
00454    }
00455    else {
00456       container->p_data = el;
00457    }
00458    container->nel++;
00459    container->elem_type = EASYDBUS_ELTYPE_INVALID;
00460    return 0;
00461 }

Here is the call graph for this function:

int easydbus_dict_entry_add_ui64 ( EasyDbus_container container,
unsigned long long  ui64 
)

Add unsigned int64 to dict entry container.

If dict entry container is empty then element is inserted as first element of dict entry, else element is inserted as second element of dict entry.

Parameters:
container pointer to dict entry container
ui64 unsigned int64 value to insert on dict entry.
Returns:
-1 error

0 ok

Definition at line 658 of file dict_entry.c.

References EasyDbus_container::container_type, easydbus_elem_create(), EASYDBUS_ELTYPE_DICT_ENTRY, EASYDBUS_ELTYPE_INVALID, EASYDBUS_ELTYPE_UINT64, EasyDbus_container::elem_type, EasyDbus_container::nel, EasyDbus_elem::next, EasyDbus_container::p_data, EasyDbus_elem::payload, and EasyDbus_elem::ui64.

Referenced by easydbus_dict_entry_build_container().

00660 {
00661    struct EasyDbus_elem *el = NULL;
00662    struct EasyDbus_elem *el2 = NULL;
00663 
00664    if (container == NULL)
00665       return -1;
00666 
00667    if (container->container_type != EASYDBUS_ELTYPE_DICT_ENTRY)
00668       return -1;
00669 
00670    if (container->nel > 1)
00671       return -1;
00672 
00673    el = easydbus_elem_create (EASYDBUS_ELTYPE_UINT64);
00674    if (el == NULL)
00675       return -1;
00676 
00677    el->payload.ui64 = ui64;
00678 
00679    if (container->nel) {
00680       el2 = (struct EasyDbus_elem *) container->p_data;
00681       el2->next = el;
00682    }
00683    else {
00684       container->p_data = el;
00685    }
00686    container->nel++;
00687    container->elem_type = EASYDBUS_ELTYPE_INVALID;
00688    return 0;
00689 }

Here is the call graph for this function:

int easydbus_dict_entry_add_variant ( EasyDbus_container dict_entry,
EasyDbus_container variant 
)

Add a variant container on a dict_entry.

If dict entry container is empty then element is inserted as first element of dict entry, else element is inserted as second element of dict entry.

Parameters:
dict_entry pointer to dict entry container where insert variant element.
variant pointer to variant container that must be insert to dict entry.
Returns:
-1 error

0 ok

Definition at line 337 of file dict_entry.c.

References EasyDbus_container::container_type, easydbus_elem_create(), EASYDBUS_ELTYPE_DICT_ENTRY, EASYDBUS_ELTYPE_INVALID, EASYDBUS_ELTYPE_VARIANT, EasyDbus_container::elem_type, EasyDbus_container::nel, EasyDbus_elem::next, EasyDbus_elem::p_container, EasyDbus_container::p_data, and EasyDbus_elem::payload.

Referenced by easydbus_dict_entry_build_container().

00339 {
00340    struct EasyDbus_elem *el = NULL;
00341    struct EasyDbus_elem *el2 = NULL;
00342 
00343    if (dict_entry == NULL || variant == NULL)
00344       return -1;
00345 
00346    if (dict_entry->container_type != EASYDBUS_ELTYPE_DICT_ENTRY)
00347       return -1;
00348 
00349    if (dict_entry->nel > 1)
00350       return -1;
00351 
00352    el = easydbus_elem_create (EASYDBUS_ELTYPE_VARIANT);
00353    if (el == NULL)
00354       return -1;
00355 
00356    el->payload.p_container = variant;
00357 
00358    if (dict_entry->nel) {
00359       el2 = (struct EasyDbus_elem *) dict_entry->p_data;
00360       el2->next = el;
00361    }
00362    else {
00363       dict_entry->p_data = el;
00364       dict_entry->elem_type = EASYDBUS_ELTYPE_INVALID;
00365    }
00366    dict_entry->nel++;
00367    return 0;
00368 }

Here is the call graph for this function:

const EasyDbus_elem* easydbus_dict_entry_get_first_element ( EasyDbus_container dict_entry  ) 

Get string from dict_entry container.

Parameters:
dict_entry EasyDbus_container object pointer
Returns:
NULL on error

EasyDbus_elem object pointer to first element of the dict_entry container.

Definition at line 699 of file dict_entry.c.

References EasyDbus_container::container_type, EASYDBUS_ELTYPE_DICT_ENTRY, EasyDbus_container::nel, and EasyDbus_container::p_data.

00700 {
00701    if (dict_entry == NULL ||
00702        dict_entry->container_type != EASYDBUS_ELTYPE_DICT_ENTRY ||
00703        dict_entry->nel == 0)
00704       return NULL;
00705 
00706    return (const EasyDbus_elem *) dict_entry->p_data;
00707 }

const EasyDbus_elem* easydbus_dict_entry_get_second_element ( EasyDbus_container dict_entry  ) 

Get string from dict_entry container.

Parameters:
dict_entry EasyDbus_container object pointer
Returns:
NULL on error

EasyDbus_elem object pointer to second element of the dict_entry container.

Definition at line 717 of file dict_entry.c.

References EasyDbus_container::container_type, EASYDBUS_ELTYPE_DICT_ENTRY, EasyDbus_container::nel, and EasyDbus_container::p_data.

00718 {
00719    if (dict_entry == NULL ||
00720        dict_entry->container_type != EASYDBUS_ELTYPE_DICT_ENTRY ||
00721        dict_entry->nel < 2)
00722       return NULL;
00723 
00724    return (const EasyDbus_elem *)
00725       (((const EasyDbus_elem *) dict_entry->p_data)->next);
00726 }


Generated on Thu Apr 10 10:01:15 2008 for EasyDbus-0.2 by  doxygen 1.5.4