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.13 by root, Mon Jan 23 11:02:27 2006 UTC vs.
Revision 1.16 by root, Mon Jan 23 11:22:34 2006 UTC

371 } 371 }
372 372
373 return true; 373 return true;
374} 374}
375 375
376/////////////////////////////////////////////////////////////////////////////
377// helper/proxy support
378
376#if PTYTTY_HELPER 379#if PTYTTY_HELPER
377 380
378static int sock_fd = -1; 381static int sock_fd = -1;
379static int helper_pid, owner_pid; 382static int helper_pid, owner_pid;
380 383
609 if (uid != geteuid () 612 if (uid != geteuid ()
610 || gid != getegid ()) 613 || gid != getegid ())
611 ptytty_fatal ("unable to drop privileges, aborting.\n"); 614 ptytty_fatal ("unable to drop privileges, aborting.\n");
612} 615}
613 616
617/////////////////////////////////////////////////////////////////////////////
618// C API
619
620#ifndef NO_C_API
621
622#define DEFINE_METHOD(retval, name, args1, args2) \
623extern "C" retval ptytty_ ## name args1 \
624{ return ((struct ptytty *)ptytty)->name args2; }
625
626DEFINE_METHOD(int,pty,(void *ptytty),)
627DEFINE_METHOD(int,tty,(void *ptytty),)
628DEFINE_METHOD(int,get,(void *ptytty),())
629DEFINE_METHOD(void,login,(void *ptytty, int cmd_pid, bool login_shell, const char *hostname),(cmd_pid,login_shell,hostname))
630
631DEFINE_METHOD(void,close_tty,(void *ptytty),())
632DEFINE_METHOD(int,make_controlling_tty,(void *ptytty),())
633DEFINE_METHOD(void,set_utf8_mode,(void *ptytty, int on),(on))
634
635#define DEFINE_STATIC(retval, name, args) \
636extern "C" retval ptytty_ ## name args \
637{ return ptytty::name args; }
638
639DEFINE_STATIC(void,drop_privileges,())
640DEFINE_STATIC(void,use_helper,())
641
642DEFINE_STATIC(void,init,())
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