array_internal.h File Reference

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

int add_array_to_msg (DBusMessage *, struct EasyDbus_elem *) EASYDBUS_INTERNAL_F_ATTR
 Add array element to a DBusMessage.
int easydbus_add_array_on_container_tomsg (DBusMessage *, DBusMessageIter *, struct EasyDbus_elem *) EASYDBUS_INTERNAL_F_ATTR
 Add array element that is contained on an other container to a DBus message.
struct EasyDbus_containereasydbus_get_marshal_data_from_array (enum event_type, void *, enum el_type, DBusMessageIter *) EASYDBUS_INTERNAL_F_ATTR
 Create array element from DBusMessage.
void free_array_from_container (struct EasyDbus_elem *) EASYDBUS_INTERNAL_F_ATTR
 Free array element from container.
void free_elem_on_array (struct EasyDbus_elem *) EASYDBUS_INTERNAL_F_ATTR


Function Documentation

int easydbus_add_array_on_container_tomsg ( DBusMessage *  msg,
DBusMessageIter *  iter,
struct EasyDbus_elem el 
)

Add array element that is contained on an other container to a DBus message.

For internal use only.

Parameters:
msg DBusMessage where is insert array.
iter pointer to DBusMessageIter high level container.
el pointer to array element to insert.
Returns:
-1 error

0 ok

Definition at line 678 of file array_internal.c.

References add_variant_to_container_on_msg(), easydbus_add_array_on_container_tomsg(), easydbus_add_dict_entry_tomsg(), easydbus_add_struct_on_container_msg(), EASYDBUS_ELTYPE_ARRAY, EASYDBUS_ELTYPE_BOOLEAN, EASYDBUS_ELTYPE_BYTE, EASYDBUS_ELTYPE_DICT_ENTRY, EASYDBUS_ELTYPE_DOUBLE, EASYDBUS_ELTYPE_INT16, EASYDBUS_ELTYPE_INT32, EASYDBUS_ELTYPE_INT64, EASYDBUS_ELTYPE_INVALID, EASYDBUS_ELTYPE_OBJECT_PATH, EASYDBUS_ELTYPE_SIGNATURE, EASYDBUS_ELTYPE_STRING, EASYDBUS_ELTYPE_STRUCT, EASYDBUS_ELTYPE_UINT16, EASYDBUS_ELTYPE_UINT32, EASYDBUS_ELTYPE_UINT64, EASYDBUS_ELTYPE_VARIANT, EASYDBUS_SIGNATURE_NORMAL, EasyDbusDebug, EasyDbus_container::elem_type, EasyDbus_container::nel, EasyDbus_elem::next, EasyDbus_elem::p_container, EasyDbus_container::p_data, EasyDbus_elem::payload, prepare_signature(), and EasyDbus_container::signature.

Referenced by add_array_to_msg(), easydbus_add_array_on_container_tomsg(), easydbus_add_struct_on_container_msg(), and easydbus_add_struct_to_msg().

