Function: bindat-get-field

bindat-get-field is a byte-compiled function defined in bindat.el.gz.

Signature

(bindat-get-field STRUCT &rest FIELD)

Documentation

In structured data STRUCT, return value of field named FIELD.

If multiple field names are specified, use the field names to lookup nested sub-structures in STRUCT, corresponding to the C-language syntax STRUCT.FIELD1.FIELD2.FIELD3... An integer value in the field list is taken as an array index, e.g. corresponding to STRUCT.FIELD1[INDEX2].FIELD3...

Source Code

;; Defined in /usr/src/emacs/lisp/emacs-lisp/bindat.el.gz
(defun bindat-get-field (struct &rest field)
  "In structured data STRUCT, return value of field named FIELD.
If multiple field names are specified, use the field names to
lookup nested sub-structures in STRUCT, corresponding to the
C-language syntax STRUCT.FIELD1.FIELD2.FIELD3...
An integer value in the field list is taken as an array index,
e.g. corresponding to STRUCT.FIELD1[INDEX2].FIELD3..."
  (while (and struct field)
    (setq struct (if (integerp (car field))
		     (elt struct (car field))
		   (cdr (assq (car field) struct))))
    (setq field (cdr field)))
  struct)