|
Packit Service |
4684c1 |
/*
|
|
Packit Service |
4684c1 |
The MIT License (MIT)
|
|
Packit Service |
4684c1 |
|
|
Packit Service |
4684c1 |
Copyright (c) 2016 Wrymouth Innovation Ltd
|
|
Packit Service |
4684c1 |
|
|
Packit Service |
4684c1 |
Permission is hereby granted, free of charge, to any person obtaining a
|
|
Packit Service |
4684c1 |
copy of this software and associated documentation files (the "Software"),
|
|
Packit Service |
4684c1 |
to deal in the Software without restriction, including without limitation
|
|
Packit Service |
4684c1 |
the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
|
Packit Service |
4684c1 |
and/or sell copies of the Software, and to permit persons to whom the
|
|
Packit Service |
4684c1 |
Software is furnished to do so, subject to the following conditions:
|
|
Packit Service |
4684c1 |
|
|
Packit Service |
4684c1 |
The above copyright notice and this permission notice shall be included
|
|
Packit Service |
4684c1 |
in all copies or substantial portions of the Software.
|
|
Packit Service |
4684c1 |
|
|
Packit Service |
4684c1 |
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
Packit Service |
4684c1 |
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
Packit Service |
4684c1 |
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
|
Packit Service |
4684c1 |
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
|
Packit Service |
4684c1 |
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
|
Packit Service |
4684c1 |
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
|
Packit Service |
4684c1 |
OTHER DEALINGS IN THE SOFTWARE.
|
|
Packit Service |
4684c1 |
*/
|
|
Packit Service |
4684c1 |
|
|
Packit Service |
4684c1 |
#ifndef __TLSPROXY_BUFFERS_H
|
|
Packit Service |
4684c1 |
#define __TLSPROXY_BUFFERS_H
|
|
Packit Service |
4684c1 |
|
|
Packit Service |
4684c1 |
#include <stdlib.h>
|
|
Packit Service |
4684c1 |
#include <sys/types.h>
|
|
Packit Service |
4684c1 |
|
|
Packit Service |
4684c1 |
typedef struct buffer buffer_t;
|
|
Packit Service |
4684c1 |
|
|
Packit Service |
4684c1 |
buffer_t *bufNew (ssize_t size, ssize_t hwm);
|
|
Packit Service |
4684c1 |
void bufFree (buffer_t * b);
|
|
Packit Service |
4684c1 |
ssize_t bufGetReadSpan (buffer_t * b, void **addr);
|
|
Packit Service |
4684c1 |
ssize_t bufGetWriteSpan (buffer_t * b, void **addr);
|
|
Packit Service |
4684c1 |
void bufDoneRead (buffer_t * b, ssize_t size);
|
|
Packit Service |
4684c1 |
void bufDoneWrite (buffer_t * b, ssize_t size);
|
|
Packit Service |
4684c1 |
int bufIsEmpty (buffer_t * b);
|
|
Packit Service |
4684c1 |
int bufIsFull (buffer_t * b);
|
|
Packit Service |
4684c1 |
int bufIsOverHWM (buffer_t * b);
|
|
Packit Service |
4684c1 |
ssize_t bufGetFree (buffer_t * b);
|
|
Packit Service |
4684c1 |
ssize_t bufGetCount (buffer_t * b);
|
|
Packit Service |
4684c1 |
|
|
Packit Service |
4684c1 |
#endif
|