File: Compression.c

package info (click to toggle)
hashrat 1.8.3%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 1,700 kB
  • ctags: 1,677
  • sloc: ansic: 17,713; sh: 323; makefile: 157
file content (21 lines) | stat: -rw-r--r-- 463 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include "DataProcessing.h"

int CompressBytes(char **Out, char *Alg, char *In, int Len, int Level)
{
TProcessingModule *Mod=NULL;
char *Tempstr=NULL;
int result, val;

Tempstr=FormatStr(Tempstr,"CompressionLevel=%d",Level);
Mod=StandardDataProcessorCreate("compression",Alg,Tempstr);
if (! Mod) return(-1);

val=Len *2;
*Out=SetStrLen(*Out,val);
result=Mod->Write(Mod,In,Len,Out,&Len,TRUE);

DestroyString(Tempstr);
DataProcessorDestroy(Mod);

return(result);
}