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

version» Context lines:

pike.git/src/modules/_Stdio/file.c:6174: Inside #if undefined(HAVE_SOCKETPAIR)
   exit_file_locking();   #ifndef HAVE_SOCKETPAIR    if (socketpair_fd >= 0) {    while (fd_close(socketpair_fd) && errno == EINTR) {}    socketpair_fd = -1;    }   #endif    exit_stdio_port();   }    - #define REF (*((struct svalue *)(Pike_fp->current_storage))) -  - #define FILE_FUNC(X,Y,Z) \ -  static ptrdiff_t PIKE_CONCAT(Y,_function_number); \ -  void PIKE_CONCAT(Y,_ref) (INT32 args) { \ -  struct object *o = REF.u.object; \ -  int fun = PIKE_CONCAT(Y,_function_number); \ -  struct program *prog; \ -  debug_malloc_touch(o); \ -  if(!o || (TYPEOF(REF) != PIKE_T_OBJECT) || !o->prog) { \ -  /* This is a temporary kluge */ \ -  Pike_error("Stdio.File(): not open.\n"); \ -  } \ -  prog = o->prog->inherits[SUBTYPEOF(REF)].prog; \ -  fun += o->prog->inherits[SUBTYPEOF(REF)].identifier_level; \ -  if(prog != file_program) \ -  Pike_error("Wrong type of object in Stdio.File->_fd\n"); \ -  apply_low(o, fun, args); \ -  } -  - #include "file_functions.h" -  - #ifdef PIKE_DEBUG - void check_static_file_data(struct callback *UNUSED(a), void *UNUSED(b), -  void *UNUSED(c)) - { -  if(file_program) -  { - #define FILE_FUNC(X,Y,Z) \ -  if(PIKE_CONCAT(Y,_function_number)<0 || \ -  PIKE_CONCAT(Y,_function_number)> \ -  file_program->num_identifier_references) \ -  Pike_fatal(#Y "_function_number is incorrect: %ld\n", \ -  (long)(PIKE_CONCAT(Y,_function_number))); - #include "file_functions.h" -  } - } - #endif -  +    #if defined(HAVE_TERMIOS_H) || defined(HAVE_SYS_TERMIOS_H) || defined(__NT__)   void file_tcgetattr(INT32 args);   #ifdef HAVE_TCGETATTR   void file_tcsetattr(INT32 args);   void file_tcsendbreak(INT32 args);   void file_tcflush(INT32 args);   void file_tcdrain(INT32 args);   /* void file_tcflow(INT32 args); */   /* void file_tcgetpgrp(INT32 args); */   /* void file_tcsetpgrp(INT32 args); */
pike.git/src/modules/_Stdio/file.c:6378:    int write_fun_num;       Pike_compiler->new_program->id = PROG_MODULE_STDIO_ID;       init_stdio_efuns();    init_stdio_stat();    init_stdio_buffer();    START_NEW_PROGRAM_ID(STDIO_FD);    ADD_STORAGE(struct my_file);    - #define FILE_FUNC(X,Y,Z) \ -  PIKE_CONCAT(Y,_function_number) = ADD_FUNCTION(X,Y,Z,0); + #define FILE_FUNC(X,Y,Z) ADD_FUNCTION(X,Y,Z,0);   #define FILE_OBJ tObjImpl_STDIO_FD   #include "file_functions.h"       PIKE_MAP_VARIABLE("_errno", OFFSETOF(my_file, my_errno),    tIntPos, PIKE_T_INT, ID_PROTECTED);    PIKE_MAP_VARIABLE("_read_callback",    OFFSETOF(my_file, event_cbs[PIKE_FD_READ]),    tMix, PIKE_T_MIXED, 0);    PIKE_MAP_VARIABLE("_write_callback",    OFFSETOF(my_file, event_cbs[PIKE_FD_WRITE]),
pike.git/src/modules/_Stdio/file.c:6632:    add_integer_constant("__HAVE_SEND_FD__", 1, 0);   #endif    /* function(:array(int)) */    ADD_FUNCTION2("get_all_active_fd", f_get_all_active_fd,    tFunc(tNone,tArr(tInt)), 0, OPT_EXTERNAL_DEPEND);       /* function(void:mapping) */    ADD_FUNCTION2("gethostip", f_gethostip, tFunc(tNone,tMapping),    0, OPT_EXTERNAL_DEPEND);    - #ifdef PIKE_DEBUG -  dmalloc_accept_leak(add_to_callback(&do_debug_callbacks, -  check_static_file_data, -  0, -  0)); - #endif +     ADD_FUNCTION2("getprotobyname", f_getprotobyname, tFunc(tStr8,tInt), 0, 0);   }      /*! @endmodule    */      /* Used from backend */   PMOD_EXPORT int pike_make_pipe(int *fds)   {    return socketpair(AF_UNIX, SOCK_STREAM, 0, fds);   }      PMOD_EXPORT int fd_from_object(struct object *o)   {    extern int fd_from_portobject( struct object *o );    struct my_file *f=get_file_storage(o);    if(!f)    return fd_from_portobject( o );    return f->box.fd;   }