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 #if SEAP_MSGID_BITS == 64
00010 typedef uint64_t SEAP_msgid_t;
00011 #else
00012 typedef uint32_t SEAP_msgid_t;
00013 #endif
00014
00015 typedef struct SEAP_msg SEAP_msg_t;
00016 typedef struct SEAP_attr SEAP_attr_t;
00017
00018 SEAP_msg_t *SEAP_msg_new (void);
00019 SEAP_msg_t *SEAP_msg_clone (SEAP_msg_t *msg);
00020 void SEAP_msg_free (SEAP_msg_t *msg);
00021
00022 SEAP_msgid_t SEAP_msg_id (SEAP_msg_t *msg);
00023
00024 int SEAP_msg_set (SEAP_msg_t *msg, SEXP_t *sexp);
00025 void SEAP_msg_unset (SEAP_msg_t *msg);
00026 SEXP_t *SEAP_msg_get (SEAP_msg_t *msg);
00027
00028 SEXP_t *SEAP_msgattr_get (SEAP_msg_t *msg, const char *name);
00029 int SEAP_msgattr_set (SEAP_msg_t *msg, const char *name, SEXP_t *value);
00030 int SEAP_msgattr_del (SEAP_msg_t *msg, const char *name);
00031 bool SEAP_msgattr_exists (SEAP_msg_t *msg, const char *name);
00032
00033 #include <stdio.h>
00034 void SEAP_msg_print (FILE *fp, SEAP_msg_t *msg);
00035
00036 #endif