00681 {
00682    DBusMessageIter iter2;
00683    short *p_i16 = NULL;
00684    int *p_i32 = NULL;
00685    long long *p_i64 = NULL;
00686    double *p_double = NULL;
00687    char *p_byte = NULL;
00688    char **p_string = NULL;
00689    struct EasyDbus_elem *internal_el = NULL;
00690    struct EasyDbus_container *container = el->payload.p_container;
00691    int ret_val = -1;
00692    unsigned int i;
00693    char *signature = NULL;
00694 
00695    if (!container->nel) {
00696       if (!container->signature) {
00697          EasyDbusDebug ("Error an empty array must have a"
00698                         " signature");
00699          return ret_val;
00700       }
00701       /* see if there is a solution more efficient */
00702       if (dbus_message_iter_open_container (iter, DBUS_TYPE_ARRAY,
00703                                              container->signature,
00704                                              &iter2))
00705          ret_val = 0;
00706       else
00707          EasyDbusDebug ("Error on open array container");
00708       goto end;
00709    }
00710 
00711    /* container has at least one element */
00712    /* build signature */
00713    signature = prepare_signature (el, EASYDBUS_SIGNATURE_NORMAL);
00714    EasyDbusDebug ("Signature prepared for container on array "
00715                   "= %s\n", signature);
00716    /* this is needed beacaurse first char of signature
00717     * relative to first container container must be ignored.
00718     * Try to speak of this with dbus protocols developers 
00719     * because i think that isn't correct. */
00720    signature++;
00721    if (dbus_message_iter_open_container (iter, DBUS_TYPE_ARRAY,
00722                                           signature, &iter2))
00723       ret_val = 0;
00724    else
00725       EasyDbusDebug ("Error on open array container\n");
00726    switch (container->elem_type) {
00727       case EASYDBUS_ELTYPE_INT16:
00728          p_i16 = (short *) container->p_data;
00729          for (i = 0; i < container->nel; i++) {
00730             dbus_message_iter_append_basic (&iter2,
00731                                             DBUS_TYPE_INT16, p_i16);
00732             p_i16++;
00733          }
00734          break;
00735       case EASYDBUS_ELTYPE_UINT16:
00736          p_i16 = (short *) container->p_data;
00737          for (i = 0; i < container->nel; i++) {
00738             dbus_message_iter_append_basic (&iter2,
00739                                             DBUS_TYPE_UINT16, p_i16);
00740             p_i16++;
00741          }
00742          break;
00743       case EASYDBUS_ELTYPE_INT32:
00744          p_i32 = (int *) container->p_data;
00745          for (i = 0; i < container->nel; i++) {
00746             dbus_message_iter_append_basic (&iter2,
00747                                             DBUS_TYPE_INT32, p_i32);
00748             p_i32++;
00749          }
00750          break;
00751       case EASYDBUS_ELTYPE_UINT32:
00752          p_i32 = (int *) container->p_data;
00753          for (i = 0; i < container->nel; i++) {
00754             dbus_message_iter_append_basic (&iter2,
00755                                             DBUS_TYPE_UINT32, p_i32);
00756             p_i32++;
00757          }
00758          break;
00759       case EASYDBUS_ELTYPE_INT64:
00760          p_i64 = (long long *) container->p_data;
00761          for (i = 0; i < container->nel; i++) {
00762             dbus_message_iter_append_basic (&iter2,
00763                                             DBUS_TYPE_UINT32, p_i64);
00764             p_i64++;
00765          }
00766          break;
00767       case EASYDBUS_ELTYPE_UINT64:
00768          p_i64 = (long long *) container->p_data;
00769          for (i = 0; i < container->nel; i++) {
00770             dbus_message_iter_append_basic (&iter2,
00771                                             DBUS_TYPE_UINT64, p_i64);
00772             p_i64++;
00773          }
00774          break;
00775       case EASYDBUS_ELTYPE_BYTE:
00776          p_byte = (char *) container->p_data;
00777          for (i = 0; i < container->nel; i++) {
00778             dbus_message_iter_append_basic (&iter2,
00779                                             DBUS_TYPE_BYTE, p_byte);
00780             p_byte++;
00781          }
00782          break;
00783       case EASYDBUS_ELTYPE_DOUBLE:
00784          p_double = (double *) container->p_data;
00785          for (i = 0; i < container->nel; i++) {
00786             dbus_message_iter_append_basic (&iter2,
00787                                             DBUS_TYPE_DOUBLE,
00788                                             p_double);
00789             p_double++;
00790          }
00791          break;
00792       case EASYDBUS_ELTYPE_BOOLEAN:
00793          p_byte = (char *) container->p_data;
00794          for (i = 0; i < container->nel; i++) {
00795             dbus_message_iter_append_basic (&iter2,
00796                                             DBUS_TYPE_BOOLEAN,
00797                                             p_byte);
00798             p_byte++;
00799          }
00800          break;
00801       case EASYDBUS_ELTYPE_STRING:
00802          p_string = (char **) container->p_data;
00803          for (i = 0; i < container->nel; i++) {
00804             // char *temp = p_string[i];
00805             // printf ("%s \n", temp);
00806             dbus_message_iter_append_basic (&iter2,
00807                                             DBUS_TYPE_STRING,
00808                                             &p_string[i]);
00809          }
00810          break;
00811       case EASYDBUS_ELTYPE_OBJECT_PATH:
00812          p_string = (char **) container->p_data;
00813          for (i = 0; i < container->nel; i++)
00814             dbus_message_iter_append_basic (&iter2,
00815                                             DBUS_TYPE_OBJECT_PATH,
00816                                             &p_string[i]);
00817          break;
00818       case EASYDBUS_ELTYPE_SIGNATURE:
00819          p_string = (char **) container->p_data;
00820          for (i = 0; i < container->nel; i++)
00821             dbus_message_iter_append_basic (&iter2,
00822                                             DBUS_TYPE_SIGNATURE,
00823                                             &p_string[i]);
00824          break;
00825       case EASYDBUS_ELTYPE_ARRAY:
00826          internal_el = (struct EasyDbus_elem *) container->p_data;
00827          for (i = 0; i < container->nel; i++) {
00828             easydbus_add_array_on_container_tomsg
00829                (msg, &iter2, internal_el);
00830             internal_el = internal_el->next;
00831          }
00832          break;
00833       case EASYDBUS_ELTYPE_VARIANT:
00834          internal_el = (struct EasyDbus_elem *)
00835             container->p_data;
00836          for (i = 0; i < container->nel; i++) {
00837             add_variant_to_container_on_msg (msg, internal_el,
00838                                              &iter2);
00839             internal_el = internal_el->next;
00840          }
00841          break;
00842       case EASYDBUS_ELTYPE_DICT_ENTRY:
00843          internal_el = (struct EasyDbus_elem *)
00844             container->p_data;
00845          for (i = 0; i < container->nel; i++) {
00846             easydbus_add_dict_entry_tomsg (msg, &iter2, internal_el);
00847             internal_el = internal_el->next;
00848          }
00849          break;
00850       case EASYDBUS_ELTYPE_STRUCT:
00851          internal_el = (struct EasyDbus_elem *)
00852             container->p_data;
00853          while (internal_el != NULL) {
00854             easydbus_add_struct_on_container_msg
00855                (msg, &iter2, internal_el);
00856             internal_el = internal_el->next;
00857          }
00858          break;
00859       case EASYDBUS_ELTYPE_INVALID:
00860          EasyDbusDebug ("ERROR This type must not be used!");
00861          break;
00862    } // end of switch
00863 
00864    /* move signature pointer to original 
00865     * position with array char before call free */
00866    free (--signature);
00867 
00868  end:
00869    dbus_message_iter_close_container (iter, &iter2);
00870 
00871    return ret_val;
00872 }

