Lines Matching +refs:format +refs:spec
69 ;; (setq header-bindat-spec
75 ;; (setq data-bindat-spec
83 ;; (setq packet-bindat-spec
84 ;; '((header struct header-bindat-spec)
88 ;; (struct data-bindat-spec))))
124 ;; We recommend using names that end in `-bindat-spec'; such names
178 ;; to current structure spec.
283 (defun bindat--unpack-group (spec)
285 (while spec
286 (let* ((item (car spec))
293 (setq spec (cdr spec))
346 (defun bindat-unpack (spec bindat-raw &optional bindat-idx)
353 (bindat--unpack-group spec))
380 (defun bindat--length-group (struct spec)
382 (while spec
383 (let* ((item (car spec))
389 (setq spec (cdr spec))
450 (defun bindat-length (spec struct)
453 (bindat--length-group struct spec)
543 (defun bindat--pack-group (struct spec)
545 (while spec
546 (let* ((item (car spec))
552 (setq spec (cdr spec))
604 (defun bindat-pack (spec struct &optional bindat-raw bindat-idx)
614 (setq bindat-raw (make-vector (+ bindat-idx (bindat-length spec struct)) 0)))
615 (bindat--pack-group struct spec)
619 ;; Misc. format conversions
621 (defun bindat-format-vector (vect fmt sep &optional len)
622 "Format vector VECT using element format FMT and separator SEP.
631 s (cons (format (if (= i 0) fmt fmt2) (aref vect i)) s)))
635 "Format vector VECT in decimal format separated by dots.
637 (bindat-format-vector vect "%d" (if (stringp sep) sep ".")))
640 "Format vector VECT in hex format separated by dots.
642 (bindat-format-vector vect "%02x" (if (stringp sep) sep ":")))
648 (format-network-address ip t)
649 (format "%d.%d.%d.%d"