Function: erc-normalize-port

erc-normalize-port is a byte-compiled function defined in erc.el.gz.

Signature

(erc-normalize-port PORT)

Documentation

Normalize the port specification PORT to integer form.

PORT may be an integer, a string or a symbol. If it is a string or a symbol, it may have these values:
* irc -> 194
* ircs -> 994
* ircd -> 6667
* ircd-dalnet -> 7000

Source Code

;; Defined in /usr/src/emacs/lisp/erc/erc.el.gz
(defun erc-normalize-port (port)
  "Normalize the port specification PORT to integer form.
PORT may be an integer, a string or a symbol.  If it is a string or a
symbol, it may have these values:
* irc         -> 194
* ircs        -> 994
* ircd        -> 6667
* ircd-dalnet -> 7000"
  (cond
   ((symbolp port)
    (erc-normalize-port (symbol-name port)))
   ((stringp port)
    (let ((port-nr (string-to-number port)))
      (cond
       ((> port-nr 0)
        port-nr)
       ((string-equal port "irc")
        194)
       ((string-equal port "ircs")
        994)
       ((string-equal port "ircd")
        6667)
       ((string-equal port "ircd-dalnet")
        7000)
       (t
        nil))))
   ((numberp port)
    port)
   (t
    nil)))