w32tex
About: TeX Live provides a comprehensive TeX system including all the major TeX-related programs, macro packages, and fonts that are free software. Windows sources.
  Fossies Dox: w32tex-src.tar.xz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

cmserr.c File Reference
#include "lcms2_internal.h"
Include dependency graph for cmserr.c:

Go to the source code of this file.

Macros

#define MAX_MEMORY_FOR_ALLOC   ((cmsUInt32Number)(1024U*1024U*512U))
 
#define MAX_ERROR_MESSAGE_LEN   1024
 

Functions

int cmsGetEncodedCMMversion (void)
 
int cmsstrcasecmp (const char *s1, const char *s2)
 
long int cmsfilelength (FILE *f)
 
cmsBool _cmsRegisterMemHandlerPlugin (cmsContext ContextID, cmsPluginBase *Plugin)
 
static void_cmsMallocDefaultFn (cmsContext ContextID, cmsUInt32Number size)
 
static void_cmsMallocZeroDefaultFn (cmsContext ContextID, cmsUInt32Number size)
 
static void _cmsFreeDefaultFn (cmsContext ContextID, void *Ptr)
 
static void_cmsReallocDefaultFn (cmsContext ContextID, void *Ptr, cmsUInt32Number size)
 
static void_cmsCallocDefaultFn (cmsContext ContextID, cmsUInt32Number num, cmsUInt32Number size)
 
static void_cmsDupDefaultFn (cmsContext ContextID, const void *Org, cmsUInt32Number size)
 
void _cmsAllocMemPluginChunk (struct _cmsContext_struct *ctx, const struct _cmsContext_struct *src)
 
void _cmsInstallAllocFunctions (cmsPluginMemHandler *Plugin, _cmsMemPluginChunkType *ptr)
 
void_cmsMalloc (cmsContext ContextID, cmsUInt32Number size)
 
void_cmsMallocZero (cmsContext ContextID, cmsUInt32Number size)
 
void_cmsCalloc (cmsContext ContextID, cmsUInt32Number num, cmsUInt32Number size)
 
void_cmsRealloc (cmsContext ContextID, void *Ptr, cmsUInt32Number size)
 
void _cmsFree (cmsContext ContextID, void *Ptr)
 
void_cmsDupMem (cmsContext ContextID, const void *Org, cmsUInt32Number size)
 
static _cmsSubAllocator_chunk_cmsCreateSubAllocChunk (cmsContext ContextID, cmsUInt32Number Initial)
 
_cmsSubAllocator_cmsCreateSubAlloc (cmsContext ContextID, cmsUInt32Number Initial)
 
void _cmsSubAllocDestroy (_cmsSubAllocator *sub)
 
void_cmsSubAlloc (_cmsSubAllocator *sub, cmsUInt32Number size)
 
void_cmsSubAllocDup (_cmsSubAllocator *s, const void *ptr, cmsUInt32Number size)
 
static void DefaultLogErrorHandlerFunction (cmsContext ContextID, cmsUInt32Number ErrorCode, const char *Text)
 
void _cmsAllocLogErrorChunk (struct _cmsContext_struct *ctx, const struct _cmsContext_struct *src)
 
void cmsSetLogErrorHandlerTHR (cmsContext ContextID, cmsLogErrorHandlerFunction Fn)
 
void cmsSetLogErrorHandler (cmsLogErrorHandlerFunction Fn)
 
void cmsSignalError (cmsContext ContextID, cmsUInt32Number ErrorCode, const char *ErrorText,...)
 
void _cmsTagSignature2String (char String[5], cmsTagSignature sig)
 
static voiddefMtxCreate (cmsContext id)
 
static void defMtxDestroy (cmsContext id, void *mtx)
 
static cmsBool defMtxLock (cmsContext id, void *mtx)
 
static void defMtxUnlock (cmsContext id, void *mtx)
 
void _cmsAllocMutexPluginChunk (struct _cmsContext_struct *ctx, const struct _cmsContext_struct *src)
 
cmsBool _cmsRegisterMutexPlugin (cmsContext ContextID, cmsPluginBase *Data)
 
void_cmsCreateMutex (cmsContext ContextID)
 
