comparison lisp/emacs-lisp/bindat.el @ 90580:7f3f771c85fa

Merge from emacs--devo--0 Patches applied: * emacs--devo--0 (patch 382-398) - Update from CVS - Update from erc--emacs--22 - Fix ERC bug introduced in last patch - Merge from gnus--rel--5.10 * gnus--rel--5.10 (patch 123-125) - Update from CVS Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-101
author Miles Bader <miles@gnu.org>
date Wed, 16 Aug 2006 14:08:49 +0000
parents a8190f7e546e 805ccb94d5d6
children a1a25ac6c88a
comparison
equal deleted inserted replaced
90579:c78f05b8f09e 90580:7f3f771c85fa
617 "Format vector VECT in hex format separated by dots. 617 "Format vector VECT in hex format separated by dots.
618 If optional second arg SEP is a string, use that as separator." 618 If optional second arg SEP is a string, use that as separator."
619 (bindat-format-vector vect "%02x" (if (stringp sep) sep ":"))) 619 (bindat-format-vector vect "%02x" (if (stringp sep) sep ":")))
620 620
621 (defun bindat-ip-to-string (ip) 621 (defun bindat-ip-to-string (ip)
622 "Format vector IP as an ip address in dotted notation." 622 "Format vector IP as an ip address in dotted notation.
623 (format "%d.%d.%d.%d" 623 The port (if any) is omitted. IP can be a string, as well."
624 (aref ip 0) (aref ip 1) (aref ip 2) (aref ip 3))) 624 (if (vectorp ip)
625 (format-network-address ip t)
626 (format "%d.%d.%d.%d"
627 (aref ip 0) (aref ip 1) (aref ip 2) (aref ip 3))))
625 628
626 (provide 'bindat) 629 (provide 'bindat)
627 630
628 ;;; arch-tag: 5e6708c3-03e2-4ad7-9885-5041b779c3fb 631 ;;; arch-tag: 5e6708c3-03e2-4ad7-9885-5041b779c3fb
629 ;;; bindat.el ends here 632 ;;; bindat.el ends here