11/*
22 * CallstackLibrary - Library creating human-readable call stacks.
33 *
4- * Copyright (C) 2024 mhahnFr
4+ * Copyright (C) 2024 - 2025 mhahnFr
55 *
66 * This file is part of the CallstackLibrary.
77 *
2222#ifndef macho_parser_h
2323#define macho_parser_h
2424
25+ #include <stdarg.h>
2526#include <stdbool.h>
26-
2727#include <mach-o/loader.h>
2828
2929#include "objectFile.h"
3030#include "optional_pair_funcFile.h"
3131
32- #include "../function.h"
33-
3432/**
3533 * @brief The function prototype for the callback called with a new object file object.
3634 *
@@ -47,23 +45,27 @@ typedef void (*macho_addFunction)(pair_funcFile_t, va_list);
4745/**
4846 * @brief Parses the given Mach-O symbol table.
4947 *
50- * At least one callback function needs to be provided (the other one
51- * may be `NULL`) or both. If none ise passed, the given symbol table
52- * is not parsed and `false` is returned.
53- *
54- * The object file callback is called when all information associated
55- * with an object file is read.
56- * The function / object file callback is called for every symbol that
57- * is not external.
58- * Both functions are passed the additional arguments passed to this function.
48+ * At least one callback function needs to be provided (the other one may be
49+ * @c NULL) or both. If none is given, the given symbol table is not parsed and
50+ * @c false is returned.
51+ * <br><br>
52+ * The object file callback will be called when all information associated with
53+ * an object file is read.<br>
54+ * The function / object file callback is called for every symbol that is not
55+ * external.<br>
56+ * Both functions will be passed the additional arguments passed to this
57+ * function.
5958 *
6059 * @param command the Mach-O symbol table load command
61- * @param baseAddress the start address of the Mach-O file the given symbol table is in
60+ * @param baseAddress the start address of the Mach-O file the given symbol
61+ * table is in
6262 * @param offset the additional parsing offset
63- * @param bytesSwapped whether the bytes need to be swapped to be in host byte order
63+ * @param bytesSwapped whether the bytes need to be swapped to be in host byte
64+ * order
6465 * @param bit64 whether a 64 bit Mach-O file is parsed
6566 * @param objCb the object file callback function
6667 * @param funCb the function / object file pair callback function
68+ * @param ... the additional parameters to pass to the given functions
6769 * @return whether the symbol table was parsed successfully
6870 */
6971bool macho_parseSymtab (struct symtab_command * command ,
0 commit comments