Function: eudc-translate-query

eudc-translate-query is a byte-compiled function defined in eudc.el.gz.

Signature

(eudc-translate-query QUERY &optional REVERSE)

Documentation

Translate attribute names of QUERY.

The translation is done according to eudc-protocol-attributes-translation-alist.

When REVERSE is nil or omitted, the attribute names are translated from EUDC generic names to protocol-specific names. When REVERSE is non-nil, the translation is from protocol-specific names back to EUDC generic names.

Source Code

;; Defined in /usr/src/emacs/lisp/net/eudc.el.gz
(defun eudc-translate-query (query &optional reverse)
  "Translate attribute names of QUERY.
The translation is done according to
`eudc-protocol-attributes-translation-alist'.

When REVERSE is nil or omitted, the attribute names are
translated from EUDC generic names to protocol-specific
names.  When REVERSE is non-nil, the translation is from
protocol-specific names back to EUDC generic names."
  (if eudc-protocol-attributes-translation-alist
      (mapcar (lambda (attribute)
                (let ((trans
                       (if reverse
                           (rassq (car attribute)
                                  (symbol-value eudc-protocol-attributes-translation-alist))
                         (assq (car attribute)
                               (symbol-value eudc-protocol-attributes-translation-alist)))))
                  (if trans
                      (cons (if reverse (car trans) (cdr trans))
                            (cdr attribute))
                    attribute)))
	      query)
    query))