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
66debf0a
Commit
66debf0a
authored
22 years ago
by
rswindell
Browse files
Options
Downloads
Patches
Plain Diff
Created function: user_rec_len, returns length of specified user record field.
parent
59f0575a
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/sbbs3/userdat.c
+93
-0
93 additions, 0 deletions
src/sbbs3/userdat.c
src/sbbs3/userdat.h
+1
-0
1 addition, 0 deletions
src/sbbs3/userdat.h
with
94 additions
and
0 deletions
src/sbbs3/userdat.c
+
93
−
0
View file @
66debf0a
...
...
@@ -1815,3 +1815,96 @@ int DLLCALL newuserdat(scfg_t* cfg, user_t* user)
return
(
0
);
}
/* Returns length of specified user record 'field', or -1 if invalid */
int
DLLCALL
user_rec_len
(
int
offset
)
{
switch
(
offset
)
{
/* Strings (of different lengths) */
case
U_ALIAS
:
return
(
LEN_ALIAS
);
case
U_NAME
:
return
(
LEN_NAME
);
case
U_HANDLE
:
return
(
LEN_HANDLE
);
case
U_NOTE
:
return
(
LEN_NOTE
);
case
U_COMP
:
return
(
LEN_COMP
);
case
U_COMMENT
:
return
(
LEN_COMMENT
);
case
U_NETMAIL
:
return
(
LEN_NETMAIL
);
case
U_ADDRESS
:
return
(
LEN_ADDRESS
);
case
U_LOCATION
:
return
(
LEN_LOCATION
);
case
U_ZIPCODE
:
return
(
LEN_ZIPCODE
);
case
U_PASS
:
return
(
LEN_PASS
);
case
U_PHONE
:
return
(
LEN_PHONE
);
case
U_BIRTH
:
return
(
LEN_BIRTH
);
case
U_MODEM
:
return
(
LEN_MODEM
);
/* Dates in time_t format (8 hex digits) */
case
U_LASTON
:
case
U_FIRSTON
:
case
U_EXPIRE
:
case
U_PWMOD
:
case
U_NS_TIME
:
case
U_LOGONTIME
:
/* 32-bit integers (8 hex digits) */
case
U_FLAGS1
:
case
U_FLAGS2
:
case
U_FLAGS3
:
case
U_FLAGS4
:
case
U_EXEMPT
:
case
U_REST
:
case
U_MISC
:
case
U_QWK
:
case
U_CHAT
:
/* Internal codes (8 chars) */
case
U_CURSUB
:
case
U_CURDIR
:
case
U_CURXTRN
:
case
U_XEDIT
:
case
U_SHELL
:
return
(
8
);
/* 16-bit integers (5 decimal digits) */
case
U_LOGONS
:
case
U_LTODAY
:
case
U_TIMEON
:
case
U_TEXTRA
:
case
U_TTODAY
:
case
U_TLAST
:
case
U_POSTS
:
case
U_EMAILS
:
case
U_FBACKS
:
case
U_ETODAY
:
case
U_PTODAY
:
case
U_ULS
:
case
U_DLS
:
return
(
5
);
/* 32-bit integers (10 decimal digits) */
case
U_ULB
:
case
U_DLB
:
case
U_CDT
:
case
U_MIN
:
case
U_FREECDT
:
return
(
10
);
/* 3 char strings */
case
U_TMPEXT
:
return
(
3
);
/* 2 digits integers (0-99) */
case
U_LEVEL
:
case
U_TL
:
case
U_ROWS
:
case
U_LEECH
:
/* actually, 2 hex digits */
return
(
2
);
/* Single digits chars */
case
U_SEX
:
case
U_PROT
:
return
(
1
);
}
return
(
-
1
);
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
src/sbbs3/userdat.h
+
1
−
0
View file @
66debf0a
...
...
@@ -102,6 +102,7 @@ DLLEXPORT ulong DLLCALL adjustuserrec(scfg_t*, int usernumber, int start, int le
DLLEXPORT
BOOL
DLLCALL
logoutuserdat
(
scfg_t
*
,
user_t
*
,
time_t
now
,
time_t
logontime
);
DLLEXPORT
void
DLLCALL
resetdailyuserdat
(
scfg_t
*
,
user_t
*
);
DLLEXPORT
void
DLLCALL
subtract_cdt
(
scfg_t
*
,
user_t
*
,
long
amt
);
DLLEXPORT
int
DLLCALL
user_rec_len
(
int
offset
);
#ifdef __cplusplus
}
...
...
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