LibT2FS 0.1
C API for accessing TEngine data in memory.
Loading...
Searching...
No Matches
common.h
Go to the documentation of this file.
1/* This file is part of LibT2FS.
2 *
3 * LibT2FS is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 3 of the License, or
6 * (at your option) any later version.
7 *
8 * LibT2FS is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <https://www.gnu.org/licenses/>.
15 */
16
17#ifndef H_T2FS_COMMON
18#define H_T2FS_COMMON
19
20#include <stdio.h>
21#include <stdint.h>
22
23#define T2FS_PRINT_INFO(...) t2fs_print_info(__VA_ARGS__)
24#define T2FS_PRINT_ERROR(...) t2fs_print_error(__func__, __VA_ARGS__)
25#define T2FS_PRINT_WARN(...) t2fs_print_warn(__func__, __VA_ARGS__)
26#define T2FS_PRINT_DEBUG(...) t2fs_print_debug(__func__, __VA_ARGS__)
27
35
37void t2fs_set_print_flags(const int flags);
38void t2fs_set_print_flag(const int flag);
39void t2fs_unset_print_flag(const int flag);
40
41void t2fs_print_info(const char *const fmt, ...);
42void t2fs_print_warn(const char *const func, const char *const fmt, ...);
43void t2fs_print_warn_extra(const char *const func, const char *const extra, const char *const fmt, va_list args);
44void t2fs_print_error(const char *const func, const char *const fmt, ...);
45void t2fs_print_error_extra(const char *const func, const char *const extra, const char *const fmt, va_list args);
46void t2fs_print_debug(const char *const func, const char *const fmt, ...);
47void t2fs_print_debug_extra(const char *const func, const char *const extra, const char *const fmt, va_list args);
48
49void t2fs_print_hex(const unsigned char *const value, const size_t size,
50 const char *const end, FILE *const out);
51void t2fs_print_bin(void *value, size_t size, const char *const end,
52 FILE *const out);
53
54void t2fs_flip_endianess_u32(uint32_t *v);
55void t2fs_flip_endianess_s32(int32_t *v);
57void t2fs_flip_endianess_u16(uint16_t *v);
58void t2fs_flip_endianess_s16(int16_t *v);
59
60#endif
void t2fs_flip_endianess_s32(int32_t *v)
void t2fs_print_debug_extra(const char *const func, const char *const extra, const char *const fmt, va_list args)
void t2fs_print_bin(void *value, size_t size, const char *const end, FILE *const out)
void t2fs_print_warn_extra(const char *const func, const char *const extra, const char *const fmt, va_list args)
void t2fs_flip_endianess_u16(uint16_t *v)
void t2fs_set_print_flags(const int flags)
void t2fs_flip_endianess_s16(int16_t *v)
void t2fs_flip_endianess_f32(float *v)
void t2fs_print_error_extra(const char *const func, const char *const extra, const char *const fmt, va_list args)
void t2fs_flip_endianess_u32(uint32_t *v)
void t2fs_print_warn(const char *const func, const char *const fmt,...)
void t2fs_set_print_flag(const int flag)
void t2fs_unset_print_flag(const int flag)
int t2fs_get_print_flags(void)
void t2fs_print_debug(const char *const func, const char *const fmt,...)
void t2fs_print_info(const char *const fmt,...)
void t2fs_print_hex(const unsigned char *const value, const size_t size, const char *const end, FILE *const out)
__PrintFlags
Definition common.h:28
@ T2FS_PRINT_FLAG_SILENT
Definition common.h:29
@ T2FS_PRINT_FLAG_DEBUG
Definition common.h:33
@ T2FS_PRINT_FLAG_ERROR
Definition common.h:32
@ T2FS_PRINT_FLAG_INFO
Definition common.h:30
@ T2FS_PRINT_FLAG_WARNING
Definition common.h:31
void t2fs_print_error(const char *const func, const char *const fmt,...)