Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Main
Synchronet
Commits
847a2378
Commit
847a2378
authored
Mar 29, 2022
by
Rob Swindell
💬
Browse files
Add parse_cstats() function
parent
6e9fee01
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
0 deletions
+15
-0
src/sbbs3/getstats.c
src/sbbs3/getstats.c
+14
-0
src/sbbs3/getstats.h
src/sbbs3/getstats.h
+1
-0
No files found.
src/sbbs3/getstats.c
View file @
847a2378
...
...
@@ -293,6 +293,20 @@ BOOL fwrite_cstats(FILE* fp, const stats_t* stats)
return
fprintf
(
fp
,
"%.*s
\n
"
,
(
int
)(
sizeof
(
pad
)
-
(
len
+
1
)),
pad
)
>
0
;
}
void
parse_cstats
(
str_list_t
record
,
stats_t
*
stats
)
{
stats
->
ltoday
=
strtoul
(
record
[
CSTATS_LOGONS
],
NULL
,
10
);
stats
->
ttoday
=
strtoul
(
record
[
CSTATS_TIMEON
],
NULL
,
10
);
stats
->
nusers
=
strtoul
(
record
[
CSTATS_NUSERS
],
NULL
,
10
);
stats
->
ftoday
=
strtoul
(
record
[
CSTATS_FBACKS
],
NULL
,
10
);
stats
->
etoday
=
strtoul
(
record
[
CSTATS_EMAIL
],
NULL
,
10
);
stats
->
ptoday
=
strtoul
(
record
[
CSTATS_POSTS
],
NULL
,
10
);
stats
->
uls
=
strtoul
(
record
[
CSTATS_UPLOADS
],
NULL
,
10
);
stats
->
ulb
=
strtoull
(
record
[
CSTATS_UPLOADB
],
NULL
,
10
);
stats
->
dls
=
strtoul
(
record
[
CSTATS_DNLOADS
],
NULL
,
10
);
stats
->
dlb
=
strtoull
(
record
[
CSTATS_DNLOADB
],
NULL
,
10
);
}
/****************************************************************************/
/* Returns the number of files in the directory 'dirnum' */
/****************************************************************************/
...
...
src/sbbs3/getstats.h
View file @
847a2378
...
...
@@ -37,6 +37,7 @@ DLLEXPORT BOOL fclose_dstats(FILE*);
DLLEXPORT
BOOL
fread_dstats
(
FILE
*
,
stats_t
*
);
DLLEXPORT
BOOL
fwrite_dstats
(
FILE
*
,
const
stats_t
*
);
DLLEXPORT
BOOL
fwrite_cstats
(
FILE
*
,
const
stats_t
*
);
DLLEXPORT
void
parse_cstats
(
str_list_t
,
stats_t
*
);
DLLEXPORT
BOOL
getstats
(
scfg_t
*
,
uint
node
,
stats_t
*
);
DLLEXPORT
BOOL
putstats
(
scfg_t
*
,
uint
node
,
const
stats_t
*
);
DLLEXPORT
ulong
getposts
(
scfg_t
*
,
uint
subnum
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment