Back to index

lightning-sunbird  0.9+nobinonly
icalfileset.h
Go to the documentation of this file.
00001 /* -*- Mode: C -*- */
00002 /*======================================================================
00003  FILE: icalfileset.h
00004  CREATOR: eric 23 December 1999
00005 
00006 
00007  $Id: icalfileset.h,v 1.13 2002/12/05 13:45:20 acampi Exp $
00008  $Locker:  $
00009 
00010  (C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org
00011 
00012  This program is free software; you can redistribute it and/or modify
00013  it under the terms of either: 
00014 
00015     The LGPL as published by the Free Software Foundation, version
00016     2.1, available at: http://www.fsf.org/copyleft/lesser.html
00017 
00018   Or:
00019 
00020     The Mozilla Public License Version 1.0. You may obtain a copy of
00021     the License at http://www.mozilla.org/MPL/
00022 
00023  The Original Code is eric. The Initial Developer of the Original
00024  Code is Eric Busboom
00025 
00026 
00027 ======================================================================*/
00028 
00029 #ifndef ICALFILESET_H
00030 #define ICALFILESET_H
00031 
00032 #include "ical.h"
00033 #include "icalset.h"
00034 #include "icalcluster.h"
00035 #include "icalgauge.h"
00036 #include <sys/types.h> /* For open() flags and mode */
00037 #include <sys/stat.h> /* For open() flags and mode */
00038 #include <fcntl.h> /* For open() flags and mode */
00039 
00040 #ifdef WIN32
00041 #define mode_t int
00042 #endif
00043 
00044 typedef struct icalfileset_impl icalfileset;
00045 
00046 icalset* icalfileset_new(const char* path);
00047 icalset* icalfileset_new_reader(const char* path);
00048 icalset* icalfileset_new_writer(const char* path);
00049 
00050 icalset* icalfileset_init(icalset *set, const char *dsn, void* options);
00051 
00052 icalfileset* icalfileset_new_from_cluster(const char* path, icalcluster *cluster);
00053 
00054 icalcluster* icalfileset_produce_icalcluster(const char *path);
00055 
00056 void icalfileset_free(icalset* cluster);
00057 
00058 const char* icalfileset_path(icalset* cluster);
00059 
00060 /* Mark the cluster as changed, so it will be written to disk when it
00061    is freed. Commit writes to disk immediately. */
00062 void icalfileset_mark(icalset* set);
00063 icalerrorenum icalfileset_commit(icalset* set); 
00064 
00065 icalerrorenum icalfileset_add_component(icalset* set,
00066                                    icalcomponent* child);
00067 
00068 icalerrorenum icalfileset_remove_component(icalset* set,
00069                                       icalcomponent* child);
00070 
00071 int icalfileset_count_components(icalset* set,
00072                              icalcomponent_kind kind);
00073 
00078 icalerrorenum icalfileset_select(icalset* set, icalgauge* gauge);
00079 
00081 void icalfileset_clear(icalset* set);
00082 
00084 icalcomponent* icalfileset_fetch(icalset* set, const char* uid);
00085 int icalfileset_has_uid(icalset* set, const char* uid);
00086 icalcomponent* icalfileset_fetch_match(icalset* set, icalcomponent *c);
00087 
00088 
00093 icalerrorenum icalfileset_modify(icalset* set, 
00094                              icalcomponent *oldcomp,
00095                             icalcomponent *newcomp);
00096 
00097 /* Iterate through components. If a gauge has been defined, these
00098    will skip over components that do not pass the gauge */
00099 
00100 icalcomponent* icalfileset_get_current_component (icalset* cluster);
00101 icalcomponent* icalfileset_get_first_component(icalset* cluster);
00102 icalcomponent* icalfileset_get_next_component(icalset* cluster);
00103 
00104 /* External iterator for thread safety */
00105 icalsetiter icalfileset_begin_component(icalset* set, icalcomponent_kind kind, icalgauge* gauge);
00106 icalcomponent * icalfilesetiter_to_next(icalset* set, icalsetiter *iter);
00107 icalcomponent* icalfileset_form_a_matched_recurrence_component(icalsetiter* itr);
00108 
00112 icalcomponent* icalfileset_get_component(icalset* cluster);
00113 
00120 typedef struct icalfileset_options {
00121   int          flags;              
00122   mode_t       mode;        
00123   icalcluster  *cluster;    
00124 } icalfileset_options;
00125 
00126 extern icalfileset_options icalfileset_options_default;
00127 
00128 #endif /* !ICALFILESET_H */
00129 
00130 
00131