+gboolean lttv_simple_expression_assign_value(LttvSimpleExpression* se, char* value) {
+
+ g_print("se->value:%s\n",value);
+
+ switch(se->field) {
+ /*
+ * string
+ */
+ case LTTV_FILTER_TRACE_NAME:
+ case LTTV_FILTER_TRACEFILE_NAME:
+ case LTTV_FILTER_STATE_P_NAME:
+ case LTTV_FILTER_EVENT_NAME:
+ se->value.v_string = value;
+ break;
+ /*
+ * integer
+ */
+ case LTTV_FILTER_STATE_PID:
+ case LTTV_FILTER_STATE_PPID:
+ case LTTV_FILTER_STATE_EX_MODE:
+ case LTTV_FILTER_STATE_EX_SUBMODE:
+ case LTTV_FILTER_STATE_P_STATUS:
+ se->value.v_uint64 = atoi(value);
+ g_free(value);
+ break;
+ /*
+ * double
+ */
+ case LTTV_FILTER_STATE_CT:
+ case LTTV_FILTER_STATE_IT:
+ case LTTV_FILTER_EVENT_TIME:
+ case LTTV_FILTER_EVENT_TSC:
+ se->value.v_double = atof(value);
+ g_free(value);
+ break;
+ default:
+ g_warning("Error encountered in value assignation ! Field type = %i",se->field);
+ return FALSE;
+ }
+
+ return TRUE;
+
+}
+
+/**
+ * @fn void lttv_simple_expression_destroy(LttvSimpleExpression*)
+ *
+ * Disallocate memory for the current
+ * simple expression
+ * @param se pointer to the current LttvSimpleExpression
+ */
+void
+lttv_simple_expression_destroy(LttvSimpleExpression* se) {
+
+ // g_free(se->value);
+ g_free(se);
+
+}
+
+/**
+ * @fn gint lttv_struct_type(gint)
+ *
+ * Finds the structure type depending
+ * on the fields in parameters
+ * @params ft Field of the current structure
+ * @return LttvStructType enum or -1 for error
+ */
+gint
+lttv_struct_type(gint ft) {
+
+ switch(ft) {
+ case LTTV_FILTER_TRACE_NAME:
+ return LTTV_FILTER_TRACE;
+ break;
+ case LTTV_FILTER_TRACEFILE_NAME:
+ return LTTV_FILTER_TRACEFILE;
+ break;
+ case LTTV_FILTER_STATE_PID:
+ case LTTV_FILTER_STATE_PPID:
+ case LTTV_FILTER_STATE_CT:
+ case LTTV_FILTER_STATE_IT:
+ case LTTV_FILTER_STATE_P_NAME:
+ case LTTV_FILTER_STATE_EX_MODE:
+ case LTTV_FILTER_STATE_EX_SUBMODE:
+ case LTTV_FILTER_STATE_P_STATUS:
+ case LTTV_FILTER_STATE_CPU:
+ return LTTV_FILTER_STATE;
+ break;
+ case LTTV_FILTER_EVENT_NAME:
+ case LTTV_FILTER_EVENT_CATEGORY:
+ case LTTV_FILTER_EVENT_TIME:
+ case LTTV_FILTER_EVENT_TSC:
+ case LTTV_FILTER_EVENT_FIELD:
+ return LTTV_FILTER_EVENT;
+ break;
+ default:
+ return -1;
+ }
+}
+
+/**
+ * @fn gboolean lttv_apply_op_eq_uint64(gpointer,LttvFieldValue)
+ *
+ * Applies the 'equal' operator to the
+ * specified structure and value
+ * @param v1 left member of comparison
+ * @param v2 right member of comparison
+ * @return success/failure of operation
+ */
+gboolean lttv_apply_op_eq_uint64(gpointer v1, LttvFieldValue v2) {
+
+ guint64* r = (guint64*) v1;
+ return (*r == v2.v_uint64);
+
+}
+
+/**
+ * @fn gboolean lttv_apply_op_eq_uint32(gpointer,LttvFieldValue)
+ *
+ * Applies the 'equal' operator to the
+ * specified structure and value
+ * @param v1 left member of comparison
+ * @param v2 right member of comparison
+ * @return success/failure of operation
+ */
+gboolean lttv_apply_op_eq_uint32(gpointer v1, LttvFieldValue v2) {
+ guint32* r = (guint32*) v1;
+ return (*r == v2.v_uint32);
+}
+
+/**
+ * @fn gboolean lttv_apply_op_eq_uint16(gpointer,LttvFieldValue)
+ *
+ * Applies the 'equal' operator to the
+ * specified structure and value
+ * @param v1 left member of comparison
+ * @param v2 right member of comparison
+ * @return success/failure of operation
+ */
+gboolean lttv_apply_op_eq_uint16(gpointer v1, LttvFieldValue v2) {
+ guint16* r = (guint16*) v1;
+ return (*r == v2.v_uint16);
+}
+
+/**
+ * @fn gboolean lttv_apply_op_eq_double(gpointer,LttvFieldValue)
+ *
+ * Applies the 'equal' operator to the
+ * specified structure and value
+ * @param v1 left member of comparison
+ * @param v2 right member of comparison
+ * @return success/failure of operation
+ */
+gboolean lttv_apply_op_eq_double(gpointer v1, LttvFieldValue v2) {
+ double* r = (double*) v1;
+ return (*r == v2.v_double);
+}
+
+/**
+ * @fn gboolean lttv_apply_op_eq_string(gpointer,LttvFieldValue)
+ *
+ * Applies the 'equal' operator to the
+ * specified structure and value
+ * @param v1 left member of comparison
+ * @param v2 right member of comparison
+ * @return success/failure of operation
+ */
+gboolean lttv_apply_op_eq_string(gpointer v1, LttvFieldValue v2) {
+ char* r = (char*) v1;
+ return (!g_strcasecmp(r,v2.v_string));
+}
+
+/**
+ * @fn gboolean lttv_apply_op_ne_uint64(gpointer,LttvFieldValue)
+ *
+ * Applies the 'not equal' operator to the
+ * specified structure and value
+ * @param v1 left member of comparison
+ * @param v2 right member of comparison
+ * @return success/failure of operation
+ */
+gboolean lttv_apply_op_ne_uint64(gpointer v1, LttvFieldValue v2) {
+ guint64* r = (guint64*) v1;
+ return (*r != v2.v_uint64);
+}
+
+/**
+ * @fn gboolean lttv_apply_op_ne_uint32(gpointer,LttvFieldValue)
+ *
+ * Applies the 'not equal' operator to the
+ * specified structure and value
+ * @param v1 left member of comparison
+ * @param v2 right member of comparison
+ * @return success/failure of operation
+ */
+gboolean lttv_apply_op_ne_uint32(gpointer v1, LttvFieldValue v2) {
+ guint32* r = (guint32*) v1;
+ return (*r != v2.v_uint32);
+}
+
+/**
+ * @fn gboolean lttv_apply_op_ne_uint16(gpointer,LttvFieldValue)
+ *
+ * Applies the 'not equal' operator to the
+ * specified structure and value
+ * @param v1 left member of comparison
+ * @param v2 right member of comparison
+ * @return success/failure of operation
+ */
+gboolean lttv_apply_op_ne_uint16(gpointer v1, LttvFieldValue v2) {
+ guint16* r = (guint16*) v1;
+ return (*r != v2.v_uint16);
+}
+
+/**
+ * @fn gboolean lttv_apply_op_ne_double(gpointer,LttvFieldValue)
+ *
+ * Applies the 'not equal' operator to the
+ * specified structure and value
+ * @param v1 left member of comparison
+ * @param v2 right member of comparison
+ * @return success/failure of operation
+ */
+gboolean lttv_apply_op_ne_double(gpointer v1, LttvFieldValue v2) {
+ double* r = (double*) v1;
+ return (*r != v2.v_double);
+}
+
+/**
+ * @fn gboolean lttv_apply_op_ne_string(gpointer,LttvFieldValue)
+ *
+ * Applies the 'not equal' operator to the
+ * specified structure and value
+ * @param v1 left member of comparison
+ * @param v2 right member of comparison
+ * @return success/failure of operation
+ */
+gboolean lttv_apply_op_ne_string(gpointer v1, LttvFieldValue v2) {
+ char* r = (char*) v1;
+ return (g_strcasecmp(r,v2.v_string));
+}
+
+/**
+ * @fn gboolean lttv_apply_op_lt_uint64(gpointer,LttvFieldValue)
+ *
+ * Applies the 'lower than' operator to the
+ * specified structure and value
+ * @param v1 left member of comparison
+ * @param v2 right member of comparison
+ * @return success/failure of operation
+ */
+gboolean lttv_apply_op_lt_uint64(gpointer v1, LttvFieldValue v2) {
+ guint64* r = (guint64*) v1;
+ return (*r < v2.v_uint64);
+}
+
+/**
+ * @fn gboolean lttv_apply_op_lt_uint32(gpointer,LttvFieldValue)
+ *
+ * Applies the 'lower than' operator to the
+ * specified structure and value
+ * @param v1 left member of comparison
+ * @param v2 right member of comparison
+ * @return success/failure of operation
+ */
+gboolean lttv_apply_op_lt_uint32(gpointer v1, LttvFieldValue v2) {
+ guint32* r = (guint32*) v1;
+ return (*r < v2.v_uint32);
+}
+
+/**
+ * @fn gboolean lttv_apply_op_lt_uint16(gpointer,LttvFieldValue)
+ *
+ * Applies the 'lower than' operator to the
+ * specified structure and value
+ * @param v1 left member of comparison
+ * @param v2 right member of comparison
+ * @return success/failure of operation
+ */
+gboolean lttv_apply_op_lt_uint16(gpointer v1, LttvFieldValue v2) {
+ guint16* r = (guint16*) v1;
+ return (*r < v2.v_uint16);
+}
+
+/**
+ * @fn gboolean lttv_apply_op_lt_double(gpointer,LttvFieldValue)
+ *
+ * Applies the 'lower than' operator to the
+ * specified structure and value
+ * @param v1 left member of comparison
+ * @param v2 right member of comparison
+ * @return success/failure of operation
+ */
+gboolean lttv_apply_op_lt_double(gpointer v1, LttvFieldValue v2) {
+ double* r = (double*) v1;
+ return (*r < v2.v_double);
+}
+
+/**
+ * @fn gboolean lttv_apply_op_le_uint64(gpointer,LttvFieldValue)
+ *
+ * Applies the 'lower or equal' operator to the
+ * specified structure and value
+ * @param v1 left member of comparison
+ * @param v2 right member of comparison
+ * @return success/failure of operation
+ */
+gboolean lttv_apply_op_le_uint64(gpointer v1, LttvFieldValue v2) {
+ guint64* r = (guint64*) v1;
+ return (*r <= v2.v_uint64);
+}
+
+/**
+ * @fn gboolean lttv_apply_op_le_uint32(gpointer,LttvFieldValue)
+ *
+ * Applies the 'lower or equal' operator to the
+ * specified structure and value
+ * @param v1 left member of comparison
+ * @param v2 right member of comparison
+ * @return success/failure of operation
+ */
+gboolean lttv_apply_op_le_uint32(gpointer v1, LttvFieldValue v2) {
+ guint32* r = (guint32*) v1;
+ return (*r <= v2.v_uint32);
+}
+
+/**
+ * @fn gboolean lttv_apply_op_le_uint16(gpointer,LttvFieldValue)
+ *
+ * Applies the 'lower or equal' operator to the
+ * specified structure and value
+ * @param v1 left member of comparison
+ * @param v2 right member of comparison
+ * @return success/failure of operation
+ */
+gboolean lttv_apply_op_le_uint16(gpointer v1, LttvFieldValue v2) {
+ guint16* r = (guint16*) v1;
+ return (*r <= v2.v_uint16);
+}
+
+/**
+ * @fn gboolean lttv_apply_op_le_double(gpointer,LttvFieldValue)
+ *
+ * Applies the 'lower or equal' operator to the
+ * specified structure and value
+ * @param v1 left member of comparison
+ * @param v2 right member of comparison
+ * @return success/failure of operation
+ */
+gboolean lttv_apply_op_le_double(gpointer v1, LttvFieldValue v2) {
+ double* r = (double*) v1;
+ return (*r <= v2.v_double);
+}
+
+/**
+ * @fn gboolean lttv_apply_op_gt_uint64(gpointer,LttvFieldValue)
+ *
+ * Applies the 'greater than' operator to the
+ * specified structure and value
+ * @param v1 left member of comparison
+ * @param v2 right member of comparison
+ * @return success/failure of operation
+ */
+gboolean lttv_apply_op_gt_uint64(gpointer v1, LttvFieldValue v2) {
+ guint64* r = (guint64*) v1;
+ return (*r > v2.v_uint64);
+}
+
+/**
+ * @fn gboolean lttv_apply_op_gt_uint32(gpointer,LttvFieldValue)
+ *
+ * Applies the 'greater than' operator to the
+ * specified structure and value
+ * @param v1 left member of comparison
+ * @param v2 right member of comparison
+ * @return success/failure of operation
+ */
+gboolean lttv_apply_op_gt_uint32(gpointer v1, LttvFieldValue v2) {
+ guint32* r = (guint32*) v1;
+ return (*r > v2.v_uint32);
+}