source: trunk/third/openssh/buffer.h @ 18759

Revision 18759, 1.3 KB checked in by zacheiss, 22 years ago (diff)
This commit was generated by cvs2svn to compensate for changes in r18758, which included commits to RCS files with non-trunk default branches.
Line 
1/*      $OpenBSD: buffer.h,v 1.11 2002/03/04 17:27:39 stevesk Exp $     */
2
3/*
4 * Author: Tatu Ylonen <ylo@cs.hut.fi>
5 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
6 *                    All rights reserved
7 * Code for manipulating FIFO buffers.
8 *
9 * As far as I am concerned, the code I have written for this software
10 * can be used freely for any purpose.  Any derived versions of this
11 * software must be clearly marked as such, and if the derived work is
12 * incompatible with the protocol description in the RFC file, it must be
13 * called by a name other than "ssh" or "Secure Shell".
14 */
15
16#ifndef BUFFER_H
17#define BUFFER_H
18
19typedef struct {
20        u_char  *buf;           /* Buffer for data. */
21        u_int    alloc;         /* Number of bytes allocated for data. */
22        u_int    offset;        /* Offset of first byte containing data. */
23        u_int    end;           /* Offset of last byte containing data. */
24}       Buffer;
25
26void     buffer_init(Buffer *);
27void     buffer_clear(Buffer *);
28void     buffer_free(Buffer *);
29
30u_int    buffer_len(Buffer *);
31void    *buffer_ptr(Buffer *);
32
33void     buffer_append(Buffer *, const void *, u_int);
34void    *buffer_append_space(Buffer *, u_int);
35
36void     buffer_get(Buffer *, void *, u_int);
37
38void     buffer_consume(Buffer *, u_int);
39void     buffer_consume_end(Buffer *, u_int);
40
41void     buffer_dump(Buffer *);
42
43#endif                          /* BUFFER_H */
Note: See TracBrowser for help on using the repository browser.