On 07/12/2012 06:50 PM, Denys Vlasenko wrote:
On 07/12/2012 06:25 PM, Denys Vlasenko wrote:
On 07/12/2012 06:24 PM, Denys Vlasenko wrote:
Please review this and the following patch.
It only renames functions in libreport, nothing else.
(Second patch does the same for arbt code).
problem_data_t *problem_data_new()
{
- return new_problem_data();
+ return problem_data_new();
}
Ahahahaha :D
This changes breaks my testing program (attached).
$ gcc `pkg-config abrt --cflags --libs` abrt-problem.c
problem.c
/tmp/ccO1Lv5J.o: In function `main':
abrt-problem.c:(.text+0x33): undefined reference to `problem_data_add_item'
abrt-problem.c:(.text+0x52): undefined reference to `problem_data_add_item'
abrt-problem.c:(.text+0x71): undefined reference to `problem_data_add_item'
abrt-problem.c:(.text+0x90): undefined reference to `problem_data_add_item'
abrt-problem.c:(.text+0xaf): undefined reference to `problem_data_add_item'
abrt-problem.c:(.text+0x11b): undefined reference to `problem_data_destroy'
collect2: error: ld returned 1 exit status
--Jirka
#include <libabrt.h>
#include <stdio.h>
int main(int argc, char **argv)
{
problem_data_t *pd = problem_data_new();
problem_data_add_item(pd, "aaa", "bar");
problem_data_add_item(pd, "type", "test");
problem_data_add_item(pd, "analyzer", "test");
problem_data_add_item(pd, "uid", "0");
problem_data_add_item(pd, "executable", "/usr/bin/gnome-terminal");
problem_data_add_file(pd, "foobar", "/tmp/foo");
char *problem_id = NULL;
LibreportError err = problem_data_save(pd, &problem_id);
if (err != LR_OK) {
printf("Error: '%i'\n", err);
return 1;
}
problem_data_destroy(pd);
printf("'%s'\n", problem_id);
return 0;
}