Back to index

lightning-sunbird  0.9+nobinonly
icaldirset.h
Go to the documentation of this file.
00001 /* -*- Mode: C -*- */
00002 /*======================================================================
00003  FILE: icaldirset.h
00004  CREATOR: eric 28 November 1999
00005 
00006 
00007  $Id: icaldirset.h,v 1.6 2002/06/27 02:30:58 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 ICALDIRSET_H
00030 #define ICALDIRSET_H
00031 
00032 #include "ical.h"
00033 #include "icalset.h"
00034 #include "icalcluster.h"
00035 #include "icalgauge.h"
00036 
00037 /* icaldirset Routines for storing, fetching, and searching for ical
00038  * objects in a database */
00039 
00040 typedef struct icaldirset_impl icaldirset;
00041 
00042 icalset* icaldirset_new(const char* path);
00043 
00044 icalset* icaldirset_new_reader(const char* path);
00045 icalset* icaldirset_new_writer(const char* path);
00046 
00047 
00048 icalset* icaldirset_init(icalset* set, const char *dsn, void *options);
00049 void icaldirset_free(icalset* set);
00050 
00051 const char* icaldirset_path(icalset* set);
00052 
00053 /* Mark the cluster as changed, so it will be written to disk when it
00054    is freed. Commit writes to disk immediately*/
00055 void icaldirset_mark(icalset* set);
00056 icalerrorenum icaldirset_commit(icalset* set);
00057 
00058 icalerrorenum icaldirset_add_component(icalset* store, icalcomponent* comp);
00059 icalerrorenum icaldirset_remove_component(icalset* store, icalcomponent* comp);
00060 
00061 int icaldirset_count_components(icalset* store,
00062                             icalcomponent_kind kind);
00063 
00064 /* Restrict the component returned by icaldirset_first, _next to those
00065    that pass the gauge. _clear removes the gauge. */
00066 icalerrorenum icaldirset_select(icalset* store, icalgauge* gauge);
00067 void icaldirset_clear(icalset* store);
00068 
00069 /* Get a component by uid */
00070 icalcomponent* icaldirset_fetch(icalset* store, const char* uid);
00071 int icaldirset_has_uid(icalset* store, const char* uid);
00072 icalcomponent* icaldirset_fetch_match(icalset* set, icalcomponent *c);
00073 
00074 /* Modify components according to the MODIFY method of CAP. Works on
00075    the currently selected components. */
00076 icalerrorenum icaldirset_modify(icalset* store, icalcomponent *oldc,
00077                             icalcomponent *newc);
00078 
00079 /* Iterate through the components. If a gauge has been defined, these
00080    will skip over components that do not pass the gauge */
00081 
00082 icalcomponent* icaldirset_get_current_component(icalset* store);
00083 icalcomponent* icaldirset_get_first_component(icalset* store);
00084 icalcomponent* icaldirset_get_next_component(icalset* store);
00085 
00086 /* External iterator for thread safety */
00087 icalsetiter icaldirset_begin_component(icalset* set, icalcomponent_kind kind, icalgauge* gauge);
00088 icalcomponent* icaldirsetiter_to_next(icalset* set, icalsetiter* i);
00089 icalcomponent* icaldirsetiter_to_prior(icalset* set, icalsetiter* i);
00090 
00091 typedef struct icaldirset_options {
00092   int flags;                
00093 } icaldirset_options;
00094 
00095 #endif /* !ICALDIRSET_H */
00096 
00097 
00098