mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 10:12:06 +00:00
C++ acts like structs are `typedef`ed by default We do have to keep `struct stat`, since there's ambiguity with the function also called `stat`.
44 lines
917 B
C++
44 lines
917 B
C++
/* SPDX-License-Identifier: MIT */
|
|
|
|
// Declarations manipulating symbols
|
|
#ifndef RGBDS_LINK_SYMBOL_H
|
|
#define RGBDS_LINK_SYMBOL_H
|
|
|
|
// GUIDELINE: external code MUST NOT BE AWARE of the data structure used!
|
|
|
|
#include <stdint.h>
|
|
#include <string>
|
|
|
|
#include "linkdefs.hpp"
|
|
|
|
struct FileStackNode;
|
|
struct Section;
|
|
|
|
struct Symbol {
|
|
// Info contained in the object files
|
|
std::string name;
|
|
enum ExportLevel type;
|
|
char const *objFileName;
|
|
FileStackNode const *src;
|
|
int32_t lineNo;
|
|
int32_t sectionID;
|
|
union {
|
|
// Both types must be identical
|
|
int32_t offset;
|
|
int32_t value;
|
|
};
|
|
// Extra info computed during linking
|
|
Section *section;
|
|
};
|
|
|
|
void sym_AddSymbol(Symbol *symbol);
|
|
|
|
/*
|
|
* Finds a symbol in all the defined symbols.
|
|
* @param name The name of the symbol to look for
|
|
* @return A pointer to the symbol, or NULL if not found.
|
|
*/
|
|
Symbol *sym_GetSymbol(std::string const &name);
|
|
|
|
#endif // RGBDS_LINK_SYMBOL_H
|