|
libreis
0.1.0
A simple header-based drop-in library
|
New functions related to file handling and writing to stdout. More...
#include <reis/io.h>#include <reis/string.h>#include <errno.h>#include <stdarg.h>Functions | |
| char | fpeek (FILE *stream) |
| View the next character in stream, doesn't move pointer. More... | |
| wchar_t | fpeek_wc (FILE *stream) |
Same as fpeek but for wchar_t. More... | |
| char | fspeek (FILE *stream, long int offset, int position) |
| View a character at position without moving pointer; Peeks a seek. More... | |
| int | frpeek (FILE *stream, char c) |
| A recursive peek that goes to end of line or EOF to get # of occurences. More... | |
| int | frdpeek (FILE *stream, char d) |
A recursive peek that goes till the delimter d. More... | |
| int | fcounts (FILE *stream) |
| Character count of current line of buffer. More... | |
| void | fcopy (FILE *dest, FILE *src) |
Copies data from src file to dest file. More... | |
| const char * | ExtractFileExtension (const char *filename) |
| Returns file extension. More... | |
| const char * | ExtractFileName (const char *path) |
| Returns filename. More... | |
| bool | fmove (char *oldpath, char *newpath) |
Move data from oldpath file to newpath. More... | |
| bool | fexists (const char *file) |
| Checks if file exists. More... | |
| bool | dexists (const char *path) |
| Checks if directory exists. More... | |
| void | sgets (char *str, int n) |
| A safe way to read input that ensures no misc LF or breaks in read string. More... | |
| bool | PromptYesOrNo (const char *question) |
| Prompts the user with a yes or no question. More... | |
| CHECK_PRINTF_FMT (1, 2) | |
| Makes writing error to stderr slightly simpler. More... | |
| void | eprintf (const char *fmt,...) |
| CHECK_PRINTF_FMT (1, 3) | |
| Easy color printing. More... | |
| void | cprintf (const char *color, const char *fmt,...) |
| Filesystem * | rsNewFilesystem (char *path) |
| Create a Filesystem object. More... | |
| void | rsFreeFilesystem (Filesystem *fs) |
| Terminates a Filesystem object. More... | |
New functions related to file handling and writing to stdout.
| CHECK_PRINTF_FMT | ( | 1 | , |
| 2 | |||
| ) |
Makes writing error to stderr slightly simpler.
| CHECK_PRINTF_FMT | ( | 1 | , |
| 3 | |||
| ) |
Easy color printing.
| color | A provided macro for VT100 escapes, or your own. |
| fmt | A format string. |
| ... | Completions for the format. |
| bool dexists | ( | const char * | path | ) |
Checks if directory exists.
| const char* ExtractFileExtension | ( | const char * | filename | ) |
Returns file extension.
| const char* ExtractFileName | ( | const char * | path | ) |
Returns filename.
| void fcopy | ( | FILE * | dest, |
| FILE * | src | ||
| ) |
Copies data from src file to dest file.
| int fcounts | ( | FILE * | stream | ) |
Character count of current line of buffer.
| bool fexists | ( | const char * | file | ) |
Checks if file exists.
| bool fmove | ( | char * | oldpath, |
| char * | newpath | ||
| ) |
Move data from oldpath file to newpath.
| char fpeek | ( | FILE * | stream | ) |
View the next character in stream, doesn't move pointer.
| wchar_t fpeek_wc | ( | FILE * | stream | ) |
Same as fpeek but for wchar_t.
| int frdpeek | ( | FILE * | stream, |
| char | d | ||
| ) |
A recursive peek that goes till the delimter d.
| int frpeek | ( | FILE * | stream, |
| char | c | ||
| ) |
A recursive peek that goes to end of line or EOF to get # of occurences.
| char fspeek | ( | FILE * | stream, |
| long int | offset, | ||
| int | position | ||
| ) |
View a character at position without moving pointer; Peeks a seek.
| bool PromptYesOrNo | ( | const char * | question | ) |
Prompts the user with a yes or no question.
| void rsFreeFilesystem | ( | Filesystem * | fs | ) |
Terminates a Filesystem object.
| Filesystem* rsNewFilesystem | ( | char * | path | ) |
Create a Filesystem object.
| void sgets | ( | char * | str, |
| int | n | ||
| ) |
A safe way to read input that ensures no misc LF or breaks in read string.
| [str] | A buffer. |
| [n] | The buffer's length. |