libgpac
Documentation of the core library of GPAC
error.c File Reference
#include <gpac/tools.h>
#include <gpac/thread.h>
#include <gpac/utf.h>
#include <gpac/list.h>
+ Include dependency graph for error.c:

Data Structures

struct  log_tool_info
 
struct  lang_def
 

Macros

#define NB_4CC_BUF   10
 
#define GF_LOG_TOOL_MAX_NAME_SIZE   (GF_LOG_TOOL_MAX*10)
 
#define CHECK_MAC(_a)   "#_a :" ? (_a) ? "yes":"no"
 

Functions

GF_EXPORT const char * gf_4cc_to_str_safe (u32 type, char szType[GF_4CC_MSIZE])
 
GF_EXPORT const char * gf_4cc_to_str (u32 type)
 
GF_EXPORT u32 gf_4cc_parse (const char *val)
 
static void gf_on_progress_std (const char *_title, u64 done, u64 total)
 
GF_EXPORT void gf_set_progress (const char *title, u64 done, u64 total)
 Progress formatting. More...
 
GF_EXPORT void gf_set_progress_callback (void *_user_cbk, gf_on_progress_cbk _prog_cbk)
 Progress overwriting Overwrites the progress signaling function by a user-defined one. More...
 
u32 gf_log_parse_tool (const char *logs)
 Parses a log tool. More...
 
GF_EXPORT GF_Err gf_log_modify_tools_levels (const char *val_)
 Modify log tools and levels. More...
 
GF_EXPORT GF_Err gf_log_set_tools_levels (const char *val, Bool reset_all)
 Set log tools and levels. More...
 
GF_EXPORT char * gf_log_get_tools_levels ()
 gets string-formatted log tools More...
 
GF_EXPORT void gf_sys_set_console_code (FILE *std, GF_ConsoleCodes code)
 
GF_EXPORT void gf_log_push_extra (const GF_LogExtra *log)
 
GF_EXPORT void gf_log_pop_extra (const GF_LogExtra *log)
 
GF_EXPORT void gf_log_reset_extras ()
 
GF_EXPORT Bool gf_log_tool_level_on (GF_LOG_Tool log_tool, GF_LOG_Level log_level)
 Log level checking. More...
 
GF_EXPORT const char * gf_log_tool_name (GF_LOG_Tool log_tool)
 Log tool name. More...
 
const char * gf_log_level_name (GF_LOG_Level log_level)
 
GF_EXPORT u32 gf_log_get_tool_level (GF_LOG_Tool log_tool)
 Log level getter. More...
 
static void do_log_time (FILE *logs, const char *fmt)
 
int gf_fileio_printf (GF_FileIO *gfio, const char *format, va_list args)
 
void default_log_callback (void *cbck, GF_LOG_Level level, GF_LOG_Tool tool, const char *fmt, va_list vlist)
 
void default_log_callback_color (void *cbck, GF_LOG_Level level, GF_LOG_Tool tool, const char *fmt, va_list vlist)
 
GF_EXPORT Bool gf_log_use_color ()
 Checks if color logs is enabled. More...
 
GF_EXPORT void gf_log (const char *fmt,...)
 
GF_EXPORT void gf_log_va_list (GF_LOG_Level level, GF_LOG_Tool tool, const char *fmt, va_list vl)
 
GF_EXPORT Bool gf_log_set_strict_error (Bool strict)
 Log exits at first error assignment. More...
 
GF_EXPORT void gf_log_set_tool_level (GF_LOG_Tool tool, GF_LOG_Level level)
 Log modules assignment. More...
 
GF_EXPORT void gf_log_lt (GF_LOG_Level ll, GF_LOG_Tool lt)
 
GF_EXPORT gf_log_cbk gf_log_set_callback (void *usr_cbk, gf_log_cbk cbk)
 Log overwrite. More...
 
GF_EXPORT const char * gf_error_to_string (GF_Err e)
 Error Printing. More...
 
GF_EXPORT u32 gf_crc_32 (const u8 *data, u32 len)
 CRC32 compute. More...
 
static const char * gf_enabled_features ()
 
static const char * gf_disabled_features ()
 
GF_EXPORT const char * gf_sys_features (Bool disabled)
 
GF_EXPORT u32 gf_lang_get_count ()
 
GF_EXPORT s32 gf_lang_find (const char *lang_or_rfc_5646_code)
 
GF_EXPORT const char * gf_lang_get_name (u32 idx)
 
GF_EXPORT const char * gf_lang_get_2cc (u32 idx)
 
GF_EXPORT const char * gf_lang_get_3cc (u32 idx)
 
GF_EXPORT GF_Err gf_dynstrcat (char **str, const char *to_append, const char *sep)
 dynamic string concatenation More...
 
GF_EXPORT Bool gf_parse_lfrac (const char *value, GF_Fraction64 *frac)
 fraction parsing More...
 
GF_EXPORT Bool gf_parse_frac (const char *value, GF_Fraction *frac)
 fraction parsing More...
 
Bool gf_strict_atoi (const char *str, s32 *ans)
 strict convert str into integer More...
 
Bool gf_strict_atoui (const char *str, u32 *ans)
 strict convert str into unsigned integer More...
 
const char * gf_strmemstr (const char *data, u32 data_size, const char *pat)
 search string in buffer More...
 

Variables

static char szTYPE_BUF [NB_4CC_BUF][GF_4CC_MSIZE]
 
static u32 buf_4cc_idx = NB_4CC_BUF
 
static const char * szProg []
 
static u64 prev_pos = (u64) -1
 
static u64 prev_pc = (u64) -1
 
