OSDN Git Service

Please enter the commit message for your changes. Lines starting
[eos/hostdependX86LINUX64.git] / util / X86LINUX64 / man / man3 / Tcl_GetEnsembleFlags.3
1 '\"
2 '\" Copyright (c) 2005 Donal K. Fellows
3 '\"
4 '\" See the file "license.terms" for information on usage and redistribution
5 '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
6 '\" 
7 '\" This documents the C API introduced in TIP#235
8 '\" 
9 .TH Tcl_Ensemble 3 8.5 Tcl "Tcl Library Procedures"
10 .\" The -*- nroff -*- definitions below are for supplemental macros used
11 .\" in Tcl/Tk manual entries.
12 .\"
13 .\" .AP type name in/out ?indent?
14 .\"     Start paragraph describing an argument to a library procedure.
15 .\"     type is type of argument (int, etc.), in/out is either "in", "out",
16 .\"     or "in/out" to describe whether procedure reads or modifies arg,
17 .\"     and indent is equivalent to second arg of .IP (shouldn't ever be
18 .\"     needed;  use .AS below instead)
19 .\"
20 .\" .AS ?type? ?name?
21 .\"     Give maximum sizes of arguments for setting tab stops.  Type and
22 .\"     name are examples of largest possible arguments that will be passed
23 .\"     to .AP later.  If args are omitted, default tab stops are used.
24 .\"
25 .\" .BS
26 .\"     Start box enclosure.  From here until next .BE, everything will be
27 .\"     enclosed in one large box.
28 .\"
29 .\" .BE
30 .\"     End of box enclosure.
31 .\"
32 .\" .CS
33 .\"     Begin code excerpt.
34 .\"
35 .\" .CE
36 .\"     End code excerpt.
37 .\"
38 .\" .VS ?version? ?br?
39 .\"     Begin vertical sidebar, for use in marking newly-changed parts
40 .\"     of man pages.  The first argument is ignored and used for recording
41 .\"     the version when the .VS was added, so that the sidebars can be
42 .\"     found and removed when they reach a certain age.  If another argument
43 .\"     is present, then a line break is forced before starting the sidebar.
44 .\"
45 .\" .VE
46 .\"     End of vertical sidebar.
47 .\"
48 .\" .DS
49 .\"     Begin an indented unfilled display.
50 .\"
51 .\" .DE
52 .\"     End of indented unfilled display.
53 .\"
54 .\" .SO ?manpage?
55 .\"     Start of list of standard options for a Tk widget. The manpage
56 .\"     argument defines where to look up the standard options; if
57 .\"     omitted, defaults to "options". The options follow on successive
58 .\"     lines, in three columns separated by tabs.
59 .\"
60 .\" .SE
61 .\"     End of list of standard options for a Tk widget.
62 .\"
63 .\" .OP cmdName dbName dbClass
64 .\"     Start of description of a specific option.  cmdName gives the
65 .\"     option's name as specified in the class command, dbName gives
66 .\"     the option's name in the option database, and dbClass gives
67 .\"     the option's class in the option database.
68 .\"
69 .\" .UL arg1 arg2
70 .\"     Print arg1 underlined, then print arg2 normally.
71 .\"
72 .\" .QW arg1 ?arg2?
73 .\"     Print arg1 in quotes, then arg2 normally (for trailing punctuation).
74 .\"
75 .\" .PQ arg1 ?arg2?
76 .\"     Print an open parenthesis, arg1 in quotes, then arg2 normally
77 .\"     (for trailing punctuation) and then a closing parenthesis.
78 .\"
79 .\"     # Set up traps and other miscellaneous stuff for Tcl/Tk man pages.
80 .if t .wh -1.3i ^B
81 .nr ^l \n(.l
82 .ad b
83 .\"     # Start an argument description
84 .de AP
85 .ie !"\\$4"" .TP \\$4
86 .el \{\
87 .   ie !"\\$2"" .TP \\n()Cu
88 .   el          .TP 15
89 .\}
90 .ta \\n()Au \\n()Bu
91 .ie !"\\$3"" \{\
92 \&\\$1 \\fI\\$2\\fP (\\$3)
93 .\".b
94 .\}
95 .el \{\
96 .br
97 .ie !"\\$2"" \{\
98 \&\\$1  \\fI\\$2\\fP
99 .\}
100 .el \{\
101 \&\\fI\\$1\\fP
102 .\}
103 .\}
104 ..
105 .\"     # define tabbing values for .AP
106 .de AS
107 .nr )A 10n
108 .if !"\\$1"" .nr )A \\w'\\$1'u+3n
109 .nr )B \\n()Au+15n
110 .\"
111 .if !"\\$2"" .nr )B \\w'\\$2'u+\\n()Au+3n
112 .nr )C \\n()Bu+\\w'(in/out)'u+2n
113 ..
114 .AS Tcl_Interp Tcl_CreateInterp in/out
115 .\"     # BS - start boxed text
116 .\"     # ^y = starting y location
117 .\"     # ^b = 1
118 .de BS
119 .br
120 .mk ^y
121 .nr ^b 1u
122 .if n .nf
123 .if n .ti 0
124 .if n \l'\\n(.lu\(ul'
125 .if n .fi
126 ..
127 .\"     # BE - end boxed text (draw box now)
128 .de BE
129 .nf
130 .ti 0
131 .mk ^t
132 .ie n \l'\\n(^lu\(ul'
133 .el \{\
134 .\"     Draw four-sided box normally, but don't draw top of
135 .\"     box if the box started on an earlier page.
136 .ie !\\n(^b-1 \{\
137 \h'-1.5n'\L'|\\n(^yu-1v'\l'\\n(^lu+3n\(ul'\L'\\n(^tu+1v-\\n(^yu'\l'|0u-1.5n\(ul'
138 .\}
139 .el \}\
140 \h'-1.5n'\L'|\\n(^yu-1v'\h'\\n(^lu+3n'\L'\\n(^tu+1v-\\n(^yu'\l'|0u-1.5n\(ul'
141 .\}
142 .\}
143 .fi
144 .br
145 .nr ^b 0
146 ..
147 .\"     # VS - start vertical sidebar
148 .\"     # ^Y = starting y location
149 .\"     # ^v = 1 (for troff;  for nroff this doesn't matter)
150 .de VS
151 .if !"\\$2"" .br
152 .mk ^Y
153 .ie n 'mc \s12\(br\s0
154 .el .nr ^v 1u
155 ..
156 .\"     # VE - end of vertical sidebar
157 .de VE
158 .ie n 'mc
159 .el \{\
160 .ev 2
161 .nf
162 .ti 0
163 .mk ^t
164 \h'|\\n(^lu+3n'\L'|\\n(^Yu-1v\(bv'\v'\\n(^tu+1v-\\n(^Yu'\h'-|\\n(^lu+3n'
165 .sp -1
166 .fi
167 .ev
168 .\}
169 .nr ^v 0
170 ..
171 .\"     # Special macro to handle page bottom:  finish off current
172 .\"     # box/sidebar if in box/sidebar mode, then invoked standard
173 .\"     # page bottom macro.
174 .de ^B
175 .ev 2
176 'ti 0
177 'nf
178 .mk ^t
179 .if \\n(^b \{\
180 .\"     Draw three-sided box if this is the box's first page,
181 .\"     draw two sides but no top otherwise.
182 .ie !\\n(^b-1 \h'-1.5n'\L'|\\n(^yu-1v'\l'\\n(^lu+3n\(ul'\L'\\n(^tu+1v-\\n(^yu'\h'|0u'\c
183 .el \h'-1.5n'\L'|\\n(^yu-1v'\h'\\n(^lu+3n'\L'\\n(^tu+1v-\\n(^yu'\h'|0u'\c
184 .\}
185 .if \\n(^v \{\
186 .nr ^x \\n(^tu+1v-\\n(^Yu
187 \kx\h'-\\nxu'\h'|\\n(^lu+3n'\ky\L'-\\n(^xu'\v'\\n(^xu'\h'|0u'\c
188 .\}
189 .bp
190 'fi
191 .ev
192 .if \\n(^b \{\
193 .mk ^y
194 .nr ^b 2
195 .\}
196 .if \\n(^v \{\
197 .mk ^Y
198 .\}
199 ..
200 .\"     # DS - begin display
201 .de DS
202 .RS
203 .nf
204 .sp
205 ..
206 .\"     # DE - end display
207 .de DE
208 .fi
209 .RE
210 .sp
211 ..
212 .\"     # SO - start of list of standard options
213 .de SO
214 'ie '\\$1'' .ds So \\fBoptions\\fR
215 'el .ds So \\fB\\$1\\fR
216 .SH "STANDARD OPTIONS"
217 .LP
218 .nf
219 .ta 5.5c 11c
220 .ft B
221 ..
222 .\"     # SE - end of list of standard options
223 .de SE
224 .fi
225 .ft R
226 .LP
227 See the \\*(So manual entry for details on the standard options.
228 ..
229 .\"     # OP - start of full description for a single option
230 .de OP
231 .LP
232 .nf
233 .ta 4c
234 Command-Line Name:      \\fB\\$1\\fR
235 Database Name:  \\fB\\$2\\fR
236 Database Class: \\fB\\$3\\fR
237 .fi
238 .IP
239 ..
240 .\"     # CS - begin code excerpt
241 .de CS
242 .RS
243 .nf
244 .ta .25i .5i .75i 1i
245 ..
246 .\"     # CE - end code excerpt
247 .de CE
248 .fi
249 .RE
250 ..
251 .\"     # UL - underline word
252 .de UL
253 \\$1\l'|0\(ul'\\$2
254 ..
255 .\"     # QW - apply quotation marks to word
256 .de QW
257 .ie '\\*(lq'"' ``\\$1''\\$2
258 .\"" fix emacs highlighting
259 .el \\*(lq\\$1\\*(rq\\$2
260 ..
261 .\"     # PQ - apply parens and quotation marks to word
262 .de PQ
263 .ie '\\*(lq'"' (``\\$1''\\$2)\\$3
264 .\"" fix emacs highlighting
265 .el (\\*(lq\\$1\\*(rq\\$2)\\$3
266 ..
267 .\"     # QR - quoted range
268 .de QR
269 .ie '\\*(lq'"' ``\\$1''\\-``\\$2''\\$3
270 .\"" fix emacs highlighting
271 .el \\*(lq\\$1\\*(rq\\-\\*(lq\\$2\\*(rq\\$3
272 ..
273 .\"     # MT - "empty" string
274 .de MT
275 .QW ""
276 ..
277 .BS
278 .SH NAME
279 Tcl_CreateEnsemble, Tcl_FindEnsemble, Tcl_GetEnsembleFlags, Tcl_GetEnsembleMappingDict, Tcl_GetEnsembleNamespace, Tcl_GetEnsembleParameterList, Tcl_GetEnsembleUnknownHandler, Tcl_GetEnsembleSubcommandList, Tcl_IsEnsemble, Tcl_SetEnsembleFlags, Tcl_SetEnsembleMappingDict, Tcl_SetEnsembleParameterList, Tcl_SetEnsembleSubcommandList, Tcl_SetEnsembleUnknownHandler \- manipulate ensemble commands
280 .SH SYNOPSIS
281 .nf
282 \fB#include <tcl.h>\fR
283 .sp
284 Tcl_Command
285 \fBTcl_CreateEnsemble\fR(\fIinterp, name, namespacePtr, ensFlags\fR)
286 .sp
287 Tcl_Command
288 \fBTcl_FindEnsemble\fR(\fIinterp, cmdNameObj, flags\fR)
289 .sp
290 int
291 \fBTcl_IsEnsemble\fR(\fItoken\fR)
292 .sp
293 int
294 \fBTcl_GetEnsembleFlags\fR(\fIinterp, token, ensFlagsPtr\fR)
295 .sp
296 int
297 \fBTcl_SetEnsembleFlags\fR(\fIinterp, token, ensFlags\fR)
298 .sp
299 int
300 \fBTcl_GetEnsembleMappingDict\fR(\fIinterp, token, dictObjPtr\fR)
301 .sp
302 int
303 \fBTcl_SetEnsembleMappingDict\fR(\fIinterp, token, dictObj\fR)
304 .sp
305 .VS 8.6
306 int
307 \fBTcl_GetEnsembleParameterList\fR(\fIinterp, token, listObjPtr\fR)
308 .sp
309 int
310 \fBTcl_SetEnsembleParameterList\fR(\fIinterp, token, listObj\fR)
311 .VE 8.6
312 .sp
313 int
314 \fBTcl_GetEnsembleSubcommandList\fR(\fIinterp, token, listObjPtr\fR)
315 .sp
316 int
317 \fBTcl_SetEnsembleSubcommandList\fR(\fIinterp, token, listObj\fR)
318 .sp
319 int
320 \fBTcl_GetEnsembleUnknownHandler\fR(\fIinterp, token, listObjPtr\fR)
321 .sp
322 int
323 \fBTcl_SetEnsembleUnknownHandler\fR(\fIinterp, token, listObj\fR)
324 .sp
325 int
326 \fBTcl_GetEnsembleNamespace\fR(\fIinterp, token, namespacePtrPtr\fR)
327 .SH ARGUMENTS
328 .AS Tcl_Namespace **namespacePtrPtr in/out
329 .AP Tcl_Interp *interp in/out
330 The interpreter in which the ensemble is to be created or found. Also
331 where error result messages are written. The functions whose names
332 start with \fBTcl_GetEnsemble\fR may have a NULL for the \fIinterp\fR,
333 but all other functions must not.
334 .AP "const char" *name in
335 The name of the ensemble command to be created.
336 .AP Tcl_Namespace *namespacePtr in
337 The namespace to which the ensemble command is to be bound, or NULL
338 for the current namespace.
339 .AP int ensFlags in
340 An ORed set of flag bits describing the basic configuration of the
341 ensemble. Currently only one bit has meaning, \fBTCL_ENSEMBLE_PREFIX\fR,
342 which is present when the ensemble command should also match
343 unambiguous prefixes of subcommands.
344 .AP Tcl_Obj *cmdNameObj in
345 A value holding the name of the ensemble command to look up.
346 .AP int flags in
347 An ORed set of flag bits controlling the behavior of
348 \fBTcl_FindEnsemble\fR. Currently only \fBTCL_LEAVE_ERR_MSG\fR is supported.
349 .AP Tcl_Command token in
350 A normal command token that refers to an ensemble command, or which
351 you wish to use for testing as an ensemble command in \fBTcl_IsEnsemble\fR.
352 .AP int *ensFlagsPtr out
353 Pointer to a variable into which to write the current ensemble flag
354 bits; currently only the bit \fBTCL_ENSEMBLE_PREFIX\fR is defined.
355 .AP Tcl_Obj *dictObj in
356 A dictionary value to use for the subcommand to implementation command
357 prefix mapping dictionary in the ensemble. May be NULL if the mapping
358 dictionary is to be removed.
359 .AP Tcl_Obj **dictObjPtr out
360 Pointer to a variable into which to write the current ensemble mapping
361 dictionary.
362 .AP Tcl_Obj *listObj in
363 A list value to use for the list of formal pre-subcommand parameters, the
364 defined list of subcommands in the dictionary or the unknown subcommand
365 handler command prefix. May be NULL if the subcommand list or unknown handler
366 are to be removed.
367 .AP Tcl_Obj **listObjPtr out
368 Pointer to a variable into which to write the current list of formal
369 pre-subcommand parameters, the defined list of subcommands or the current
370 unknown handler prefix.
371 .AP Tcl_Namespace **namespacePtrPtr out
372 Pointer to a variable into which to write the handle of the namespace
373 to which the ensemble is bound.
374 .BE
375 .SH DESCRIPTION
376 An ensemble is a command, bound to some namespace, which consists of a
377 collection of subcommands implemented by other Tcl commands. The first
378 argument to the ensemble command is always interpreted as a selector
379 that states what subcommand to execute.
380 .PP
381 Ensembles are created using \fBTcl_CreateEnsemble\fR, which takes four
382 arguments: the interpreter to work within, the name of the ensemble to
383 create, the namespace within the interpreter to bind the ensemble to,
384 and the default set of ensemble flags. The result of the function is
385 the command token for the ensemble, which may be used to further
386 configure the ensemble using the API described below in
387 \fBENSEMBLE PROPERTIES\fR.
388 .PP
389 Given the name of an ensemble command, the token for that command may
390 be retrieved using \fBTcl_FindEnsemble\fR. If the given command name
391 (in \fIcmdNameObj\fR) does not refer to an ensemble command, the
392 result of the function is NULL and (if the \fBTCL_LEAVE_ERR_MSG\fR bit is
393 set in \fIflags\fR) an error message is left in the interpreter
394 result.
395 .PP
396 A command token may be checked to see if it refers to an ensemble
397 using \fBTcl_IsEnsemble\fR. This returns 1 if the token refers to an
398 ensemble, or 0 otherwise.
399 .SS "ENSEMBLE PROPERTIES"
400 Every ensemble has four read-write properties and a read-only
401 property. The properties are:
402 .TP
403 \fBflags\fR (read-write)
404 .
405 The set of flags for the ensemble, expressed as a
406 bit-field. Currently, the only public flag is \fBTCL_ENSEMBLE_PREFIX\fR
407 which is set when unambiguous prefixes of subcommands are permitted to
408 be resolved to implementations as well as exact matches. The flags may
409 be read and written using \fBTcl_GetEnsembleFlags\fR and
410 \fBTcl_SetEnsembleFlags\fR respectively. The result of both of those
411 functions is a Tcl result code (\fBTCL_OK\fR, or \fBTCL_ERROR\fR if
412 the token does not refer to an ensemble).
413 .TP
414 \fBmapping dictionary\fR (read-write)
415 .
416 A dictionary containing a mapping from subcommand names to lists of
417 words to use as a command prefix (replacing the first two words of the
418 command which are the ensemble command itself and the subcommand
419 name), or NULL if every subcommand is to be mapped to the command with
420 the same unqualified name in the ensemble's bound namespace. Defaults
421 to NULL. May be read and written using
422 \fBTcl_GetEnsembleMappingDict\fR and \fBTcl_SetEnsembleMappingDict\fR
423 respectively. The result of both of those functions is a Tcl result
424 code (\fBTCL_OK\fR, or \fBTCL_ERROR\fR if the token does not refer to an
425 ensemble) and the dictionary obtained from
426 \fBTcl_GetEnsembleMappingDict\fR should always be treated as immutable
427 even if it is unshared.
428 All command names in prefixes set via \fBTcl_SetEnsembleMappingDict\fR
429 must be fully qualified.
430 .TP
431 \fBformal pre-subcommand parameter list\fR (read-write)
432 .VS 8.6
433 A list of formal parameter names (the names only being used when generating
434 error messages) that come at invocation of the ensemble between the name of
435 the ensemble and the subcommand argument. NULL (the default) is equivalent to
436 the empty list. May be read and written using
437 \fBTcl_GetEnsembleParameterList\fR and \fBTcl_SetEnsembleParameterList\fR
438 respectively. The result of both of those functions is a Tcl result code
439 (\fBTCL_OK\fR, or \fBTCL_ERROR\fR if the token does not refer to an
440 ensemble) and the
441 dictionary obtained from \fBTcl_GetEnsembleParameterList\fR should always be
442 treated as immutable even if it is unshared.
443 .VE 8.6
444 .TP
445 \fBsubcommand list\fR (read-write)
446 .
447 A list of all the subcommand names for the ensemble, or NULL if this
448 is to be derived from either the keys of the mapping dictionary (see
449 above) or (if that is also NULL) from the set of commands exported by
450 the bound namespace. May be read and written using
451 \fBTcl_GetEnsembleSubcommandList\fR and
452 \fBTcl_SetEnsembleSubcommandList\fR respectively. The result of both
453 of those functions is a Tcl result code (\fBTCL_OK\fR, or
454 \fBTCL_ERROR\fR if the 
455 token does not refer to an ensemble) and the list obtained from
456 \fBTcl_GetEnsembleSubcommandList\fR should always be treated as
457 immutable even if it is unshared.
458 .TP
459 \fBunknown subcommand handler command prefix\fR (read-write)
460 .
461 A list of words to prepend on the front of any subcommand when the
462 subcommand is unknown to the ensemble (according to the current prefix
463 handling rule); see the \fBnamespace ensemble\fR command for more
464 details. If NULL, the default behavior \- generate a suitable error
465 message \- will be used when an unknown subcommand is encountered. May
466 be read and written using \fBTcl_GetEnsembleUnknownHandler\fR and
467 \fBTcl_SetEnsembleUnknownHandler\fR respectively. The result of both
468 functions is a Tcl result code (\fBTCL_OK\fR, or \fBTCL_ERROR\fR if
469 the token does
470 not refer to an ensemble) and the list obtained from
471 \fBTcl_GetEnsembleUnknownHandler\fR should always be treated as
472 immutable even if it is unshared.
473 .TP
474 \fBbound namespace\fR (read-only)
475 .
476 The namespace to which the ensemble is bound; when the namespace is
477 deleted, so too will the ensemble, and this namespace is also the
478 namespace whose list of exported commands is used if both the mapping
479 dictionary and the subcommand list properties are NULL. May be read
480 using \fBTcl_GetEnsembleNamespace\fR which returns a Tcl result code
481 (\fBTCL_OK\fR, or \fBTCL_ERROR\fR if the token does not refer to an ensemble).
482 .SH "SEE ALSO"
483 namespace(n), Tcl_DeleteCommandFromToken(3)
484 .SH KEYWORDS
485 command, ensemble