ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/src/ptytty.C
(Generate patch)

Comparing rxvt-unicode/src/ptytty.C (file contents):
Revision 1.59 by root, Mon Jan 23 12:05:12 2006 UTC vs.
Revision 1.60 by root, Mon Jan 23 12:37:59 2006 UTC

679///////////////////////////////////////////////////////////////////////////// 679/////////////////////////////////////////////////////////////////////////////
680// C API 680// C API
681 681
682#ifndef PTYTTY_NO_C_API 682#ifndef PTYTTY_NO_C_API
683 683
684typedef void *PTYTTY;
685
684#define DEFINE_METHOD(retval, name, args1, args2) \ 686#define DEFINE_METHOD(retval, name, args1, args2) \
685extern "C" retval ptytty_ ## name args1 \ 687extern "C" retval ptytty_ ## name args1 \
686{ return ((struct ptytty *)ptytty)->name args2; } 688{ return ((struct ptytty *)ptytty)->name args2; }
687 689
688DEFINE_METHOD(int,pty,(void *ptytty),) 690DEFINE_METHOD(int,pty,(PTYTTY ptytty),)
689DEFINE_METHOD(int,tty,(void *ptytty),) 691DEFINE_METHOD(int,tty,(PTYTTY ptytty),)
690DEFINE_METHOD(int,get,(void *ptytty),()) 692DEFINE_METHOD(int,get,(PTYTTY ptytty),())
691DEFINE_METHOD(void,login,(void *ptytty, int cmd_pid, bool login_shell, const char *hostname),(cmd_pid,login_shell,hostname)) 693DEFINE_METHOD(void,login,(PTYTTY ptytty, int cmd_pid, bool login_shell, const char *hostname),(cmd_pid,login_shell,hostname))
692 694
693DEFINE_METHOD(void,close_tty,(void *ptytty),()) 695DEFINE_METHOD(void,close_tty,(PTYTTY ptytty),())
694DEFINE_METHOD(int,make_controlling_tty,(void *ptytty),()) 696DEFINE_METHOD(int,make_controlling_tty,(PTYTTY ptytty),())
695DEFINE_METHOD(void,set_utf8_mode,(void *ptytty, int on),(on)) 697DEFINE_METHOD(void,set_utf8_mode,(PTYTTY ptytty, int on),(on))
696 698
697#define DEFINE_STATIC(retval, name, args) \ 699#define DEFINE_STATIC(retval, name, args) \
698extern "C" retval ptytty_ ## name args \ 700extern "C" retval ptytty_ ## name args \
699{ return ptytty::name args; } 701{ return ptytty::name args; }
700 702
701DEFINE_STATIC(void,drop_privileges,()) 703DEFINE_STATIC(void,drop_privileges,())
702DEFINE_STATIC(void,use_helper,()) 704DEFINE_STATIC(void,use_helper,())
703DEFINE_STATIC(void,init,()) 705DEFINE_STATIC(void,init,())
704 706
705DEFINE_STATIC(void *,create,()) 707DEFINE_STATIC(PTYTTY ,create,())
706 708
707void ptytty_delete (void *ptytty) 709void ptytty_delete (PTYTTY ptytty)
708{ 710{
709 delete (struct ptytty *)ptytty; 711 delete (struct ptytty *)ptytty;
710} 712}
711 713
712// send_fd, recv_fd not exposed 714// send_fd, recv_fd not exposed

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines