Branch: Tag:

2003-11-09

2003-11-09 01:10:15 by Martin Stjernholm <mast@lysator.liu.se>

Made the interface for the global dynamic buffer reentrant.

Rev: src/apply_low.h:1.25
Rev: src/array.c:1.151
Rev: src/dynamic_buffer.c:1.24
Rev: src/dynamic_buffer.h:1.19
Rev: src/error.c:1.117
Rev: src/interpret.c:1.337
Rev: src/interpret_functions.h:1.161
Rev: src/las.c:1.341
Rev: src/mapping.c:1.173
Rev: src/modules/sprintf/sprintf.c:1.115
Rev: src/multiset.c:1.79
Rev: src/pike_types.c:1.224
Rev: src/program.c:1.530
Rev: src/stralloc.c:1.160
Rev: src/svalue.c:1.179

2:   || 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: pike_types.c,v 1.223 2003/09/09 14:31:00 mast Exp $ + || $Id: pike_types.c,v 1.224 2003/11/09 01:10:14 mast Exp $   */      #include "global.h" - RCSID("$Id: pike_types.c,v 1.223 2003/09/09 14:31:00 mast Exp $"); + RCSID("$Id: pike_types.c,v 1.224 2003/11/09 01:10:14 mast Exp $");   #include <ctype.h>   #include "svalue.h"   #include "pike_types.h"
1794:      struct pike_string *describe_type(struct pike_type *type)   { +  dynamic_buffer save_buf;    check_type_string(type);    if(!type) return make_shared_string("mixed"); -  init_buf(); +  init_buf(&save_buf);    low_describe_type(type); -  return free_buf(); +  return free_buf(&save_buf);   }      
2203: Inside #if defined(PIKE_TYPE_DEBUG)
   int flags);       if (l_flag>2) { -  init_buf(); +  dynamic_buffer save_buf; +  init_buf(&save_buf);    for(e=0;e<indent;e++) my_strcat(" ");    my_strcat("low_match_types(");    my_describe_type(a);
2246: Inside #if defined(PIKE_TYPE_DEBUG)
   my_strcat("0");    }    my_strcat(");\n"); -  fprintf(stderr,"%s",(s=simple_free_buf())); +  fprintf(stderr,"%s",(s=simple_free_buf(&save_buf)));    free(s);    indent++;    }
2254: Inside #if defined(PIKE_TYPE_DEBUG)
   a = low_match_types2(a, b, flags);       if (l_flag>2) { +  dynamic_buffer save_buf;    indent--; -  init_buf(); +  init_buf(&save_buf);    for(e=0;e<indent;e++) my_strcat(" ");    my_strcat("= ");    if(a)
2263: Inside #if defined(PIKE_TYPE_DEBUG)
   else    my_strcat("NULL");    my_strcat("\n"); -  fprintf(stderr,"%s",(s=simple_free_buf())); +  fprintf(stderr,"%s",(s=simple_free_buf(&save_buf)));    free(s);    }    return a;
2333: Inside #if defined(PIKE_TYPE_DEBUG)
     #ifdef PIKE_TYPE_DEBUG    if (l_flag>2) { +  dynamic_buffer save_buf;    char *s;    int e; -  init_buf(); +  init_buf(&save_buf);    for(e=0;e<indent;e++) my_strcat(" ");    my_strcat("a_markers[");    my_putchar((char)(m+'0'));    my_strcat("]=");    my_describe_type(a_markers[m]);    my_strcat("\n"); -  fprintf(stderr,"%s",(s=simple_free_buf())); +  fprintf(stderr,"%s",(s=simple_free_buf(&save_buf)));    free(s);    }   #endif
2419: Inside #if defined(PIKE_TYPE_DEBUG)
   b_markers[m] = pop_unfinished_type();   #ifdef PIKE_TYPE_DEBUG    if (l_flag>2) { +  dynamic_buffer save_buf;    char *s;    int e; -  init_buf(); +  init_buf(&save_buf);    for(e=0;e<indent;e++) my_strcat(" ");    my_strcat("b_markers[");    my_putchar((char)(m+'0'));    my_strcat("]=");    my_describe_type(b_markers[m]);    my_strcat("\n"); -  fprintf(stderr,"%s",(s=simple_free_buf())); +  fprintf(stderr,"%s",(s=simple_free_buf(&save_buf)));    free(s);    }   #endif
2753: Inside #if defined(PIKE_TYPE_DEBUG)
   char buf[50];       if (l_flag>2) { -  init_buf(); +  dynamic_buffer save_buf; +  init_buf(&save_buf);    for(e=0;e<indent;e++) my_strcat(" ");    my_strcat("low_pike_types_le(");    my_describe_type(a);
2770: Inside #if defined(PIKE_TYPE_DEBUG)
   sprintf(buf, "0x%08x", flags);    my_strcat(buf);    my_strcat(");\n"); -  fprintf(stderr,"%s",(s=simple_free_buf())); +  fprintf(stderr,"%s",(s=simple_free_buf(&save_buf)));    free(s);    indent++;    }
2877: Inside #if defined(PIKE_TYPE_DEBUG)
   a_markers[m] = pop_unfinished_type();   #ifdef PIKE_TYPE_DEBUG    if (l_flag>2) { +  dynamic_buffer save_buf;    char *s;    int e; -  init_buf(); +  init_buf(&save_buf);    for(e=0;e<indent;e++) my_strcat(" ");    my_strcat("a_markers[");    my_putchar((char)(m+'0'));    my_strcat("]=");    my_describe_type(a_markers[m]);    my_strcat("\n"); -  fprintf(stderr,"%s",(s=simple_free_buf())); +  fprintf(stderr,"%s",(s=simple_free_buf(&save_buf)));    free(s);    }   #endif
2961: Inside #if defined(PIKE_TYPE_DEBUG)
   b_markers[m]=pop_unfinished_type();   #ifdef PIKE_TYPE_DEBUG    if (l_flag>2) { +  dynamic_buffer save_buf;    char *s;    int e; -  init_buf(); +  init_buf(&save_buf);    for(e=0;e<indent;e++) my_strcat(" ");    my_strcat("b_markers[");    my_putchar((char)(m+'0'));    my_strcat("]=");    my_describe_type(b_markers[m]);    my_strcat("\n"); -  fprintf(stderr,"%s",(s=simple_free_buf())); +  fprintf(stderr,"%s",(s=simple_free_buf(&save_buf)));    free(s);    }   #endif
4844:      struct pike_string *type_to_string(struct pike_type *t)   { -  init_buf(); +  dynamic_buffer save_buf; +  init_buf(&save_buf);    low_type_to_string(t); -  return free_buf(); +  return free_buf(&save_buf);   }      void init_types(void)