====== LibHFZ functions ====== ===== High-level functions ===== * [[libhfz:functions:hfzSave]] --- Save a float map as a HF2/HFZ file. * [[libhfz:functions:hfzLoad]] --- Load a float map from a HF2/HFZ file. * [[libhfz:functions:hfzLoadEx]] --- Load a float map from a HF2/HFZ file, and automatically allocates required memory. ===== Medium-level functions ===== * [[libhfz:functions:hfzReadHeader]] --- Read a hfzHeader from a HF2/HFZ file (already open). * [[libhfz:functions:hfzReadHeader2]] --- Read a hfzHeader from a HF2/HFZ file (not already open). * [[libhfz:functions:hfzReadTile]] --- Read a map data tile from a HF2/HFZ file (uses map memory block). * [[libhfz:functions:hfzReadTile2]] --- Read a map data tile from a HF2/HFZ file (uses tile memory block). * [[libhfz:functions:hfzWriteHeader]] --- Write a hfzHeader to a HF2/HFZ file. * [[libhfz:functions:hfzWriteTile]] --- Write a map data tile to a HF2/HFZ file (uses map memory block). * [[libhfz:functions:hfzWriteTile2]] --- Write a map data tile to a HF2/HFZ file (uses tile memory block). ===== Low-level functions (overridables) ===== * [[libhfz:functions:hfzOpen]] --- Open a HF2/HFZ file for reading or writing. * [[libhfz:functions:hfzClose]] --- Close an open HF2/HFZ file. * [[libhfz:functions:hfzRead]] --- Read bytes from an open HF2/HFZ file. * [[libhfz:functions:hfzWrite]] --- Write bytes to an open HF2/HFZ file. * [[libhfz:functions:hfzMalloc]] --- Allocate memory. * [[libhfz:functions:hfzMemcpy]] --- Copy memory. * [[libhfz:functions:hfzFree]] --- Free memory. ===== Helper functions ===== ==== Header manipulation ==== * [[libhfz:functions:hfzHeader_Init]] --- Initialise a hfzHeader struct. * [[libhfz:functions:hfzHeader_Reset]] --- De-allocate memory in hfzHeader struct. * [[libhfz:functions:hfzHeader_EncodeExtHeaderBuf]] --- Convert the extended header block array in a hfzHeader struct into a byte array. * [[libhfz:functions:hfzHeader_DecodeExtHeaderBuf]] --- Convert a byte array into an array of extended header blocks in a hfzHeader struct. ==== Extended header manipulation ==== * [[libhfz:functions:hfzExtHeaderBlock_Init]] --- Initialise a hfzExtHeaderBlock struct. * [[libhfz:functions:hfzExtHeaderBlock_InitEx]] --- Initialise a hfzExtHeaderBlock struct in the extended header array of a hfzHeader struct. * [[libhfz:functions:hfzExtHeaderBlock_Reset]] --- De-allocate memory in hfzExtHeaderBlock struct. ==== Byte order handling ==== * [[libhfz:functions:hfzSetLocalByteOrder]] --- Set the byte order of the local machine. * [[libhfz:functions:hfzByteSwap]] --- Swap the byte ordering of a binary buffer/object. ==== Error processing ==== * [[libhfz:functions:hfzGetErrorStr]] --- Convert a LibHFZ error code to an error description string.