pike.git / src / post_modules / Shuffler / a_source_pikestring.c

version» Context lines:

pike.git/src/post_modules/Shuffler/a_source_pikestring.c:1:   /*   || This file is part of Pike. For copyright information see COPYRIGHT.   || Pike is distributed under GPL, LGPL and MPL. See the file COPYING   || for more information. - || $Id: a_source_pikestring.c,v 1.7 2002/10/11 01:39:59 nilsson Exp $ + || $Id: a_source_pikestring.c,v 1.8 2003/03/14 15:57:49 grubba Exp $   */      #include "global.h"   #include "stralloc.h"   #include "bignum.h"   #include "interpret.h"      #include "shuffler.h"      
pike.git/src/post_modules/Shuffler/a_source_pikestring.c:62:    if( s->u.string->size_shift ) return 0;       res = malloc( sizeof( struct ps_source ) );    debug_malloc_touch( res );    debug_malloc_touch( s );    MEMSET( res, 0, sizeof( struct ps_source ) );       res->s.free_source = free_source;    res->s.get_data = get_data;    -  res->str = s->u.string; -  res->str->refs++; +  copy_shared_string(res->str, s->u.string);    res->offset = start;       if( len != -1 )    {    if( len > res->str->len-start )    { -  res->str->refs--; +  sub_ref(res->str);    free(res);    return 0;    }    else    res->len = len;    }    else    res->len = res->str->len-start;       if( res->len <= 0 )    { -  res->str->refs--; +  sub_ref(res->str);    free(res);    }    return (struct source *)res;   }      void source_pikestring_init( )   {    /* nothing to do here */   }      void source_pikestring_exit( )   {    /* nothing to do here */   }