summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authornpmccallum <npmccallum@c587cffe-e639-0410-9787-d7902ae8ed56>2010-01-17 00:49:40 +0000
committernpmccallum <npmccallum@c587cffe-e639-0410-9787-d7902ae8ed56>2010-01-17 00:49:40 +0000
commiteb677dcd774a460da9349cc3622c5e14317645bd (patch)
tree75881e126bd950a8d1654490a0bf959fd85492c2 /utils
parentfc72a9f5414d7498c78dc7b6a1382cd0631cbf49 (diff)
downloadlibproxy-eb677dcd774a460da9349cc3622c5e14317645bd.tar.gz
make code more c++ish (major rework)
git-svn-id: http://libproxy.googlecode.com/svn/trunk@457 c587cffe-e639-0410-9787-d7902ae8ed56
Diffstat (limited to 'utils')
-rw-r--r--utils/CMakeLists.txt5
-rw-r--r--utils/iniparse.c23
2 files changed, 1 insertions, 27 deletions
diff --git a/utils/CMakeLists.txt b/utils/CMakeLists.txt
index 4f27eb7..eebe337 100644
--- a/utils/CMakeLists.txt
+++ b/utils/CMakeLists.txt
@@ -5,8 +5,5 @@ add_executable(proxy proxy.c)
target_link_libraries(proxy libproxy)
install(TARGETS proxy RUNTIME DESTINATION ${rbindir})
-add_executable(iniparse iniparse.c)
-target_link_libraries(iniparse libproxy)
-
-set_target_properties(proxy iniparse PROPERTIES COMPILE_FLAGS "-g -std=c99")
+set_target_properties(proxy PROPERTIES COMPILE_FLAGS "-g -std=c99")
diff --git a/utils/iniparse.c b/utils/iniparse.c
deleted file mode 100644
index 211f835..0000000
--- a/utils/iniparse.c
+++ /dev/null
@@ -1,23 +0,0 @@
-#include <stdio.h>
-
-#include "../libproxy/strdict.h"
-#include "../libproxy/config_file.h"
-
-int main(int argc, char **argv) {
- if (argc != 4) {
- printf("You started with %d parameters.\n", argc);
- printf("Wrong invocation. Start with 3 parameters:\n");
- printf("1. path to config file\n2. Section name in conf file.\n3. Keyname to read.\n");
- printf("iniparse will return \"key = value\" if found\n.");
- return 2;
- }
- pxConfigFile* cf = px_config_file_new(argv[1]);
- if (!cf) {
- printf("Could not find conf file.\n.");
- return 1;
- }
- char* val1 = px_config_file_get_value(cf, argv[2], argv[3]);
- printf("%s = %s", argv[3] == NULL ? "NULL" : argv[3], val1 == NULL ? "NULL" : val1);
- px_config_file_free(cf);
- return 0;
-}