cfengine  3.15.4
About: CFEngine is a configuration management system for configuring and maintaining Unix-like computers (using an own high level policy language). Community version.
  Fossies Dox: cfengine-3.15.4.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

variable.h
Go to the documentation of this file.
1 /*
2  Copyright 2019 Northern.tech AS
3 
4  This file is part of CFEngine 3 - written and maintained by Northern.tech AS.
5 
6  This program is free software; you can redistribute it and/or modify it
7  under the terms of the GNU General Public License as published by the
8  Free Software Foundation; version 3.
9 
10  This program is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU General Public License for more details.
14 
15  You should have received a copy of the GNU General Public License
16  along with this program; if not, write to the Free Software
17  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
18 
19  To the extent this program is licensed as part of the Enterprise
20  versions of CFEngine, the applicable Commercial Open Source License
21  (COSL) may apply to this file if you as a licensee so wish it. See
22  included file COSL.txt.
23 */
24 #ifndef CFENGINE_VARIABLE_H
25 #define CFENGINE_VARIABLE_H
26 
27 #include <cf3.defs.h>
28 
29 #include <var_expressions.h>
30 
31 typedef struct
32 {
37  const Promise *promise; // The promise that set the present value
38 } Variable;
39 
40 typedef struct VariableTable_ VariableTable;
42 
45 
46 bool VariableTablePut(VariableTable *table, const VarRef *ref,
47  const Rval *rval, DataType type, const
48  char *tags, const Promise *promise);
49 Variable *VariableTableGet(const VariableTable *table, const VarRef *ref);
50 bool VariableTableRemove(VariableTable *table, const VarRef *ref);
51 
52 size_t VariableTableCount(const VariableTable *table, const char *ns, const char *scope, const char *lval);
53 bool VariableTableClear(VariableTable *table, const char *ns, const char *scope, const char *lval);
54 
55 VariableTableIterator *VariableTableIteratorNew(const VariableTable *table, const char *ns, const char *scope, const char *lval);
59 
60 VariableTable *VariableTableCopyLocalized(const VariableTable *table, const char *ns, const char *scope);
61 
62 #endif
DataType
Definition: cf3.defs.h:368
Definition: cf3.defs.h:614
Definition: set.h:138
MapIterator iter
Definition: variable.c:61
VarRef * ref
Definition: variable.h:33
StringSet * tags
Definition: variable.h:36
const Promise * promise
Definition: variable.h:37
DataType type
Definition: variable.h:35
Rval rval
Definition: variable.h:34
bool VariableTableRemove(VariableTable *table, const VarRef *ref)
Definition: variable.c:144
bool VariableTablePut(VariableTable *table, const VarRef *ref, const Rval *rval, DataType type, const char *tags, const Promise *promise)
Definition: variable.c:170
Variable * VariableTableIteratorNext(VariableTableIterator *iter)
Definition: variable.c:283
VariableTableIterator * VariableTableIteratorNew(const VariableTable *table, const char *ns, const char *scope, const char *lval)
Definition: variable.c:273
VariableTableIterator * VariableTableIteratorNewFromVarRef(const VariableTable *table, const VarRef *ref)
Definition: variable.c:263
VariableTable * VariableTableNew(void)
Definition: variable.c:79
void VariableTableIteratorDestroy(VariableTableIterator *iter)
Definition: variable.c:336
VariableTable * VariableTableCopyLocalized(const VariableTable *table, const char *ns, const char *scope)
bool VariableTableClear(VariableTable *table, const char *ns, const char *scope, const char *lval)
Definition: variable.c:196
size_t VariableTableCount(const VariableTable *table, const char *ns, const char *scope, const char *lval)
Definition: variable.c:246
void VariableTableDestroy(VariableTable *table)
Definition: variable.c:88
Variable * VariableTableGet(const VariableTable *table, const VarRef *ref)
Definition: variable.c:98