Back to index

lightning-sunbird  0.9+nobinonly
Typedefs | Functions
icalcluster.h File Reference
#include "ical.h"
#include "icalset.h"
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Typedefs

typedef struct icalcluster_impl

Functions

icalcluster * icalcluster_new (const char *key, icalcomponent *data)
 Create a cluster with a key/value pair.
icalcluster * icalcluster_new_clone (const icalcluster *cluster)
 Deep clone an icalcluster to a new one.
void icalcluster_free (icalcluster *cluster)
const char * icalcluster_key (icalcluster *cluster)
int icalcluster_is_changed (icalcluster *cluster)
void icalcluster_mark (icalcluster *cluster)
void icalcluster_commit (icalcluster *cluster)
icalcomponent * icalcluster_get_component (icalcluster *cluster)
int icalcluster_count_components (icalcluster *cluster, icalcomponent_kind kind)
icalerrorenum icalcluster_add_component (icalcluster *cluster, icalcomponent *child)
icalerrorenum icalcluster_remove_component (icalcluster *cluster, icalcomponent *child)
icalcomponent * icalcluster_get_current_component (icalcluster *cluster)
 Iterate through components.
icalcomponent * icalcluster_get_first_component (icalcluster *cluster)
icalcomponent * icalcluster_get_next_component (icalcluster *cluster)

Typedef Documentation

typedef struct icalcluster_impl

Definition at line 35 of file icalcluster.h.


Function Documentation

icalerrorenum icalcluster_add_component ( icalcluster *  cluster,
icalcomponent *  child 
)

Definition at line 189 of file icalcluster.c.

Here is the call graph for this function:

Here is the caller graph for this function:

void icalcluster_commit ( icalcluster *  cluster)

Definition at line 168 of file icalcluster.c.

                                           {
       icalerror_check_arg_rv((impl!=0),"cluster");

       impl->changed = 0;
}
int icalcluster_count_components ( icalcluster *  cluster,
icalcomponent_kind  kind 
)

Definition at line 213 of file icalcluster.c.

                                                                             {

       icalerror_check_arg_re((impl!=0),"cluster",ICAL_BADARG_ERROR);

       return icalcomponent_count_components(impl->data, kind);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void icalcluster_free ( icalcluster *  cluster)

Definition at line 130 of file icalcluster.c.

                                         {
       icalerror_check_arg_rv((impl!=0),"cluster");

       if (impl->key != 0){
              free(impl->key);
              impl->key = 0;
       }

       if (impl->data != 0){
              icalcomponent_free(impl->data);
              impl->data = 0;
       }

       free(impl);
}

Here is the call graph for this function:

Here is the caller graph for this function:

icalcomponent* icalcluster_get_component ( icalcluster *  cluster)

Definition at line 175 of file icalcluster.c.

                                                            {

       icalerror_check_arg_rz((impl!=0),"cluster");

       if (icalcomponent_isa(impl->data) != ICAL_XROOT_COMPONENT) {
              icalerror_warn("The top component is not an XROOT");
              fprintf(stderr, "%s\n", icalcomponent_as_ical_string(impl->data));
              abort();
       }

       return impl->data;
}

Here is the call graph for this function:

Here is the caller graph for this function:

icalcomponent* icalcluster_get_current_component ( icalcluster *  cluster)

Iterate through components.

Definition at line 222 of file icalcluster.c.

                                                                    {

       icalerror_check_arg_rz((impl!=0),"cluster");

       return icalcomponent_get_current_component(impl->data);
}

Here is the call graph for this function:

Here is the caller graph for this function:

icalcomponent* icalcluster_get_first_component ( icalcluster *  cluster)

Definition at line 230 of file icalcluster.c.

                                                                  {

       icalerror_check_arg_rz((impl!=0),"cluster");

       return icalcomponent_get_first_component(impl->data,
                                            ICAL_ANY_COMPONENT);
}

Here is the call graph for this function:

Here is the caller graph for this function:

icalcomponent* icalcluster_get_next_component ( icalcluster *  cluster)

Definition at line 239 of file icalcluster.c.

                                                                 {

       icalerror_check_arg_rz((impl!=0),"cluster");
    
       return icalcomponent_get_next_component(impl->data,
                                        ICAL_ANY_COMPONENT);
}

Here is the call graph for this function:

Here is the caller graph for this function:

int icalcluster_is_changed ( icalcluster *  cluster)

Definition at line 154 of file icalcluster.c.

                                              {
       icalerror_check_arg_rz((impl!=0),"cluster");

       return impl->changed;
}
const char* icalcluster_key ( icalcluster *  cluster)

Definition at line 147 of file icalcluster.c.

                                               {
       icalerror_check_arg_rz((impl!=0),"cluster");

       return impl->key;
}

Here is the caller graph for this function:

void icalcluster_mark ( icalcluster *  cluster)

Definition at line 161 of file icalcluster.c.

                                         {
       icalerror_check_arg_rv((impl!=0),"cluster");

       impl->changed = 1;
}

Here is the caller graph for this function:

icalcluster* icalcluster_new ( const char *  key,
icalcomponent *  data 
)

Create a cluster with a key/value pair.

Todo:
Always do a deep copy.

Definition at line 92 of file icalcluster.c.

                                                                    {
       struct icalcluster_impl *impl = icalcluster_new_impl();
       assert(impl->data == 0);

       impl->key     = strdup(key);
       impl->changed = 0;
       impl->data    = 0;

       if (data != NULL) {
              if (icalcomponent_isa(data) != ICAL_XROOT_COMPONENT) {
                     impl->data = icalcomponent_new(ICAL_XROOT_COMPONENT);
                     icalcomponent_add_component(impl->data, data);
              } else {
                     impl->data = icalcomponent_new_clone(data);
              }
       } else {
              impl->data = icalcomponent_new(ICAL_XROOT_COMPONENT);
       }

       return impl;
}

Here is the call graph for this function:

Here is the caller graph for this function:

icalcluster* icalcluster_new_clone ( const icalcluster *  cluster)

Deep clone an icalcluster to a new one.

Definition at line 118 of file icalcluster.c.

                                                            {
       struct icalcluster_impl *old = (struct icalcluster_impl *)data;
       struct icalcluster_impl *impl = icalcluster_new_impl();

       impl->key     = strdup(old->key);
       impl->data    = icalcomponent_new_clone(old->data);
       impl->changed = 0;

       return impl;
}

Here is the call graph for this function:

icalerrorenum icalcluster_remove_component ( icalcluster *  cluster,
icalcomponent *  child 
)

Definition at line 201 of file icalcluster.c.

Here is the call graph for this function:

Here is the caller graph for this function: