xref: /onnv-gate/usr/src/common/openssl/crypto/comp/comp.h (revision 0:68f95e015346)
1*0Sstevel@tonic-gate 
2*0Sstevel@tonic-gate #ifndef HEADER_COMP_H
3*0Sstevel@tonic-gate #define HEADER_COMP_H
4*0Sstevel@tonic-gate 
5*0Sstevel@tonic-gate #include <openssl/crypto.h>
6*0Sstevel@tonic-gate 
7*0Sstevel@tonic-gate #ifdef  __cplusplus
8*0Sstevel@tonic-gate extern "C" {
9*0Sstevel@tonic-gate #endif
10*0Sstevel@tonic-gate 
11*0Sstevel@tonic-gate typedef struct comp_method_st
12*0Sstevel@tonic-gate 	{
13*0Sstevel@tonic-gate 	int type;		/* NID for compression library */
14*0Sstevel@tonic-gate 	const char *name;	/* A text string to identify the library */
15*0Sstevel@tonic-gate 	int (*init)();
16*0Sstevel@tonic-gate 	void (*finish)();
17*0Sstevel@tonic-gate 	int (*compress)();
18*0Sstevel@tonic-gate 	int (*expand)();
19*0Sstevel@tonic-gate 	long (*ctrl)();
20*0Sstevel@tonic-gate 	long (*callback_ctrl)();
21*0Sstevel@tonic-gate 	} COMP_METHOD;
22*0Sstevel@tonic-gate 
23*0Sstevel@tonic-gate typedef struct comp_ctx_st
24*0Sstevel@tonic-gate 	{
25*0Sstevel@tonic-gate 	COMP_METHOD *meth;
26*0Sstevel@tonic-gate 	unsigned long compress_in;
27*0Sstevel@tonic-gate 	unsigned long compress_out;
28*0Sstevel@tonic-gate 	unsigned long expand_in;
29*0Sstevel@tonic-gate 	unsigned long expand_out;
30*0Sstevel@tonic-gate 
31*0Sstevel@tonic-gate 	CRYPTO_EX_DATA	ex_data;
32*0Sstevel@tonic-gate 	} COMP_CTX;
33*0Sstevel@tonic-gate 
34*0Sstevel@tonic-gate 
35*0Sstevel@tonic-gate COMP_CTX *COMP_CTX_new(COMP_METHOD *meth);
36*0Sstevel@tonic-gate void COMP_CTX_free(COMP_CTX *ctx);
37*0Sstevel@tonic-gate int COMP_compress_block(COMP_CTX *ctx, unsigned char *out, int olen,
38*0Sstevel@tonic-gate 	unsigned char *in, int ilen);
39*0Sstevel@tonic-gate int COMP_expand_block(COMP_CTX *ctx, unsigned char *out, int olen,
40*0Sstevel@tonic-gate 	unsigned char *in, int ilen);
41*0Sstevel@tonic-gate COMP_METHOD *COMP_rle(void );
42*0Sstevel@tonic-gate COMP_METHOD *COMP_zlib(void );
43*0Sstevel@tonic-gate 
44*0Sstevel@tonic-gate /* BEGIN ERROR CODES */
45*0Sstevel@tonic-gate /* The following lines are auto generated by the script mkerr.pl. Any changes
46*0Sstevel@tonic-gate  * made after this point may be overwritten when the script is next run.
47*0Sstevel@tonic-gate  */
48*0Sstevel@tonic-gate void ERR_load_COMP_strings(void);
49*0Sstevel@tonic-gate 
50*0Sstevel@tonic-gate /* Error codes for the COMP functions. */
51*0Sstevel@tonic-gate 
52*0Sstevel@tonic-gate /* Function codes. */
53*0Sstevel@tonic-gate 
54*0Sstevel@tonic-gate /* Reason codes. */
55*0Sstevel@tonic-gate 
56*0Sstevel@tonic-gate #ifdef  __cplusplus
57*0Sstevel@tonic-gate }
58*0Sstevel@tonic-gate #endif
59*0Sstevel@tonic-gate #endif
60