summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2005-09-13 21:23:51 (GMT)
committerdgp <dgp@users.sourceforge.net>2005-09-13 21:23:51 (GMT)
commitc483a47557d64385bc3cc9f65aedf8b6bf387843 (patch)
tree4ec0eea5f561d67d221ac1cac6c7ccde0cf4c8e9
parent0f676d700286952cb2db293c6dd1320dd31e7fe9 (diff)
downloadtcl-c483a47557d64385bc3cc9f65aedf8b6bf387843.zip
tcl-c483a47557d64385bc3cc9f65aedf8b6bf387843.tar.gz
tcl-c483a47557d64385bc3cc9f65aedf8b6bf387843.tar.bz2
* generic/tcl.h: Explicitly standardized on the use of stdarg.h
* generic/tclBasic.c: conventions for functions with variable number * generic/tclInt.h: of arguments. Support for varargs.h has been * generic/tclPanic.c: implicitly gone for some time now. All * generic/tclResult.c: TCL_VARARGS* macros purged from Tcl sources, * generic/tclStringObj.c: leaving only some deprecated #define's * tools/genStubs.tcl: in tcl.h for the sake of older extensions. * generic/tclDecls.h: make genstubs * doc/AddErrInfo.3: Replaced all documented requirement for use * doc/Eval.3: of TCL_VARARGS_START() with requirement for * doc/Panic.3: use of va_start(). * doc/SetResult.3: * doc/StringObj.3:
-rw-r--r--ChangeLog18
-rw-r--r--doc/AddErrInfo.36
-rw-r--r--doc/Eval.34
-rw-r--r--doc/Panic.34
-rw-r--r--doc/SetResult.34
-rw-r--r--doc/StringObj.34
-rw-r--r--generic/tcl.h34
-rw-r--r--generic/tclBasic.c9
-rw-r--r--generic/tclDecls.h22
-rw-r--r--generic/tclInt.h8
-rw-r--r--generic/tclPanic.c9
-rw-r--r--generic/tclResult.c13
-rw-r--r--generic/tclStringObj.c17
-rw-r--r--tools/genStubs.tcl12
14 files changed, 86 insertions, 78 deletions
diff --git a/ChangeLog b/ChangeLog
index 0cc4431..e4edf8b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,21 @@
+2005-09-13 Don Porter <dgp@users.sourceforge.net>
+
+ * generic/tcl.h: Explicitly standardized on the use of stdarg.h
+ * generic/tclBasic.c: conventions for functions with variable number
+ * generic/tclInt.h: of arguments. Support for varargs.h has been
+ * generic/tclPanic.c: implicitly gone for some time now. All
+ * generic/tclResult.c: TCL_VARARGS* macros purged from Tcl sources,
+ * generic/tclStringObj.c: leaving only some deprecated #define's
+ * tools/genStubs.tcl: in tcl.h for the sake of older extensions.
+
+ * generic/tclDecls.h: make genstubs
+
+ * doc/AddErrInfo.3: Replaced all documented requirement for use
+ * doc/Eval.3: of TCL_VARARGS_START() with requirement for
+ * doc/Panic.3: use of va_start().
+ * doc/SetResult.3:
+ * doc/StringObj.3:
+
2005-09-12 Don Porter <dgp@users.sourceforge.net>
* generic/tclStringObj.c (TclAppendFormattedObjs): Bug fix:
diff --git a/doc/AddErrInfo.3 b/doc/AddErrInfo.3
index 5332e6a..bc32cd1 100644
--- a/doc/AddErrInfo.3
+++ b/doc/AddErrInfo.3
@@ -5,10 +5,10 @@
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
-'\" RCS: @(#) $Id: AddErrInfo.3,v 1.14 2005/08/05 01:58:52 dgp Exp $
+'\" RCS: @(#) $Id: AddErrInfo.3,v 1.15 2005/09/13 21:23:51 dgp Exp $
'\"
.so man.macros
-.TH Tcl_AddErrorInfo 3 8.0 Tcl "Tcl Library Procedures"
+.TH Tcl_AddErrorInfo 3 8.5 Tcl "Tcl Library Procedures"
.BS
.SH NAME
Tcl_GetReturnOptions, Tcl_SetReturnOptions, Tcl_AddErrorInfo, Tcl_AddObjErrorInfo, Tcl_SetObjErrorCode, Tcl_SetErrorCode, Tcl_SetErrorCodeVA, Tcl_PosixError, Tcl_LogCommandInfo \- retrieve or record information about errors and other return options
@@ -66,7 +66,7 @@ String to record as one element of the \fB-errorcode\fR return option.
Last \fIelement\fR argument must be NULL.
.AP va_list argList in
An argument list which must have been initialized using
-\fBTCL_VARARGS_START\fR, and cleared using \fBva_end\fR.
+\fBva_start\fR, and cleared using \fBva_end\fR.
.AP "const char" *script in
Pointer to first character in script containing command (must be <= command)
.AP "const char" *command in
diff --git a/doc/Eval.3 b/doc/Eval.3
index 24b1648..d626964 100644
--- a/doc/Eval.3
+++ b/doc/Eval.3
@@ -6,7 +6,7 @@
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
-'\" RCS: @(#) $Id: Eval.3,v 1.21 2005/05/10 18:33:55 kennykb Exp $
+'\" RCS: @(#) $Id: Eval.3,v 1.22 2005/09/13 21:23:51 dgp Exp $
'\"
.so man.macros
.TH Tcl_Eval 3 8.1 Tcl "Tcl Library Procedures"
@@ -71,7 +71,7 @@ Points to first byte of script to execute (null-terminated and UTF-8).
String forming part of a Tcl script.
.AP va_list argList in
An argument list which must have been initialized using
-\fBTCL_VARARGS_START\fR, and cleared using \fBva_end\fR.
+\fBva_start\fR, and cleared using \fBva_end\fR.
.BE
.SH DESCRIPTION
diff --git a/doc/Panic.3 b/doc/Panic.3
index edd8615..0b2ec03 100644
--- a/doc/Panic.3
+++ b/doc/Panic.3
@@ -2,7 +2,7 @@
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
-'\" RCS: @(#) $Id: Panic.3,v 1.7 2004/10/07 15:15:47 dkf Exp $
+'\" RCS: @(#) $Id: Panic.3,v 1.8 2005/09/13 21:23:51 dgp Exp $
'\"
.so man.macros
.TH Tcl_Panic 3 8.4 Tcl "Tcl Library Procedures"
@@ -31,7 +31,7 @@ A printf-style format string.
Arguments matching the format string.
.AP va_list argList in
An argument list of arguments matching the format string.
-Must have been initialized using \fBTCL_VARARGS_START\fR,
+Must have been initialized using \fBva_start\fR,
and cleared using \fBva_end\fR.
.AP Tcl_PanicProc *panicProc in
Procedure to report fatal error message and abort.
diff --git a/doc/SetResult.3 b/doc/SetResult.3
index ad1261c..99aaff2 100644
--- a/doc/SetResult.3
+++ b/doc/SetResult.3
@@ -5,7 +5,7 @@
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
-'\" RCS: @(#) $Id: SetResult.3,v 1.13 2005/05/10 18:33:57 kennykb Exp $
+'\" RCS: @(#) $Id: SetResult.3,v 1.14 2005/09/13 21:23:51 dgp Exp $
'\"
.so man.macros
.TH Tcl_SetResult 3 8.0 Tcl "Tcl Library Procedures"
@@ -53,7 +53,7 @@ Address of procedure to call to release storage at
\fBTCL_VOLATILE\fR.
.AP va_list argList in
An argument list which must have been initialized using
-\fBTCL_VARARGS_START\fR, and cleared using \fBva_end\fR.
+\fBva_start\fR, and cleared using \fBva_end\fR.
.BE
.SH DESCRIPTION
diff --git a/doc/StringObj.3 b/doc/StringObj.3
index c16e9cc..f326315 100644
--- a/doc/StringObj.3
+++ b/doc/StringObj.3
@@ -4,7 +4,7 @@
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
-'\" RCS: @(#) $Id: StringObj.3,v 1.19 2005/05/10 18:33:57 kennykb Exp $
+'\" RCS: @(#) $Id: StringObj.3,v 1.20 2005/09/13 21:23:51 dgp Exp $
'\"
.so man.macros
.TH Tcl_StringObj 3 8.1 Tcl "Tcl Library Procedures"
@@ -113,7 +113,7 @@ the length of an object's string representation.
Null-terminated string value to append to \fIobjPtr\fR.
.AP va_list argList in
An argument list which must have been initialised using
-\fBTCL_VARARGS_START\fR, and cleared using \fBva_end\fR.
+\fBva_start\fR, and cleared using \fBva_end\fR.
.AP int newLength in
New length for the string value of \fIobjPtr\fR, not including the
final null character.
diff --git a/generic/tcl.h b/generic/tcl.h
index ff80a84..f75ae6f 100644
--- a/generic/tcl.h
+++ b/generic/tcl.h
@@ -13,7 +13,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tcl.h,v 1.202 2005/09/08 10:49:19 dkf Exp $
+ * RCS: @(#) $Id: tcl.h,v 1.203 2005/09/13 21:23:51 dgp Exp $
*/
#ifndef _TCL
@@ -153,26 +153,20 @@ extern "C" {
#include <stdio.h>
/*
- * Definitions that allow Tcl functions with variable numbers of arguments to
- * be used with either varargs.h or stdarg.h. TCL_VARARGS is used in function
- * prototypes. TCL_VARARGS_DEF is used to declare the arguments in a function
- * definiton: it takes the type and name of the first argument and supplies
- * the appropriate argument declaration string for use in the function
- * definition. TCL_VARARGS_START initializes the va_list data structure and
- * returns the first argument.
+ * Support for functions with a variable number of arguments.
+ *
+ * The following TCL_VARARGS* macros are to support old extensions
+ * written for older versions of Tcl where the macros permitted
+ * support for the varargs.h system as well as stdarg.h .
+ *
+ * New code should just directly be written to use stdarg.h conventions.
*/
-#if !defined(NO_STDARG)
-# include <stdarg.h>
-# define TCL_VARARGS(type, name) (type name, ...)
-# define TCL_VARARGS_DEF(type, name) (type name, ...)
-# define TCL_VARARGS_START(type, name, list) (va_start(list, name), name)
-#else
-# include <varargs.h>
-# define TCL_VARARGS(type, name) ()
-# define TCL_VARARGS_DEF(type, name) (va_alist)
-# define TCL_VARARGS_START(type, name, list) \
- (va_start(list), va_arg(list, type))
+#include <stdarg.h>
+#ifndef TCL_NO_DEPRECATED
+# define TCL_VARARGS(type, name) (type name, ...)
+# define TCL_VARARGS_DEF(type, name) (type name, ...)
+# define TCL_VARARGS_START(type, name, list) (va_start(list, name), name)
#endif
/*
@@ -694,7 +688,7 @@ typedef int (Tcl_ObjCmdProc) _ANSI_ARGS_((ClientData clientData,
typedef int (Tcl_PackageInitProc) _ANSI_ARGS_((Tcl_Interp *interp));
typedef int (Tcl_PackageUnloadProc) _ANSI_ARGS_((Tcl_Interp *interp,
int flags));
-typedef void (Tcl_PanicProc) _ANSI_ARGS_(TCL_VARARGS(CONST char *, format));
+typedef void (Tcl_PanicProc) _ANSI_ARGS_((CONST char *format, ...));
typedef void (Tcl_TcpAcceptProc) _ANSI_ARGS_((ClientData callbackData,
Tcl_Channel chan, char *address, int port));
typedef void (Tcl_TimerProc) _ANSI_ARGS_((ClientData clientData));
diff --git a/generic/tclBasic.c b/generic/tclBasic.c
index e9c12d9..7266c08 100644
--- a/generic/tclBasic.c
+++ b/generic/tclBasic.c
@@ -13,7 +13,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclBasic.c,v 1.169 2005/09/06 14:40:10 dkf Exp $
+ * RCS: @(#) $Id: tclBasic.c,v 1.170 2005/09/13 21:23:51 dgp Exp $
*/
#include "tclInt.h"
@@ -4859,15 +4859,14 @@ Tcl_VarEvalVA(interp, argList)
*
*----------------------------------------------------------------------
*/
- /* VARARGS2 */ /* ARGSUSED */
+ /* ARGSUSED */
int
-Tcl_VarEval TCL_VARARGS_DEF(Tcl_Interp *,arg1)
+Tcl_VarEval(Tcl_Interp *interp, ...)
{
- Tcl_Interp *interp;
va_list argList;
int result;
- interp = TCL_VARARGS_START(Tcl_Interp *,arg1,argList);
+ va_start(argList, interp);
result = Tcl_VarEvalVA(interp, argList);
va_end(argList);
diff --git a/generic/tclDecls.h b/generic/tclDecls.h
index d10cb4c..4528521 100644
--- a/generic/tclDecls.h
+++ b/generic/tclDecls.h
@@ -8,7 +8,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclDecls.h,v 1.115 2005/08/24 17:56:23 andreas_kupries Exp $
+ * RCS: @(#) $Id: tclDecls.h,v 1.116 2005/09/13 21:23:51 dgp Exp $
*/
#ifndef _TCLDECLS
@@ -55,7 +55,7 @@ EXTERN CONST84_RETURN char * Tcl_PkgRequireEx _ANSI_ARGS_((
#ifndef Tcl_Panic_TCL_DECLARED
#define Tcl_Panic_TCL_DECLARED
/* 2 */
-EXTERN void Tcl_Panic _ANSI_ARGS_(TCL_VARARGS(CONST char *,format));
+EXTERN void Tcl_Panic _ANSI_ARGS_((CONST char *format, ...));
#endif
#ifndef Tcl_Alloc_TCL_DECLARED
#define Tcl_Alloc_TCL_DECLARED
@@ -131,7 +131,7 @@ EXTERN int Tcl_AppendAllObjTypes _ANSI_ARGS_((
#ifndef Tcl_AppendStringsToObj_TCL_DECLARED
#define Tcl_AppendStringsToObj_TCL_DECLARED
/* 15 */
-EXTERN void Tcl_AppendStringsToObj _ANSI_ARGS_(TCL_VARARGS(Tcl_Obj *,objPtr));
+EXTERN void Tcl_AppendStringsToObj _ANSI_ARGS_((Tcl_Obj *objPtr, ...));
#endif
#ifndef Tcl_AppendToObj_TCL_DECLARED
#define Tcl_AppendToObj_TCL_DECLARED
@@ -461,7 +461,7 @@ EXTERN void Tcl_AppendElement _ANSI_ARGS_((Tcl_Interp * interp,
#ifndef Tcl_AppendResult_TCL_DECLARED
#define Tcl_AppendResult_TCL_DECLARED
/* 70 */
-EXTERN void Tcl_AppendResult _ANSI_ARGS_(TCL_VARARGS(Tcl_Interp *,interp));
+EXTERN void Tcl_AppendResult _ANSI_ARGS_((Tcl_Interp *interp, ...));
#endif
#ifndef Tcl_AsyncCreate_TCL_DECLARED
#define Tcl_AsyncCreate_TCL_DECLARED
@@ -1450,7 +1450,7 @@ EXTERN void Tcl_SetErrno _ANSI_ARGS_((int err));
#ifndef Tcl_SetErrorCode_TCL_DECLARED
#define Tcl_SetErrorCode_TCL_DECLARED
/* 228 */
-EXTERN void Tcl_SetErrorCode _ANSI_ARGS_(TCL_VARARGS(Tcl_Interp *,interp));
+EXTERN void Tcl_SetErrorCode _ANSI_ARGS_((Tcl_Interp *interp, ...));
#endif
#ifndef Tcl_SetMaxBlockTime_TCL_DECLARED
#define Tcl_SetMaxBlockTime_TCL_DECLARED
@@ -1653,7 +1653,7 @@ EXTERN int Tcl_UpVar2 _ANSI_ARGS_((Tcl_Interp * interp,
#ifndef Tcl_VarEval_TCL_DECLARED
#define Tcl_VarEval_TCL_DECLARED
/* 260 */
-EXTERN int Tcl_VarEval _ANSI_ARGS_(TCL_VARARGS(Tcl_Interp *,interp));
+EXTERN int Tcl_VarEval _ANSI_ARGS_((Tcl_Interp *interp, ...));
#endif
#ifndef Tcl_VarTraceInfo_TCL_DECLARED
#define Tcl_VarTraceInfo_TCL_DECLARED
@@ -3533,7 +3533,7 @@ typedef struct TclStubs {
int (*tcl_PkgProvideEx) _ANSI_ARGS_((Tcl_Interp* interp, CONST char* name, CONST char* version, ClientData clientData)); /* 0 */
CONST84_RETURN char * (*tcl_PkgRequireEx) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * name, CONST char * version, int exact, ClientData * clientDataPtr)); /* 1 */
- void (*tcl_Panic) _ANSI_ARGS_(TCL_VARARGS(CONST char *,format)); /* 2 */
+ void (*tcl_Panic) _ANSI_ARGS_((CONST char *format, ...)); /* 2 */
char * (*tcl_Alloc) _ANSI_ARGS_((unsigned int size)); /* 3 */
void (*tcl_Free) _ANSI_ARGS_((char * ptr)); /* 4 */
char * (*tcl_Realloc) _ANSI_ARGS_((char * ptr, unsigned int size)); /* 5 */
@@ -3556,7 +3556,7 @@ typedef struct TclStubs {
void (*tcl_Sleep) _ANSI_ARGS_((int ms)); /* 12 */
int (*tcl_WaitForEvent) _ANSI_ARGS_((Tcl_Time * timePtr)); /* 13 */
int (*tcl_AppendAllObjTypes) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Obj * objPtr)); /* 14 */
- void (*tcl_AppendStringsToObj) _ANSI_ARGS_(TCL_VARARGS(Tcl_Obj *,objPtr)); /* 15 */
+ void (*tcl_AppendStringsToObj) _ANSI_ARGS_((Tcl_Obj *objPtr, ...)); /* 15 */
void (*tcl_AppendToObj) _ANSI_ARGS_((Tcl_Obj* objPtr, CONST char* bytes, int length)); /* 16 */
Tcl_Obj * (*tcl_ConcatObj) _ANSI_ARGS_((int objc, Tcl_Obj *CONST objv[])); /* 17 */
int (*tcl_ConvertToType) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Obj * objPtr, Tcl_ObjType * typePtr)); /* 18 */
@@ -3611,7 +3611,7 @@ typedef struct TclStubs {
void (*tcl_AddObjErrorInfo) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * message, int length)); /* 67 */
void (*tcl_AllowExceptions) _ANSI_ARGS_((Tcl_Interp * interp)); /* 68 */
void (*tcl_AppendElement) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * element)); /* 69 */
- void (*tcl_AppendResult) _ANSI_ARGS_(TCL_VARARGS(Tcl_Interp *,interp)); /* 70 */
+ void (*tcl_AppendResult) _ANSI_ARGS_((Tcl_Interp *interp, ...)); /* 70 */
Tcl_AsyncHandler (*tcl_AsyncCreate) _ANSI_ARGS_((Tcl_AsyncProc * proc, ClientData clientData)); /* 71 */
void (*tcl_AsyncDelete) _ANSI_ARGS_((Tcl_AsyncHandler async)); /* 72 */
int (*tcl_AsyncInvoke) _ANSI_ARGS_((Tcl_Interp * interp, int code)); /* 73 */
@@ -3789,7 +3789,7 @@ typedef struct TclStubs {
int (*tcl_SetChannelOption) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Channel chan, CONST char * optionName, CONST char * newValue)); /* 225 */
int (*tcl_SetCommandInfo) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * cmdName, CONST Tcl_CmdInfo * infoPtr)); /* 226 */
void (*tcl_SetErrno) _ANSI_ARGS_((int err)); /* 227 */
- void (*tcl_SetErrorCode) _ANSI_ARGS_(TCL_VARARGS(Tcl_Interp *,interp)); /* 228 */
+ void (*tcl_SetErrorCode) _ANSI_ARGS_((Tcl_Interp *interp, ...)); /* 228 */
void (*tcl_SetMaxBlockTime) _ANSI_ARGS_((Tcl_Time * timePtr)); /* 229 */
void (*tcl_SetPanicProc) _ANSI_ARGS_((Tcl_PanicProc * panicProc)); /* 230 */
int (*tcl_SetRecursionLimit) _ANSI_ARGS_((Tcl_Interp * interp, int depth)); /* 231 */
@@ -3821,7 +3821,7 @@ typedef struct TclStubs {
void (*tcl_UpdateLinkedVar) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * varName)); /* 257 */
int (*tcl_UpVar) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * frameName, CONST char * varName, CONST char * localName, int flags)); /* 258 */
int (*tcl_UpVar2) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * frameName, CONST char * part1, CONST char * part2, CONST char * localName, int flags)); /* 259 */
- int (*tcl_VarEval) _ANSI_ARGS_(TCL_VARARGS(Tcl_Interp *,interp)); /* 260 */
+ int (*tcl_VarEval) _ANSI_ARGS_((Tcl_Interp *interp, ...)); /* 260 */
ClientData (*tcl_VarTraceInfo) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * varName, int flags, Tcl_VarTraceProc * procPtr, ClientData prevClientData)); /* 261 */
ClientData (*tcl_VarTraceInfo2) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * part1, CONST char * part2, int flags, Tcl_VarTraceProc * procPtr, ClientData prevClientData)); /* 262 */
int (*tcl_Write) _ANSI_ARGS_((Tcl_Channel chan, CONST char * s, int slen)); /* 263 */
diff --git a/generic/tclInt.h b/generic/tclInt.h
index 689f95f..43d12c7 100644
--- a/generic/tclInt.h
+++ b/generic/tclInt.h
@@ -12,7 +12,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclInt.h,v 1.250 2005/09/09 17:47:18 dgp Exp $
+ * RCS: @(#) $Id: tclInt.h,v 1.251 2005/09/13 21:23:51 dgp Exp $
*/
#ifndef _TCLINT
@@ -2001,7 +2001,7 @@ MODULE_SCOPE void TclFinalizePreserve(void);
MODULE_SCOPE void TclFinalizeSynchronization(void);
MODULE_SCOPE void TclFinalizeThreadData(void);
MODULE_SCOPE void TclFormatNaN(double value, char* buffer);
-MODULE_SCOPE int TclFormatObj TCL_VARARGS(Tcl_Interp *, arg1);
+MODULE_SCOPE int TclFormatObj(Tcl_Interp *arg1, ...);
MODULE_SCOPE int TclFSFileAttrIndex(Tcl_Obj *pathPtr,
CONST char *attributeName, int *indexPtr);
MODULE_SCOPE Tcl_Obj * TclGetBgErrorHandler(Tcl_Interp *interp);
@@ -2053,7 +2053,7 @@ MODULE_SCOPE int TclMergeReturnOptions(Tcl_Interp *interp, int objc,
MODULE_SCOPE int TclObjInvokeNamespace(Tcl_Interp *interp,
int objc, Tcl_Obj *CONST objv[],
Tcl_Namespace *nsPtr, int flags);
-MODULE_SCOPE int TclObjPrintf TCL_VARARGS(Tcl_Interp *, arg1);
+MODULE_SCOPE int TclObjPrintf(Tcl_Interp *arg1, ...);
MODULE_SCOPE int TclParseBackslash(CONST char *src,
int numBytes, int *readPtr, char *dst);
MODULE_SCOPE int TclParseHex(CONST char *src, int numBytes,
@@ -2112,7 +2112,7 @@ MODULE_SCOPE Tcl_Obj* TclpObjLink(Tcl_Obj *pathPtr, Tcl_Obj *toPtr,
MODULE_SCOPE int TclpObjChdir(Tcl_Obj *pathPtr);
MODULE_SCOPE Tcl_Obj * TclPathPart(Tcl_Interp *interp, Tcl_Obj *pathPtr,
Tcl_PathPart portion);
-MODULE_SCOPE void TclpPanic TCL_VARARGS(CONST char *, format);
+MODULE_SCOPE void TclpPanic(CONST char *format, ...);
MODULE_SCOPE char * TclpReadlink(CONST char *fileName,
Tcl_DString *linkPtr);
MODULE_SCOPE void TclpReleaseFile(TclFile file);
diff --git a/generic/tclPanic.c b/generic/tclPanic.c
index 9b1c36f..b69706c 100644
--- a/generic/tclPanic.c
+++ b/generic/tclPanic.c
@@ -12,7 +12,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclPanic.c,v 1.6 2005/07/19 22:45:35 dkf Exp $
+ * RCS: @(#) $Id: tclPanic.c,v 1.7 2005/09/13 21:23:51 dgp Exp $
*/
#include "tclInt.h"
@@ -120,14 +120,13 @@ Tcl_PanicVA(format, argList)
*----------------------------------------------------------------------
*/
- /* VARARGS ARGSUSED */
+ /* ARGSUSED */
void
-Tcl_Panic TCL_VARARGS_DEF(CONST char *,arg1)
+Tcl_Panic(CONST char *format, ...)
{
va_list argList;
- CONST char *format;
- format = TCL_VARARGS_START(CONST char *,arg1,argList);
+ va_start(argList, format);
Tcl_PanicVA(format, argList);
va_end (argList);
}
diff --git a/generic/tclResult.c b/generic/tclResult.c
index 1cc9028..53b45a0 100644
--- a/generic/tclResult.c
+++ b/generic/tclResult.c
@@ -8,7 +8,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclResult.c,v 1.30 2005/09/02 19:23:46 andreas_kupries Exp $
+ * RCS: @(#) $Id: tclResult.c,v 1.31 2005/09/13 21:23:51 dgp Exp $
*/
#include "tclInt.h"
@@ -663,12 +663,11 @@ Tcl_AppendResultVA(interp, argList)
*/
void
-Tcl_AppendResult TCL_VARARGS_DEF(Tcl_Interp *,arg1)
+Tcl_AppendResult(Tcl_Interp *interp, ...)
{
- Tcl_Interp *interp;
va_list argList;
- interp = TCL_VARARGS_START(Tcl_Interp *,arg1,argList);
+ va_start(argList, interp);
Tcl_AppendResultVA(interp, argList);
va_end(argList);
}
@@ -1030,11 +1029,9 @@ Tcl_SetErrorCodeVA(interp, argList)
*----------------------------------------------------------------------
*/
- /* VARARGS2 */
void
-Tcl_SetErrorCode TCL_VARARGS_DEF(Tcl_Interp *,arg1)
+Tcl_SetErrorCode(Tcl_Interp *interp, ...)
{
- Tcl_Interp *interp;
va_list argList;
/*
@@ -1042,7 +1039,7 @@ Tcl_SetErrorCode TCL_VARARGS_DEF(Tcl_Interp *,arg1)
* errorCode field as list elements.
*/
- interp = TCL_VARARGS_START(Tcl_Interp *,arg1,argList);
+ va_start(argList, interp);
Tcl_SetErrorCodeVA(interp, argList);
va_end(argList);
}
diff --git a/generic/tclStringObj.c b/generic/tclStringObj.c
index dd1a2eb..0b2cdb2 100644
--- a/generic/tclStringObj.c
+++ b/generic/tclStringObj.c
@@ -33,7 +33,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclStringObj.c,v 1.43 2005/09/12 14:31:15 dgp Exp $ */
+ * RCS: @(#) $Id: tclStringObj.c,v 1.44 2005/09/13 21:23:51 dgp Exp $ */
#include "tclInt.h"
@@ -1662,12 +1662,11 @@ Tcl_AppendStringsToObjVA (objPtr, argList)
*/
void
-Tcl_AppendStringsToObj TCL_VARARGS_DEF(Tcl_Obj *,arg1)
+Tcl_AppendStringsToObj(Tcl_Obj *objPtr, ...)
{
- register Tcl_Obj *objPtr;
va_list argList;
- objPtr = TCL_VARARGS_START(Tcl_Obj *,arg1,argList);
+ va_start(argList, objPtr);
Tcl_AppendStringsToObjVA(objPtr, argList);
va_end(argList);
}
@@ -2260,11 +2259,12 @@ FormatObjVA(interp, argList)
*/
int
-TclFormatObj TCL_VARARGS_DEF(Tcl_Interp *,arg1)
+TclFormatObj(Tcl_Interp *interp, ...)
{
va_list argList;
int result;
- Tcl_Interp *interp = TCL_VARARGS_START(Tcl_Interp *,arg1,argList);
+
+ va_start(argList, interp);
result = FormatObjVA(interp, argList);
va_end(argList);
return result;
@@ -2384,11 +2384,12 @@ ObjPrintfVA(interp, argList)
*/
int
-TclObjPrintf TCL_VARARGS_DEF(Tcl_Interp *,arg1)
+TclObjPrintf(Tcl_Interp *interp, ...)
{
va_list argList;
int result;
- Tcl_Interp *interp = TCL_VARARGS_START(Tcl_Interp *,arg1,argList);
+
+ va_start(argList, interp);
result = ObjPrintfVA(interp, argList);
va_end(argList);
return result;
diff --git a/tools/genStubs.tcl b/tools/genStubs.tcl
index 15cb0a2..788ab7a 100644
--- a/tools/genStubs.tcl
+++ b/tools/genStubs.tcl
@@ -8,7 +8,7 @@
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
-# RCS: @(#) $Id: genStubs.tcl,v 1.17 2004/03/17 18:14:18 das Exp $
+# RCS: @(#) $Id: genStubs.tcl,v 1.18 2005/09/13 21:23:51 dgp Exp $
package require Tcl 8
@@ -371,7 +371,7 @@ proc genStubs::makeDecl {name decl index} {
}
TCL_VARARGS {
set arg [lindex $args 1]
- append line "TCL_VARARGS([lindex $arg 0],[lindex $arg 1])"
+ append line "([lindex $arg 0][lindex $arg 1], ...)"
}
default {
set sep "("
@@ -464,13 +464,13 @@ proc genStubs::makeStub {name decl index} {
if {![string compare $arg1 "TCL_VARARGS"]} {
lassign [lindex $args 1] type argName
- append text " TCL_VARARGS_DEF($type,$argName)\n\{\n"
+ append text " ($type$argName, ...)\n\{\n"
append text " " $type " var;\n va_list argList;\n"
if {[string compare $rtype "void"]} {
append text " " $rtype " resultValue;\n"
}
- append text "\n var = (" $type ") TCL_VARARGS_START(" \
- $type "," $argName ",argList);\n\n "
+ append text "\n var = (" $type ") (va_start(argList, " \
+ $argName "), " $argName ");\n\n "
if {[string compare $rtype "void"]} {
append text "resultValue = "
}
@@ -533,7 +533,7 @@ proc genStubs::makeSlot {name decl index} {
}
TCL_VARARGS {
set arg [lindex $args 1]
- append text "TCL_VARARGS([lindex $arg 0],[lindex $arg 1])"
+ append text "([lindex $arg 0][lindex $arg 1], ...)"
}
default {
set sep "("