diff options
author | Nikola Pajkovsky <npajkovs@redhat.com> | 2010-08-05 13:23:51 +0200 |
---|---|---|
committer | Nikola Pajkovsky <npajkovs@redhat.com> | 2010-08-10 09:56:37 +0200 |
commit | e84ab7783d05eb7b5f1b55ab44e7c23c85e50516 (patch) | |
tree | 7656e60b9ce0c6cb51d3464369a519709ea8ed5c /lib/Utils | |
parent | f926010c0f67582bcb37d1221cfe09743248b148 (diff) | |
download | abrt-e84ab7783d05eb7b5f1b55ab44e7c23c85e50516.tar.gz abrt-e84ab7783d05eb7b5f1b55ab44e7c23c85e50516.tar.xz abrt-e84ab7783d05eb7b5f1b55ab44e7c23c85e50516.zip |
rename RPM.cpp -> rpm.c
Signed-off-by: Nikola Pajkovsky <npajkovs@redhat.com>
Diffstat (limited to 'lib/Utils')
-rw-r--r-- | lib/Utils/Makefile.am | 2 | ||||
-rw-r--r-- | lib/Utils/abrt_packages.c | 44 | ||||
-rw-r--r-- | lib/Utils/abrt_packages.cpp | 26 | ||||
-rw-r--r-- | lib/Utils/abrt_packages.h | 35 |
4 files changed, 80 insertions, 27 deletions
diff --git a/lib/Utils/Makefile.am b/lib/Utils/Makefile.am index 88aab4d2..04211a7c 100644 --- a/lib/Utils/Makefile.am +++ b/lib/Utils/Makefile.am @@ -28,7 +28,7 @@ libABRTUtils_la_SOURCES = \ backtrace.h backtrace.c \ backtrace_parser.y \ strbuf.h strbuf.c \ - abrt_packages.cpp \ + abrt_packages.c abrt_packages.h \ hooklib.h hooklib.cpp libABRTUtils_la_CPPFLAGS = \ -Wall -Werror \ diff --git a/lib/Utils/abrt_packages.c b/lib/Utils/abrt_packages.c new file mode 100644 index 00000000..d9ffe44a --- /dev/null +++ b/lib/Utils/abrt_packages.c @@ -0,0 +1,44 @@ +/* + 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 "abrt_packages.h" + +/* cuts the name from the NVR format: foo-1.2.3-1.el6 + returns a newly allocated string +*/ +char* get_package_name_from_NVR_or_NULL(const char* packageNVR) +{ + char* package_name = NULL; + if (packageNVR != NULL) + { + VERB1 log("packageNVR %s", packageNVR); + package_name = xstrdup(packageNVR); + char *pos = strrchr(package_name, '-'); + if (pos != NULL) + { + *pos = 0; + pos = strrchr(package_name, '-'); + if (pos != NULL) + { + *pos = 0; + } + } + } + return package_name; +} diff --git a/lib/Utils/abrt_packages.cpp b/lib/Utils/abrt_packages.cpp deleted file mode 100644 index 4cb87244..00000000 --- a/lib/Utils/abrt_packages.cpp +++ /dev/null @@ -1,26 +0,0 @@ -#include "abrtlib.h" - - -/* cuts the name from the NVR format: foo-1.2.3-1.el6 - returns a newly allocated string -*/ -char* get_package_name_from_NVR_or_NULL(const char* packageNVR) -{ - char* package_name = NULL; - if (packageNVR != NULL) - { - VERB1 log("packageNVR %s", packageNVR); - package_name = xstrdup(packageNVR); - char *pos = strrchr(package_name, '-'); - if (pos != NULL) - { - *pos = 0; - pos = strrchr(package_name, '-'); - if (pos != NULL) - { - *pos = 0; - } - } - } - return package_name; -} diff --git a/lib/Utils/abrt_packages.h b/lib/Utils/abrt_packages.h new file mode 100644 index 00000000..e6209d81 --- /dev/null +++ b/lib/Utils/abrt_packages.h @@ -0,0 +1,35 @@ +/* + 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. +*/ + +#ifndef ABRT_PACKAGES_H +#define ABRT_PACKAGES_H + +#include "xfuncs.h" + +#ifdef __cplusplus +extern "C" { +#endif + +char* get_package_name_from_NVR_or_NULL(const char* packageNVR); + +#ifdef __cplusplus +} +#endif + +#endif |