diff options
Diffstat (limited to 'doc/CrtMathFnc.3')
-rw-r--r-- | doc/CrtMathFnc.3 | 61 |
1 files changed, 57 insertions, 4 deletions
diff --git a/doc/CrtMathFnc.3 b/doc/CrtMathFnc.3 index 23fabd4..69aca3d 100644 --- a/doc/CrtMathFnc.3 +++ b/doc/CrtMathFnc.3 @@ -5,20 +5,29 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: CrtMathFnc.3,v 1.4 2001/04/24 20:59:17 kennykb Exp $ +'\" RCS: @(#) $Id: CrtMathFnc.3,v 1.5 2001/05/30 08:57:05 dkf Exp $ '\" .so man.macros -.TH Tcl_CreateMathFunc 3 7.0 Tcl "Tcl Library Procedures" +.TH Tcl_CreateMathFunc 3 8.4 Tcl "Tcl Library Procedures" .BS .SH NAME -Tcl_CreateMathFunc \- Define a new math function for expressions +Tcl_CreateMathFunc, Tcl_GetMathFuncInfo, Tcl_ListMathFuncs \- Define, query and enumerate math functions for expressions .SH SYNOPSIS .nf \fB#include <tcl.h>\fR .sp +void \fBTcl_CreateMathFunc\fR(\fIinterp, name, numArgs, argTypes, proc, clientData\fR) +.sp +.VS 8.4 +int +\fBTcl_GetMathFuncInfo\fR(\fIinterp, name, numArgsPtr, argTypesPtr, procPtr, clientDataPtr\fR) +.sp +Tcl_Obj * +\fBTcl_ListMathFuncs\fR(\fIinterp, pattern\fR) +.VE .SH ARGUMENTS -.AS Tcl_ValueType clientData +.AS Tcl_ValueType *clientDataPtr .AP Tcl_Interp *interp in Interpreter in which new function will be defined. .VS 8.4 @@ -34,6 +43,24 @@ function. Procedure that implements the function. .AP ClientData clientData in Arbitrary one-word value to pass to \fIproc\fR when it is invoked. +.AP int *numArgsPtr out +Points to a variable that will be set to contain the number of +arguments to the function. +.AP Tcl_ValueType *argTypesPtr out +Points to a variable that will be set to contain a pointer to an array +giving the permissible types for each argument to the function which +will need to be freed up using \fITcl_Free\fR. +.AP Tcl_MathProc *procPtr out +Points to a variable that will be set to contain a pointer to the +implementation code for the function (or NULL if the function is +implemented directly in bytecode.) +.AP ClientData *clientDataPtr out +Points to a variable that will be set to contain the clientData +argument passed to \fITcl_CreateMathFunc\fR when the function was +created if the function is not implemented directly in bytecode. +.AP "CONST char" *pattern in +Pattern to match against function names so as to filter them (by +passing to \fITcl_StringMatch\fR), or NULL to not apply any filter. .BE .SH DESCRIPTION @@ -90,6 +117,32 @@ to indicate which value was set. Under normal circumstances \fIproc\fR should return TCL_OK. If an error occurs while executing the function, \fIproc\fR should return TCL_ERROR and leave an error message in the interpreter's result. +.PP +.VS 8.4 +\fBTcl_GetMathFuncInfo\fR retrieves the values associated with +function \fIname\fR that were passed to a preceding +\fBTcl_CreateMathFunc\fR call. Normally, the return code is +\fBTCL_OK\fR but if the named function does not exist, \fBTCL_ERROR\fR +is returned and an error message is placed in the interpreter's +result. +.PP +If an error did not occur, the array reference placed in the variable +pointed to by \fIargTypesPtr\fR is newly allocated, and should be +released by passing it to \fBTcl_Free\fR. Some functions (the +standard set implemented in the core) are implemented directly at the +bytecode level; attempting to retrieve values for them causes a NULL +to be stored in the variable pointed to by \fIprocPtr\fR and the +variable pointed to by \fIclientDataPtr\fR will not be modified. +.PP +\fBTcl_ListMathFuncs\fR returns a Tcl object containing a list of all +the math functions defined in the interpreter whose name matches +\fIpattern\fR. In the case of an error, NULL is returned and an error +message is left in the interpreter result, and otherwise the returned +object will have a reference count of zero. +.VE .SH KEYWORDS expression, mathematical function + +.SH "SEE ALSO" +expr(n), info(n), Tcl_Free(3), Tcl_NewListObj(3) |