HPCToolkit
generic_val.h
Go to the documentation of this file.
1 /*
2  * generic_val.h
3  *
4  * A variable of type void* epresents an abstract notion of a value in a tree
5  * or list node.
6  *
7  * Author: dxnguyen
8  */
9 
10 #ifndef __GENERIC_VAL__
11 #define __GENERIC_VAL__
12 
13 #if 0
14 // abstract function to compute and return a string representation of
15 // a generic value.
16 typedef char* (*val_str)(void* val);
17 #endif
18 
19 // abstract function to compute a string representation of a generic value
20 // and return the result in the str parameter.
21 // caller to provide the appropriate length for the result string.
22 typedef void (*val_tostr)(void* val, char str[]);
23 
24 
25 /*
26  * Abstract comparator function to compare two generic values: lhs vs rhs
27  * Returns:
28  * 0 if lhs matches rhs
29  * < 0 if lhs < rhs
30  * > 0 if lhs > rhs
31  */
32 typedef int (*val_cmp)(void* lhs, void *rhs);
33 
34 #endif /* __GENERIC_VAL__ */
void(* val_tostr)(void *val, char str[])
Definition: generic_val.h:22
int(* val_cmp)(void *lhs, void *rhs)
Definition: generic_val.h:32