Open SCAP Library
seap-message.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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18  *
19  * Authors:
20  * "Daniel Kopecek" <dkopecek@redhat.com>
21  */
22 
23 #pragma once
24 #ifndef SEAP_MESSAGE_H
25 #define SEAP_MESSAGE_H
26 
27 #include <stdint.h>
28 #include <stdbool.h>
29 #include <sexp-types.h>
30 #include "oscap_export.h"
31 
32 #ifdef __cplusplus
33 extern "C" {
34 #endif
35 
36 #if SEAP_MSGID_BITS == 64
37 typedef uint64_t SEAP_msgid_t;
38 #else
39 typedef uint32_t SEAP_msgid_t;
40 #endif
41 
42 typedef struct SEAP_msg SEAP_msg_t;
43 typedef struct SEAP_attr SEAP_attr_t;
44 
45 OSCAP_API SEAP_msg_t *SEAP_msg_new (void);
46 OSCAP_API SEAP_msg_t *SEAP_msg_clone (SEAP_msg_t *msg);
47 OSCAP_API void SEAP_msg_free (SEAP_msg_t *msg);
48 
49 OSCAP_API SEAP_msgid_t SEAP_msg_id (SEAP_msg_t *msg);
50 
51 OSCAP_API int SEAP_msg_set (SEAP_msg_t *msg, SEXP_t *sexp);
52 OSCAP_API void SEAP_msg_unset (SEAP_msg_t *msg);
53 OSCAP_API SEXP_t *SEAP_msg_get (SEAP_msg_t *msg);
54 
55 OSCAP_API SEXP_t *SEAP_msgattr_get (SEAP_msg_t *msg, const char *name);
56 OSCAP_API int SEAP_msgattr_set (SEAP_msg_t *msg, const char *name, SEXP_t *value);
57 OSCAP_API int SEAP_msgattr_del (SEAP_msg_t *msg, const char *name);
58 OSCAP_API bool SEAP_msgattr_exists (SEAP_msg_t *msg, const char *name);
59 
60 #include <stdio.h>
61 OSCAP_API void SEAP_msg_print (FILE *fp, SEAP_msg_t *msg);
62 
63 #ifdef __cplusplus
64 }
65 #endif
66 
67 #endif /* SEAP_MESSAGE_H */
Definition: _seap-message.h:33
Definition: sexp-types.h:82
Definition: _seap-message.h:38