blob: 8a4f7aa35963aebf8bc3fc1a349e2b5131324fcf [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 Faulete95f2c32017-07-24 16:30:34 +020021#ifdef USE_THREAD
22 HA_RWLOCK_T rwlock;
23#endif
Thierry FOURNIER4834bc72015-06-06 19:29:07 +020024};
25
26/* This struct describes a variable. */
27struct var_desc {
28 const char *name; /* Contains the normalized variable name. */
29 enum vars_scope scope;
30};
31
32struct var {
33 struct list l; /* Used for chaining vars. */
34 const char *name; /* Contains the variable name. */
Thierry FOURNIER12ba0c22015-08-14 00:02:11 +020035 struct sample_data data; /* data storage. */
Thierry FOURNIER4834bc72015-06-06 19:29:07 +020036};
37
38#endif