summaryrefslogtreecommitdiff
path: root/lib/opencdk/stream.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/opencdk/stream.h')
-rw-r--r--lib/opencdk/stream.h119
1 files changed, 56 insertions, 63 deletions
diff --git a/lib/opencdk/stream.h b/lib/opencdk/stream.h
index be57fb2963..3a7b93495e 100644
--- a/lib/opencdk/stream.h
+++ b/lib/opencdk/stream.h
@@ -26,77 +26,70 @@
/* The default buffer size for the stream. */
#define STREAM_BUFSIZE 8192
-enum
-{
- fDUMMY = 0,
- fARMOR = 1,
- fCIPHER = 2,
- fLITERAL = 3,
- fCOMPRESS = 4,
- fHASH = 5,
- fTEXT = 6
+enum {
+ fDUMMY = 0,
+ fARMOR = 1,
+ fCIPHER = 2,
+ fLITERAL = 3,
+ fCOMPRESS = 4,
+ fHASH = 5,
+ fTEXT = 6
};
/* Type definition for the filter function. */
-typedef cdk_error_t (*filter_fnct_t) (void *uint8_t, int ctl, FILE * in,
- FILE * out);
+typedef cdk_error_t(*filter_fnct_t) (void *uint8_t, int ctl, FILE * in,
+ FILE * out);
/* The stream filter context structure. */
-struct stream_filter_s
-{
- struct stream_filter_s *next;
- filter_fnct_t fnct;
- void *uint8_t;
- FILE *tmp;
- union
- {
- armor_filter_t afx;
- cipher_filter_t cfx;
- literal_filter_t pfx;
- compress_filter_t zfx;
- text_filter_t tfx;
- md_filter_t mfx;
- } u;
- struct
- {
- unsigned enabled:1;
- unsigned rdonly:1;
- unsigned error:1;
- } flags;
- unsigned type;
- unsigned ctl;
+struct stream_filter_s {
+ struct stream_filter_s *next;
+ filter_fnct_t fnct;
+ void *uint8_t;
+ FILE *tmp;
+ union {
+ armor_filter_t afx;
+ cipher_filter_t cfx;
+ literal_filter_t pfx;
+ compress_filter_t zfx;
+ text_filter_t tfx;
+ md_filter_t mfx;
+ } u;
+ struct {
+ unsigned enabled:1;
+ unsigned rdonly:1;
+ unsigned error:1;
+ } flags;
+ unsigned type;
+ unsigned ctl;
};
/* The stream context structure. */
-struct cdk_stream_s
-{
- struct stream_filter_s *filters;
- int fmode;
- int error;
- size_t blkmode;
- struct
- {
- unsigned filtrated:1;
- unsigned eof:1;
- unsigned write:1;
- unsigned temp:1;
- unsigned reset:1;
- unsigned no_filter:1;
- unsigned compressed:3;
- } flags;
- struct
- {
- unsigned char *buf;
- unsigned on:1;
- size_t size;
- size_t alloced;
- } cache;
- char *fname;
- FILE *fp;
- unsigned int fp_ref:1;
- struct cdk_stream_cbs_s cbs;
- void *cbs_hd;
+struct cdk_stream_s {
+ struct stream_filter_s *filters;
+ int fmode;
+ int error;
+ size_t blkmode;
+ struct {
+ unsigned filtrated:1;
+ unsigned eof:1;
+ unsigned write:1;
+ unsigned temp:1;
+ unsigned reset:1;
+ unsigned no_filter:1;
+ unsigned compressed:3;
+ } flags;
+ struct {
+ unsigned char *buf;
+ unsigned on:1;
+ size_t size;
+ size_t alloced;
+ } cache;
+ char *fname;
+ FILE *fp;
+ unsigned int fp_ref:1;
+ struct cdk_stream_cbs_s cbs;
+ void *cbs_hd;
};
-#endif /* CDK_STREAM_H */
+#endif /* CDK_STREAM_H */