view src/lib-index/mail-index-util.h @ 221:ed0d5b17c7a4 HEAD

Added extra functions for easier printing of error messages. Moved file_set_size() to generic function in lib. If there's no space to build hash file, it builds itself in anon-mmaped memory and stays there.
author Timo Sirainen <tss@iki.fi>
date Fri, 13 Sep 2002 03:01:23 +0300
parents ff05b320482c
children cf4d065f2f85
line wrap: on
line source

#ifndef __MAIL_INDEX_UTIL_H
#define __MAIL_INDEX_UTIL_H

/* Set the current error message */
void index_set_error(MailIndex *index, const char *fmt, ...)
	__attr_format__(2, 3);

/* "Error in index file %s: ...". Also marks the index file as corrupted. */
void index_set_corrupted(MailIndex *index, const char *fmt, ...);

/* "%s failed with index file %s: %m" */
void index_set_syscall_error(MailIndex *index, const char *function);

/* Reset the current error */
void index_reset_error(MailIndex *index);

/* Create temporary file into index's directory. Returns opened file handle
   and sets *path to the full path of the created file.  */
int mail_index_create_temp_file(MailIndex *index, const char **path);

/* Calculates virtual size for specified message. If the fastscan is FALSE
   and the size can't be figured out from headers, the message is opened and
   fully scanned to calculate the size. Returns TRUE if size was successfully
   got. */
int mail_index_get_virtual_size(MailIndex *index, MailIndexRecord *rec,
				int fastscan, uoff_t *virtual_size);

#endif