| 1 |
'\" |
| 2 |
'\" Copyright 1991-1998 by Bell Labs Innovations for Lucent Technologies. |
| 3 |
'\" |
| 4 |
'\" Permission to use, copy, modify, and distribute this software and its |
| 5 |
'\" documentation for any purpose and without fee is hereby granted, provided |
| 6 |
'\" that the above copyright notice appear in all copies and that both that the |
| 7 |
'\" copyright notice and warranty disclaimer appear in supporting documentation, |
| 8 |
'\" and that the names of Lucent Technologies any of their entities not be used |
| 9 |
'\" in advertising or publicity pertaining to distribution of the software |
| 10 |
'\" without specific, written prior permission. |
| 11 |
'\" |
| 12 |
'\" Lucent Technologies disclaims all warranties with regard to this software, |
| 13 |
'\" including all implied warranties of merchantability and fitness. In no event |
| 14 |
'\" shall Lucent Technologies be liable for any special, indirect or |
| 15 |
'\" consequential damages or any damages whatsoever resulting from loss of use, |
| 16 |
'\" data or profits, whether in an action of contract, negligence or other |
| 17 |
'\" tortuous action, arising out of or in connection with the use or performance |
| 18 |
'\" of this software. |
| 19 |
'\" |
| 20 |
'\" |
| 21 |
.so man.macros |
| 22 |
.TH Blt_TreeGetToken 3 BLT_VERSION BLT "BLT Library Procedures" |
| 23 |
.BS |
| 24 |
.SH NAME |
| 25 |
Blt_TreeGetToken \- Grabs a token associated with existing tree data object. |
| 26 |
.SH SYNOPSIS |
| 27 |
.nf |
| 28 |
\fB#include <bltTree.h>\fR |
| 29 |
.sp |
| 30 |
int |
| 31 |
\fBBlt_TreeGetToken\fR(\fIinterp\fR, \fIname\fR, \fItokenPtr\fR) |
| 32 |
.fi |
| 33 |
.SH ARGUMENTS |
| 34 |
.AS Tcl_Interp *interp |
| 35 |
.AP Tcl_Interp *interp in |
| 36 |
Interpreter to report results back to. |
| 37 |
.AP "const char" *name in |
| 38 |
Name of an existing tree data object. Can be qualified by a namespace. |
| 39 |
.AP Blt_Tree *tokenPtr out |
| 40 |
Points to location to store the client tree token. |
| 41 |
.BE |
| 42 |
.SH DESCRIPTION |
| 43 |
.PP |
| 44 |
This procedure obtains a token to a C-based tree data object. The |
| 45 |
arguments are as follows: |
| 46 |
.TP 1i |
| 47 |
\fIinterp\fR |
| 48 |
Interpreter to report results back to. If an error occurs, then |
| 49 |
interp->result will contain an error message. |
| 50 |
.TP 1i |
| 51 |
\fIname\fR |
| 52 |
Name of an existing tree data object. It's an error if a tree |
| 53 |
\fIname\fR doesn't already exist. \fIName\fR can be qualified by |
| 54 |
a namespace such as \fBfred::myTree\fR. If no namespace qualifier |
| 55 |
is used, the tree the current namespace is searched, then the global |
| 56 |
namespace. |
| 57 |
.TP 1i |
| 58 |
\fItokenPtr\fR |
| 59 |
Points to the location where the returned token is stored. A tree |
| 60 |
token is used to work with the tree object. |
| 61 |
.PP |
| 62 |
A token for the tree data object is returned. Tree data objects can |
| 63 |
be shared. For example, the \fBtree\fR and \fBhiertable\fR commands |
| 64 |
may be accessing the same tree data object. Each client grabs a token |
| 65 |
that is associated with the tree. When all tokens are released (see |
| 66 |
\fBBlt_TreeReleaseToken\fR) the tree data object is automatically |
| 67 |
destroyed. |
| 68 |
.PP |
| 69 |
.SH RETURNS |
| 70 |
A standard Tcl result is returned. If TCL_ERROR is returned, then |
| 71 |
\fIinterp->result\fR will contain an error message. The following errors |
| 72 |
may occur: |
| 73 |
.IP \(bu 3 |
| 74 |
No tree exists as \fIname\fR. You can use \fBTcl_TreeExists\fR to |
| 75 |
determine if a tree exists beforehand. |
| 76 |
.IP \(bu |
| 77 |
Memory can't be allocated for the token. |
| 78 |
.SH EXAMPLE |
| 79 |
The following example allocated a token for an existing tree. |
| 80 |
.CS |
| 81 |
Blt_Tree token; |
| 82 |
|
| 83 |
if (Blt_TreeGetToken(interp, "myTree", &token) != TCL_OK) { |
| 84 |
return TCL_ERROR; |
| 85 |
} |
| 86 |
printf("tree is %s\\n", Blt_TreeName(token)); |
| 87 |
.CE |
| 88 |
.SH SEE ALSO |
| 89 |
Tcl_TreeCreate, Tcl_TreeExists, Tcl_TreeReleaseToken |