abrt  2.1.5.6.g638c.dirty
A tool to inform users about various problems on the running system
Macros | Typedefs | Functions | Variables
libabrt.h File Reference
#include <gio/gio.h>
#include "abrt-dbus.h"
#include <libreport/internal_libreport.h>
#include "hooklib.h"

Go to the source code of this file.

Macros

#define _(S)   (S)
#define NORETURN   __attribute__ ((noreturn))
#define ARRAY_SIZE(x)   ((unsigned)(sizeof(x) / sizeof((x)[0])))
#define check_free_space   abrt_check_free_space
#define trim_problem_dirs   abrt_trim_problem_dirs
#define run_unstrip_n   abrt_run_unstrip_n
#define get_backtrace   abrt_get_backtrace
#define g_settings_nMaxCrashReportsSize   abrt_g_settings_nMaxCrashReportsSize
#define g_settings_sWatchCrashdumpArchiveDir   abrt_g_settings_sWatchCrashdumpArchiveDir
#define g_settings_dump_location   abrt_g_settings_dump_location
#define g_settings_delete_uploaded   abrt_g_settings_delete_uploaded
#define g_settings_autoreporting   abrt_g_settings_autoreporting
#define g_settings_autoreporting_event   abrt_g_settings_autoreporting_event
#define load_abrt_conf   abrt_load_abrt_conf
#define free_abrt_conf_data   abrt_free_abrt_conf_data
#define daemon_is_ok   abrt_daemon_is_ok
#define koops_extract_version   abrt_koops_extract_version
#define kernel_tainted_short   abrt_kernel_tainted_short
#define kernel_tainted_long   abrt_kernel_tainted_long
#define koops_hash_str   abrt_koops_hash_str
#define koops_extract_oopses   abrt_koops_extract_oopses
#define koops_print_suspicious_strings   abrt_koops_print_suspicious_strings

Typedefs

typedef struct ignored_problems ignored_problems_t

Functions

void check_free_space (unsigned setting_MaxCrashReportsSize, const char *dump_location)
 Checks if there is enough free space to store the problem data.
void trim_problem_dirs (const char *dirname, double cap_size, const char *exclude_path)
char * run_unstrip_n (const char *dump_dir_name, unsigned timeout_sec)
char * get_backtrace (const char *dump_dir_name, unsigned timeout_sec, const char *debuginfo_dirs)
int load_abrt_conf ()
void free_abrt_conf_data ()
void migrate_to_xdg_dirs (void)
int check_recent_crash_file (const char *filename, const char *executable)
int daemon_is_ok ()
char * koops_extract_version (const char *line)
char * kernel_tainted_short (const char *kernel_bt)
char * kernel_tainted_long (const char *tainted_short)
int koops_hash_str (char hash_str[SHA1_RESULT_LEN *2+1], const char *oops_buf)
void koops_extract_oopses (GList **oops_list, char *buffer, size_t buflen)
void koops_print_suspicious_strings (void)
int chown_dir_over_dbus (const char *problem_dir_path)
 Changes the access rights of the problem specified by problem id.
int delete_problem_dirs_over_dbus (const GList *problem_dir_paths)
 Delets multiple problems specified by their id (as returned from problem_data_save)
problem_data_t * get_problem_data_dbus (const char *problem_dir_path)
 Fetches problem information for specified problem id.
GList * get_problems_over_dbus (bool authorize)
 Fetches all problems from problem database.
ignored_problems_tignored_problems_new (char *file_path)
 Initializes a new instance of ignored problems.
void ignored_problems_free (ignored_problems_t *set)
 Destroys an instance of ignored problems.
void ignored_problems_add (ignored_problems_t *set, const char *problem_id)
 Adds a problem to the ignored problems.
void ignored_problems_remove (ignored_problems_t *set, const char *problem_id)
 Removes a problem from the ignored problems.
bool ignored_problems_contains (ignored_problems_t *set, const char *problem_id)
 Checks if a problem is in the ignored problems.

Variables

char ** environ
unsigned int g_settings_nMaxCrashReportsSize
char * g_settings_sWatchCrashdumpArchiveDir
char * g_settings_dump_location
bool g_settings_delete_uploaded
bool g_settings_autoreporting
char * g_settings_autoreporting_event

Detailed Description

Definition in file libabrt.h.


Function Documentation

void check_free_space ( unsigned  setting_MaxCrashReportsSize,
const char *  dump_location 
)

Checks if there is enough free space to store the problem data.

Parameters:
setting_MaxCrashReportsSizeMaximum data size
dump_locationLocation to check for the available space
int chown_dir_over_dbus ( const char *  problem_dir_path)

Changes the access rights of the problem specified by problem id.

Requires authorization

Returns:
0 if successfull non-zeru on failure
int delete_problem_dirs_over_dbus ( const GList *  problem_dir_paths)

Delets multiple problems specified by their id (as returned from problem_data_save)

Parameters:
problem_dir_pathsList of problem ids
Returns:
0 if operation was successfull, non-zero on failure
problem_data_t* get_problem_data_dbus ( const char *  problem_dir_path)

Fetches problem information for specified problem id.

Returns:
problem_data_t or NULL on failure
GList* get_problems_over_dbus ( bool  authorize)

Fetches all problems from problem database.

Parameters:
authorizeIf set to true will try to fetch even problems owned by other users (will require root authorization over policy kit)
Returns:
List of problem ids or NULL on failure
void ignored_problems_add ( ignored_problems_t set,
const char *  problem_id 
)

Adds a problem to the ignored problems.

This function never fails. All errors will be logged.

Parameters:
setAn instance of ignored problems to which the problem will be added
problem_idAn identifier of a problem which will be added to an ignored set
bool ignored_problems_contains ( ignored_problems_t set,
const char *  problem_id 
)

Checks if a problem is in the ignored problems.

This function never fails. All errors will be logged. If any error occurs, the function returns 0 value.

Parameters:
setAn instance of ignored problems in which the problem will be searched
problem_idAn identifier of a problem
Returns:
Non 0 value if the problem is ignored; otherwise returns 0 value.
void ignored_problems_free ( ignored_problems_t set)

Destroys an instance of ignored problems.

This function never fails. Supports the common behaviour where it accepts NULL pointers.

Parameters:
setA destroyed instance
ignored_problems_t* ignored_problems_new ( char *  file_path)

Initializes a new instance of ignored problems.

Parameters:
file_pathA malloced string holding a path to a file containing the list of ignored problems. Function takes ownership of the malloced memory, which will be freed in ignored_problems_free()
See also:
ignored_problems_free()
Returns:
Fully initialized instance of ignored problems struct which must be destroyed by ignored_problems_free()
void ignored_problems_remove ( ignored_problems_t set,
const char *  problem_id 
)

Removes a problem from the ignored problems.

This function never fails. All errors will be logged.

Parameters:
setAn instance of ignored problems from which the problem will be deleted
problem_idAn identifier of a problem which will be removed from an ignored problems struct