Remove inclusion of sys/socket.h from nntp-thread.c
[claws.git] / src / plugins / mailmbox / mailmbox.h
blob60d25e83ce3cbe5f68f426f4590ab458ac19d14e
1 /*
2 * libEtPan! -- a mail stuff library
4 * Copyright (C) 2001, 2002 - DINH Viet Hoa
5 * All rights reserved.
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
9 * are met:
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
29 * SUCH DAMAGE.
33 * $Id$
36 #ifndef MAILMBOX_H
38 #define MAILMBOX_H
40 #ifdef __cplusplus
41 extern "C" {
42 #endif
44 #include "mailmbox_types.h"
46 int
47 claws_mailmbox_append_message_list(struct claws_mailmbox_folder * folder,
48 carray * append_tab);
50 int
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,
56 size_t * result_len);
58 int claws_mailmbox_fetch_msg_headers(struct claws_mailmbox_folder * folder,
59 uint32_t num, const char ** result,
60 size_t * result_len);
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,
66 carray * tab);
68 int claws_mailmbox_copy_msg(struct claws_mailmbox_folder * dest_folder,
69 struct claws_mailmbox_folder * src_folder,
70 uint32_t uid);
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,
77 int force_readonly,
78 int force_no_uid,
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);
95 /* memory map */
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);
111 /* validate cache */
113 int claws_mailmbox_validate_write_lock(struct claws_mailmbox_folder * folder);
115 int claws_mailmbox_validate_read_lock(struct claws_mailmbox_folder * folder);
118 /* fetch message */
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);
128 /* append message */
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);
136 #ifdef __cplusplus
138 #endif
140 #endif