Last bit of string cleanup. string.h finally gone.
This commit is contained in:
@@ -12,36 +12,34 @@
|
||||
|
||||
#include <xenia/core.h>
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
|
||||
typedef struct xe_ppc_state xe_ppc_state_t;
|
||||
|
||||
|
||||
namespace xe {
|
||||
|
||||
|
||||
typedef void (*xe_kernel_export_shim_fn)(xe_ppc_state_t*, void*);
|
||||
|
||||
class KernelExport {
|
||||
public:
|
||||
public:
|
||||
enum ExportType {
|
||||
Function = 0,
|
||||
Variable = 1,
|
||||
};
|
||||
|
||||
uint32_t ordinal;
|
||||
ExportType type;
|
||||
uint32_t flags;
|
||||
char name[96];
|
||||
uint32_t ordinal;
|
||||
ExportType type;
|
||||
uint32_t flags;
|
||||
char name[96];
|
||||
|
||||
bool is_implemented;
|
||||
bool is_implemented;
|
||||
|
||||
union {
|
||||
// Variable data. Only valid when kXEKernelExportFlagVariable is set.
|
||||
// This is an address in the client memory space that the variable can
|
||||
// be found at.
|
||||
uint32_t variable_ptr;
|
||||
uint32_t variable_ptr;
|
||||
|
||||
struct {
|
||||
// Second argument passed to the shim function.
|
||||
@@ -55,41 +53,40 @@ public:
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
class ExportResolver {
|
||||
public:
|
||||
public:
|
||||
ExportResolver();
|
||||
~ExportResolver();
|
||||
|
||||
void RegisterTable(const char* library_name, KernelExport* exports,
|
||||
void RegisterTable(const std::string& library_name, KernelExport* exports,
|
||||
const size_t count);
|
||||
|
||||
uint16_t GetLibraryOrdinal(const char* library_name);
|
||||
uint16_t GetLibraryOrdinal(const std::string& library_name);
|
||||
|
||||
KernelExport* GetExportByOrdinal(const uint16_t library_ordinal,
|
||||
const uint32_t ordinal);
|
||||
KernelExport* GetExportByOrdinal(const char* library_name,
|
||||
KernelExport* GetExportByOrdinal(const std::string& library_name,
|
||||
const uint32_t ordinal);
|
||||
KernelExport* GetExportByName(const char* library_name, const char* name);
|
||||
KernelExport* GetExportByName(const std::string& library_name,
|
||||
const std::string& name);
|
||||
|
||||
void SetVariableMapping(const char* library_name, const uint32_t ordinal,
|
||||
uint32_t value);
|
||||
void SetFunctionMapping(const char* library_name, const uint32_t ordinal,
|
||||
void* shim_data, xe_kernel_export_shim_fn shim);
|
||||
void SetVariableMapping(const std::string& library_name,
|
||||
const uint32_t ordinal, uint32_t value);
|
||||
void SetFunctionMapping(const std::string& library_name,
|
||||
const uint32_t ordinal, void* shim_data,
|
||||
xe_kernel_export_shim_fn shim);
|
||||
|
||||
private:
|
||||
class ExportTable {
|
||||
public:
|
||||
char name[32];
|
||||
private:
|
||||
struct ExportTable {
|
||||
std::string name;
|
||||
KernelExport* exports;
|
||||
size_t count;
|
||||
size_t count;
|
||||
ExportTable(const std::string& name, KernelExport* exports, size_t count)
|
||||
: name(name), exports(exports), count(count) {}
|
||||
};
|
||||
|
||||
std::vector<ExportTable> tables_;
|
||||
};
|
||||
|
||||
|
||||
} // namespace xe
|
||||
|
||||
|
||||
#endif // XENIA_EXPORT_RESOLVER_H_
|
||||
|
||||
Reference in New Issue
Block a user