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
Go to the documentation of this file.
1 //---------------------------------------------------------------------------------
2 //
3 // Little Color Management System
4 // Copyright (c) 1998-2020 Marti Maria Saguer
5 //
6 // Permission is hereby granted, free of charge, to any person obtaining
7 // a copy of this software and associated documentation files (the "Software"),
8 // to deal in the Software without restriction, including without limitation
9 // the rights to use, copy, modify, merge, publish, distribute, sublicense,
10 // and/or sell copies of the Software, and to permit persons to whom the Software
11 // is furnished to do so, subject to the following conditions:
12 //
13 // The above copyright notice and this permission notice shall be included in
14 // all copies or substantial portions of the Software.
15 //
16 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
18 // THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 //
24 //---------------------------------------------------------------------------------
25 
26 #include "lcms2_internal.h"
27 
28 
29 // This function is here to help applications to prevent mixing lcms versions on header and shared objects.
31 {
32  return LCMS_VERSION;
33 }
34 
35 // I am so tired about incompatibilities on those functions that here are some replacements
36 // that hopefully would be fully portable.
37 
38 // compare two strings ignoring case
39 int CMSEXPORT cmsstrcasecmp(const char* s1, const char* s2)
40 {
41  CMSREGISTER const unsigned char *us1 = (const unsigned char *)s1,
42  *us2 = (const unsigned char *)s2;
43 
44  while (toupper(*us1) == toupper(*us2++))
45  if (*us1++ == '\0')
46  return 0;
47 
48  return (toupper(*us1) - toupper(*--us2));
49 }
50 
51 // long int because C99 specifies ftell in such way (7.19.9.2)
53 {
54  long int p , n;
55 
56  p = ftell(f); // register current file position
57  if (p == -1L)
58  return -1L;
59 
60  if (fseek(f, 0, SEEK_END) != 0) {
61  return -1L;
62  }
63 
64  n = ftell(f);
65  fseek(f, p, SEEK_SET); // file position restored
66 
67  return n;
68 }
69 
70 
71 // Memory handling ------------------------------------------------------------------
72 //
73 // This is the interface to low-level memory management routines. By default a simple
74 // wrapping to malloc/free/realloc is provided, although there is a limit on the max
75 // amount of memoy that can be reclaimed. This is mostly as a safety feature to prevent
76 // bogus or evil code to allocate huge blocks that otherwise lcms would never need.
77 
78 #define MAX_MEMORY_FOR_ALLOC ((cmsUInt32Number)(1024U*1024U*512U))
79 
80 // User may override this behaviour by using a memory plug-in, which basically replaces
81 // the default memory management functions. In this case, no check is performed and it
82 // is up to the plug-in writter to keep in the safe side. There are only three functions
83 // required to be implemented: malloc, realloc and free, although the user may want to
84 // replace the optional mallocZero, calloc and dup as well.
85 
87 
88 // *********************************************************************************
89 
90 // This is the default memory allocation function. It does a very coarse
91 // check of amount of memory, just to prevent exploits
92 static
94 {
95  if (size > MAX_MEMORY_FOR_ALLOC) return NULL; // Never allow over maximum
96 
97  return (void*) malloc(size);
98 
99  cmsUNUSED_PARAMETER(ContextID);
100 }
101 
102 // Generic allocate & zero
103 static
105 {
106  void *pt = _cmsMalloc(ContextID, size);
107  if (pt == NULL) return NULL;
108 
109  memset(pt, 0, size);
110  return pt;
111 }
112 
113 
114 // The default free function. The only check proformed is against NULL pointers
115 static
116 void _cmsFreeDefaultFn(cmsContext ContextID, void *Ptr)
117 {
118  // free(NULL) is defined a no-op by C99, therefore it is safe to
119  // avoid the check, but it is here just in case...
120 
121  if (Ptr) free(Ptr);
122 
123  cmsUNUSED_PARAMETER(ContextID);
124 }
125 
126 // The default realloc function. Again it checks for exploits. If Ptr is NULL,
127 // realloc behaves the same way as malloc and allocates a new block of size bytes.
128 static
130 {
131 
132  if (size > MAX_MEMORY_FOR_ALLOC) return NULL; // Never realloc over 512Mb
133 
134  return realloc(Ptr, size);
135 
136  cmsUNUSED_PARAMETER(ContextID);
137 }
138 
139 
140 // The default calloc function. Allocates an array of num elements, each one of size bytes
141 // all memory is initialized to zero.
142 static
144 {
145  cmsUInt32Number Total = num * size;
146 
147  // Preserve calloc behaviour
148  if (Total == 0) return NULL;
149 
150  // Safe check for overflow.
151  if (num >= UINT_MAX / size) return NULL;
152 
153  // Check for overflow
154  if (Total < num || Total < size) {
155  return NULL;
156  }
157 
158  if (Total > MAX_MEMORY_FOR_ALLOC) return NULL; // Never alloc over 512Mb
159 
160  return _cmsMallocZero(ContextID, Total);
161 }
162 
163 // Generic block duplication
164 static
165 void* _cmsDupDefaultFn(cmsContext ContextID, const void* Org, cmsUInt32Number size)
166 {
167  void* mem;
168 
169  if (size > MAX_MEMORY_FOR_ALLOC) return NULL; // Never dup over 512Mb
170 
171  mem = _cmsMalloc(ContextID, size);
172 
173  if (mem != NULL && Org != NULL)
174  memmove(mem, Org, size);
175 
176  return mem;
177 }
178 
179 
180 // Pointers to memory manager functions in Context0
183  };
184 
185 
186 // Reset and duplicate memory manager
188 {
189  _cmsAssert(ctx != NULL);
190 
191  if (src != NULL) {
192 
193  // Duplicate
194  ctx ->chunks[MemPlugin] = _cmsSubAllocDup(ctx ->MemPool, src ->chunks[MemPlugin], sizeof(_cmsMemPluginChunkType));
195  }
196  else {
197 
198  // To reset it, we use the default allocators, which cannot be overridden
199  ctx ->chunks[MemPlugin] = &ctx ->DefaultMemoryManager;
200  }
201 }
202 
203 // Auxiliary to fill memory management functions from plugin (or context 0 defaults)
205 {
206  if (Plugin == NULL) {
207 
209  }
210  else {
211 
212  ptr ->MallocPtr = Plugin -> MallocPtr;
213  ptr ->FreePtr = Plugin -> FreePtr;
214  ptr ->ReallocPtr = Plugin -> ReallocPtr;
215 
216  // Make sure we revert to defaults
217  ptr ->MallocZeroPtr= _cmsMallocZeroDefaultFn;
218  ptr ->CallocPtr = _cmsCallocDefaultFn;
219  ptr ->DupPtr = _cmsDupDefaultFn;
220 
221  if (Plugin ->MallocZeroPtr != NULL) ptr ->MallocZeroPtr = Plugin -> MallocZeroPtr;
222  if (Plugin ->CallocPtr != NULL) ptr ->CallocPtr = Plugin -> CallocPtr;
223  if (Plugin ->DupPtr != NULL) ptr ->DupPtr = Plugin -> DupPtr;
224 
225  }
226 }
227 
228 
229 // Plug-in replacement entry
231 {
232  cmsPluginMemHandler* Plugin = (cmsPluginMemHandler*) Data;
234 
235  // NULL forces to reset to defaults. In this special case, the defaults are stored in the context structure.
236  // Remaining plug-ins does NOT have any copy in the context structure, but this is somehow special as the
237  // context internal data should be malloce'd by using those functions.
238  if (Data == NULL) {
239 
240  struct _cmsContext_struct* ctx = ( struct _cmsContext_struct*) ContextID;
241 
242  // Return to the default allocators
243  if (ContextID != NULL) {
244  ctx->chunks[MemPlugin] = (void*) &ctx->DefaultMemoryManager;
245  }
246  return TRUE;
247  }
248 
249  // Check for required callbacks
250  if (Plugin -> MallocPtr == NULL ||
251  Plugin -> FreePtr == NULL ||
252  Plugin -> ReallocPtr == NULL) return FALSE;
253 
254  // Set replacement functions
256  if (ptr == NULL)
257  return FALSE;
258 
260  return TRUE;
261 }
262 
263 // Generic allocate
265 {
267  return ptr ->MallocPtr(ContextID, size);
268 }
269 
270 // Generic allocate & zero
272 {
274  return ptr->MallocZeroPtr(ContextID, size);
275 }
276 
277 // Generic calloc
279 {
281  return ptr->CallocPtr(ContextID, num, size);
282 }
283 
284 // Generic reallocate
286 {
288  return ptr->ReallocPtr(ContextID, Ptr, size);
289 }
290 
291 // Generic free memory
292 void CMSEXPORT _cmsFree(cmsContext ContextID, void* Ptr)
293 {
294  if (Ptr != NULL) {
296  ptr ->FreePtr(ContextID, Ptr);
297  }
298 }
299 
300 // Generic block duplication
301 void* CMSEXPORT _cmsDupMem(cmsContext ContextID, const void* Org, cmsUInt32Number size)
302 {
304  return ptr ->DupPtr(ContextID, Org, size);
305 }
306 
307 // ********************************************************************************************
308 
309 // Sub allocation takes care of many pointers of small size. The memory allocated in
310 // this way have be freed at once. Next function allocates a single chunk for linked list
311 // I prefer this method over realloc due to the big inpact on xput realloc may have if
312 // memory is being swapped to disk. This approach is safer (although that may not be true on all platforms)
313 static
315 {
317 
318  // 20K by default
319  if (Initial == 0)
320  Initial = 20*1024;
321 
322  // Create the container
324  if (chunk == NULL) return NULL;
325 
326  // Initialize values
327  chunk ->Block = (cmsUInt8Number*) _cmsMalloc(ContextID, Initial);
328  if (chunk ->Block == NULL) {
329 
330  // Something went wrong
331  _cmsFree(ContextID, chunk);
332  return NULL;
333  }
334 
335  chunk ->BlockSize = Initial;
336  chunk ->Used = 0;
337  chunk ->next = NULL;
338 
339  return chunk;
340 }
341 
342 // The suballocated is nothing but a pointer to the first element in the list. We also keep
343 // the thread ID in this structure.
345 {
347 
348  // Create the container
349  sub = (_cmsSubAllocator*) _cmsMallocZero(ContextID, sizeof(_cmsSubAllocator));
350  if (sub == NULL) return NULL;
351 
352  sub ->ContextID = ContextID;
353 
354  sub ->h = _cmsCreateSubAllocChunk(ContextID, Initial);
355  if (sub ->h == NULL) {
356  _cmsFree(ContextID, sub);
357  return NULL;
358  }
359 
360  return sub;
361 }
362 
363 
364 // Get rid of whole linked list
366 {
368 
369  for (chunk = sub ->h; chunk != NULL; chunk = n) {
370 
371  n = chunk->next;
372  if (chunk->Block != NULL) _cmsFree(sub ->ContextID, chunk->Block);
373  _cmsFree(sub ->ContextID, chunk);
374  }
375 
376  // Free the header
377  _cmsFree(sub ->ContextID, sub);
378 }
379 
380 
381 // Get a pointer to small memory block.
383 {
384  cmsUInt32Number Free = sub -> h ->BlockSize - sub -> h -> Used;
386 
388 
389  // Check for memory. If there is no room, allocate a new chunk of double memory size.
390  if (size > Free) {
391 
393  cmsUInt32Number newSize;
394 
395  newSize = sub -> h ->BlockSize * 2;
396  if (newSize < size) newSize = size;
397 
398  chunk = _cmsCreateSubAllocChunk(sub -> ContextID, newSize);
399  if (chunk == NULL) return NULL;
400 
401  // Link list
402  chunk ->next = sub ->h;
403  sub ->h = chunk;
404 
405  }
406 
407  ptr = sub -> h ->Block + sub -> h ->Used;
408  sub -> h -> Used += size;
409 
410  return (void*) ptr;
411 }
412 
413 // Duplicate in pool
415 {
416  void *NewPtr;
417 
418  // Dup of null pointer is also NULL
419  if (ptr == NULL)
420  return NULL;
421 
422  NewPtr = _cmsSubAlloc(s, size);
423 
424  if (ptr != NULL && NewPtr != NULL) {
425  memcpy(NewPtr, ptr, size);
426  }
427 
428  return NewPtr;
429 }
430 
431 
432 
433 // Error logging ******************************************************************
434 
435 // There is no error handling at all. When a function fails, it returns proper value.
436 // For example, all create functions does return NULL on failure. Other return FALSE
437 // It may be interesting, for the developer, to know why the function is failing.
438 // for that reason, lcms2 does offer a logging function. This function does receive
439 // a ENGLISH string with some clues on what is going wrong. You can show this
440 // info to the end user, or just create some sort of log.
441 // The logging function should NOT terminate the program, as this obviously can leave
442 // resources. It is the programmer's responsibility to check each function return code
443 // to make sure it didn't fail.
444 
445 // Error messages are limited to MAX_ERROR_MESSAGE_LEN
446 
447 #define MAX_ERROR_MESSAGE_LEN 1024
448 
449 // ---------------------------------------------------------------------------------------------------------
450 
451 // This is our default log error
452 static void DefaultLogErrorHandlerFunction(cmsContext ContextID, cmsUInt32Number ErrorCode, const char *Text);
453 
454 // Context0 storage, which is global
456 
457 // Allocates and inits error logger container for a given context. If src is NULL, only initializes the value
458 // to the default. Otherwise, it duplicates the value. The interface is standard across all context clients
460  const struct _cmsContext_struct* src)
461 {
462  static _cmsLogErrorChunkType LogErrorChunk = { DefaultLogErrorHandlerFunction };
463  void* from;
464 
465  if (src != NULL) {
466  from = src ->chunks[Logger];
467  }
468  else {
469  from = &LogErrorChunk;
470  }
471 
472  ctx ->chunks[Logger] = _cmsSubAllocDup(ctx ->MemPool, from, sizeof(_cmsLogErrorChunkType));
473 }
474 
475 // The default error logger does nothing.
476 static
477 void DefaultLogErrorHandlerFunction(cmsContext ContextID, cmsUInt32Number ErrorCode, const char *Text)
478 {
479  // fprintf(stderr, "[lcms]: %s\n", Text);
480  // fflush(stderr);
481 
482  cmsUNUSED_PARAMETER(ContextID);
483  cmsUNUSED_PARAMETER(ErrorCode);
484  cmsUNUSED_PARAMETER(Text);
485 }
486 
487 // Change log error, context based
489 {
491 
492  if (lhg != NULL) {
493 
494  if (Fn == NULL)
495  lhg -> LogErrorHandler = DefaultLogErrorHandlerFunction;
496  else
497  lhg -> LogErrorHandler = Fn;
498  }
499 }
500 
501 // Change log error, legacy
503 {
505 }
506 
507 // Log an error
508 // ErrorText is a text holding an english description of error.
509 void CMSEXPORT cmsSignalError(cmsContext ContextID, cmsUInt32Number ErrorCode, const char *ErrorText, ...)
510 {
511  va_list args;
514 
515 
516  va_start(args, ErrorText);
517  vsnprintf(Buffer, MAX_ERROR_MESSAGE_LEN-1, ErrorText, args);
518  va_end(args);
519 
520  // Check for the context, if specified go there. If not, go for the global
522  if (lhg ->LogErrorHandler) {
523  lhg ->LogErrorHandler(ContextID, ErrorCode, Buffer);
524  }
525 }
526 
527 // Utility function to print signatures
529 {
531 
532  // Convert to big endian
534 
535  // Move chars
536  memmove(String, &be, 4);
537 
538  // Make sure of terminator
539  String[4] = 0;
540 }
541 
542 //--------------------------------------------------------------------------------------------------
543 
544 
545 static
547 {
548  _cmsMutex* ptr_mutex = (_cmsMutex*) _cmsMalloc(id, sizeof(_cmsMutex));
549  _cmsInitMutexPrimitive(ptr_mutex);
550  return (void*) ptr_mutex;
551 }
552 
553 static
554 void defMtxDestroy(cmsContext id, void* mtx)
555 {
557  _cmsFree(id, mtx);
558 }
559 
560 static
562 {
564  return _cmsLockPrimitive((_cmsMutex *) mtx) == 0;
565 }
566 
567 static
568 void defMtxUnlock(cmsContext id, void* mtx)
569 {
571  _cmsUnlockPrimitive((_cmsMutex *) mtx);
572 }
573 
574 
575 
576 // Pointers to memory manager functions in Context0
578 
579 // Allocate and init mutex container.
581  const struct _cmsContext_struct* src)
582 {
584  void* from;
585 
586  if (src != NULL) {
587  from = src ->chunks[MutexPlugin];
588  }
589  else {
590  from = &MutexChunk;
591  }
592 
593  ctx ->chunks[MutexPlugin] = _cmsSubAllocDup(ctx ->MemPool, from, sizeof(_cmsMutexPluginChunkType));
594 }
595 
596 // Register new ways to transform
598 {
599  cmsPluginMutex* Plugin = (cmsPluginMutex*) Data;
601 
602  if (Data == NULL) {
603 
604  // No lock routines
605  ctx->CreateMutexPtr = NULL;
606  ctx->DestroyMutexPtr = NULL;
607  ctx->LockMutexPtr = NULL;
608  ctx ->UnlockMutexPtr = NULL;
609  return TRUE;
610  }
611 
612  // Factory callback is required
613  if (Plugin ->CreateMutexPtr == NULL || Plugin ->DestroyMutexPtr == NULL ||
614  Plugin ->LockMutexPtr == NULL || Plugin ->UnlockMutexPtr == NULL) return FALSE;
615 
616 
617  ctx->CreateMutexPtr = Plugin->CreateMutexPtr;
618  ctx->DestroyMutexPtr = Plugin ->DestroyMutexPtr;
619  ctx ->LockMutexPtr = Plugin ->LockMutexPtr;
620  ctx ->UnlockMutexPtr = Plugin ->UnlockMutexPtr;
621 
622  // All is ok
623  return TRUE;
624 }
625 
626 // Generic Mutex fns
628 {
630 
631  if (ptr ->CreateMutexPtr == NULL) return NULL;
632 
633  return ptr ->CreateMutexPtr(ContextID);
634 }
635 
636 void CMSEXPORT _cmsDestroyMutex(cmsContext ContextID, void* mtx)
637 {
639 
640  if (ptr ->DestroyMutexPtr != NULL) {
641 
642  ptr ->DestroyMutexPtr(ContextID, mtx);
643  }
644 }
645 
647 {
649 
650  if (ptr ->LockMutexPtr == NULL) return TRUE;
651 
652  return ptr ->LockMutexPtr(ContextID, mtx);
653 }
654 
655 void CMSEXPORT _cmsUnlockMutex(cmsContext ContextID, void* mtx)
656 {
658 
659  if (ptr ->UnlockMutexPtr != NULL) {
660 
661  ptr ->UnlockMutexPtr(ContextID, mtx);
662  }
663 }
Definition: Endian.h:47
void * _cmsSubAlloc(_cmsSubAllocator *sub, cmsUInt32Number size)
Definition: cmserr.c:382
static void * defMtxCreate(cmsContext id)
Definition: cmserr.c:546
void _cmsAllocLogErrorChunk(struct _cmsContext_struct *ctx, const struct _cmsContext_struct *src)
Definition: cmserr.c:459
void cmsSetLogErrorHandler(cmsLogErrorHandlerFunction Fn)
Definition: cmserr.c:502
_cmsMutexPluginChunkType _cmsMutexPluginChunk
Definition: cmserr.c:577
void * _cmsCreateMutex(cmsContext ContextID)
Definition: cmserr.c:627
int cmsGetEncodedCMMversion(void)
Definition: cmserr.c:30
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 cmsBool defMtxLock(cmsContext id, void *mtx)
Definition: cmserr.c:561
void _cmsTagSignature2String(char String[5], cmsTagSignature sig)
Definition: cmserr.c:528
static void defMtxDestroy(cmsContext id, void *mtx)
Definition: cmserr.c:554
void * _cmsCalloc(cmsContext ContextID, cmsUInt32Number num, cmsUInt32Number size)
Definition: cmserr.c:278
#define MAX_ERROR_MESSAGE_LEN
Definition: cmserr.c:447
_cmsLogErrorChunkType _cmsLogErrorChunk
Definition: cmserr.c:455
static void _cmsFreeDefaultFn(cmsContext ContextID, void *Ptr)
Definition: cmserr.c:116
cmsBool _cmsRegisterMutexPlugin(cmsContext ContextID, cmsPluginBase *Data)
Definition: cmserr.c:597
void _cmsFree(cmsContext ContextID, void *Ptr)
Definition: cmserr.c:292
void * _cmsRealloc(cmsContext ContextID, void *Ptr, cmsUInt32Number size)
Definition: cmserr.c:285
void _cmsDestroyMutex(cmsContext ContextID, void *mtx)
Definition: cmserr.c:636
void _cmsUnlockMutex(cmsContext ContextID, void *mtx)
Definition: cmserr.c:655
long int cmsfilelength(FILE *f)
Definition: cmserr.c:52
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 _cmsSubAllocator_chunk * _cmsCreateSubAllocChunk(cmsContext ContextID, cmsUInt32Number Initial)
Definition: cmserr.c:314
static void defMtxUnlock(cmsContext id, void *mtx)
Definition: cmserr.c:568
void * _cmsDupMem(cmsContext ContextID, const void *Org, cmsUInt32Number size)
Definition: cmserr.c:301
static void DefaultLogErrorHandlerFunction(cmsContext ContextID, cmsUInt32Number ErrorCode, const char *Text)
Definition: cmserr.c:477
cmsBool _cmsRegisterMemHandlerPlugin(cmsContext ContextID, cmsPluginBase *Plugin)
Definition: cmserr.c:230
int cmsstrcasecmp(const char *s1, const char *s2)
Definition: cmserr.c:39
#define MAX_MEMORY_FOR_ALLOC
Definition: cmserr.c:78
void _cmsInstallAllocFunctions(cmsPluginMemHandler *Plugin, _cmsMemPluginChunkType *ptr)
Definition: cmserr.c:204
void * _cmsSubAllocDup(_cmsSubAllocator *s, const void *ptr, cmsUInt32Number size)
Definition: cmserr.c:414
void _cmsAllocMemPluginChunk(struct _cmsContext_struct *ctx, const struct _cmsContext_struct *src)
Definition: cmserr.c:187
_cmsSubAllocator * _cmsCreateSubAlloc(cmsContext ContextID, cmsUInt32Number Initial)
Definition: cmserr.c:344
void cmsSetLogErrorHandlerTHR(cmsContext ContextID, cmsLogErrorHandlerFunction Fn)
Definition: cmserr.c:488
static void * _cmsMallocDefaultFn(cmsContext ContextID, cmsUInt32Number size)
Definition: cmserr.c:93
void _cmsSubAllocDestroy(_cmsSubAllocator *sub)
Definition: cmserr.c:365
void cmsSignalError(cmsContext ContextID, cmsUInt32Number ErrorCode, const char *ErrorText,...)
Definition: cmserr.c:509
void * _cmsMallocZero(cmsContext ContextID, cmsUInt32Number size)
Definition: cmserr.c:271
void * _cmsMalloc(cmsContext ContextID, cmsUInt32Number size)
Definition: cmserr.c:264
cmsBool _cmsLockMutex(cmsContext ContextID, void *mtx)
Definition: cmserr.c:646
void _cmsAllocMutexPluginChunk(struct _cmsContext_struct *ctx, const struct _cmsContext_struct *src)
Definition: cmserr.c:580
_cmsMemPluginChunkType _cmsMemPluginChunk
Definition: cmserr.c:181
#define n
Definition: t4ht.c:1290
void * _cmsContextGetClientChunk(cmsContext ContextID, _cmsMemoryClient mc)
Definition: cmsplugin.c:699
cmsUInt32Number _cmsAdjustEndianess32(cmsUInt32Number DWord)
Definition: cmsplugin.c:58
@ FALSE
Definition: dd.h:101
@ TRUE
Definition: dd.h:102
#define Free(x)
Definition: dd.h:135
#define free(a)
Definition: decNumber.cpp:310
int h
Definition: dviconv.c:9
#define fseek
Definition: xxstdio.h:30
#define ftell
Definition: xxstdio.h:31
mpz_t * f
Definition: gen-fib.c:34
#define s
Definition: afcover.h:80
#define memmove(d, s, n)
Definition: gsftopk.c:65
#define memcpy(d, s, n)
Definition: gsftopk.c:64
#define SEEK_SET
Definition: jmemansi.c:26
#define NULL
Definition: ftobjs.h:61
small capitals from c petite p
Definition: afcover.h:72
#define SEEK_END
Definition: ftzconf.h:251
int num
Definition: disdvi.c:621
#define UINT_MAX
Definition: c-minmax.h:56
#define malloc
Definition: alloca.c:91
#define mem
Definition: synctex.c:171
char args[100]
Definition: fixwrites.c:7
#define vsnprintf
Definition: snprintf.c:40
int cmsBool
Definition: lcms2.h:174
#define CMSEXPORT
Definition: lcms2.h:252
unsigned int cmsUInt32Number
Definition: lcms2.h:120
#define LCMS_VERSION
Definition: lcms2.h:84
cmsTagSignature
Definition: lcms2.h:333
#define CMSREGISTER
Definition: lcms2.h:158
unsigned char cmsUInt8Number
Definition: lcms2.h:90
void(* cmsLogErrorHandlerFunction)(cmsContext ContextID, cmsUInt32Number ErrorCode, const char *Text)
Definition: lcms2.h:1084
static int _cmsDestroyMutexPrimitive(_cmsMutex *m)
#define _cmsAssert(a)
@ MemPlugin
@ MutexPlugin
pthread_mutex_t _cmsMutex
#define cmsUNUSED_PARAMETER(x)
static int _cmsInitMutexPrimitive(_cmsMutex *m)
static int _cmsUnlockPrimitive(_cmsMutex *m)
static int _cmsLockPrimitive(_cmsMutex *m)
#define _cmsALIGNMEM(x)
struct Logger Logger
#define realloc
Definition: glob.c:206
int16 Block[8][8]
Definition: mtypes.h:99
set set set set set set set set set set set set set set set set set set set set *set set set macro pixldst op &r &cond WK op &r &cond WK op &r &cond WK else op &m &cond &ia op &r &cond WK else op &m &cond &ia elseif elseif else error unsupported base if elseif elseif else error unsupported unaligned pixldst unaligned endm macro pixst base base else pixldst base endif endm macro PF base if bpp PF set rept prefetch_distance PF set OFFSET endr endif endm macro preload_leading_step2 base if bpp ifc DST PF PF else if bpp lsl PF PF lsl PF sub
set set set set set set set set set set set set set set set set set set set set *set set set macro pixldst op &r &cond WK op &r &cond WK op &r &cond WK else op &m &cond &ia op &r &cond WK else op &m &cond &ia elseif elseif else error unsupported base if elseif elseif else error unsupported unaligned pixldst unaligned endm macro pixst base base else pixldst base endif endm macro PF ptr
static int size
Definition: ppmlabel.c:24
type_C toupper(type_C)
bstring c int memset(void *s, int c, int length)
static void chunk(LexState *ls)
Definition: minilua.c:4678
char * Ptr
Definition: TECkit_Common.h:41
Definition: logger.c:4
A string of characters.
Definition: t1part.c:49
void * chunks[MemoryClientMax]
_cmsSubAllocator * MemPool
_cmsMemPluginChunkType DefaultMemoryManager
cmsLogErrorHandlerFunction LogErrorHandler
_cmsLockMutexFnPtrType LockMutexPtr
_cmsCreateMutexFnPtrType CreateMutexPtr
_cmsUnlockMutexFnPtrType UnlockMutexPtr
_cmsDestroyMutexFnPtrType DestroyMutexPtr
Definition: usprintf.c:39
struct chunk * next
Definition: splineutil.c:76
_cmsDestroyMutexFnPtrType DestroyMutexPtr
Definition: lcms2_plugin.h:652
_cmsLockMutexFnPtrType LockMutexPtr
Definition: lcms2_plugin.h:653
_cmsUnlockMutexFnPtrType UnlockMutexPtr
Definition: lcms2_plugin.h:654
_cmsCreateMutexFnPtrType CreateMutexPtr
Definition: lcms2_plugin.h:651
#define FILE
Definition: t1stdio.h:34
s1
Definition: t4ht.c:1059
char * s2
Definition: t4ht.c:1062
#define va_start(pvar)
Definition: varargs.h:30
#define va_end(pvar)
Definition: varargs.h:38
char * va_list
Definition: varargs.h:22
PATTERN * pt
Definition: vlna.c:74