Skip to content
Snippets Groups Projects
Commit 3459e759 authored by rswindell's avatar rswindell
Browse files

Added file.cnf support (Nightfox, you could use this for your filearea-lb

module).
Also fixed a couple of field names (to match the Sync-JS model) in the
msgs.cnf representation (e.g. op_ars -> operator_ars).
parent dd0149e3
Branches
Tags
No related merge requests found
......@@ -3,11 +3,12 @@
*/
/* miscellaneous constants required for cnf parsing
(if adding definitions to this file, make sure the required
constants are defined... if not, add them */
(if adding definitions to this file, make sure the required
constants are defined... if not, add them)
*/
/* Note: rev 1.3 (and earlier) of this file used field names derived from the
* C/C++ source code (sbbsdefs.h), while rev 1.4 and later now use field
* C/C++ source code (scfgdefs.h), while rev 1.4 and later now use field
* names which correlate with the Synchronet JS object model (jsobjs.html).
*/
......@@ -111,7 +112,7 @@ struct.sub_t={
ars: {bytes:LEN_ARSTR+1, type:"str"}, // was arstr
read_ars: {bytes:LEN_ARSTR+1, type:"str"}, // was read_arstr
post_ars: {bytes:LEN_ARSTR+1, type:"str"}, // was post_arstr
op_ars: {bytes:LEN_ARSTR+1, type:"str"}, // was op_arstr
operator_ars: {bytes:LEN_ARSTR+1, type:"str"}, // was op_arstr
// uchar *ar,
// *read_ar,
// *post_ar,
......@@ -126,7 +127,7 @@ struct.sub_t={
max_crcs: {bytes:UINT32_T, type:"int"}, // was maxcrcs
max_age: {bytes:UINT16_T, type:"int"}, // was maxage
ptridx: {bytes:UINT16_T, type:"int"},
mod_ars: {bytes:LEN_ARSTR+1, type:"str"}, // was mod_arstr
moderated_ars: {bytes:LEN_ARSTR+1, type:"str"}, // was mod_arstr
// *mod_ar;
qwk_conf: {bytes:UINT16_T, type:"int"}, // was qwkconf
__PADDING__:53
......@@ -225,4 +226,135 @@ struct.msg={
inetmail_cost: {bytes:UINT32_T, type:"str"},
smtpmail_sem: {bytes:LEN_DIR+1, type:"str"}
};
/************/
/* file.cnf */
/************/
struct.dir_t={
lib_number: {bytes:UINT16_T, type:"int"},
description: {bytes:LEN_SLNAME+1, type:"str"},
name: {bytes:LEN_SSNAME+1, type:"str"},
code_suffix: {bytes:LEN_CODE+1, type:"str"},
data_dir: {bytes:LEN_DIR+1, type:"str"},
ars: {bytes:LEN_ARSTR+1, type:"str"},
upload_ars: {bytes:LEN_ARSTR+1, type:"str"},
download_ars: {bytes:LEN_ARSTR+1, type:"str"},
operator_ars: {bytes:LEN_ARSTR+1, type:"str"},
path: {bytes:LEN_DIR+1, type:"str"},
upload_sem: {bytes:LEN_DIR+1, type:"str"},
max_files: {bytes:UINT16_T, type:"int"},
extensions: {bytes:41, type:"str"},
settings: {bytes:UINT32_T, type:"int"},
seq_dev: {bytes:1, type:"int"}, // seqdev
sort: {bytes:1, type:"int"},
exempt_ars: {bytes:LEN_ARSTR+1, type:"str"},
max_age: {bytes:UINT16_T, type:"int"},
upload_pct: {bytes:UINT16_T, type:"int"},
download_pct: {bytes:UINT16_T, type:"int"},
__PADDING__:49
};
struct.lib_t={
description: {bytes:LEN_GLNAME+1, type:"str"},
name: {bytes:LEN_GSNAME+1, type:"str"},
ars: {bytes:LEN_ARSTR+1, type:"str"},
parent_path: {bytes:48, type:"str"},
code_prefix: {bytes:LEN_CODE+1, type:"str"},
sort: {bytes:1, type:"int"},
settings: {bytes:UINT32_T, type:"int"},
__PADDING__:34
};
/* Extractable File Types */
struct.fextr_t={
extension: {bytes:4, type:"str"},
cmd: {bytes:LEN_CMD+1, type:"str"},
ars: {bytes:LEN_ARSTR+1, type:"str"},
__PADDING__:16
};
/* Compressable File Types */
struct.fcomp_t={
extension: {bytes:4, type:"str"},
cmd: {bytes:LEN_CMD+1, type:"str"},
ars: {bytes:LEN_ARSTR+1, type:"str"},
__PADDING__:16
};
/* Viewable File Types */
struct.fview_t={
extension: {bytes:4, type:"str"},
cmd: {bytes:LEN_CMD+1, type:"str"},
ars: {bytes:LEN_ARSTR+1, type:"str"},
__PADDING__:16
};
/* Testable File Types */
struct.ftest_t={
extension: {bytes:4, type:"str"},
cmd: {bytes:LEN_CMD+1, type:"str"},
working: {bytes:41, type:"str"},
ars: {bytes:LEN_ARSTR+1, type:"str"},
__PADDING__:16
};
/* Download Events */
struct.dlevent_t={
extension: {bytes:4, type:"str"},
cmd: {bytes:LEN_CMD+1, type:"str"},
working: {bytes:41, type:"str"},
ars: {bytes:LEN_ARSTR+1, type:"str"},
__PADDING__:16
};
/* File Transfer Protocol (drivers) */
struct.prot_t={
mnemonic: {bytes:1, type:"str"},
name: {bytes:26, type:"str"},
ulcmd: {bytes:LEN_CMD+1, type:"str"},
dlcmd: {bytes:LEN_CMD+1, type:"str"},
batulcmd: {bytes:LEN_CMD+1, type:"str"},
batdlcmd: {bytes:LEN_CMD+1, type:"str"},
blindcmd: {bytes:LEN_CMD+1, type:"str"}, // unused
bicmd: {bytes:LEN_CMD+1, type:"str"},
settings: {bytes:UINT32_T, type:"int"}, // misc
ars: {bytes:LEN_ARSTR+1, type:"str"},
__PADDING__:16
};
struct.altpath_t={
path: {bytes:LEN_DIR+1, type:"str"},
__PADDING__:16
};
struct.txtsec_t={
name: {bytes:41, type:"str"},
code: {bytes:LEN_CODE+1, type:"str"},
ars: {bytes:LEN_ARSTR+1, type:"str"},
__PADDING__:16
};
/* file transfer configuration (file.cnf) */
struct.file={
min_dspace: {bytes:UINT16_T, type:"int"},
max_batup: {bytes:UINT16_T, type:"int"},
max_batdn: {bytes:UINT16_T, type:"int"},
max_userxfer: {bytes:UINT16_T, type:"int"},
__PADDING1__:4,
cdt_up_pct: {bytes:UINT16_T, type:"int"},
cdt_dn_pct: {bytes:UINT16_T, type:"int"},
__PADDING2__:68,
leech_pct: {bytes:UINT16_T, type:"int"},
leech_sec: {bytes:UINT16_T, type:"int"},
settings: {bytes:UINT32_T, type:"int"},
__PADDING3__:60,
fextr: {bytes:struct.fextr_t, type:"lst"},
fcomp: {bytes:struct.fcomp_t, type:"lst"},
fview: {bytes:struct.fview_t, type:"lst"},
ftest: {bytes:struct.ftest_t, type:"lst"},
dlevent: {bytes:struct.dlevent_t,type:"lst"},
prot: {bytes:struct.prot_t, type:"lst"},
altpath: {bytes:struct.altpath_t,type:"lst"},
lib: {bytes:struct.lib_t, type:"lst"},
dir: {bytes:struct.dir_t, type:"lst"},
txtsec: {bytes:struct.txtsec_t, type:"lst"},
};
\ No newline at end of file
/* CNF data structure definitions (see scfglib2.c)
/* CNF data structure definitions (see scfglib2.c, scfgdefs.h)
$Id$
*/
......@@ -51,7 +51,7 @@ var CNF = new (function() {
setStr(file,bytes,"");
}
/* read a set of records from xtrn.cnf */
/* read a set of records from *.cnf */
function readArray(file,struct,length) {
var list = [];
if(length == undefined)
......@@ -116,7 +116,7 @@ var CNF = new (function() {
return list;
}
/* write a set of records to xtrn.cnf */
/* write a set of records to *.cnf */
function writeArray(file,struct,length,records) {
if(length == undefined) {
setInt(file,UINT16_T,records.length);
......@@ -191,6 +191,9 @@ var CNF = new (function() {
case "msgs.cnf":
struct = js.global.struct.msg;
break;
case "file.cnf":
struct = js.global.struct.file;
break;
default:
return false;
}
......@@ -215,6 +218,9 @@ var CNF = new (function() {
case "msgs.cnf":
struct = js.global.struct.msg;
break;
case "file.cnf":
struct = js.global.struct.file;
break;
default:
return false;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment