source: trunk/third/ssh/bufaux.h @ 12646

Revision 12646, 1.8 KB checked in by danw, 26 years ago (diff)
This commit was generated by cvs2svn to compensate for changes in r12645, which included commits to RCS files with non-trunk default branches.
Line 
1/*
2
3bufaux.h
4
5Author: Tatu Ylonen <ylo@cs.hut.fi>
6
7Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
8                   All rights reserved
9
10Created: Wed Mar 29 02:18:23 1995 ylo
11
12*/
13
14/*
15 * $Id: bufaux.h,v 1.1.1.2 1999-03-08 17:43:40 danw Exp $
16 * $Log: not supported by cvs2svn $
17 * Revision 1.1.1.1  1996/02/18  21:38:11  ylo
18 *      Imported ssh-1.2.13.
19 *
20 * Revision 1.2  1995/07/13  01:18:07  ylo
21 *      Removed "Last modified" header.
22 *      Added cvs log.
23 *
24 * $Endlog$
25 */
26
27#ifndef BUFAUX_H
28#define BUFAUX_H
29
30#include "buffer.h"
31
32/* Stores an MP_INT in the buffer with a 2-byte msb first bit count, followed
33   by (bits+7)/8 bytes of binary data, msb first. */
34void buffer_put_mp_int(Buffer *buffer, MP_INT *value);
35
36/* Retrieves an MP_INT from the buffer. */
37void buffer_get_mp_int(Buffer *buffer, MP_INT *value);
38
39/* Returns an integer from the buffer (4 bytes, msb first). */
40unsigned int buffer_get_int(Buffer *buffer);
41
42/* Stores an integer in the buffer in 4 bytes, msb first. */
43void buffer_put_int(Buffer *buffer, unsigned int value);
44
45/* Returns a character from the buffer (0 - 255). */
46int buffer_get_char(Buffer *buffer);
47
48/* Stores a character in the buffer. */
49void buffer_put_char(Buffer *buffer, int value);
50
51/* Returns an arbitrary binary string from the buffer.  The string cannot
52   be longer than 256k.  The returned value points to memory allocated
53   with xmalloc; it is the responsibility of the calling function to free
54   the data.  If length_ptr is non-NULL, the length of the returned data
55   will be stored there.  A null character will be automatically appended
56   to the returned string, and is not counted in length. */
57char *buffer_get_string(Buffer *buffer, unsigned int *length_ptr);
58
59/* Stores and arbitrary binary string in the buffer. */
60void buffer_put_string(Buffer *buffer, const void *buf, unsigned int len);
61
62#endif /* BUFAUX_H */
Note: See TracBrowser for help on using the repository browser.