From c9d99addadf5ee9a98010b0db414310857b44128 Mon Sep 17 00:00:00 2001 From: cage Date: Sun, 2 Jan 2022 16:10:05 +0100 Subject: [PATCH] - prepared code for kamid. --- src/9p-client/conditions.lisp | 32 ------------------- src/9p-client/message-types.lisp | 53 -------------------------------- src/kami/client.lisp | 1 + src/kami/package.lisp | 7 +++++ src/tests/kami-tests.lisp | 20 ++++++++++++ src/tests/package.lisp | 8 +++++ tinmop.asd | 19 ++++++------ 7 files changed, 45 insertions(+), 95 deletions(-) delete mode 100644 src/9p-client/conditions.lisp delete mode 100644 src/9p-client/message-types.lisp create mode 100644 src/kami/client.lisp create mode 100644 src/kami/package.lisp create mode 100644 src/tests/kami-tests.lisp diff --git a/src/9p-client/conditions.lisp b/src/9p-client/conditions.lisp deleted file mode 100644 index 328b77d..0000000 --- a/src/9p-client/conditions.lisp +++ /dev/null @@ -1,32 +0,0 @@ -(in-package :9p-client) - -(define-condition 9p-error (error) - ((error-value - :initarg :error-value - :reader error-value) - (message-type - :initarg :message-type - :reader message-type) - (tag - :initarg :tag - :reader tag)) - (:report (lambda (condition stream) - (format stream - "message-type ~a tag ~a: ~a" - (message-type condition) - (tag condition) - (error-value condition)))) - (:documentation "Error for 9p protocol")) - - -(define-condition 9p-initialization-error (error) - ((tag - :initarg :tag - :reader tag) - (rtag - :initarg :rtag - :reader rtag)) - (:report (lambda (condition stream) - (format stream "error initialization tag sent ~a, got ~a instead" - (tag condition) (rtag condition)))) - (:documentation "Error for 9p protocol")) diff --git a/src/9p-client/message-types.lisp b/src/9p-client/message-types.lisp deleted file mode 100644 index 115b9af..0000000 --- a/src/9p-client/message-types.lisp +++ /dev/null @@ -1,53 +0,0 @@ -(in-package :9p-client) - -(defparameter *tversion* 100) - -(defparameter *rversion* 101) - -(defparameter *tauth* 102) - -(defparameter *rauth* 103) - -(defparameter *tattach* 104) - -(defparameter *rattach* 105) - -(defparameter *terror* 106) ; there is no terror - -(defparameter *rerror* 107) - -(defparameter *tflush* 108) - -(defparameter *rflush* 108) - -(defparameter *twalk* 110) - -(defparameter *rwalk* 109) - -(defparameter *topen* 112) - -(defparameter *ropen* 113) - -(defparameter *tcreate* 114) - -(defparameter *rcreate* 115) - -(defparameter *tread* 116) - -(defparameter *rread* 117) - -(defparameter *twrite* 118) - -(defparameter *rwrite* 119) - -(defparameter *tclunk* 120) - -(defparameter *rclunk* 121) - -(defparameter *tremove* 122) - -(defparameter *rremove* 123) - -(defparameter *tstat* 124) - -(defparameter *rstat* 125) diff --git a/src/kami/client.lisp b/src/kami/client.lisp new file mode 100644 index 0000000..f12c9a6 --- /dev/null +++ b/src/kami/client.lisp @@ -0,0 +1 @@ +(in-package :kami) diff --git a/src/kami/package.lisp b/src/kami/package.lisp new file mode 100644 index 0000000..02883af --- /dev/null +++ b/src/kami/package.lisp @@ -0,0 +1,7 @@ +(defpackage :kami + (:use + :cl + :config + :constants + :purgatory) + (:export)) diff --git a/src/tests/kami-tests.lisp b/src/tests/kami-tests.lisp new file mode 100644 index 0000000..49c6544 --- /dev/null +++ b/src/tests/kami-tests.lisp @@ -0,0 +1,20 @@ +;; tinmop: an humble gemini and pleroma client +;; Copyright (C) 2021 cage + +;; This program is free software: you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; This program is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with this program. +;; If not, see [[http://www.gnu.org/licenses/][http://www.gnu.org/licenses/]]. + +(in-package :kami-tests) + +(defsuite kami-suite (all-suite)) diff --git a/src/tests/package.lisp b/src/tests/package.lisp index 13cc9a0..af70668 100644 --- a/src/tests/package.lisp +++ b/src/tests/package.lisp @@ -118,3 +118,11 @@ :text-utils :all-tests) (:export)) + +(defpackage :kami-tests + (:use :cl + :clunit + :misc + :kami + :all-tests) + (:export)) diff --git a/tinmop.asd b/tinmop.asd index e05df77..7748ee1 100644 --- a/tinmop.asd +++ b/tinmop.asd @@ -31,6 +31,7 @@ :sqlite :sxql :sxql-composer + :purgatory :marshal :bordeaux-threads :cl-base64 @@ -85,17 +86,15 @@ (:file "date-formatter") (:file "software-configuration") (:file "tui-utils") - (:module 9p-client - :components ((:file "package") - (:file "message-types") - (:file "conditions") - (:file "client"))) (:module gemini - :components ((:file "package") - (:file "gemini-constants") - (:file "gemini-parser") - (:file "client") - (:file "subscription"))) + :components ((:file "package") + (:file "gemini-constants") + (:file "gemini-parser") + (:file "client") + (:file "subscription"))) + (:module kami + :components ((:file "package") + (:file "client"))) (:file "command-line") (:file "specials") (:file "keybindings")