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
847a2378
Commit
847a2378
authored
3 years ago
by
Rob Swindell
Browse files
Options
Downloads
Patches
Plain Diff
Add parse_cstats() function
parent
6e9fee01
No related branches found
No related tags found
1 merge request
!463
MRC mods by Codefenix (2024-10-20)
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/sbbs3/getstats.c
+14
-0
14 additions, 0 deletions
src/sbbs3/getstats.c
src/sbbs3/getstats.h
+1
-0
1 addition, 0 deletions
src/sbbs3/getstats.h
with
15 additions
and
0 deletions
src/sbbs3/getstats.c
+
14
−
0
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' */
/****************************************************************************/
...
...
This diff is collapsed.
Click to expand it.
src/sbbs3/getstats.h
+
1
−
0
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
);
...
...
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