Thierry FOURNIER | 4834bc7 | 2015-06-06 19:29:07 +0200 | [diff] [blame] | 1 | #ifndef _TYPES_VARS_H |
| 2 | #define _TYPES_VARS_H |
| 3 | |
| 4 | #include <common/mini-clist.h> |
| 5 | |
| 6 | #include <types/sample.h> |
| 7 | |
| 8 | enum vars_scope { |
| 9 | SCOPE_SESS = 0, |
| 10 | SCOPE_TXN, |
| 11 | SCOPE_REQ, |
| 12 | SCOPE_RES, |
Christopher Faulet | ff2613e | 2016-11-09 11:36:17 +0100 | [diff] [blame] | 13 | SCOPE_PROC, |
Thierry FOURNIER | 4834bc7 | 2015-06-06 19:29:07 +0200 | [diff] [blame] | 14 | }; |
| 15 | |
| 16 | struct vars { |
| 17 | struct list head; |
| 18 | enum vars_scope scope; |
| 19 | unsigned int size; |
| 20 | }; |
| 21 | |
| 22 | /* This struct describes a variable. */ |
| 23 | struct var_desc { |
| 24 | const char *name; /* Contains the normalized variable name. */ |
| 25 | enum vars_scope scope; |
| 26 | }; |
| 27 | |
| 28 | struct var { |
| 29 | struct list l; /* Used for chaining vars. */ |
| 30 | const char *name; /* Contains the variable name. */ |
Thierry FOURNIER | 12ba0c2 | 2015-08-14 00:02:11 +0200 | [diff] [blame] | 31 | struct sample_data data; /* data storage. */ |
Thierry FOURNIER | 4834bc7 | 2015-06-06 19:29:07 +0200 | [diff] [blame] | 32 | }; |
| 33 | |
| 34 | #endif |