From 17ceb4ac27c7b625192bc6c333cdc533060ada36 Mon Sep 17 00:00:00 2001 From: Marcus Comstedt <marcus@mc.pp.se> Date: Mon, 21 Oct 2002 00:05:08 +0200 Subject: [PATCH] Renamed "string" typedef in dynamic_buffer.h to avoid unneccesary name clashes. Rev: src/dynamic_buffer.c:1.22 Rev: src/dynamic_buffer.h:1.17 Rev: src/modules/Mysql/mysql.c:1.60 Rev: src/modules/Mysql/result.c:1.28 Rev: src/modules/sprintf/sprintf.c:1.98 Rev: src/svalue.c:1.148 --- src/dynamic_buffer.c | 12 ++++++------ src/dynamic_buffer.h | 14 +++++++------- src/modules/Mysql/mysql.c | 10 ++-------- src/modules/Mysql/result.c | 9 ++------- src/modules/sprintf/sprintf.c | 15 ++++++++++----- src/svalue.c | 10 +++++----- 6 files changed, 32 insertions(+), 38 deletions(-) diff --git a/src/dynamic_buffer.c b/src/dynamic_buffer.c index 65701ef77c..edf0528ba6 100644 --- a/src/dynamic_buffer.c +++ b/src/dynamic_buffer.c @@ -2,7 +2,7 @@ || 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.c,v 1.21 2002/10/11 01:39:30 nilsson Exp $ +|| $Id: dynamic_buffer.c,v 1.22 2002/10/20 22:05:07 marcus Exp $ */ #include "global.h" @@ -11,7 +11,7 @@ #include "pike_error.h" #include "pike_memory.h" -RCSID("$Id: dynamic_buffer.c,v 1.21 2002/10/11 01:39:30 nilsson Exp $"); +RCSID("$Id: dynamic_buffer.c,v 1.22 2002/10/20 22:05:07 marcus Exp $"); static dynamic_buffer buff; @@ -77,7 +77,7 @@ PMOD_EXPORT void low_reinit_buf(dynamic_buffer *buf) } } -PMOD_EXPORT void low_init_buf_with_string(string s, dynamic_buffer *buf) +PMOD_EXPORT void low_init_buf_with_string(dynbuf_string s, dynamic_buffer *buf) { if(buf->s.str) { free(buf->s.str); buf->s.str=NULL; } buf->s=s; @@ -92,9 +92,9 @@ PMOD_EXPORT void low_init_buf_with_string(string s, dynamic_buffer *buf) #endif } -PMOD_EXPORT string complex_free_buf(void) +PMOD_EXPORT dynbuf_string complex_free_buf(void) { - string tmp; + dynbuf_string tmp; if(!buff.s.str) return buff.s; my_putchar(0); buff.s.len--; @@ -133,7 +133,7 @@ PMOD_EXPORT void my_binary_strcat(const char *b, ptrdiff_t l) { low_my_binary_st PMOD_EXPORT void my_strcat(const char *b) { my_binary_strcat(b,strlen(b)); } PMOD_EXPORT void initialize_global_buf(void) { buff.s.str = NULL; } PMOD_EXPORT void init_buf(void) { low_reinit_buf(&buff); } -PMOD_EXPORT void init_buf_with_string(string s) { low_init_buf_with_string(s,&buff); } +PMOD_EXPORT void init_buf_with_string(dynbuf_string s) { low_init_buf_with_string(s,&buff); } PMOD_EXPORT char *debug_return_buf(void) { my_putchar(0); diff --git a/src/dynamic_buffer.h b/src/dynamic_buffer.h index 5ad3a8befa..50b65df576 100644 --- a/src/dynamic_buffer.h +++ b/src/dynamic_buffer.h @@ -2,7 +2,7 @@ || 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.16 2002/10/11 01:39:30 nilsson Exp $ +|| $Id: dynamic_buffer.h,v 1.17 2002/10/20 22:05:07 marcus Exp $ */ #ifndef DYNAMIC_BUFFER_H @@ -10,17 +10,17 @@ #define BUFFER_BEGIN_SIZE 4080 -struct string_s +struct dynbuf_string_s { char *str; SIZE_T len; }; -typedef struct string_s string; +typedef struct dynbuf_string_s dynbuf_string; struct dynamic_buffer_s { - string s; + dynbuf_string s; SIZE_T bufsize; }; @@ -32,8 +32,8 @@ PMOD_EXPORT void low_my_putchar(char b,dynamic_buffer *buf); PMOD_EXPORT void low_my_binary_strcat(const char *b, size_t l, dynamic_buffer *buf); 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(string s, dynamic_buffer *buf); -PMOD_EXPORT string complex_free_buf(void); +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); @@ -44,7 +44,7 @@ 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(string s); +PMOD_EXPORT void init_buf_with_string(dynbuf_string s); PMOD_EXPORT char *debug_return_buf(void); /* Prototypes end here */ diff --git a/src/modules/Mysql/mysql.c b/src/modules/Mysql/mysql.c index 2ac1ecd9a0..8f7a2454d3 100644 --- a/src/modules/Mysql/mysql.c +++ b/src/modules/Mysql/mysql.c @@ -2,7 +2,7 @@ || 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: mysql.c,v 1.59 2002/10/11 01:39:47 nilsson Exp $ +|| $Id: mysql.c,v 1.60 2002/10/20 22:05:07 marcus Exp $ */ /* @@ -58,12 +58,6 @@ #endif /* HAVE_ERRMGS_H */ -/* dynamic_buffer.h contains a conflicting typedef for string - * we don't use any dynamic buffers, so we have this work-around - */ -#define DYNAMIC_BUFFER_H -typedef struct dynamic_buffer_s dynamic_buffer; - #endif /* HAVE_MYSQL */ /* From the Pike-dist */ @@ -100,7 +94,7 @@ typedef struct dynamic_buffer_s dynamic_buffer; * Globals */ -RCSID("$Id: mysql.c,v 1.59 2002/10/11 01:39:47 nilsson Exp $"); +RCSID("$Id: mysql.c,v 1.60 2002/10/20 22:05:07 marcus Exp $"); /*! @module Mysql *! diff --git a/src/modules/Mysql/result.c b/src/modules/Mysql/result.c index 5cd3578a34..5ee8791d76 100644 --- a/src/modules/Mysql/result.c +++ b/src/modules/Mysql/result.c @@ -2,7 +2,7 @@ || 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: result.c,v 1.27 2002/10/11 01:39:47 nilsson Exp $ +|| $Id: result.c,v 1.28 2002/10/20 22:05:07 marcus Exp $ */ /* @@ -47,11 +47,6 @@ #endif #endif -/* dynamic_buffer.h contains a conflicting typedef for string - * we don't use any dynamic buffers, so we have this work-around - */ -#define DYNAMIC_BUFFER_H -typedef struct dynamic_buffer_s dynamic_buffer; /* From the Pike-dist */ #include "svalue.h" @@ -92,7 +87,7 @@ typedef struct dynamic_buffer_s dynamic_buffer; * Globals */ -RCSID("$Id: result.c,v 1.27 2002/10/11 01:39:47 nilsson Exp $"); +RCSID("$Id: result.c,v 1.28 2002/10/20 22:05:07 marcus Exp $"); struct program *mysql_result_program = NULL; diff --git a/src/modules/sprintf/sprintf.c b/src/modules/sprintf/sprintf.c index a2cb720071..d33b5078a7 100644 --- a/src/modules/sprintf/sprintf.c +++ b/src/modules/sprintf/sprintf.c @@ -2,7 +2,7 @@ || 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: sprintf.c,v 1.97 2002/10/11 01:39:55 nilsson Exp $ +|| $Id: sprintf.c,v 1.98 2002/10/20 22:05:08 marcus Exp $ */ /* TODO: use ONERROR to cleanup fsp */ @@ -286,7 +286,7 @@ *! @[lfun::_sprintf()] */ #include "global.h" -RCSID("$Id: sprintf.c,v 1.97 2002/10/11 01:39:55 nilsson Exp $"); +RCSID("$Id: sprintf.c,v 1.98 2002/10/20 22:05:08 marcus Exp $"); #include "pike_error.h" #include "array.h" #include "svalue.h" @@ -1513,7 +1513,7 @@ static void low_pike_sprintf(struct format_stack *fs, case 'O': { - string s; + dynbuf_string s; struct svalue *t; DO_OP(); /* No need to do CHECK_OBJECT_SPRINTF() here, @@ -1627,9 +1627,14 @@ static void low_pike_sprintf(struct format_stack *fs, /* An C-callable pike_sprintf -string pike_sprintf(char *format,struct svalue *argp,int num_arg) + +** This doesn't seem to work at all. The prototype for +** low_pike_sprintf has changed _a lot_ since this code was +** written. It should probably be removed. // Marcus + +dynbuf_string pike_sprintf(char *format,struct svalue *argp,int num_arg) { - string prefix; + dynbuf_string prefix; prefix.str=0; prefix.len=0; diff --git a/src/svalue.c b/src/svalue.c index 376d768e00..330099d6bf 100644 --- a/src/svalue.c +++ b/src/svalue.c @@ -2,7 +2,7 @@ || 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: svalue.c,v 1.147 2002/10/11 01:39:38 nilsson Exp $ +|| $Id: svalue.c,v 1.148 2002/10/20 22:05:07 marcus Exp $ */ #include "global.h" @@ -66,7 +66,7 @@ static int pike_isnan(double x) #endif /* HAVE__ISNAN */ #endif /* HAVE_ISNAN */ -RCSID("$Id: svalue.c,v 1.147 2002/10/11 01:39:38 nilsson Exp $"); +RCSID("$Id: svalue.c,v 1.148 2002/10/20 22:05:07 marcus Exp $"); struct svalue dest_ob_zero = { T_INT, 0, @@ -1240,7 +1240,7 @@ PMOD_EXPORT void describe_svalue(const struct svalue *s,int indent,struct proces * with tracing... */ int save_t_flag=t_flag; - string save_buffer=complex_free_buf(); + dynbuf_string save_buffer=complex_free_buf(); t_flag=0; SET_CYCLIC_RET(1); @@ -1404,8 +1404,8 @@ PMOD_EXPORT void describe_svalue(const struct svalue *s,int indent,struct proces PMOD_EXPORT void print_svalue (FILE *out, const struct svalue *s) { - string orig_str; - string str; + dynbuf_string orig_str; + dynbuf_string str; orig_str = complex_free_buf(); init_buf(); describe_svalue (s, 0, 0); -- GitLab