From 6a6d9896be04bb1aa4da504ba891f3a22182cc49 Mon Sep 17 00:00:00 2001 From: Stelian Ionescu Date: Thu, 4 Sep 2008 21:02:04 +0200 Subject: [PATCH] Cosmetic changes. --- base/conditions.lisp | 4 +-- net.sockets/socket-methods.lisp | 60 ++++++++++++++++++++-------------------- syscalls/conditions.lisp | 12 ++++---- syscalls/ffi-functions-unix.lisp | 44 ++++++++++++++--------------- syscalls/ffi-wrappers-unix.lisp | 8 +++--- syscalls/os-conditions-unix.lisp | 4 +-- 6 files changed, 66 insertions(+), 66 deletions(-) diff --git a/base/conditions.lisp b/base/conditions.lisp index dfb75cf..9fe8d34 100644 --- a/base/conditions.lisp +++ b/base/conditions.lisp @@ -5,9 +5,9 @@ (in-package :iolib.base) -;;;----------------------------------------------------------------------------- +;;;------------------------------------------------------------------------- ;;; Bugs -;;;----------------------------------------------------------------------------- +;;;------------------------------------------------------------------------- (define-condition bug (error) ((message :reader message :initarg :message)) diff --git a/net.sockets/socket-methods.lisp b/net.sockets/socket-methods.lisp index 24733d8..4348066 100644 --- a/net.sockets/socket-methods.lisp +++ b/net.sockets/socket-methods.lisp @@ -5,9 +5,9 @@ (in-package :net.sockets) -;;;----------------------------------------------------------------------------- +;;;------------------------------------------------------------------------- ;;; Shared Initialization -;;;----------------------------------------------------------------------------- +;;;------------------------------------------------------------------------- (defun translate-make-socket-keywords-to-constants (address-family type protocol) (let ((sf (ecase address-family @@ -49,9 +49,9 @@ (setf (external-format-of socket) external-format)) -;;;----------------------------------------------------------------------------- +;;;------------------------------------------------------------------------- ;;; Misc -;;;----------------------------------------------------------------------------- +;;;------------------------------------------------------------------------- (defmethod socket-type ((socket stream-socket)) :stream) @@ -64,9 +64,9 @@ (eq :ipv6 (socket-address-family socket))) -;;;----------------------------------------------------------------------------- +;;;------------------------------------------------------------------------- ;;; PRINT-OBJECT -;;;----------------------------------------------------------------------------- +;;;------------------------------------------------------------------------- (defun sock-fam (socket) (ecase (socket-address-family socket) @@ -133,9 +133,9 @@ (format stream ", closed" ))))) -;;;----------------------------------------------------------------------------- +;;;------------------------------------------------------------------------- ;;; CLOSE -;;;----------------------------------------------------------------------------- +;;;------------------------------------------------------------------------- (defmethod close :around ((socket socket) &key abort) (declare (ignore abort)) @@ -162,9 +162,9 @@ (:no-error (_) (declare (ignore _)) t))))) -;;;----------------------------------------------------------------------------- +;;;------------------------------------------------------------------------- ;;; GETSOCKNAME -;;;----------------------------------------------------------------------------- +;;;------------------------------------------------------------------------- (defun %local-name (socket) (with-sockaddr-storage-and-socklen (ss size) @@ -184,9 +184,9 @@ (%local-name socket)) -;;;----------------------------------------------------------------------------- +;;;------------------------------------------------------------------------- ;;; GETPEERNAME -;;;----------------------------------------------------------------------------- +;;;------------------------------------------------------------------------- (defun %remote-name (socket) (with-sockaddr-storage-and-socklen (ss size) @@ -206,9 +206,9 @@ (%remote-name socket)) -;;;----------------------------------------------------------------------------- +;;;------------------------------------------------------------------------- ;;; BIND -;;;----------------------------------------------------------------------------- +;;;------------------------------------------------------------------------- (defmethod bind-address :before ((socket internet-socket) address &key (reuse-address t)) @@ -247,9 +247,9 @@ (setf (slot-value socket 'bound) t)) -;;;----------------------------------------------------------------------------- +;;;------------------------------------------------------------------------- ;;; LISTEN -;;;----------------------------------------------------------------------------- +;;;------------------------------------------------------------------------- (defmethod listen-on ((socket passive-socket) &key backlog) (unless backlog (setf backlog (min *default-backlog-size* @@ -263,9 +263,9 @@ (error "You can't listen on active sockets.")) -;;;----------------------------------------------------------------------------- +;;;------------------------------------------------------------------------- ;;; ACCEPT -;;;----------------------------------------------------------------------------- +;;;------------------------------------------------------------------------- (defmethod accept-connection ((socket active-socket) &key) (error "You can't accept connections on active sockets.")) @@ -288,9 +288,9 @@ (make-client-socket (%accept (fd-of socket) ss size))))))) -;;;----------------------------------------------------------------------------- +;;;------------------------------------------------------------------------- ;;; CONNECT -;;;----------------------------------------------------------------------------- +;;;------------------------------------------------------------------------- (defun ipv4-connect (fd address port) (with-sockaddr-in (sin address port) @@ -345,9 +345,9 @@ (:no-error (_) (declare (ignore _)) t))))) -;;;----------------------------------------------------------------------------- +;;;------------------------------------------------------------------------- ;;; DISCONNECT -;;;----------------------------------------------------------------------------- +;;;------------------------------------------------------------------------- (defmethod disconnect :before ((socket socket)) (unless (typep socket 'datagram-socket) @@ -361,9 +361,9 @@ (values socket))) -;;;----------------------------------------------------------------------------- +;;;------------------------------------------------------------------------- ;;; SHUTDOWN -;;;----------------------------------------------------------------------------- +;;;------------------------------------------------------------------------- (defmethod shutdown ((socket socket) &key read write) (assert (or read write) (read write) @@ -376,9 +376,9 @@ (values socket)) -;;;----------------------------------------------------------------------------- +;;;------------------------------------------------------------------------- ;;; Socket flag definition -;;;----------------------------------------------------------------------------- +;;;------------------------------------------------------------------------- (defmacro define-socket-flag (place name value platform) (let ((val (cond ((or (not platform) @@ -394,9 +394,9 @@ ,@(mapcar #'dflag definitions)))) -;;;----------------------------------------------------------------------------- +;;;------------------------------------------------------------------------- ;;; SENDTO -;;;----------------------------------------------------------------------------- +;;;------------------------------------------------------------------------- (defvar *sendto-flags* ()) @@ -467,9 +467,9 @@ form)))) -;;;----------------------------------------------------------------------------- +;;;------------------------------------------------------------------------- ;;; RECVFROM -;;;----------------------------------------------------------------------------- +;;;------------------------------------------------------------------------- (defvar *recvfrom-flags* ()) diff --git a/syscalls/conditions.lisp b/syscalls/conditions.lisp index 8b93ca4..1b28e30 100644 --- a/syscalls/conditions.lisp +++ b/syscalls/conditions.lisp @@ -5,9 +5,9 @@ (in-package :iolib.syscalls) -;;;----------------------------------------------------------------------------- +;;;------------------------------------------------------------------------- ;;; System Errors -;;;----------------------------------------------------------------------------- +;;;------------------------------------------------------------------------- (define-condition condition-info-mixin (condition) ((code :initarg :code :reader code-of @@ -34,9 +34,9 @@ (error 'syscall-error :message (format nil "~?" control-string args))) -;;;----------------------------------------------------------------------------- +;;;------------------------------------------------------------------------- ;;; I/O Poll Errors -;;;----------------------------------------------------------------------------- +;;;------------------------------------------------------------------------- (define-condition poll-error (system-error) ((event-type :initarg :event-type :reader event-type-of) @@ -63,9 +63,9 @@ of a file descriptor.")) of a file descriptor.")) -;;;----------------------------------------------------------------------------- +;;;------------------------------------------------------------------------- ;;; Repeat upon conditions -;;;----------------------------------------------------------------------------- +;;;------------------------------------------------------------------------- (defmacro repeat-decreasing-timeout ((timeout-var timeout &optional (block-name nil blockp)) &body body) diff --git a/syscalls/ffi-functions-unix.lisp b/syscalls/ffi-functions-unix.lisp index 2748d60..9961d06 100644 --- a/syscalls/ffi-functions-unix.lisp +++ b/syscalls/ffi-functions-unix.lisp @@ -9,9 +9,9 @@ #+linux (load-foreign-library "librt.so") -;;;----------------------------------------------------------------------------- +;;;------------------------------------------------------------------------- ;;; ERRNO-related functions -;;;----------------------------------------------------------------------------- +;;;------------------------------------------------------------------------- (defentrypoint (setf %sys-errno) (value) (%%sys-set-errno value)) @@ -34,9 +34,9 @@ (or (%sys-strerror code) "[Can't get error string.]"))))) -;;;----------------------------------------------------------------------------- +;;;------------------------------------------------------------------------- ;;; Memory manipulation -;;;----------------------------------------------------------------------------- +;;;------------------------------------------------------------------------- (defcfun* ("memset" %sys-memset) :pointer (buffer :pointer) @@ -57,9 +57,9 @@ (length size-t)) -;;;----------------------------------------------------------------------------- +;;;------------------------------------------------------------------------- ;;; I/O -;;;----------------------------------------------------------------------------- +;;;------------------------------------------------------------------------- (defsyscall* ("read" %sys-read) ssize-t "Read at most COUNT bytes from FD into the foreign area BUF." @@ -74,9 +74,9 @@ (count size-t)) -;;;----------------------------------------------------------------------------- +;;;------------------------------------------------------------------------- ;;; Files -;;;----------------------------------------------------------------------------- +;;;------------------------------------------------------------------------- (defsyscall* ("open" %%sys-open) :int (pathname filename-designator) @@ -209,9 +209,9 @@ (values (%%sys-mkstemp ptr) (foreign-string-to-lisp ptr))))) -;;;----------------------------------------------------------------------------- +;;;------------------------------------------------------------------------- ;;; Directories -;;;----------------------------------------------------------------------------- +;;;------------------------------------------------------------------------- (defsyscall "mkdir" :int "Create a directory." @@ -246,9 +246,9 @@ (values (%%sys-mkdtemp ptr) (foreign-string-to-lisp ptr))))) -;;;----------------------------------------------------------------------------- +;;;------------------------------------------------------------------------- ;;; File Descriptors -;;;----------------------------------------------------------------------------- +;;;------------------------------------------------------------------------- (defsyscall ("close" %sys-close) :int "Close an open file descriptor." @@ -274,9 +274,9 @@ (not (minusp (%sys-fstat fd)))) -;;;----------------------------------------------------------------------------- +;;;------------------------------------------------------------------------- ;;; File descriptor polling -;;;----------------------------------------------------------------------------- +;;;------------------------------------------------------------------------- ;;; FIXME: Until a way to autodetect platform features is implemented #+(or darwin freebsd) @@ -289,9 +289,9 @@ (timeout :int)) -;;;----------------------------------------------------------------------------- +;;;------------------------------------------------------------------------- ;;; Memory mapping -;;;----------------------------------------------------------------------------- +;;;------------------------------------------------------------------------- (defsyscall ("munmap" %sys-munmap) :int "Unmap pages of memory." @@ -299,9 +299,9 @@ (len size-t)) -;;;----------------------------------------------------------------------------- +;;;------------------------------------------------------------------------- ;;; Time -;;;----------------------------------------------------------------------------- +;;;------------------------------------------------------------------------- (defsyscall* ("usleep" %sys-usleep) :int (useconds useconds-t)) @@ -403,9 +403,9 @@ (+ seconds (/ nanoseconds 1d9)))) -;;;----------------------------------------------------------------------------- +;;;------------------------------------------------------------------------- ;;; Environement -;;;----------------------------------------------------------------------------- +;;;------------------------------------------------------------------------- (defcvar ("environ" :read-only t) (:pointer :string)) @@ -424,9 +424,9 @@ (name :string)) -;;;----------------------------------------------------------------------------- +;;;------------------------------------------------------------------------- ;;; Local info -;;;----------------------------------------------------------------------------- +;;;------------------------------------------------------------------------- (defsyscall ("gethostname" %%sys-gethostname) :int (name :pointer) diff --git a/syscalls/ffi-wrappers-unix.lisp b/syscalls/ffi-wrappers-unix.lisp index 44c6f8c..8a5cecb 100644 --- a/syscalls/ffi-wrappers-unix.lisp +++ b/syscalls/ffi-wrappers-unix.lisp @@ -16,9 +16,9 @@ "unistd.h" "sys/mman.h") -;;;----------------------------------------------------------------------------- +;;;------------------------------------------------------------------------- ;;; Large-file support -;;;----------------------------------------------------------------------------- +;;;------------------------------------------------------------------------- ;;; FIXME: this is only necessary on Linux right? @@ -86,9 +86,9 @@ (offset off-t)) -;;;----------------------------------------------------------------------------- +;;;------------------------------------------------------------------------- ;;; ERRNO-related functions -;;;----------------------------------------------------------------------------- +;;;------------------------------------------------------------------------- (declaim (inline %sys-errno)) (defwrapper* ("iolib_get_errno" %sys-errno) :int diff --git a/syscalls/os-conditions-unix.lisp b/syscalls/os-conditions-unix.lisp index 02d3344..5fade91 100644 --- a/syscalls/os-conditions-unix.lisp +++ b/syscalls/os-conditions-unix.lisp @@ -5,9 +5,9 @@ (in-package :iolib.syscalls) -;;;----------------------------------------------------------------------------- +;;;------------------------------------------------------------------------- ;;; POSIX Syscall Errors -;;;----------------------------------------------------------------------------- +;;;------------------------------------------------------------------------- (define-condition posix-error (syscall-error) () -- 2.11.4.GIT