1 This is ../info/lispref.info, produced by makeinfo version 4.0 from
4 INFO-DIR-SECTION XEmacs Editor
6 * Lispref: (lispref). XEmacs Lisp Reference Manual.
11 GNU Emacs Lisp Reference Manual Second Edition (v2.01), May 1993 GNU
12 Emacs Lisp Reference Manual Further Revised (v2.02), August 1993 Lucid
13 Emacs Lisp Reference Manual (for 19.10) First Edition, March 1994
14 XEmacs Lisp Programmer's Manual (for 19.12) Second Edition, April 1995
15 GNU Emacs Lisp Reference Manual v2.4, June 1995 XEmacs Lisp
16 Programmer's Manual (for 19.13) Third Edition, July 1995 XEmacs Lisp
17 Reference Manual (for 19.14 and 20.0) v3.1, March 1996 XEmacs Lisp
18 Reference Manual (for 19.15 and 20.1, 20.2, 20.3) v3.2, April, May,
19 November 1997 XEmacs Lisp Reference Manual (for 21.0) v3.3, April 1998
21 Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995 Free Software
22 Foundation, Inc. Copyright (C) 1994, 1995 Sun Microsystems, Inc.
23 Copyright (C) 1995, 1996 Ben Wing.
25 Permission is granted to make and distribute verbatim copies of this
26 manual provided the copyright notice and this permission notice are
27 preserved on all copies.
29 Permission is granted to copy and distribute modified versions of
30 this manual under the conditions for verbatim copying, provided that the
31 entire resulting derived work is distributed under the terms of a
32 permission notice identical to this one.
34 Permission is granted to copy and distribute translations of this
35 manual into another language, under the above conditions for modified
36 versions, except that this permission notice may be stated in a
37 translation approved by the Foundation.
39 Permission is granted to copy and distribute modified versions of
40 this manual under the conditions for verbatim copying, provided also
41 that the section entitled "GNU General Public License" is included
42 exactly as in the original, and provided that the entire resulting
43 derived work is distributed under the terms of a permission notice
44 identical to this one.
46 Permission is granted to copy and distribute translations of this
47 manual into another language, under the above conditions for modified
48 versions, except that the section entitled "GNU General Public License"
49 may be included in a translation approved by the Free Software
50 Foundation instead of in the original English.
53 File: lispref.info, Node: Elisp Interface for Sending Messages, Prev: Example of Sending Messages, Up: Sending Messages
55 Elisp Interface for Sending Messages
56 ------------------------------------
58 - Function: make-tooltalk-message attributes
59 Create a ToolTalk message and initialize its attributes. The
60 value of ATTRIBUTES must be a list of alternating keyword/values,
61 where keywords are symbols that name valid message attributes.
64 (make-tooltalk-message
69 args ("arg1" 12345 (TT_INOUT "arg3" "string"))))
71 Values must always be strings, integers, or symbols that represent
72 ToolTalk constants. Attribute names are the same as those
73 supported by `set-tooltalk-message-attribute', plus `args'.
75 The value of `args' should be a list of message arguments where
76 each message argument has the following form:
78 `(mode [value [type]])' or just `value'
80 Where MODE is one of `TT_IN', `TT_OUT', or `TT_INOUT' and TYPE is
81 a string. If TYPE isn't specified then `int' is used if VALUE is
82 a number; otherwise `string' is used. If TYPE is `string' then
83 VALUE is converted to a string (if it isn't a string already) with
84 `prin1-to-string'. If only a value is specified then MODE
85 defaults to `TT_IN'. If MODE is `TT_OUT' then VALUE and TYPE
86 don't need to be specified. You can find out more about the
87 semantics and uses of ToolTalk message arguments in chapter 4 of
88 the `ToolTalk Programmer's Guide'.
91 - Function: send-tooltalk-message msg
92 Send the message on its way. Once the message has been sent it's
93 almost always a good idea to get rid of it with
94 `destroy-tooltalk-message'.
97 - Function: return-tooltalk-message msg &optional mode
98 Send a reply to this message. The second argument can be `reply',
99 `reject' or `fail'; the default is `reply'. Before sending a
100 reply, all message arguments whose mode is `TT_INOUT' or `TT_OUT'
101 should have been filled in--see `set-tooltalk-message-attribute'.
104 - Function: get-tooltalk-message-attribute msg attribute &optional argn
105 Returns the indicated ToolTalk message attribute. Attributes are
106 identified by symbols with the same name (underscores and all) as
107 the suffix of the ToolTalk `tt_message_<attribute>' function that
108 extracts the value. String attribute values are copied and
109 enumerated type values (except disposition) are converted to
110 symbols; e.g. `TT_HANDLER' is `'TT_HANDLER', `uid' and `gid' are
111 represented by fixnums (small integers), `opnum' is converted to a
112 string, and `disposition' is converted to a fixnum. We convert
113 `opnum' (a C int) to a string (e.g. `123' => `"123"') because
114 there's no guarantee that opnums will fit within the range of
115 XEmacs Lisp integers.
117 [TBD] Use the `plist' attribute instead of C API `user' attribute
118 for user-defined message data. To retrieve the value of a message
119 property, specify the indicator for ARGN. For example, to get the
120 value of a property called `rflag', use
122 (get-tooltalk-message-attribute msg 'plist 'rflag)
124 To get the value of a message argument use one of the `arg_val'
125 (strings), `arg_ival' (integers), or `arg_bval' (strings with
126 embedded nulls), attributes. For example, to get the integer
127 value of the third argument:
129 (get-tooltalk-message-attribute msg 'arg_ival 2)
131 As you can see, argument numbers are zero-based. The type of each
132 arguments can be retrieved with the `arg_type' attribute; however
133 ToolTalk doesn't define any semantics for the string value of
134 `arg_type'. Conventionally `string' is used for strings and `int'
135 for 32 bit integers. Note that XEmacs Lisp stores the lengths of
136 strings explicitly (unlike C) so treating the value returned by
137 `arg_bval' like a string is fine.
140 - Function: set-tooltalk-message-attribute value msg attribute
142 Initialize one ToolTalk message attribute.
144 Attribute names and values are the same as for
145 `get-tooltalk-message-attribute'. A property list is provided for
146 user data (instead of the `user' message attribute); see
147 `get-tooltalk-message-attribute'.
149 Callbacks are handled slightly differently than in the C ToolTalk
150 API. The value of CALLBACK should be the name of a function of one
151 argument. It will be called each time the state of the message
152 changes. This is usually used to notice when the message's state
153 has changed to `TT_HANDLED' (or `TT_FAILED'), so that reply
154 argument values can be used.
156 If one of the argument attributes is specified as `arg_val',
157 `arg_ival', or `arg_bval', then ARGN must be the number of an
158 already created argument. Arguments can be added to a message
159 with `add-tooltalk-message-arg'.
162 - Function: add-tooltalk-message-arg msg mode type &optional value
163 Append one new argument to the message. MODE must be one of
164 `TT_IN', `TT_INOUT', or `TT_OUT', TYPE must be a string, and VALUE
165 can be a string or an integer. ToolTalk doesn't define any
166 semantics for TYPE, so only the participants in the protocol
167 you're using need to agree what types mean (if anything).
168 Conventionally `string' is used for strings and `int' for 32 bit
169 integers. Arguments can initialized by providing a value or with
170 `set-tooltalk-message-attribute'; the latter is necessary if you
171 want to initialize the argument with a string that can contain
172 embedded nulls (use `arg_bval').
175 - Function: create-tooltalk-message
176 Create a new ToolTalk message. The message's session attribute is
177 initialized to the default session. Other attributes can be
178 initialized with `set-tooltalk-message-attribute'.
179 `make-tooltalk-message' is the preferred way to create and
180 initialize a message.
183 - Function: destroy-tooltalk-message msg
184 Apply `tt_message_destroy' to the message. It's not necessary to
185 destroy messages after they've been processed by a message or
186 pattern callback, the Lisp/ToolTalk callback machinery does this
190 File: lispref.info, Node: Receiving Messages, Prev: Sending Messages, Up: ToolTalk Support
197 * Example of Receiving Messages::
198 * Elisp Interface for Receiving Messages::
201 File: lispref.info, Node: Example of Receiving Messages, Next: Elisp Interface for Receiving Messages, Up: Receiving Messages
203 Example of Receiving Messages
204 -----------------------------
206 Here's a simple example of a handler for a message that tells XEmacs
207 to display a string in the mini-buffer area. The message operation is
208 called `emacs-display-string'. Its first (0th) argument is the string
211 (defun tooltalk-display-string-handler (msg)
212 (message (get-tooltalk-message-attribute msg 'arg_val 0)))
214 (defvar display-string-pattern
217 op "emacs-display-string"
218 callback tooltalk-display-string-handler))
220 (let ((p (make-tooltalk-pattern display-string-pattern)))
221 (register-tooltalk-pattern p))
224 File: lispref.info, Node: Elisp Interface for Receiving Messages, Prev: Example of Receiving Messages, Up: Receiving Messages
226 Elisp Interface for Receiving Messages
227 --------------------------------------
229 - Function: make-tooltalk-pattern attributes
230 Create a ToolTalk pattern and initialize its attributes. The
231 value of attributes must be a list of alternating keyword/values,
232 where keywords are symbols that name valid pattern attributes or
233 lists of valid attributes. For example:
235 (make-tooltalk-pattern
236 '(category TT_OBSERVE
238 op ("operation1" "operation2")
239 args ("arg1" 12345 (TT_INOUT "arg3" "string"))))
241 Attribute names are the same as those supported by
242 `add-tooltalk-pattern-attribute', plus `'args'.
244 Values must always be strings, integers, or symbols that represent
245 ToolTalk constants or lists of same. When a list of values is
246 provided all of the list elements are added to the attribute. In
247 the example above, messages whose `op' attribute is `"operation1"'
248 or `"operation2"' would match the pattern.
250 The value of ARGS should be a list of pattern arguments where each
251 pattern argument has the following form:
253 `(mode [value [type]])' or just `value'
255 Where MODE is one of `TT_IN', `TT_OUT', or `TT_INOUT' and TYPE is
256 a string. If TYPE isn't specified then `int' is used if VALUE is
257 a number; otherwise `string' is used. If TYPE is `string' then
258 VALUE is converted to a string (if it isn't a string already) with
259 `prin1-to-string'. If only a value is specified then MODE
260 defaults to `TT_IN'. If MODE is `TT_OUT' then VALUE and TYPE
261 don't need to be specified. You can find out more about the
262 semantics and uses of ToolTalk pattern arguments in chapter 3 of
263 the `ToolTalk Programmer's Guide'.
266 - Function: register-tooltalk-pattern pat
267 XEmacs will begin receiving messages that match this pattern.
269 - Function: unregister-tooltalk-pattern pat
270 XEmacs will stop receiving messages that match this pattern.
272 - Function: add-tooltalk-pattern-attribute value pat indicator
273 Add one value to the indicated pattern attribute. The names of
274 attributes are the same as the ToolTalk accessors used to set them
275 less the `tooltalk_pattern_' prefix and the `_add' suffix. For
276 example, the name of the attribute for the
277 `tt_pattern_disposition_add' attribute is `disposition'. The
278 `category' attribute is handled specially, since a pattern can only
279 be a member of one category (`TT_OBSERVE' or `TT_HANDLE').
281 Callbacks are handled slightly differently than in the C ToolTalk
282 API. The value of CALLBACK should be the name of a function of one
283 argument. It will be called each time the pattern matches an
286 - Function: add-tooltalk-pattern-arg pat mode type value
287 Add one fully-specified argument to a ToolTalk pattern. MODE must
288 be one of `TT_IN', `TT_INOUT', or `TT_OUT'. TYPE must be a
289 string. VALUE can be an integer, string or `nil'. If VALUE is an
290 integer then an integer argument (`tt_pattern_iarg_add') is added;
291 otherwise a string argument is added. At present there's no way
292 to add a binary data argument.
295 - Function: create-tooltalk-pattern
296 Create a new ToolTalk pattern and initialize its session attribute
297 to be the default session.
299 - Function: destroy-tooltalk-pattern pat
300 Apply `tt_pattern_destroy' to the pattern. This effectively
301 unregisters the pattern.
303 - Function: describe-tooltalk-message msg &optional stream
304 Print the message's attributes and arguments to STREAM. This is
305 often useful for debugging.
308 File: lispref.info, Node: LDAP Support, Next: PostgreSQL Support, Prev: ToolTalk Support, Up: Top
313 XEmacs can be linked with a LDAP client library to provide Elisp
314 primitives to access directory servers using the Lightweight Directory
319 * Building XEmacs with LDAP support:: How to add LDAP support to XEmacs
320 * XEmacs LDAP API:: Lisp access to LDAP functions
321 * Syntax of Search Filters:: A brief summary of RFC 1558
324 File: lispref.info, Node: Building XEmacs with LDAP support, Next: XEmacs LDAP API, Prev: LDAP Support, Up: LDAP Support
326 Building XEmacs with LDAP support
327 =================================
329 LDAP support must be added to XEmacs at build time since it requires
330 linking to an external LDAP client library. As of 21.2, XEmacs has been
331 successfully built and tested with
333 * OpenLDAP 1.2 (<http://www.openldap.org/>)
335 * University of Michigan's LDAP 3.3
336 (<http://www.umich.edu/~dirsvcs/ldap/>)
338 * LDAP SDK 1.0 from Netscape Corp. (<http://developer.netscape.com/>)
340 Other libraries conforming to RFC 1823 will probably work also but
341 may require some minor tweaking at C level.
343 The standard XEmacs configure script auto-detects an installed LDAP
344 library provided the library itself and the corresponding header files
345 can be found in the library and include paths. A successful detection
346 will be signalled in the final output of the configure script.
349 File: lispref.info, Node: XEmacs LDAP API, Next: Syntax of Search Filters, Prev: Building XEmacs with LDAP support, Up: LDAP Support
354 XEmacs LDAP API consists of two layers: a low-level layer which
355 tries to stay as close as possible to the C API (where practical) and a
356 higher-level layer which provides more convenient primitives to
357 effectively use LDAP.
359 The low-level API should be used directly for very specific purposes
360 (such as multiple operations on a connection) only. The higher-level
361 functions provide a more convenient way to access LDAP directories
362 hiding the subtleties of handling the connection, translating arguments
363 and ensuring compliance with LDAP internationalization rules and formats
364 (currently partly implemented only).
368 * LDAP Variables:: Lisp variables related to LDAP
369 * The High-Level LDAP API:: High-level LDAP lisp functions
370 * The Low-Level LDAP API:: Low-level LDAP lisp primitives
371 * LDAP Internationalization:: I18n variables and functions
374 File: lispref.info, Node: LDAP Variables, Next: The High-Level LDAP API, Prev: XEmacs LDAP API, Up: XEmacs LDAP API
379 - Variable: ldap-default-host
380 The default LDAP server hostname. A TCP port number can be
381 appended to that name using a colon as a separator.
383 - Variable: ldap-default-port
384 Default TCP port for LDAP connections. Initialized from the LDAP
385 library. Default value is 389.
387 - Variable: ldap-default-base
388 Default base for LDAP searches. This is a string using the syntax
389 of RFC 1779. For instance, "o=ACME, c=US" limits the search to the
390 Acme organization in the United States.
392 - Variable: ldap-host-parameters-alist
393 An alist of per host options for LDAP transactions. The list
394 elements look like `(HOST PROP1 VAL1 PROP2 VAL2 ...)' HOST is the
395 name of an LDAP server. A TCP port number can be appended to that
396 name using a colon as a separator. PROPN and VALN are
397 property/value pairs describing parameters for the server. Valid
400 The distinguished name of the user to bind as. This may look
401 like `cn=Babs Jensen,o=ACME,c=US', see RFC 1779 for details.
404 The password to use for authentication.
407 The authentication method to use, possible values depend on
408 the LDAP library XEmacs was compiled with, they may include
409 `simple', `krbv41' and `krbv42'.
412 The base for the search. This may look like `cÿ, o¬me', see
413 RFC 1779 for syntax details.
416 One of the symbols `base', `onelevel' or `subtree' indicating
417 the scope of the search limited to a base object, to a single
418 level or to the whole subtree.
421 The dereference policy is one of the symbols `never',
422 `always', `search' or `find' and defines how aliases are
425 Aliases are never dereferenced
428 Aliases are always dereferenced
431 Aliases are dereferenced when searching
434 Aliases are dereferenced when locating the base object
438 The timeout limit for the connection in seconds.
441 The maximum number of matches to return for searches
442 performed on this connection.
444 - Variable: ldap-verbose
445 If non-`nil', LDAP operations will echo progress messages.
449 File: lispref.info, Node: The High-Level LDAP API, Next: The Low-Level LDAP API, Prev: LDAP Variables, Up: XEmacs LDAP API
451 The High-Level LDAP API
452 -----------------------
454 The following functions provide the most convenient interface to
455 perform LDAP operations. All of them open a connection to a host,
456 perform an operation (add/search/modify/delete) on one or several
457 entries and cleanly close the connection thus insulating the user from
458 all the details of the low-level interface such as LDAP Lisp objects
459 *note The Low-Level LDAP API::.
461 Note that `ldap-search' which used to be the name of the high-level
462 search function in XEmacs 21.1 is now obsolete. For consistency in the
463 naming as well as backward compatibility, that function now acts as a
464 wrapper that calls either `ldap-search-basic' (low-level search
465 function) or `ldap-search-entries' (high-level search function)
466 according to the actual parameters. A direct call to one of these two
467 functions is preferred since it is faster and unambiguous.
469 - Function: ldap-search-entries filter &optional host attributes
471 Perform an LDAP search. FILTER is the search filter *note Syntax
472 of Search Filters:: HOST is the LDAP host on which to perform the
473 search. ATTRIBUTES is the specific attributes to retrieve, `nil'
474 means retrieve all. ATTRSONLY if non-`nil' retrieves the
475 attributes only without their associated values. If WITHDN is
476 non-`nil' each entry in the result will be prepended with its
477 distinguished name DN. Additional search parameters can be
478 specified through `ldap-host-parameters-alist'. The function
479 returns a list of matching entries. Each entry is itself an alist
480 of attribute/value pairs optionally preceded by the DN of the
481 entry according to the value of WITHDN.
483 - Function: ldap-add-entries entries &optional host binddn passwd
484 Add entries to an LDAP directory. ENTRIES is a list of entry
485 specifications of the form `(DN (ATTR . VALUE) (ATTR . VALUE) ...)'
486 where DN the distinguished name of an entry to add, the following
487 are cons cells containing attribute/value string pairs. HOST is
488 the LDAP host, defaulting to `ldap-default-host' BINDDN is the DN
489 to bind as to the server PASSWD is the corresponding password.
491 - Function: ldap-modify-entries entry-mods &optional host binddn passwd
492 Modify entries of an LDAP directory. ENTRY_MODS is a list of
493 entry modifications of the form `(DN MOD-SPEC1 MOD-SPEC2 ...)'
494 where DN is the distinguished name of the entry to modify, the
495 following are modification specifications. A modification
496 specification is itself a list of the form `(MOD-OP ATTR VALUE1
497 VALUE2 ...)' MOD-OP and ATTR are mandatory, VALUES are optional
498 depending on MOD-OP. MOD-OP is the type of modification, one of
499 the symbols `add', `delete' or `replace'. ATTR is the LDAP
500 attribute type to modify. HOST is the LDAP host, defaulting to
501 `ldap-default-host' BINDDN is the DN to bind as to the server
502 PASSWD is the corresponding password"
504 - Function: ldap-delete-entries dn &optional host binddn passwd
505 Delete an entry from an LDAP directory. DN is the distinguished
506 name of an entry to delete or a list of those. HOST is the LDAP
507 host, defaulting to `ldap-default-host' BINDDN is the DN to bind
508 as to the server PASSWD is the corresponding password.
511 File: lispref.info, Node: The Low-Level LDAP API, Next: LDAP Internationalization, Prev: The High-Level LDAP API, Up: XEmacs LDAP API
513 The Low-Level LDAP API
514 ----------------------
516 The low-level API should be used directly for very specific purposes
517 (such as multiple operations on a connection) only. The higher-level
518 functions provide a more convenient way to access LDAP directories
519 hiding the subtleties of handling the connection, translating arguments
520 and ensuring compliance with LDAP internationalization rules and formats
521 (currently partly implemented only). See *note The High-Level LDAP API::
523 Note that the former functions `ldap-*-internal' functions have been
524 renamed in XEmacs 21.2
528 * The LDAP Lisp Object::
529 * Opening and Closing a LDAP Connection::
530 * Low-level Operations on a LDAP Server::
533 File: lispref.info, Node: The LDAP Lisp Object, Next: Opening and Closing a LDAP Connection, Prev: The Low-Level LDAP API, Up: The Low-Level LDAP API
538 An internal built-in `ldap' lisp object represents a LDAP connection.
540 - Function: ldapp object
541 This function returns non-`nil' if OBJECT is a `ldap' object.
543 - Function: ldap-host ldap
544 Return the server host of the connection represented by LDAP
546 - Function: ldap-live-p ldap
547 Return non-`nil' if LDAP is an active LDAP connection
550 File: lispref.info, Node: Opening and Closing a LDAP Connection, Next: Low-level Operations on a LDAP Server, Prev: The LDAP Lisp Object, Up: The Low-Level LDAP API
552 Opening and Closing a LDAP Connection
553 .....................................
555 - Function: ldap-open host &optional plist
556 Open a LDAP connection to HOST. PLIST is a property list
557 containing additional parameters for the connection. Valid keys
560 The TCP port to use for the connection if different from
561 `ldap-default-port' or the library builtin value
564 The authentication method to use, possible values depend on
565 the LDAP library XEmacs was compiled with, they may include
566 `simple', `krbv41' and `krbv42'.
569 The distinguished name of the user to bind as. This may look
570 like `c=com, o=Acme, cn=Babs Jensen', see RFC 1779 for
574 The password to use for authentication.
577 The dereference policy is one of the symbols `never',
578 `always', `search' or `find' and defines how aliases are
581 Aliases are never dereferenced
584 Aliases are always dereferenced
587 Aliases are dereferenced when searching
590 Aliases are dereferenced when locating the base object
591 for the search The default is `never'.
594 The timeout limit for the connection in seconds.
597 The maximum number of matches to return for searches
598 performed on this connection.
600 - Function: ldap-close ldap
601 Close the connection represented by LDAP
604 File: lispref.info, Node: Low-level Operations on a LDAP Server, Prev: Opening and Closing a LDAP Connection, Up: The Low-Level LDAP API
606 Low-level Operations on a LDAP Server
607 .....................................
609 `ldap-search-basic' is the low-level primitive to perform a search
610 on a LDAP server. It works directly on an open LDAP connection thus
611 requiring a preliminary call to `ldap-open'. Multiple searches can be
612 made on the same connection, then the session must be closed with
615 - Function: ldap-search-basic ldap filter base scope attrs attrsonly
616 Perform a search on an open connection LDAP created with
617 `ldap-open'. FILTER is a filter string for the search *note
618 Syntax of Search Filters:: BASE is the distinguished name at which
619 to start the search. SCOPE is one of the symbols `base',
620 `onelevel' or `subtree' indicating the scope of the search limited
621 to a base object, to a single level or to the whole subtree. The
622 default is `subtree'. `attrs' is a list of strings indicating
623 which attributes to retrieve for each matching entry. If `nil' all
624 available attributes are returned. If `attrsonly' is non-`nil'
625 then only the attributes are retrieved, not their associated values
626 If `withdn' is non-`nil' then each entry in the result is
627 prepended with its distinguished name DN If `verbose' is non-`nil'
628 then progress messages are echoed The function returns a list of
629 matching entries. Each entry is itself an alist of
630 attribute/value pairs optionally preceded by the DN of the entry
631 according to the value of `withdn'.
633 - Function: ldap-add ldap dn entry
634 Add ENTRY to a LDAP directory which a connection LDAP has been
635 opened to with `ldap-open'. DN is the distinguished name of the
636 entry to add. ENTRY is an entry specification, i.e., a list of
637 cons cells containing attribute/value string pairs.
639 - Function: ldap-modify ldap dn mods
640 Modify an entry in an LDAP directory. LDAP is an LDAP connection
641 object created with `ldap-open'. DN is the distinguished name of
642 the entry to modify. MODS is a list of modifications to apply. A
643 modification is a list of the form `(MOD-OP ATTR VALUE1 VALUE2
644 ...)' MOD-OP and ATTR are mandatory, VALUES are optional
645 depending on MOD-OP. MOD-OP is the type of modification, one of
646 the symbols `add', `delete' or `replace'. ATTR is the LDAP
647 attribute type to modify
649 - Function: ldap-delete ldap dn
650 Delete an entry to an LDAP directory. LDAP is an LDAP connection
651 object created with `ldap-open'. DN is the distinguished name of
655 File: lispref.info, Node: LDAP Internationalization, Prev: The Low-Level LDAP API, Up: XEmacs LDAP API
657 LDAP Internationalization
658 -------------------------
660 The XEmacs LDAP API provides basic internationalization features
661 based on the LDAP v3 specification (essentially RFC2252 on "LDAP v3
662 Attribute Syntax Definitions"). Unfortunately since there is currently
663 no free LDAP v3 server software, this part has not received much
664 testing and should be considered experimental. The framework is in
667 - Function: ldap-decode-attribute attr
668 Decode the attribute/value pair ATTR according to LDAP rules. The
669 attribute name is looked up in `ldap-attribute-syntaxes-alist' and
670 the corresponding decoder is then retrieved from
671 `ldap-attribute-syntax-decoders'' and applied on the value(s).
675 * LDAP Internationalization Variables::
676 * Encoder/Decoder Functions::
679 File: lispref.info, Node: LDAP Internationalization Variables, Next: Encoder/Decoder Functions, Prev: LDAP Internationalization, Up: LDAP Internationalization
681 LDAP Internationalization Variables
682 ...................................
684 - Variable: ldap-ignore-attribute-codings
685 If non-`nil', no encoding/decoding will be performed LDAP
688 - Variable: ldap-coding-system
689 Coding system of LDAP string values. LDAP v3 specifies the coding
690 system of strings to be UTF-8. You need an XEmacs with Mule
693 - Variable: ldap-default-attribute-decoder
694 Decoder function to use for attributes whose syntax is unknown.
695 Such a function receives an encoded attribute value as a string
696 and should return the decoded value as a string
698 - Variable: ldap-attribute-syntax-encoders
699 A vector of functions used to encode LDAP attribute values. The
700 sequence of functions corresponds to the sequence of LDAP
701 attribute syntax object identifiers of the form
702 1.3.6.1.4.1.1466.1115.121.1.* as defined in RFC2252 section 4.3.2.
703 As of this writing, only a few encoder functions are available.
705 - Variable: ldap-attribute-syntax-decoders
706 A vector of functions used to decode LDAP attribute values. The
707 sequence of functions corresponds to the sequence of LDAP
708 attribute syntax object identifiers of the form
709 1.3.6.1.4.1.1466.1115.121.1.* as defined in RFC2252 section 4.3.2.
710 As of this writing, only a few decoder functions are available.
712 - Variable: ldap-attribute-syntaxes-alist
713 A map of LDAP attribute names to their type object id minor number.
714 This table is built from RFC2252 Section 5 and RFC2256 Section 5
717 File: lispref.info, Node: Encoder/Decoder Functions, Prev: LDAP Internationalization Variables, Up: LDAP Internationalization
719 Encoder/Decoder Functions
720 .........................
722 - Function: ldap-encode-boolean bool
723 A function that encodes an elisp boolean BOOL into a LDAP boolean
724 string representation
726 - Function: ldap-decode-boolean str
727 A function that decodes a LDAP boolean string representation STR
728 into an elisp boolean
730 - Function: ldap-decode-string str
731 Decode a string STR according to `ldap-coding-system'
733 - Function: ldap-encode-string str
734 Encode a string STR according to `ldap-coding-system'
736 - Function: ldap-decode-address str
737 Decode an address STR according to `ldap-coding-system' and
738 replacing $ signs with newlines as specified by LDAP encoding
741 - Function: ldap-encode-address str
742 Encode an address STR according to `ldap-coding-system' and
743 replacing newlines with $ signs as specified by LDAP encoding
747 File: lispref.info, Node: Syntax of Search Filters, Prev: XEmacs LDAP API, Up: LDAP Support
749 Syntax of Search Filters
750 ========================
752 LDAP search functions use RFC1558 syntax to describe the search
753 filter. In that syntax simple filters have the form:
755 (<attr> <filtertype> <value>)
757 `<attr>' is an attribute name such as `cn' for Common Name, `o' for
760 `<value>' is the corresponding value. This is generally an exact
761 string but may also contain `*' characters as wildcards
763 `filtertype' is one `=' `~=', `<=', `>=' which respectively describe
764 equality, approximate equality, inferiority and superiority.
766 Thus `(cn=John Smith)' matches all records having a canonical name
769 A special case is the presence filter `(<attr>=*' which matches
770 records containing a particular attribute. For instance `(mail=*)'
771 matches all records containing a `mail' attribute.
773 Simple filters can be connected together with the logical operators
774 `&', `|' and `!' which stand for the usual and, or and not operators.
776 `(&(objectClass=Person)(mail=*)(|(sn=Smith)(givenname=John)))'
777 matches records of class `Person' containing a `mail' attribute and
778 corresponding to people whose last name is `Smith' or whose first name
782 File: lispref.info, Node: PostgreSQL Support, Next: Internationalization, Prev: LDAP Support, Up: Top
787 XEmacs can be linked with PostgreSQL libpq run-time support to
788 provide relational database access from Emacs Lisp code.
792 * Building XEmacs with PostgreSQL support::
793 * XEmacs PostgreSQL libpq API::
794 * XEmacs PostgreSQL libpq Examples::
797 File: lispref.info, Node: Building XEmacs with PostgreSQL support, Next: XEmacs PostgreSQL libpq API, Up: PostgreSQL Support
799 Building XEmacs with PostgreSQL support
800 =======================================
802 XEmacs PostgreSQL support requires linking to the PostgreSQL libpq.so
803 library. Describing how to build and install PostgreSQL is beyond the
804 scope of this document, see the PostgreSQL manual for details.
806 If you have installed XEmacs from one of the binary kits on
807 (<ftp://ftp.xemacs.org/>), or are using an XEmacs binary from a CD ROM,
808 you should have XEmacs PostgreSQL support by default. If you are
809 building XEmacs from source on a Linux system with PostgreSQL installed
810 into the default location, it should be autodetected when you run
811 configure. If you have installed PostgreSQL into its non-Linux default
812 location, `/usr/local/pgsql', you must specify
813 `--site-prefixes=/usr/local/pgsql' when you run configure. If you
814 installed PostgreSQL into another location, use that instead of
815 `/usr/local/pgsql' when specifying `--site-prefixes'.
817 As of XEmacs 21.2, PostgreSQL versions 6.5.3 and 7.0 are supported.
818 XEmacs Lisp support for V7.0 is somewhat more extensive than support for
819 V6.5. In particular, asynchronous queries are supported.
822 File: lispref.info, Node: XEmacs PostgreSQL libpq API, Next: XEmacs PostgreSQL libpq Examples, Prev: Building XEmacs with PostgreSQL support, Up: PostgreSQL Support
824 XEmacs PostgreSQL libpq API
825 ===========================
827 XEmacs PostgreSQL API is intended to be a policy-free, low-level
828 binding to libpq. The intent is to provide all the basic functionality
829 and then let high level Lisp code decide its own policies.
831 This documentation assumes that the reader has knowledge of SQL, but
832 requires no prior knowledge of libpq.
834 There are many examples in this manual and some setup will be
835 required. In order to run most of the following examples, the
836 following code needs to be executed. In addition to the data is in
837 this table, nearly all of the examples will assume that the free
838 variable `P' refers to this database connection. The examples in the
839 original edition of this manual were run against Postgres 7.0beta1.
842 (setq P (pq-connectdb ""))
843 ;; id is the primary key, shikona is a Japanese word that
844 ;; means `the professional name of a Sumo wrestler', and
845 ;; rank is the Sumo rank name.
846 (pq-exec P (concat "CREATE TABLE xemacs_test"
847 " (id int, shikona text, rank text);"))
848 (pq-exec P "COPY xemacs_test FROM stdin;")
849 (pq-put-line P "1\tMusashimaru\tYokuzuna\n")
850 (pq-put-line P "2\tDejima\tOozeki\n")
851 (pq-put-line P "3\tMusoyama\tSekiwake\n")
852 (pq-put-line P "4\tMiyabiyama\tSekiwake\n")
853 (pq-put-line P "5\tWakanoyama\tMaegashira\n")
854 (pq-put-line P "\\.\n")
860 * libpq Lisp Variables::
861 * libpq Lisp Symbols and DataTypes::
862 * Synchronous Interface Functions::
863 * Asynchronous Interface Functions::
864 * Large Object Support::
865 * Other libpq Functions::
866 * Unimplemented libpq Functions::
869 File: lispref.info, Node: libpq Lisp Variables, Next: libpq Lisp Symbols and DataTypes, Prev: XEmacs PostgreSQL libpq API, Up: XEmacs PostgreSQL libpq API
874 Various Unix environment variables are used by libpq to provide
875 defaults to the many different parameters. In the XEmacs Lisp API,
876 these environment variables are bound to Lisp variables to provide more
877 convenient access to Lisp Code. These variables are passed to the
878 backend database server during the establishment of a database
879 connection and when the `pq-setenv' call is made.
882 Initialized from the PGHOST environment variable. The default
886 Initialized from the PGUSER environment variable. The default
889 - Variable: pg:options
890 Initialized from the PGOPTIONS environment variable. Default
891 additional server options.
894 Initialized from the PGPORT environment variable. The default TCP
898 Initialized from the PGTTY environment variable. The default
901 Compatibility note: Debugging TTYs are turned off in the XEmacs
904 - Variable: pg:database
905 Initialized from the PGDATABASE environment variable. The default
906 database to connect to.
909 Initialized from the PGREALM environment variable. The default
912 - Variable: pg:client-encoding
913 Initialized from the PGCLIENTENCODING environment variable. The
914 default client encoding.
916 Compatibility note: This variable is not present in non-Mule
917 XEmacsen. This variable is not present in versions of libpq prior
918 to 7.0. In the current implementation, client encoding is
919 equivalent to the `file-name-coding-system' format.
921 - Variable: pg:authtype
922 Initialized from the PGAUTHTYPE environment variable. The default
923 authentication scheme used.
925 Compatibility note: This variable is unused in versions of libpq
926 after 6.5. It is not implemented at all in the XEmacs Lisp
930 Initialized from the PGGEQO environment variable. Genetic
933 - Variable: pg:cost-index
934 Initialized from the PGCOSTINDEX environment variable. Cost index
937 - Variable: pg:cost-heap
938 Initialized from the PGCOSTHEAP environment variable. Cost heap
942 Initialized from the PGTZ environment variable. Default timezone.
944 - Variable: pg:date-style
945 Initialized from the PGDATESTYLE environment variable. Default
946 date style in returned date objects.
948 - Variable: pg-coding-system
949 This is a variable controlling which coding system is used to
950 encode non-ASCII strings sent to the database.
952 Compatibility Note: This variable is not present in InfoDock.