Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Synchronet
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Main
Synchronet
Commits
a9fe9fe4
Commit
a9fe9fe4
authored
21 years ago
by
rswindell
Browse files
Options
Downloads
Patches
Plain Diff
Added "LogMask" global/per-server ini key.
Using string constants.
parent
c580124e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/sbbs3/sbbs_ini.c
+41
-11
41 additions, 11 deletions
src/sbbs3/sbbs_ini.c
with
41 additions
and
11 deletions
src/sbbs3/sbbs_ini.c
+
41
−
11
View file @
a9fe9fe4
...
...
@@ -140,6 +140,21 @@ static ini_bitdesc_t service_options[] = {
{
-
1
,
NULL
}
};
static
ini_bitdesc_t
log_mask_bits
[]
=
{
{
(
1
<<
LOG_EMERG
)
,
"EMERG"
},
{
(
1
<<
LOG_ALERT
)
,
"ALERT"
},
{
(
1
<<
LOG_CRIT
)
,
"CRIT"
},
{
(
1
<<
LOG_ERR
)
,
"ERR"
},
{
(
1
<<
LOG_WARNING
)
,
"WARNING"
},
{
(
1
<<
LOG_NOTICE
)
,
"NOTICE"
},
{
(
1
<<
LOG_INFO
)
,
"INFO"
},
{
(
1
<<
LOG_DEBUG
)
,
"DEBUG"
},
/* the Gubinator */
{
-
1
,
NULL
}
};
#define DEFAULT_LOG_MASK 0x3f
/* LOG_EMERG|LOG_ALERT|LOG_CRIT|LOG_ERR|LOG_WARNING|LOG_NOTICE */
void
sbbs_get_ini_fname
(
char
*
ini_file
,
char
*
ctrl_dir
,
char
*
host_name
)
{
sprintf
(
ini_file
,
"%s%c%s.ini"
,
ctrl_dir
,
PATH_DELIM
,
host_name
);
...
...
@@ -169,11 +184,15 @@ void sbbs_read_ini(
const
char
*
default_term_ansi
;
const
char
*
default_cgi_temp
;
const
char
*
default_dosemu_path
;
const
char
*
strOptions
=
"Options"
;
const
char
*
strInterface
=
"Interface"
;
const
char
*
strHostName
=
"HostName"
;
const
char
*
strLogMask
=
"LogMask"
;
char
*
ctrl_dir
;
char
*
temp_dir
;
char
host_name
[
128
];
char
value
[
INI_MAX_VALUE_LEN
];
DWORD
log_mask
;
ulong
interface_addr
;
ulong
js_max_bytes
;
ulong
js_cx_stack
;
...
...
@@ -199,9 +218,10 @@ void sbbs_read_ini(
if
(
ftp
!=
NULL
)
SAFECOPY
(
ftp
->
temp_dir
,
temp_dir
);
}
SAFECOPY
(
host_name
,
iniGetString
(
fp
,
section
,
"
HostName
"
,
nulstr
,
value
));
SAFECOPY
(
host_name
,
iniGetString
(
fp
,
section
,
str
HostName
,
nulstr
,
value
));
sem_chk_freq
=
iniGetShortInt
(
fp
,
section
,
strSemFileCheckFrequency
,
0
);
interface_addr
=
iniGetIpAddress
(
fp
,
section
,
strInterface
,
INADDR_ANY
);
log_mask
=
iniGetBitField
(
fp
,
section
,
strLogMask
,
log_mask_bits
,
DEFAULT_LOG_MASK
);
/* Global JavaScript defaults */
js_max_bytes
=
iniGetInteger
(
fp
,
section
,
strJavaScriptMaxBytes
,
JAVASCRIPT_MAX_BYTES
);
...
...
@@ -257,7 +277,7 @@ void sbbs_read_ini(
=
iniGetInteger
(
fp
,
section
,
strJavaScriptYieldInterval
,
js_yield_interval
);
SAFECOPY
(
bbs
->
host_name
,
iniGetString
(
fp
,
section
,
"
HostName
"
,
host_name
,
value
));
,
iniGetString
(
fp
,
section
,
str
HostName
,
host_name
,
value
));
/* Set default terminal type to "stock" termcap closest to "ansi-bbs" */
#if defined(__FreeBSD__)
...
...
@@ -285,8 +305,10 @@ void sbbs_read_ini(
SAFECOPY
(
bbs
->
hangup_sound
,
iniGetString
(
fp
,
section
,
"HangupSound"
,
nulstr
,
value
));
bbs
->
log_mask
=
iniGetBitField
(
fp
,
section
,
strLogMask
,
log_mask_bits
,
log_mask
);
bbs
->
options
=
iniGetBitField
(
fp
,
section
,
"
Options
"
,
bbs_options
=
iniGetBitField
(
fp
,
section
,
str
Options
,
bbs_options
,
BBS_OPT_XTRN_MINIMIZED
|
BBS_OPT_SYSOP_AVAILABLE
);
}
...
...
@@ -318,7 +340,7 @@ void sbbs_read_ini(
=
iniGetInteger
(
fp
,
section
,
strJavaScriptContextStack
,
js_cx_stack
);
SAFECOPY
(
ftp
->
host_name
,
iniGetString
(
fp
,
section
,
"
HostName
"
,
host_name
,
value
));
,
iniGetString
(
fp
,
section
,
str
HostName
,
host_name
,
value
));
SAFECOPY
(
ftp
->
index_file_name
,
iniGetString
(
fp
,
section
,
"IndexFileName"
,
"00index"
,
value
));
...
...
@@ -334,8 +356,10 @@ void sbbs_read_ini(
SAFECOPY
(
ftp
->
hack_sound
,
iniGetString
(
fp
,
section
,
"HackAttemptSound"
,
nulstr
,
value
));
ftp
->
log_mask
=
iniGetBitField
(
fp
,
section
,
strLogMask
,
log_mask_bits
,
log_mask
);
ftp
->
options
=
iniGetBitField
(
fp
,
section
,
"
Options
"
,
ftp_options
=
iniGetBitField
(
fp
,
section
,
str
Options
,
ftp_options
,
FTP_OPT_INDEX_FILE
|
FTP_OPT_HTML_INDEX_FILE
|
FTP_OPT_ALLOW_QWK
);
}
...
...
@@ -373,7 +397,7 @@ void sbbs_read_ini(
=
iniGetInteger
(
fp
,
section
,
"MaxMsgSize"
,
10
*
1024
*
1024
);
/* 10MB */
SAFECOPY
(
mail
->
host_name
,
iniGetString
(
fp
,
section
,
"
HostName
"
,
host_name
,
value
));
,
iniGetString
(
fp
,
section
,
str
HostName
,
host_name
,
value
));
SAFECOPY
(
mail
->
relay_server
,
iniGetString
(
fp
,
section
,
"RelayServer"
,
mail
->
relay_server
,
value
));
...
...
@@ -398,8 +422,10 @@ void sbbs_read_ini(
SAFECOPY
(
mail
->
proc_cfg_file
,
iniGetString
(
fp
,
section
,
"ProcessConfigFile"
,
"mailproc.cfg"
,
value
));
mail
->
log_mask
=
iniGetBitField
(
fp
,
section
,
strLogMask
,
log_mask_bits
,
log_mask
);
mail
->
options
=
iniGetBitField
(
fp
,
section
,
"
Options
"
,
mail_options
=
iniGetBitField
(
fp
,
section
,
str
Options
,
mail_options
,
MAIL_OPT_ALLOW_POP3
);
}
...
...
@@ -430,7 +456,7 @@ void sbbs_read_ini(
=
iniGetInteger
(
fp
,
section
,
strJavaScriptYieldInterval
,
js_yield_interval
);
SAFECOPY
(
services
->
host_name
,
iniGetString
(
fp
,
section
,
"
HostName
"
,
host_name
,
value
));
,
iniGetString
(
fp
,
section
,
str
HostName
,
host_name
,
value
));
SAFECOPY
(
services
->
ini_file
,
iniGetString
(
fp
,
section
,
"iniFile"
,
"services.ini"
,
value
));
...
...
@@ -443,8 +469,10 @@ void sbbs_read_ini(
SAFECOPY
(
services
->
hangup_sound
,
iniGetString
(
fp
,
section
,
"HangupSound"
,
nulstr
,
value
));
services
->
log_mask
=
iniGetBitField
(
fp
,
section
,
strLogMask
,
log_mask_bits
,
log_mask
);
services
->
options
=
iniGetBitField
(
fp
,
section
,
"
Options
"
,
service_options
=
iniGetBitField
(
fp
,
section
,
str
Options
,
service_options
,
BBS_OPT_NO_HOST_LOOKUP
);
}
...
...
@@ -470,7 +498,7 @@ void sbbs_read_ini(
=
iniGetInteger
(
fp
,
section
,
strJavaScriptContextStack
,
js_cx_stack
);
SAFECOPY
(
web
->
host_name
,
iniGetString
(
fp
,
section
,
"
HostName
"
,
host_name
,
value
));
,
iniGetString
(
fp
,
section
,
str
HostName
,
host_name
,
value
));
SAFECOPY
(
web
->
root_dir
,
iniGetString
(
fp
,
section
,
"RootDirectory"
,
"../html"
,
value
));
...
...
@@ -496,8 +524,10 @@ void sbbs_read_ini(
SAFECOPY
(
web
->
cgi_temp_dir
,
iniGetString
(
fp
,
section
,
"CGITempDirectory"
,
default_cgi_temp
,
value
));
web
->
log_mask
=
iniGetBitField
(
fp
,
section
,
strLogMask
,
log_mask_bits
,
log_mask
);
web
->
options
=
iniGetBitField
(
fp
,
section
,
"
Options
"
,
web_options
=
iniGetBitField
(
fp
,
section
,
str
Options
,
web_options
,
BBS_OPT_NO_HOST_LOOKUP
);
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment