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
f60a41cb
Commit
f60a41cb
authored
19 years ago
by
deuce
Browse files
Options
Downloads
Patches
Plain Diff
Add ANSI/ASCII logging (capture) capabilities.
PR:25->closed
parent
ab29b519
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/syncterm/menu.c
+5
-0
5 additions, 0 deletions
src/syncterm/menu.c
src/syncterm/term.c
+100
-9
100 additions, 9 deletions
src/syncterm/term.c
with
105 additions
and
9 deletions
src/syncterm/menu.c
+
5
−
0
View file @
f60a41cb
...
...
@@ -118,6 +118,7 @@ int syncmenu(struct bbslist *bbs, int *speed)
,
"Zmodem Download (Alt-D)"
,
"Change Output Rate (Alt-Up/Alt-Down)"
,
"Change Log Level"
,
"Capture Control (Alt-C)"
,
"Exit (Alt-X)"
,
""
};
int
opt
=
0
;
...
...
@@ -148,6 +149,7 @@ int syncmenu(struct bbslist *bbs, int *speed)
"~ Zmodem Download ~ Initiates a ZModem download
\n
"
"~ Change Output Rate ~ Changes the speed charaters are output to the screen
\n
"
"~ Change Log Level ~ Changes the minimum log leve for ZModem information
\n
"
"~ Capture Control ~ Enables/Disables screen capture
\n
"
"~ Exit ~ Disconnects and closes the Syncterm"
;
i
=
uifc
.
list
(
WIN_MID
|
WIN_SAV
,
0
,
0
,
0
,
&
opt
,
NULL
,
"SyncTERM Online Menu"
,
opts
);
switch
(
i
)
{
...
...
@@ -199,6 +201,9 @@ int syncmenu(struct bbslist *bbs, int *speed)
log_level
=
j
;
ret
=
6
;
break
;
case
7
:
/* Capture control */
ret
=
i
;
break
;
default:
ret
=
i
;
uifcbail
();
...
...
This diff is collapsed.
Click to expand it.
src/syncterm/term.c
+
100
−
9
View file @
f60a41cb
...
...
@@ -119,7 +119,7 @@ void mousedrag(unsigned char *scrollback)
void
update_status
(
struct
bbslist
*
bbs
,
int
speed
)
{
char
buf
[
160
];
char
nbuf
[
50
];
char
nbuf
[
LIST_NAME_MAX
+
10
+
11
+
1
];
/* Room for "Name (Logging) (115300)" and terminator */
int
oldscroll
;
int
olddmc
;
struct
text_info
txtinfo
;
...
...
@@ -143,10 +143,11 @@ void update_status(struct bbslist *bbs, int speed)
window
(
term
.
x
-
1
,
term
.
y
+
term
.
height
-
1
,
term
.
x
+
term
.
width
-
2
,
term
.
y
+
term
.
height
-
1
);
gotoxy
(
1
,
1
);
_wscroll
=
0
;
strcpy
(
nbuf
,
bbs
->
name
);
if
(
cterm
.
log
)
strcat
(
nbuf
,
" (Logging)"
);
if
(
speed
)
sprintf
(
nbuf
,
"%-.30s (%d)"
,
bbs
->
name
,
speed
);
else
sprintf
(
nbuf
,
"%-.30s"
,
bbs
->
name
);
sprintf
(
strchr
(
nbuf
,
0
),
" (%d)"
,
speed
);
switch
(
cio_api
.
mode
)
{
case
CIOLIB_MODE_CURSES
:
case
CIOLIB_MODE_CURSES_IBM
:
...
...
@@ -600,6 +601,90 @@ void zmodem_download(char *download_dir)
}
/* End of Zmodem Stuff */
void
capture_control
(
struct
bbslist
*
bbs
)
{
char
*
buf
;
struct
text_info
txtinfo
;
int
i
,
j
;
gettextinfo
(
&
txtinfo
);
buf
=
(
char
*
)
malloc
(
txtinfo
.
screenheight
*
txtinfo
.
screenwidth
*
2
);
gettext
(
1
,
1
,
txtinfo
.
screenwidth
,
txtinfo
.
screenheight
,
buf
);
init_uifc
(
FALSE
,
FALSE
);
if
(
!
cterm
.
log
)
{
struct
file_pick
fpick
;
char
*
opts
[
3
]
=
{
"ASCII"
,
"Raw"
,
""
};
i
=
0
;
uifc
.
helpbuf
=
"`Capture Type`
\n\n
"
"~ ASCII ~ Strips out ANSI sequences
\n
"
"~ Raw ~ Leaves ANSI sequences in
\n\n
"
"Raw is usefull for stealing ANSI screens from other systems.
\n
"
"Don't do that though. :-)"
;
if
(
uifc
.
list
(
WIN_MID
|
WIN_SAV
,
0
,
0
,
0
,
&
i
,
NULL
,
"Capture Type"
,
opts
)
!=-
1
)
{
j
=
filepick
(
&
uifc
,
"Capture File"
,
&
fpick
,
bbs
->
dldir
,
NULL
,
UIFC_FP_ALLOWENTRY
);
if
(
j
!=-
1
||
fpick
.
files
>=
1
)
cterm_openlog
(
fpick
.
selected
[
0
],
i
?
CTERM_LOG_RAW
:
CTERM_LOG_ASCII
);
filepick_free
(
&
fpick
);
}
}
else
{
if
(
cterm
.
log
&
CTERM_LOG_PAUSED
)
{
char
*
opts
[
3
]
=
{
"Unpause"
,
"Close"
};
i
=
0
;
uifc
.
helpbuf
=
"`Capture Control`
\n\n
"
"~ Unpause ~ Continues logging
\n
"
"~ Close ~ Closes the log
\n\n
"
;
if
(
uifc
.
list
(
WIN_MID
|
WIN_SAV
,
0
,
0
,
0
,
&
i
,
NULL
,
"Capture Control"
,
opts
)
!=-
1
)
{
switch
(
i
)
{
case
0
:
cterm
.
log
=
cterm
.
log
&
CTERM_LOG_MASK
;
break
;
case
1
:
cterm_closelog
();
break
;
}
}
}
else
{
char
*
opts
[
3
]
=
{
"Pause"
,
"Close"
};
i
=
0
;
uifc
.
helpbuf
=
"`Capture Control`
\n\n
"
"~ Pause ~ Suspends logging
\n
"
"~ Close ~ Closes the log
\n\n
"
;
if
(
uifc
.
list
(
WIN_MID
|
WIN_SAV
,
0
,
0
,
0
,
&
i
,
NULL
,
"Capture Control"
,
opts
)
!=-
1
)
{
switch
(
i
)
{
case
0
:
cterm
.
log
=
cterm
.
log
|=
CTERM_LOG_PAUSED
;
break
;
case
1
:
cterm_closelog
();
break
;
}
}
}
}
uifcbail
();
puttext
(
1
,
1
,
txtinfo
.
screenwidth
,
txtinfo
.
screenheight
,
buf
);
window
(
txtinfo
.
winleft
,
txtinfo
.
wintop
,
txtinfo
.
winright
,
txtinfo
.
winbottom
);
textattr
(
txtinfo
.
attribute
);
gotoxy
(
txtinfo
.
curx
,
txtinfo
.
cury
);
free
(
buf
);
}
BOOL
doterm
(
struct
bbslist
*
bbs
)
{
unsigned
char
ch
[
2
];
...
...
@@ -796,15 +881,15 @@ BOOL doterm(struct bbslist *bbs)
case
CIO_KEY_F
(
4
):
conn_send
(
"
\033
Ox"
,
3
,
0
);
break
;
case
0x1600
:
/* ALT-U - Upload */
zmodem_upload
(
bbs
->
uldir
);
case
0x3000
:
/* ALT-B - Scrollback */
viewscroll
();
break
;
case
0x2e00
:
/* ALT-C - Capture */
capture_control
(
bbs
);
break
;
case
0x2000
:
/* ALT-D - Download */
zmodem_download
(
bbs
->
dldir
);
break
;
case
0x3000
:
/* ALT-B - Scrollback */
viewscroll
();
break
;
case
0x2600
:
/* ALT-L */
conn_send
(
bbs
->
user
,
strlen
(
bbs
->
user
),
0
);
conn_send
(
"
\r
"
,
1
,
0
);
...
...
@@ -816,6 +901,9 @@ BOOL doterm(struct bbslist *bbs)
conn_send
(
bbs
->
syspass
,
strlen
(
bbs
->
syspass
),
0
);
conn_send
(
"
\r
"
,
1
,
0
);
}
case
0x1600
:
/* ALT-U - Upload */
zmodem_upload
(
bbs
->
uldir
);
break
;
case
17
:
/* CTRL-Q */
if
(
cio_api
.
mode
!=
CIOLIB_MODE_CURSES
&&
cio_api
.
mode
!=
CIOLIB_MODE_CURSES_IBM
...
...
@@ -882,6 +970,9 @@ BOOL doterm(struct bbslist *bbs)
zmodem_download
(
bbs
->
dldir
);
break
;
case
7
:
capture_control
(
bbs
);
break
;
case
8
:
cterm_end
();
free
(
scrollback
);
conn_close
();
...
...
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