Branch: Tag:

1998-11-22

1998-11-22 11:08:52 by Fredrik Hübinette (Hubbe) <hubbe@hubbe.net>

New module: Perl

Rev: src/ChangeLog:1.157
Rev: src/README:1.8
Rev: src/acconfig.h:1.35
Rev: src/array.c:1.42
Rev: src/array.h:1.14
Rev: src/backend.c:1.40
Rev: src/builtin_functions.c:1.140
Rev: src/callback.c:1.15
Rev: src/compilation.h:1.13
Rev: src/configure.in:1.254
Rev: src/cpp.c:1.30
Rev: src/docode.c:1.42
Rev: src/dynamic_buffer.c:1.9
Rev: src/encode.c:1.26
Rev: src/error.c:1.22
Rev: src/error.h:1.25
Rev: src/fd_control.c:1.22
Rev: src/fdlib.h:1.21
Rev: src/gc.c:1.39
Rev: src/gc.h:1.20
Rev: src/global.h:1.26
Rev: src/hashtable.c:1.5
Rev: src/interpret.c:1.111
Rev: src/interpret.h:1.24
Rev: src/language.yacc:1.108
Rev: src/las.c:1.71
Rev: src/las.h:1.17
Rev: src/lex.c:1.58
Rev: src/lex.h:1.12
Rev: src/main.c:1.60
Rev: src/mapping.c:1.37
Rev: src/modules/Odbc/odbc.c:1.12
Rev: src/modules/Perl/.cvsignore:1.1
Rev: src/modules/Perl/Makefile.in:1.1
Rev: src/modules/Perl/configure.in:1.1
Rev: src/modules/Perl/perlmod.c:1.1
Rev: src/modules/Perl/testsuite.in:1.1
Rev: src/modules/Postgres/postgres.c:1.10
Rev: src/modules/Regexp/pike_regexp.c:1.13
Rev: src/modules/call_out/call_out.c:1.23
Rev: src/modules/files/file.c:1.128
Rev: src/modules/files/socket.c:1.40
Rev: src/modules/spider/spider.c:1.76
Rev: src/modules/sprintf/sprintf.c:1.31
Rev: src/multiset.c:1.12
Rev: src/object.c:1.53
Rev: src/opcodes.c:1.32
Rev: src/operators.c:1.44
Rev: src/peep.c:1.25
Rev: src/pike_memory.c:1.28
Rev: src/pike_types.c:1.49
Rev: src/pike_types.h:1.16
Rev: src/port.c:1.18
Rev: src/port.h:1.20
Rev: src/program.c:1.105
Rev: src/program.h:1.46
Rev: src/signal_handler.c:1.89
Rev: src/stralloc.c:1.50
Rev: src/stralloc.h:1.26
Rev: src/svalue.c:1.39
Rev: src/svalue.h:1.19
Rev: src/threads.c:1.85
Rev: src/threads.h:1.60

15:      #include <ctype.h>    - RCSID("$Id: stralloc.c,v 1.49 1998/10/29 16:37:33 grubba Exp $"); + RCSID("$Id: stralloc.c,v 1.50 1998/11/22 11:03:18 hubbe Exp $");      #define BEGIN_HASH_SIZE 997   #define MAX_AVG_LINK_LENGTH 3
90:      INLINE unsigned INT32 index_shared_string(struct pike_string *s, int pos)   { - #ifdef DEBUG + #ifdef PIKE_DEBUG    if(pos > s->len || pos<0) {    if (s->len) {    fatal("String index %d is out of range [0 - %d]!\n", pos, s->len-1);
104:      INLINE void low_set_index(struct pike_string *s, int pos, int value)   { - #ifdef DEBUG + #ifdef PIKE_DEBUG    if(pos > s->len || pos<0)    fatal("string index out of range!\n");   
121:    }   }    - #ifdef DEBUG + #ifdef PIKE_DEBUG   struct INLINE pike_string *debug_check_size_shift(struct pike_string *a,int shift)   {    if(a->size_shift != shift)
208:   }       - #ifdef DEBUG + #ifdef PIKE_DEBUG   #ifdef DEBUG_MALLOC   #define DM(X) X   #else
272:       for(base = prev = base_table + h;( curr=*prev ); prev=&curr->next)    { - #ifdef DEBUG + #ifdef PIKE_DEBUG    if(curr->refs<1)    {    debug_dump_pike_string(curr, 70);
323:    *base=curr;    return curr;    } - #ifdef DEBUG + #ifdef PIKE_DEBUG    if(curr->refs<1)    {    debug_dump_pike_string(curr, 70);
374:   struct pike_string *debug_begin_shared_string(int len)   {    struct pike_string *t; - #ifdef DEBUG + #ifdef PIKE_DEBUG    extern int d_flag;    if(d_flag>10)    verify_shared_strings_tables();
400:   struct pike_string *debug_begin_wide_shared_string(int len, int shift)   {    struct pike_string *t; - #ifdef DEBUG + #ifdef PIKE_DEBUG    extern int d_flag;    if(d_flag>10)    verify_shared_strings_tables();
424:    len=s->len;    h=do_hash(s);    s2=internal_findstring(s->str,len,s->size_shift,h); - #ifdef DEBUG + #ifdef PIKE_DEBUG    if(s2==s)    fatal("end_shared_string called twice! (or something like that)\n");   #endif
600:    h=do_hash(s);    propagate_shared_string(s,h);    base_table[h]=s->next; - #ifdef DEBUG + #ifdef PIKE_DEBUG    s->next=(struct pike_string *)-1;   #endif    num_strings--;
608:      void really_free_string(struct pike_string *s)   { - #ifdef DEBUG + #ifdef PIKE_DEBUG    extern int d_flag;    if(d_flag > 2)    {
683:    return free_buf();   }    - /*** DEBUG ***/ - #ifdef DEBUG + /*** PIKE_DEBUG ***/ + #ifdef PIKE_DEBUG      void check_string(struct pike_string *s)   {
1052:    INT32 c)   {    INT32 old_value; - #ifdef DEBUG + #ifdef PIKE_DEBUG    if(index<0 || index>=a->len)    fatal("Index out of range in modify_shared_string()\n");   #endif
1248:    INT32 start,    INT32 len)   { - #ifdef DEBUG + #ifdef PIKE_DEBUG    if(start < 0 || len<0 || start+len>s->len )    {    fatal("string_slice, start = %d, len = %d, s->len = %d\n",start,len,s->len);
1385:    unsigned INT32 e;    struct pike_string *s,*next;    - #if defined(DEBUG) && defined(DEBUG_MALLOC) + #if defined(PIKE_DEBUG) && defined(DEBUG_MALLOC)    while(all_shared_string_locations)    {    struct shared_string_location *x=all_shared_string_locations;
1441:    size_+=sizeof(struct pike_string)+(p->len<<p->size_shift);    }    } - #ifdef DEBUG + #ifdef PIKE_DEBUG    if(num_strings != num_)    fatal("Num strings is wrong! %d!=%d.\n",num_strings, num_);   #endif
1545:    INT32 offset)   {    INT32 tmp; - #ifdef DEBUG + #ifdef PIKE_DEBUG    if(len<=0)    fatal("Cannot fill with zero length strings!\n");   #endif