void _cmsDestroyMutex (cmsContext ContextID, void *mtx)
 
cmsBool _cmsLockMutex (cmsContext ContextID, void *mtx)
 
void _cmsUnlockMutex (cmsContext ContextID, void *mtx)
 

Variables

_cmsMemPluginChunkType _cmsMemPluginChunk
 
_cmsLogErrorChunkType _cmsLogErrorChunk = { DefaultLogErrorHandlerFunction }
 
_cmsMutexPluginChunkType _cmsMutexPluginChunk = { defMtxCreate, defMtxDestroy, defMtxLock, defMtxUnlock }
 

Macro Definition Documentation

◆ MAX_ERROR_MESSAGE_LEN

#define MAX_ERROR_MESSAGE_LEN   1024

Definition at line 447 of file cmserr.c.

◆ MAX_MEMORY_FOR_ALLOC

#define MAX_MEMORY_FOR_ALLOC   ((cmsUInt32Number)(1024U*1024U*512U))

Definition at line 78 of file cmserr.c.

Function Documentation

◆ _cmsAllocLogErrorChunk()

void _cmsAllocLogErrorChunk ( struct _cmsContext_struct ctx,
const struct _cmsContext_struct src 
)

◆ _cmsAllocMemPluginChunk()

void _cmsAllocMemPluginChunk ( struct _cmsContext_struct ctx,
const struct _cmsContext_struct src 
)

◆ _cmsAllocMutexPluginChunk()

◆ _cmsCalloc()

◆ _cmsCallocDefaultFn()

static void* _cmsCallocDefaultFn ( cmsContext  ContextID,
cmsUInt32Number  num,
cmsUInt32Number  size 
)
static

Definition at line 143 of file cmserr.c.

References _cmsMallocZero(), MAX_MEMORY_FOR_ALLOC, NULL, num, size, and UINT_MAX.

Referenced by _cmsInstallAllocFunctions().

◆ _cmsCreateMutex()

void* _cmsCreateMutex ( cmsContext  ContextID)

Definition at line 627 of file cmserr.c.

References _cmsContextGetClientChunk(), MutexPlugin, NULL, and ptr.

Referenced by cmsCreateProfilePlaceholder().

◆ _cmsCreateSubAlloc()

_cmsSubAllocator* _cmsCreateSubAlloc ( cmsContext  ContextID,
cmsUInt32Number  Initial 
)

Definition at line 344 of file cmserr.c.

References _cmsCreateSubAllocChunk(), _cmsFree(), _cmsMallocZero(), h, NULL, and sub.

Referenced by _cmsPluginMalloc(), cmsCreateContext(), and cmsDupContext().

◆ _cmsCreateSubAllocChunk()

static _cmsSubAllocator_chunk* _cmsCreateSubAllocChunk ( cmsContext  ContextID,
cmsUInt32Number  Initial 
)
static

Definition at line 314 of file cmserr.c.

References _cmsFree(), _cmsMalloc(), _cmsMallocZero(), chunk(), chunk::next, and NULL.

Referenced by _cmsCreateSubAlloc(), and _cmsSubAlloc().

◆ _cmsDestroyMutex()

void _cmsDestroyMutex ( cmsContext  ContextID,
void mtx 
)

Definition at line 636 of file cmserr.c.

References _cmsContextGetClientChunk(), MutexPlugin, NULL, and ptr.

Referenced by cmsCloseProfile().

◆ _cmsDupDefaultFn()

static void* _cmsDupDefaultFn ( cmsContext  ContextID,
const void Org,
cmsUInt32Number  size 
)
static

Definition at line 165 of file cmserr.c.

References _cmsMalloc(), MAX_MEMORY_FOR_ALLOC, mem, memmove, NULL, and size.

Referenced by _cmsInstallAllocFunctions().

◆ _cmsDupMem()

◆ _cmsFree()

void _cmsFree ( cmsContext  ContextID,
void Ptr 
)

Definition at line 292 of file cmserr.c.

References _cmsContextGetClientChunk(), MemPlugin, NULL, and ptr.

