roo_e/shared/util.h
2022-06-28 16:00:42 -05:00

51 lines
1.4 KiB
C

/*
* Roo/E, the Kangaroo Punch Portable GUI Toolkit
* Copyright (C) 2022 Scott Duensing
*
* http://kangaroopunch.com
*
*
* This file is part of Roo/E.
*
* Roo/E is free software: you can redistribute it and/or modify it under the
* terms of the GNU Affero General Public License as published by the Free
* Software Foundation, either version 3 of the License, or (at your option)
* any later version.
*
* Roo/E is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License
* along with Roo/E. If not, see <https://www.gnu.org/licenses/>.
*
*/
#ifndef UTIL_H
#define UTIL_H
#include "os.h"
#define SCRATCH_SIZE 4096
extern char __scratch[SCRATCH_SIZE];
char *utilFileExtensionChange(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