Commit 1ffa4404 authored by rswindell's avatar rswindell

Move sysop_available() and set_sysop_availability() from chat.cpp to userdat.c

so they can be more easily used by external utils (e.g. umonitor).
parent 4d43c044
......@@ -692,25 +692,6 @@ void sbbs_t::chatsection()
// free(gurubuf);
}
static char* sysop_available_semfile(scfg_t* scfg)
{
static char semfile[MAX_PATH+1];
SAFEPRINTF(semfile, "%ssysavail.chat", scfg->ctrl_dir);
return semfile;
}
extern "C" BOOL DLLCALL sysop_available(scfg_t* scfg)
{
return fexist(sysop_available_semfile(scfg));
}
extern "C" BOOL DLLCALL set_sysop_availability(scfg_t* scfg, BOOL available)
{
if(available)
return ftouch(sysop_available_semfile(scfg));
return remove(sysop_available_semfile(scfg)) == 0;
}
/****************************************************************************/
/****************************************************************************/
bool sbbs_t::sysop_page(void)
......
......@@ -1027,10 +1027,6 @@ extern "C" {
DLLEXPORT int DLLCALL sbbs_random(int);
DLLEXPORT void DLLCALL sbbs_srand(void);
/* chat.cpp */
DLLEXPORT BOOL DLLCALL sysop_available(scfg_t*);
DLLEXPORT BOOL DLLCALL set_sysop_availability(scfg_t*, BOOL available);
/* getstats.c */
DLLEXPORT BOOL DLLCALL getstats(scfg_t* cfg, char node, stats_t* stats);
DLLEXPORT ulong DLLCALL getposts(scfg_t* cfg, uint subnum);
......
......@@ -3193,3 +3193,22 @@ BOOL DLLCALL fixmsgptrs(scfg_t* cfg, subscan_t* subscan)
}
return TRUE;
}
static char* sysop_available_semfile(scfg_t* scfg)
{
static char semfile[MAX_PATH+1];
SAFEPRINTF(semfile, "%ssysavail.chat", scfg->ctrl_dir);
return semfile;
}
BOOL DLLCALL sysop_available(scfg_t* scfg)
{
return fexist(sysop_available_semfile(scfg));
}
BOOL DLLCALL set_sysop_availability(scfg_t* scfg, BOOL available)
{
if(available)
return ftouch(sysop_available_semfile(scfg));
return remove(sysop_available_semfile(scfg)) == 0;
}
......@@ -144,6 +144,8 @@ DLLEXPORT BOOL DLLCALL user_adjust_minutes(scfg_t*, user_t*, long amount);
DLLEXPORT time_t DLLCALL gettimeleft(scfg_t*, user_t*, time_t starttime);
DLLEXPORT BOOL DLLCALL check_name(scfg_t*, const char* name);
DLLEXPORT BOOL DLLCALL sysop_available(scfg_t*);
DLLEXPORT BOOL DLLCALL set_sysop_availability(scfg_t*, BOOL available);
/* Login attempt/hack tracking */
typedef struct {
......
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