Here is the call graph for this function:

struct EasyDbus_container* easydbus_get_marshal_data_from_array ( enum event_type  type,
void *  container,
enum el_type  type_marshal_data,
DBusMessageIter *  iter 
) [read]

Create array element from DBusMessage.

For internal use only.

Parameters:
type type of message object
container pointer to message object
type_marshal_data type of array data
iter pointer to DBusMessageIter where recover data about array from DBusMessage.
Returns:
-1 error

0 ok

TODO manage marshalled data on array

Definition at line 288 of file array_internal.c.

References easydbus_array_add_array(), easydbus_array_add_boolean_array(), easydbus_array_add_byte_array(), easydbus_array_add_dict_entry(), easydbus_array_add_double_array(), easydbus_array_add_i16_array(), easydbus_array_add_i32_array(), easydbus_array_add_i64_array(), easydbus_array_add_obj_path_array(), easydbus_array_add_signature_array(), easydbus_array_add_string_array(), easydbus_array_add_struct(), easydbus_array_add_ui16_array(), easydbus_array_add_ui32_array(), easydbus_array_add_ui64_array(), easydbus_array_add_variant(), easydbus_container_add_signature_to_empty_container(), easydbus_container_create_skeleton(), easydbus_container_free(), easydbus_dict_entry_build_container(), EASYDBUS_ELTYPE_ARRAY, EASYDBUS_ELTYPE_INVALID, easydbus_get_marshal_data_from_array(), EASYDBUS_MEMCOPY, easydbus_struct_build_elem(), easydbus_variant_build_elem(), EasyDbusDebug, get_easydbus_type_from_dbus_type(), and EasyDbus_container::signature.

