aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPetr Machata <pmachata@redhat.com>2012-11-23 20:43:15 +0100
committerPetr Machata <pmachata@redhat.com>2013-03-08 22:55:25 +0100
commit9117dab63337a8cb91741b5f170e8f2dab1e89b8 (patch)
tree3309af5ccdb7ef9e7fe2f3a301120ce959002a70
parentebc56a70e20ca0b3fc49c0eb5fc83e56c5e1fa5b (diff)
downloadltrace-9117dab63337a8cb91741b5f170e8f2dab1e89b8.tar.gz
Move some code around
-rw-r--r--read_config_file.c44
1 files changed, 22 insertions, 22 deletions
diff --git a/read_config_file.c b/read_config_file.c
index 52d23ea..1c1571a 100644
--- a/read_config_file.c
+++ b/read_config_file.c
@@ -1256,6 +1256,28 @@ process_line(char *buf, struct protolib *plib)
}
void
+read_config_file(char *file)
+{
+ FILE *stream;
+
+ filename = file;
+ stream = fopen(filename, "r");
+ if (!stream) {
+ return;
+ }
+
+ debug(1, "Reading config file `%s'...", filename);
+
+ line_no = 0;
+ char *line = NULL;
+ size_t len = 0;
+ while (getline(&line, &len, stream) >= 0)
+ process_line(line, &g_prototypes);
+ free(line);
+ fclose(stream);
+}
+
+void
init_global_config(void)
{
protolib_init(&g_prototypes);
@@ -1281,25 +1303,3 @@ destroy_global_config(void)
{
protolib_destroy(&g_prototypes);
}
-
-void
-read_config_file(char *file)
-{
- FILE *stream;
-
- filename = file;
- stream = fopen(filename, "r");
- if (!stream) {
- return;
- }
-
- debug(1, "Reading config file `%s'...", filename);
-
- line_no = 0;
- char *line = NULL;
- size_t len = 0;
- while (getline(&line, &len, stream) >= 0)
- process_line(line, &g_prototypes);
- free(line);
- fclose(stream);
-}