summaryrefslogtreecommitdiff
path: root/ebus-racket/3rdparty/bzlib/base/version.ss
diff options
context:
space:
mode:
authorYves Fischer <yvesf-git@xapek.org>2016-08-14 19:25:26 +0200
committerYves Fischer <yvesf-git@xapek.org>2016-08-14 19:25:26 +0200
commitcaae83f445935c06cd6aef36f283a4688675278a (patch)
tree5e63cbfd2877195430a8657dcd75f42b6a4d7110 /ebus-racket/3rdparty/bzlib/base/version.ss
downloadebus-caae83f445935c06cd6aef36f283a4688675278a.tar.gz
ebus-caae83f445935c06cd6aef36f283a4688675278a.zip
refactored ebus code
Diffstat (limited to 'ebus-racket/3rdparty/bzlib/base/version.ss')
-rw-r--r--ebus-racket/3rdparty/bzlib/base/version.ss71
1 files changed, 71 insertions, 0 deletions
diff --git a/ebus-racket/3rdparty/bzlib/base/version.ss b/ebus-racket/3rdparty/bzlib/base/version.ss
new file mode 100644
index 0000000..0932012
--- /dev/null
+++ b/ebus-racket/3rdparty/bzlib/base/version.ss
@@ -0,0 +1,71 @@
+#lang scheme/base
+;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; BASE.plt - common routines that are shared by all other bzlib modules
+;;
+;; in a way, base.plt is the most fundamental module of the whole bzlib stack
+;; and as such it also is the lowest level code. We are not likely to
+;; fix the code any time soon, and hence any of the functions here are
+;; explicitly likely to be obsoleted or moved elsewhere.
+;;
+;; Proceed with caution.
+;;
+;;
+;; Bonzai Lab, LLC. All rights reserved.
+;;
+;; Licensed under LGPL.
+;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; version.ss - version comparison utilities as well as version-based macros
+;; yc 1/18/2010 - first version
+(require (prefix-in v: version/utils)
+ scheme/contract
+ (for-syntax scheme/base
+ (prefix-in v: version/utils))
+ mzlib/trace
+ )
+
+(define (version? v)
+ (and (string? v)
+ (integer? (v:version->integer v))))
+
+(define (vcomp? comp? v v2 vs)
+ (apply comp? (map v:version->integer (list* v v2 vs))))
+
+(define (version<? v v2 . vs)
+ (vcomp? < v v2 vs))
+;; (trace version<?)
+
+(define (version<=? v v2 . vs)
+ (vcomp? <= v v2 vs))
+;; (trace version<=?)
+
+(define (version>=? v v2 . vs)
+ (vcomp? >= v v2 vs))
+;; (trace version>=?)
+
+(define (version>? v v2 . vs)
+ (vcomp? > v v2 vs))
+;; (trace version>?)
+
+(define (version=? v v2 . vs)
+ (vcomp? = v v2 vs))
+;; (trace version=?)
+
+(define (version!=? v v2 . vs)
+ (vcomp? (compose not =) v v2 vs))
+;; (trace version!=?)
+
+(define vcomp/c (->* (version? version?)
+ ()
+ #:rest (listof version?)
+ boolean?))
+
+(provide/contract
+ (version? (-> any/c boolean?))
+ (version<? vcomp/c)
+ (version<=? vcomp/c)
+ (version>=? vcomp/c)
+ (version>? vcomp/c)
+ (version=? vcomp/c)
+ (version!=? vcomp/c)
+ )
+