comparison man/lispref/tooltalk.texi @ 444:576fb035e263 r21-2-37

Import from CVS: tag r21-2-37
author cvs
date Mon, 13 Aug 2007 11:36:19 +0200
parents 8de8e3f6228a
children 9fae6227ede5
comparison
equal deleted inserted replaced
443:a8296e22da4e 444:576fb035e263
1 @c -*-texinfo-*- 1 @c -*-texinfo-*-
2 @c This is part of the XEmacs Lisp Reference Manual. 2 @c This is part of the XEmacs Lisp Reference Manual.
3 @c Copyright (C) 1990, 1991, 1992, 1993 Free Software Foundation, Inc. 3 @c Copyright (C) 1990, 1991, 1992, 1993 Free Software Foundation, Inc.
4 @c See the file lispref.texi for copying conditions. 4 @c See the file lispref.texi for copying conditions.
5 @setfilename ../../info/tooltalk.info 5 @setfilename ../../info/tooltalk.info
6 @node ToolTalk Support, LDAP Support, X-Windows, top 6 @node ToolTalk Support, LDAP Support, X-Windows, top
7 @chapter ToolTalk Support 7 @chapter ToolTalk Support
8 @cindex ToolTalk 8 @cindex ToolTalk
36 A single callback may be associated with a message or a pattern; 36 A single callback may be associated with a message or a pattern;
37 the callback is specified with a Lisp symbol (the symbol should 37 the callback is specified with a Lisp symbol (the symbol should
38 have a function binding). 38 have a function binding).
39 39
40 @item 40 @item
41 The session attribute for messages and patterns is always 41 The session attribute for messages and patterns is always
42 initialized to the default session. 42 initialized to the default session.
43 43
44 @item 44 @item
45 Anywhere a ToolTalk enum constant, e.g. @samp{TT_SESSION}, is valid, one 45 Anywhere a ToolTalk enum constant, e.g. @samp{TT_SESSION}, is valid, one
46 can substitute the corresponding symbol, e.g. @code{'TT_SESSION}. This 46 can substitute the corresponding symbol, e.g. @code{'TT_SESSION}. This
72 (message (get-tooltalk-message-attribute msg arg_val 0))) 72 (message (get-tooltalk-message-attribute msg arg_val 0)))
73 ((memq state '(TT_FAILED TT_REJECTED)) 73 ((memq state '(TT_FAILED TT_REJECTED))
74 (message "Random query turns up nothing"))))) 74 (message "Random query turns up nothing")))))
75 75
76 (defvar random-query-message 76 (defvar random-query-message
77 '( class TT_REQUEST 77 '( class TT_REQUEST
78 scope TT_SESSION 78 scope TT_SESSION
79 address TT_PROCEDURE 79 address TT_PROCEDURE
80 op "random-query" 80 op "random-query"
81 args '((TT_INOUT "?" "string")) 81 args '((TT_INOUT "?" "string"))
82 callback tooltalk-random-query-handler)) 82 callback tooltalk-random-query-handler))
83 83
88 @node Elisp Interface for Sending Messages 88 @node Elisp Interface for Sending Messages
89 @subsection Elisp Interface for Sending Messages 89 @subsection Elisp Interface for Sending Messages
90 90
91 @defun make-tooltalk-message attributes 91 @defun make-tooltalk-message attributes
92 Create a ToolTalk message and initialize its attributes. 92 Create a ToolTalk message and initialize its attributes.
93 The value of @var{attributes} must be a list of alternating keyword/values, 93 The value of @var{attributes} must be a list of alternating keyword/values,
94 where keywords are symbols that name valid message attributes. 94 where keywords are symbols that name valid message attributes.
95 For example: 95 For example:
96 96
97 @example 97 @example
98 (make-tooltalk-message 98 (make-tooltalk-message
99 '(class TT_NOTICE 99 '(class TT_NOTICE
100 scope TT_SESSION 100 scope TT_SESSION
101 address TT_PROCEDURE 101 address TT_PROCEDURE
102 op "do-something" 102 op "do-something"
103 args ("arg1" 12345 (TT_INOUT "arg3" "string")))) 103 args ("arg1" 12345 (TT_INOUT "arg3" "string"))))
221 want to initialize the argument with a string that can contain embedded 221 want to initialize the argument with a string that can contain embedded
222 nulls (use @code{arg_bval}). 222 nulls (use @code{arg_bval}).
223 @refill 223 @refill
224 @end defun 224 @end defun
225 225
226 @defun create-tooltalk-message 226 @defun create-tooltalk-message &optional no-callback
227 Create a new ToolTalk message. The message's session attribute is 227 Create a new ToolTalk message. The message's session attribute is
228 initialized to the default session. Other attributes can be initialized 228 initialized to the default session. Other attributes can be initialized
229 with @code{set-tooltalk-message-attribute}. 229 with @code{set-tooltalk-message-attribute}.
230 @code{make-tooltalk-message} is the preferred way to create and 230 @code{make-tooltalk-message} is the preferred way to create and
231 initialize a message. 231 initialize a message.
232
233 Optional arg @var{no-callback} says don't add a C-level callback at all.
234 Normally don't do that; just don't specify the Lisp callback when
235 calling @code{make-tooltalk-message}.
232 @refill 236 @refill
233 @end defun 237 @end defun
234 238
235 @defun destroy-tooltalk-message msg 239 @defun destroy-tooltalk-message msg
236 Apply @samp{tt_message_destroy} to the message. It's not necessary to 240 Apply @samp{tt_message_destroy} to the message. It's not necessary to
273 @node Elisp Interface for Receiving Messages 277 @node Elisp Interface for Receiving Messages
274 @subsection Elisp Interface for Receiving Messages 278 @subsection Elisp Interface for Receiving Messages
275 279
276 @defun make-tooltalk-pattern attributes 280 @defun make-tooltalk-pattern attributes
277 Create a ToolTalk pattern and initialize its attributes. 281 Create a ToolTalk pattern and initialize its attributes.
278 The value of attributes must be a list of alternating keyword/values, 282 The value of attributes must be a list of alternating keyword/values,
279 where keywords are symbols that name valid pattern attributes 283 where keywords are symbols that name valid pattern attributes
280 or lists of valid attributes. For example: 284 or lists of valid attributes. For example:
281 285
282 @example 286 @example
283 (make-tooltalk-pattern 287 (make-tooltalk-pattern
284 '(category TT_OBSERVE 288 '(category TT_OBSERVE
285 scope TT_SESSION 289 scope TT_SESSION
286 op ("operation1" "operation2") 290 op ("operation1" "operation2")
287 args ("arg1" 12345 (TT_INOUT "arg3" "string")))) 291 args ("arg1" 12345 (TT_INOUT "arg3" "string"))))
288 @end example 292 @end example
289 293
290 Attribute names are the same as those supported by 294 Attribute names are the same as those supported by
291 @code{add-tooltalk-pattern-attribute}, plus @code{'args}. 295 @code{add-tooltalk-pattern-attribute}, plus @code{'args}.
292 296
293 Values must always be strings, integers, or symbols that represent 297 Values must always be strings, integers, or symbols that represent
294 ToolTalk constants or lists of same. When a list of values is provided 298 ToolTalk constants or lists of same. When a list of values is provided
295 all of the list elements are added to the attribute. In the example 299 all of the list elements are added to the attribute. In the example
314 more about the semantics and uses of ToolTalk pattern arguments in 318 more about the semantics and uses of ToolTalk pattern arguments in
315 chapter 3 of the @cite{ToolTalk Programmer's Guide}. 319 chapter 3 of the @cite{ToolTalk Programmer's Guide}.
316 @refill 320 @refill
317 @end defun 321 @end defun
318 322
319 @defun register-tooltalk-pattern pat 323 @defun register-tooltalk-pattern pattern
320 XEmacs will begin receiving messages that match this pattern. 324 XEmacs will begin receiving messages that match this pattern.
321 @end defun 325 @end defun
322 326
323 @defun unregister-tooltalk-pattern pat 327 @defun unregister-tooltalk-pattern pattern
324 XEmacs will stop receiving messages that match this pattern. 328 XEmacs will stop receiving messages that match this pattern.
325 @end defun 329 @end defun
326 330
327 @defun add-tooltalk-pattern-attribute value pat indicator 331 @defun add-tooltalk-pattern-attribute value pattern indicator
328 Add one value to the indicated pattern attribute. The names of 332 Add one value to the indicated pattern attribute. The names of
329 attributes are the same as the ToolTalk accessors used to set them less 333 attributes are the same as the ToolTalk accessors used to set them less
330 the @samp{tooltalk_pattern_} prefix and the @samp{_add} suffix. For 334 the @samp{tooltalk_pattern_} prefix and the @samp{_add} suffix. For
331 example, the name of the attribute for the 335 example, the name of the attribute for the
332 @samp{tt_pattern_disposition_add} attribute is @code{disposition}. The 336 @samp{tt_pattern_disposition_add} attribute is @code{disposition}. The
338 The value of @var{callback} should be the name of a function of one 342 The value of @var{callback} should be the name of a function of one
339 argument. It will be called each time the pattern matches an incoming 343 argument. It will be called each time the pattern matches an incoming
340 message. 344 message.
341 @end defun 345 @end defun
342 346
343 @defun add-tooltalk-pattern-arg pat mode type value 347 @defun add-tooltalk-pattern-arg pattern mode vtype &optional value
344 Add one fully-specified argument to a ToolTalk pattern. @var{mode} must 348 Add one fully-specified argument to a ToolTalk pattern. @var{mode} must
345 be one of @code{TT_IN}, @code{TT_INOUT}, or @code{TT_OUT}. @var{type} 349 be one of @code{TT_IN}, @code{TT_INOUT}, or @code{TT_OUT}. @var{vtype}
346 must be a string. @var{value} can be an integer, string or @code{nil}. 350 must be a string. @var{value} can be an integer, string or @code{nil}.
347 If @var{value} is an integer then an integer argument 351 If @var{value} is an integer then an integer argument
348 (@samp{tt_pattern_iarg_add}) is added; otherwise a string argument is 352 (@samp{tt_pattern_iarg_add}) is added; otherwise a string argument is
349 added. At present there's no way to add a binary data argument. 353 added. At present there's no way to add a binary data argument.
350 @refill 354 @refill
353 @defun create-tooltalk-pattern 357 @defun create-tooltalk-pattern
354 Create a new ToolTalk pattern and initialize its session attribute to 358 Create a new ToolTalk pattern and initialize its session attribute to
355 be the default session. 359 be the default session.
356 @end defun 360 @end defun
357 361
358 @defun destroy-tooltalk-pattern pat 362 @defun destroy-tooltalk-pattern pattern
359 Apply @samp{tt_pattern_destroy} to the pattern. This effectively 363 Apply @samp{tt_pattern_destroy} to the pattern. This effectively
360 unregisters the pattern. 364 unregisters the pattern.
361 @end defun 365 @end defun
362 366
363 @defun describe-tooltalk-message msg &optional stream 367 @defun describe-tooltalk-message msg &optional stream