diff options
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/README.md b/README.md new file mode 100644 index 0000000..bdb186e --- /dev/null +++ b/README.md @@ -0,0 +1,31 @@ +# legato-util + +Small collection of helper functions required by some of our open source code + +## API + +### File I/O + +Functions to handle boilerplate when reading and writing from files. + +```C +le_result_t readFromFile (const char *path, void *value, + int (*scanCallback) (FILE *f, void *val)); +int scanIntCallback (FILE *f, void *value); +int scanDoubleCallback (FILE *f, void *value); +le_result_t ioutil_readIntFromFile (const char *path, int *value); +le_result_t ioutil_readDoubleFromFile (const char *filePath, double *value); +le_result_t ioutil_writeToFile (const char *path, void *value, size_t size, size_t count); +``` + +### Time +```C +int util_getUnixDatetime (); +time_t util_getMTime (char *path); +uint64_t GetCurrentTimestamp (void); +``` + +### Other +```C +le_result_t util_flattenRes (le_result_t *res, int nRes); +```
\ No newline at end of file |