C AMQP Protocol Engine API  0.7
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
message.h
Go to the documentation of this file.
1 #ifndef PROTON_MESSAGE_H
2 #define PROTON_MESSAGE_H 1
3 
4 /*
5  *
6  * Licensed to the Apache Software Foundation (ASF) under one
7  * or more contributor license agreements. See the NOTICE file
8  * distributed with this work for additional information
9  * regarding copyright ownership. The ASF licenses this file
10  * to you under the Apache License, Version 2.0 (the
11  * "License"); you may not use this file except in compliance
12  * with the License. You may obtain a copy of the License at
13  *
14  * http://www.apache.org/licenses/LICENSE-2.0
15  *
16  * Unless required by applicable law or agreed to in writing,
17  * software distributed under the License is distributed on an
18  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
19  * KIND, either express or implied. See the License for the
20  * specific language governing permissions and limitations
21  * under the License.
22  *
23  */
24 
25 #include <proton/import_export.h>
26 #include <proton/types.h>
27 #include <proton/codec.h>
28 #include <proton/error.h>
29 #include <sys/types.h>
30 #include <proton/type_compat.h>
31 
32 #ifdef __cplusplus
33 extern "C" {
34 #endif
35 
50 typedef struct pn_message_t pn_message_t;
51 
55 typedef enum {
60 } pn_format_t;
61 
65 #define PN_DEFAULT_PRIORITY (4)
66 
76 
83 
94 
107 
121 
137 
148 PN_EXTERN int pn_message_set_inferred(pn_message_t *msg, bool inferred);
149 
150 // standard message headers and properties
151 
162 
173 PN_EXTERN int pn_message_set_durable (pn_message_t *msg, bool durable);
174 
186 
196 PN_EXTERN int pn_message_set_priority (pn_message_t *msg, uint8_t priority);
197 
211 
222 
236 
248 
260 
271 PN_EXTERN int pn_message_set_delivery_count (pn_message_t *msg, uint32_t count);
272 
287 
301 
314 
329 
341 
356 PN_EXTERN const char * pn_message_get_address (pn_message_t *msg);
357 
370 PN_EXTERN int pn_message_set_address (pn_message_t *msg, const char *address);
371 
386 PN_EXTERN const char * pn_message_get_subject (pn_message_t *msg);
387 
400 PN_EXTERN int pn_message_set_subject (pn_message_t *msg, const char *subject);
401 
417 
430 PN_EXTERN int pn_message_set_reply_to (pn_message_t *msg, const char *reply_to);
431 
445 
458 
471 
487 
500 PN_EXTERN int pn_message_set_content_type (pn_message_t *msg, const char *type);
501 
517 
530 PN_EXTERN int pn_message_set_content_encoding (pn_message_t *msg, const char *encoding);
531 
542 
553 
564 
575 
591 
604 PN_EXTERN int pn_message_set_group_id (pn_message_t *msg, const char *group_id);
605 
617 
629 
645 
658 PN_EXTERN int pn_message_set_reply_to_group_id (pn_message_t *msg, const char *reply_to_group_id);
659 
664 
669 
673 PN_EXTERN int pn_message_load(pn_message_t *message, const char *data, size_t size);
674 
678 PN_EXTERN int pn_message_load_data(pn_message_t *message, const char *data, size_t size);
679 
683 PN_EXTERN int pn_message_load_text(pn_message_t *message, const char *data, size_t size);
684 
688 PN_EXTERN int pn_message_load_amqp(pn_message_t *message, const char *data, size_t size);
689 
693 PN_EXTERN int pn_message_load_json(pn_message_t *message, const char *data, size_t size);
694 
698 PN_EXTERN int pn_message_save(pn_message_t *message, char *data, size_t *size);
699 
703 PN_EXTERN int pn_message_save_data(pn_message_t *message, char *data, size_t *size);
704 
708 PN_EXTERN int pn_message_save_text(pn_message_t *message, char *data, size_t *size);
709 
713 PN_EXTERN int pn_message_save_amqp(pn_message_t *message, char *data, size_t *size);
714 
718 PN_EXTERN int pn_message_save_json(pn_message_t *message, char *data, size_t *size);
719 
736 
752 
768 
781 
794 PN_EXTERN int pn_message_decode(pn_message_t *msg, const char *bytes, size_t size);
795 
809 PN_EXTERN int pn_message_encode(pn_message_t *msg, char *bytes, size_t *size);
810 
814 PN_EXTERN ssize_t pn_message_data(char *dst, size_t available, const char *src, size_t size);
815 
819 #ifdef __cplusplus
820 }
821 #endif
822 
823 #endif /* message.h */