1 ;;;; -*- Mode: Lisp; Syntax: ANSI-Common-Lisp; indent-tabs-mode: nil -*-
3 ;;; etc-files.lisp --- Common parsing routines for /etc namedb files.
6 (in-package :net.sockets
)
8 (eval-when (:compile-toplevel
)
9 (series::install
:macro t
:shadow nil
:shadow-extensions t
))
11 (defun space-char-p (char)
12 (declare (type character char
))
13 (or (char= char
#\Space
)
16 (defun split-etc-tokens (line)
17 (declare (type string line
))
18 (let ((comment-start (position #\
# line
)))
19 (split-sequence-if #'space-char-p line
20 :remove-empty-subseqs t
21 :start
0 :end comment-start
)))
23 (defmacro serialize-etc-file
(file)
24 `(#msplit-etc-tokens
(scan-file ,file
#'read-line
)))