diff --git a/src/clj/coffi/mem.clj b/src/clj/coffi/mem.clj index e647268..a2a20c1 100644 --- a/src/clj/coffi/mem.clj +++ b/src/clj/coffi/mem.clj @@ -21,6 +21,7 @@ (:require [clojure.spec.alpha :as s]) (:import + (java.nio ByteOrder) (jdk.incubator.foreign Addressable CLinker @@ -205,6 +206,24 @@ (map #(slice segment (* % size) size) (range num-segments)))) +(def big-endian + "The big-endian [[ByteOrder]]. + + See [[little-endian]], [[native-endian]]." + ByteOrder/BIG_ENDIAN) + +(def little-endian + "The little-endian [[ByteOrder]]. + + See [[big-endian]], [[native-endian]]" + ByteOrder/LITTLE_ENDIAN) + +(def native-endian + "The [[ByteOrder]] for the native endianness of the current hardware. + + See [[big-endian]], [[little-endian]]." + (ByteOrder/nativeOrder)) + (defn- type-dispatch "Gets a type dispatch value from a (potentially composite) type." [type]