Simplify fstk_FindFile usage (#1310)

* Simplify `fstk_FindFile` usage

* Use `std::string` for `fstk_FindFile`
This commit is contained in:
Sylvie
2024-02-22 07:14:38 -05:00
committed by GitHub
parent c70cecc24a
commit 6d29d2a67e
3 changed files with 33 additions and 69 deletions

View File

@@ -8,6 +8,7 @@
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <string>
#include "asm/lexer.hpp"
@@ -52,12 +53,9 @@ void fstk_AddIncludePath(char const *s);
void fstk_SetPreIncludeFile(char const *s);
/*
* @param path The user-provided file name
* @param fullPath The address of a pointer, which will be made to point at the full path
* The pointer's value must be a valid argument to `realloc`, including NULL
* @param size Current size of the buffer, or 0 if the pointer is NULL
* @return True if the file was found, false if no path worked
* @return A pointer to the `new`-allocated full path, or NULL if no path worked
*/
bool fstk_FindFile(char const *path, char **fullPath, size_t *size);
std::string *fstk_FindFile(char const *path);
bool yywrap(void);
void fstk_RunInclude(char const *path);