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
36 #ifndef MAILMBOX_TYPES_H
38 #define MAILMBOX_TYPES_H
44 #include <sys/types.h>
51 MAILMBOX_NO_ERROR = 0,
54 MAILMBOX_ERROR_FILE_NOT_FOUND,
55 MAILMBOX_ERROR_MEMORY,
56 MAILMBOX_ERROR_TEMPORARY_FILE,
58 MAILMBOX_ERROR_MSG_NOT_FOUND,
59 MAILMBOX_ERROR_READONLY,
63 struct mailmbox_folder {
64 char filename[PATH_MAX];
85 struct mailmbox_folder * mailmbox_folder_new(char * filename);
86 void mailmbox_folder_free(struct mailmbox_folder * folder);
89 struct mailmbox_msg_info {
110 int mailmbox_msg_info_update(struct mailmbox_folder * folder,
111 size_t start, size_t start_len,
112 size_t headers, size_t headers_len,
113 size_t body, size_t body_len,
114 size_t size, size_t padding,
117 struct mailmbox_msg_info *
118 mailmbox_msg_info_new(size_t start, size_t start_len,
119 size_t headers, size_t headers_len,
120 size_t body, size_t body_len,
121 size_t size, size_t padding,
124 void mailmbox_msg_info_free(struct mailmbox_msg_info * info);
126 struct mailmbox_append_info {
131 struct mailmbox_append_info *
132 mailmbox_append_info_new(char * message, size_t size);
134 void mailmbox_append_info_free(struct mailmbox_append_info * info);