Use C99 uint32_t rather than u_int32_t
[onak.git] / armor.h
1 /*
2  * armor.h - Routines to (de)armor OpenPGP packet streams.
3  *
4  * Copyright 2002-2004, 2011 Jonathan McDowell <noodles@earth.li>
5  *
6  * This program is free software: you can redistribute it and/or modify it
7  * under the terms of the GNU General Public License as published by the Free
8  * Software Foundation; version 2 of the License.
9  *
10  * This program is distributed in the hope that it will be useful, but WITHOUT
11  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
13  * more details.
14  *
15  * You should have received a copy of the GNU General Public License along with
16  * this program; if not, write to the Free Software Foundation, Inc., 51
17  * Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18  */
19
20 #ifndef __ARMOR_H__
21 #define __ARMOR_H__
22
23 #include "keystructs.h"
24
25 /**
26  *      armor_openpgp_stream - Takes a list of OpenPGP packets and armors it.
27  *      @putchar_func: The function to output the next armor character.
28  *      @ctx: The context pointer for putchar_func.
29  *      @packets: The list of packets to output.
30  *
31  *      This function ASCII armors a list of OpenPGP packets and outputs it
32  *      using putchar_func.
33  */
34 int armor_openpgp_stream(int (*putchar_func)(void *ctx, size_t count,
35                                                 void *c),
36                                 void *ctx,
37                                 struct openpgp_packet_list *packets);
38
39 /**
40  *      dearmor_openpgp_stream - Reads & decodes an ACSII armored OpenPGP msg.
41  *      @getchar_func: The function to get the next character from the stream.
42  *      @ctx: The context pointer for getchar_func.
43  *      @packets: The list of packets.
44  *
45  *      This function uses getchar_func to read characters from an ASCII
46  *      armored OpenPGP stream and outputs the data as a linked list of
47  *      packets.
48  */
49 int dearmor_openpgp_stream(int (*getchar_func)(void *ctx, size_t count,
50                                         void *c),
51                                 void *ctx,
52                                 struct openpgp_packet_list **packets);
53
54 #endif /* __ARMOR_H__ */