char gf_prog_lf
 
static gf_on_progress_cbk prog_cbk = NULL
 
static void * user_cbk = NULL
 
static Bool gpac_no_color_logs = GF_FALSE
 
static struct log_tool_info global_log_tools []
 
u32 call_lev = 0
 
u32 call_tool = 0
 
GF_Mutex * logs_mx
 
GF_List * logs_extras = NULL
 
FILE * gpac_log_file = NULL
 
Bool gpac_log_time_start = GF_FALSE
 
Bool gpac_log_utc_time = GF_FALSE
 
Bool gpac_log_dual = GF_FALSE
 
Bool last_log_is_lf = GF_TRUE
 
static u64 gpac_last_log_time =0
 
static void * user_log_cbk = NULL
 
gf_log_cbk log_cbk = default_log_callback_color
 
static Bool log_exit_on_error = GF_FALSE
 
static char szErrMsg [50]
 
static const u32 gf_crc_table [256]
 
static const struct lang_def defined_languages []
 

Data Structure Documentation

◆ log_tool_info

struct log_tool_info
Data Fields
u32 type
const char * name
GF_LOG_Level level
Bool strict
const char * alt

◆ lang_def

struct lang_def
Data Fields
const char * name
const char * three_char_code
const char * two_char_code

Macro Definition Documentation

◆ NB_4CC_BUF

#define NB_4CC_BUF   10

◆ GF_LOG_TOOL_MAX_NAME_SIZE

#define GF_LOG_TOOL_MAX_NAME_SIZE   (GF_LOG_TOOL_MAX*10)

◆ CHECK_MAC

#define CHECK_MAC (   _a)    "#_a :" ? (_a) ? "yes":"no"

Function Documentation

◆ gf_on_progress_std()

static void gf_on_progress_std ( const char *  _title,
u64  done,
u64  total 
)
static
+ Here is the caller graph for this function:

◆ gf_log_level_name()

const char* gf_log_level_name ( GF_LOG_Level  log_level)
+ Here is the caller graph for this function:

◆ do_log_time()

static void do_log_time ( FILE *  logs,
const char *  fmt 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gf_fileio_printf()

int gf_fileio_printf ( GF_FileIO *  gfio,
const char *  format,
va_list  args 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ default_log_callback()

void default_log_callback ( void *  cbck,
GF_LOG_Level  level,
GF_LOG_Tool  tool,
const char *  fmt,
va_list  vlist 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ default_log_callback_color()

void default_log_callback_color ( void *  cbck,
GF_LOG_Level  level,
GF_LOG_Tool  tool,
const char *  fmt,
va_list  vlist 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gf_log()

GF_EXPORT void gf_log ( const char *  fmt,
  ... 
)
+ Here is the call graph for this function:

◆ gf_log_va_list()

GF_EXPORT void gf_log_va_list ( GF_LOG_Level  level,
GF_LOG_Tool  tool,
const char *  fmt,
va_list  vl 
)
+ Here is the caller graph for this function:

◆ gf_log_lt()

GF_EXPORT void gf_log_lt ( GF_LOG_Level  ll,
GF_LOG_Tool  lt 
)
+ Here is the caller graph for this function:

◆ gf_enabled_features()

static const char* gf_enabled_features ( )
static
+ Here is the caller graph for this function:

◆ gf_disabled_features()

static const char* gf_disabled_features ( )
static
+ Here is the caller graph for this function:

Variable Documentation

◆ szTYPE_BUF

char szTYPE_BUF[NB_4CC_BUF][GF_4CC_MSIZE]
static

◆ buf_4cc_idx

u32 buf_4cc_idx = NB_4CC_BUF
static

◆ szProg

const char* szProg[]
static
Initial value:
=
{
" ",
"= ",
"== ",
"=== ",
"==== ",
"===== ",
"====== ",
"======= ",
"======== ",
"========= ",
"========== ",
"=========== ",
"============ ",
"============= ",
"============== ",
"=============== ",
"================ ",
"================= ",
"================== ",
"=================== ",
"====================",
}

◆ prev_pos

u64 prev_pos = (u64) -1
static

◆ prev_pc

u64 prev_pc = (u64) -1
static

◆ gf_prog_lf

char gf_prog_lf
extern

◆ prog_cbk

gf_on_progress_cbk prog_cbk = NULL
static

◆ user_cbk

void* user_cbk = NULL
static

◆ gpac_no_color_logs

Bool gpac_no_color_logs = GF_FALSE
static

◆ global_log_tools

struct log_tool_info global_log_tools[]
static

◆ call_lev

u32 call_lev = 0

◆ call_tool

u32 call_tool = 0

◆ logs_mx

GF_Mutex* logs_mx
extern

◆ logs_extras

GF_List* logs_extras = NULL

◆ gpac_log_file

FILE* gpac_log_file = NULL

◆ gpac_log_time_start

Bool gpac_log_time_start = GF_FALSE

◆ gpac_log_utc_time

Bool gpac_log_utc_time = GF_FALSE

◆ gpac_log_dual

Bool gpac_log_dual = GF_FALSE

◆ last_log_is_lf

Bool last_log_is_lf = GF_TRUE

◆ gpac_last_log_time

u64 gpac_last_log_time =0
static

◆ user_log_cbk

void* user_log_cbk = NULL
static

◆ log_cbk

◆ log_exit_on_error

Bool log_exit_on_error = GF_FALSE
static

◆ szErrMsg

char szErrMsg[50]
static

◆ gf_crc_table

const u32 gf_crc_table[256]
static

◆ defined_languages

const struct lang_def defined_languages[]
static