Correct PPTP server firewall rules chain.
[tomato/davidwu.git] / release / src / router / nettle / examples / io.h
blobf79855da0091e44cfe5f0d2f63d242030cb7ff2c
1 /* io.c
3 * Miscellaneous functions used by the example programs.
4 */
6 /* nettle, low-level cryptographics library
8 * Copyright (C) 2002 Niels Möller
9 *
10 * The nettle library is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU Lesser General Public License as published by
12 * the Free Software Foundation; either version 2.1 of the License, or (at your
13 * option) any later version.
15 * The nettle library is distributed in the hope that it will be useful, but
16 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
17 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
18 * License for more details.
20 * You should have received a copy of the GNU Lesser General Public License
21 * along with the nettle library; see the file COPYING.LIB. If not, write to
22 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
23 * MA 02111-1301, USA.
26 #ifndef NETTLE_EXAMPLES_IO_H_INCLUDED
27 #define NETTLE_EXAMPLES_IO_H_INCLUDED
29 #include "nettle-meta.h"
30 #include "yarrow.h"
32 #include <stdio.h>
34 extern int quiet_flag;
36 void *
37 xalloc(size_t size);
39 void
40 werror(const char *format, ...) PRINTF_STYLE(1, 2);
42 /* If size is > 0, read at most that many bytes. If size == 0, read
43 * until EOF. Allocates the buffer dynamically. An empty file is
44 * treated as an error; return value is zero, and no space is
45 * allocated. The returned data is NUL-terminated, for convenience. */
47 unsigned
48 read_file(const char *name, unsigned size, char **buffer);
50 int
51 write_file(const char *name, unsigned size, const char *buffer);
53 int
54 write_string(FILE *f, unsigned size, const char *buffer);
56 int
57 simple_random(struct yarrow256_ctx *ctx, const char *name);
59 int
60 hash_file(const struct nettle_hash *hash, void *ctx, FILE *f);
62 #if WITH_HOGWEED
63 struct rsa_public_key;
64 struct rsa_private_key;
66 int
67 read_rsa_key(const char *name,
68 struct rsa_public_key *pub,
69 struct rsa_private_key *priv);
70 #endif /* WITH_HOGWEED */
72 #endif /* NETTLE_EXAMPLES_IO_H_INCLUDED */