pike.git / src / modules / Pipe / pipe.c

version» Context lines:

pike.git/src/modules/Pipe/pipe.c:19: Inside #if defined(HAVE_MMAP)
  #else   #ifdef HAVE_MMAP   /* sys/mman.h is _probably_ there anyway. */   #include <sys/mman.h>   #endif   #endif   #endif      #include <fcntl.h>    - RCSID("$Id: pipe.c,v 1.37 2000/07/28 07:14:27 hubbe Exp $"); + RCSID("$Id: pipe.c,v 1.38 2000/08/03 18:45:52 grubba Exp $");      #include "threads.h"   #include "stralloc.h"   #include "pike_macros.h"   #include "object.h"   #include "constants.h"   #include "interpret.h"   #include "svalue.h"   #include "error.h"   #include "builtin_functions.h"
pike.git/src/modules/Pipe/pipe.c:111:      struct input   {    enum { I_NONE,I_OBJ,I_BLOCKING_OBJ,I_STRING,I_MMAP } type;    union    {    struct object *obj;    struct pike_string *str;    char *mmap;    } u; -  unsigned long len; /* current input: string or mmap len */ -  int set_blocking_offset, set_nonblocking_offset; +  size_t len; /* current input: string or mmap len */ +  ptrdiff_t set_blocking_offset, set_nonblocking_offset;    struct input *next;   };      struct output   {    struct object *obj; -  int write_offset, set_blocking_offset, set_nonblocking_offset; +  ptrdiff_t write_offset, set_blocking_offset, set_nonblocking_offset;    int fd;       enum    {    O_RUN, /* waiting for callback */    O_SLEEP /* sleeping; waiting for more data */    } mode;    -  unsigned long pos; /* position in buffer */ +  size_t pos; /* position in buffer */    struct object *next;    struct pipe *the_pipe;   };      struct buffer   {    struct pike_string *s;    struct buffer *next;   };   
pike.git/src/modules/Pipe/pipe.c:167:    /* fd: size of buffer file */    /* current position of first element (buffer or mmap) */    struct buffer *firstbuffer,*lastbuffer;    short sleeping; /* sleeping; buffer is full */    short done;    struct input *firstinput,*lastinput;    struct object *firstoutput;    unsigned long sent;   };    - static int offset_input_read_callback; - static int offset_input_close_callback; - static int offset_output_write_callback; - static int offset_output_close_callback; - static int mmapped, nobjects, nstrings, noutputs, ninputs, nbuffers, sbuffers; + static ptrdiff_t offset_input_read_callback; + static ptrdiff_t offset_input_close_callback; + static ptrdiff_t offset_output_write_callback; + static ptrdiff_t offset_output_close_callback; + static ptrdiff_t mmapped, nobjects, nstrings, noutputs; + static ptrdiff_t ninputs, nbuffers, sbuffers;      void close_and_free_everything(struct object *o,struct pipe *);   static INLINE void output_finish(struct object *obj);   static INLINE void output_try_write_some(struct object *obj);      /********** internal ********************************************************/      /* Push a callback to this object given the internal function number.    */   static void push_callback(int no)