mirror of
https://github.com/libevent/libevent.git
synced 2025-01-09 00:56:20 +08:00
Move obsolete evbuffer function into include/event2/buffer_compat.h
svn:r1043
This commit is contained in:
parent
c735f2b45a
commit
ec2f4cbc09
3
buffer.c
3
buffer.c
@ -67,6 +67,7 @@
|
||||
|
||||
#include "event2/event.h"
|
||||
#include "event2/buffer.h"
|
||||
#include "event2/buffer_compat.h"
|
||||
#include "config.h"
|
||||
#include "log-internal.h"
|
||||
#include "mm-internal.h"
|
||||
@ -132,7 +133,7 @@ evbuffer_invoke_callbacks(struct evbuffer *buffer, size_t old_size)
|
||||
static void
|
||||
evbuffer_remove_all_callbacks(struct evbuffer *buffer)
|
||||
{
|
||||
struct evbuffer_cb_entry *cbent, *next;
|
||||
struct evbuffer_cb_entry *cbent;
|
||||
while ((cbent = TAILQ_FIRST(&buffer->callbacks))) {
|
||||
TAILQ_REMOVE(&buffer->callbacks, cbent, next);
|
||||
mm_free(cbent);
|
||||
|
@ -51,6 +51,7 @@
|
||||
#include "event2/util.h"
|
||||
#include "event2/bufferevent.h"
|
||||
#include "event2/buffer.h"
|
||||
#include "event2/buffer_compat.h"
|
||||
#include "event2/bufferevent_struct.h"
|
||||
#include "event2/event.h"
|
||||
#include "log-internal.h"
|
||||
|
1
event.h
1
event.h
@ -189,6 +189,7 @@ typedef unsigned short u_short;
|
||||
#include <event2/event.h>
|
||||
#include <event2/event_compat.h>
|
||||
#include <event2/buffer.h>
|
||||
#include <event2/buffer_compat.h>
|
||||
#include <event2/bufferevent.h>
|
||||
#include <event2/bufferevent_struct.h>
|
||||
#include <event2/tag.h>
|
||||
|
@ -219,14 +219,6 @@ enum evbuffer_eol_style {
|
||||
char *evbuffer_readln(struct evbuffer *buffer, size_t *n_read_out,
|
||||
enum evbuffer_eol_style eol_style);
|
||||
|
||||
/**
|
||||
Obsolete alias for evbuffer_readln(buffer, NULL, EOL_STYLE_ANY).
|
||||
|
||||
@param buffer the evbuffer to read from
|
||||
@return pointer to a single line, or NULL if an error occurred
|
||||
*/
|
||||
char *evbuffer_readline(struct evbuffer *buffer);
|
||||
|
||||
/**
|
||||
Move data from one evbuffer into another evbuffer.
|
||||
|
||||
|
35
include/event2/buffer_compat.h
Normal file
35
include/event2/buffer_compat.h
Normal file
@ -0,0 +1,35 @@
|
||||
|
||||
#ifndef _EVENT2_BUFFER_COMPAT_H_
|
||||
#define _EVENT2_BUFFER_COMPAT_H_
|
||||
|
||||
/** @file buffer_compat.h
|
||||
|
||||
Obsolete and deprecated versions of the functions in buffer.h: provided
|
||||
only for backward compatibility.
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
Obsolete alias for evbuffer_readln(buffer, NULL, EOL_STYLE_ANY).
|
||||
|
||||
@param buffer the evbuffer to read from
|
||||
@return pointer to a single line, or NULL if an error occurred
|
||||
*/
|
||||
char *evbuffer_readline(struct evbuffer *buffer);
|
||||
|
||||
/**
|
||||
Replace all callbacks on an evbuffer with a single new callback, or
|
||||
remove them.
|
||||
|
||||
Subsequent calls to evbuffer_setcb() replace callbacks set by previous
|
||||
calls. Setting the callback to NULL removes any previously set callback.
|
||||
|
||||
@param buffer the evbuffer to be monitored
|
||||
@param cb the callback function to invoke when the evbuffer is modified,
|
||||
or NULL to remove all callbacks.
|
||||
@param cbarg an argument to be provided to the callback function
|
||||
*/
|
||||
void evbuffer_setcb(struct evbuffer *buffer, evbuffer_cb cb, void *cbarg);
|
||||
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user