X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Floader%2FLoader.h;h=17f637ad22ef07bda40cab79a6f59b3e810c73c2;hb=refs%2Fheads%2Flinker;hp=0a7f845e062d8f9861d22d2debf4ff5aa3471cb2;hpb=45bb35881a10720ae26701ddf075f756419cd627;p=l2e.git diff --git a/src/loader/Loader.h b/src/loader/Loader.h index 0a7f845..17f637a 100644 --- a/src/loader/Loader.h +++ b/src/loader/Loader.h @@ -4,8 +4,10 @@ #include "ObjectFile.h" #include "TypeDescription.h" +#include #include #include +#include #include namespace loader { @@ -21,18 +23,46 @@ public: const std::map &Exports() const { return exports; } + std::ostream &Dump(std::ostream &) const; + private: void LoadExports(char *src, Export *begin, Export *end); void LoadExternals(char *src, External *begin, External *end); + void LoadImages(char *src, Image *begin, Image *end); void LoadObjects(char *src, Object *begin, Object *end); void LoadObject(char *src, char *dest, const TypeDescription &); void LoadArrays(char *src, Array *begin, Array *end); + void LoadScripts(char *src, Script *begin, Script *end); + + void InitObjects(Object *begin, Object *end); + void InitObject(char *object, const TypeDescription &); + void InitArrays(Array *begin, Array *end); + + struct MissingExternal { + std::string identifier; + char *dest; + int typeId; + bool inlined; + }; + void LinkExternal(const MissingExternal &, const LoadedExport &); private: std::map objectFiles; std::map exports; + std::map images; + std::vector unlinked; }; } + + +namespace std { + +inline ostream &operator <<(ostream &o, const loader::Loader &l) { + return l.Dump(o); +} + +} + #endif