version 1.6.2.5, 2001/09/27 00:15:41 |
version 1.6.2.6, 2002/03/08 17:04:42 |
|
|
|
/* $OpenBSD$ */ |
|
|
/* |
/* |
* Author: Tatu Ylonen <ylo@cs.hut.fi> |
* Author: Tatu Ylonen <ylo@cs.hut.fi> |
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland |
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland |
|
|
* called by a name other than "ssh" or "Secure Shell". |
* called by a name other than "ssh" or "Secure Shell". |
*/ |
*/ |
|
|
/* RCSID("$OpenBSD$"); */ |
|
|
|
#ifndef BUFFER_H |
#ifndef BUFFER_H |
#define BUFFER_H |
#define BUFFER_H |
|
|
typedef struct { |
typedef struct { |
char *buf; /* Buffer for data. */ |
u_char *buf; /* Buffer for data. */ |
u_int alloc; /* Number of bytes allocated for data. */ |
u_int alloc; /* Number of bytes allocated for data. */ |
u_int offset; /* Offset of first byte containing data. */ |
u_int offset; /* Offset of first byte containing data. */ |
u_int end; /* Offset of last byte containing data. */ |
u_int end; /* Offset of last byte containing data. */ |
|
|
void buffer_free(Buffer *); |
void buffer_free(Buffer *); |
|
|
u_int buffer_len(Buffer *); |
u_int buffer_len(Buffer *); |
char *buffer_ptr(Buffer *); |
void *buffer_ptr(Buffer *); |
|
|
void buffer_append(Buffer *, const char *, u_int); |
void buffer_append(Buffer *, const void *, u_int); |
void buffer_append_space(Buffer *, char **, u_int); |
void *buffer_append_space(Buffer *, u_int); |
|
|
void buffer_get(Buffer *, char *, u_int); |
void buffer_get(Buffer *, void *, u_int); |
|
|
void buffer_consume(Buffer *, u_int); |
void buffer_consume(Buffer *, u_int); |
void buffer_consume_end(Buffer *, u_int); |
void buffer_consume_end(Buffer *, u_int); |