Referenced by _cmsComputeInterpParamsEx(), _cmsCreateSubAlloc(), _cmsCreateSubAllocChunk(), _cmsDeleteTagByPos(), _cmsFreeInterpParams(), _cmsSubAllocDestroy(), AllocateToneCurveStruct(), AllocBigBlock(), AllocElem(), CLUTElemDup(), CLutElemTypeFree(), cmsAllocProfileSequenceDescription(), cmsCIECAM02Done(), cmsCloseProfile(), cmsDeleteContext(), cmsDeleteTransform(), cmsDictFree(), cmsFreeNamedColorList(), cmsFreeProfileSequenceDescription(), cmsFreeToneCurve(), cmsGBDFree(), cmsIT8Free(), cmsIT8LoadFromMem(), cmsJoinToneCurve(), cmsMD5computeID(), cmsMD5finish(), cmsMLUalloc(), cmsMLUfree(), cmsMLUsetASCII(), cmsOpenIOhandlerFromFile(), cmsOpenIOhandlerFromMem(), cmsOpenIOhandlerFromNULL(), cmsPipelineAlloc(), cmsPipelineDup(), cmsPipelineFree(), cmsSmoothToneCurve(), cmsStageFree(), ComputeKToLstar(), CurvesAlloc(), CurveSetDup(), CurveSetElemTypeFree(), CurvesFree(), defMtxDestroy(), FileClose(), FreeElem(), FreeMatShaper(), GrowNamedColorList(), MatrixElemTypeFree(), MemoryClose(), NULLClose(), OptimizeByJoiningCurves(), Prelin8free(), PrelinOpt16free(), Read8bitTables(), ReadCountAndSting(), ReadOneWChar(), ReadPositionTable(), ReadSegmentedCurve(), SaveTags(), smooth2(), Type_Chromaticity_Free(), Type_Chromaticity_Read(), Type_ColorantOrderType_Free(), Type_ColorantOrderType_Read(), Type_Data_Free(), Type_Data_Read(), Type_DateTime_Free(), Type_Dictionary_Read(), Type_LUT16_Read(), Type_LUT8_Read(), Type_Measurement_Free(), Type_MPE_Write(), Type_MPEcurve_Read(), Type_MPEmatrix_Read(), Type_S15Fixed16_Free(), Type_S15Fixed16_Read(), Type_Screening_Free(), Type_Screening_Read(), Type_Signature_Free(), Type_Text_Description_Read(), Type_Text_Description_Write(), Type_Text_Read(), Type_Text_Write(), Type_U16Fixed16_Free(), Type_U16Fixed16_Read(), Type_UcrBg_Free(), Type_UcrBg_Read(), Type_UcrBg_Write(), Type_vcgt_Free(), Type_vcgt_Read(), Type_ViewingConditions_Free(), Type_ViewingConditions_Read(), Type_XYZ_Free(), Type_XYZ_Read(), WriteCountAndSting(), and WritePositionTable().

◆ _cmsFreeDefaultFn()

static void _cmsFreeDefaultFn ( cmsContext  ContextID,
void Ptr 
)
static

Definition at line 116 of file cmserr.c.

References cmsUNUSED_PARAMETER, and free.

◆ _cmsInstallAllocFunctions()

void _cmsInstallAllocFunctions ( cmsPluginMemHandler Plugin,
_cmsMemPluginChunkType ptr 
)

◆ _cmsLockMutex()

cmsBool _cmsLockMutex ( cmsContext  ContextID,
void mtx 
)

◆ _cmsMalloc()

◆ _cmsMallocDefaultFn()

static void* _cmsMallocDefaultFn ( cmsContext  ContextID,
cmsUInt32Number  size 
)
static

Definition at line 93 of file cmserr.c.

References cmsUNUSED_PARAMETER, malloc, MAX_MEMORY_FOR_ALLOC, NULL, and size.

◆ _cmsMallocZero()

◆ _cmsMallocZeroDefaultFn()

static void* _cmsMallocZeroDefaultFn ( cmsContext  ContextID,
cmsUInt32Number  size 
)
static

Definition at line 104 of file cmserr.c.

References _cmsMalloc(), memset(), NULL, pt, and size.

Referenced by _cmsInstallAllocFunctions().

◆ _cmsRealloc()

void* _cmsRealloc ( cmsContext  ContextID,
void Ptr,
cmsUInt32Number  size 
)

