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
36cd3b55
Commit
36cd3b55
authored
9 years ago
by
rswindell
Browse files
Options
Downloads
Patches
Plain Diff
Create a C version of sbbs_t::ansi(), call it ansi_attr() and DLL-export it.
parent
c73bc331
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/ansiterm.cpp
+9
-4
9 additions, 4 deletions
src/sbbs3/ansiterm.cpp
src/sbbs3/sbbs.h
+2
-0
2 additions, 0 deletions
src/sbbs3/sbbs.h
with
11 additions
and
4 deletions
src/sbbs3/ansiterm.cpp
+
9
−
4
View file @
36cd3b55
...
...
@@ -8,7 +8,7 @@
* @format.tab-size 4 (Plain Text/Source Code File Header) *
* @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) *
* *
* Copyright
2009
Rob Swindell - http://www.synchro.net/copyright.html *
* Copyright Rob Swindell - http://www.synchro.net/copyright.html
*
* *
* This program is free software; you can redistribute it and/or *
* modify it under the terms of the GNU General Public License *
...
...
@@ -98,14 +98,14 @@ const char *sbbs_t::ansi(int atr)
}
/* insure str is at least 14 bytes in size! */
char
*
sbbs_t
::
ansi
(
int
atr
,
int
curatr
,
char
*
str
)
extern
"C"
char
*
ansi_attr
(
int
atr
,
int
curatr
,
char
*
str
,
BOOL
color
)
{
if
(
!
term_supports
(
COLOR
)
)
{
/* eliminate colors if
user
doesn't
have
them */
if
(
!
color
)
{
/* eliminate colors if
terminal
doesn't
support
them */
if
(
atr
&
LIGHTGRAY
)
/* if any foreground bits set, set all */
atr
|=
LIGHTGRAY
;
if
(
atr
&
BG_LIGHTGRAY
)
/* if any background bits set, set all */
atr
|=
BG_LIGHTGRAY
;
if
(
atr
&
LIGHTGRAY
&&
atr
&
BG_LIGHTGRAY
)
if
(
(
atr
&
LIGHTGRAY
)
&&
(
atr
&
BG_LIGHTGRAY
)
)
atr
&=~
LIGHTGRAY
;
/* if background is solid, foreground is black */
if
(
!
atr
)
atr
|=
LIGHTGRAY
;
/* don't allow black on black */
...
...
@@ -193,6 +193,11 @@ char* sbbs_t::ansi(int atr, int curatr, char* str)
return
str
;
}
char
*
sbbs_t
::
ansi
(
int
atr
,
int
curatr
,
char
*
str
)
{
return
::
ansi_attr
(
atr
,
curatr
,
str
,
term_supports
(
COLOR
)
?
TRUE
:
FALSE
);
}
void
sbbs_t
::
ansi_getlines
()
{
if
(
sys_status
&
SS_USERON
&&
useron
.
misc
&
ANSI
&&
!
useron
.
rows
/* Auto-detect rows */
...
...
This diff is collapsed.
Click to expand it.
src/sbbs3/sbbs.h
+
2
−
0
View file @
36cd3b55
...
...
@@ -982,6 +982,8 @@ public:
#ifdef __cplusplus
extern
"C"
{
#endif
/* ansiterm.cpp */
DLLEXPORT
char
*
DLLCALL
ansi_attr
(
int
attr
,
int
curattr
,
char
*
str
,
BOOL
color
);
/* main.cpp */
DLLEXPORT
int
DLLCALL
sbbs_random
(
int
);
...
...
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