projects
/
lttv.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
filter core:
[lttv.git]
/
ltt
/
branches
/
poly
/
lttv
/
modules
/
text
/
textFilter.c
diff --git
a/ltt/branches/poly/lttv/modules/text/textFilter.c
b/ltt/branches/poly/lttv/modules/text/textFilter.c
index 5729634e2e9a7de705ec325cbb637503d47c9d1f..83895e9263900f5adabcedd40ff6d3b20e4c8a5c 100644
(file)
--- a/
ltt/branches/poly/lttv/modules/text/textFilter.c
+++ b/
ltt/branches/poly/lttv/modules/text/textFilter.c
@@
-44,11
+44,16
@@
* - why does this module need dependency with batchAnalysis ?
*/
* - why does this module need dependency with batchAnalysis ?
*/
+/*
+ * TODO
+ * - specify wich hook function will be used to call the core filter
+ */
+
static char
*a_file_name = NULL,
*a_string = NULL;
static char
*a_file_name = NULL,
*a_string = NULL;
-
static
GString
+GString
*a_filter_string = NULL;
*a_filter_string = NULL;
@@
-79,15
+84,20
@@
void filter_analyze_file(void *hook_data) {
return;
}
return;
}
- char*
tmp
;
-
fscanf(a_file,"%s",tmp)
;
+ char*
line = NULL
;
+
size_t len = 0
;
- if(
!a_filter_string->len
) {
-
g_string_append(a_filter_string,tmp
);
+ if(
a_filter_string == NULL
) {
+
a_filter_string = g_string_new(""
);
}
else {
g_string_append(a_filter_string,"&"); /*conjonction between expression*/
}
else {
g_string_append(a_filter_string,"&"); /*conjonction between expression*/
- g_string_append(a_filter_string,tmp);
+ }
+
+ while(!feof(a_file)) {
+ getline(&line,&len,a_file);
+ g_string_append(a_filter_string,line);
+ line = NULL;
}
fclose(a_file);
}
fclose(a_file);
@@
-102,20
+112,19
@@
void filter_analyze_string(void *hook_data) {
g_print("textFilter::filter_analyze_string\n");
g_print("textFilter::filter_analyze_string\n");
- a_filter_string = g_string_new("");
/*
* User may specify filtering options through static file
* and/or command line string. From these sources, an
* option string is rebuilded and sent to the filter core
*/
/*
* User may specify filtering options through static file
* and/or command line string. From these sources, an
* option string is rebuilded and sent to the filter core
*/
-// if(!a_filter_string->len) {
+ if(a_filter_string==NULL) {
+ a_filter_string = g_string_new("");
+ g_string_append(a_filter_string,a_string);
+ }
+ else {
+ g_string_append(a_filter_string,"&"); /*conjonction between expression*/
g_string_append(a_filter_string,a_string);
g_string_append(a_filter_string,a_string);
- lttv_filter_new(a_filter_string->str,NULL);
-// }
-// else {
-// g_string_append(a_filter_string,"&"); /*conjonction between expression*/
-// g_string_append(a_filter_string,a_string);
-// }
+ }
}
}
@@
-138,8
+147,6
@@
static void init() {
g_print("textFilter::init()\n"); /* debug */
g_print("textFilter::init()\n"); /* debug */
- a_filter_string = g_string_new("");
-
LttvAttributeValue value;
LttvIAttribute *attributes = LTTV_IATTRIBUTE(lttv_global_attributes());
LttvAttributeValue value;
LttvIAttribute *attributes = LTTV_IATTRIBUTE(lttv_global_attributes());
@@
-173,7
+180,6
@@
static void init() {
// LTTV_POINTER, &value));
// g_assert((before_traceset = *(value.v_pointer)) != NULL);
// lttv_hooks_add(before_traceset, parse_filter_options, NULL, LTTV_PRIO_DEFAULT);
// LTTV_POINTER, &value));
// g_assert((before_traceset = *(value.v_pointer)) != NULL);
// lttv_hooks_add(before_traceset, parse_filter_options, NULL, LTTV_PRIO_DEFAULT);
-
}
}
This page took
0.023669 seconds
and
4
git commands to generate.