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

Comparing libptytty/src/ptytty.C (file contents):
Revision 1.14 by root, Mon Jan 23 11:21:48 2006 UTC vs.
Revision 1.17 by root, Mon Jan 23 11:22:52 2006 UTC

615} 615}
616 616
617///////////////////////////////////////////////////////////////////////////// 617/////////////////////////////////////////////////////////////////////////////
618// C API 618// C API
619 619
620#ifndef NO_C_API
621
620#define DEFINE_METHOD(retval, name, args1, args2) \ 622#define DEFINE_METHOD(retval, name, args1, args2) \
621extern "C" retval ptytty_ ## name args1 \ 623extern "C" retval ptytty_ ## name args1 \
622{ return ((struct ptytty *)ptytty)->name args2; } 624{ return ((struct ptytty *)ptytty)->name args2; }
623 625
624DEFINE_METHOD(int,pty,(void *ptytty),) 626DEFINE_METHOD(int,pty,(void *ptytty),)
629DEFINE_METHOD(void,close_tty,(void *ptytty),()) 631DEFINE_METHOD(void,close_tty,(void *ptytty),())
630DEFINE_METHOD(int,make_controlling_tty,(void *ptytty),()) 632DEFINE_METHOD(int,make_controlling_tty,(void *ptytty),())
631DEFINE_METHOD(void,set_utf8_mode,(void *ptytty, int on),(on)) 633DEFINE_METHOD(void,set_utf8_mode,(void *ptytty, int on),(on))
632 634
633#define DEFINE_STATIC(retval, name, args) \ 635#define DEFINE_STATIC(retval, name, args) \
634extern "C" retval ptytty_ ## name args \ 636 retval ptytty_ ## name args \
635{ return ptytty::name args; } 637{ return ptytty::name args; }
636
637DEFINE_STATIC(void,init,())
638DEFINE_STATIC(void *,create,())
639
640void ptytty_delete (void *ptytty)
641{
642 delete (struct ptytty *)ptytty;
643}
644 638
645DEFINE_STATIC(void,drop_privileges,()) 639DEFINE_STATIC(void,drop_privileges,())
646DEFINE_STATIC(void,use_helper,()) 640DEFINE_STATIC(void,use_helper,())
641DEFINE_STATIC(void,init,())
647 642
643DEFINE_STATIC(void *,create,())
644
645void ptytty_delete (void *ptytty)
646{
647 delete (struct ptytty *)ptytty;
648}
649
650// send_fd, recv_fd not exposed
651
652#endif

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines