#define _BINARY_H
// === TYPES ===
+typedef struct sBinaryPage
+{
+ /**
+ * \brief Physical address, or file offset
+ *
+ * Physical address of this page or, when the file is not yet
+ * loaded, this is a file offset (or -1 for uninitialised data)
+ */
+ tPAddr Physical;
+ tVAddr Virtual; //!< Virtual load address
+ Uint16 Size; //!< Number of bytes to load from the file
+ Uint16 Flags; //!< Load Flags
+} __attribute__ ((packed)) tBinaryPage;
+
+/**
+ * \brief Flags for ::tBinaryPage.Flags
+ * \name Binary Page Flags
+ * \{
+ */
+//! \brief Read-only
+#define BIN_PAGEFLAG_RO 0x0001
+//! \brief Executable
+#define BIN_PAGEFLAG_EXEC 0x0002
+/**
+ * \}
+ */
+
/**
* \brief Defines a binary file
*
* \brief Array of pages defined by this binary
* \note Contains \a NumPages entries
*/
- struct {
- /**
- * \brief Physical address, or file offset
- *
- * Physical address of this page or, when the file is not yet
- * loaded, this is a file offset (or -1 for uninitialised data)
- */
- tPAddr Physical;
- tVAddr Virtual; //!< Virtual load address
- Uint16 Size; //!< Number of bytes to load from the file
- Uint16 Flags; //!< Load Flags
- } Pages[];
+ tBinaryPage Pages[];
} tBinary;
/**
*/
extern char *Binary_RegInterp(char *Path);
+extern int Binary_RegisterType(tBinaryType *Type);
+
#endif