Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(816)

Side by Side Diff: openssl/crypto/comp/comp_lib.c

Issue 2072073002: Delete bundled copy of OpenSSL and replace with README. (Closed) Base URL: https://chromium.googlesource.com/chromium/deps/openssl@master
Patch Set: Delete bundled copy of OpenSSL and replace with README. Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « openssl/crypto/comp/comp_err.c ('k') | openssl/crypto/conf/README » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 #include <stdio.h>
2 #include <stdlib.h>
3 #include <string.h>
4 #include <openssl/objects.h>
5 #include <openssl/comp.h>
6
7 COMP_CTX *COMP_CTX_new(COMP_METHOD *meth)
8 {
9 COMP_CTX *ret;
10
11 if ((ret=(COMP_CTX *)OPENSSL_malloc(sizeof(COMP_CTX))) == NULL)
12 {
13 /* ZZZZZZZZZZZZZZZZ */
14 return(NULL);
15 }
16 memset(ret,0,sizeof(COMP_CTX));
17 ret->meth=meth;
18 if ((ret->meth->init != NULL) && !ret->meth->init(ret))
19 {
20 OPENSSL_free(ret);
21 ret=NULL;
22 }
23 return(ret);
24 }
25
26 void COMP_CTX_free(COMP_CTX *ctx)
27 {
28 if(ctx == NULL)
29 return;
30
31 if (ctx->meth->finish != NULL)
32 ctx->meth->finish(ctx);
33
34 OPENSSL_free(ctx);
35 }
36
37 int COMP_compress_block(COMP_CTX *ctx, unsigned char *out, int olen,
38 unsigned char *in, int ilen)
39 {
40 int ret;
41 if (ctx->meth->compress == NULL)
42 {
43 /* ZZZZZZZZZZZZZZZZZ */
44 return(-1);
45 }
46 ret=ctx->meth->compress(ctx,out,olen,in,ilen);
47 if (ret > 0)
48 {
49 ctx->compress_in+=ilen;
50 ctx->compress_out+=ret;
51 }
52 return(ret);
53 }
54
55 int COMP_expand_block(COMP_CTX *ctx, unsigned char *out, int olen,
56 unsigned char *in, int ilen)
57 {
58 int ret;
59
60 if (ctx->meth->expand == NULL)
61 {
62 /* ZZZZZZZZZZZZZZZZZ */
63 return(-1);
64 }
65 ret=ctx->meth->expand(ctx,out,olen,in,ilen);
66 if (ret > 0)
67 {
68 ctx->expand_in+=ilen;
69 ctx->expand_out+=ret;
70 }
71 return(ret);
72 }
OLDNEW
« no previous file with comments | « openssl/crypto/comp/comp_err.c ('k') | openssl/crypto/conf/README » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698