Sync with r21-2-33 and r21-2-33-utf-2000.
[chise/xemacs-chise.git] / info / lispref.info-41
1 This is ../info/lispref.info, produced by makeinfo version 4.0 from
2 lispref/lispref.texi.
3
4 INFO-DIR-SECTION XEmacs Editor
5 START-INFO-DIR-ENTRY
6 * Lispref: (lispref).           XEmacs Lisp Reference Manual.
7 END-INFO-DIR-ENTRY
8
9    Edition History:
10
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
20
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.
24
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.
28
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.
33
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.
38
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.
45
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.
51
52 \1f
53 File: lispref.info,  Node: Elisp Interface for Sending Messages,  Prev: Example of Sending Messages,  Up: Sending Messages
54
55 Elisp Interface for Sending Messages
56 ------------------------------------
57
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.
62      For example:
63
64             (make-tooltalk-message
65               '(class TT_NOTICE
66                 scope TT_SESSION
67                 address TT_PROCEDURE
68                 op "do-something"
69                 args ("arg1" 12345 (TT_INOUT "arg3" "string"))))
70
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'.
74
75      The value of `args' should be a list of message arguments where
76      each message argument has the following form:
77
78              `(mode [value [type]])' or just `value'
79
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'.
89
90
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'.
95
96
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'.
102
103
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.
116
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
121
122              (get-tooltalk-message-attribute msg 'plist 'rflag)
123
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:
128
129              (get-tooltalk-message-attribute msg 'arg_ival 2)
130
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.
138
139
140  - Function: set-tooltalk-message-attribute value msg attribute
141           &optional argn
142      Initialize one ToolTalk message attribute.
143
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'.
148
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.
155
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'.
160
161
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').
173
174
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.
181
182
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
187      for you.
188
189 \1f
190 File: lispref.info,  Node: Receiving Messages,  Prev: Sending Messages,  Up: ToolTalk Support
191
192 Receiving Messages
193 ==================
194
195 * Menu:
196
197 * Example of Receiving Messages::
198 * Elisp Interface for Receiving Messages::
199
200 \1f
201 File: lispref.info,  Node: Example of Receiving Messages,  Next: Elisp Interface for Receiving Messages,  Up: Receiving Messages
202
203 Example of Receiving Messages
204 -----------------------------
205
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
209 to display.
210
211      (defun tooltalk-display-string-handler (msg)
212        (message (get-tooltalk-message-attribute msg 'arg_val 0)))
213      
214      (defvar display-string-pattern
215        '(category TT_HANDLE
216             scope TT_SESSION
217                op "emacs-display-string"
218          callback tooltalk-display-string-handler))
219      
220      (let ((p (make-tooltalk-pattern display-string-pattern)))
221        (register-tooltalk-pattern p))
222
223 \1f
224 File: lispref.info,  Node: Elisp Interface for Receiving Messages,  Prev: Example of Receiving Messages,  Up: Receiving Messages
225
226 Elisp Interface for Receiving Messages
227 --------------------------------------
228
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:
234
235             (make-tooltalk-pattern
236               '(category TT_OBSERVE
237                    scope TT_SESSION
238                       op ("operation1" "operation2")
239                     args ("arg1" 12345 (TT_INOUT "arg3" "string"))))
240
241      Attribute names are the same as those supported by
242      `add-tooltalk-pattern-attribute', plus `'args'.
243
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.
249
250      The value of ARGS should be a list of pattern arguments where each
251      pattern argument has the following form:
252
253              `(mode [value [type]])' or just `value'
254
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'.
264
265
266  - Function: register-tooltalk-pattern pat
267      XEmacs will begin receiving messages that match this pattern.
268
269  - Function: unregister-tooltalk-pattern pat
270      XEmacs will stop receiving messages that match this pattern.
271
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').
280
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
284      incoming message.
285
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.
293
294
295  - Function: create-tooltalk-pattern
296      Create a new ToolTalk pattern and initialize its session attribute
297      to be the default session.
298
299  - Function: destroy-tooltalk-pattern pat
300      Apply `tt_pattern_destroy' to the pattern.  This effectively
301      unregisters the pattern.
302
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.
306
307 \1f
308 File: lispref.info,  Node: LDAP Support,  Next: PostgreSQL Support,  Prev: ToolTalk Support,  Up: Top
309
310 LDAP Support
311 ************
312
313    XEmacs can be linked with a LDAP client library to provide Elisp
314 primitives to access directory servers using the Lightweight Directory
315 Access Protocol.
316
317 * Menu:
318
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
322
323 \1f
324 File: lispref.info,  Node: Building XEmacs with LDAP support,  Next: XEmacs LDAP API,  Prev: LDAP Support,  Up: LDAP Support
325
326 Building XEmacs with LDAP support
327 =================================
328
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
332
333    * OpenLDAP 1.2 (<http://www.openldap.org/>)
334
335    * University of Michigan's LDAP 3.3
336      (<http://www.umich.edu/~dirsvcs/ldap/>)
337
338    * LDAP SDK 1.0 from Netscape Corp. (<http://developer.netscape.com/>)
339
340    Other libraries conforming to RFC 1823 will probably work also but
341 may require some minor tweaking at C level.
342
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.
347
348 \1f
349 File: lispref.info,  Node: XEmacs LDAP API,  Next: Syntax of Search Filters,  Prev: Building XEmacs with LDAP support,  Up: LDAP Support
350
351 XEmacs LDAP API
352 ===============
353
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.
358
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).
365
366 * Menu:
367
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
372
373 \1f
374 File: lispref.info,  Node: LDAP Variables,  Next: The High-Level LDAP API,  Prev: XEmacs LDAP API,  Up: XEmacs LDAP API
375
376 LDAP Variables
377 --------------
378
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.
382
383  - Variable: ldap-default-port
384      Default TCP port for LDAP connections.  Initialized from the LDAP
385      library. Default value is 389.
386
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.
391
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
398      properties:
399     `binddn'
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.
402
403     `passwd'
404           The password to use for authentication.
405
406     `auth'
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'.
410
411     `base'
412           The base for the search. This may look like `cÿ, o¬me', see
413           RFC 1779 for syntax details.
414
415     `scope'
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.
419
420     `deref'
421           The dereference policy is one of the symbols `never',
422           `always', `search' or `find' and defines how aliases are
423           dereferenced.
424          `never'
425                Aliases are never dereferenced
426
427          `always'
428                Aliases are always dereferenced
429
430          `search'
431                Aliases are dereferenced when searching
432
433          `find'
434                Aliases are dereferenced when locating the base object
435                for the search
436
437     `timelimit'
438           The timeout limit for the connection in seconds.
439
440     `sizelimit'
441           The maximum number of matches to return for searches
442           performed on this connection.
443
444  - Variable: ldap-verbose
445      If non-`nil', LDAP operations will echo progress messages.
446      Defaults to `nil'.
447
448 \1f
449 File: lispref.info,  Node: The High-Level LDAP API,  Next: The Low-Level LDAP API,  Prev: LDAP Variables,  Up: XEmacs LDAP API
450
451 The High-Level LDAP API
452 -----------------------
453
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::.
460
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.
468
469  - Function: ldap-search-entries filter &optional host attributes
470           attrsonly withdn
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.
482
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.
490
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"
503
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.
509
510 \1f
511 File: lispref.info,  Node: The Low-Level LDAP API,  Next: LDAP Internationalization,  Prev: The High-Level LDAP API,  Up: XEmacs LDAP API
512
513 The Low-Level LDAP API
514 ----------------------
515
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::
522
523    Note that the former functions `ldap-*-internal' functions have been
524 renamed in XEmacs 21.2
525
526 * Menu:
527
528 * The LDAP Lisp Object::
529 * Opening and Closing a LDAP Connection::
530 * Low-level Operations on a LDAP Server::
531
532 \1f
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
534
535 The LDAP Lisp Object
536 ....................
537
538    An internal built-in `ldap' lisp object represents a LDAP connection.
539
540  - Function: ldapp object
541      This function returns non-`nil' if OBJECT is a `ldap' object.
542
543  - Function: ldap-host ldap
544      Return the server host of the connection represented by LDAP
545
546  - Function: ldap-live-p ldap
547      Return non-`nil' if LDAP is an active LDAP connection
548
549 \1f
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
551
552 Opening and Closing a LDAP Connection
553 .....................................
554
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
558      in that list are:
559     `port'
560           The TCP port to use for the connection if different from
561           `ldap-default-port' or the library builtin value
562
563     `auth'
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'.
567
568     `binddn'
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
571           details.
572
573     `passwd'
574           The password to use for authentication.
575
576     `deref'
577           The dereference policy is one of the symbols `never',
578           `always', `search' or `find' and defines how aliases are
579           dereferenced.
580          `never'
581                Aliases are never dereferenced
582
583          `always'
584                Aliases are always dereferenced
585
586          `search'
587                Aliases are dereferenced when searching
588
589          `find'
590                Aliases are dereferenced when locating the base object
591                for the search The default is `never'.
592
593     `timelimit'
594           The timeout limit for the connection in seconds.
595
596     `sizelimit'
597           The maximum number of matches to return for searches
598           performed on this connection.
599
600  - Function: ldap-close ldap
601      Close the connection represented by LDAP
602
603 \1f
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
605
606 Low-level Operations on a LDAP Server
607 .....................................
608
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
613 `ldap-close'.
614
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'.
632
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.
638
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
648
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
652      the entry to delete
653
654 \1f
655 File: lispref.info,  Node: LDAP Internationalization,  Prev: The Low-Level LDAP API,  Up: XEmacs LDAP API
656
657 LDAP Internationalization
658 -------------------------
659
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
665 place though.
666
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).
672
673 * Menu:
674
675 * LDAP Internationalization Variables::
676 * Encoder/Decoder Functions::
677
678 \1f
679 File: lispref.info,  Node: LDAP Internationalization Variables,  Next: Encoder/Decoder Functions,  Prev: LDAP Internationalization,  Up: LDAP Internationalization
680
681 LDAP Internationalization Variables
682 ...................................
683
684  - Variable: ldap-ignore-attribute-codings
685      If non-`nil', no encoding/decoding will be performed LDAP
686      attribute values
687
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
691      support for this.
692
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
697
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.
704
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.
711
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
715
716 \1f
717 File: lispref.info,  Node: Encoder/Decoder Functions,  Prev: LDAP Internationalization Variables,  Up: LDAP Internationalization
718
719 Encoder/Decoder Functions
720 .........................
721
722  - Function: ldap-encode-boolean bool
723      A function that encodes an elisp boolean BOOL into a LDAP boolean
724      string representation
725
726  - Function: ldap-decode-boolean str
727      A function that decodes a LDAP boolean string representation STR
728      into an elisp boolean
729
730  - Function: ldap-decode-string str
731      Decode a string STR according to `ldap-coding-system'
732
733  - Function: ldap-encode-string str
734      Encode a string STR according to `ldap-coding-system'
735
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
739      rules for addresses
740
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
744      rules for addresses
745
746 \1f
747 File: lispref.info,  Node: Syntax of Search Filters,  Prev: XEmacs LDAP API,  Up: LDAP Support
748
749 Syntax of Search Filters
750 ========================
751
752    LDAP search functions use RFC1558 syntax to describe the search
753 filter.  In that syntax simple filters have the form:
754
755      (<attr> <filtertype> <value>)
756
757    `<attr>' is an attribute name such as `cn' for Common Name, `o' for
758 Organization, etc...
759
760    `<value>' is the corresponding value.  This is generally an exact
761 string but may also contain `*' characters as wildcards
762
763    `filtertype' is one `=' `~=', `<=', `>=' which respectively describe
764 equality, approximate equality, inferiority and superiority.
765
766    Thus `(cn=John Smith)' matches all records having a canonical name
767 equal to John Smith.
768
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.
772
773    Simple filters can be connected together with the logical operators
774 `&', `|' and `!' which stand for the usual and, or and not operators.
775
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
779 is `John'.
780
781 \1f
782 File: lispref.info,  Node: PostgreSQL Support,  Next: Internationalization,  Prev: LDAP Support,  Up: Top
783
784 PostgreSQL Support
785 ******************
786
787    XEmacs can be linked with PostgreSQL libpq run-time support to
788 provide relational database access from Emacs Lisp code.
789
790 * Menu:
791
792 * Building XEmacs with PostgreSQL support::
793 * XEmacs PostgreSQL libpq API::
794 * XEmacs PostgreSQL libpq Examples::
795
796 \1f
797 File: lispref.info,  Node: Building XEmacs with PostgreSQL support,  Next: XEmacs PostgreSQL libpq API,  Up: PostgreSQL Support
798
799 Building XEmacs with PostgreSQL support
800 =======================================
801
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.
805
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'.
816
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.
820
821 \1f
822 File: lispref.info,  Node: XEmacs PostgreSQL libpq API,  Next: XEmacs PostgreSQL libpq Examples,  Prev: Building XEmacs with PostgreSQL support,  Up: PostgreSQL Support
823
824 XEmacs PostgreSQL libpq API
825 ===========================
826
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.
830
831    This documentation assumes that the reader has knowledge of SQL, but
832 requires no prior knowledge of libpq.
833
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.
840
841      (progn
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")
855        (pq-end-copy P))
856           => nil
857
858 * Menu:
859
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::
867
868 \1f
869 File: lispref.info,  Node: libpq Lisp Variables,  Next: libpq Lisp Symbols and DataTypes,  Prev: XEmacs PostgreSQL libpq API,  Up: XEmacs PostgreSQL libpq API
870
871 libpq Lisp Variables
872 --------------------
873
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.
880
881  - Variable: pg:host
882      Initialized from the PGHOST environment variable.  The default
883      host to connect to.
884
885  - Variable: pg:user
886      Initialized from the PGUSER environment variable.  The default
887      database user name.
888
889  - Variable: pg:options
890      Initialized from the PGOPTIONS environment variable.  Default
891      additional server options.
892
893  - Variable: pg:port
894      Initialized from the PGPORT environment variable.  The default TCP
895      port to connect to.
896
897  - Variable: pg:tty
898      Initialized from the PGTTY environment variable.  The default
899      debugging TTY.
900
901      Compatibility note:  Debugging TTYs are turned off in the XEmacs
902      Lisp binding.
903
904  - Variable: pg:database
905      Initialized from the PGDATABASE environment variable.  The default
906      database to connect to.
907
908  - Variable: pg:realm
909      Initialized from the PGREALM environment variable.  The default
910      Kerberos realm.
911
912  - Variable: pg:client-encoding
913      Initialized from the PGCLIENTENCODING environment variable.  The
914      default client encoding.
915
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.
920
921  - Variable: pg:authtype
922      Initialized from the PGAUTHTYPE environment variable.  The default
923      authentication scheme used.
924
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
927      binding.
928
929  - Variable: pg:geqo
930      Initialized from the PGGEQO environment variable.  Genetic
931      optimizer options.
932
933  - Variable: pg:cost-index
934      Initialized from the PGCOSTINDEX environment variable.  Cost index
935      options.
936
937  - Variable: pg:cost-heap
938      Initialized from the PGCOSTHEAP environment variable.  Cost heap
939      options.
940
941  - Variable: pg:tz
942      Initialized from the PGTZ environment variable.  Default timezone.
943
944  - Variable: pg:date-style
945      Initialized from the PGDATESTYLE environment variable.  Default
946      date style in returned date objects.
947
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.
951
952      Compatibility Note: This variable is not present in InfoDock.
953