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: dynamic_buffer.h,v 1.18 2003/04/02 19:22:43 mast Exp $ + || $Id: dynamic_buffer.h,v 1.19 2003/11/09 01:10:13 mast Exp $   */      #ifndef DYNAMIC_BUFFER_H
33:   PMOD_EXPORT void debug_initialize_buf(dynamic_buffer *buf);   PMOD_EXPORT void low_reinit_buf(dynamic_buffer *buf);   PMOD_EXPORT void low_init_buf_with_string(dynbuf_string s, dynamic_buffer *buf); - PMOD_EXPORT dynbuf_string complex_free_buf(void); +    PMOD_EXPORT void toss_buffer(dynamic_buffer *buf); - PMOD_EXPORT char *simple_free_buf(void); +    PMOD_EXPORT struct pike_string *debug_low_free_buf(dynamic_buffer *buf); - PMOD_EXPORT struct pike_string *debug_free_buf(void); +  + PMOD_EXPORT dynbuf_string complex_free_buf(dynamic_buffer *old_buf); + PMOD_EXPORT char *simple_free_buf(dynamic_buffer *old_buf); + PMOD_EXPORT struct pike_string *debug_free_buf(dynamic_buffer *old_buf);   PMOD_EXPORT char *make_buf_space(INT32 space);   PMOD_EXPORT void my_putchar(int b);   PMOD_EXPORT void my_binary_strcat(const char *b, ptrdiff_t l);   PMOD_EXPORT void my_strcat(const char *b); - PMOD_EXPORT void initialize_global_buf(void); - PMOD_EXPORT void init_buf(void); - PMOD_EXPORT void init_buf_with_string(dynbuf_string s); - PMOD_EXPORT char *debug_return_buf(void); + PMOD_EXPORT void init_buf(dynamic_buffer *old_buf); + PMOD_EXPORT void init_buf_with_string(dynamic_buffer *old_buf, dynbuf_string s); + PMOD_EXPORT void save_buffer (dynamic_buffer *save_buf); + PMOD_EXPORT void restore_buffer (dynamic_buffer *save_buf); + /* PMOD_EXPORT char *debug_return_buf(void); */   /* Prototypes end here */      #ifdef DEBUG_MALLOC
55:   #define low_free_buf(X) \    ((struct pike_string *)debug_malloc_pass(debug_low_free_buf(X)))    - #define free_buf() \ -  ((struct pike_string *)debug_malloc_pass(debug_free_buf())) + #define free_buf(OLD_BUF) \ +  ((struct pike_string *)debug_malloc_pass(debug_free_buf(OLD_BUF)))      #define return_buf() \    ((char *)debug_malloc_pass(debug_return_buf()))