Back to index

lightning-sunbird  0.9+nobinonly
icaldirset.c
Go to the documentation of this file.
00001 /* -*- Mode: C -*-
00002     ======================================================================
00003     FILE: icaldirset.c
00004     CREATOR: eric 28 November 1999
00005   
00006     $Id: icaldirset.c,v 1.22 2005/01/24 14:00:39 acampi Exp $
00007     $Locker:  $
00008     
00009  (C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org
00010 
00011  This program is free software; you can redistribute it and/or modify
00012  it under the terms of either: 
00013 
00014     The LGPL as published by the Free Software Foundation, version
00015     2.1, available at: http://www.fsf.org/copyleft/lesser.html
00016 
00017   Or:
00018 
00019     The Mozilla Public License Version 1.0. You may obtain a copy of
00020     the License at http://www.mozilla.org/MPL/
00021 
00022     The Original Code is eric. The Initial Developer of the Original
00023     Code is Eric Busboom
00024 
00025 
00026     ======================================================================*/
00027 
00028 
00055 #ifdef HAVE_CONFIG_H
00056 #include "config.h"
00057 #endif
00058 
00059 
00060 #include "ical.h"
00061 #include "icaldirset.h"
00062 #include "icaldirset.h"
00063 #include "icalfileset.h"
00064 #include "icalfilesetimpl.h"
00065 #include "icalcluster.h"
00066 #include "icalgauge.h"
00067 
00068 #include <limits.h> /* For PATH_MAX */
00069 #ifndef WIN32
00070 #include <dirent.h> /* for opendir() */
00071 #include <unistd.h> /* for stat, getpid */
00072 #include <sys/utsname.h> /* for uname */
00073 #else
00074 #include <io.h>
00075 #include <process.h>
00076 #endif
00077 #include <errno.h>
00078 #include <sys/types.h> /* for opendir() */
00079 #include <sys/stat.h> /* for stat */
00080 #include <time.h> /* for clock() */
00081 #include <stdlib.h> /* for rand(), srand() */
00082 #include <string.h> /* for strdup */
00083 #include "icaldirsetimpl.h"
00084 
00085 
00086 #ifdef WIN32
00087 #define snprintf     _snprintf
00088 #define strcasecmp   stricmp
00089 
00090 #define _S_ISTYPE(mode, mask)  (((mode) & _S_IFMT) == (mask))
00091 
00092 #define S_ISDIR(mode)    _S_ISTYPE((mode), _S_IFDIR)
00093 #define S_ISREG(mode)    _S_ISTYPE((mode), _S_IFREG)
00094 #endif
00095 
00097 icaldirset_options icaldirset_options_default = {O_RDWR|O_CREAT};
00098 
00099 
00100 const char* icaldirset_path(icalset* set)
00101 {
00102   icaldirset *dset = (icaldirset*)set;
00103 
00104   return dset->dir;
00105 }
00106 
00107 
00108 void icaldirset_mark(icalset* set)
00109 {
00110   icaldirset *dset = (icaldirset*)set;
00111 
00112   icalcluster_mark(dset->cluster);
00113 }
00114 
00115 
00116 icalerrorenum icaldirset_commit(icalset* set)
00117 {
00118   icaldirset *dset = (icaldirset*)set;
00119   icalset *fileset;
00120   icalfileset_options options = icalfileset_options_default;
00121 
00122   options.cluster = dset->cluster;
00123 
00124   fileset = icalset_new(ICAL_FILE_SET, icalcluster_key(dset->cluster), &options);
00125 
00126   fileset->commit(fileset);
00127   fileset->free(fileset);
00128 
00129   return ICAL_NO_ERROR;
00130 }
00131 
00132 void icaldirset_lock(const char* dir)
00133 {
00134 }
00135 
00136 
00137 void icaldirset_unlock(const char* dir)
00138 {
00139 }
00140 
00141 /* Load the contents of the store directory into the store's internal directory list*/
00142 icalerrorenum icaldirset_read_directory(icaldirset *dset)
00143 {
00144     char *str;
00145 #ifndef WIN32
00146     struct dirent *de;
00147     DIR* dp;
00148  
00149     dp = opendir(dset->dir);
00150    
00151     if (dp == 0) {
00152        icalerror_set_errno(ICAL_FILE_ERROR);
00153        return ICAL_FILE_ERROR;
00154     }
00155 
00156     /* clear contents of directory list */
00157     while((str = pvl_pop(dset->directory))){
00158        free(str);
00159     }
00160     
00161     /* load all of the cluster names in the directory list */
00162     for(de = readdir(dp);
00163        de != 0;
00164        de = readdir(dp)){
00165 
00166        /* Remove known directory names  '.' and '..'*/
00167        if (strcmp(de->d_name,".") == 0 ||
00168            strcmp(de->d_name,"..") == 0 ){
00169            continue;
00170        }
00171 
00172        pvl_push(dset->directory, (void*)strdup(de->d_name));   
00173     }
00174 
00175     closedir(dp);
00176 #else
00177        struct _finddata_t c_file;
00178        long hFile;
00179        
00180        /* Find first .c file in current directory */
00181     if( (hFile = _findfirst( "*", &c_file )) == -1L ) {
00182               icalerror_set_errno(ICAL_FILE_ERROR);
00183               return ICAL_FILE_ERROR;
00184     } else {
00185       while((str = pvl_pop(dset->directory))){
00186                      free(str);
00187               }
00188               
00189               /* load all of the cluster names in the directory list */
00190       do {
00191                      /* Remove known directory names  '.' and '..'*/
00192                      if (strcmp(c_file.name,".") == 0 ||
00193                             strcmp(c_file.name,"..") == 0 ){
00194                             continue;
00195                      }
00196                      
00197        pvl_push(dset->directory, (void*)strdup(c_file.name));
00198               }
00199               while ( _findnext( hFile, &c_file ) == 0 );
00200                      
00201               _findclose( hFile );
00202        }
00203 
00204 #endif
00205 
00206     return ICAL_NO_ERROR;
00207 }
00208 
00209 
00210 icalset* icaldirset_init(icalset* set, const char* dir, void* options_in)
00211 {
00212   icaldirset *dset = (icaldirset*)set;
00213   icaldirset_options *options = options_in;
00214     struct stat sbuf;
00215 
00216     icalerror_check_arg_rz( (dir!=0), "dir");
00217   icalerror_check_arg_rz( (set!=0), "set");
00218 
00219     if (stat(dir,&sbuf) != 0){
00220        icalerror_set_errno(ICAL_FILE_ERROR);
00221        return 0;
00222     }
00223     
00224     /* dir is not the name of a direectory*/
00225     if (!S_ISDIR(sbuf.st_mode)){ 
00226        icalerror_set_errno(ICAL_USAGE_ERROR);
00227        return 0;
00228     }      
00229 
00230     icaldirset_lock(dir);
00231 
00232   dset->dir = (char*)strdup(dir);
00233   dset->options = *options;
00234   dset->directory = pvl_newlist();
00235   dset->directory_iterator = 0;
00236   dset->gauge = 0;
00237   dset->first_component = 0;
00238   dset->cluster = 0;
00239 
00240   return set;
00241 }
00242 
00243 icalset* icaldirset_new(const char* dir)
00244 {
00245   return icalset_new(ICAL_DIR_SET, dir, &icaldirset_options_default);
00246 }
00247 
00248     
00249 icalset* icaldirset_new_reader(const char* dir)
00250 {
00251   icaldirset_options reader_options = icaldirset_options_default;
00252 
00253   reader_options.flags = O_RDONLY;
00254 
00255   return icalset_new(ICAL_DIR_SET, dir, &reader_options);
00256 }
00257 
00258     
00259 icalset* icaldirset_new_writer(const char* dir)
00260 {
00261   icaldirset_options writer_options = icaldirset_options_default;
00262 
00263   writer_options.flags = O_RDWR|O_CREAT;
00264 
00265   return icalset_new(ICAL_DIR_SET, dir, &writer_options);
00266 }
00267 
00268 
00269 void icaldirset_free(icalset* s)
00270 {
00271   icaldirset *dset = (icaldirset*)s;
00272     char* str;
00273 
00274   icaldirset_unlock(dset->dir);
00275 
00276   if(dset->dir !=0){
00277     free(dset->dir);
00278     dset->dir = 0;
00279     }
00280 
00281   if(dset->gauge !=0){
00282     icalgauge_free(dset->gauge);
00283     dset->gauge = 0;
00284     }
00285 
00286   if(dset->cluster !=0){
00287     icalcluster_free(dset->cluster);
00288     }
00289 
00290   while(dset->directory !=0 &&  (str=pvl_pop(dset->directory)) != 0){
00291        free(str);
00292     }
00293 
00294   if(dset->directory != 0){
00295     pvl_free(dset->directory);
00296     dset->directory = 0;
00297     }
00298 
00299   dset->directory_iterator = 0;
00300   dset->first_component = 0;
00301 }
00302 
00303 
00304 /* icaldirset_next_uid_number updates a serial number in the Store
00305    directory in a file called SEQUENCE */
00306 
00307 int icaldirset_next_uid_number(icaldirset* dset)
00308 {
00309     char sequence = 0;
00310     char temp[128];
00311     char filename[ICAL_PATH_MAX];
00312     char *r;
00313     FILE *f;
00314     struct stat sbuf;
00315 
00316     icalerror_check_arg_rz( (dset!=0), "dset");
00317 
00318     snprintf(filename,sizeof(filename),"%s/%s",dset->dir,"SEQUENCE");
00319 
00320     /* Create the file if it does not exist.*/
00321     if (stat(filename,&sbuf) == -1 || !S_ISREG(sbuf.st_mode)){
00322 
00323        f = fopen(filename,"w");
00324        if (f != 0){
00325            fprintf(f,"0");
00326            fclose(f);
00327        } else {
00328            icalerror_warn("Can't create SEQUENCE file in icaldirset_next_uid_number");
00329            return 0;
00330        }
00331     }
00332     
00333     if ( (f = fopen(filename,"r+")) != 0){
00334 
00335        rewind(f);
00336        r = fgets(temp,128,f);
00337 
00338        if (r == 0){
00339            sequence = 1;
00340        } else {
00341            sequence = atoi(temp)+1;
00342        }
00343 
00344        rewind(f);
00345 
00346        fprintf(f,"%d",sequence);
00347 
00348        fclose(f);
00349 
00350        return sequence;
00351        
00352     } else {
00353        icalerror_warn("Can't create SEQUENCE file in icaldirset_next_uid_number");
00354        return 0;
00355     }
00356 }
00357 
00358 icalerrorenum icaldirset_next_cluster(icaldirset* dset)
00359 {
00360     char path[ICAL_PATH_MAX];
00361 
00362     if (dset->directory_iterator == 0){
00363        icalerror_set_errno(ICAL_INTERNAL_ERROR);
00364        return ICAL_INTERNAL_ERROR;
00365     }      
00366     dset->directory_iterator = pvl_next(dset->directory_iterator);
00367 
00368     if (dset->directory_iterator == 0){
00369        /* There are no more clusters */
00370        if(dset->cluster != 0){
00371            icalcluster_free(dset->cluster);
00372            dset->cluster = 0;
00373        }
00374        return ICAL_NO_ERROR;
00375     }
00376            
00377     snprintf(path,sizeof(path),"%s/%s", dset->dir,(char*)pvl_data(dset->directory_iterator));
00378 
00379     icalcluster_free(dset->cluster);
00380     dset->cluster = icalfileset_produce_icalcluster(path);
00381 
00382     return icalerrno;
00383 }
00384 
00385 static void icaldirset_add_uid(icalcomponent* comp)
00386 {
00387     char uidstring[ICAL_PATH_MAX];
00388     icalproperty *uid;
00389 #ifndef WIN32
00390     struct utsname unamebuf;
00391 #endif
00392 
00393     icalerror_check_arg_rv( (comp!=0), "comp");
00394 
00395     uid = icalcomponent_get_first_property(comp,ICAL_UID_PROPERTY);
00396     
00397     if (uid == 0) {
00398        
00399 #ifndef WIN32
00400        uname(&unamebuf);
00401        
00402        snprintf(uidstring,sizeof(uidstring),"%d-%s",(int)getpid(),unamebuf.nodename);
00403 #else
00404        snprintf(uidstring,sizeof(uidstring),"%d-%s",(int)getpid(),"WINDOWS");  /* FIX: There must be an easy get the system name */
00405 #endif
00406        
00407        uid = icalproperty_new_uid(uidstring);
00408        icalcomponent_add_property(comp,uid);
00409     } else {
00410        strcpy(uidstring,icalproperty_get_uid(uid));
00411     }
00412 }
00413 
00414 
00421 icalerrorenum icaldirset_add_component(icalset* set, icalcomponent* comp)
00422 {
00423     char clustername[ICAL_PATH_MAX];
00424     icalproperty *dt = 0;
00425     icalvalue *v;
00426     struct icaltimetype tm;
00427     icalerrorenum error = ICAL_NO_ERROR;
00428     icalcomponent *inner;
00429     icaldirset *dset = (icaldirset*) set;
00430 
00431     icalerror_check_arg_rz( (dset!=0), "dset");
00432     icalerror_check_arg_rz( (comp!=0), "comp");
00433 
00434     icaldirset_add_uid(comp);
00435 
00436     /* Determine which cluster this object belongs in. This is a HACK */
00437 
00438     for(inner = icalcomponent_get_first_component(comp,ICAL_ANY_COMPONENT);
00439        inner != 0;
00440        inner = icalcomponent_get_next_component(comp,ICAL_ANY_COMPONENT)){
00441   
00442        dt = icalcomponent_get_first_property(inner,ICAL_DTSTAMP_PROPERTY);
00443        
00444       if (dt != 0)
00445            break; 
00446        }      
00447 
00448     if (dt == 0) {
00449        for(inner = icalcomponent_get_first_component(comp,ICAL_ANY_COMPONENT);
00450            inner != 0;
00451            inner = icalcomponent_get_next_component(comp,ICAL_ANY_COMPONENT)){
00452            
00453            dt = icalcomponent_get_first_property(inner,ICAL_DTSTART_PROPERTY);
00454            
00455          if (dt != 0)
00456               break; 
00457            }  
00458        }
00459 
00460     if (dt == 0){
00461        icalerror_warn("The component does not have a DTSTAMP or DTSTART property, so it cannot be added to the store");
00462        icalerror_set_errno(ICAL_BADARG_ERROR);
00463        return ICAL_BADARG_ERROR;
00464     }
00465 
00466     v = icalproperty_get_value(dt);
00467     tm = icalvalue_get_datetime(v);
00468 
00469     snprintf(clustername,ICAL_PATH_MAX,"%s/%04d%02d",dset->dir, tm.year, tm.month);
00470 
00471     /* Load the cluster and insert the object */
00472     if(dset->cluster != 0 && 
00473        strcmp(clustername,icalcluster_key(dset->cluster)) != 0 ){
00474       icalcluster_free(dset->cluster);
00475       dset->cluster = 0;
00476     }
00477 
00478     if (dset->cluster == 0){
00479       dset->cluster = icalfileset_produce_icalcluster(clustername);
00480 
00481       if (dset->cluster == 0){
00482            error = icalerrno;
00483        }
00484     }
00485     
00486     if (error != ICAL_NO_ERROR){
00487        icalerror_set_errno(error);
00488        return error;
00489     }
00490 
00491     /* Add the component to the cluster */
00492     icalcluster_add_component(dset->cluster,comp);
00493     
00494     /* icalcluster_mark(impl->cluster); */
00495 
00496     return ICAL_NO_ERROR;    
00497 }
00498 
00506 icalerrorenum icaldirset_remove_component(icalset* set, icalcomponent* comp)
00507 {
00508     icaldirset *dset = (icaldirset*)set;
00509     icalcomponent *filecomp = icalcluster_get_component(dset->cluster);
00510 
00511     icalcompiter i;
00512     int found = 0;
00513 
00514     icalerror_check_arg_re((set!=0),"set",ICAL_BADARG_ERROR);
00515     icalerror_check_arg_re((comp!=0),"comp",ICAL_BADARG_ERROR);
00516     icalerror_check_arg_re((dset->cluster!=0),"Cluster pointer",ICAL_USAGE_ERROR);
00517 
00518     for(i = icalcomponent_begin_component(filecomp,ICAL_ANY_COMPONENT);
00519        icalcompiter_deref(&i)!= 0; icalcompiter_next(&i)){
00520        
00521        icalcomponent *this = icalcompiter_deref(&i);
00522 
00523        if (this == comp){
00524            found = 1;
00525            break;
00526        }
00527     }
00528 
00529     if (found != 1){
00530        icalerror_warn("icaldirset_remove_component: component is not part of current cluster");
00531        icalerror_set_errno(ICAL_USAGE_ERROR);
00532        return ICAL_USAGE_ERROR;
00533     }
00534 
00535     icalcluster_remove_component(dset->cluster,comp);
00536 
00537     /* icalcluster_mark(impl->cluster); */
00538 
00539     /* If the removal emptied the fileset, get the next fileset */
00540     if( icalcluster_count_components(dset->cluster,ICAL_ANY_COMPONENT)==0){
00541       icalerrorenum error = icaldirset_next_cluster(dset);
00542 
00543       if(dset->cluster != 0 && error == ICAL_NO_ERROR){
00544        icalcluster_get_first_component(dset->cluster);
00545        } else {
00546            /* HACK. Not strictly correct for impl->cluster==0 */
00547            return error;
00548        }
00549     } else {
00550        /* Do nothing */
00551     }
00552 
00553     return ICAL_NO_ERROR;
00554 }
00555 
00556 
00557 
00558 int icaldirset_count_components(icalset* store,
00559                             icalcomponent_kind kind)
00560 {
00561     /* HACK, not implemented */
00562     assert(0);
00563 
00564     return 0;
00565 }
00566 
00567 
00568 icalcomponent* icaldirset_fetch_match(icalset* set, icalcomponent *c)
00569 {
00570     fprintf(stderr," icaldirset_fetch_match is not implemented\n");
00571     assert(0);
00572     return 0;
00573 }
00574 
00575 
00576 icalcomponent* icaldirset_fetch(icalset* set, const char* uid)
00577 {
00578     icaldirset *dset = (icaldirset*)set;
00579     icalgauge *gauge;
00580     icalgauge *old_gauge;
00581     icalcomponent *c;
00582     char sql[256];
00583 
00584     icalerror_check_arg_rz( (set!=0), "set");
00585     icalerror_check_arg_rz( (uid!=0), "uid");
00586 
00587     snprintf(sql, 256, "SELECT * FROM VEVENT WHERE UID = \"%s\"", uid);
00588     
00589     gauge = icalgauge_new_from_sql(sql, 0);
00590 
00591     old_gauge = dset->gauge;
00592     dset->gauge = gauge;
00593 
00594     c= icaldirset_get_first_component(set);
00595 
00596     dset->gauge = old_gauge;
00597 
00598     icalgauge_free(gauge);
00599 
00600     return c;
00601 }
00602 
00603 
00604 int icaldirset_has_uid(icalset* set, const char* uid)
00605 {
00606     icalcomponent *c;
00607 
00608     icalerror_check_arg_rz( (set!=0), "set");
00609     icalerror_check_arg_rz( (uid!=0), "uid");
00610     
00611     /* HACK. This is a temporary implementation. _has_uid should use a
00612        database, and _fetch should use _has_uid, not the other way
00613        around */
00614     c = icaldirset_fetch(set,uid);
00615 
00616     return c!=0;
00617 
00618 }
00619 
00620 
00621 icalerrorenum icaldirset_select(icalset* set, icalgauge* gauge)
00622 {
00623   icaldirset *dset = (icaldirset*)set;
00624 
00625   icalerror_check_arg_re( (set!=0), "set",ICAL_BADARG_ERROR);
00626     icalerror_check_arg_re( (gauge!=0), "gauge",ICAL_BADARG_ERROR);
00627 
00628   dset->gauge = gauge;
00629 
00630     return ICAL_NO_ERROR;
00631 }
00632 
00633 
00634 icalerrorenum icaldirset_modify(icalset* set, 
00635                             icalcomponent *old,
00636                             icalcomponent *new)
00637 {
00638     assert(0);
00639     return ICAL_NO_ERROR; /* HACK, not implemented */
00640 
00641 }
00642 
00643 
00644 void icaldirset_clear(icalset* set)
00645 {
00646 
00647     assert(0);
00648     return;
00649     /* HACK, not implemented */
00650 }
00651 
00652 icalcomponent* icaldirset_get_current_component(icalset* set)
00653 {
00654   icaldirset *dset = (icaldirset*)set;
00655 
00656   if (dset->cluster == 0){
00657     icaldirset_get_first_component(set);
00658     }
00659   if(dset->cluster == 0){
00660        return 0;
00661     }
00662 
00663   return icalcluster_get_current_component(dset->cluster);
00664 }
00665 
00666 
00667 icalcomponent* icaldirset_get_first_component(icalset* set)
00668 {
00669   icaldirset *dset = (icaldirset*)set;
00670 
00671     icalerrorenum error;
00672     char path[ICAL_PATH_MAX];
00673 
00674   error = icaldirset_read_directory(dset);
00675 
00676     if (error != ICAL_NO_ERROR){
00677        icalerror_set_errno(error);
00678        return 0;
00679     }
00680 
00681   dset->directory_iterator = pvl_head(dset->directory);
00682     
00683   if (dset->directory_iterator == 0){
00684        icalerror_set_errno(error);
00685        return 0;
00686     }
00687     
00688   snprintf(path,ICAL_PATH_MAX,"%s/%s",
00689           dset->dir,
00690           (char*)pvl_data(dset->directory_iterator));
00691 
00692     /* If the next cluster we need is different than the current cluster, 
00693        delete the current one and get a new one */
00694 
00695   if(dset->cluster != 0 && strcmp(path,icalcluster_key(dset->cluster)) != 0 ){
00696     icalcluster_free(dset->cluster);
00697     dset->cluster = 0;
00698     }
00699     
00700   if (dset->cluster == 0){
00701     dset->cluster = icalfileset_produce_icalcluster(path);
00702 
00703     if (dset->cluster == 0){
00704            error = icalerrno;
00705        }
00706     } 
00707 
00708     if (error != ICAL_NO_ERROR){
00709        icalerror_set_errno(error);
00710        return 0;
00711     }
00712 
00713   dset->first_component = 1;
00714 
00715   return icaldirset_get_next_component(set);
00716 }
00717 
00718 
00719 icalcomponent* icaldirset_get_next_component(icalset* set)
00720 {
00721   icaldirset *dset = (icaldirset*)set;
00722     icalcomponent *c;
00723     icalerrorenum error;
00724 
00725   icalerror_check_arg_rz( (set!=0), "set");
00726 
00727 
00728   if(dset->cluster == 0){
00729        icalerror_warn("icaldirset_get_next_component called with a NULL cluster (Caller must call icaldirset_get_first_component first");
00730        icalerror_set_errno(ICAL_USAGE_ERROR);
00731        return 0;
00732 
00733     }
00734 
00735     /* Set the component iterator for the following for loop */
00736   if (dset->first_component == 1){
00737     icalcluster_get_first_component(dset->cluster);
00738     dset->first_component = 0;
00739     } else {
00740     icalcluster_get_next_component(dset->cluster);
00741     }
00742 
00743     while(1){
00744        /* Iterate through all of the objects in the cluster*/
00745     for( c = icalcluster_get_current_component(dset->cluster);
00746             c != 0;
00747         c = icalcluster_get_next_component(dset->cluster)){
00748            
00749            /* If there is a gauge defined and the component does not
00750               pass the gauge, skip the rest of the loop */
00751 
00752       if (dset->gauge != 0 && icalgauge_compare(dset->gauge,c) == 0){
00753               continue;
00754            }
00755 
00756            /* Either there is no gauge, or the component passed the
00757               gauge, so return it*/
00758 
00759            return c;
00760        }
00761 
00762        /* Fell through the loop, so the component we want is not
00763           in this cluster. Load a new cluster and try again.*/
00764 
00765     error = icaldirset_next_cluster(dset);
00766 
00767     if(dset->cluster == 0 || error != ICAL_NO_ERROR){
00768            /* No more clusters */
00769            return 0;
00770        } else {
00771       c = icalcluster_get_first_component(dset->cluster);
00772 
00773            return c;
00774        }
00775        
00776     }
00777 
00778     return 0; /* Should never get here */
00779 }
00780 
00781 icalsetiter icaldirset_begin_component(icalset* set, icalcomponent_kind kind, icalgauge* gauge)
00782 {
00783     icalsetiter itr = icalsetiter_null;
00784     icaldirset *fset = (icaldirset*) set;
00785 
00786     icalerror_check_arg_re((fset!=0), "set", icalsetiter_null);
00787 
00788     itr.iter.kind = kind;
00789     itr.gauge = gauge;
00790 
00791     /* TO BE IMPLEMENTED */
00792     return icalsetiter_null;
00793 }
00794 
00795 icalcomponent* icaldirsetiter_to_next(icalset* set, icalsetiter* i)
00796 {
00797     /* TO BE IMPLEMENTED */
00798     return NULL;
00799 }
00800 
00801 icalcomponent* icaldirsetiter_to_prior(icalset* set, icalsetiter* i)
00802 {
00803     /* TO BE IMPLEMENTED */
00804     return NULL;
00805 }