Function: x-dnd-xm-read-single-rec

x-dnd-xm-read-single-rec is a byte-compiled function defined in x-dnd.el.gz.

Signature

(x-dnd-xm-read-single-rec DATA I)

Documentation

Read a single rec from DATA, a Motif targets table.

I is the offset into DATA to begin reading at. Return a list of (CONSUMED NTARGETS TARGETS), where CONSUMED is the number of bytes read from DATA, NTARGETS is the total number of targets inside the current rec, and TARGETS is a vector of atoms describing the selection targets in the current rec.

Source Code

;; Defined in /usr/src/emacs/lisp/x-dnd.el.gz
(defun x-dnd-xm-read-single-rec (data i)
  "Read a single rec from DATA, a Motif targets table.
I is the offset into DATA to begin reading at.  Return a list
of (CONSUMED NTARGETS TARGETS), where CONSUMED is the number of
bytes read from DATA, NTARGETS is the total number of targets
inside the current rec, and TARGETS is a vector of atoms
describing the selection targets in the current rec."
  (let* ((byte-order (aref data 0))
         (n-targets (x-dnd-get-motif-value
                     data i 2 byte-order))
         (targets (make-vector n-targets nil))
         (consumed 0))
    (while (< consumed n-targets)
      (aset targets consumed (x-dnd-get-motif-value
                              data (+ i 2 (* consumed 4))
                              4 byte-order))
      (setq consumed (1+ consumed)))
    (list (+ 2 (* consumed 4)) n-targets targets)))