X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Fpty.in.h;h=5eddfad5e556ee56245016767440849283287f63;hb=acc203f3da092e2ee94eff8f9c85e1fdc61315cf;hp=1b7bf8205553cd4f31c006ddb9e94b250041c0ec;hpb=9d84afa467b0a9abcd6e0d90fc7d1608f07bf2f1;p=gnulib.git diff --git a/lib/pty.in.h b/lib/pty.in.h index 1b7bf8205..5eddfad5e 100644 --- a/lib/pty.in.h +++ b/lib/pty.in.h @@ -1,5 +1,5 @@ /* Substitute for and wrapper around . - Copyright (C) 2010 Free Software Foundation, Inc. + Copyright (C) 2010-2011 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -20,6 +20,7 @@ #if __GNUC__ >= 3 @PRAGMA_SYSTEM_HEADER@ #endif +@PRAGMA_COLUMNS@ /* The include_next requires a split double-inclusion guard. */ #if @HAVE_PTY_H@ @@ -34,9 +35,14 @@ # include #endif #if @HAVE_LIBUTIL_H@ +/* is a prerequisite of on FreeBSD 8.0. */ +# include # include #endif +/* Get 'struct termios' and 'struct winsize'. */ +#include + /* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */ /* The definition of _GL_WARN_ON_USE is copied here. */ @@ -45,6 +51,32 @@ /* Declare overridden functions. */ #if @GNULIB_FORKPTY@ +/* Create pseudo tty master slave pair and set terminal attributes + according to TERMP and WINP. Fork a child process attached to the + slave end. Return a handle for the master end in *AMASTER, and + return the name of the slave end in NAME. */ +# if @REPLACE_FORKPTY@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef forkpty +# define forkpty rpl_forkpty +# endif +_GL_FUNCDECL_RPL (forkpty, int, + (int *amaster, char *name, + struct termios const *termp, struct winsize const *winp)); +_GL_CXXALIAS_RPL (forkpty, int, + (int *amaster, char *name, + struct termios const *termp, struct winsize const *winp)); +# else +# if !@HAVE_FORKPTY@ +_GL_FUNCDECL_SYS (forkpty, int, + (int *amaster, char *name, + struct termios const *termp, struct winsize const *winp)); +# endif +_GL_CXXALIAS_SYS (forkpty, int, + (int *amaster, char *name, + struct termios const *termp, struct winsize const *winp)); +# endif +_GL_CXXALIASWARN (forkpty); #elif defined GNULIB_POSIXCHECK # undef forkpty # if HAVE_RAW_DECL_FORKPTY @@ -54,6 +86,31 @@ _GL_WARN_ON_USE (forkpty, "forkpty is not declared consistently - " #endif #if @GNULIB_OPENPTY@ +/* Create pseudo tty master slave pair and set terminal attributes + according to TERMP and WINP. Return handles for both ends in + *AMASTER and *ASLAVE, and return the name of the slave end in NAME. */ +# if @REPLACE_OPENPTY@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef openpty +# define openpty rpl_openpty +# endif +_GL_FUNCDECL_RPL (openpty, int, + (int *amaster, int *aslave, char *name, + struct termios const *termp, struct winsize const *winp)); +_GL_CXXALIAS_RPL (openpty, int, + (int *amaster, int *aslave, char *name, + struct termios const *termp, struct winsize const *winp)); +# else +# if !@HAVE_OPENPTY@ +_GL_FUNCDECL_SYS (openpty, int, + (int *amaster, int *aslave, char *name, + struct termios const *termp, struct winsize const *winp)); +# endif +_GL_CXXALIAS_SYS (openpty, int, + (int *amaster, int *aslave, char *name, + struct termios const *termp, struct winsize const *winp)); +# endif +_GL_CXXALIASWARN (openpty); #elif defined GNULIB_POSIXCHECK # undef openpty # if HAVE_RAW_DECL_OPENPTY