mmapstorage: document MmapAddr structure
#define SIZEOF_MMAPHEADER (sizeof (MmapHeader))
#define SIZEOF_MMAPMETADATA (sizeof (MmapMetaData))
#define SIZEOF_MMAPFOOTER (sizeof (MmapFooter))
-#define SIZEOF_ADDR_STRING (19) // format: 0xADDR -> ADDR in hex, for 64bit addr: 2 bytes (0x) + 16 bytes (ADDR) + 1 byte (ending null)
+/** Size to store a 64-bit (max.) address.
+ * format: 0xADDR -> ADDR in hex, for 64bit addr: 2 bytes (0x) + 16 bytes (ADDR) + 1 byte (ending null)
+ */
+#define SIZEOF_ADDR_STRING (19)
+
+/** Flag for mmap file format. Defines whether file was written with checksum on or off. */
#define ELEKTRA_MMAP_CHECKSUM_ON (1)
+/**
+ * Internal MmapAddr structure.
+ * Used for functions passing around relevant pointers into the mmap region.
+ * The write functions increment the pointers by the number of bytes written,
+ * such that the next iteration or function writes to the correct (free) place.
+ */
struct _mmapAddr
{
- KeySet * const ksPtr;
- char * metaKsPtr;
- char * ksArrayPtr;
- char * metaKsArrayPtr;
- char * keyPtr;
- char * dataPtr;
+ KeySet * const ksPtr; /**<Pointer to the (main) KeySet struct. */
+ char * metaKsPtr; /**<Pointer to the current meta KeySet structs. */
+ char * ksArrayPtr; /**<Pointer to the current KeySet->array. */
+ char * metaKsArrayPtr; /**<Pointer to the current meta KeySet->array. */
+ char * keyPtr; /**<Pointer to the current Key struct. */
+ char * dataPtr; /**<Pointer to the data region, where Key->key and Key->data is stored. */
- const uintptr_t mmapAddrInt;
+ const uintptr_t mmapAddrInt; /**<Address of the mapped region as integer. */
};
typedef struct _mmapAddr MmapAddr;
