blob: 9b166e9d650f59f69fcb8717b7e19792260cb5cd [file] [log] [blame]
Thierry FOURNIER4834bc72015-06-06 19:29:07 +02001#ifndef _TYPES_VARS_H
2#define _TYPES_VARS_H
3
4#include <common/mini-clist.h>
Christopher Faulete95f2c32017-07-24 16:30:34 +02005#include <common/hathreads.h>
Thierry FOURNIER4834bc72015-06-06 19:29:07 +02006
7#include <types/sample.h>
8
9enum vars_scope {
10 SCOPE_SESS = 0,
11 SCOPE_TXN,
12 SCOPE_REQ,
13 SCOPE_RES,
Christopher Fauletff2613e2016-11-09 11:36:17 +010014 SCOPE_PROC,
Thierry FOURNIER4834bc72015-06-06 19:29:07 +020015};
16
17struct vars {
18 struct list head;
19 enum vars_scope scope;
20 unsigned int size;
Christopher Faulet9dcf9b62017-11-13 10:34:01 +010021 __decl_hathreads(HA_RWLOCK_T rwlock);
Thierry FOURNIER4834bc72015-06-06 19:29:07 +020022};
23
24/* This struct describes a variable. */
25struct var_desc {
26 const char *name; /* Contains the normalized variable name. */
27 enum vars_scope scope;
28};
29
30struct var {
31 struct list l; /* Used for chaining vars. */
32 const char *name; /* Contains the variable name. */
Thierry FOURNIER12ba0c22015-08-14 00:02:11 +020033 struct sample_data data; /* data storage. */
Thierry FOURNIER4834bc72015-06-06 19:29:07 +020034};
35
36#endif