diff options
author | Nikola Pajkovsky <npajkovs@redhat.com> | 2010-09-07 18:12:17 +0200 |
---|---|---|
committer | Nikola Pajkovsky <npajkovs@redhat.com> | 2010-09-08 15:53:29 +0200 |
commit | a0b7850b3ac3a89e2bb02a214039c777d244ef22 (patch) | |
tree | 406d4cddd94e4d6ec6d282907fc6bc3bf3c97a4d /lib/utils | |
parent | 890e78b99a136533fa5bab788ce0f6b9a9f2b47c (diff) | |
download | abrt-a0b7850b3ac3a89e2bb02a214039c777d244ef22.tar.gz abrt-a0b7850b3ac3a89e2bb02a214039c777d244ef22.tar.xz abrt-a0b7850b3ac3a89e2bb02a214039c777d244ef22.zip |
SQLite3.cpp: replace std::vector by GList
Signed-off-by: Nikola Pajkovsky <npajkovs@redhat.com>
Acked-off-by: Denys Vlasenko <dvlasenk@redhat.com>
Diffstat (limited to 'lib/utils')
-rw-r--r-- | lib/utils/Makefile.am | 3 | ||||
-rw-r--r-- | lib/utils/database.c | 52 |
2 files changed, 54 insertions, 1 deletions
diff --git a/lib/utils/Makefile.am b/lib/utils/Makefile.am index cc77c823..15fd03e1 100644 --- a/lib/utils/Makefile.am +++ b/lib/utils/Makefile.am @@ -31,7 +31,8 @@ libABRTUtils_la_SOURCES = \ backtrace_parser.y \ strbuf.c strbuf.h \ abrt_packages.c abrt_packages.h \ - hooklib.c hooklib.h + hooklib.c hooklib.h \ + database.c libABRTUtils_la_CPPFLAGS = \ -Wall -Werror \ -I$(srcdir)/../../inc \ diff --git a/lib/utils/database.c b/lib/utils/database.c new file mode 100644 index 00000000..f572a5ba --- /dev/null +++ b/lib/utils/database.c @@ -0,0 +1,52 @@ +/* + Copyright (C) 2010 ABRT team + Copyright (C) 2010 RedHat Inc + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +*/ + +#include "abrtlib.h" +#include "database.h" + +void db_row_free(struct db_row *row) +{ + if (!row) + return; + + free(row->db_uuid); + free(row->db_uid); + free(row->db_inform_all); + free(row->db_dump_dir); + free(row->db_count); + free(row->db_reported); + free(row->db_message); + free(row->db_time); + + free(row); +} + +void db_list_free(GList *list) +{ + if (!list) + return; + + for (GList *li = list; li != NULL; li = g_list_next(li)) + { + struct db_row *row = (struct db_row*)li->data; + db_row_free(row); + } + g_list_free(list); +} + |