Open SCAP Library
Loading...
Searching...
No Matches
_sexp-datatype.h
1/*
2 * Copyright 2009 Red Hat Inc., Durham, North Carolina.
3 * All Rights Reserved.
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
9 *
10 * This library 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 GNU
13 * Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18 *
19 * Authors:
20 * "Daniel Kopecek" <dkopecek@redhat.com>
21 */
22
23#pragma once
24#ifndef _SEXP_DATATYPE
25#define _SEXP_DATATYPE
26
27#include "public/sexp-datatype.h"
28#include "generic/rbt/rbt.h"
29#include "../../../common/util.h"
30
31
33 uint16_t dt_flg;
34 uint8_t _dt[];
35};
36
37#define SEXP_DTFLG_LOCALDATA 0x01 /* whether a extended pointer should be used */
38#define SEXP_DTFLG_HAVEDTOPS 0x02 /* whether there are defined some operations */
39
41 uint16_t dt_opcnt;
42 SEXP_datatypeOP_t *dt_op;
43};
44
46 rbt_t *tree;
47};
48
49/*
50 * Datatype pointer
51 */
52typedef struct rbt_str_node SEXP_datatypePtr_t;
53
54/*
55 * Extended datatype pointer
56 */
58 struct rbt_str_node *n; /* datatype tree node */
59 void *l; /* local data related to an S-exp reference */
60};
61
63
64
65const char *SEXP_datatype_name(SEXP_datatypePtr_t *p);
66
67void SEXP_datatype_once(void);
68void SEXP_datatypeGlobalTbl_init(void);
69void SEXP_datatypeGlobalTbl_free(void);
70
71SEXP_datatypeTbl_t *SEXP_datatypeTbl_new (void);
72int SEXP_datatypeTbl_init(SEXP_datatypeTbl_t *t);
73void SEXP_datatypeTbl_free(SEXP_datatypeTbl_t *t);
74
75SEXP_datatypePtr_t *SEXP_datatype_get(SEXP_datatypeTbl_t *t, const char *name);
76SEXP_datatypePtr_t *SEXP_datatype_add(SEXP_datatypeTbl_t *t, char *name);
77int SEXP_datatype_del(SEXP_datatypeTbl_t *t, const char *name);
78
79#define SEXP_OP_CONTINUE 0 /* continue with the default handler */
80#define SEXP_OP_ABORT 1 /* abort with an error status */
81#define SEXP_OP_RETURN 2 /* return success, don't execute default handler */
82
83#define SEXP_DATATYPEPTR_MASK (UINTPTR_MAX << 2)
84#define SEXP_DATATYPEPTR_ALIGN (4 > sizeof(void *) ? 4 : sizeof (void *))
85
86
87#endif /* _SEXP_DATATYPE */
Definition _sexp-datatype.h:45
Definition _sexp-datatype.h:57
Definition _sexp-datatype.h:40
Definition _sexp-datatype.h:32
Definition rbt_str.h:27
Definition rbt_common.h:129