2000-02-22 bertrand <Bertrand.Guiheneuf@aful.org> * message-list.c (message_list_set_folder): fix to show a sample correct implementation. * camel-folder.c (camel_folder_get_subfolder): (camel_folder_create): (camel_folder_delete): (camel_folder_delete_messages): (camel_folder_list_subfolders): (camel_folder_expunge): (camel_folder_get_message_by_number): (camel_folder_get_message_count): (camel_folder_append_message): (camel_folder_copy_message_to): (camel_folder_get_summary): (camel_folder_get_message_uid): (camel_folder_get_message_by_uid): (camel_folder_get_uid_list): Check folder state (open/close) and raise an exception if it is not ok. * providers/mbox/camel-mbox-folder.c (_create): create the file and the path with two different names. * camel-folder.c (_create): handle the case when the folder name starts with '/' * camel-exception.c (camel_exception_new): use (void) instead of () in decl. * camel-exception.h: cosmetic fixes. * camel-exception.c (camel_exception_init): new routine. Fix a bug in mail/message-list.c * camel-folder.h: cosmetic changes. * camel-stream-b64.c (reset__static): added a reset method. Thanks message-browser to find so much bugs :) * providers/mbox/Makefile.am (libcamelmbox_la_LIBADD): readd Unicode libs. Fixes and exception handling in camel-folder. Fixes in mail/evolution-mail to make it not segfault and to demonstrate a correct implementation. svn path=/trunk/; revision=1902
90 lines
2.4 KiB
C
90 lines
2.4 KiB
C
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
|
|
/* camel-execpetion.h : exception utils */
|
|
|
|
/*
|
|
*
|
|
* Author :
|
|
* Bertrand Guiheneuf <bertrand@helixcode.com>
|
|
*
|
|
* Copyright 1999, 2000 HelixCode (http://www.helixcode.com) .
|
|
*
|
|
* 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 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.
|
|
*
|
|
* 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
|
|
*/
|
|
|
|
|
|
|
|
#ifndef CAMEL_EXCEPTION_H
|
|
#define CAMEL_EXCEPTION_H 1
|
|
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#pragma }
|
|
#endif /* __cplusplus }*/
|
|
|
|
#include <glib.h>
|
|
#include "camel-types.h"
|
|
|
|
typedef enum {
|
|
#include "camel-exception-list.def"
|
|
|
|
} ExceptionId;
|
|
|
|
|
|
struct _CamelException {
|
|
/* do not access the fields directly */
|
|
ExceptionId id;
|
|
char *desc;
|
|
|
|
};
|
|
|
|
|
|
|
|
/* creation and destruction functions */
|
|
CamelException * camel_exception_new (void);
|
|
void camel_exception_free (CamelException *exception);
|
|
void camel_exception_init (CamelException *ex);
|
|
|
|
|
|
/* exception content manipulation */
|
|
void camel_exception_clear (CamelException *exception);
|
|
void camel_exception_set (CamelException *ex,
|
|
ExceptionId id,
|
|
const char *desc);
|
|
void camel_exception_setv (CamelException *ex,
|
|
ExceptionId id,
|
|
const char *format,
|
|
...);
|
|
|
|
|
|
/* exception content transfer */
|
|
void camel_exception_xfer (CamelException *ex_dst,
|
|
CamelException *ex_src);
|
|
|
|
|
|
/* exception content retrieval */
|
|
ExceptionId camel_exception_get_id (CamelException *ex);
|
|
const gchar * camel_exception_get_description (CamelException *ex);
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif /* __cplusplus */
|
|
|
|
#endif /* CAMEL_EXCEPTION_H */
|
|
|