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

version» Context lines:

pike.git/src/modules/_Stdio/file.c:6185:    }   #endif /* defined(HAVE_LINUX_IF_H) && defined(HAVE_SYS_IOCTL_H) */       push_mapping(m);   }      #ifdef HAVE_OPENPTY   #include <pty.h>   #endif    + int fd_write_identifier_offset; +    PIKE_MODULE_INIT   {    struct object *o; -  +  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.git/src/modules/_Stdio/file.c:6235:    /* function(int, void|mapping:string) */    ADD_FUNCTION("_sprintf",fd__sprintf,    tFunc(tInt tOr(tVoid,tMapping),tString),ID_PROTECTED);       init_file_locking();    pike_set_prog_event_callback(file_handle_events);       file_program=end_program();    add_program_constant("Fd",file_program,0);    +  write_fun_num = find_identifier("write", file_program); +  fd_write_identifier_offset = +  file_program->identifier_references[write_fun_num].identifier_offset; +     o=file_make_object_from_fd(0, low_fd_query_properties(0)|FILE_READ,    fd_CAN_NONBLOCK);    ((struct my_file *)(o->storage + file_program->inherits->storage_offset))->flags |= FILE_NO_CLOSE_ON_DESTRUCT;    (void) dmalloc_register_fd(0);    dmalloc_accept_leak_fd(0);    add_object_constant("_stdin",o,0);    free_object(o);       o=file_make_object_from_fd(1, low_fd_query_properties(1)|FILE_WRITE,    fd_CAN_NONBLOCK);