Synchronet now requires the libarchive development package (e.g. libarchive-dev on Debian-based Linux distros, libarchive.org for more info) to build successfully.

Commit 06332908 authored by rswindell's avatar rswindell

New convenience function: smb_storage_mode(), returns the correct storage

mode for a specified message base (mail or sub-board). This logic exists in
many other files and can now be consolidated using this single function.
parent 1d642d12
/* scfglib.h */
/* Synchronet configuration library routine prototypes */
/* $Id$ */
......@@ -8,7 +6,7 @@
* @format.tab-size 4 (Plain Text/Source Code File Header) *
* @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) *
* *
* Copyright 2004 Rob Swindell - http://www.synchro.net/copyright.html *
* Copyright Rob Swindell - http://www.synchro.net/copyright.html *
* *
* This program is free software; you can redistribute it and/or *
* modify it under the terms of the GNU General Public License *
......@@ -88,6 +86,8 @@ long aftol(char *str); /* Converts flag string to long */
char* ltoaf(long l, char *str); /* Converts long to flag string */
uchar attrstr(char *str); /* Convert ATTR string into attribute int */
int smb_storage_mode(scfg_t*, smb_t*);
#ifdef __cplusplus
}
#endif
......
/* scfglib1.c */
/* Synchronet configuration library routines */
/* $Id$ */
......@@ -847,3 +845,18 @@ void make_data_dirs(scfg_t* cfg)
}
#endif
}
int smb_storage_mode(scfg_t* cfg, smb_t* smb)
{
if(smb->subnum == INVALID_SUB)
return (cfg->sys_misc&SM_FASTMAIL) ? SMB_FASTALLOC : SMB_SELFPACK;
if(smb->subnum >= cfg->total_subs)
return -1;
if(cfg->sub[smb->subnum]->misc&SUB_HYPER) {
smb->status.attr |= SMB_HYPERALLOC;
return SMB_HYPERALLOC;
}
if(cfg->sub[smb->subnum]->misc&SUB_FAST)
return SMB_FASTALLOC;
return SMB_SELFPACK;
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment