Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
ef3c46a9
Commit
ef3c46a9
authored
Jan 18, 2011
by
Eric Pouech
Committed by
Alexandre Julliard
Jan 19, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32: Added support for terminfo/termcap in console code.
parent
3ada9f2c
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
124 additions
and
0 deletions
+124
-0
Makefile.in
dlls/kernel32/Makefile.in
+1
-0
console.c
dlls/kernel32/console.c
+2
-0
console_private.h
dlls/kernel32/console_private.h
+4
-0
term.c
dlls/kernel32/term.c
+117
-0
No files found.
dlls/kernel32/Makefile.in
View file @
ef3c46a9
...
...
@@ -35,6 +35,7 @@ C_SRCS = \
string.c
\
sync.c
\
tape.c
\
term.c
\
thread.c
\
time.c
\
toolhelp.c
\
...
...
dlls/kernel32/console.c
View file @
ef3c46a9
...
...
@@ -216,6 +216,7 @@ static BOOL restore_console_mode(HANDLE hin)
if
((
fd
=
get_console_bare_fd
(
hin
))
==
-
1
)
return
FALSE
;
ret
=
tcsetattr
(
fd
,
TCSANOW
,
&
S_termios
)
>=
0
;
close
(
fd
);
TERM_Exit
();
return
ret
;
}
...
...
@@ -3086,6 +3087,7 @@ BOOL CONSOLE_Init(RTL_USER_PROCESS_PARAMETERS *params)
/* This is wine specific: we have no parent (we're started from unix)
* so, create a simple console with bare handles
*/
TERM_Init
();
wine_server_send_fd
(
0
);
SERVER_START_REQ
(
alloc_console
)
{
...
...
dlls/kernel32/console_private.h
View file @
ef3c46a9
...
...
@@ -33,4 +33,8 @@ extern BOOL CONSOLE_GetEditionMode(HANDLE, int*);
/* editline.c */
extern
WCHAR
*
CONSOLE_Readline
(
HANDLE
,
BOOL
);
/* term.c */
extern
BOOL
TERM_Init
(
void
);
extern
BOOL
TERM_Exit
(
void
);
#endif
/* __WINE_CONSOLE_PRIVATE_H */
dlls/kernel32/term.c
0 → 100644
View file @
ef3c46a9
/*
* Interface to terminfo and termcap libraries
*
* Copyright 2010 Eric Pouech
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "config.h"
#include "wine/port.h"
#ifdef HAVE_NCURSES_H
# include <ncurses.h>
#elif defined(HAVE_CURSES_H)
# include <curses.h>
#endif
/* avoid redefinition warnings */
#undef KEY_EVENT
#undef MOUSE_MOVED
#include <term.h>
#include <windef.h>
#include <winbase.h>
#include <winnls.h>
#include <wincon.h>
#include "console_private.h"
#include "wine/library.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
console
);
#if defined(SONAME_LIBCURSES) || defined(SONAME_LIBNCURSES)
#ifdef HAVE_NCURSES_H
# define CURSES_NAME "ncurses"
#else
# define CURSES_NAME "curses"
#endif
static
void
*
nc_handle
=
NULL
;
#define MAKE_FUNCPTR(f) static typeof(f) * p_##f;
MAKE_FUNCPTR
(
setupterm
)
#undef MAKE_FUNCPTR
/**********************************************************************/
static
BOOL
TERM_bind_libcurses
(
void
)
{
#ifdef SONAME_LIBNCURSES
static
const
char
ncname
[]
=
SONAME_LIBNCURSES
;
#else
static
const
char
ncname
[]
=
SONAME_LIBCURSES
;
#endif
if
(
!
(
nc_handle
=
wine_dlopen
(
ncname
,
RTLD_NOW
,
NULL
,
0
)))
{
WINE_MESSAGE
(
"Wine cannot find the "
CURSES_NAME
" library (%s).
\n
"
,
ncname
);
return
FALSE
;
}
#define LOAD_FUNCPTR(f) \
if((p_##f = wine_dlsym(nc_handle, #f, NULL, 0)) == NULL) \
{ \
WINE_WARN("Can't find symbol %s\n", #f); \
goto sym_not_found; \
}
LOAD_FUNCPTR
(
setupterm
)
#undef LOAD_FUNCPTR
return
TRUE
;
sym_not_found
:
WINE_MESSAGE
(
"Wine cannot find certain functions that it needs inside the "
CURSES_NAME
"
\n
library. To enable Wine to use "
CURSES_NAME
" please upgrade your "
CURSES_NAME
"
\n
libraries
\n
"
);
wine_dlclose
(
nc_handle
,
NULL
,
0
);
nc_handle
=
NULL
;
return
FALSE
;
}
#define setupterm p_setupterm
BOOL
TERM_Init
(
void
)
{
if
(
!
TERM_bind_libcurses
())
return
FALSE
;
if
(
setupterm
(
NULL
,
1
/* really ?? */
,
NULL
)
==
-
1
)
return
FALSE
;
return
TRUE
;
}
BOOL
TERM_Exit
(
void
)
{
return
TRUE
;
}
#else
BOOL
TERM_Init
(
void
)
{
return
FALSE
;}
BOOL
TERM_Exit
(
void
)
{
return
FALSE
;}
#endif
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment