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