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

version» Context lines:

pike.git/src/modules/_Stdio/file.c:1099:    */   #define CHUNK ( 1024 * 8 )    INT32 try_read;    dynamic_buffer b;       b.s.str=0;    initialize_buf(&b);    SET_ONERROR(ebuf, free_dynamic_buffer, &b);    do{    int e; -  char *buf; +     try_read=MINIMUM(CHUNK,r);      #ifdef HAVE_STRUCT_MSGHDR_MSG_CONTROL    message.msg.msg_control = &message.cmsgbuf;    message.msg.msg_controllen = sizeof(message.cmsgbuf);   #else    message.msg.msg_accrights = (void *)&message.cmsgbuf;    message.msg.msg_accrightslen = sizeof(message.cmsgbuf);   #endif    message.iov.iov_base = low_make_buf_space(try_read, &b);
pike.git/src/modules/_Stdio/file.c:1708: Inside #if defined(__NT__)
   if (!(fd_query_properties(f->box.fd, fd_CAN_NONBLOCK) & fd_CAN_NONBLOCK)) {    Pike_error("Setting backend callback on a non-socket!\n");    }   #endif /* __NT__ */    assign_svalue (&f->event_cbs[event], cb);    ADD_FD_EVENTS2 (f, 1 << event, flags);    }   }      #undef CBFUNCS +    #define CBFUNCS(CB, EVENT) \    static void PIKE_CONCAT(file_set_,CB) (INT32 args) \    { \    if(!args) \    SIMPLE_TOO_FEW_ARGS_ERROR("Stdio.File->set_" #CB, 1); \    set_fd_event_cb (THIS, Pike_sp-args, EVENT, 0); \ -  } \ -  \ -  static void PIKE_CONCAT(file_query_,CB) (INT32 args) \ -  { \ -  pop_n_elems(args); \ -  push_svalue(& THIS->event_cbs[EVENT]); \ +     }      #define CBFUNCS2(CB, EVENT) \    static void PIKE_CONCAT(file_set_,CB) (INT32 args) \    { \    if(args<2) \    SIMPLE_TOO_FEW_ARGS_ERROR("Stdio.File->set_" #CB, 2); \    if (TYPEOF(Pike_sp[1-args]) != PIKE_T_INT) \    SIMPLE_ARG_TYPE_ERROR("Stdio.File->set_" #CB, 2, "int"); \    set_fd_event_cb (THIS, Pike_sp-args, EVENT, \    Pike_sp[1-args].u.integer); \ -  } \ -  \ -  static void PIKE_CONCAT(file_query_,CB) (INT32 args) \ -  { \ -  pop_n_elems(args); \ -  push_svalue(& THIS->event_cbs[EVENT]); \ +     }      CBFUNCS(read_callback, PIKE_FD_READ)   CBFUNCS(write_callback, PIKE_FD_WRITE)   CBFUNCS(read_oob_callback, PIKE_FD_READ_OOB)   CBFUNCS(write_oob_callback, PIKE_FD_WRITE_OOB)   CBFUNCS2(fs_event_callback, PIKE_FD_FS_EVENT)         static void file_query_fs_event_flags(INT32 args)
pike.git/src/modules/_Stdio/file.c:2270: Inside #if defined(HAVE_PIKE_SEND_FD)
   *! for @[__HAVE_SEND_FD__].    *!    *! The queue is emptied on successful @[write()] and when the    *! write direction is @[close()]'d.    *!    *! @seealso    *! @[receive_fd()], @[write()], @[pipe()], @[read()], @[__HAVE_SEND_FD__]    */   static void file_send_fd(INT32 args)   { -  int e; +     int other_fd;    struct object *o = NULL;    struct my_file *f = NULL;    int *fd_info = NULL;       if(args<1 || (TYPEOF(Pike_sp[-args]) != PIKE_T_OBJECT) ||    !(o = Pike_sp[-args].u.object)->prog ||    (o->prog->inherits[SUBTYPEOF(Pike_sp[-args])].prog != file_program))    SIMPLE_BAD_ARG_ERROR("Stdio.File->send_fd()", 1, "object(is Stdio.Fd)");   
pike.git/src/modules/_Stdio/file.c:4593:    int family=-1;       close_fd();       if (args > 2 && TYPEOF(Pike_sp[2-args]) == PIKE_T_INT &&    Pike_sp[2-args].u.integer != 0)    family = Pike_sp[2-args].u.integer;    else if (args > 2 && TYPEOF(Pike_sp[2-args]) == PIKE_T_STRING &&    !Pike_sp[2-args].u.string->size_shift) {    PIKE_SOCKADDR addr; -  int addr_len; -  addr_len = get_inet_addr(&addr, (char *) STR0(Pike_sp[2-args].u.string), +  get_inet_addr(&addr, (char *) STR0(Pike_sp[2-args].u.string),    NULL, -1, 0);    family = SOCKADDR_FAMILY(addr);    INVALIDATE_CURRENT_TIME();    }       if (args && TYPEOF(Pike_sp[-args]) == PIKE_T_INT &&    Pike_sp[-args].u.integer < 0) {    pop_n_elems(args);    args = 0;    }