2 * libEtPan! -- a mail stuff library
4 * Copyright (C) 2001, 2002 - DINH Viet Hoa
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
15 * 3. Neither the name of the libEtPan! project nor the names of its
16 * contributors may be used to endorse or promote products derived
17 * from this software without specific prior written permission.
19 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
20 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
23 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 #ifndef MAILMBOX_TYPES_H
34 #define MAILMBOX_TYPES_H
40 #include <sys/types.h>
43 /* The Hurd doesn't have this limit */
53 MAILMBOX_NO_ERROR = 0,
56 MAILMBOX_ERROR_FILE_NOT_FOUND,
57 MAILMBOX_ERROR_MEMORY,
58 MAILMBOX_ERROR_TEMPORARY_FILE,
60 MAILMBOX_ERROR_MSG_NOT_FOUND,
61 MAILMBOX_ERROR_READONLY,
65 struct claws_mailmbox_folder {
66 char mb_filename[PATH_MAX];
75 unsigned int mb_deleted_count;
78 size_t mb_mapping_size;
80 uint32_t mb_written_uid;
87 struct claws_mailmbox_folder * claws_mailmbox_folder_new(const char * mb_filename);
88 void claws_mailmbox_folder_free(struct claws_mailmbox_folder * folder);
91 struct claws_mailmbox_msg_info {
92 unsigned int msg_index;
101 size_t msg_headers_len;
112 int claws_mailmbox_msg_info_update(struct claws_mailmbox_folder * folder,
113 size_t msg_start, size_t msg_start_len,
114 size_t msg_headers, size_t msg_headers_len,
115 size_t msg_body, size_t msg_body_len,
116 size_t msg_size, size_t msg_padding,
119 struct claws_mailmbox_msg_info *
120 claws_mailmbox_msg_info_new(size_t msg_start, size_t msg_start_len,
121 size_t msg_headers, size_t msg_headers_len,
122 size_t msg_body, size_t msg_body_len,
123 size_t msg_size, size_t msg_padding,
126 void claws_mailmbox_msg_info_free(struct claws_mailmbox_msg_info * info);
128 struct claws_mailmbox_append_info {
129 const char * ai_message;
133 struct claws_mailmbox_append_info *
134 claws_mailmbox_append_info_new(const char * ai_message, size_t ai_size);
136 void claws_mailmbox_append_info_free(struct claws_mailmbox_append_info * info);