--- rxvt-unicode/src/libptytty.h 2006/01/22 09:57:48 1.1 +++ rxvt-unicode/src/libptytty.h 2006/01/23 12:39:42 1.5 @@ -4,6 +4,10 @@ #ifndef LIBPTYTTY_H_ /* public libptytty header file */ #define LIBPTYTTY_H_ +#ifdef __cplusplus + +// c++ api + struct ptytty { int pty; // pty file descriptor; connected to rxvt int tty; // tty file descriptor; connected to child @@ -25,7 +29,7 @@ static void drop_privileges (); static void use_helper (); - static int send_fd (int socket, int fd); + static bool send_fd (int socket, int fd); static int recv_fd (int socket); protected: @@ -36,5 +40,29 @@ } }; +#else + +// c api + +typedef void *PTYTTY; + +int ptytty_pty (PTYTTY ptytty); +int ptytty_tty (PTYTTY ptytty); +void ptytty_delete (PTYTTY ptytty); +int ptytty_get (PTYTTY ptytty); +void ptytty_login (PTYTTY ptytty, int cmd_pid, bool login_shell, const char *hostname); + +void ptytty_close_tty (PTYTTY ptytty); +int ptytty_make_controlling_tty (PTYTTY ptytty); +void ptytty_set_utf8_mode (PTYTTY ptytty, int on); + +void ptytty_init (); +PTYTTY ptytty_create (); + +void ptytty_drop_privileges (); +void ptytty_use_helper (); + +#endif + #endif