00001 #pragma once
00002 #ifndef SEAP_MESSAGE_H
00003 #define SEAP_MESSAGE_H
00004
00005 #include <stdint.h>
00006 #include <stdbool.h>
00007 #include <sexp-types.h>
00008
00009 #ifdef __cplusplus
00010 extern "C" {
00011 #endif
00012
00013 #if SEAP_MSGID_BITS == 64
00014 typedef uint64_t SEAP_msgid_t;
00015 #else
00016 typedef uint32_t SEAP_msgid_t;
00017 #endif
00018
00019 typedef struct SEAP_msg SEAP_msg_t;
00020 typedef struct SEAP_attr SEAP_attr_t;
00021
00022 SEAP_msg_t *SEAP_msg_new (void);
00023 SEAP_msg_t *SEAP_msg_clone (SEAP_msg_t *msg);
00024 void SEAP_msg_free (SEAP_msg_t *msg);
00025
00026 SEAP_msgid_t SEAP_msg_id (SEAP_msg_t *msg);
00027
00028 int SEAP_msg_set (SEAP_msg_t *msg, SEXP_t *sexp);
00029 void SEAP_msg_unset (SEAP_msg_t *msg);
00030 SEXP_t *SEAP_msg_get (SEAP_msg_t *msg);
00031
00032 SEXP_t *SEAP_msgattr_get (SEAP_msg_t *msg, const char *name);
00033 int SEAP_msgattr_set (SEAP_msg_t *msg, const char *name, SEXP_t *value);
00034 int SEAP_msgattr_del (SEAP_msg_t *msg, const char *name);
00035 bool SEAP_msgattr_exists (SEAP_msg_t *msg, const char *name);
00036
00037 #include <stdio.h>
00038 void SEAP_msg_print (FILE *fp, SEAP_msg_t *msg);
00039
00040 #ifdef __cplusplus
00041 }
00042 #endif
00043
00044 #endif