Commit fef3f7a9 authored by Marco Antoniotti's avatar Marco Antoniotti

Initial check-in.

parent d33c04c4
*fasl
*~
;;;; -*- Mode: Lisp -*-
;;;; clad-package.lisp --
;;;; See file COPYING for licensing information.
(defpackage "IT.UNIMIB.DISCO.MA.CLAD" (:use "CL")
(:nicknames "CLAD")
(:export
"USER-COMMON-LISP-DATA-DIRECTORY"
"USER-CL-DATA-FOLDER"
"APP-OR-LIBRARY-DATA-FOLDER"
"ENSURE-APP-OR-LIBRARY-DATA-FOLDER"
))
;;;; end of file -- clad-package.lisp
;;;; -*- Mode: Lisp -*-
;;;; clad.asd --
;;;; See file COPYING for licensing information.
(asdf:defsystem #:clad
:components ((:file "clad-package")
(:file "clad" :depends-on ("clad-package"))
)
)
;;;; end of file -- clad.asd
;;;; -*- Mode: Lisp -*-
;;;; clad.lisp --
;;;; See file COPYING for licensing information.
(in-package "CLAD")
(defun user-common-lisp-data-directory ()
(let ((uadd-pathname
(merge-pathnames (system-dependent-cl-subfolder-name)
(user-homedir-pathname)))
)
(declare (type pathname uadd-pathname))
(values uadd-pathname
(and (probe-file uadd-pathname) t))
))
(defun user-cl-data-folder ()
(user-common-lisp-data-directory))
(defun app-or-library-data-folder (app-or-library-name
&key
version-name
impl-dependent-too
&aux
(addl (list :relative app-or-library-name))
)
(declare (type string app-or-library-name)
(type (or null string)
version-name
impl-dependent-too)
(ignore version-name) ; Too much for the time being.
(type list addl))
#|
(when version-name
(setf addl (nconc addl (list version-name))))
|#
(when (string= "" app-or-library-name)
(warn "CLAD: empty app or library name; top user folder will be returned.")
(return-from app-or-library-data-folder
(values (user-common-lisp-data-directory) t)))
(when impl-dependent-too
(setf addl (nconc addl (list (lisp-implementation-type)))))
(let ((a-or-l-dd-pathname
(merge-pathnames (make-pathname :directory addl)
(user-common-lisp-data-directory))))
(values a-or-l-dd-pathname
(and (probe-file a-or-l-dd-pathname) t))))
(defun ensure-app-or-library-data-folder (app-or-library-name
&key
version-name
impl-dependent-too
)
(declare (type string
app-or-library-name
version-name
impl-dependent-too))
(let ((addp
(app-or-library-data-folder app-or-library-name
:version-name version-name
:impl-dependent-too impl-dependent-too))
)
(declare (type pathname addp))
(ensure-directories-exist addp)
))
;;;; These will go in the 'impl-dependent' folder.
#-sbcl
(defconstant +cl-subfolder-name+
#+(or macosx darwin) "Library/Common Lisp/"
#+mswindows "AppData/Roaming/Common Lisp/"
#+(and (or linux unix) (not (or macosx darwin))) ".Common-Lisp/"
)
;;; Fascist SBCL.
#+sbcl
(defvar +cl-subfolder-name+
#+(or macosx darwin) "Library/Common Lisp/"
#+mswindows "AppData/Roaming/Common Lisp/"
#+(and (or linux unix) (not (or macosx darwin))) ".Common-Lisp/"
)
(defun system-dependent-cl-subfolder-name ()
(pathname +cl-subfolder-name+))
;;;; end of file -- clad.lisp
;;;; -*- Mode: Lisp -*-
;;;; clad.system --
;;;; See file COPYING for licensing information.
(mk:defsystem "CLAD"
:components ((:file "clad-package")
(:file "clad" :depends-on ("clad-package"))
)
)
;;;; end of file -- clad.system
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment