Qpid Proton C API  0.17.0
 All Classes Files Functions Variables Typedefs Enumerations Enumerator 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 <proton/type_compat.h>
30 
31 #ifdef __cplusplus
32 extern "C" {
33 #endif
34 
51 typedef struct pn_message_t pn_message_t;
52 
56 #define PN_DEFAULT_PRIORITY (4)
57 
66 PN_EXTERN pn_message_t * pn_message(void);
67 
73 PN_EXTERN void pn_message_free(pn_message_t *msg);
74 
84 PN_EXTERN void pn_message_clear(pn_message_t *msg);
85 
97 PN_EXTERN int pn_message_errno(pn_message_t *msg);
98 
111 PN_EXTERN pn_error_t *pn_message_error(pn_message_t *msg);
112 
127 PN_EXTERN bool pn_message_is_inferred(pn_message_t *msg);
128 
139 PN_EXTERN int pn_message_set_inferred(pn_message_t *msg, bool inferred);
140 
141 // standard message headers and properties
142 
152 PN_EXTERN bool pn_message_is_durable (pn_message_t *msg);
153 
164 PN_EXTERN int pn_message_set_durable (pn_message_t *msg, bool durable);
165 
176 PN_EXTERN uint8_t pn_message_get_priority (pn_message_t *msg);
177 
187 PN_EXTERN int pn_message_set_priority (pn_message_t *msg, uint8_t priority);
188 
202 
212 PN_EXTERN int pn_message_set_ttl (pn_message_t *msg, pn_millis_t ttl);
213 
226 PN_EXTERN bool pn_message_is_first_acquirer (pn_message_t *msg);
227 
238 PN_EXTERN int pn_message_set_first_acquirer (pn_message_t *msg, bool first);
239 
250 PN_EXTERN uint32_t pn_message_get_delivery_count (pn_message_t *msg);
251 
262 PN_EXTERN int pn_message_set_delivery_count (pn_message_t *msg, uint32_t count);
263 
277 PN_EXTERN pn_data_t * pn_message_id (pn_message_t *msg);
278 
291 PN_EXTERN pn_atom_t pn_message_get_id (pn_message_t *msg);
292 
304 PN_EXTERN int pn_message_set_id (pn_message_t *msg, pn_atom_t id);
305 
320 
331 PN_EXTERN int pn_message_set_user_id (pn_message_t *msg, pn_bytes_t user_id);
332 
347 PN_EXTERN const char * pn_message_get_address (pn_message_t *msg);
348 
361 PN_EXTERN int pn_message_set_address (pn_message_t *msg, const char *address);
362 
377 PN_EXTERN const char * pn_message_get_subject (pn_message_t *msg);
378 
391 PN_EXTERN int pn_message_set_subject (pn_message_t *msg, const char *subject);
392 
407 PN_EXTERN const char * pn_message_get_reply_to (pn_message_t *msg);
408 
421 PN_EXTERN int pn_message_set_reply_to (pn_message_t *msg, const char *reply_to);
422 
436 
449 
461 PN_EXTERN int pn_message_set_correlation_id (pn_message_t *msg, pn_atom_t id);
462 
477 PN_EXTERN const char * pn_message_get_content_type (pn_message_t *msg);
478 
491 PN_EXTERN int pn_message_set_content_type (pn_message_t *msg, const char *type);
492 
507 PN_EXTERN const char * pn_message_get_content_encoding (pn_message_t *msg);
508 
521 PN_EXTERN int pn_message_set_content_encoding (pn_message_t *msg, const char *encoding);
522 
533 
543 PN_EXTERN int pn_message_set_expiry_time (pn_message_t *msg, pn_timestamp_t time);
544 
555 
565 PN_EXTERN int pn_message_set_creation_time (pn_message_t *msg, pn_timestamp_t time);
566 
581 PN_EXTERN const char * pn_message_get_group_id (pn_message_t *msg);
582 
595 PN_EXTERN int pn_message_set_group_id (pn_message_t *msg, const char *group_id);
596 
608 
620 
635 PN_EXTERN const char * pn_message_get_reply_to_group_id (pn_message_t *msg);
636 
649 PN_EXTERN int pn_message_set_reply_to_group_id (pn_message_t *msg, const char *reply_to_group_id);
650 
667 
683 
699 
711 PN_EXTERN pn_data_t *pn_message_body(pn_message_t *msg);
712 
725 PN_EXTERN int pn_message_decode(pn_message_t *msg, const char *bytes, size_t size);
726 
740 PN_EXTERN int pn_message_encode(pn_message_t *msg, char *bytes, size_t *size);
741 
745 PN_EXTERN int pn_message_data(pn_message_t *msg, pn_data_t *data);
746 
750 #ifdef __cplusplus
751 }
752 #endif
753 
754 #endif /* message.h */