Remove unused rgblink function sym_ForEach

This commit is contained in:
Rangi42
2024-02-18 18:46:07 -05:00
parent 5e8c87cf82
commit cd297e1f90
2 changed files with 0 additions and 29 deletions

View File

@@ -29,16 +29,6 @@ struct Symbol {
struct Section *section; struct Section *section;
}; };
/*
* Execute a callback for each symbol currently registered.
* This is done to avoid exposing the data structure in which symbol are stored.
* @param callback The function to call for each symbol;
* the first argument will be a pointer to the symbol,
* the second argument will be the pointer `arg`.
* @param arg A pointer which will be passed to all calls to `callback`.
*/
void sym_ForEach(void (*callback)(struct Symbol *, void *), void *arg);
void sym_AddSymbol(struct Symbol *symbol); void sym_AddSymbol(struct Symbol *symbol);
/* /*

View File

@@ -13,25 +13,6 @@
HashMap symbols; HashMap symbols;
struct ForEachSymbolArg {
void (*callback)(struct Symbol *symbol, void *arg);
void *arg;
};
static void forEach(void *symbol, void *arg)
{
struct ForEachSymbolArg *callbackArg = (struct ForEachSymbolArg *)arg;
callbackArg->callback((struct Symbol *)symbol, callbackArg->arg);
}
void sym_ForEach(void (*callback)(struct Symbol *, void *), void *arg)
{
struct ForEachSymbolArg callbackArg = { .callback = callback, .arg = arg };
hash_ForEach(symbols, forEach, &callbackArg);
}
void sym_AddSymbol(struct Symbol *symbol) void sym_AddSymbol(struct Symbol *symbol)
{ {
// Check if the symbol already exists // Check if the symbol already exists