From 2cfa0ed6231209037e512fd8d1d6c8acc789768a Mon Sep 17 00:00:00 2001 From: Joshua Suskalo Date: Tue, 18 Jan 2022 13:38:48 -0600 Subject: [PATCH] Add docstrings to layout defs --- src/clj/coffi/mem.clj | 36 +++++++++++++++++++++++++++--------- 1 file changed, 27 insertions(+), 9 deletions(-) diff --git a/src/clj/coffi/mem.clj b/src/clj/coffi/mem.clj index 049d9fe..ecd2369 100644 --- a/src/clj/coffi/mem.clj +++ b/src/clj/coffi/mem.clj @@ -227,23 +227,41 @@ See [[big-endian]], [[little-endian]]." (ByteOrder/nativeOrder)) -(def byte-layout CLinker/C_CHAR) +(def byte-layout + "The [[MemoryLayout]] for a byte in [[native-endian]] [[ByteOrder]]." + CLinker/C_CHAR) -(def short-layout CLinker/C_SHORT) +(def short-layout + "The [[MemoryLayout]] for a c-sized short in [[native-endian]] [[ByteOrder]]." + CLinker/C_SHORT) -(def int-layout CLinker/C_INT) +(def int-layout + "The [[MemoryLayout]] for a c-sized int in [[native-endian]] [[ByteOrder]]." + CLinker/C_INT) -(def long-layout CLinker/C_LONG) +(def long-layout + "The [[MemoryLayout]] for a c-sized long in [[native-endian]] [[ByteOrder]]." + CLinker/C_LONG) -(def long-long-layout CLinker/C_LONG_LONG) +(def long-long-layout + "The [[MemoryLayout]] for a c-sized long-long in [[native-endian]] [[ByteOrder]]." + CLinker/C_LONG_LONG) -(def char-layout CLinker/C_CHAR) +(def char-layout + "The [[MemoryLayout]] for a c-sized char in [[native-endian]] [[ByteOrder]]." + CLinker/C_CHAR) -(def float-layout CLinker/C_FLOAT) +(def float-layout + "The [[MemoryLayout]] for a c-sized float in [[native-endian]] [[ByteOrder]]." + CLinker/C_FLOAT) -(def double-layout CLinker/C_DOUBLE) +(def double-layout + "The [[MemoryLayout]] for a c-sized double in [[native-endian]] [[ByteOrder]]." + CLinker/C_DOUBLE) -(def pointer-layout CLinker/C_POINTER) +(def pointer-layout + "The [[MemoryLayout]] for a native pointer in [[native-endian]] [[ByteOrder]]." + CLinker/C_POINTER) (defn- type-dispatch "Gets a type dispatch value from a (potentially composite) type."