Definition at line 285 of file cmserr.c.

References _cmsContextGetClientChunk(), MemPlugin, ptr, and size.

Referenced by GrowMLUpool(), GrowMLUtable(), and GrowNamedColorList().

◆ _cmsReallocDefaultFn()

static void* _cmsReallocDefaultFn ( cmsContext  ContextID,
void Ptr,
cmsUInt32Number  size 
)
static

Definition at line 129 of file cmserr.c.

References cmsUNUSED_PARAMETER, MAX_MEMORY_FOR_ALLOC, NULL, realloc, and size.

◆ _cmsRegisterMemHandlerPlugin()

◆ _cmsRegisterMutexPlugin()

◆ _cmsSubAlloc()

void* _cmsSubAlloc ( _cmsSubAllocator sub,
cmsUInt32Number  size 
)

Definition at line 382 of file cmserr.c.

References _cmsALIGNMEM, _cmsCreateSubAllocChunk(), chunk(), Free, h, chunk::next, NULL, ptr, size, and sub.

Referenced by _cmsPluginMalloc(), and _cmsSubAllocDup().

◆ _cmsSubAllocDestroy()

void _cmsSubAllocDestroy ( _cmsSubAllocator sub)

Definition at line 365 of file cmserr.c.

References _cmsFree(), chunk(), h, n, chunk::next, NULL, and sub.

Referenced by cmsDeleteContext().

◆ _cmsSubAllocDup()

◆ _cmsTagSignature2String()

void _cmsTagSignature2String ( char  String[5],
cmsTagSignature  sig 
)

◆ _cmsUnlockMutex()

void _cmsUnlockMutex ( cmsContext  ContextID,
void mtx 
)

◆ cmsfilelength()

long int cmsfilelength ( FILE f)

Definition at line 52 of file cmserr.c.

References f, fseek, ftell, n, p, SEEK_END, and SEEK_SET.

Referenced by cmsOpenIOhandlerFromFile(), and cmsOpenIOhandlerFromStream().

◆ cmsGetEncodedCMMversion()

int cmsGetEncodedCMMversion ( void  )

Definition at line 30 of file cmserr.c.

References LCMS_VERSION.

Referenced by GfxICCBasedColorSpace::getPostScriptCSA().

◆ cmsSetLogErrorHandler()

void cmsSetLogErrorHandler ( cmsLogErrorHandlerFunction  Fn)

Definition at line 502 of file cmserr.c.

References cmsSetLogErrorHandlerTHR(), and NULL.

Referenced by GfxState::GfxState().

◆ cmsSetLogErrorHandlerTHR()

void cmsSetLogErrorHandlerTHR ( cmsContext  ContextID,
cmsLogErrorHandlerFunction  Fn 
)

Definition at line 488 of file cmserr.c.

References _cmsContextGetClientChunk(), DefaultLogErrorHandlerFunction(), and NULL.

Referenced by cmsSetLogErrorHandler().

◆ cmsSignalError()

void cmsSignalError ( cmsContext  ContextID,
cmsUInt32Number  ErrorCode,
const char *  ErrorText,
  ... 
)

Definition at line 509 of file cmserr.c.

References _cmsContextGetClientChunk(), args, _cmsLogErrorChunkType::LogErrorHandler, MAX_ERROR_MESSAGE_LEN, va_end, va_start, and vsnprintf.

