Files
fz-lang/include/compiler/utils/fzl_linked.h
T
samsonium 69b2253c34 feat: enhance compiler
- Add comments and test for it
- Add semicolon as required end of some expressions
- Add new arguments parser
- Add multi-file compilation
- Add colors in output
2026-10-15 17:20:43 +03:00

50 lines
872 B
C

#ifndef FZL_LINKED_H
#define FZL_LINKED_H
#include <stdbool.h>
#include <stddef.h>
// Linked file descriptor
typedef struct
{
char *name;
size_t start;
size_t end;
} fzl_linked_entry_t;
// Linked descriptor
typedef struct
{
fzl_linked_entry_t *entries;
size_t entries_count;
char *source;
size_t total_sz;
} fzl_linked_t;
// Position in file
typedef struct
{
size_t line;
size_t col;
char *filename;
} fzl_file_loc;
// Allocated new linked
fzl_linked_t *fzl_mklinked();
// Read specified files
bool fzl_linked_add_files(fzl_linked_t *l, char **files, size_t files_count);
// Get last error from linked
char *fzl_linked_geterror();
// Get filename and position in it by reader cursor
bool fzl_linked_getpos(fzl_linked_t *l, size_t pos, fzl_file_loc *res);
// Free linked obj
void fzl_freelinked(fzl_linked_t *linked);
#endif // FZL_LINKED_H