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
44 #include "mailmbox_types.h"
47 claws_mailmbox_append_message_list(struct claws_mailmbox_folder
* folder
,
51 claws_mailmbox_append_message(struct claws_mailmbox_folder
* folder
,
52 const char * data
, size_t len
);
54 int claws_mailmbox_fetch_msg(struct claws_mailmbox_folder
* folder
,
55 uint32_t num
, const char ** result
,
58 int claws_mailmbox_fetch_msg_headers(struct claws_mailmbox_folder
* folder
,
59 uint32_t num
, const char ** result
,
62 void claws_mailmbox_fetch_result_free(char * msg
);
64 int claws_mailmbox_copy_msg_list(struct claws_mailmbox_folder
* dest_folder
,
65 struct claws_mailmbox_folder
* src_folder
,
68 int claws_mailmbox_copy_msg(struct claws_mailmbox_folder
* dest_folder
,
69 struct claws_mailmbox_folder
* src_folder
,
72 int claws_mailmbox_expunge(struct claws_mailmbox_folder
* folder
);
74 int claws_mailmbox_delete_msg(struct claws_mailmbox_folder
* folder
, uint32_t uid
);
76 int claws_mailmbox_init(const char * filename
,
79 uint32_t default_written_uid
,
80 struct claws_mailmbox_folder
** result_folder
);
82 void claws_mailmbox_done(struct claws_mailmbox_folder
* folder
);
84 /* low-level access primitives */
86 int claws_mailmbox_write_lock(struct claws_mailmbox_folder
* folder
);
88 int claws_mailmbox_write_unlock(struct claws_mailmbox_folder
* folder
);
90 int claws_mailmbox_read_lock(struct claws_mailmbox_folder
* folder
);
92 int claws_mailmbox_read_unlock(struct claws_mailmbox_folder
* folder
);
97 int claws_mailmbox_map(struct claws_mailmbox_folder
* folder
);
99 void claws_mailmbox_unmap(struct claws_mailmbox_folder
* folder
);
101 void claws_mailmbox_sync(struct claws_mailmbox_folder
* folder
);
104 /* open & close file */
106 int claws_mailmbox_open(struct claws_mailmbox_folder
* folder
);
108 void claws_mailmbox_close(struct claws_mailmbox_folder
* folder
);
113 int claws_mailmbox_validate_write_lock(struct claws_mailmbox_folder
* folder
);
115 int claws_mailmbox_validate_read_lock(struct claws_mailmbox_folder
* folder
);
120 int claws_mailmbox_fetch_msg_no_lock(struct claws_mailmbox_folder
* folder
,
121 uint32_t num
, const char ** result
,
122 size_t * result_len
);
124 int claws_mailmbox_fetch_msg_headers_no_lock(struct claws_mailmbox_folder
* folder
,
125 uint32_t num
, const char ** result
,
126 size_t * result_len
);
131 claws_mailmbox_append_message_list_no_lock(struct claws_mailmbox_folder
* folder
,
132 carray
* append_tab
);
134 int claws_mailmbox_expunge_no_lock(struct claws_mailmbox_folder
* folder
);