From 383f245d39b8b806a4b6ce4dea7b0ab7f1658450 Mon Sep 17 00:00:00 2001 From: NotZed Date: Thu, 20 Apr 2000 23:48:45 +0000 Subject: MERGE NEW_PARSER branch into HEAD, fixed conflicts. 2000-04-20 NotZed * MERGE NEW_PARSER branch into HEAD, fixed conflicts. * gmime-content-field.c (_print_parameter): Duh, removed again (@@#$@ cvs merge). * camel-mime-utils.c (header_content_type_is): Constify. (header_content_type_unref): Killed a couple warnings. * camel-folder.c (_init): Removed more log crap. * providers/Makefile.am (SUBDIRS): Removed nntp, pending fixes for summary changes. * providers/mbox/camel-mbox-folder.c (_get_message_by_number): Fixed for new summary interface. Added a warning for using this broken api. (_get_message_by_uid): Fixed for message new with session vanishing. svn path=/trunk/; revision=2531 --- camel/providers/mbox/camel-mbox-summary.h | 115 ++++++++++++++---------------- 1 file changed, 54 insertions(+), 61 deletions(-) (limited to 'camel/providers/mbox/camel-mbox-summary.h') diff --git a/camel/providers/mbox/camel-mbox-summary.h b/camel/providers/mbox/camel-mbox-summary.h index f8570f15c0..80b59ef54f 100644 --- a/camel/providers/mbox/camel-mbox-summary.h +++ b/camel/providers/mbox/camel-mbox-summary.h @@ -1,85 +1,78 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ - -/* - * - * Author : Bertrand Guiheneuf +/* + * Copyright (C) 2000 Helix Code Inc. * - * Copyright (C) 1999 Helix Code (http://www.helixcode.com). + * Authors: Michael Zucchi * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of the - * License, or (at your option) any later version. + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public License + * as published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Library General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 - * USA + * You should have received a copy of the GNU Library General Public + * License along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#ifndef MBOX_SUMMARY_H -#define MBOX_SUMMARY_H 1 - -#include - -#define CAMEL_MBOX_SUMMARY_TYPE (camel_mbox_summary_get_type ()) -#define CAMEL_MBOX_SUMMARY(obj) (GTK_CHECK_CAST((obj), CAMEL_MBOX_SUMMARY_TYPE, CamelMboxSummary)) -#define CAMEL_MBOX_SUMMARY_CLASS(k) (GTK_CHECK_CLASS_CAST ((k), CAMEL_MBOX_SUMMARY_TYPE, CamelMboxSummaryClass)) -#define CAMEL_IS_MBOX_SUMMARY(o) (GTK_CHECK_TYPE((o), CAMEL_MBOX_SUMMARY_TYPE)) - - -#define CAMEL_MBOX_SUMMARY_VERSION 1 +#ifndef _CAMEL_MBOX_SUMMARY_H +#define _CAMEL_MBOX_SUMMARY_H +#include +#include +#include typedef struct { - CamelMessageInfo headers; + CamelMessageContentInfo info; - guint32 position; - guint size; - guint x_evolution_offset; - guint32 uid; - guchar status; + /* position in stream of this part */ + off_t pos; + off_t bodypos; + off_t endpos; +} CamelMboxMessageContentInfo; -} CamelMboxSummaryInformation; - - -/* this contains informations about the whole mbox file */ typedef struct { - CamelFolderSummary parent_object; + CamelMessageInfo info; - guint nb_message; /* number of messages in the summary */ - guint32 next_uid; - guint32 mbox_file_size; - guint32 mbox_modtime; + /* position of the xev header, if one exists */ + off_t xev_offset; +} CamelMboxMessageInfo; - GArray *message_info; /* array of CamelMboxSummaryInformation */ +typedef struct { + int dirty; /* if anything has changed */ -} CamelMboxSummary; + char *folder_path; + char *summary_path; + ibex *index; -typedef struct { - CamelFolderSummaryClass parent_class; + GPtrArray *messages; /* array of messages matching mbox order */ + GHashTable *message_uid; /* index to messages by uid */ -} CamelMboxSummaryClass; + int nextuid; + time_t time; /* time/size of folder's last update */ + size_t size; +} CamelMboxSummary; -GtkType camel_mbox_summary_get_type (void); +CamelMboxSummary *camel_mbox_summary_new(const char *summary, const char *folder, ibex *index); +void camel_mbox_summary_unref(CamelMboxSummary *); -void camel_mbox_summary_save (CamelMboxSummary *summary, - const gchar *filename, CamelException *ex); -CamelMboxSummary *camel_mbox_summary_load (const gchar *filename, - CamelException *ex); +int camel_mbox_summary_load(CamelMboxSummary *); +int camel_mbox_summary_save(CamelMboxSummary *); +int camel_mbox_summary_check(CamelMboxSummary *); -gboolean camel_mbox_summary_check_sync (gchar *summary_filename, - gchar *mbox_filename, - CamelException *ex); +guint32 camel_mbox_summary_next_uid(CamelMboxSummary *); +/* set the minimum uid */ +guint32 camel_mbox_summary_set_uid(CamelMboxSummary *s, guint32 uid); -void camel_mbox_summary_append_entries (CamelMboxSummary *summary, - GArray *entries); +CamelMboxMessageInfo *camel_mbox_summary_uid(CamelMboxSummary *s, const char *uid); +CamelMboxMessageInfo *camel_mbox_summary_index(CamelMboxSummary *, int index); +int camel_mbox_summary_message_count(CamelMboxSummary *); +/* TODO: should be in a utility library */ +int camel_mbox_summary_copy_block(int fromfd, int tofd, off_t readpos, size_t bytes); -#endif /* MBOX_SUMMARY_H */ +#endif /* ! _CAMEL_MBOX_SUMMARY_H */ -- cgit v1.2.3