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
6966a81b
Commit
6966a81b
authored
3 years ago
by
Rob Swindell
Browse files
Options
Downloads
Patches
Plain Diff
Create i64toac() to generate comma-separated ASCII string of 64-bit int
parent
1bea8247
No related branches found
No related tags found
1 merge request
!463
MRC mods by Codefenix (2024-10-20)
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/sbbs3/str_util.c
+17
-0
17 additions, 0 deletions
src/sbbs3/str_util.c
src/sbbs3/str_util.h
+1
-0
1 addition, 0 deletions
src/sbbs3/str_util.h
with
18 additions
and
0 deletions
src/sbbs3/str_util.c
+
17
−
0
View file @
6966a81b
...
...
@@ -495,6 +495,23 @@ char* ultoac(ulong l, char *string)
return
(
string
);
}
char
*
i64toac
(
int64_t
l
,
char
*
string
)
{
char
str
[
256
];
int
i
,
j
,
k
;
_i64toa
(
l
,
str
,
10
);
i
=
strlen
(
str
)
-
1
;
j
=
i
/
3
+
1
+
i
;
string
[
j
--
]
=
0
;
for
(
k
=
1
;
i
>-
1
;
k
++
)
{
string
[
j
--
]
=
str
[
i
--
];
if
(
j
>
0
&&
!
(
k
%
3
))
string
[
j
--
]
=
','
;
}
return
string
;
}
/****************************************************************************/
/* Truncate string at first occurrence of char in specified character set */
/* Returns a pointer to the terminating NUL if the string was truncated, */
...
...
This diff is collapsed.
Click to expand it.
src/sbbs3/str_util.h
+
1
−
0
View file @
6966a81b
...
...
@@ -64,6 +64,7 @@ DLLEXPORT BOOL valid_ctrl_a_attr(char a);
DLLEXPORT
BOOL
valid_ctrl_a_code
(
char
a
);
DLLEXPORT
size_t
strip_invalid_attr
(
char
*
str
);
DLLEXPORT
char
*
ultoac
(
ulong
l
,
char
*
str
);
DLLEXPORT
char
*
i64toac
(
int64_t
,
char
*
str
);
DLLEXPORT
char
*
rot13
(
char
*
str
);
DLLEXPORT
uint32_t
str_to_bits
(
uint32_t
currval
,
const
char
*
str
);
DLLEXPORT
BOOL
str_has_ctrl
(
const
char
*
);
...
...
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