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
9244d4dd
Commit
9244d4dd
authored
20 years ago
by
rswindell
Browse files
Options
Downloads
Patches
Plain Diff
Fixed numerous problems/warnings encountered when building for Win32.
parent
b757b96d
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
src/conio/ansi_cio.c
+1
-1
1 addition, 1 deletion
src/conio/ansi_cio.c
src/conio/ansi_cio.h
+5
-5
5 additions, 5 deletions
src/conio/ansi_cio.h
src/conio/ciolib.c
+12
-11
12 additions, 11 deletions
src/conio/ciolib.c
src/conio/ciolib.h
+6
-5
6 additions, 5 deletions
src/conio/ciolib.h
with
24 additions
and
22 deletions
src/conio/ansi_cio.c
+
1
−
1
View file @
9244d4dd
...
...
@@ -601,7 +601,7 @@ void ansi_fixterm(void)
}
#endif
int
ansi_initcio
wrap
(
long
inmode
)
int
ansi_initcio
lib
(
long
inmode
)
{
int
i
;
char
*
init
=
"
\033
[0m
\033
[2J
\033
[1;1H"
;
...
...
This diff is collapsed.
Click to expand it.
src/conio/ansi_cio.h
+
5
−
5
View file @
9244d4dd
...
...
@@ -5,16 +5,16 @@
#ifdef __cplusplus
extern
"C"
{
#endif
int
ansi_puttext
(
int
sx
,
int
sy
,
int
ex
,
int
ey
,
unsigned
char
*
fill
);
int
ansi_gettext
(
int
sx
,
int
sy
,
int
ex
,
int
ey
,
unsigned
char
*
fill
);
void
ansi_textattr
(
unsigned
char
attr
);
int
ansi_puttext
(
int
sx
,
int
sy
,
int
ex
,
int
ey
,
void
*
fill
);
int
ansi_gettext
(
int
sx
,
int
sy
,
int
ex
,
int
ey
,
void
*
fill
);
void
ansi_textattr
(
int
);
int
ansi_kbhit
(
void
);
void
ansi_delay
(
long
msec
);
int
ansi_wherey
(
void
);
int
ansi_wherex
(
void
);
int
ansi_putch
(
unsigned
char
ch
);
int
ansi_putch
(
int
ch
);
void
ansi_gotoxy
(
int
x
,
int
y
);
int
ansi_initcio
wrap
(
long
inmode
);
int
ansi_initcio
lib
(
long
inmode
);
void
ansi_gettextinfo
(
struct
text_info
*
info
);
void
ansi_setcursortype
(
int
type
);
int
ansi_getch
(
void
);
...
...
This diff is collapsed.
Click to expand it.
src/conio/ciolib.c
+
12
−
11
View file @
9244d4dd
#include
<stdarg.h>
#include
<stdlib.h>
/* malloc */
#include
<stdio.h>
#define CIOLIB_NO_MACROS
...
...
@@ -136,25 +137,25 @@ int try_ansi_init(int mode)
}
#ifdef _WIN32
int
try_cio
lib
_init
(
int
mode
)
int
try_c
on
io_init
(
int
mode
)
{
/* This should test for something or other */
if
(
isatty
(
fileno
(
stdout
)))
{
cio_api
.
mode
=
CIOLIB_CIO
LIB
_MODE
;
cio_api
.
mode
=
CIOLIB_C
ON
IO_MODE
;
cio_api
.
puttext
=
puttext
;
cio_api
.
gettext
=
gettext
;
cio_api
.
textattr
=
textattr
;
cio_api
.
kbhit
=
kbhit
;
cio_api
.
delay
=
delay
;
//
cio_api.delay=delay;
cio_api
.
wherey
=
wherey
;
cio_api
.
wherex
=
wherex
;
cio_api
.
putch
=
putch
;
cio_api
.
gotoxy
=
gotoxy
;
cio_api
.
gettextinfo
=
gettextinfo
;
cio_api
.
setcursortype
=
setcursortype
;
cio_api
.
setcursortype
=
_
setcursortype
;
cio_api
.
getch
=
getch
;
cio_api
.
getche
=
getche
;
cio_api
.
beep
=
beep
;
//
cio_api.beep=beep;
cio_api
.
textmode
=
textmode
;
return
(
1
);
}
...
...
@@ -169,7 +170,7 @@ int initciolib(int mode)
switch
(
mode
)
{
case
CIOLIB_AUTO_MODE
:
#ifdef _WIN32
if
(
!
try_cio
lib
_init
(
mode
))
if
(
!
try_c
on
io_init
(
mode
))
#else
if
(
!
try_x_init
(
mode
))
if
(
!
try_curses_init
(
mode
))
...
...
@@ -177,8 +178,8 @@ int initciolib(int mode)
try_ansi_init
(
mode
);
break
;
#ifdef _WIN32
case
CIOLIB_
ciolib
_MODE
:
try_cio
lib
_init
(
mode
);
case
CIOLIB_
CONIO
_MODE
:
try_c
on
io_init
(
mode
);
break
;
#else
case
CIOLIB_CURSES_MODE
:
...
...
@@ -580,8 +581,8 @@ int ciolib_cprintf(char *fmat, ...)
if
(
!
initialized
)
initciolib
(
CIOLIB_AUTO_MODE
);
va_start
(
argptr
,
fmat
);
#ifdef WIN32
ret
=
v
n
sprintf
(
str
,
sizeof
(
str
)
-
1
,
fmat
,
argptr
);
#ifdef
_
WIN32
ret
=
vs
n
printf
(
str
,
sizeof
(
str
)
-
1
,
fmat
,
argptr
);
#else
ret
=
vsnprintf
(
NULL
,
0
,
fmat
,
argptr
);
str
=
(
char
*
)
malloc
(
ret
+
1
);
...
...
@@ -594,7 +595,7 @@ int ciolib_cprintf(char *fmat, ...)
ciolib_cputs
(
str
);
else
ret
=
EOF
;
#ifndef WIN32
#ifndef
_
WIN32
free
(
str
);
#endif
return
(
ret
);
...
...
This diff is collapsed.
Click to expand it.
src/conio/ciolib.h
+
6
−
5
View file @
9244d4dd
...
...
@@ -12,8 +12,9 @@ enum {
,
CIOLIB_CONIO_MODE
};
#ifndef __unix__
#ifndef __unix__
/* presumably, Win32 */
#include
<conio.h>
#include
<io.h>
/* isatty */
#else
#ifndef BOOL
...
...
@@ -83,14 +84,14 @@ struct text_info {
typedef
struct
{
int
mode
;
void
(
*
clreol
)
(
void
);
int
(
*
puttext
)
(
int
,
int
,
int
,
int
,
unsigned
char
*
);
int
(
*
gettext
)
(
int
,
int
,
int
,
int
,
unsigned
char
*
);
void
(
*
textattr
)
(
unsigned
char
);
int
(
*
puttext
)
(
int
,
int
,
int
,
int
,
void
*
);
int
(
*
gettext
)
(
int
,
int
,
int
,
int
,
void
*
);
void
(
*
textattr
)
(
int
);
int
(
*
kbhit
)
(
void
);
void
(
*
delay
)
(
long
);
int
(
*
wherex
)
(
void
);
int
(
*
wherey
)
(
void
);
int
(
*
putch
)
(
unsigned
char
);
int
(
*
putch
)
(
int
);
void
(
*
gotoxy
)
(
int
,
int
);
void
(
*
clrscr
)
(
void
);
void
(
*
gettextinfo
)
(
struct
text_info
*
);
...
...
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