[Initng-svn] r3828 - initng/trunk/plugins/iparser
svn at initng.thinktux.net
svn at initng.thinktux.net
Tue Apr 18 13:22:40 CEST 2006
Author: jimmy
Date: Tue Apr 18 13:22:39 2006
New Revision: 3828
Modified:
initng/trunk/plugins/iparser/initng_i_parser.c
Log:
Some reorganization.
Modified: initng/trunk/plugins/iparser/initng_i_parser.c
==============================================================================
--- initng/trunk/plugins/iparser/initng_i_parser.c (original)
+++ initng/trunk/plugins/iparser/initng_i_parser.c Tue Apr 18 13:22:39 2006
@@ -148,6 +148,7 @@
const char *service = NULL;
assert(service_to_find);
+ D_("Parsing for %s\n", service_to_find);
/* Make sure the filename of 200 chars above are more than enough */
if (strlen(service_to_find) > 50)
@@ -292,7 +293,7 @@
/* set the error message filename */
g_filename = filename;
- D_("parse_file(%s);\n", filename);
+ D_("parse_file(%s) for: %s\n", filename, watch_for);
/* read config file */
if (!open_read_close(filename, &file_content))
@@ -348,6 +349,7 @@
if (parse_service_line(&file, watch_for, NULL, stype,
filename, &match, &exact_match) == TRUE)
{
+ D_("parse_service_line(%s, %s)\n", match ? match->name : NULL, exact_match ? exact_match->name : NULL);
/* if we found RIGHT what we wanted */
if (exact_match)
{
@@ -500,55 +502,6 @@
(*to_parse)++;
JUMP_NSPACES(*to_parse);
- if (initng_service_cache_find_by_exact_name(name))
- {
- D_("service %s already parsed, skipping to the end of stack\n", name);
- int stack = 1;
- int quoted = FALSE;
- int backslashed = FALSE;
-
- while ((*to_parse)[0])
- {
- if (backslashed == FALSE)
- {
- if ((*to_parse)[0] == '\\')
- backslashed = TRUE;
- else if ((*to_parse)[0] == '"' || (*to_parse)[0] == '\'')
- {
- if (quoted == FALSE)
- quoted = (*to_parse)[0];
- else if (quoted == (*to_parse)[0])
- quoted = FALSE;
- }
- else if (quoted == FALSE)
- {
- if ((*to_parse)[0] == '{')
- stack++;
- else if ((*to_parse)[0] == '}')
- stack--;
- else if ((*to_parse)[0] == '#')
- {
- REALLY_JUMP_TO_NEXT_ROW(*to_parse);
- continue;
- }
- }
- }
- else
- backslashed = FALSE;
-
- if (stack == 0)
- break;
-
- (*to_parse)++;
- }
-
- free(name);
- if (father_name)
- free(father_name);
-
- return (TRUE);
- }
-
DL_(*to_parse, "Parse opt, should be first char in stack");
@@ -650,6 +603,7 @@
/* if not watching for anything special */
if(!watch_for)
{
+ D_("Nothing to wait for\n");
return (FALSE);
}
@@ -664,7 +618,7 @@
/* check if this is the service we are looking for. */
if (service_match(watch_for, new_service->name) == TRUE)
{
- D_("Found :%s\n", new_service->name);
+ D_("MATCH Found :%s\n", new_service->name);
/* Just explanation - will erase later (TheLich):
* don't keep services with wildcards in service_cache
@@ -692,6 +646,7 @@
initng_service_cache_free(new_service);
#endif
+ D_(" returning true, no match or exact match\n");
/* return null if not */
return (TRUE);
}
More information about the Initng-svn
mailing list