summaryrefslogtreecommitdiffstats
path: root/doc/Limit.3
diff options
context:
space:
mode:
Diffstat (limited to 'doc/Limit.3')
-rw-r--r--doc/Limit.338
1 files changed, 17 insertions, 21 deletions
diff --git a/doc/Limit.3 b/doc/Limit.3
index 6502919..20a2e02 100644
--- a/doc/Limit.3
+++ b/doc/Limit.3
@@ -4,10 +4,8 @@
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
-'\" RCS: @(#) $Id: Limit.3,v 1.1 2004/05/30 12:18:25 dkf Exp $
-'\"
-.so man.macros
.TH Tcl_LimitCheck 3 8.5 Tcl "Tcl Library Procedures"
+.so man.macros
.BS
.SH NAME
Tcl_LimitAddHandler, Tcl_LimitCheck, Tcl_LimitExceeded, Tcl_LimitGetCommands, Tcl_LimitGetGranularity, Tcl_LimitGetTime, Tcl_LimitReady, Tcl_LimitRemoveHandler, Tcl_LimitSetCommands, Tcl_LimitSetGranularity, Tcl_LimitSetTime, Tcl_LimitTypeEnabled, Tcl_LimitTypeExceeded, Tcl_LimitTypeReset, Tcl_LimitTypeSet \- manage and check resource limits on interpreters
@@ -60,13 +58,13 @@ void
void
\fBTcl_LimitRemoveHandler\fR(\fIinterp, type, handlerProc, clientData\fR)
.SH ARGUMENTS
-.AS Tcl_LimitHandlerDeleteProc commandLimit
+.AS Tcl_LimitHandlerDeleteProc commandLimit in/out
.AP Tcl_Interp *interp in
Interpreter that the limit being managed applies to or that will have
its limits checked.
.AP int type in
-The type of limit that the operation refers to. Must be either
-TCL_LIMIT_COMMANDS or TCL_LIMIT_TIME.
+The type of limit that the operation refers to. This must be either
+\fBTCL_LIMIT_COMMANDS\fR or \fBTCL_LIMIT_TIME\fR.
.AP int commandLimit in
The maximum number of commands (as reported by \fBinfo cmdcount\fR)
that may be executed in the interpreter.
@@ -92,7 +90,6 @@ Arbitrary pointer-sized word used to pass some context to the
Function to call whenever a handler is deleted. May be NULL if the
\fIclientData\fR requires no deletion.
.BE
-
.SH DESCRIPTION
.PP
Tcl's interpreter resource limit subsystem allows for close control
@@ -123,8 +120,8 @@ interpreter (typically a master interpreter) to handle the error.
.SH "LIMIT CHECKING API"
.PP
To check the resource limits for an interpreter, call
-\fBTcl_LimitCheck\fR, which returns TCL_OK if the limit was not
-exceeded (after processing callbacks) and TCL_ERROR if the limit was
+\fBTcl_LimitCheck\fR, which returns \fBTCL_OK\fR if the limit was not
+exceeded (after processing callbacks) and \fBTCL_ERROR\fR if the limit was
exceeded (in which case an error message is also placed in the
interpreter result). That function should only be called when
\fBTcl_LimitReady\fR returns non-zero so that granularity policy is
@@ -140,7 +137,7 @@ limit has been exceeded using \fBTcl_LimitTypeExceeded\fR.
.SH "LIMIT CONFIGURATION"
.PP
To check whether a limit has been set (but not whether it has actually
-been exceeded) on an interpreter, call \fTcl_LimitTypeEnabled\fR with
+been exceeded) on an interpreter, call \fBTcl_LimitTypeEnabled\fR with
the type of limit you want to check. To enable a particular limit
call \fBTcl_LimitTypeSet\fR, and to disable a limit call
\fBTcl_LimitTypeReset\fR.
@@ -148,7 +145,7 @@ call \fBTcl_LimitTypeSet\fR, and to disable a limit call
The level of a command limit may be set using
\fBTcl_LimitSetCommands\fR, and retrieved using
\fBTcl_LimitGetCommands\fR. Similarly for a time limit with
-\fRTcl_LimitSetTime\fR and \fBTcl_LimitGetTime\fR respectively, but
+\fBTcl_LimitSetTime\fR and \fBTcl_LimitGetTime\fR respectively, but
with that API the time limit is copied from and to the Tcl_Time
structure that the \fItimeLimitPtr\fR argument points to.
.PP
@@ -164,25 +161,25 @@ the function that will actually be called; it should have the
following prototype:
.PP
.CS
-typedef void Tcl_LimitHandlerProc(
- ClientData \fIclientData\fR,
- Tcl_Interp *\fIinterp\fR);
+typedef void \fBTcl_LimitHandlerProc\fR(
+ ClientData \fIclientData\fR,
+ Tcl_Interp *\fIinterp\fR);
.CE
.PP
The \fIclientData\fR argument to the handler will be whatever is
-passed to the \fIclientData\fR argment to \fBTcl_LimitAddHandler\fR,
+passed to the \fIclientData\fR argument to \fBTcl_LimitAddHandler\fR,
and the \fIinterp\fR is the interpreter that had its limit exceeded.
.PP
The \fIdeleteProc\fR argument to \fBTcl_LimitAddHandler\fR is a
function to call to delete the \fIclientData\fR value. It may be
-TCL_STATIC or NULL if no deletion action is necessary, or TCL_DYNAMIC
-if all that is necessary is to free the structure with
+\fBTCL_STATIC\fR or NULL if no deletion action is necessary, or
+\fBTCL_DYNAMIC\fR if all that is necessary is to free the structure with
\fBTcl_Free\fR. Otherwise, it should refer to a function with the
following prototype:
.PP
.CS
-typedef void Tcl_LimitHandlerDeleteProc(
- ClientData \fIclientData\fR);
+typedef void \fBTcl_LimitHandlerDeleteProc\fR(
+ ClientData \fIclientData\fR);
.CE
.PP
A limit handler may be deleted using \fBTcl_LimitRemoveHandler\fR; the
@@ -190,7 +187,6 @@ handler removed will be the first one found (out of the handlers added
with \fBTcl_LimitAddHandler\fR) with exactly matching \fItype\fR,
\fIhandlerProc\fR and \fIclientData\fR arguments. This function
always invokes the \fIdeleteProc\fR on the \fIclientData\fR (unless
-the \fIdeleteProc\fR was NULL or TCL_STATIC).
-
+the \fIdeleteProc\fR was NULL or \fBTCL_STATIC\fR).
.SH KEYWORDS
interpreter, resource, limit, commands, time, callback