On 07/12/2012 11:15 AM, Denys Vlasenko wrote:
On 07/11/2012 05:54 PM, Jiri Moskovcak wrote:
> On 07/11/2012 05:31 PM, Denys Vlasenko wrote:
>> On 07/11/2012 05:26 PM, Jiri Moskovcak wrote:
>>>> Let's add add_text_to_problem_data() to
>>>> libreport.1/src/include/problem_data.h
>>>> instead of creating yet another abstraction layer.
>>>> Abstraction layers are not zero price.
>>>
>>> - I don't mind the few microseconds or few bytes it will cost I really
>>> prefer the easy to use API over that...
>>
>> I'm not so much concerned about overhead but by having
>> another set of functions which do the same thing.
>> I am an idiot. I get confused by this stuff.
>>
>
> - ok, so what's the consensus here?
>
> - problem_data_save() definitely belongs to ABRT because it reads the abrt.conf file
Yes.
> - the rest is more or less already in libreport,
> but I would like to see it exported thru some abrt header (which I think already is)
#include <libreport/problem_data.h>
> and also would like to rename it to problem_data_*
Ok. I will prepare a patch.
> - so should we rename the functions in libreport and keep just that one in ABRT?
I think yes, this would be the best solution.
Please review this and the following patch.
It only renames functions in libreport, nothing else.
(Second patch does the same for arbt code).
--
vda
diff -x '*.po' -d -urpN libreport.0/src/cli/cli-report.c
libreport.1/src/cli/cli-report.c
--- libreport.0/src/cli/cli-report.c 2012-07-10 18:07:42.000000000 +0200
+++ libreport.1/src/cli/cli-report.c 2012-07-12 17:41:35.732059855 +0200
@@ -117,7 +117,7 @@ static void remove_comments_and_unescape
static void write_crash_report_field(FILE *fp, problem_data_t *problem_data,
const char *field, const char *description)
{
- const struct problem_item *value = get_problem_data_item_or_NULL(problem_data,
field);
+ const struct problem_item *value = problem_data_get_item_or_NULL(problem_data,
field);
if (!value)
{
// exit silently, all fields are optional for now
@@ -189,7 +189,7 @@ static int read_crash_report_field(const
else
length = end - textfield;
- struct problem_item *value = get_problem_data_item_or_NULL(report, field);
+ struct problem_item *value = problem_data_get_item_or_NULL(report, field);
if (!value)
{
error_msg("Field %s not found", field);
@@ -251,8 +251,8 @@ static int read_crash_report(problem_dat
*/
static void create_fields_for_editor(problem_data_t *problem_data)
{
- if (!get_problem_data_item_or_NULL(problem_data, FILENAME_COMMENT))
- add_to_problem_data_ext(problem_data, FILENAME_COMMENT, "", CD_FLAG_TXT
+ CD_FLAG_ISEDITABLE);
+ if (!problem_data_get_item_or_NULL(problem_data, FILENAME_COMMENT))
+ problem_data_add(problem_data, FILENAME_COMMENT, "", CD_FLAG_TXT +
CD_FLAG_ISEDITABLE);
}
/**
@@ -811,7 +811,7 @@ int report(const char *dump_dir_name, in
int result = run_report_editor(problem_data);
if (result != 0)
{
- free_problem_data(problem_data);
+ problem_data_free(problem_data);
free(report_events_as_lines);
return 1;
}
@@ -820,8 +820,8 @@ int report(const char *dump_dir_name, in
if (dd)
{
//TODO: we should iterate through problem_data and modify all modifiable fields
- const char *comment = get_problem_item_content_or_NULL(problem_data,
FILENAME_COMMENT);
- const char *backtrace = get_problem_item_content_or_NULL(problem_data,
FILENAME_BACKTRACE);
+ const char *comment = problem_data_get_content_or_NULL(problem_data,
FILENAME_COMMENT);
+ const char *backtrace = problem_data_get_content_or_NULL(problem_data,
FILENAME_BACKTRACE);
if (comment)
dd_save_text(dd, FILENAME_COMMENT, comment);
if (backtrace)
@@ -839,7 +839,7 @@ int report(const char *dump_dir_name, in
if (!report_events)
{
- free_problem_data(problem_data);
+ problem_data_free(problem_data);
error_msg_and_die("The problem directory '%s' has no defined
reporters",
dump_dir_name);
}
@@ -857,10 +857,10 @@ int report(const char *dump_dir_name, in
}
else
{
- const char *rating_str = get_problem_item_content_or_NULL(problem_data,
FILENAME_RATING);
+ const char *rating_str = problem_data_get_content_or_NULL(problem_data,
FILENAME_RATING);
//COMPAT, remove after 2.1 release
if (!rating_str)
- rating_str = get_problem_item_content_or_NULL(problem_data,
"rating");
+ rating_str = problem_data_get_content_or_NULL(problem_data,
"rating");
unsigned i, rating = rating_str ? xatou(rating_str) : 4;
GList *li;
@@ -894,7 +894,7 @@ int report(const char *dump_dir_name, in
{
puts(_("Reporting disabled because the backtrace is
unusable"));
- const char *package = get_problem_item_content_or_NULL(problem_data,
FILENAME_PACKAGE);
+ const char *package = problem_data_get_content_or_NULL(problem_data,
FILENAME_PACKAGE);
if (package && package[0])
printf(_("Please try to install debuginfo manually using the
command: \"debuginfo-install %s\" and try again\n"), package);
@@ -919,7 +919,7 @@ int report(const char *dump_dir_name, in
}
printf(_("Problem reported via %d report events (%d errors)\n"), plugins,
errors);
- free_problem_data(problem_data);
+ problem_data_free(problem_data);
list_free_with_free(report_events);
return errors;
}
diff -x '*.po' -d -urpN libreport.0/src/gui-wizard-gtk/main.c
libreport.1/src/gui-wizard-gtk/main.c
--- libreport.0/src/gui-wizard-gtk/main.c 2012-07-10 18:07:42.000000000 +0200
+++ libreport.1/src/gui-wizard-gtk/main.c 2012-07-12 17:44:26.354644065 +0200
@@ -30,7 +30,7 @@ GList *g_auto_event_list = NULL;
problem_data_t *g_cd;
-void reload_problem_data_from_dump_dir(void)
+void problem_data_reload_from_dump_dir(void)
{
free(g_events);
@@ -39,7 +39,7 @@ void reload_problem_data_from_dump_dir(v
xfunc_die(); /* dd_opendir already logged error msg */
problem_data_t *new_cd = create_problem_data_from_dump_dir(dd);
- add_to_problem_data_ext(new_cd, CD_DUMPDIR, g_dump_dir_name, (CD_FLAG_TXT |
CD_FLAG_ISNOTEDITABLE));
+ problem_data_add(new_cd, CD_DUMPDIR, g_dump_dir_name, (CD_FLAG_TXT |
CD_FLAG_ISNOTEDITABLE));
g_events = list_possible_events(dd, NULL, "");
dd_close(dd);
@@ -53,7 +53,7 @@ void reload_problem_data_from_dump_dir(v
g_hash_table_iter_init(&iter, new_cd);
while (g_hash_table_iter_next(&iter, (void**)&name,
(void**)&new_item))
{
- struct problem_item *old_item = g_cd ? get_problem_data_item_or_NULL(g_cd,
name) : NULL;
+ struct problem_item *old_item = g_cd ? problem_data_get_item_or_NULL(g_cd,
name) : NULL;
if (old_item)
{
new_item->selected_by_user = old_item->selected_by_user;
@@ -70,7 +70,7 @@ void reload_problem_data_from_dump_dir(v
}
//log("%s: was ->selected_by_user=%d", __func__,
new_item->selected_by_user);
}
- free_problem_data(g_cd);
+ problem_data_free(g_cd);
}
g_cd = new_cd;
@@ -140,7 +140,7 @@ int main(int argc, char **argv)
load_event_config_data_from_keyring();
load_user_settings("report-gtk");
- reload_problem_data_from_dump_dir();
+ problem_data_reload_from_dump_dir();
create_assistant();
diff -x '*.po' -d -urpN libreport.0/src/gui-wizard-gtk/wizard.c
libreport.1/src/gui-wizard-gtk/wizard.c
--- libreport.0/src/gui-wizard-gtk/wizard.c 2012-07-10 18:07:42.000000000 +0200
+++ libreport.1/src/gui-wizard-gtk/wizard.c 2012-07-12 17:44:06.835691513 +0200
@@ -296,7 +296,7 @@ static void update_window_title(void)
{
/* prgname can be null according to gtk documentation */
const char *prgname = g_get_prgname();
- const char *reason = get_problem_item_content_or_NULL(g_cd, FILENAME_REASON);
+ const char *reason = problem_data_get_content_or_NULL(g_cd, FILENAME_REASON);
char *title = xasprintf("%s - %s", (reason ? reason : g_dump_dir_name),
(prgname ? prgname : "report"));
gtk_window_set_title(g_wnd_assistant, title);
@@ -394,7 +394,7 @@ static void load_text_to_text_view(GtkTe
{
GtkTextBuffer *tb = gtk_text_view_get_buffer(tv);
- const char *str = g_cd ? get_problem_item_content_or_NULL(g_cd, name) : NULL;
+ const char *str = g_cd ? problem_data_get_content_or_NULL(g_cd, name) : NULL;
/* Bad: will choke at any text with non-Unicode parts: */
/* gtk_text_buffer_set_text(tb, (str ? str : ""), -1);*/
/* Start torturing ourself instead: */
@@ -431,7 +431,7 @@ static gchar *get_malloced_string_from_t
static void save_text_if_changed(const char *name, const char *new_value)
{
- const char *old_value = g_cd ? get_problem_item_content_or_NULL(g_cd, name) :
"";
+ const char *old_value = g_cd ? problem_data_get_content_or_NULL(g_cd, name) :
"";
if (!old_value)
old_value = "";
if (strcmp(new_value, old_value) != 0)
@@ -444,7 +444,7 @@ static void save_text_if_changed(const c
}
//FIXME: else: what to do with still-unsaved data in the widget??
dd_close(dd);
- reload_problem_data_from_dump_dir();
+ problem_data_reload_from_dump_dir();
update_gui_state_from_problem_data();
}
}
@@ -521,7 +521,7 @@ static struct problem_item *get_current_
-1);
if (!*pp_item_name) /* paranoia, should never happen */
return NULL;
- struct problem_item *item = get_problem_data_item_or_NULL(g_cd, *pp_item_name);
+ struct problem_item *item = problem_data_get_item_or_NULL(g_cd, *pp_item_name);
return item;
}
@@ -642,7 +642,7 @@ static void g_tv_details_checkbox_toggle
-1);
if (!item_name) /* paranoia, should never happen */
return;
- struct problem_item *item = get_problem_data_item_or_NULL(g_cd, item_name);
+ struct problem_item *item = problem_data_get_item_or_NULL(g_cd, item_name);
g_free(item_name);
if (!item) /* paranoia */
return;
@@ -729,7 +729,7 @@ static char *missing_items_in_comma_list
{
char *end = strchr(item_list, ',');
if (end) *end = '\0';
- if (!get_problem_data_item_or_NULL(g_cd, item_list))
+ if (!problem_data_get_item_or_NULL(g_cd, item_list))
{
if (dst != result)
*dst++ = ',';
@@ -805,7 +805,7 @@ static event_gui_data_t *add_event_butto
else
if (cfg->ec_creates_items)
{
- if (get_problem_data_item_or_NULL(g_cd, cfg->ec_creates_items))
+ if (problem_data_get_item_or_NULL(g_cd, cfg->ec_creates_items))
{
char *missing =
missing_items_in_comma_list(cfg->ec_creates_items);
if (missing)
@@ -930,7 +930,7 @@ static void append_item_to_ls_details(gp
gtk_list_store_append(g_ls_details, &iter);
stats->filecount++;
- //FIXME: use the human-readable format_problem_item(item) instead of
item->content.
+ //FIXME: use the human-readable problem_item_format(item) instead of
item->content.
if (item->flags & CD_FLAG_TXT)
{
if (item->flags & CD_FLAG_ISEDITABLE)
@@ -1070,8 +1070,8 @@ void update_gui_state_from_problem_data(
update_window_title();
remove_tabs_from_notebook(g_notebook);
- const char *reason = get_problem_item_content_or_NULL(g_cd, FILENAME_REASON);
- const char *not_reportable = get_problem_item_content_or_NULL(g_cd,
+ const char *reason = problem_data_get_content_or_NULL(g_cd, FILENAME_REASON);
+ const char *not_reportable = problem_data_get_content_or_NULL(g_cd,
FILENAME_NOT_REPORTABLE);
char *t = xasprintf("%s%s%s",
@@ -1558,7 +1558,7 @@ static gboolean consume_cmd_output(GIOCh
strbuf_free(evd->event_log);
free(evd);
- reload_problem_data_from_dump_dir();
+ problem_data_reload_from_dump_dir();
update_gui_state_from_problem_data();
/* Inform abrt-gui that it is a good idea to rescan the directory */
@@ -1703,14 +1703,14 @@ static void check_bt_rating_and_allow_se
* but so far only oopses don't have rating, so for now we
* skip the "kernel" manually
*/
- const char *analyzer = get_problem_item_content_or_NULL(g_cd, FILENAME_ANALYZER);
+ const char *analyzer = problem_data_get_content_or_NULL(g_cd, FILENAME_ANALYZER);
//FIXME: say "no" to special casing!
if (analyzer && strcmp(analyzer, "Kerneloops") != 0)
{
- const char *rating_str = get_problem_item_content_or_NULL(g_cd,
FILENAME_RATING);
+ const char *rating_str = problem_data_get_content_or_NULL(g_cd,
FILENAME_RATING);
//COMPAT, remove after 2.1 release
if (!rating_str)
- rating_str = get_problem_item_content_or_NULL(g_cd, "rating");
+ rating_str = problem_data_get_content_or_NULL(g_cd, "rating");
if (rating_str)
{
@@ -2071,14 +2071,14 @@ static gint select_next_page_no(gint cur
current_page_no = pages[PAGENO_EVENT_PROGRESS].page_no - 1;
goto again;
}
- if (!get_problem_item_content_or_NULL(g_cd, FILENAME_BACKTRACE))
+ if (!problem_data_get_content_or_NULL(g_cd, FILENAME_BACKTRACE))
goto again; /* no backtrace, skip this page */
}
#if 0
if (pages[PAGENO_EDIT_COMMENT].page_widget == page)
{
- if (get_problem_item_content_or_NULL(g_cd, FILENAME_COMMENT))
+ if (problem_data_get_content_or_NULL(g_cd, FILENAME_COMMENT))
goto again; /* no comment, skip this page */
}
#endif
@@ -2206,7 +2206,7 @@ static void save_edited_one_liner(GtkCel
-1);
if (!item_name) /* paranoia, should never happen */
return;
- struct problem_item *item = get_problem_data_item_or_NULL(g_cd, item_name);
+ struct problem_item *item = problem_data_get_item_or_NULL(g_cd, item_name);
if (item && (item->flags & CD_FLAG_ISEDITABLE))
{
struct dump_dir *dd = dd_opendir(g_dump_dir_name, DD_OPEN_READONLY);
@@ -2257,7 +2257,7 @@ static void on_btn_add_file(GtkButton *b
goto show_msgbox;
}
- struct problem_item *item = get_problem_data_item_or_NULL(g_cd, basename);
+ struct problem_item *item = problem_data_get_item_or_NULL(g_cd, basename);
if (!item || (item->flags & CD_FLAG_ISEDITABLE))
{
struct dump_dir *dd = dd_opendir(g_dump_dir_name, DD_OPEN_READONLY);
@@ -2281,7 +2281,7 @@ static void on_btn_add_file(GtkButton *b
}
if (!message)
{
- reload_problem_data_from_dump_dir();
+ problem_data_reload_from_dump_dir();
update_gui_state_from_problem_data();
/* Set flags for the new item */
update_ls_details_checkboxes();
@@ -2326,7 +2326,7 @@ static void delete_item(GtkTreeView *tre
const char *item_name = g_value_get_string(&d_item_name);
if (item_name)
{
- struct problem_item *item = get_problem_data_item_or_NULL(g_cd,
item_name);
+ struct problem_item *item = problem_data_get_item_or_NULL(g_cd,
item_name);
if (item->flags & CD_FLAG_ISEDITABLE)
{
// GtkTreePath *old_path = gtk_tree_model_get_path(store, &iter);
diff -x '*.po' -d -urpN libreport.0/src/gui-wizard-gtk/wizard.h
libreport.1/src/gui-wizard-gtk/wizard.h
--- libreport.0/src/gui-wizard-gtk/wizard.h 2012-07-10 18:07:42.000000000 +0200
+++ libreport.1/src/gui-wizard-gtk/wizard.h 2012-07-12 17:44:30.044635099 +0200
@@ -31,6 +31,6 @@ extern char *g_dump_dir_name;
extern char *g_events;
extern GList *g_auto_event_list;
extern problem_data_t *g_cd;
-void reload_problem_data_from_dump_dir(void);
+void problem_data_reload_from_dump_dir(void);
#endif
diff -x '*.po' -d -urpN libreport.0/src/include/problem_data.h
libreport.1/src/include/problem_data.h
--- libreport.0/src/include/problem_data.h 2012-07-10 18:07:42.000000000 +0200
+++ libreport.1/src/include/problem_data.h 2012-07-12 17:52:31.081475074 +0200
@@ -49,45 +49,46 @@ struct problem_item {
};
typedef struct problem_item problem_item;
-char *format_problem_item(struct problem_item *item);
+char *problem_item_format(struct problem_item *item);
/* In-memory problem data structure and accessors */
typedef GHashTable problem_data_t;
-problem_data_t *new_problem_data(void);
-
-void add_basics_to_problem_data(problem_data_t *pd);
+problem_data_t *problem_data_new(void);
-static inline void free_problem_data(problem_data_t *problem_data)
+static inline void problem_data_free(problem_data_t *problem_data)
{
//TODO: leaks problem item;
if (problem_data)
g_hash_table_destroy(problem_data);
}
-void add_to_problem_data_ext(problem_data_t *problem_data,
+void problem_data_add_basics(problem_data_t *pd);
+
+void problem_data_add(problem_data_t *problem_data,
const char *name,
const char *content,
unsigned flags);
/* Uses CD_FLAG_TXT + CD_FLAG_ISNOTEDITABLE flags */
-void add_to_problem_data(problem_data_t *problem_data,
+void problem_data_add_text_noteditable(problem_data_t *problem_data,
const char *name,
const char *content);
-static inline struct problem_item *get_problem_data_item_or_NULL(problem_data_t
*problem_data, const char *key)
+static inline struct problem_item *problem_data_get_item_or_NULL(problem_data_t
*problem_data, const char *key)
{
return (struct problem_item *)g_hash_table_lookup(problem_data, key);
}
-char *get_problem_item_content_or_NULL(problem_data_t *problem_data, const char *key);
+char *problem_data_get_content_or_NULL(problem_data_t *problem_data, const char *key);
/* Aborts if key is not found: */
-char *get_problem_item_content_or_die(problem_data_t *problem_data, const char *key);
+char *problem_data_get_content_or_die(problem_data_t *problem_data, const char *key);
/* Conversions between in-memory and on-disk formats */
-void load_problem_data_from_dump_dir(problem_data_t *problem_data, struct dump_dir *dd,
char **excluding);
+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);
/* Helper for typical operation in reporters: */
problem_data_t *create_problem_data_for_reporting(const char *dump_dir_name);
diff -x '*.po' -d -urpN libreport.0/src/lib/create_dump_dir.c
libreport.1/src/lib/create_dump_dir.c
--- libreport.0/src/lib/create_dump_dir.c 2012-07-10 18:07:42.000000000 +0200
+++ libreport.1/src/lib/create_dump_dir.c 2012-07-12 17:41:17.524104364 +0200
@@ -93,7 +93,7 @@ struct dump_dir *create_dump_dir_from_pr
LibreportError save_dump_dir_from_problem_data(problem_data_t *problem_data, char
**problem_id, const char *base_dir_name)
{
- char *type = get_problem_item_content_or_NULL(problem_data, FILENAME_TYPE);
+ char *type = problem_data_get_content_or_NULL(problem_data, FILENAME_TYPE);
if(!type)
{
@@ -101,7 +101,7 @@ LibreportError save_dump_dir_from_proble
return LR_MISSING_ITEM;
}
- char *time_s = get_problem_item_content_or_NULL(problem_data, FILENAME_TIME);
+ char *time_s = problem_data_get_content_or_NULL(problem_data, FILENAME_TIME);
if(!time_s)
{
/* 64 is a randomly picked constant which should be
@@ -111,7 +111,7 @@ LibreportError save_dump_dir_from_proble
time_t t = time(NULL);
/* time is a required field, so if it's not provided add a default one */
snprintf(buf, sizeof(buf), "%lu", (long unsigned)t);
- add_to_problem_data_ext(problem_data, FILENAME_TIME, buf, CD_FLAG_TXT);
+ problem_data_add(problem_data, FILENAME_TIME, buf, CD_FLAG_TXT);
}
*problem_id = xasprintf("%s-%s-%lu"NEW_PD_SUFFIX, type,
iso_date_string(NULL), (long)getpid());
diff -x '*.po' -d -urpN libreport.0/src/lib/json.c libreport.1/src/lib/json.c
--- libreport.0/src/lib/json.c 2012-06-25 08:49:05.000000000 +0200
+++ libreport.1/src/lib/json.c 2012-07-12 17:41:28.068078586 +0200
@@ -38,7 +38,7 @@ static int get_pd_int_item(problem_data_
if (!pd || !key)
return 0;
- char *pd_item = get_problem_item_content_or_NULL(pd, key);
+ char *pd_item = problem_data_get_content_or_NULL(pd, key);
if (!pd_item)
{
VERB1 log("warning: '%s' is not an item in problem directory",
key);
@@ -76,7 +76,7 @@ static void ureport_add_str(struct json_
static void ureport_add_os(struct json_object *ur, problem_data_t *pd)
{
- char *pd_item = get_problem_item_content_or_NULL(pd, FILENAME_OS_RELEASE);
+ char *pd_item = problem_data_get_content_or_NULL(pd, FILENAME_OS_RELEASE);
if (!pd_item)
return;
@@ -98,7 +98,7 @@ static void ureport_add_os(struct json_o
static void ureport_add_type(struct json_object *ur, problem_data_t *pd)
{
- char *pd_item = get_problem_item_content_or_NULL(pd, FILENAME_ANALYZER);
+ char *pd_item = problem_data_get_content_or_NULL(pd, FILENAME_ANALYZER);
if (!pd_item)
return;
@@ -112,7 +112,7 @@ static void ureport_add_type(struct json
static void ureport_add_core_backtrace(struct json_object *ur, problem_data_t *pd)
{
- char *pd_item = get_problem_item_content_or_NULL(pd, FILENAME_CORE_BACKTRACE);
+ char *pd_item = problem_data_get_content_or_NULL(pd, FILENAME_CORE_BACKTRACE);
if (!pd_item)
return;
@@ -164,7 +164,7 @@ static void ureport_add_core_backtrace(s
static void ureport_add_item_str(struct json_object *ur, problem_data_t *pd,
const char *key, const char *rename)
{
- char *pd_item = get_problem_item_content_or_NULL(pd, key);
+ char *pd_item = problem_data_get_content_or_NULL(pd, key);
if (!pd_item)
return;
diff -x '*.po' -d -urpN libreport.0/src/lib/make_descr.c
libreport.1/src/lib/make_descr.c
--- libreport.0/src/lib/make_descr.c 2012-06-14 15:38:17.000000000 +0200
+++ libreport.1/src/lib/make_descr.c 2012-07-12 17:41:31.795069477 +0200
@@ -52,7 +52,7 @@ char *make_description(problem_data_t *p
{
struct strbuf *buf_dsc = strbuf_new();
- const char *analyzer = get_problem_item_content_or_NULL(problem_data,
+ const char *analyzer = problem_data_get_content_or_NULL(problem_data,
FILENAME_ANALYZER);
GList *list = g_hash_table_get_keys(problem_data);
@@ -86,7 +86,7 @@ char *make_description(problem_data_t *p
if ((item->flags & CD_FLAG_TXT)
&& strlen(item->content) <= max_text_size
) {
- char *formatted = format_problem_item(item);
+ char *formatted = problem_item_format(item);
char *output = formatted ? formatted : item->content;
char *eol = strchr(output, '\n');
if (!eol)
@@ -191,7 +191,7 @@ char *make_description(problem_data_t *p
&& (strlen(item->content) <= max_text_size
|| (!strcmp(analyzer, "Kerneloops") && !strcmp(key,
FILENAME_BACKTRACE))))
{
- char *formatted = format_problem_item(item);
+ char *formatted = problem_item_format(item);
char *output = make_description_item_multiline(key, formatted ? formatted
: item->content);
if (output)
diff -x '*.po' -d -urpN libreport.0/src/lib/problem_data.c
libreport.1/src/lib/problem_data.c
--- libreport.0/src/lib/problem_data.c 2012-06-14 15:38:52.000000000 +0200
+++ libreport.1/src/lib/problem_data.c 2012-07-12 17:43:10.690828164 +0200
@@ -28,7 +28,7 @@ static void free_problem_item(void *ptr)
}
}
-char *format_problem_item(struct problem_item *item)
+char *problem_item_format(struct problem_item *item)
{
if (!item)
return xstrdup("(nullitem)");
@@ -51,27 +51,27 @@ char *format_problem_item(struct problem
/* problem_data["name"] = { "content", CD_FLAG_foo_bits } */
-problem_data_t *new_problem_data(void)
+problem_data_t *problem_data_new(void)
{
return g_hash_table_new_full(g_str_hash, g_str_equal,
free, free_problem_item);
}
-void add_basics_to_problem_data(problem_data_t *pd)
+void problem_data_add_basics(problem_data_t *pd)
{
- const char *analyzer = get_problem_item_content_or_NULL(pd, FILENAME_ANALYZER);
+ const char *analyzer = problem_data_get_content_or_NULL(pd, FILENAME_ANALYZER);
if (analyzer == NULL)
{
analyzer = "libreport";
- add_to_problem_data(pd, FILENAME_ANALYZER, analyzer);
+ problem_data_add_text_noteditable(pd, FILENAME_ANALYZER, analyzer);
}
- add_to_problem_data(pd, FILENAME_TYPE, analyzer);
+ problem_data_add_text_noteditable(pd, FILENAME_TYPE, analyzer);
/* If application didn't provide dupe hash, we generate it
* from all components, so we at least eliminate the exact same
* reports
*/
- if (get_problem_item_content_or_NULL(pd, FILENAME_DUPHASH) == NULL)
+ if (problem_data_get_content_or_NULL(pd, FILENAME_DUPHASH) == NULL)
{
/* start hash */
sha1_ctx_t sha1ctx;
@@ -105,10 +105,10 @@ void add_basics_to_problem_data(problem_
char hash_str[SHA1_RESULT_LEN*2 + 1];
bin2hex(hash_str, hash_bytes, SHA1_RESULT_LEN)[0] = '\0';
- add_to_problem_data(pd, FILENAME_DUPHASH, hash_str);
+ problem_data_add_text_noteditable(pd, FILENAME_DUPHASH, hash_str);
}
- const char *executable = get_problem_item_content_or_NULL(pd, FILENAME_EXECUTABLE);
+ const char *executable = problem_data_get_content_or_NULL(pd, FILENAME_EXECUTABLE);
if (executable == NULL)
{
char buf[PATH_MAX + 1];
@@ -119,7 +119,7 @@ void add_basics_to_problem_data(problem_
{
buf[read] = '\0';
VERB2 log("reporting initiated from: %s", buf);
- add_to_problem_data(pd, FILENAME_EXECUTABLE, buf);
+ problem_data_add_text_noteditable(pd, FILENAME_EXECUTABLE, buf);
}
//#ifdef WITH_RPM
@@ -128,15 +128,15 @@ void add_basics_to_problem_data(problem_
* or run rpm -qf executable ??
*/
/* Fedora/RHEL rpm specific piece of code */
- const char *component = get_problem_item_content_or_NULL(pd,
FILENAME_COMPONENT);
+ const char *component = problem_data_get_content_or_NULL(pd,
FILENAME_COMPONENT);
//FIXME: this REALLY needs to go away, or every report will be assigned to abrt
if (component == NULL) // application didn't specify component
- add_to_problem_data(pd, FILENAME_COMPONENT, "abrt");
+ problem_data_add_text_noteditable(pd, FILENAME_COMPONENT, "abrt");
//#endif
}
}
-void add_to_problem_data_ext(problem_data_t *problem_data,
+void problem_data_add(problem_data_t *problem_data,
const char *name,
const char *content,
unsigned flags)
@@ -152,24 +152,24 @@ void add_to_problem_data_ext(problem_dat
g_hash_table_replace(problem_data, xstrdup(name), item);
}
-void add_to_problem_data(problem_data_t *problem_data,
+void problem_data_add_text_noteditable(problem_data_t *problem_data,
const char *name,
const char *content)
{
- add_to_problem_data_ext(problem_data, name, content, CD_FLAG_TXT +
CD_FLAG_ISNOTEDITABLE);
+ problem_data_add(problem_data, name, content, CD_FLAG_TXT + CD_FLAG_ISNOTEDITABLE);
}
-char *get_problem_item_content_or_die(problem_data_t *problem_data, const char *key)
+char *problem_data_get_content_or_die(problem_data_t *problem_data, const char *key)
{
- struct problem_item *item = get_problem_data_item_or_NULL(problem_data, key);
+ struct problem_item *item = problem_data_get_item_or_NULL(problem_data, key);
if (!item)
error_msg_and_die(_("Essential element '%s' is missing, can't
continue"), key);
return item->content;
}
-char *get_problem_item_content_or_NULL(problem_data_t *problem_data, const char *key)
+char *problem_data_get_content_or_NULL(problem_data_t *problem_data, const char *key)
{
- struct problem_item *item = get_problem_data_item_or_NULL(problem_data, key);
+ struct problem_item *item = problem_data_get_item_or_NULL(problem_data, key);
if (!item)
return NULL;
return item->content;
@@ -294,7 +294,7 @@ static char* is_text_file(const char *na
return NULL; /* it's binary */
}
-void load_problem_data_from_dump_dir(problem_data_t *problem_data, struct dump_dir *dd,
char **excluding)
+void problem_data_load_from_dump_dir(problem_data_t *problem_data, struct dump_dir *dd,
char **excluding)
{
char *short_name;
char *full_name;
@@ -324,7 +324,7 @@ void load_problem_data_from_dump_dir(pro
text = is_text_file(full_name, &sz);
if (!text)
{
- add_to_problem_data_ext(problem_data,
+ problem_data_add(problem_data,
short_name,
full_name,
CD_FLAG_BIN + CD_FLAG_ISNOTEDITABLE
@@ -383,7 +383,7 @@ void load_problem_data_from_dump_dir(pro
if (strcmp(short_name, FILENAME_TIME) == 0)
flags |= CD_FLAG_UNIXTIME;
- add_to_problem_data_ext(problem_data,
+ problem_data_add(problem_data,
short_name,
content,
flags
@@ -397,8 +397,8 @@ void load_problem_data_from_dump_dir(pro
problem_data_t *create_problem_data_from_dump_dir(struct dump_dir *dd)
{
- problem_data_t *problem_data = new_problem_data();
- load_problem_data_from_dump_dir(problem_data, dd, NULL);
+ problem_data_t *problem_data = problem_data_new();
+ problem_data_load_from_dump_dir(problem_data, dd, NULL);
return problem_data;
}
@@ -448,8 +448,8 @@ problem_data_t *create_problem_data_for_
if (!dd)
return NULL; /* dd_opendir already emitted error msg */
char **exclude_items =
build_exclude_vector(getenv("EXCLUDE_FROM_REPORT"));
- problem_data_t *problem_data = new_problem_data();
- load_problem_data_from_dump_dir(problem_data, dd, exclude_items);
+ problem_data_t *problem_data = problem_data_new();
+ problem_data_load_from_dump_dir(problem_data, dd, exclude_items);
dd_close(dd);
free(exclude_items);
return problem_data;
@@ -474,11 +474,11 @@ void log_problem_data(problem_data_t *pr
gint cmp_problem_data(gconstpointer a, gconstpointer b, gpointer filename)
{
problem_data_t *a_data = *(problem_data_t **) a;
- const char *a_time_str = get_problem_item_content_or_NULL(a_data, filename);
+ const char *a_time_str = problem_data_get_content_or_NULL(a_data, filename);
unsigned long a_time= strtoul(a_time_str, NULL, 10);
problem_data_t *b_data = *(problem_data_t **) b;
- const char *b_time_str = get_problem_item_content_or_NULL(b_data, filename);
+ const char *b_time_str = problem_data_get_content_or_NULL(b_data, filename);
unsigned long b_time= strtoul(b_time_str, NULL, 10);
/* newer first */
diff -x '*.po' -d -urpN libreport.0/src/lib/report.c libreport.1/src/lib/report.c
--- libreport.0/src/lib/report.c 2012-07-10 18:07:42.000000000 +0200
+++ libreport.1/src/lib/report.c 2012-07-12 17:43:15.888815501 +0200
@@ -197,7 +197,7 @@ int report_problem_in_memory(problem_dat
if (dd)
{
if (flags & LIBREPORT_RELOAD_DATA)
- load_problem_data_from_dump_dir(pd, dd, NULL);
+ problem_data_load_from_dump_dir(pd, dd, NULL);
dd_delete(dd);
}
}
diff -x '*.po' -d -urpN libreport.0/src/lib/run_event.c
libreport.1/src/lib/run_event.c
--- libreport.0/src/lib/run_event.c 2012-06-14 15:38:17.000000000 +0200
+++ libreport.1/src/lib/run_event.c 2012-07-12 17:43:06.466838450 +0200
@@ -560,7 +560,7 @@ int run_event_on_problem_data(struct run
free(dir_name);
if (dd)
{
- load_problem_data_from_dump_dir(data, dd, NULL);
+ problem_data_load_from_dump_dir(data, dd, NULL);
dd_delete(dd);
}
diff -x '*.po' -d -urpN libreport.0/src/plugins/reporter-bugzilla.c
libreport.1/src/plugins/reporter-bugzilla.c
--- libreport.0/src/plugins/reporter-bugzilla.c 2012-06-25 08:49:05.000000000 +0200
+++ libreport.1/src/plugins/reporter-bugzilla.c 2012-07-12 17:41:45.216036681 +0200
@@ -264,16 +264,16 @@ int main(int argc, char **argv)
if (!problem_data)
xfunc_die(); /* create_problem_data_for_reporting already emitted error msg */
- const char *component = get_problem_item_content_or_die(problem_data,
FILENAME_COMPONENT);
- const char *duphash = get_problem_item_content_or_NULL(problem_data,
FILENAME_DUPHASH);
+ const char *component = problem_data_get_content_or_die(problem_data,
FILENAME_COMPONENT);
+ const char *duphash = problem_data_get_content_or_NULL(problem_data,
FILENAME_DUPHASH);
//COMPAT, remove after 2.1 release
- if (!duphash) duphash = get_problem_item_content_or_die(problem_data,
"global_uuid");
+ if (!duphash) duphash = problem_data_get_content_or_die(problem_data,
"global_uuid");
if (!rhbz.b_release || !*rhbz.b_release) /* if not overridden or empty... */
{
- rhbz.b_release = get_problem_item_content_or_NULL(problem_data,
FILENAME_OS_RELEASE);
+ rhbz.b_release = problem_data_get_content_or_NULL(problem_data,
FILENAME_OS_RELEASE);
//COMPAT, remove in abrt-2.1
if (!rhbz.b_release)
- rhbz.b_release = get_problem_item_content_or_die(problem_data, "release");
+ rhbz.b_release = problem_data_get_content_or_die(problem_data, "release");
}
log(_("Logging into Bugzilla at %s"), rhbz.b_bugzilla_url);
@@ -284,7 +284,7 @@ int main(int argc, char **argv)
free(version);
char *remote_result;
- remote_result = get_problem_item_content_or_NULL(problem_data,
FILENAME_REMOTE_RESULT);
+ remote_result = problem_data_get_content_or_NULL(problem_data,
FILENAME_REMOTE_RESULT);
if (remote_result)
{
char *cmd = strtok(remote_result, " \n");
@@ -397,12 +397,12 @@ int main(int argc, char **argv)
}
/* Add comment */
- const char *comment = get_problem_item_content_or_NULL(problem_data,
FILENAME_COMMENT);
+ const char *comment = problem_data_get_content_or_NULL(problem_data,
FILENAME_COMMENT);
if (comment && comment[0])
{
- const char *package = get_problem_item_content_or_NULL(problem_data,
FILENAME_PACKAGE);
- const char *arch = get_problem_item_content_or_NULL(problem_data,
FILENAME_ARCHITECTURE);
- const char *rating_str = get_problem_item_content_or_NULL(problem_data,
FILENAME_RATING);
+ const char *package = problem_data_get_content_or_NULL(problem_data,
FILENAME_PACKAGE);
+ const char *arch = problem_data_get_content_or_NULL(problem_data,
FILENAME_ARCHITECTURE);
+ const char *rating_str = problem_data_get_content_or_NULL(problem_data,
FILENAME_RATING);
struct strbuf *full_desc = strbuf_new();
strbuf_append_strf(full_desc, "%s\n\n", comment);
@@ -424,7 +424,7 @@ int main(int argc, char **argv)
/* unused code, enable it when gui/cli will be ready
int is_priv = is_private && string_to_bool(is_private);
- const char *is_private = get_problem_item_content_or_NULL(problem_data,
+ const char *is_private = problem_data_get_content_or_NULL(problem_data,
"is_private");
*/
@@ -449,7 +449,7 @@ int main(int argc, char **argv)
char bug_id_str[sizeof(int)*3 + 2];
snprintf(bug_id_str, sizeof(bug_id_str), "%i", bz->bi_id);
- const char *bt = get_problem_item_content_or_NULL(problem_data,
+ const char *bt = problem_data_get_content_or_NULL(problem_data,
FILENAME_BACKTRACE);
log(_("Attaching better backtrace"));
rhbz_attach_blob(client, FILENAME_BACKTRACE, bug_id_str, bt, strlen(bt),
@@ -480,7 +480,7 @@ int main(int argc, char **argv)
#if 0 /* enable if you search for leaks (valgrind etc) */
free(product);
- free_problem_data(problem_data);
+ problem_data_free(problem_data);
free_bug_info(bz);
abrt_xmlrpc_free_client(client);
free_map_string(settings);
diff -x '*.po' -d -urpN libreport.0/src/plugins/reporter-kerneloops.c
libreport.1/src/plugins/reporter-kerneloops.c
--- libreport.0/src/plugins/reporter-kerneloops.c 2012-06-25 08:49:05.000000000 +0200
+++ libreport.1/src/plugins/reporter-kerneloops.c 2012-07-12 17:41:39.391050913 +0200
@@ -93,7 +93,7 @@ static void report_to_kerneloops(
if (!problem_data)
xfunc_die(); /* create_problem_data_for_reporting already emitted error msg */
- const char *backtrace = get_problem_item_content_or_NULL(problem_data,
FILENAME_BACKTRACE);
+ const char *backtrace = problem_data_get_content_or_NULL(problem_data,
FILENAME_BACKTRACE);
if (!backtrace)
error_msg_and_die("Error sending kernel oops due to missing
backtrace");
@@ -108,7 +108,7 @@ static void report_to_kerneloops(
if (ret != CURLE_OK)
error_msg_and_die("Kernel oops has not been sent due to %s",
curl_easy_strerror(ret));
- free_problem_data(problem_data);
+ problem_data_free(problem_data);
/* Server replies with:
* 200 thank you for submitting the kernel oops information
diff -x '*.po' -d -urpN libreport.0/src/plugins/reporter-mailx.c
libreport.1/src/plugins/reporter-mailx.c
--- libreport.0/src/plugins/reporter-mailx.c 2012-06-14 15:38:17.000000000 +0200
+++ libreport.1/src/plugins/reporter-mailx.c 2012-07-12 16:33:37.560360375 +0200
@@ -118,7 +118,7 @@ static void create_and_send_email(
args -= arg_size;
free(args);
- free_problem_data(problem_data);
+ problem_data_free(problem_data);
if (!notify_only)
{
diff -x '*.po' -d -urpN libreport.0/src/plugins/reporter-print.c
libreport.1/src/plugins/reporter-print.c
--- libreport.0/src/plugins/reporter-print.c 2012-06-14 15:38:17.000000000 +0200
+++ libreport.1/src/plugins/reporter-print.c 2012-07-12 16:33:30.457369442 +0200
@@ -131,7 +131,7 @@ int main(int argc, char **argv)
if (open_mode[0] == 'a')
fputs("\nEND:\n\n", stdout);
free(dsc);
- free_problem_data(problem_data);
+ problem_data_free(problem_data);
if (output_file)
{
diff -x '*.po' -d -urpN libreport.0/src/plugins/reporter-rhtsupport.c
libreport.1/src/plugins/reporter-rhtsupport.c
--- libreport.0/src/plugins/reporter-rhtsupport.c 2012-06-25 08:49:05.000000000 +0200
+++ libreport.1/src/plugins/reporter-rhtsupport.c 2012-07-12 17:41:59.892000836 +0200
@@ -212,12 +212,12 @@ int main(int argc, char **argv)
const char *package;
const char *release;
- release = get_problem_item_content_or_NULL(problem_data, FILENAME_OS_RELEASE);
+ release = problem_data_get_content_or_NULL(problem_data, FILENAME_OS_RELEASE);
if (!release) /* Old dump dir format compat. Remove in abrt-2.1 */
- release = get_problem_item_content_or_NULL(problem_data, "release");
- package = get_problem_item_content_or_NULL(problem_data, FILENAME_PACKAGE);
- reason = get_problem_item_content_or_NULL(problem_data, FILENAME_REASON);
- function = get_problem_item_content_or_NULL(problem_data, FILENAME_CRASH_FUNCTION);
+ release = problem_data_get_content_or_NULL(problem_data, "release");
+ package = problem_data_get_content_or_NULL(problem_data, FILENAME_PACKAGE);
+ reason = problem_data_get_content_or_NULL(problem_data, FILENAME_REASON);
+ function = problem_data_get_content_or_NULL(problem_data, FILENAME_CRASH_FUNCTION);
{
struct strbuf *buf_summary = strbuf_new();
@@ -493,7 +493,7 @@ int main(int argc, char **argv)
free(url);
free(login);
free(password);
- free_problem_data(problem_data);
+ problem_data_free(problem_data);
return 0;
}
diff -x '*.po' -d -urpN libreport.0/src/plugins/rhbz.c
libreport.1/src/plugins/rhbz.c
--- libreport.0/src/plugins/rhbz.c 2012-06-25 08:49:05.000000000 +0200
+++ libreport.1/src/plugins/rhbz.c 2012-07-12 17:41:52.476018946 +0200
@@ -543,7 +543,7 @@ struct bug_info *rhbz_bug_info(struct ab
*/
char *rhbz_get_backtrace_info(problem_data_t *problem_data, size_t max_text_size)
{
- const problem_item *item = get_problem_data_item_or_NULL(problem_data,
+ const problem_item *item = problem_data_get_item_or_NULL(problem_data,
FILENAME_BACKTRACE);
if (!item)
@@ -603,31 +603,31 @@ int rhbz_new_bug(struct abrt_xmlrpc *ax,
if (group)
VERB3 log("# of groups %d", g_list_length(group));
- const char *package = get_problem_item_content_or_NULL(problem_data,
+ const char *package = problem_data_get_content_or_NULL(problem_data,
FILENAME_PACKAGE);
- const char *component = get_problem_item_content_or_NULL(problem_data,
+ const char *component = problem_data_get_content_or_NULL(problem_data,
FILENAME_COMPONENT);
if (!release)
{
- release = get_problem_item_content_or_NULL(problem_data,
+ release = problem_data_get_content_or_NULL(problem_data,
FILENAME_OS_RELEASE);
if (!release) /* Old dump dir format compat. Remove in abrt-2.1 */
- release = get_problem_item_content_or_NULL(problem_data,
"release");
+ release = problem_data_get_content_or_NULL(problem_data,
"release");
}
- const char *arch = get_problem_item_content_or_NULL(problem_data,
+ const char *arch = problem_data_get_content_or_NULL(problem_data,
FILENAME_ARCHITECTURE);
- const char *duphash = get_problem_item_content_or_NULL(problem_data,
+ const char *duphash = problem_data_get_content_or_NULL(problem_data,
FILENAME_DUPHASH);
//COMPAT, remove after 2.1 release
- if (!duphash) duphash = get_problem_item_content_or_NULL(problem_data,
+ if (!duphash) duphash = problem_data_get_content_or_NULL(problem_data,
"global_uuid");
- const char *reason = get_problem_item_content_or_NULL(problem_data,
+ const char *reason = problem_data_get_content_or_NULL(problem_data,
FILENAME_REASON);
- const char *function = get_problem_item_content_or_NULL(problem_data,
+ const char *function = problem_data_get_content_or_NULL(problem_data,
FILENAME_CRASH_FUNCTION);
- const char *analyzer = get_problem_item_content_or_NULL(problem_data,
+ const char *analyzer = problem_data_get_content_or_NULL(problem_data,
FILENAME_ANALYZER);
- const char *tainted_short = get_problem_item_content_or_NULL(problem_data,
+ const char *tainted_short = problem_data_get_content_or_NULL(problem_data,
FILENAME_TAINTED_SHORT);
struct strbuf *buf_summary = strbuf_new();
@@ -665,7 +665,7 @@ int rhbz_new_bug(struct abrt_xmlrpc *ax,
}
else
{
- const char *comment = get_problem_item_content_or_NULL(problem_data,
+ const char *comment = problem_data_get_content_or_NULL(problem_data,
FILENAME_COMMENT);
char *bz_dsc = make_description(problem_data, (char**)g_additional_info_files,
@@ -833,7 +833,7 @@ int rhbz_attach_files(struct abrt_xmlrpc
{
func_entry();
- const char *analyzer = get_problem_item_content_or_NULL(problem_data,
+ const char *analyzer = problem_data_get_content_or_NULL(problem_data,
FILENAME_ANALYZER);
/* Do not attach anything if analyzer is Kerneloops */
if (!strcmp(analyzer, "Kerneloops"))
diff -x '*.po' -d -urpN libreport.0/src/plugins/ureport.c
libreport.1/src/plugins/ureport.c
--- libreport.0/src/plugins/ureport.c 2012-06-25 08:49:05.000000000 +0200
+++ libreport.1/src/plugins/ureport.c 2012-07-12 16:33:24.008377666 +0200
@@ -125,7 +125,7 @@ int main(int argc, char **argv)
post_state_t *post_state = NULL;
post_state = post_ureport(pd, &config);
- free_problem_data(pd);
+ problem_data_free(pd);
if (post_state->http_resp_code != 200)
{
diff -x '*.po' -d -urpN libreport.0/src/report-python/problem_data.c
libreport.1/src/report-python/problem_data.c
--- libreport.0/src/report-python/problem_data.c 2012-06-14 15:38:17.000000000 +0200
+++ libreport.1/src/report-python/problem_data.c 2012-07-12 17:40:10.740267859 +0200
@@ -26,7 +26,7 @@ static void
p_problem_data_dealloc(PyObject *pself)
{
p_problem_data *self = (p_problem_data*)pself;
- free_problem_data(self->cd);
+ problem_data_free(self->cd);
self->cd = NULL;
self->ob_type->tp_free(pself);
}
@@ -36,7 +36,7 @@ p_problem_data_new(PyTypeObject *type, P
{
p_problem_data *self = (p_problem_data *)type->tp_alloc(type, 0);
if (self)
- self->cd = new_problem_data();
+ self->cd = problem_data_new();
return (PyObject *)self;
}
@@ -47,7 +47,7 @@ p_problem_data_new(PyTypeObject *type, P
//}
/*
-void add_to_problem_data_ext(problem_data_t *problem_data,
+void problem_data_add(problem_data_t *problem_data,
const char *name,
const char *content,
unsigned flags);
@@ -66,14 +66,14 @@ static PyObject *p_problem_data_add(PyOb
*/
return NULL;
}
- add_to_problem_data_ext(self->cd, name, content, flags);
+ problem_data_add(self->cd, name, content, flags);
/* every function returns PyObject, to return void we need to do this */
Py_RETURN_NONE;
}
-/* struct problem_item *get_problem_data_item_or_NULL(problem_data_t *problem_data, const
char *key); */
-static PyObject *p_get_problem_data_item(PyObject *pself, PyObject *args)
+/* struct problem_item *problem_data_get_item_or_NULL(problem_data_t *problem_data, const
char *key); */
+static PyObject *p_problem_data_get_item(PyObject *pself, PyObject *args)
{
p_problem_data *self = (p_problem_data*)pself;
const char *key;
@@ -81,7 +81,7 @@ static PyObject *p_get_problem_data_item
{
return NULL;
}
- struct problem_item *ci = get_problem_data_item_or_NULL(self->cd, key);
+ struct problem_item *ci = problem_data_get_item_or_NULL(self->cd, key);
if (ci == NULL)
{
Py_RETURN_NONE;
@@ -112,10 +112,10 @@ static PyObject *p_create_dump_dir_from_
return (PyObject*)new_dd;
}
-static PyObject *p_add_basics_to_problem_data(PyObject *pself, PyObject *always_null)
+static PyObject *p_problem_data_add_basics(PyObject *pself, PyObject *always_null)
{
p_problem_data *self = (p_problem_data*)pself;
- add_basics_to_problem_data(self->cd);
+ problem_data_add_basics(self->cd);
Py_RETURN_NONE;
}
@@ -128,9 +128,9 @@ static PyObject *p_add_basics_to_problem
static PyMethodDef p_problem_data_methods[] = {
/* method_name, func, flags, doc_string */
{ "add" , p_problem_data_add , METH_VARARGS },
- { "get" , p_get_problem_data_item , METH_VARARGS },
+ { "get" , p_problem_data_get_item , METH_VARARGS },
{ "create_dump_dir", p_create_dump_dir_from_problem_data, METH_VARARGS },
- { "add_basics", p_add_basics_to_problem_data, METH_NOARGS },
+ { "add_basics", p_problem_data_add_basics, METH_NOARGS },
{ NULL }
};