pike.git / src / modules / _Stdio / socket.c

version» Context lines:

pike.git/src/modules/_Stdio/socket.c:717:    *! @seealso    *! @[set_backend]    */   static void port_query_backend (INT32 args)   {    pop_n_elems (args);    ref_push_object (get_backend_obj (THIS->box.backend ? THIS->box.backend :    default_backend));   }    + int fd_from_portobject( struct object *p ) + { +  struct port *po = get_storage( p, port_program ); +  if(!po) return -1; +  return po->box.fd; + }    -  + /*! @decl int query_fd() +  *! +  *! Returns the file descriptor number associated with this object. +  */ + static void port_query_fd(INT32 UNUSED(args)) + { +  push_int(fd_from_portobject(Pike_fp->current_object)); + } +  +    static void init_port_struct(struct object *o)   {    INIT_FD_CALLBACK_BOX(&THIS->box, NULL, o, -1, 0, got_port_event, 0);    THIS->my_errno=0;    /* map_variable takes care of id and accept_callback. */   }      static void exit_port_struct(struct object *UNUSED(o))   {    do_close(THIS);    unhook_fd_callback_box (&THIS->box);    /* map_variable takes care of id and accept_callback. */   } -  - int fd_from_portobject( struct object *p ) - { -  struct port *po = get_storage( p, port_program ); -  if(!po) return -1; -  return po->box.fd; - } -  - static void port_query_fd(INT32 UNUSED(args)) - { -  push_int(fd_from_portobject(Pike_fp->current_object)); - } +    /*! @endclass    */      /*! @endmodule    */      PMOD_EXPORT struct program *port_program = NULL;      void exit_stdio_port(void)   {