C AMQP Protocol Engine API  0.5
proton/buffer.h
Go to the documentation of this file.
00001 #ifndef PROTON_BUFFER_H
00002 #define PROTON_BUFFER_H 1
00003 
00004 /*
00005  *
00006  * Licensed to the Apache Software Foundation (ASF) under one
00007  * or more contributor license agreements.  See the NOTICE file
00008  * distributed with this work for additional information
00009  * regarding copyright ownership.  The ASF licenses this file
00010  * to you under the Apache License, Version 2.0 (the
00011  * "License"); you may not use this file except in compliance
00012  * with the License.  You may obtain a copy of the License at
00013  *
00014  *   http://www.apache.org/licenses/LICENSE-2.0
00015  *
00016  * Unless required by applicable law or agreed to in writing,
00017  * software distributed under the License is distributed on an
00018  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
00019  * KIND, either express or implied.  See the License for the
00020  * specific language governing permissions and limitations
00021  * under the License.
00022  *
00023  */
00024 
00025 #include <proton/import_export.h>
00026 #include <proton/types.h>
00027 
00028 #ifdef __cplusplus
00029 extern "C" {
00030 #endif
00031 
00032 typedef struct pn_buffer_t pn_buffer_t;
00033 
00034 PN_EXTERN pn_buffer_t *pn_buffer(size_t capacity);
00035 PN_EXTERN void pn_buffer_free(pn_buffer_t *buf);
00036 PN_EXTERN size_t pn_buffer_size(pn_buffer_t *buf);
00037 PN_EXTERN size_t pn_buffer_capacity(pn_buffer_t *buf);
00038 PN_EXTERN size_t pn_buffer_available(pn_buffer_t *buf);
00039 PN_EXTERN int pn_buffer_ensure(pn_buffer_t *buf, size_t size);
00040 PN_EXTERN int pn_buffer_append(pn_buffer_t *buf, const char *bytes, size_t size);
00041 PN_EXTERN int pn_buffer_prepend(pn_buffer_t *buf, const char *bytes, size_t size);
00042 PN_EXTERN size_t pn_buffer_get(pn_buffer_t *buf, size_t offset, size_t size, char *dst);
00043 PN_EXTERN int pn_buffer_trim(pn_buffer_t *buf, size_t left, size_t right);
00044 PN_EXTERN void pn_buffer_clear(pn_buffer_t *buf);
00045 PN_EXTERN int pn_buffer_defrag(pn_buffer_t *buf);
00046 PN_EXTERN pn_bytes_t pn_buffer_bytes(pn_buffer_t *buf);
00047 PN_EXTERN int pn_buffer_print(pn_buffer_t *buf);
00048 
00049 #ifdef __cplusplus
00050 }
00051 #endif
00052 
00053 #endif /* buffer.h */