mail-index-open.c revision 73db234f79f77142305b2238d283d97bfc6b8906
c25356d5978632df6203437e1953bcb29e0c736fTimo Sirainen/* Copyright (C) 2002 Timo Sirainen */
d96f86fb881c5b106649e8994ead1052acf24030Timo Sirainenstatic const char *index_file_prefixes[] =
d96f86fb881c5b106649e8994ead1052acf24030Timo Sirainen /* main index */
d96f86fb881c5b106649e8994ead1052acf24030Timo Sirainen for (i = 0; index_file_prefixes[i] != NULL; i++) {
d96f86fb881c5b106649e8994ead1052acf24030Timo Sirainenstatic int read_and_verify_header(int fd, MailIndexHeader *hdr,
d96f86fb881c5b106649e8994ead1052acf24030Timo Sirainen /* read the header */
d96f86fb881c5b106649e8994ead1052acf24030Timo Sirainen if (read(fd, hdr, sizeof(MailIndexHeader)) != sizeof(MailIndexHeader))
68a4946b12583b88fa802e52ebee45cd96056772Timo Sirainen /* check the compatibility */
d96f86fb881c5b106649e8994ead1052acf24030Timo Sirainen return hdr->compat_data[1] == MAIL_INDEX_COMPAT_FLAGS &&
d96f86fb881c5b106649e8994ead1052acf24030Timo Sirainen hdr->compat_data[2] == sizeof(unsigned int) &&
a10ed8c47534b4c6b6bf2711ccfe577e720a47b4Timo Sirainen (!check_version || hdr->compat_data[0] == MAIL_INDEX_VERSION);
27a44fcfd8d19bffe0f267f20a2b5d3fe7600fddTimo Sirainen/* Returns TRUE if we're compatible with given index file. May delete the
27a44fcfd8d19bffe0f267f20a2b5d3fe7600fddTimo Sirainen file if it's from older version. */
27a44fcfd8d19bffe0f267f20a2b5d3fe7600fddTimo Sirainenstatic int mail_check_compatible_index(MailIndex *index, const char *path)
return FALSE;
return compatible;
const char *name;
hostpid_init();
return name;
return name;
return NULL;
return FALSE;
return FALSE;
return FALSE;
return TRUE;
int rebuild;
return FALSE;
return FALSE;
return FALSE;
return FALSE;
return FALSE;
return FALSE;
return FALSE;
return FALSE;
return FALSE;
return FALSE;
return FALSE;
return FALSE;
return FALSE;
return FALSE;
return FALSE;
return TRUE;
return FALSE;
return FALSE;
return FALSE;
return TRUE;
return FALSE;
return FALSE;
return TRUE;
const char *temp_path)
const char *index_path;
return FALSE;
return FALSE;
return FALSE;
return FALSE;
hostpid_init();
return FALSE;
return TRUE;
int update_recent)
const char *path;
int nodiskspace;
return FALSE;
return FALSE;
return TRUE;
return FALSE;
return FALSE;
return FALSE;
return TRUE;
return TRUE;
return FALSE;
return FALSE;
return FALSE;
if (failed)
return FALSE;
return TRUE;