Referenced by _cmsComputeInterpParamsEx(), _cmsContextGetClientChunk(), _cmsCreateGamutCheckPipeline(), _cmsGetFormatterAlpha(), _cmsLinkProfiles(), _cmsNewTag(), _cmsPluginMalloc(), _cmsReadHeader(), AllocateToneCurveStruct(), AllocEmptyTransform(), cmsBuildParametricToneCurve(), cmsChangeBuffersFormat(), cmsCreateExtendedTransform(), cmsCreateInkLimitingDeviceLinkTHR(), cmsCreateMultiprofileTransform(), cmsCreateMultiprofileTransformTHR(), cmsDesaturateLab(), cmsIsCLUT(), cmsOpenIOhandlerFromFile(), cmsOpenIOhandlerFromMem(), cmsOpenIOhandlerFromStream(), cmsPluginTHR(), cmsReadTag(), cmsSmoothToneCurve(), cmsStageAllocCLut16bitGranular(), cmsStageAllocCLutFloatGranular(), cmsWhitePointFromTemp(), cmsWriteTag(), DefaultICCintents(), EvalNamedColor(), EvalNamedColorPCS(), FileRead(), FileSeek(), FileTell(), GenerateCSA(), GetPoint(), IsMyFile(), MemoryRead(), MemorySeek(), PatchLUT(), ReadCLUT(), ReadEmbeddedCurve(), ReadMPEElem(), ReadSegmentedCurve(), SaveTags(), SynError(), Type_ColorantTable_Read(), Type_Dictionary_Read(), Type_LUT16_Write(), Type_LUT8_Write(), Type_LUTA2B_Write(), Type_LUTB2A_Write(), Type_MLU_Read(), Type_MPE_Write(), Type_NamedColor_Read(), Type_ParametricCurve_Read(), Type_ParametricCurve_Write(), Type_vcgt_Read(), Write8bitTables(), WriteCLUT(), WriteInputLUT(), WriteInputMatrixShaper(), WriteOutputLUT(), WriteSetOfCurves(), and WriteStr().

◆ cmsstrcasecmp()

int cmsstrcasecmp ( const char *  s1,
const char *  s2 
)

◆ DefaultLogErrorHandlerFunction()

static void DefaultLogErrorHandlerFunction ( cmsContext  ContextID,
cmsUInt32Number  ErrorCode,
const char *  Text 
)
static

Definition at line 477 of file cmserr.c.

References cmsUNUSED_PARAMETER.

Referenced by _cmsAllocLogErrorChunk(), and cmsSetLogErrorHandlerTHR().

◆ defMtxCreate()

static void* defMtxCreate ( cmsContext  id)
static

Definition at line 546 of file cmserr.c.

References _cmsInitMutexPrimitive(), and _cmsMalloc().

Referenced by _cmsAllocMutexPluginChunk().

◆ defMtxDestroy()

static void defMtxDestroy ( cmsContext  id,
void mtx 
)
static

Definition at line 554 of file cmserr.c.

References _cmsDestroyMutexPrimitive(), and _cmsFree().

Referenced by _cmsAllocMutexPluginChunk().

◆ defMtxLock()

static cmsBool defMtxLock ( cmsContext  id,
void mtx 
)
static

Definition at line 561 of file cmserr.c.

References _cmsLockPrimitive(), and cmsUNUSED_PARAMETER.

Referenced by _cmsAllocMutexPluginChunk().

◆ defMtxUnlock()

static void defMtxUnlock ( cmsContext  id,
void mtx 
)
static

Definition at line 568 of file cmserr.c.

References _cmsUnlockPrimitive(), and cmsUNUSED_PARAMETER.

Referenced by _cmsAllocMutexPluginChunk().

Variable Documentation

◆ _cmsLogErrorChunk

Definition at line 455 of file cmserr.c.

◆ _cmsMemPluginChunk

_cmsMemPluginChunkType _cmsMemPluginChunk
Initial value:
}
static void * _cmsDupDefaultFn(cmsContext ContextID, const void *Org, cmsUInt32Number size)
Definition: cmserr.c:165
static void * _cmsCallocDefaultFn(cmsContext ContextID, cmsUInt32Number num, cmsUInt32Number size)
Definition: cmserr.c:143
static void _cmsFreeDefaultFn(cmsContext ContextID, void *Ptr)
Definition: cmserr.c:116
static void * _cmsReallocDefaultFn(cmsContext ContextID, void *Ptr, cmsUInt32Number size)
Definition: cmserr.c:129
static void * _cmsMallocZeroDefaultFn(cmsContext ContextID, cmsUInt32Number size)
Definition: cmserr.c:104
static void * _cmsMallocDefaultFn(cmsContext ContextID, cmsUInt32Number size)
Definition: cmserr.c:93

Definition at line 181 of file cmserr.c.

Referenced by _cmsInstallAllocFunctions(), and cmsCreateContext().

◆ _cmsMutexPluginChunk

Definition at line 577 of file cmserr.c.