summaryrefslogtreecommitdiffstats
path: root/src/Daemon/PluginManager.cpp
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2010-02-07 23:08:53 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2010-02-07 23:08:53 +0100
commiteafe336a8e5580bbd76546970351956810f01d8f (patch)
tree131b770ca194f2d840208ae9e52ee650b12e75e0 /src/Daemon/PluginManager.cpp
parent5ddcae3c61341e655e98470ceb26dda91b013704 (diff)
downloadabrt-eafe336a8e5580bbd76546970351956810f01d8f.tar.gz
abrt-eafe336a8e5580bbd76546970351956810f01d8f.tar.xz
abrt-eafe336a8e5580bbd76546970351956810f01d8f.zip
*: remove all usages of C++ streams (-10k in code size)
Also add copyright banners to all files which were missing them Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'src/Daemon/PluginManager.cpp')
-rw-r--r--src/Daemon/PluginManager.cpp23
1 files changed, 9 insertions, 14 deletions
diff --git a/src/Daemon/PluginManager.cpp b/src/Daemon/PluginManager.cpp
index 5166c6a4..e63cb3ac 100644
--- a/src/Daemon/PluginManager.cpp
+++ b/src/Daemon/PluginManager.cpp
@@ -17,10 +17,7 @@
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 <fstream>
-#include <iostream>
+*/
#include <dlfcn.h>
#include "abrtlib.h"
#include "ABRTException.h"
@@ -85,23 +82,21 @@ static const char *const plugin_type_str[] = {
bool LoadPluginSettings(const char *pPath, map_plugin_settings_t& pSettings)
{
- ifstream fIn;
- fIn.open(pPath);
- if (!fIn.is_open())
+ FILE *fp = fopen(pPath, "r");
+ if (!fp)
return false;
- string line;
- while (!fIn.eof())
+ char line[512];
+ while (fgets(line, sizeof(line), fp))
{
- getline(fIn, line);
-
- int ii;
+ strchrnul(line, '\n')[0] = '\0';
+ unsigned ii;
bool is_value = false;
bool valid = false;
bool in_quote = false;
string key;
string value;
- for (ii = 0; ii < line.length(); ii++)
+ for (ii = 0; line[ii] != '\0'; ii++)
{
if (line[ii] == '"')
{
@@ -135,7 +130,7 @@ bool LoadPluginSettings(const char *pPath, map_plugin_settings_t& pSettings)
pSettings[key] = value;
}
}
- fIn.close();
+ fclose(fp);
return true;
}