author | zautrix <zautrix> | 2004-09-01 10:23:29 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-09-01 10:23:29 (UTC) |
commit | 6cefbdc9c8f3f3001373f10715361e2740c45395 (patch) (unidiff) | |
tree | cb2c36f57620e698913c27ca4ebe59e4a7c9d46e /kmicromail/libetpan/mbox/mailmbox_types.c | |
parent | b9257cb225cd29bab5d96fcdaf557926603ee587 (diff) | |
download | kdepimpi-6cefbdc9c8f3f3001373f10715361e2740c45395.zip kdepimpi-6cefbdc9c8f3f3001373f10715361e2740c45395.tar.gz kdepimpi-6cefbdc9c8f3f3001373f10715361e2740c45395.tar.bz2 |
Mail fixes and libetpan updated
Diffstat (limited to 'kmicromail/libetpan/mbox/mailmbox_types.c') (more/less context) (ignore whitespace changes)
-rw-r--r-- | kmicromail/libetpan/mbox/mailmbox_types.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/kmicromail/libetpan/mbox/mailmbox_types.c b/kmicromail/libetpan/mbox/mailmbox_types.c index 1986182..4e3e521 100644 --- a/kmicromail/libetpan/mbox/mailmbox_types.c +++ b/kmicromail/libetpan/mbox/mailmbox_types.c | |||
@@ -133,97 +133,98 @@ mailmbox_msg_info_new(size_t msg_start, size_t msg_start_len, | |||
133 | 133 | ||
134 | info = malloc(sizeof(* info)); | 134 | info = malloc(sizeof(* info)); |
135 | if (info == NULL) | 135 | if (info == NULL) |
136 | return NULL; | 136 | return NULL; |
137 | 137 | ||
138 | info->msg_index = 0; | 138 | info->msg_index = 0; |
139 | info->msg_uid = msg_uid; | 139 | info->msg_uid = msg_uid; |
140 | if (msg_uid != 0) | 140 | if (msg_uid != 0) |
141 | info->msg_written_uid = TRUE; | 141 | info->msg_written_uid = TRUE; |
142 | else | 142 | else |
143 | info->msg_written_uid = FALSE; | 143 | info->msg_written_uid = FALSE; |
144 | info->msg_deleted = FALSE; | 144 | info->msg_deleted = FALSE; |
145 | 145 | ||
146 | info->msg_start = msg_start; | 146 | info->msg_start = msg_start; |
147 | info->msg_start_len = msg_start_len; | 147 | info->msg_start_len = msg_start_len; |
148 | 148 | ||
149 | info->msg_headers = msg_headers; | 149 | info->msg_headers = msg_headers; |
150 | info->msg_headers_len = msg_headers_len; | 150 | info->msg_headers_len = msg_headers_len; |
151 | 151 | ||
152 | info->msg_body = msg_body; | 152 | info->msg_body = msg_body; |
153 | info->msg_body_len = msg_body_len; | 153 | info->msg_body_len = msg_body_len; |
154 | 154 | ||
155 | info->msg_size = msg_size; | 155 | info->msg_size = msg_size; |
156 | 156 | ||
157 | info->msg_padding = msg_padding; | 157 | info->msg_padding = msg_padding; |
158 | 158 | ||
159 | return info; | 159 | return info; |
160 | } | 160 | } |
161 | 161 | ||
162 | void mailmbox_msg_info_free(struct mailmbox_msg_info * info) | 162 | void mailmbox_msg_info_free(struct mailmbox_msg_info * info) |
163 | { | 163 | { |
164 | free(info); | 164 | free(info); |
165 | } | 165 | } |
166 | 166 | ||
167 | 167 | ||
168 | /* append info */ | 168 | /* append info */ |
169 | 169 | ||
170 | struct mailmbox_append_info * | 170 | struct mailmbox_append_info * |
171 | mailmbox_append_info_new(const char * ai_message, size_t ai_size) | 171 | mailmbox_append_info_new(const char * ai_message, size_t ai_size) |
172 | { | 172 | { |
173 | struct mailmbox_append_info * info; | 173 | struct mailmbox_append_info * info; |
174 | 174 | ||
175 | info = malloc(sizeof(* info)); | 175 | info = malloc(sizeof(* info)); |
176 | if (info == NULL) | 176 | if (info == NULL) |
177 | return NULL; | 177 | return NULL; |
178 | 178 | ||
179 | info->ai_message = ai_message; | 179 | info->ai_message = ai_message; |
180 | info->ai_size = ai_size; | 180 | info->ai_size = ai_size; |
181 | 181 | info->ai_uid = 0; | |
182 | |||
182 | return info; | 183 | return info; |
183 | } | 184 | } |
184 | 185 | ||
185 | void mailmbox_append_info_free(struct mailmbox_append_info * info) | 186 | void mailmbox_append_info_free(struct mailmbox_append_info * info) |
186 | { | 187 | { |
187 | free(info); | 188 | free(info); |
188 | } | 189 | } |
189 | 190 | ||
190 | struct mailmbox_folder * mailmbox_folder_new(const char * mb_filename) | 191 | struct mailmbox_folder * mailmbox_folder_new(const char * mb_filename) |
191 | { | 192 | { |
192 | struct mailmbox_folder * folder; | 193 | struct mailmbox_folder * folder; |
193 | 194 | ||
194 | folder = malloc(sizeof(* folder)); | 195 | folder = malloc(sizeof(* folder)); |
195 | if (folder == NULL) | 196 | if (folder == NULL) |
196 | goto err; | 197 | goto err; |
197 | 198 | ||
198 | strncpy(folder->mb_filename, mb_filename, PATH_MAX); | 199 | strncpy(folder->mb_filename, mb_filename, PATH_MAX); |
199 | 200 | ||
200 | folder->mb_mtime = (time_t) -1; | 201 | folder->mb_mtime = (time_t) -1; |
201 | 202 | ||
202 | folder->mb_fd = -1; | 203 | folder->mb_fd = -1; |
203 | folder->mb_read_only = TRUE; | 204 | folder->mb_read_only = TRUE; |
204 | folder->mb_no_uid = TRUE; | 205 | folder->mb_no_uid = TRUE; |
205 | 206 | ||
206 | folder->mb_changed = FALSE; | 207 | folder->mb_changed = FALSE; |
207 | folder->mb_deleted_count = 0; | 208 | folder->mb_deleted_count = 0; |
208 | 209 | ||
209 | folder->mb_mapping = NULL; | 210 | folder->mb_mapping = NULL; |
210 | folder->mb_mapping_size = 0; | 211 | folder->mb_mapping_size = 0; |
211 | 212 | ||
212 | folder->mb_written_uid = 0; | 213 | folder->mb_written_uid = 0; |
213 | folder->mb_max_uid = 0; | 214 | folder->mb_max_uid = 0; |
214 | 215 | ||
215 | folder->mb_hash = chash_new(CHASH_DEFAULTSIZE, CHASH_COPYKEY); | 216 | folder->mb_hash = chash_new(CHASH_DEFAULTSIZE, CHASH_COPYKEY); |
216 | if (folder->mb_hash == NULL) | 217 | if (folder->mb_hash == NULL) |
217 | goto free; | 218 | goto free; |
218 | 219 | ||
219 | folder->mb_tab = carray_new(128); | 220 | folder->mb_tab = carray_new(128); |
220 | if (folder->mb_tab == NULL) | 221 | if (folder->mb_tab == NULL) |
221 | goto free_hash; | 222 | goto free_hash; |
222 | 223 | ||
223 | return folder; | 224 | return folder; |
224 | 225 | ||
225 | free_hash: | 226 | free_hash: |
226 | chash_free(folder->mb_hash); | 227 | chash_free(folder->mb_hash); |
227 | free: | 228 | free: |
228 | free(folder); | 229 | free(folder); |
229 | err: | 230 | err: |