Files

30 lines
849 B
C
Raw Permalink Normal View History

2017-09-23 10:18:46 -07:00
#pragma once
2017-11-12 15:48:57 -08:00
#include "pkg2zip_utils.h"
// correctly outputs utf8 string
void sys_output_init(void);
2017-11-17 20:55:38 -08:00
void sys_output_done(void);
2017-11-12 15:48:57 -08:00
void sys_output(const char* msg, ...);
void NORETURN sys_error(const char* msg, ...);
2017-09-23 10:18:46 -07:00
2017-11-16 21:29:54 -08:00
void sys_output_progress_init(uint64_t size);
void sys_output_progress(uint64_t progress);
2017-09-23 10:18:46 -07:00
typedef void* sys_file;
void sys_mkdir(const char* path);
2017-09-23 10:18:46 -07:00
sys_file sys_open(const char* fname, uint64_t* size);
sys_file sys_create(const char* fname);
void sys_close(sys_file file);
void sys_read(sys_file file, uint64_t offset, void* buffer, uint32_t size);
void sys_write(sys_file file, uint64_t offset, const void* buffer, uint32_t size);
// if !ptr && size => malloc
// if ptr && !size => free
// if ptr && size => realloc
void* sys_realloc(void* ptr, size_t size);
2017-11-09 22:29:22 -08:00
void sys_vstrncat(char* dst, size_t n, const char* format, ...);