47#if defined(WIZARDSTOOLKIT_LZMA_DELEGATE)
56#if defined(WIZARDSTOOLKIT_LZMA_DELEGATE)
104 (void) memset(lzma_info,0,
sizeof(*lzma_info));
106 lzma_info->
level=level;
139 return(lzma_info->
chaos);
216#if defined(WIZARDSTOOLKIT_LZMA_DELEGATE)
217#define LZMAMaxExtent(x) ((x)+((x)/3)+128)
226 initialize_lzma = LZMA_STREAM_INIT,
236 (void) memset(&allocator,0,
sizeof(allocator));
239 stream=initialize_lzma;
240 stream.allocator=&allocator;
247 status=lzma_easy_encoder(&stream,lzma_info->
level,LZMA_CHECK_SHA256);
248 if (status != LZMA_OK)
251 "unable to increase entropy `%s'",strerror(errno));
255 status=lzma_code(&stream,LZMA_RUN);
256 if (status != LZMA_OK)
259 "unable to increase entropy `%s'",strerror(errno));
263 status=lzma_code(&stream,LZMA_FINISH);
264 if ((status != LZMA_STREAM_END) && (status != LZMA_OK))
267 "unable to restore entropy `%s'",strerror(errno));
276 "unable to increase entropy `%s'",
"LZMA delegate support not builtin");
314#if defined(WIZARDSTOOLKIT_LZMA_DELEGATE)
322 initialize_lzma = LZMA_STREAM_INIT,
332 (void) memset(&allocator,0,
sizeof(allocator));
335 stream=initialize_lzma;
336 stream.allocator=&allocator;
342 status=lzma_auto_decoder(&stream,-1,0);
343 if (status != LZMA_OK)
346 "unable to restore entropy `%s'",strerror(errno));
350 status=lzma_code(&stream,LZMA_RUN);
354 "unable to restore entropy `%s'",strerror(errno));
358 status=lzma_code(&stream,LZMA_FINISH);
359 if ((status != LZMA_STREAM_END) && (status != LZMA_OK))
362 "unable to restore entropy `%s'",strerror(errno));
371 "unable to restore entropy `%s'",
"LZMA delegate support not builtin");
#define WizardAssert(domain, predicate)
#define ThrowWizardFatalError(domain, error)
WizardExport WizardBooleanType ThrowWizardException(ExceptionInfo *exception, const char *module, const char *function, const size_t line, const ExceptionType severity, const char *format,...)
WizardBooleanType LogWizardEvent(const LogEventType type, const char *module, const char *function, const size_t line, const char *format,...)
#define GetWizardModule()
WizardExport WizardBooleanType IncreaseLZMA(LZMAInfo *lzma_info, const StringInfo *message, ExceptionInfo *exception)
WizardExport WizardBooleanType RestoreLZMA(LZMAInfo *lzma_info, const size_t length, const StringInfo *message, ExceptionInfo *exception)
static void RelinquishLZMAMemory(void *context, void *memory)
WizardExport const StringInfo * GetLZMAChaos(const LZMAInfo *lzma_info)
static void * AcquireLZMAMemory(void *context, size_t items, size_t size)
WizardExport LZMAInfo * DestroyLZMAInfo(LZMAInfo *lzma_info)
WizardExport LZMAInfo * AcquireLZMAInfo(const size_t level)
WizardExport void * AcquireWizardMemory(const size_t size)
WizardExport void * AcquireQuantumMemory(const size_t count, const size_t quantum)
WizardExport void * RelinquishWizardMemory(void *memory)
WizardExport void SetStringInfoLength(StringInfo *string_info, const size_t length)
WizardExport size_t GetStringInfoLength(const StringInfo *string_info)
WizardExport StringInfo * AcquireStringInfo(const size_t length)
WizardExport unsigned char * GetStringInfoDatum(const StringInfo *string_info)
WizardExport StringInfo * DestroyStringInfo(StringInfo *string_info)