feat: implement file writer

This commit is contained in:
samsonium
2026-10-10 03:56:00 +03:00
parent e979a22739
commit 96115b347e
4 changed files with 138 additions and 1 deletions
+25
View File
@@ -0,0 +1,25 @@
#ifndef FZL_WRITER_H
#define FZL_WRITER_H
#include <compiler/fzl_walker.h>
#include <compiler/utils/fzl_const_pool.h>
// File writer descriptor
typedef struct
{
const char *filepath;
} fzl_writer_t;
// Allocate writer
fzl_writer_t *fzl_mkwriter(const char *filepath);
// Write out a file
int fzl_write(fzl_writer_t *writer, fzl_walker_t *walker);
// Get last writer error message
char *fzl_writer_geterror();
// Free writer
void fzl_freewriter(fzl_writer_t *writer);
#endif // FZL_WRITER_H