diff options
Diffstat (limited to 'src/libsystem/libsystem.h')
-rw-r--r-- | src/libsystem/libsystem.h | 276 |
1 files changed, 276 insertions, 0 deletions
diff --git a/src/libsystem/libsystem.h b/src/libsystem/libsystem.h index acd50dc..4452179 100644 --- a/src/libsystem/libsystem.h +++ b/src/libsystem/libsystem.h @@ -480,6 +480,162 @@ int write_uint64_to_file(FILE *f, uint64_t u, enum file_write_flags flags); int write_uint64_to_path(const char *path, uint64_t u, enum file_write_flags flags); /** + * @brief Write int to FILE. + * + * @param f File pointer + * @param num int to write. + * @param flags Optional flags to write file. if + * ::FILE_WRITE_NEWLINE_IF_NOT is set, line-end added. For detail, see + * ::file_write_flags. + * + * @return 0 on success, -errno on failure. + */ +int write_int_to_file(FILE *f, int num, enum file_write_flags flags); + +/** + * @brief Write int to path. + * + * @param path File path. + * @param num int to write. + * @param flags Optional flags to write file. if + * ::FILE_WRITE_NEWLINE_IF_NOT is set, line-end added. For detail, see + * ::file_write_flags. + * + * @return 0 on success, -errno on failure. + */ +int write_int_to_path(const char *path, int num, enum file_write_flags flags); + +/** + * @brief Write type unsigned int to FILE. + * + * @param f File pointer + * @param num unsigned int to write. + * @param flags Optional flags to write file. if + * ::FILE_WRITE_NEWLINE_IF_NOT is set, line-end added. For detail, see + * ::file_write_flags. + * + * @return 0 on success, -errno on failure. + */ +int write_unsigned_int_to_file(FILE *f, unsigned int num, enum file_write_flags flags); + +/** + * @brief Write int to path. + * + * @param path File path. + * @param num int to write. + * @param flags Optional flags to write file. if + * ::FILE_WRITE_NEWLINE_IF_NOT is set, line-end added. For detail, see + * ::file_write_flags. + * + * @return 0 on success, -errno on failure. + */ +int write_unsigned_int_to_path(const char *path, unsigned int num, enum file_write_flags flags); + +/** + * @brief Write long int to FILE. + * + * @param f File pointer + * @param num long int to write. + * @param flags Optional flags to write file. if + * ::FILE_WRITE_NEWLINE_IF_NOT is set, line-end added. For detail, see + * ::file_write_flags. + * + * @return 0 on success, -errno on failure. + */ +int write_long_int_to_file(FILE *f, long int num, enum file_write_flags flags); + +/** + * @brief Write int to path. + * + * @param path File path. + * @param num int to write. + * @param flags Optional flags to write file. if + * ::FILE_WRITE_NEWLINE_IF_NOT is set, line-end added. For detail, see + * ::file_write_flags. + * + * @return 0 on success, -errno on failure. + */ +int write_long_int_to_path(const char *path, long int num, enum file_write_flags flags); + +/** + * @brief Write unsigned long int to FILE. + * + * @param f File pointer + * @param num unsigned long int to write. + * @param flags Optional flags to write file. if + * ::FILE_WRITE_NEWLINE_IF_NOT is set, line-end added. For detail, see + * ::file_write_flags. + * + * @return 0 on success, -errno on failure. + */ +int write_unsigned_long_int_to_file(FILE *f, unsigned long int num, enum file_write_flags flags); + +/** + * @brief Write int to path. + * + * @param path File path. + * @param num int to write. + * @param flags Optional flags to write file. if + * ::FILE_WRITE_NEWLINE_IF_NOT is set, line-end added. For detail, see + * ::file_write_flags. + * + * @return 0 on success, -errno on failure. + */ +int write_unsigned_long_int_to_path(const char *path, unsigned long int num, enum file_write_flags flags); + +/** + * @brief Write long long int to FILE. + * + * @param f File pointer + * @param num long long int to write. + * @param flags Optional flags to write file. if + * ::FILE_WRITE_NEWLINE_IF_NOT is set, line-end added. For detail, see + * ::file_write_flags. + * + * @return 0 on success, -errno on failure. + */ +int write_long_long_int_to_file(FILE *f, long long int num, enum file_write_flags flags); + +/** + * @brief Write int to path. + * + * @param path File path. + * @param num int to write. + * @param flags Optional flags to write file. if + * ::FILE_WRITE_NEWLINE_IF_NOT is set, line-end added. For detail, see + * ::file_write_flags. + * + * @return 0 on success, -errno on failure. + */ +int write_long_long_int_to_path(const char *path, long long int num, enum file_write_flags flags); + +/** + * @brief Write unsigned long long int to FILE. + * + * @param f File pointer + * @param num unsigned long long int to write. + * @param flags Optional flags to write file. if + * ::FILE_WRITE_NEWLINE_IF_NOT is set, line-end added. For detail, see + * ::file_write_flags. + * + * @return 0 on success, -errno on failure. + */ +int write_unsigned_long_long_int_to_file(FILE *f, unsigned long long int num, enum file_write_flags flags); + +/** + * @brief Write int to path. + * + * @param path File path. + * @param num int to write. + * @param flags Optional flags to write file. if + * ::FILE_WRITE_NEWLINE_IF_NOT is set, line-end added. For detail, see + * ::file_write_flags. + * + * @return 0 on success, -errno on failure. + */ +int write_unsigned_long_long_int_to_path(const char *path, unsigned long long int num, enum file_write_flags flags); + +/** * @brief Read the first line from FILE * * @param f File pointer. @@ -580,6 +736,126 @@ int read_uint64_from_file(FILE *f, uint64_t *u); * @return 0 on success, -errno on failure. */ int read_uint64_from_path(const char *path, uint64_t *u); + +/** + * @brief Read type int from FILE + * + * @param f File pointer. + * @param num type int pointer + * + * @return 0 on success, -errno on failure. + */ +int read_int_from_file(FILE *f, int *num); + +/** + * @brief Read type int from path + * + * @param path File path. + * @param num type int pointer + * + * @return 0 on success, -errno on failure. + */ +int read_int_from_path(const char *path, int *num); + +/** + * @brief Read type unsigned int from FILE + * + * @param f File pointer. + * @param num type unsigned int pointer + * + * @return 0 on success, -errno on failure. + */ +int read_unsigned_int_from_file(FILE *f, unsigned int *num); + +/** + * @brief Read type unsigned int from path + * + * @param path File path. + * @param num type unsigned int pointer + * + * @return 0 on success, -errno on failure. + */ +int read_unsigned_int_from_path(const char *path, unsigned int *num); + +/** + * @brief Read type long int from FILE + * + * @param f File pointer. + * @param num type long int pointer + * + * @return 0 on success, -errno on failure. + */ +int read_long_int_from_file(FILE *f, long int *num); + +/** + * @brief Read type long int from path + * + * @param path File path. + * @param num type long int pointer + * + * @return 0 on success, -errno on failure. + */ +int read_long_int_from_path(const char *path, long int *num); + +/** + * @brief Read type unsigned long int from FILE + * + * @param f File pointer. + * @param num type unsigned long int pointer + * + * @return 0 on success, -errno on failure. + */ +int read_unsigned_long_int_from_file(FILE *f, unsigned long int *num); + +/** + * @brief Read type unsigned long int from path + * + * @param path File path. + * @param num type unsigned long int pointer + * + * @return 0 on success, -errno on failure. + */ +int read_unsigned_long_int_from_path(const char *path, unsigned long int *num); + +/** + * @brief Read type long long int from FILE + * + * @param f File pointer. + * @param num type long long int pointer + * + * @return 0 on success, -errno on failure. + */ +int read_long_long_int_from_file(FILE *f, long long *num); + +/** + * @brief Read type long long int from path + * + * @param path File path. + * @param num type long long int pointer + * + * @return 0 on success, -errno on failure. + */ +int read_long_long_int_from_path(const char *path, long long *num); + +/** + * @brief Read type unsigned long long int from FILE + * + * @param f File pointer. + * @param num type unsigned long long int pointer + * + * @return 0 on success, -errno on failure. + */ +int read_unsigned_long_long_int_from_file(FILE *f, unsigned long long *num); + +/** + * @brief Read type unsigned long long int from path + * + * @param path File path. + * @param num type unsigned long long int pointer + * + * @return 0 on success, -errno on failure. + */ +int read_unsigned_long_long_int_from_path(const char *path, unsigned long long *num); /** * @} */ |