Add `gnutls/dtls.h' to the distribution.
[gnutls.git] / lib / opencdk / filters.h
blobfc770eaabc8cbd7d1378677d9619f8b27dc56a57
1 /* filters.h - Filter structs
2 * Copyright (C) 2002, 2003, 2008, 2010 Free Software Foundation, Inc.
4 * Author: Timo Schulz
6 * This file is part of OpenCDK.
8 * The OpenCDK library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public License
10 * as published by the Free Software Foundation; either version 2.1 of
11 * the License, or (at your option) any later version.
13 * This library is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this library; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
21 * USA
24 #ifndef CDK_FILTERS_H
25 #define CDK_FILTERS_H
27 enum
29 STREAMCTL_READ = 0,
30 STREAMCTL_WRITE = 1,
31 STREAMCTL_FREE = 2
34 typedef struct
36 cipher_hd_st hd;
37 digest_hd_st mdc;
38 int mdc_method;
39 u32 datalen;
40 struct
42 size_t on;
43 off_t size;
44 off_t nleft;
45 } blkmode;
46 cdk_stream_t s;
47 } cipher_filter_t;
49 typedef struct
51 int digest_algo;
52 digest_hd_st md;
53 int md_initialized;
54 } md_filter_t;
56 typedef struct
58 const char *le; /* line endings */
59 const char *hdrlines;
60 u32 crc;
61 int crc_okay;
62 int idx, idx2;
63 } armor_filter_t;
65 typedef struct
67 cdk_lit_format_t mode;
68 char *orig_filename; /* This original name of the input file. */
69 char *filename;
70 digest_hd_st md;
71 int md_initialized;
72 struct
74 size_t on;
75 off_t size;
76 } blkmode;
77 } literal_filter_t;
79 typedef struct
81 size_t inbufsize;
82 byte inbuf[8192];
83 size_t outbufsize;
84 byte outbuf[8192];
85 int algo; /* compress algo */
86 int level;
87 } compress_filter_t;
89 typedef struct
91 const char *lf;
92 } text_filter_t;
95 /*-- armor.c -*/
96 int _cdk_filter_armor (void *opaque, int ctl, FILE * in, FILE * out);
98 /*-- cipher.c --*/
99 cdk_error_t _cdk_filter_hash (void *opaque, int ctl, FILE * in, FILE * out);
100 cdk_error_t _cdk_filter_cipher (void *opaque, int ctl, FILE * in, FILE * out);
102 /*-- literal.c --*/
103 int _cdk_filter_literal (void *opaque, int ctl, FILE * in, FILE * out);
104 int _cdk_filter_text (void *opaque, int ctl, FILE * in, FILE * out);
106 /*-- compress.c --*/
107 cdk_error_t _cdk_filter_compress (void *opaque, int ctl,
108 FILE * in, FILE * out);
110 #endif /* CDK_FILTERS_H */