*/
gboolean lttv_simple_expression_assign_value(LttvSimpleExpression* se, char* value) {
- g_print("se->value:%s\n",value);
+// g_print("se->value:%s\n",value);
switch(se->field) {
/*
* 3. pop the tree value from the tree stack
*/
- g_print("expression: %s\n",filter->expression);
- g_print("strlen(expression): %i\n",strlen(filter->expression));
+// g_print("expression: %s\n",filter->expression);
+// g_print("strlen(expression): %i\n",strlen(filter->expression));
for(i=0;i<strlen(filter->expression);i++) {
// debug
g_print("%c ",filter->expression[i]);
//a_simple_expression->value = g_string_free(a_field_component,FALSE);
a_field_component = g_string_new("");
t1 = g_ptr_array_index(tree_stack,tree_stack->len-1);
- g_print("here\n");
while(t1->right != LTTV_TREE_IDLE) {
g_print("while right:%i %p->child:%p\n",t1->right,t1,t1->r_child.t);
g_assert(t1->right == LTTV_TREE_NODE);
g_assert(t1->r_child.t != NULL);
t1 = t1->r_child.t;
}
- g_print("here2\n");
t1->right = LTTV_TREE_LEAF;
t1->r_child.leaf = a_simple_expression;
a_simple_expression = lttv_simple_expression_new();
}
}
- g_print("subtree:%p, tree:%p, t1:%p, t2:%p\n",subtree,tree,t1,t2);
- g_print("stack size: %i\n",tree_stack->len);
+// g_print("subtree:%p, tree:%p, t1:%p, t2:%p\n",subtree,tree,t1,t2);
+// g_print("stack size: %i\n",tree_stack->len);
/*
* Preliminary check to see
*before_traceset,
*event_hook;
-static FILE *a_file;
-
/**
* filters the file input from user
* @param hook_data the hook data
* and/or command line string. From these sources, an
* option string is rebuilded and sent to the filter core
*/
- GString* a_file_content = g_string_new("");
+
+/* OLD CODE
+ * GString* a_file_content = g_string_new("");
a_file = fopen(a_file_name, "r");
if(a_file == NULL) {
g_warning("file %s does not exist", a_file_name);
g_string_append(a_file_content,line);
}
free(line);
+
+ fclose(a_file);
+*/
+
+ if(!g_file_test(a_file_name,G_FILE_TEST_EXISTS)) {
+ g_warning("file %s does not exist", a_file_name);
+ return;
+ }
+
+ char* a_file_content = NULL;
+
+ g_file_get_contents(a_file_name,&a_file_content,NULL,NULL);
g_assert(lttv_iattribute_find_by_path(attributes, "filter/expression",
LTTV_POINTER, &value));
if(((GString*)*(value.v_pointer))->len != 0) g_string_append_c((GString*)*(value.v_pointer),'&');
- g_string_append((GString*)*(value.v_pointer),a_file_content->str);
+ g_string_append_c((GString*)*(value.v_pointer),'(');
+ g_string_append((GString*)*(value.v_pointer),a_file_content);
+ g_string_append_c((GString*)*(value.v_pointer),')');
- fclose(a_file);
}
/**
LTTV_POINTER, &value));
if(((GString*)*(value.v_pointer))->len != 0) g_string_append_c((GString*)*(value.v_pointer),'&');
+ g_string_append_c((GString*)*(value.v_pointer),'(');
g_string_append((GString*)*(value.v_pointer),a_string);
+ g_string_append_c((GString*)*(value.v_pointer),')');
// LttvFilter* filter = lttv_filter_new();
// lttv_filter_append_expression(filter,a_string);