libreport  2.9.5
A tool to inform users about various problems on the running system
Data Structures | Macros | Typedefs | Enumerations | Functions
problem_data.h File Reference
#include "libreport_types.h"

Go to the source code of this file.

Data Structures

struct  problem_item
 

Macros

#define PROBLEM_ITEM_UNINITIALIZED_SIZE   ((unsigned long)-1)
 

Typedefs

typedef struct problem_item problem_item
 
typedef GHashTable problem_data_t
 

Enumerations

enum  {
  CD_FLAG_BIN = (1 << 0), CD_FLAG_TXT = (1 << 1), CD_FLAG_ISEDITABLE = (1 << 2), CD_FLAG_ISNOTEDITABLE = (1 << 3),
  CD_FLAG_LIST = (1 << 4), CD_FLAG_UNIXTIME = (1 << 5), CD_FLAG_BIGTXT = (1 << 6)
}
 
enum  { PROBLEM_REPRODUCIBLE_UNKNOWN, PROBLEM_REPRODUCIBLE_YES, PROBLEM_REPRODUCIBLE_RECURRENT, _PROBLEM_REPRODUCIBLE_MAX_ }
 

Functions

char * problem_item_format (struct problem_item *item)
 
int problem_item_get_size (struct problem_item *item, unsigned long *size)
 
problem_data_t * problem_data_new (void)
 
void problem_data_add_basics (problem_data_t *pd)
 
void problem_data_add_current_process_data (problem_data_t *pd)
 
void problem_data_add (problem_data_t *problem_data, const char *name, const char *content, unsigned flags)
 
struct problem_itemproblem_data_add_ext (problem_data_t *problem_data, const char *name, const char *content, unsigned flags, unsigned long size)
 
void problem_data_add_text_noteditable (problem_data_t *problem_data, const char *name, const char *content)
 
void problem_data_add_text_editable (problem_data_t *problem_data, const char *name, const char *content)
 
void problem_data_add_file (problem_data_t *pd, const char *name, const char *path)
 
char * problem_data_get_content_or_NULL (problem_data_t *problem_data, const char *key)
 
char * problem_data_get_content_or_die (problem_data_t *problem_data, const char *key)
 
void problem_data_get_osinfo (problem_data_t *problem_data, map_string_t *osinfo)
 Loads key value pairs from os_info item in to the osinfo argument. More...
 
int problem_data_send_to_abrt (problem_data_t *problem_data)
 
int problem_data_load_dump_dir_element (struct dump_dir *dd, const char *name, char **content, int *type_flags, int *fd)
 
void problem_data_load_from_dump_dir (problem_data_t *problem_data, struct dump_dir *dd, char **excluding)
 
problem_data_t * create_problem_data_from_dump_dir (struct dump_dir *dd)
 
problem_data_t * create_problem_data_for_reporting (const char *dump_dir_name)
 
struct dump_dircreate_dump_dir_from_problem_data (problem_data_t *problem_data, const char *base_dir_name)
 Saves the problem data object. More...
 
struct dump_dircreate_dump_dir_from_problem_data_ext (problem_data_t *problem_data, const char *base_dir_name, uid_t uid)
 
int save_problem_data_in_dump_dir (struct dump_dir *dd, problem_data_t *problem_data)
 Saves the problem data object in opened dump directory. More...
 
int get_problem_data_reproducible (problem_data_t *problem_data)
 
const char * get_problem_data_reproducible_name (int reproducible)
 

Function Documentation

◆ create_dump_dir_from_problem_data()

struct dump_dir* create_dump_dir_from_problem_data ( problem_data_t *  problem_data,
const char *  base_dir_name 
)

Saves the problem data object.

Parameters
problem_dataProblem data object to save
base_dir_nameLocation to store the problem data

◆ problem_data_get_osinfo()

void problem_data_get_osinfo ( problem_data_t *  problem_data,
map_string_t *  osinfo 
)

Loads key value pairs from os_info item in to the osinfo argument.

The function expects that osinfo data are stored in format of os-release(5).

The Function at first step tries to load the data from os_info obtained from chrooted directory. If the chrooted data doesn't exist the function loads os_info from the data obtained from the standard path. If the os_info item is missing the function adds PRETTY_NAME key with a content of the os_release item.

Parameters
problem_dataProblem data object to read the os_info items
osinfoString string map where loaded key value pairs are saved

◆ save_problem_data_in_dump_dir()

int save_problem_data_in_dump_dir ( struct dump_dir dd,
problem_data_t *  problem_data 
)

Saves the problem data object in opened dump directory.

Parameters
ddDump directory
problem_dataProblem data object to save
Returns
0 on success; otherwise non-zero value