Referenced by easydbus_build_skeleton_data(), easydbus_get_marshal_data_from_array(), and easydbus_struct_build_elem().

00292 {
00293    int i32 = 0;
00294    unsigned int ui32 = 0;
00295    short i16 = 0;
00296    char byte = 0;
00297    char *string = NULL;
00298    unsigned short ui16 = 0;
00299    long long i64 = 0;
00300    double d = 0;
00301    unsigned long long ui64 = 0;
00302    DBusMessageIter subiter;
00303    unsigned int len = 1;
00304    char *bytes = NULL;
00305    char **strings = NULL;
00306    int *int32_array = NULL;
00307    unsigned int *uint32_array = NULL;
00308    unsigned short *uint16_array = NULL;
00309    short *int16_array = NULL;
00310    long long *int64_array = NULL;
00311    unsigned long long *uint64_array = NULL;
00312    double *double_array = NULL;
00313    unsigned int i = 0;
00314    struct EasyDbus_container *array = NULL;
00315    struct EasyDbus_container *cont_marshal_data = NULL;
00316 
00317 #ifdef EASYDBUS_DEBUG
00318    char *signature = NULL;
00319 #endif
00320 
00321    dbus_message_iter_recurse (iter, &subiter);
00322 
00323    if (type_marshal_data == DBUS_TYPE_INVALID) {
00324       EasyDbusDebug ("No element on array or error");
00325       return NULL;
00326    }
00327 
00328    if (type_marshal_data != DBUS_TYPE_DICT_ENTRY) {
00329       // count elems
00330       while (dbus_message_iter_has_next (&subiter)) {
00331          len++;
00332          dbus_message_iter_next (&subiter);
00333       }
00334       // reinit iterator
00335       dbus_message_iter_recurse (iter, &subiter);
00336       EasyDbusDebug ("Number of element on array = %d", len);
00337    }
00338 
00339    array = easydbus_container_create_skeleton (EASYDBUS_ELTYPE_ARRAY);
00340    if (!array) {
00341       EasyDbusDebug ("Error on create container skeleton");
00342       return NULL;
00343    }
00344 
00345    // this is neeeded for manage correctly empty array
00346    switch (type_marshal_data) {
00347       case DBUS_TYPE_STRING:
00348       case DBUS_TYPE_OBJECT_PATH:
00349       case DBUS_TYPE_SIGNATURE:
00350          strings = (char **) malloc (sizeof (char *) * len);
00351          if (!strings)
00352             goto error;
00353          memset (strings, 0, len * sizeof (char *));
00354          break;
00355       case DBUS_TYPE_INT32:
00356          int32_array = (int *) malloc (sizeof (int) * len);
00357          if (!int32_array)
00358             goto error;
00359          memset (int32_array, 0, sizeof (int) * len);
00360          break;
00361       case DBUS_TYPE_UINT32:
00362          uint32_array = (unsigned int *) malloc (sizeof (int) * len);
00363          if (!uint32_array)
00364             goto error;
00365          memset (uint32_array, 0, sizeof (int) * len);
00366          break;
00367       case DBUS_TYPE_INT64:
00368          int64_array =
00369             (long long *) malloc (sizeof (long long) * len);
00370          if (!int64_array)
00371             goto error;
00372          memset (int64_array, 0, sizeof (long long) * len);
00373          break;
00374       case DBUS_TYPE_UINT64:
00375          uint64_array = (unsigned long long *) malloc
00376             (sizeof (unsigned long long) * len);
00377          if (!uint64_array)
00378             goto error;
00379          memset (uint64_array, 0, sizeof (unsigned long long) * len);
00380          break;
00381       case DBUS_TYPE_INT16:
00382          int16_array = (short *) malloc (sizeof (short) * len);
00383          if (!int16_array)
00384             goto error;
00385          memset (int16_array, 0, sizeof (short) * len);
00386          break;
00387       case DBUS_TYPE_UINT16:
00388          uint16_array = (unsigned short *) malloc
00389             (sizeof (unsigned short) * len);
00390          if (!uint16_array)
00391             goto error;
00392          memset (uint16_array, 0, sizeof (unsigned short) * len);
00393          break;
00394       case DBUS_TYPE_BYTE:
00395       case DBUS_TYPE_BOOLEAN:
00396          bytes = (char *) malloc (len);
00397          if (!bytes)
00398             goto error;
00399          memset (bytes, 0, len);
00400       case DBUS_TYPE_DOUBLE:
00401          double_array = (double *) malloc (sizeof (double) * len);
00402          if (!double_array)
00403             goto error;
00404          memset (double_array, 0, sizeof (double) * len);
00405          break;
00406       case DBUS_TYPE_VARIANT:
00407       case DBUS_TYPE_DICT_ENTRY:
00408       case DBUS_TYPE_ARRAY:
00409       case DBUS_TYPE_STRUCT:
00410          // do nothings, dict entry and variant elements are
00411          // insert dinamically when it is read a element.
00412          break;
00413       default:
00414          goto error;
00415          break;
00416    }
00417 
00418    while (1) {
00419 #ifdef EASYDBUS_DEBUG
00420       signature = dbus_message_iter_get_signature (iter);
00421       EasyDbusDebug ("Current Signature = %s", signature);
00422       dbus_free (signature);
00423 #endif
00424       switch (dbus_message_iter_get_arg_type (&subiter)) {
00425          case DBUS_TYPE_STRING:
00426             dbus_message_iter_get_basic (&subiter, &string);
00427             EasyDbusDebug ("founded string = %s\n", string);
00428             strings[i] = (char *) malloc (strlen (string) + 1);
00429             EASYDBUS_MEMCOPY (strings[i], string,
00430                               strlen (string) + 1);
00431             //memset (strings[i], 0, strlen (string) + 1);
00432             //memcpy (strings[i], string, strlen (string) + 1);
00433             //EasyDbusDebug ("founded string = %s\n", strings[i]);
00434             i++;
00435             break;
00436          case DBUS_TYPE_INT32:
00437             dbus_message_iter_get_basic (&subiter, &i32);
00438             EasyDbusDebug ("founded int32 = %d", i32);
00439             int32_array[i] = i32;
00440             i++;
00441             break;
00442          case DBUS_TYPE_UINT32:
00443             dbus_message_iter_get_basic (&subiter, &ui32);
00444             EasyDbusDebug ("founded uint32 = %d", ui32);
00445             uint32_array[i] = ui32;
00446             i++;
00447             break;
00448          case DBUS_TYPE_INT16:
00449             dbus_message_iter_get_basic (&subiter, &i16);
00450             EasyDbusDebug ("founded int16 = %d", i16);
00451             int16_array[i] = i16;
00452             i++;
00453             break;
00454          case DBUS_TYPE_UINT16:
00455             dbus_message_iter_get_basic (&subiter, &ui16);
00456             EasyDbusDebug ("founded uint16 = %d", ui16);
00457             uint16_array[i] = ui16;
00458             i++;
00459             break;
00460          case DBUS_TYPE_INT64:
00461             dbus_message_iter_get_basic (&subiter, &i64);
00462             EasyDbusDebug ("founded int64 = %lld", i64);
00463             int64_array[i] = i64;
00464             i++;
00465             break;
00466          case DBUS_TYPE_UINT64:
00467             dbus_message_iter_get_basic (&subiter, &ui64);
00468             EasyDbusDebug ("founded uint64 = %lld", ui64);
00469             uint64_array[i] = ui64;
00470             i++;
00471             break;
00472          case DBUS_TYPE_BYTE:
00473             dbus_message_iter_get_basic (&subiter, &byte);
00474             EasyDbusDebug ("founded byte = %d", byte);
00475             bytes[i] = byte;
00476             i++;
00477             break;
00478          case DBUS_TYPE_BOOLEAN:
00479             dbus_message_iter_get_basic (&subiter, &byte);
00480             EasyDbusDebug ("founded boolean = %d", byte);
00481             bytes[i] = byte;
00482             i++;
00483             break;
00484          case DBUS_TYPE_DOUBLE:
00485             dbus_message_iter_get_basic (&subiter, &d);
00486             EasyDbusDebug ("founded double = %f", d);
00487             double_array[i] = d;
00488             i++;
00489             break;
00490          case DBUS_TYPE_OBJECT_PATH:
00491             dbus_message_iter_get_basic (&subiter, &string);
00492             EasyDbusDebug ("founded obj_path = %s\n", string);
00493             strings[i] = (char *) malloc (strlen (string) + 1);
00494             EASYDBUS_MEMCOPY (strings[i], string, strlen (string) + 1);
00495             //memset (strings[i], 0, strlen (string) + 1);
00496             //memcpy (strings[i], string, strlen (string));
00497             i++;
00498             break;
00499          case DBUS_TYPE_SIGNATURE:
00500             dbus_message_iter_get_basic (&subiter, &string);
00501             EasyDbusDebug ("founded signature = %s\n", string);
00502             strings[i] = (char *) malloc (strlen (string) + 1);
00503             EASYDBUS_MEMCOPY (strings[i], string, strlen (string) + 1);
00504             //memset (strings[i], 0, strlen (string) + 1);
00505             //memcpy (strings[i], string, strlen (string));
00506             i++;
00507             break;
00508          case DBUS_TYPE_ARRAY:
00509             cont_marshal_data =
00510                easydbus_get_marshal_data_from_array (type,
00511                                                      container,
00512                                                      dbus_message_iter_get_element_type
00513                                                      (&subiter),
00514                                                      &subiter);
00515             if (cont_marshal_data != NULL) {
00516                easydbus_array_add_array (cont_marshal_data, array);
00517                EasyDbusDebug ("Added array to container");
00518             }
00519             else
00520                EasyDbusDebug ("Error on manage array");
00521             break;
00522          case DBUS_TYPE_STRUCT:
00523             cont_marshal_data = easydbus_struct_build_elem
00524                (type, (void *) container, &subiter);
00525             if (cont_marshal_data != NULL) {
00526                easydbus_array_add_struct (cont_marshal_data, array);
00527                EasyDbusDebug ("Added struct to container");
00528             }
00529             else
00530                EasyDbusDebug ("Error on add struct to container");
00531             break;
00532          case DBUS_TYPE_VARIANT:
00533             cont_marshal_data = easydbus_variant_build_elem
00534                (type, (void *) container, &subiter);
00535             if (cont_marshal_data != NULL) {
00536                easydbus_array_add_variant (cont_marshal_data, array);
00537                EasyDbusDebug ("Added variant to container");
00538             }
00539             else
00540                EasyDbusDebug ("Error on add variant to container");
00541             i++;
00542             break;
00543          case DBUS_TYPE_DICT_ENTRY:
00544             cont_marshal_data = easydbus_dict_entry_build_container
00545                (type, container, &subiter);
00546             if (cont_marshal_data != NULL) {
00547                easydbus_array_add_dict_entry
00548                   (cont_marshal_data, array);
00549                EasyDbusDebug ("Added dict entry to array");
00550             }
00551             else
00552                EasyDbusDebug ("Error on add dict entry to array");
00553             i++;
00554             break;
00555          case DBUS_TYPE_INVALID:
00556             EasyDbusDebug ("Empty array or field wrong");
00557             break;
00558          default:
00559             EasyDbusDebug ("Not managed or error");
00560             break;
00561       }
00562       if (!dbus_message_iter_has_next (&subiter))
00563          goto exit;
00564       else
00565          dbus_message_iter_next (&subiter);
00566    }
00567 
00568  exit:
00569    /* no element on array */
00570    if (i == 0) {
00571       EasyDbusDebug ("Add signature %d (easydbus %d) to empty array",
00572                      type_marshal_data,
00573                      get_easydbus_type_from_dbus_type
00574                      (type_marshal_data));
00576       easydbus_container_add_signature_to_empty_container (array,
00577                                                            get_easydbus_type_from_dbus_type
00578                                                            (type_marshal_data),
00579                                                            EASYDBUS_ELTYPE_INVALID);
00580    }
00581    switch (type_marshal_data) {
00582       case DBUS_TYPE_STRING:
00583          if (i)                 /* if array isn't empty */
00584             easydbus_array_add_string_array (array, len, strings);
00585          for (i = 0; i < len; i++)
00586             free (strings[i]);
00587          free (strings);
00588          break;
00589       case DBUS_TYPE_INT32:
00590          if (i)
00591             easydbus_array_add_i32_array (array, len, int32_array);
00592          free (int32_array);
00593          break;
00594       case DBUS_TYPE_UINT32:
00595          if (i)
00596             easydbus_array_add_ui32_array (array, len, uint32_array);
00597          free (uint32_array);
00598       case DBUS_TYPE_BYTE:
00599          if (i)
00600             easydbus_array_add_byte_array (array, len, bytes);
00601          free (bytes);
00602          break;
00603       case DBUS_TYPE_INT64:
00604          if (i)
00605             easydbus_array_add_i64_array (array, len, int64_array);
00606          free (int64_array);
00607          break;
00608       case DBUS_TYPE_UINT64:
00609          if (i)
00610             easydbus_array_add_ui64_array (array, len, uint64_array);
00611          free (uint64_array);
00612          break;
00613       case DBUS_TYPE_INT16:
00614          if (i)
00615             easydbus_array_add_i16_array (array, len, int16_array);
00616          free (int16_array);
00617          break;
00618       case DBUS_TYPE_UINT16:
00619          if (i)
00620             easydbus_array_add_ui16_array (array, len, uint16_array);
00621          free (uint16_array);
00622          break;
00623       case DBUS_TYPE_BOOLEAN:
00624          if (i)
00625             easydbus_array_add_boolean_array (array, len, bytes);
00626          free (bytes);
00627          break;
00628       case DBUS_TYPE_DOUBLE:
00629          if (i)
00630             easydbus_array_add_double_array (array, len,
00631                                              double_array);
00632          free (double_array);
00633          break;
00634       case DBUS_TYPE_OBJECT_PATH:
00635          if (i)
00636             easydbus_array_add_obj_path_array (array, len, strings);
00637          for (i = 0; i < len; i++)
00638             free (strings[i]);
00639          free (strings);
00640          break;
00641       case DBUS_TYPE_SIGNATURE:
00642          if (i)
00643             easydbus_array_add_signature_array (array, len, strings);
00644          for (i = 0; i < len; i++)
00645             free (strings[i]);
00646          free (strings);
00647          break;
00648       case DBUS_TYPE_DICT_ENTRY:
00649       case DBUS_TYPE_VARIANT:
00650       case DBUS_TYPE_ARRAY:
00651       case DBUS_TYPE_STRUCT:
00652          EasyDbusDebug ("Data already inserted on array");
00653          break;
00654       default:
00655          break;
00656    }
00657 
00658    EasyDbusDebug ("End of get recurse marshal data");
00659    return array;
00660 
00661  error:
00662    if (array != NULL)
00663       easydbus_container_free (array);
00664    return NULL;
00665 }

Here is the call graph for this function:

void free_elem_on_array ( struct EasyDbus_elem  ) 


Generated on Thu Apr 10 10:00:27 2008 for EasyDbus-0.2 by  doxygen 1.5.4