]> git.localhorst.tv Git - l2e.git/blobdiff - src/loader/ObjectFile.h
relocate scripts
[l2e.git] / src / loader / ObjectFile.h
index 56319a4dd444050681fb0aef7a8886893e91c3d6..2bdcb125c63aa5ec2c3a57b5c79fc8126776e669 100644 (file)
@@ -54,6 +54,13 @@ struct Array {
        Array *Next();
 };
 
+struct Script {
+       unsigned int size;
+
+       char *Text();
+       Script *Next();
+};
+
 struct ObjectFileHeader {
        /// Has to be "L2E\n"
        char ident[4];
@@ -109,6 +116,13 @@ struct ObjectFileHeader {
        unsigned int arraysBegin;
        unsigned int arraysEnd;
 
+       /// File-relative offsets of the script section's begin
+       /// and end respectively.
+       /// Each script is an unsigned int with the length in
+       /// bytes followed by the script text.
+       unsigned int scriptsBegin;
+       unsigned int scriptsEnd;
+
        ObjectFileHeader();
 
        /// Check if there are any problems with the file header.
@@ -124,6 +138,8 @@ struct ObjectFileHeader {
        Object *ObjectsEnd();
        Array *ArraysBegin();
        Array *ArraysEnd();
+       Script *ScriptsBegin();
+       Script *ScriptsEnd();
 
 private:
        bool CheckSection(