From 7ca9930ec1fc0aef059a2d8e81f7db6b3c1085ce Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Fri, 26 Nov 2010 13:21:07 +0100 Subject: reorganize libraries This patch does not change any code per se, it renames libABRTfoo -> libabrt_bar and moves a few functions around. After the patch, we are left with the following libs: libabrt - the stuff shared among most of abrt (like xmalloc, logging) libabrt_daemon - only daemon-related things are here (should probably be just moved into daemon - later) libabrt_dbus - daemon, cli and applet use this libabrt_web - abrt-action-foo where foo deals with network/web/ftp/... As a result, we have following reductions in dependent libs: /usr/libexec/abrt-hook-ccpp: linux-vdso.so.1 => () - libABRTUtils.so.0 => /usr/lib64/libABRTUtils.so.0 () + libabrt.so.0 => /usr/lib64/libabrt.so.0 () libglib-2.0.so.0 => /lib64/libglib-2.0.so.0 () - libdbus-1.so.3 => /lib64/libdbus-1.so.3 () - libpthread.so.0 => /lib64/libpthread.so.0 () - librt.so.1 => /lib64/librt.so.1 () - libdl.so.2 => /lib64/libdl.so.2 () /usr/libexec/abrt-action-upload: linux-vdso.so.1 => () libtar.so.1 => /usr/lib64/libtar.so.1 () libcurl.so.4 => /usr/lib64/libcurl.so.4 () - libABRTdUtils.so.0 => /usr/lib64/libABRTdUtils.so.0 () - libABRTUtils.so.0 => /usr/lib64/libABRTUtils.so.0 () + libabrt.so.0 => /usr/lib64/libabrt.so.0 () libglib-2.0.so.0 => /lib64/libglib-2.0.so.0 () - libdbus-1.so.3 => /lib64/libdbus-1.so.3 () Similar savings are in almost every abrt-action-foo. Signed-off-by: Denys Vlasenko --- src/lib/Plugin.cpp | 75 ------------------------------------------------------ 1 file changed, 75 deletions(-) (limited to 'src/lib/Plugin.cpp') diff --git a/src/lib/Plugin.cpp b/src/lib/Plugin.cpp index bf237959..0c2137f5 100644 --- a/src/lib/Plugin.cpp +++ b/src/lib/Plugin.cpp @@ -39,78 +39,3 @@ void CPlugin::SetSettings(const map_plugin_settings_t& pSettings) } } } - -bool LoadPluginSettings(const char *pPath, map_plugin_settings_t& pSettings, - bool skipKeysWithoutValue /*= true*/) -{ - FILE *fp = stdin; - if (strcmp(pPath, "-") != 0) - { - fp = fopen(pPath, "r"); - if (!fp) - return false; - } - - char *line; - while ((line = xmalloc_fgetline(fp)) != NULL) - { - unsigned ii; - bool is_value = false; - bool valid = false; - bool in_quote = false; - std::string key; - std::string value; - for (ii = 0; line[ii] != '\0'; ii++) - { - if (line[ii] == '"') - { - in_quote = !in_quote; - } - if (isspace(line[ii]) && !in_quote) - { - continue; - } - if (line[ii] == '#' && !in_quote && key == "") - { - break; - } - if (line[ii] == '=' && !in_quote) - { - is_value = true; - valid = true; - continue; - } - if (!is_value) - { - key += line[ii]; - } - else - { - value += line[ii]; - } - } - - /* Skip broken or empty lines. */ - if (!valid) - goto free_line; - - /* Skip lines with empty key. */ - if (key.length() == 0) - goto free_line; - - if (skipKeysWithoutValue && value.length() == 0) - goto free_line; - - /* Skip lines with unclosed quotes. */ - if (in_quote) - goto free_line; - - pSettings[key] = value; - free_line: - free(line); - } - - if (fp != stdin) - fclose(fp); - return true; -} -- cgit