~ubuntu-branches/ubuntu/wily/syslog-ng/wily-proposed

« back to all changes in this revision

Viewing changes to modules/afamqp/rabbitmq-c/librabbitmq/amqp.h

  • Committer: Package Import Robot
  • Author(s): Gergely Nagy, Gergely Nagy
  • Date: 2013-11-04 15:27:37 UTC
  • mfrom: (1.3.12)
  • Revision ID: package-import@ubuntu.com-20131104152737-mqh6eqtna2xk97jq
Tags: 3.5.1-1
[ Gergely Nagy <algernon@madhouse-project.org> ]
* New upstream release.
  + Support auto-loading modules (Closes: #650814)
  + The SMTP module is available in syslog-ng-mod-smtp (Closes: #722746)
  + New modules: amqp, geoip, stomp, redis and smtp.
  + Multi-line input support (indented multiline and regexp-based)
  + Template type hinting for the MongoDB destination and $(format-json)
  + Support for unit suffixes in the configuration file
  + New filters, template functions and other miscellaneous changes
* New (team) maintainer, Laszlo Boszormenyi, Attila Szalay and myself
  added to Uploaders.
* Ship /var/lib/syslog-ng in the syslog-ng-core package, instead of
  creating it in the init script. Thanks Michael Biebl
  <biebl@debian.org> for the report & assistance. (Closes: #699942, #719910)
* Use dh-systemd for proper systemd-related maintainer scripts. Based on
  a patch by Michael Biebl <biebl@debian.org>. (Closes: #713982,
  #690067)
* Do not wait for syslog-ng to settle down during installation / update.
  This also fixes installing via debootstrap and a fake
  start-stop-daemon. (Closes: #714254)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * ***** BEGIN LICENSE BLOCK *****
 
3
 * Version: MIT
 
4
 *
 
5
 * Portions created by VMware are Copyright (c) 2007-2012 VMware, Inc.
 
6
 * All Rights Reserved.
 
7
 *
 
8
 * Portions created by Tony Garnock-Jones are Copyright (c) 2009-2010
 
9
 * VMware, Inc. and Tony Garnock-Jones. All Rights Reserved.
 
10
 *
 
11
 * Permission is hereby granted, free of charge, to any person
 
12
 * obtaining a copy of this software and associated documentation
 
13
 * files (the "Software"), to deal in the Software without
 
14
 * restriction, including without limitation the rights to use, copy,
 
15
 * modify, merge, publish, distribute, sublicense, and/or sell copies
 
16
 * of the Software, and to permit persons to whom the Software is
 
17
 * furnished to do so, subject to the following conditions:
 
18
 *
 
19
 * The above copyright notice and this permission notice shall be
 
20
 * included in all copies or substantial portions of the Software.
 
21
 *
 
22
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 
23
 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 
24
 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 
25
 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
 
26
 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
 
27
 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
 
28
 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 
29
 * SOFTWARE.
 
30
 * ***** END LICENSE BLOCK *****
 
31
 */
 
32
 
 
33
#ifndef AMQP_H
 
34
#define AMQP_H
 
35
 
 
36
#ifdef __cplusplus
 
37
#define AMQP_BEGIN_DECLS extern "C" {
 
38
#define AMQP_END_DECLS }
 
39
#else
 
40
#define AMQP_BEGIN_DECLS
 
41
#define AMQP_END_DECLS
 
42
#endif
 
43
 
 
44
/** Important API Decorators
 
45
  * AMQP_PUBLIC_FUNCTION - Declares an exportable function
 
46
  * AMQP_PUBLIC_VARIABLE - Declares an exportable variable
 
47
  * AMQP_CALL - Declares the calling convention
 
48
  */
 
49
 
 
50
#if defined(_WIN32) && defined(_MSC_VER)
 
51
# if defined(AMQP_BUILD) && !defined(AMQP_STATIC)
 
52
#  define AMQP_PUBLIC_FUNCTION __declspec(dllexport)
 
53
#  define AMQP_PUBLIC_VARIABLE __declspec(dllexport) extern
 
54
# else
 
55
#  define AMQP_PUBLIC_FUNCTION
 
56
#  if !defined(AMQP_STATIC)
 
57
#   define AMQP_PUBLIC_VARIABLE __declspec(dllimport) extern
 
58
#  else
 
59
#   define AMQP_PUBLIC_VARIABLE extern
 
60
#  endif
 
61
# endif
 
62
# define AMQP_CALL __cdecl
 
63
 
 
64
#elif defined(_WIN32) && defined(__BORLANDC__)
 
65
# if defined(AMQP_BUILD) && !defined(AMQP_STATIC)
 
66
#  define AMQP_PUBLIC_FUNCTION __declspec(dllexport)
 
67
#  define AMQP_PUBLIC_VARIABLE __declspec(dllexport) extern
 
68
# else
 
69
#  define AMQP_PUBLIC_FUNCTION
 
70
#  if !defined(AMQP_STATIC)
 
71
#   define AMQP_PUBLIC_VARIABLE __declspec(dllimport) extern
 
72
#  else
 
73
#   define AMQP_PUBLIC_VARIABLE extern
 
74
#  endif
 
75
# endif
 
76
# define AMQP_CALL __cdecl
 
77
 
 
78
#elif defined(_WIN32) && defined(__MINGW32__)
 
79
# if defined(AMQP_BUILD) && !defined(AMQP_STATIC)
 
80
#  define AMQP_PUBLIC_FUNCTION __declspec(dllexport)
 
81
#  define AMQP_PUBLIC_VARIABLE __declspec(dllexport)
 
82
# else
 
83
#  define AMQP_PUBLIC_FUNCTION
 
84
#  if !defined(AMQP_STATIC)
 
85
#   define AMQP_PUBLIC_VARIABLE __declspec(dllimport) extern
 
86
#  else
 
87
#   define AMQP_PUBLIC_VARIABLE extern
 
88
#  endif
 
89
# endif
 
90
# define AMQP_CALL __cdecl
 
91
 
 
92
#elif defined(_WIN32) && defined(__CYGWIN__)
 
93
# if defined(AMQP_BUILD) && !defined(AMQP_STATIC)
 
94
#  define AMQP_PUBLIC_FUNCTION __declspec(dllexport)
 
95
#  define AMQP_PUBLIC_VARIABLE __declspec(dllexport)
 
96
# else
 
97
#  define AMQP_PUBLIC_FUNCTION
 
98
#  if !defined(AMQP_STATIC)
 
99
#   define AMQP_PUBLIC_VARIABLE __declspec(dllimport) extern
 
100
#  else
 
101
#   define AMQP_PUBLIC_VARIABLE extern
 
102
#  endif
 
103
# endif
 
104
# define AMQP_CALL __cdecl
 
105
 
 
106
#elif defined(__GNUC__) && __GNUC__ >= 4
 
107
# define AMQP_PUBLIC_FUNCTION \
 
108
  __attribute__ ((visibility ("default")))
 
109
# define AMQP_PUBLIC_VARIABLE \
 
110
  __attribute__ ((visibility ("default"))) extern
 
111
# define AMQP_CALL
 
112
#else
 
113
# define AMQP_PUBLIC_FUNCTION
 
114
# define AMQP_PUBLIC_VARIABLE extern
 
115
# define AMQP_CALL
 
116
#endif
 
117
 
 
118
#include <stddef.h>
 
119
#include <stdint.h>
 
120
 
 
121
AMQP_BEGIN_DECLS
 
122
 
 
123
typedef int amqp_boolean_t;
 
124
typedef uint32_t amqp_method_number_t;
 
125
typedef uint32_t amqp_flags_t;
 
126
typedef uint16_t amqp_channel_t;
 
127
 
 
128
typedef struct amqp_bytes_t_ {
 
129
  size_t len;
 
130
  void *bytes;
 
131
} amqp_bytes_t;
 
132
 
 
133
typedef struct amqp_decimal_t_ {
 
134
  uint8_t decimals;
 
135
  uint32_t value;
 
136
} amqp_decimal_t;
 
137
 
 
138
typedef struct amqp_table_t_ {
 
139
  int num_entries;
 
140
  struct amqp_table_entry_t_ *entries;
 
141
} amqp_table_t;
 
142
 
 
143
typedef struct amqp_array_t_ {
 
144
  int num_entries;
 
145
  struct amqp_field_value_t_ *entries;
 
146
} amqp_array_t;
 
147
 
 
148
/*
 
149
  0-9   0-9-1   Qpid/Rabbit  Type               Remarks
 
150
---------------------------------------------------------------------------
 
151
        t       t            Boolean
 
152
        b       b            Signed 8-bit
 
153
        B                    Unsigned 8-bit
 
154
        U       s            Signed 16-bit      (A1)
 
155
        u                    Unsigned 16-bit
 
156
  I     I       I            Signed 32-bit
 
157
        i                    Unsigned 32-bit
 
158
        L       l            Signed 64-bit      (B)
 
159
        l                    Unsigned 64-bit
 
160
        f       f            32-bit float
 
161
        d       d            64-bit float
 
162
  D     D       D            Decimal
 
163
        s                    Short string       (A2)
 
164
  S     S       S            Long string
 
165
        A                    Nested Array
 
166
  T     T       T            Timestamp (u64)
 
167
  F     F       F            Nested Table
 
168
  V     V       V            Void
 
169
                x            Byte array
 
170
 
 
171
Remarks:
 
172
 
 
173
 A1, A2: Notice how the types **CONFLICT** here. In Qpid and Rabbit,
 
174
         's' means a signed 16-bit integer; in 0-9-1, it means a
 
175
         short string.
 
176
 
 
177
 B: Notice how the signednesses **CONFLICT** here. In Qpid and Rabbit,
 
178
    'l' means a signed 64-bit integer; in 0-9-1, it means an unsigned
 
179
    64-bit integer.
 
180
 
 
181
I'm going with the Qpid/Rabbit types, where there's a conflict, and
 
182
the 0-9-1 types otherwise. 0-8 is a subset of 0-9, which is a subset
 
183
of the other two, so this will work for both 0-8 and 0-9-1 branches of
 
184
the code.
 
185
*/
 
186
 
 
187
typedef struct amqp_field_value_t_ {
 
188
  uint8_t kind;
 
189
  union {
 
190
    amqp_boolean_t boolean;
 
191
    int8_t i8;
 
192
    uint8_t u8;
 
193
    int16_t i16;
 
194
    uint16_t u16;
 
195
    int32_t i32;
 
196
    uint32_t u32;
 
197
    int64_t i64;
 
198
    uint64_t u64;
 
199
    float f32;
 
200
    double f64;
 
201
    amqp_decimal_t decimal;
 
202
    amqp_bytes_t bytes;
 
203
    amqp_table_t table;
 
204
    amqp_array_t array;
 
205
  } value;
 
206
} amqp_field_value_t;
 
207
 
 
208
typedef struct amqp_table_entry_t_ {
 
209
  amqp_bytes_t key;
 
210
  amqp_field_value_t value;
 
211
} amqp_table_entry_t;
 
212
 
 
213
typedef enum {
 
214
  AMQP_FIELD_KIND_BOOLEAN = 't',
 
215
  AMQP_FIELD_KIND_I8 = 'b',
 
216
  AMQP_FIELD_KIND_U8 = 'B',
 
217
  AMQP_FIELD_KIND_I16 = 's',
 
218
  AMQP_FIELD_KIND_U16 = 'u',
 
219
  AMQP_FIELD_KIND_I32 = 'I',
 
220
  AMQP_FIELD_KIND_U32 = 'i',
 
221
  AMQP_FIELD_KIND_I64 = 'l',
 
222
  AMQP_FIELD_KIND_U64 = 'L',
 
223
  AMQP_FIELD_KIND_F32 = 'f',
 
224
  AMQP_FIELD_KIND_F64 = 'd',
 
225
  AMQP_FIELD_KIND_DECIMAL = 'D',
 
226
  AMQP_FIELD_KIND_UTF8 = 'S',
 
227
  AMQP_FIELD_KIND_ARRAY = 'A',
 
228
  AMQP_FIELD_KIND_TIMESTAMP = 'T',
 
229
  AMQP_FIELD_KIND_TABLE = 'F',
 
230
  AMQP_FIELD_KIND_VOID = 'V',
 
231
  AMQP_FIELD_KIND_BYTES = 'x'
 
232
} amqp_field_value_kind_t;
 
233
 
 
234
typedef struct amqp_pool_blocklist_t_ {
 
235
  int num_blocks;
 
236
  void **blocklist;
 
237
} amqp_pool_blocklist_t;
 
238
 
 
239
typedef struct amqp_pool_t_ {
 
240
  size_t pagesize;
 
241
 
 
242
  amqp_pool_blocklist_t pages;
 
243
  amqp_pool_blocklist_t large_blocks;
 
244
 
 
245
  int next_page;
 
246
  char *alloc_block;
 
247
  size_t alloc_used;
 
248
} amqp_pool_t;
 
249
 
 
250
typedef struct amqp_method_t_ {
 
251
  amqp_method_number_t id;
 
252
  void *decoded;
 
253
} amqp_method_t;
 
254
 
 
255
typedef struct amqp_frame_t_ {
 
256
  uint8_t frame_type; /* 0 means no event */
 
257
  amqp_channel_t channel;
 
258
  union {
 
259
    amqp_method_t method;
 
260
    struct {
 
261
      uint16_t class_id;
 
262
      uint64_t body_size;
 
263
      void *decoded;
 
264
      amqp_bytes_t raw;
 
265
    } properties;
 
266
    amqp_bytes_t body_fragment;
 
267
    struct {
 
268
      uint8_t transport_high;
 
269
      uint8_t transport_low;
 
270
      uint8_t protocol_version_major;
 
271
      uint8_t protocol_version_minor;
 
272
    } protocol_header;
 
273
  } payload;
 
274
} amqp_frame_t;
 
275
 
 
276
typedef enum amqp_response_type_enum_ {
 
277
  AMQP_RESPONSE_NONE = 0,
 
278
  AMQP_RESPONSE_NORMAL,
 
279
  AMQP_RESPONSE_LIBRARY_EXCEPTION,
 
280
  AMQP_RESPONSE_SERVER_EXCEPTION
 
281
} amqp_response_type_enum;
 
282
 
 
283
typedef struct amqp_rpc_reply_t_ {
 
284
  amqp_response_type_enum reply_type;
 
285
  amqp_method_t reply;
 
286
  int library_error; /* if AMQP_RESPONSE_LIBRARY_EXCEPTION, then 0 here means socket EOF */
 
287
} amqp_rpc_reply_t;
 
288
 
 
289
typedef enum amqp_sasl_method_enum_ {
 
290
  AMQP_SASL_METHOD_PLAIN = 0
 
291
} amqp_sasl_method_enum;
 
292
 
 
293
/* Opaque struct. */
 
294
typedef struct amqp_connection_state_t_ *amqp_connection_state_t;
 
295
 
 
296
AMQP_PUBLIC_FUNCTION
 
297
char const *
 
298
AMQP_CALL amqp_version(void);
 
299
 
 
300
/* Exported empty data structures */
 
301
AMQP_PUBLIC_VARIABLE const amqp_bytes_t amqp_empty_bytes;
 
302
AMQP_PUBLIC_VARIABLE const amqp_table_t amqp_empty_table;
 
303
AMQP_PUBLIC_VARIABLE const amqp_array_t amqp_empty_array;
 
304
 
 
305
/* Compatibility macros for the above, to avoid the need to update
 
306
   code written against earlier versions of librabbitmq. */
 
307
#define AMQP_EMPTY_BYTES amqp_empty_bytes
 
308
#define AMQP_EMPTY_TABLE amqp_empty_table
 
309
#define AMQP_EMPTY_ARRAY amqp_empty_array
 
310
 
 
311
AMQP_PUBLIC_FUNCTION
 
312
void
 
313
AMQP_CALL init_amqp_pool(amqp_pool_t *pool, size_t pagesize);
 
314
 
 
315
AMQP_PUBLIC_FUNCTION
 
316
void
 
317
AMQP_CALL recycle_amqp_pool(amqp_pool_t *pool);
 
318
 
 
319
AMQP_PUBLIC_FUNCTION
 
320
void
 
321
AMQP_CALL empty_amqp_pool(amqp_pool_t *pool);
 
322
 
 
323
AMQP_PUBLIC_FUNCTION
 
324
void *
 
325
AMQP_CALL amqp_pool_alloc(amqp_pool_t *pool, size_t amount);
 
326
 
 
327
AMQP_PUBLIC_FUNCTION
 
328
void
 
329
AMQP_CALL amqp_pool_alloc_bytes(amqp_pool_t *pool, size_t amount, amqp_bytes_t *output);
 
330
 
 
331
AMQP_PUBLIC_FUNCTION
 
332
amqp_bytes_t
 
333
AMQP_CALL amqp_cstring_bytes(char const *cstr);
 
334
 
 
335
AMQP_PUBLIC_FUNCTION
 
336
amqp_bytes_t
 
337
AMQP_CALL amqp_bytes_malloc_dup(amqp_bytes_t src);
 
338
 
 
339
AMQP_PUBLIC_FUNCTION
 
340
amqp_bytes_t
 
341
AMQP_CALL amqp_bytes_malloc(size_t amount);
 
342
 
 
343
AMQP_PUBLIC_FUNCTION
 
344
void
 
345
AMQP_CALL amqp_bytes_free(amqp_bytes_t bytes);
 
346
 
 
347
AMQP_PUBLIC_FUNCTION
 
348
amqp_connection_state_t
 
349
AMQP_CALL amqp_new_connection(void);
 
350
 
 
351
AMQP_PUBLIC_FUNCTION
 
352
int
 
353
AMQP_CALL amqp_get_sockfd(amqp_connection_state_t state);
 
354
 
 
355
AMQP_PUBLIC_FUNCTION
 
356
void
 
357
AMQP_CALL amqp_set_sockfd(amqp_connection_state_t state, int sockfd);
 
358
 
 
359
AMQP_PUBLIC_FUNCTION
 
360
int
 
361
AMQP_CALL amqp_tune_connection(amqp_connection_state_t state,
 
362
            int channel_max,
 
363
            int frame_max,
 
364
            int heartbeat);
 
365
 
 
366
AMQP_PUBLIC_FUNCTION
 
367
int
 
368
AMQP_CALL amqp_get_channel_max(amqp_connection_state_t state);
 
369
 
 
370
AMQP_PUBLIC_FUNCTION
 
371
int
 
372
AMQP_CALL amqp_destroy_connection(amqp_connection_state_t state);
 
373
 
 
374
AMQP_PUBLIC_FUNCTION
 
375
int
 
376
AMQP_CALL amqp_handle_input(amqp_connection_state_t state,
 
377
                        amqp_bytes_t received_data,
 
378
                        amqp_frame_t *decoded_frame);
 
379
 
 
380
AMQP_PUBLIC_FUNCTION
 
381
amqp_boolean_t
 
382
AMQP_CALL amqp_release_buffers_ok(amqp_connection_state_t state);
 
383
 
 
384
AMQP_PUBLIC_FUNCTION
 
385
void
 
386
AMQP_CALL amqp_release_buffers(amqp_connection_state_t state);
 
387
 
 
388
AMQP_PUBLIC_FUNCTION
 
389
void
 
390
AMQP_CALL amqp_maybe_release_buffers(amqp_connection_state_t state);
 
391
 
 
392
AMQP_PUBLIC_FUNCTION
 
393
int
 
394
AMQP_CALL amqp_send_frame(amqp_connection_state_t state, amqp_frame_t const *frame);
 
395
 
 
396
AMQP_PUBLIC_FUNCTION
 
397
int
 
398
AMQP_CALL amqp_table_entry_cmp(void const *entry1, void const *entry2);
 
399
 
 
400
AMQP_PUBLIC_FUNCTION
 
401
int
 
402
AMQP_CALL amqp_open_socket(char const *hostname, int portnumber);
 
403
 
 
404
AMQP_PUBLIC_FUNCTION
 
405
int
 
406
AMQP_CALL amqp_send_header(amqp_connection_state_t state);
 
407
 
 
408
AMQP_PUBLIC_FUNCTION
 
409
amqp_boolean_t
 
410
AMQP_CALL amqp_frames_enqueued(amqp_connection_state_t state);
 
411
 
 
412
AMQP_PUBLIC_FUNCTION
 
413
int
 
414
AMQP_CALL amqp_simple_wait_frame(amqp_connection_state_t state,
 
415
                       amqp_frame_t *decoded_frame);
 
416
 
 
417
AMQP_PUBLIC_FUNCTION
 
418
int
 
419
AMQP_CALL amqp_simple_wait_method(amqp_connection_state_t state,
 
420
                              amqp_channel_t expected_channel,
 
421
                              amqp_method_number_t expected_method,
 
422
                              amqp_method_t *output);
 
423
 
 
424
AMQP_PUBLIC_FUNCTION
 
425
int
 
426
AMQP_CALL amqp_send_method(amqp_connection_state_t state,
 
427
                        amqp_channel_t channel,
 
428
                        amqp_method_number_t id,
 
429
                        void *decoded);
 
430
 
 
431
AMQP_PUBLIC_FUNCTION
 
432
amqp_rpc_reply_t
 
433
AMQP_CALL amqp_simple_rpc(amqp_connection_state_t state,
 
434
                        amqp_channel_t channel,
 
435
                        amqp_method_number_t request_id,
 
436
                        amqp_method_number_t *expected_reply_ids,
 
437
                        void *decoded_request_method);
 
438
 
 
439
AMQP_PUBLIC_FUNCTION
 
440
void *
 
441
AMQP_CALL amqp_simple_rpc_decoded(amqp_connection_state_t state,
 
442
                        amqp_channel_t channel,
 
443
                              amqp_method_number_t request_id,
 
444
                              amqp_method_number_t reply_id,
 
445
                              void *decoded_request_method);
 
446
 
 
447
/*
 
448
 * The API methods corresponding to most synchronous AMQP methods
 
449
 * return a pointer to the decoded method result.  Upon error, they
 
450
 * return NULL, and we need some way of discovering what, if anything,
 
451
 * went wrong. amqp_get_rpc_reply() returns the most recent
 
452
 * amqp_rpc_reply_t instance corresponding to such an API operation
 
453
 * for the given connection.
 
454
 *
 
455
 * Only use it for operations that do not themselves return
 
456
 * amqp_rpc_reply_t; operations that do return amqp_rpc_reply_t
 
457
 * generally do NOT update this per-connection-global amqp_rpc_reply_t
 
458
 * instance.
 
459
 */
 
460
AMQP_PUBLIC_FUNCTION
 
461
amqp_rpc_reply_t
 
462
AMQP_CALL amqp_get_rpc_reply(amqp_connection_state_t state);
 
463
 
 
464
AMQP_PUBLIC_FUNCTION
 
465
amqp_rpc_reply_t
 
466
AMQP_CALL amqp_login(amqp_connection_state_t state, char const *vhost,
 
467
            int channel_max, int frame_max, int heartbeat,
 
468
                  amqp_sasl_method_enum sasl_method, ...);
 
469
 
 
470
struct amqp_basic_properties_t_;
 
471
 
 
472
AMQP_PUBLIC_FUNCTION
 
473
int
 
474
AMQP_CALL amqp_basic_publish(amqp_connection_state_t state, amqp_channel_t channel,
 
475
            amqp_bytes_t exchange, amqp_bytes_t routing_key,
 
476
                        amqp_boolean_t mandatory, amqp_boolean_t immediate,
 
477
                        struct amqp_basic_properties_t_ const *properties,
 
478
                        amqp_bytes_t body);
 
479
 
 
480
AMQP_PUBLIC_FUNCTION
 
481
amqp_rpc_reply_t
 
482
AMQP_CALL amqp_channel_close(amqp_connection_state_t state, amqp_channel_t channel,
 
483
                        int code);
 
484
 
 
485
AMQP_PUBLIC_FUNCTION
 
486
amqp_rpc_reply_t
 
487
AMQP_CALL amqp_connection_close(amqp_connection_state_t state, int code);
 
488
 
 
489
AMQP_PUBLIC_FUNCTION
 
490
int
 
491
AMQP_CALL amqp_basic_ack(amqp_connection_state_t state, amqp_channel_t channel,
 
492
                  uint64_t delivery_tag, amqp_boolean_t multiple);
 
493
 
 
494
AMQP_PUBLIC_FUNCTION
 
495
amqp_rpc_reply_t
 
496
AMQP_CALL amqp_basic_get(amqp_connection_state_t state, amqp_channel_t channel,
 
497
                  amqp_bytes_t queue, amqp_boolean_t no_ack);
 
498
 
 
499
AMQP_PUBLIC_FUNCTION
 
500
int
 
501
AMQP_CALL amqp_basic_reject(amqp_connection_state_t state, amqp_channel_t channel,
 
502
                        uint64_t delivery_tag, amqp_boolean_t requeue);
 
503
 
 
504
/*
 
505
 * Can be used to see if there is data still in the buffer, if so
 
506
 * calling amqp_simple_wait_frame will not immediately enter a
 
507
 * blocking read.
 
508
 *
 
509
 * Possibly amqp_frames_enqueued should be used for this?
 
510
 */
 
511
AMQP_PUBLIC_FUNCTION
 
512
amqp_boolean_t
 
513
AMQP_CALL amqp_data_in_buffer(amqp_connection_state_t state);
 
514
 
 
515
/*
 
516
 * Get the error string for the given error code.
 
517
 *
 
518
 * The returned string resides on the heap; the caller is responsible
 
519
 * for freeing it.
 
520
 */
 
521
AMQP_PUBLIC_FUNCTION
 
522
char *
 
523
AMQP_CALL amqp_error_string(int err);
 
524
 
 
525
AMQP_PUBLIC_FUNCTION
 
526
int
 
527
AMQP_CALL amqp_decode_table(amqp_bytes_t encoded, amqp_pool_t *pool,
 
528
                        amqp_table_t *output, size_t *offset);
 
529
 
 
530
AMQP_PUBLIC_FUNCTION
 
531
int
 
532
AMQP_CALL amqp_encode_table(amqp_bytes_t encoded, amqp_table_t *input, size_t *offset);
 
533
 
 
534
struct amqp_connection_info {
 
535
  char *user;
 
536
  char *password;
 
537
  char *host;
 
538
  char *vhost;
 
539
  int port;
 
540
};
 
541
 
 
542
AMQP_PUBLIC_FUNCTION
 
543
void 
 
544
AMQP_CALL amqp_default_connection_info(struct amqp_connection_info *parsed);
 
545
 
 
546
AMQP_PUBLIC_FUNCTION
 
547
int 
 
548
AMQP_CALL amqp_parse_url(char *url, struct amqp_connection_info *parsed);
 
549
 
 
550
AMQP_END_DECLS
 
551
 
 
552
#include <amqp_framing.h>
 
553
 
 
554
#endif /* AMQP_H */