xref: /onnv-gate/usr/src/common/openssl/crypto/comp/comp.h (revision 2139:6243c3338933)
10Sstevel@tonic-gate 
20Sstevel@tonic-gate #ifndef HEADER_COMP_H
30Sstevel@tonic-gate #define HEADER_COMP_H
40Sstevel@tonic-gate 
50Sstevel@tonic-gate #include <openssl/crypto.h>
60Sstevel@tonic-gate 
70Sstevel@tonic-gate #ifdef  __cplusplus
80Sstevel@tonic-gate extern "C" {
90Sstevel@tonic-gate #endif
100Sstevel@tonic-gate 
11*2139Sjp161948 typedef struct comp_ctx_st COMP_CTX;
12*2139Sjp161948 
130Sstevel@tonic-gate typedef struct comp_method_st
140Sstevel@tonic-gate 	{
150Sstevel@tonic-gate 	int type;		/* NID for compression library */
160Sstevel@tonic-gate 	const char *name;	/* A text string to identify the library */
17*2139Sjp161948 	int (*init)(COMP_CTX *ctx);
18*2139Sjp161948 	void (*finish)(COMP_CTX *ctx);
19*2139Sjp161948 	int (*compress)(COMP_CTX *ctx,
20*2139Sjp161948 			unsigned char *out, unsigned int olen,
21*2139Sjp161948 			unsigned char *in, unsigned int ilen);
22*2139Sjp161948 	int (*expand)(COMP_CTX *ctx,
23*2139Sjp161948 		      unsigned char *out, unsigned int olen,
24*2139Sjp161948 		      unsigned char *in, unsigned int ilen);
25*2139Sjp161948 	/* The following two do NOTHING, but are kept for backward compatibility */
26*2139Sjp161948 	long (*ctrl)(void);
27*2139Sjp161948 	long (*callback_ctrl)(void);
280Sstevel@tonic-gate 	} COMP_METHOD;
290Sstevel@tonic-gate 
30*2139Sjp161948 struct comp_ctx_st
310Sstevel@tonic-gate 	{
320Sstevel@tonic-gate 	COMP_METHOD *meth;
330Sstevel@tonic-gate 	unsigned long compress_in;
340Sstevel@tonic-gate 	unsigned long compress_out;
350Sstevel@tonic-gate 	unsigned long expand_in;
360Sstevel@tonic-gate 	unsigned long expand_out;
370Sstevel@tonic-gate 
380Sstevel@tonic-gate 	CRYPTO_EX_DATA	ex_data;
39*2139Sjp161948 	};
400Sstevel@tonic-gate 
410Sstevel@tonic-gate 
420Sstevel@tonic-gate COMP_CTX *COMP_CTX_new(COMP_METHOD *meth);
430Sstevel@tonic-gate void COMP_CTX_free(COMP_CTX *ctx);
440Sstevel@tonic-gate int COMP_compress_block(COMP_CTX *ctx, unsigned char *out, int olen,
450Sstevel@tonic-gate 	unsigned char *in, int ilen);
460Sstevel@tonic-gate int COMP_expand_block(COMP_CTX *ctx, unsigned char *out, int olen,
470Sstevel@tonic-gate 	unsigned char *in, int ilen);
480Sstevel@tonic-gate COMP_METHOD *COMP_rle(void );
490Sstevel@tonic-gate COMP_METHOD *COMP_zlib(void );
500Sstevel@tonic-gate 
510Sstevel@tonic-gate /* BEGIN ERROR CODES */
520Sstevel@tonic-gate /* The following lines are auto generated by the script mkerr.pl. Any changes
530Sstevel@tonic-gate  * made after this point may be overwritten when the script is next run.
540Sstevel@tonic-gate  */
550Sstevel@tonic-gate void ERR_load_COMP_strings(void);
560Sstevel@tonic-gate 
570Sstevel@tonic-gate /* Error codes for the COMP functions. */
580Sstevel@tonic-gate 
590Sstevel@tonic-gate /* Function codes. */
600Sstevel@tonic-gate 
610Sstevel@tonic-gate /* Reason codes. */
620Sstevel@tonic-gate 
630Sstevel@tonic-gate #ifdef  __cplusplus
640Sstevel@tonic-gate }
650Sstevel@tonic-gate #endif
660Sstevel@tonic-gate #endif
67