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

version» Context lines:

pike.git/src/modules/Pipe/pipe.c:199:   };      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); + 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(ptrdiff_t no)   {    SET_SVAL(*Pike_sp, T_FUNCTION,    no + Pike_fp->context->identifier_level,    object, THISOBJ);    add_ref(THISOBJ);    Pike_sp++;   }      /* Allocate a new struct input, link it last in the linked list */ - static INLINE struct input *new_input(void) + static inline struct input *new_input(void)   {    struct input *i;    ninputs++;    i=ALLOC_STRUCT(input);    i->type=I_NONE;    i->next=NULL;    if (THIS->lastinput)    THIS->lastinput->next=i;    else    THIS->firstinput=i;    THIS->lastinput=i;    return i;   }      /* Free an input struct and all that it stands for */ - static INLINE void free_input(struct input *i) + static inline void free_input(struct input *i)   {    debug_malloc_touch(i);       ninputs--;    switch (i->type)    {    case I_OBJ:    case I_BLOCKING_OBJ:    if (!i->u.obj) break;    if (i->u.obj->prog)
pike.git/src/modules/Pipe/pipe.c:277:    Pike_error("I_MMAP input when MMAP is diabled!");   #endif    break;       case I_NONE: break;    }    free(i);   }      /* do the done_callback, then close and free everything */ - static INLINE void pipe_done(void) + static inline void pipe_done(void)   {    if (TYPEOF(THIS->done_callback) != T_INT)    {    assign_svalue_no_free(sp++,&THIS->id);    apply_svalue(&(THIS->done_callback),1);    pop_stack();       if(!THISOBJ->prog) /* We will not free anything in this case. */    return;    /* Pike_error("Pipe done callback destructed pipe.\n"); */
pike.git/src/modules/Pipe/pipe.c:311:    }else{    if(THIS->living_outputs) return;    }    pipe_done();   }      /* Allocate a new buffer and put it at the end of the chain of buffers    * scheduled for output. Return 1 if we have more bytes in buffers    * than allowed afterwards.    */ - static INLINE int append_buffer(struct pike_string *s) + static inline int append_buffer(struct pike_string *s)    /* 1=buffer full */   {    struct buffer *b;       debug_malloc_touch(s);       if(THIS->fd!= -1)    {    ptrdiff_t len = s->len;    char *data = s->str;
pike.git/src/modules/Pipe/pipe.c:425:       /* FIXME: Should we check the return value here? */    pop_stack();    /* EOF */    return(0); /* EOF */   }      /* Let's guess what this function does....    *    */ - static INLINE void input_finish(void) + static inline void input_finish(void)   {    struct input *i;       while(1)    {    /* Get the next input from the queue */    i=THIS->firstinput->next;    free_input(THIS->firstinput);    THIS->firstinput=i;   
pike.git/src/modules/Pipe/pipe.c:473:    }    THIS->sleeping=0;       low_start();    finished_p();   }      /* This function reads some data from the file cache..    * Called when we want some data to send.    */ - static INLINE struct pike_string* gimme_some_data(size_t pos) + static inline struct pike_string* gimme_some_data(size_t pos)   {    struct buffer *b;    ptrdiff_t len;    struct pipe *this = THIS;       /* We have a file cache, read from it */    if (this->fd!=-1)    {    char buffer[READ_BUFFER_SIZE];    ptrdiff_t sz = this->pos-pos;
pike.git/src/modules/Pipe/pipe.c:603:    this->firstbuffer->s->len-    pos+this->pos);   }         /*    * close and free the contents of a struct output    * Note that the output struct is not freed or unlinked here,    * that is taken care of later.    */ - static INLINE void output_finish(struct object *obj) + static inline void output_finish(struct object *obj)   {    struct output *o, *oi;    struct object *obji;       debug_malloc_touch(obj);       o=(struct output *)(obj->storage);       if (o->obj)    {
pike.git/src/modules/Pipe/pipe.c:656:       finished_p(); /* Moved by per, one line down.. :) */       /* free_object(THISOBJ); */ /* What? /Hubbe */    }   }      /*    * Try to write some data to our precious output    */ - static INLINE void output_try_write_some(struct object *obj) + static inline void output_try_write_some(struct object *obj)   {    struct output *out;    struct pike_string *s;    size_t len;    INT_TYPE ret;       debug_malloc_touch(obj);       out=(struct output*)(obj->storage);