pike.git / src / dynamic_buffer.c

version» Context lines:

pike.git/src/dynamic_buffer.c:1:   /*\   ||| This file a part of Pike, and is copyright by Fredrik Hubinette   ||| Pike is distributed as GPL (General Public License)   ||| See the files COPYING and DISCLAIMER for more information.   \*/   /**/   #include "global.h"   #include "dynamic_buffer.h"   #include "stralloc.h" - #include "error.h" + #include "pike_error.h"   #include "pike_memory.h"    - RCSID("$Id: dynamic_buffer.c,v 1.12 2000/08/10 09:03:10 grubba Exp $"); + RCSID("$Id: dynamic_buffer.c,v 1.13 2000/12/01 08:09:45 hubbe Exp $");      static dynamic_buffer buff;      PMOD_EXPORT char *low_make_buf_space(size_t space, dynamic_buffer *buf)   {    char *ret;   #ifdef PIKE_DEBUG    if(!buf->s.str) fatal("ARRRRGH! Deadly Trap!\n");   #endif       if(buf->s.len+space >= buf->bufsize)    {    if(!buf->bufsize) buf->bufsize=1;       do{    buf->bufsize*=2;    }while(buf->s.len+space >= buf->bufsize);       buf->s.str=(char *)realloc(buf->s.str, buf->bufsize);    if(!buf->s.str) -  error("Out of memory.\n"); +  Pike_error("Out of memory.\n");    }    ret = buf->s.str + buf->s.len;    buf->s.len += space;    return ret;   }      PMOD_EXPORT void low_my_putchar(char b,dynamic_buffer *buf)   {   #ifdef PIKE_DEBUG    if(!buf->s.str)