libevent
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines
event2/buffer_compat.h
Go to the documentation of this file.
00001 /*
00002  * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
00003  *
00004  * Redistribution and use in source and binary forms, with or without
00005  * modification, are permitted provided that the following conditions
00006  * are met:
00007  * 1. Redistributions of source code must retain the above copyright
00008  *    notice, this list of conditions and the following disclaimer.
00009  * 2. Redistributions in binary form must reproduce the above copyright
00010  *    notice, this list of conditions and the following disclaimer in the
00011  *    documentation and/or other materials provided with the distribution.
00012  * 3. The name of the author may not be used to endorse or promote products
00013  *    derived from this software without specific prior written permission.
00014  *
00015  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
00016  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
00017  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
00018  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
00019  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
00020  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
00021  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
00022  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
00023  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
00024  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00025  */
00026 
00027 #ifndef _EVENT2_BUFFER_COMPAT_H_
00028 #define _EVENT2_BUFFER_COMPAT_H_
00029 
00048 char *evbuffer_readline(struct evbuffer *buffer);
00049 
00070 typedef void (*evbuffer_cb)(struct evbuffer *buffer, size_t old_len, size_t new_len, void *arg);
00071 
00091 void evbuffer_setcb(struct evbuffer *buffer, evbuffer_cb cb, void *cbarg);
00092 
00093 
00102 unsigned char *evbuffer_find(struct evbuffer *buffer, const unsigned char *what, size_t len);
00103 
00105 #define EVBUFFER_LENGTH(x)      evbuffer_get_length(x)
00106 
00107 #define EVBUFFER_DATA(x)        evbuffer_pullup((x), -1)
00108 
00109 #endif
00110