diff options
| author | SkyperTHC | 2026-03-04 16:56:48 +0000 |
|---|---|---|
| committer | SkyperTHC | 2026-03-04 16:56:48 +0000 |
| commit | 9da824575b3f4496431691bdb3f6ce45c601accc (patch) | |
| tree | 781ffcc47483852cc340a7a84b2508aae292db83 /other/openssh-2.1.1p4/buffer.h | |
| parent | bf6359d15fbb74aa95d36b1137fdc785def1bc46 (diff) | |
packetstorm sync
Diffstat (limited to 'other/openssh-2.1.1p4/buffer.h')
| -rw-r--r-- | other/openssh-2.1.1p4/buffer.h | 68 |
1 files changed, 0 insertions, 68 deletions
diff --git a/other/openssh-2.1.1p4/buffer.h b/other/openssh-2.1.1p4/buffer.h deleted file mode 100644 index a2b4eff..0000000 --- a/other/openssh-2.1.1p4/buffer.h +++ /dev/null | |||
| @@ -1,68 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * | ||
| 3 | * buffer.h | ||
| 4 | * | ||
| 5 | * Author: Tatu Ylonen <ylo@cs.hut.fi> | ||
| 6 | * | ||
| 7 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland | ||
| 8 | * All rights reserved | ||
| 9 | * | ||
| 10 | * Created: Sat Mar 18 04:12:25 1995 ylo | ||
| 11 | * | ||
| 12 | * Code for manipulating FIFO buffers. | ||
| 13 | * | ||
| 14 | */ | ||
| 15 | |||
| 16 | /* RCSID("$OpenBSD: buffer.h,v 1.5 2000/06/20 01:39:39 markus Exp $"); */ | ||
| 17 | |||
| 18 | #ifndef BUFFER_H | ||
| 19 | #define BUFFER_H | ||
| 20 | |||
| 21 | typedef struct { | ||
| 22 | char *buf; /* Buffer for data. */ | ||
| 23 | unsigned int alloc; /* Number of bytes allocated for data. */ | ||
| 24 | unsigned int offset; /* Offset of first byte containing data. */ | ||
| 25 | unsigned int end; /* Offset of last byte containing data. */ | ||
| 26 | } Buffer; | ||
| 27 | /* Initializes the buffer structure. */ | ||
| 28 | void buffer_init(Buffer * buffer); | ||
| 29 | |||
| 30 | /* Frees any memory used for the buffer. */ | ||
| 31 | void buffer_free(Buffer * buffer); | ||
| 32 | |||
| 33 | /* Clears any data from the buffer, making it empty. This does not actually | ||
| 34 | zero the memory. */ | ||
| 35 | void buffer_clear(Buffer * buffer); | ||
| 36 | |||
| 37 | /* Appends data to the buffer, expanding it if necessary. */ | ||
| 38 | void buffer_append(Buffer * buffer, const char *data, unsigned int len); | ||
| 39 | |||
| 40 | /* | ||
| 41 | * Appends space to the buffer, expanding the buffer if necessary. This does | ||
| 42 | * not actually copy the data into the buffer, but instead returns a pointer | ||
| 43 | * to the allocated region. | ||
| 44 | */ | ||
| 45 | void buffer_append_space(Buffer * buffer, char **datap, unsigned int len); | ||
| 46 | |||
| 47 | /* Returns the number of bytes of data in the buffer. */ | ||
| 48 | unsigned int buffer_len(Buffer * buffer); | ||
| 49 | |||
| 50 | /* Gets data from the beginning of the buffer. */ | ||
| 51 | void buffer_get(Buffer * buffer, char *buf, unsigned int len); | ||
| 52 | |||
| 53 | /* Consumes the given number of bytes from the beginning of the buffer. */ | ||
| 54 | void buffer_consume(Buffer * buffer, unsigned int bytes); | ||
| 55 | |||
| 56 | /* Consumes the given number of bytes from the end of the buffer. */ | ||
| 57 | void buffer_consume_end(Buffer * buffer, unsigned int bytes); | ||
| 58 | |||
| 59 | /* Returns a pointer to the first used byte in the buffer. */ | ||
| 60 | char *buffer_ptr(Buffer * buffer); | ||
| 61 | |||
| 62 | /* | ||
| 63 | * Dumps the contents of the buffer to stderr in hex. This intended for | ||
| 64 | * debugging purposes only. | ||
| 65 | */ | ||
| 66 | void buffer_dump(Buffer * buffer); | ||
| 67 | |||
| 68 | #endif /* BUFFER_H */ | ||
