From: Utz-Uwe Haus Date: Fri, 28 May 2010 15:46:38 +0000 (+0200) Subject: Move package definitions from .i file to separate lisp file X-Git-Url: https://repo.or.cz/w/cl-cudd.git/commitdiff_plain/60ae0aaf9a8d5e95f445a5e2e82adb498e151086 Move package definitions from .i file to separate lisp file Signed-off-by: Utz-Uwe Haus --- diff --git a/cudd-cffi.i b/cudd-cffi.i index 728e9f4..4672315 100644 --- a/cudd-cffi.i +++ b/cudd-cffi.i @@ -13,10 +13,7 @@ (eval-when (:compile-toplevel :load-toplevel) (declaim (optimize (speed 3) (debug 0) (safety 1)))) -(cl:defpackage :swig-macros - (:use :cl :cffi) - (:documentation "Package containing utility functions for SWIG cffi interface generation") - (:export #:swig-lispify #:defanonenum)) + (cl:in-package :swig-macros) @@ -66,11 +63,7 @@ %insert ("swiglisp") %{ -(cl:defpackage #:cuddapi - (:use :cl :cffi :swig-macros) - (:export #:cudd-manager #:cudd-node) - ;; other exports done by swig - ) + (cl:in-package :cuddapi) %} %insert ("swiglisp") %{ @@ -175,22 +168,7 @@ TYPEMAP_WRAPPED_POINTER(DdNode *, cudd-node) %insert ("swiglisp") %{ -;;; Higher-level interface similar to de.uuhaus.bdd -(defpackage #:cudd - (:use #:cuddapi #:cl) - (:export #:bdd-environment) - (:export #:with-bdd-environment #:make-bdd-environment) - ; (:export #:make-bdd) - (:export #:bdd-true #:bdd-false) - (:export #:bdd-new-variable) - (:export #:bdd-and #:bdd-or #:bdd-not #:bdd-xor #:bdd-nand #:bdd-nor - #:bdd-and-not #:bdd-or-not #:bdd-implies - #:bdd-iff #:bdd-restrict) - (:export #:bdd-exists #:bdd-forall) - (:export #:bdd-tautologyp #:bdd-satisfiablep) - (:export #:bdd-var-min #:bdd-var-max) - (:export #:bdd-var-fixed0 #:bdd-var-fixed0) - (:export #:deserialize-bdd)) + (cl:in-package :cudd) diff --git a/cudd.asd b/cudd.asd index 84c16cd..979bd2d 100644 --- a/cudd.asd +++ b/cudd.asd @@ -58,7 +58,8 @@ :pathname "./cudd/libcudd.so"))) ;; (:file "package") - (:file "cuddapi" :depends-on ("foreignlib")) - (:file "cuddsat" :depends-on ("cuddapi")) + (:file "package") + (:file "cuddapi" :depends-on ("foreignlib" "package")) + (:file "cuddsat" :depends-on ("cuddapi" "package")) )) diff --git a/package.lisp b/package.lisp new file mode 100644 index 0000000..dd9b349 --- /dev/null +++ b/package.lisp @@ -0,0 +1,61 @@ +;;; -*- Mode: Lisp; Syntax: ANSI-Common-Lisp; Base: 10; -*- +;;; +;;; package.lisp --- CUDD wrapper package definitions + +;; Copyright (C) 2010 Utz-Uwe Haus +;; +;; $Id:$ +;; +;; This code is free software; you can redistribute it and/or modify +;; it under the terms of the version 3 of the GNU General +;; Public License as published by the Free Software Foundation, as +;; clarified by the prequel found in LICENSE.Lisp-GPL-Preface. +;; +;; This code 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 +;; Lesser General Public License for more details. +;; +;; Version 3 of the GNU General Public License is in the file +;; LICENSE.GPL that was distributed with this file. If it is not +;; present, you can access it from +;; http://www.gnu.org/copyleft/gpl.txt (until superseded by a +;; newer version) or write to the Free Software Foundation, Inc., 59 +;; Temple Place, Suite 330, Boston, MA 02111-1307 USA +;; +;; Commentary: + +;; + +;;; Code: + +;;; Hiding swig: +(cl:defpackage :swig-macros + (:use :cl :cffi) + (:documentation + "Package containing utility functions for SWIG cffi interface generation") + (:export #:swig-lispify #:defanonenum)) + +;;; Low-level implementation: +(defpackage #:cuddapi + (:use :cl :cffi :swig-macros) + (:export #:cudd-manager #:cudd-node) + ;; other exports done by swig + ) + +;;; Higher-level interface similar to de.uuhaus.bdd +(defpackage #:cudd + (:use #:cuddapi #:cl) + (:export #:bdd-environment) + (:export #:with-bdd-environment #:make-bdd-environment) + ; (:export #:make-bdd) + (:export #:bdd-true #:bdd-false) + (:export #:bdd-new-variable) + (:export #:bdd-and #:bdd-or #:bdd-not #:bdd-xor #:bdd-nand #:bdd-nor + #:bdd-and-not #:bdd-or-not #:bdd-implies + #:bdd-iff #:bdd-restrict) + (:export #:bdd-exists #:bdd-forall) + (:export #:bdd-tautologyp #:bdd-satisfiablep) + (:export #:bdd-var-min #:bdd-var-max) + (:export #:bdd-var-fixed0 #:bdd-var-fixed0) + (:export #:deserialize-bdd)) \ No newline at end of file