projects
/
collection4.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
src/graph.[ch]: Implement "graph_search_inst".
[collection4.git]
/
src
/
graph_list.c
diff --git
a/src/graph_list.c
b/src/graph_list.c
index
60ac94f
..
cf0ca4a
100644
(file)
--- a/
src/graph_list.c
+++ b/
src/graph_list.c
@@
-158,7
+158,7
@@
static int gl_clear_hosts (void) /* {{{ */
static int gl_compare_hosts (const void *v0, const void *v1) /* {{{ */
{
static int gl_compare_hosts (const void *v0, const void *v1) /* {{{ */
{
- return (strcmp (
v0,
v1));
+ return (strcmp (
*(char * const *) v0, *(char * const *)
v1));
} /* }}} int gl_compare_hosts */
static int gl_register_file (const graph_ident_t *file, /* {{{ */
} /* }}} int gl_compare_hosts */
static int gl_register_file (const graph_ident_t *file, /* {{{ */
@@
-173,7
+173,7
@@
static int gl_register_file (const graph_ident_t *file, /* {{{ */
graph_config_t *cfg = gl_active[i];
int status;
graph_config_t *cfg = gl_active[i];
int status;
- if (!graph_
matches_ident
(cfg, file))
+ if (!graph_
ident_matches
(cfg, file))
continue;
status = graph_add_file (cfg, file);
continue;
status = graph_add_file (cfg, file);
@@
-381,7
+381,7
@@
int gl_instance_get_all (graph_inst_callback_t callback, /* {{{ */
} /* }}} int gl_instance_get_all */
/* }}} gl_instance_get_all, gl_graph_instance_get_all */
} /* }}} int gl_instance_get_all */
/* }}} gl_instance_get_all, gl_graph_instance_get_all */
-int gl_search (const char *term, graph_inst_callback_t callback, /* {{{ */
+int gl_search
_string
(const char *term, graph_inst_callback_t callback, /* {{{ */
void *user_data)
{
size_t i;
void *user_data)
{
size_t i;
@@
-390,7
+390,7
@@
int gl_search (const char *term, graph_inst_callback_t callback, /* {{{ */
{
int status;
{
int status;
- status = graph_
inst_search
(gl_active[i], term,
+ status = graph_
search_inst_string
(gl_active[i], term,
/* callback = */ callback,
/* user data = */ user_data);
if (status != 0)
/* callback = */ callback,
/* user data = */ user_data);
if (status != 0)
@@
-401,7
+401,7
@@
int gl_search (const char *term, graph_inst_callback_t callback, /* {{{ */
{
int status;
{
int status;
- status = graph_
inst_search
(gl_dynamic[i], term,
+ status = graph_
search_inst_string
(gl_dynamic[i], term,
/* callback = */ callback,
/* user data = */ user_data);
if (status != 0)
/* callback = */ callback,
/* user data = */ user_data);
if (status != 0)
@@
-409,7
+409,7
@@
int gl_search (const char *term, graph_inst_callback_t callback, /* {{{ */
}
return (0);
}
return (0);
-} /* }}} int gl_search */
+} /* }}} int gl_search
_string
*/
int gl_search_field (graph_ident_field_t field, /* {{{ */
const char *field_value,
int gl_search_field (graph_ident_field_t field, /* {{{ */
const char *field_value,
@@
-467,6
+467,7
@@
int gl_update (void) /* {{{ */
{
time_t now;
int status;
{
time_t now;
int status;
+ size_t i;
/*
printf ("Content-Type: text/plain\n\n");
/*
printf ("Content-Type: text/plain\n\n");
@@
-492,6
+493,9
@@
int gl_update (void) /* {{{ */
gl_last_update = now;
gl_last_update = now;
+ for (i = 0; i < gl_active_num; i++)
+ graph_sort_instances (gl_active[i]);
+
return (status);
} /* }}} int gl_update */
return (status);
} /* }}} int gl_update */