#ifndef UTIL_H
#define UTIL_H


#include "os.h"


#define SCRATCH_SIZE  4096


extern char __scratch[SCRATCH_SIZE];


char     *utilAppNameWithNewExtensionGet(char *appName, char *extension);
void      utilBitsPrint(uint8_t byte);
char     *utilCreateString(char *format, ...);
char     *utilCreateStringVArgs(char *format, va_list args);
void      utilDie(const char *why, ...);
uint8_t   utilFileExists(char *filename);
uint8_t   utilFromFileReadByte(FILE *f,  uint8_t *result);
uint8_t   utilFromFileReadString(FILE *f, char **result);
void      utilStringToLower(char *string);
char    **utilWrapText(char *text, uint16_t width);


#endif // UTIL_H
