Lines Matching defs:ContextID

123     _cmsFree(iohandler ->ContextID, ResData);
124 _cmsFree(iohandler ->ContextID, iohandler);
129 cmsIOHANDLER* CMSEXPORT cmsOpenIOhandlerFromNULL(cmsContext ContextID)
134 iohandler = (struct _cms_io_handler*) _cmsMallocZero(ContextID, sizeof(struct _cms_io_handler));
137 fm = (FILENULL*) _cmsMallocZero(ContextID, sizeof(FILENULL));
142 iohandler ->ContextID = ContextID;
157 if (iohandler) _cmsFree(ContextID, iohandler);
185 cmsSignalError(iohandler ->ContextID, cmsERROR_READ, "Read from memory error. Got %d bytes, block should be of %d bytes", len, count * size);
204 cmsSignalError(iohandler ->ContextID, cmsERROR_SEEK, "Too few data; probably corrupted profile");
255 if (ResData ->Block) _cmsFree(iohandler ->ContextID, ResData ->Block);
258 _cmsFree(iohandler ->ContextID, ResData);
259 _cmsFree(iohandler ->ContextID, iohandler);
267 cmsIOHANDLER* CMSEXPORT cmsOpenIOhandlerFromMem(cmsContext ContextID, void *Buffer, cmsUInt32Number size, const char* AccessMode)
274 iohandler = (cmsIOHANDLER*) _cmsMallocZero(ContextID, sizeof(cmsIOHANDLER));
280 fm = (FILEMEM*) _cmsMallocZero(ContextID, sizeof(FILEMEM));
284 cmsSignalError(ContextID, cmsERROR_READ, "Couldn't read profile from NULL pointer");
288 fm ->Block = (cmsUInt8Number*) _cmsMalloc(ContextID, size);
291 _cmsFree(ContextID, fm);
292 _cmsFree(ContextID, iohandler);
293 cmsSignalError(ContextID, cmsERROR_READ, "Couldn't allocate %ld bytes for profile", size);
306 fm = (FILEMEM*) _cmsMallocZero(ContextID, sizeof(FILEMEM));
317 cmsSignalError(ContextID, cmsERROR_UNKNOWN_EXTENSION, "Unknown access mode '%c'", *AccessMode);
321 iohandler ->ContextID = ContextID;
335 if (fm) _cmsFree(ContextID, fm);
336 if (iohandler) _cmsFree(ContextID, iohandler);
349 cmsSignalError(iohandler ->ContextID, cmsERROR_FILE, "Read error. Got %d bytes, block should be of %d bytes", nReaded * size, count * size);
362 cmsSignalError(iohandler ->ContextID, cmsERROR_FILE, "Seek error; probably corrupted file");
391 _cmsFree(iohandler ->ContextID, iohandler);
396 cmsIOHANDLER* CMSEXPORT cmsOpenIOhandlerFromFile(cmsContext ContextID, const char* FileName, const char* AccessMode)
405 iohandler = (cmsIOHANDLER*) _cmsMallocZero(ContextID, sizeof(cmsIOHANDLER));
413 _cmsFree(ContextID, iohandler);
414 cmsSignalError(ContextID, cmsERROR_FILE, "File '%s' not found", FileName);
421 _cmsFree(ContextID, iohandler);
422 cmsSignalError(ContextID, cmsERROR_FILE, "Cannot get size of file '%s'", FileName);
432 _cmsFree(ContextID, iohandler);
433 cmsSignalError(ContextID, cmsERROR_FILE, "Couldn't create '%s'", FileName);
440 _cmsFree(ContextID, iohandler);
441 cmsSignalError(ContextID, cmsERROR_FILE, "Unknown access mode '%c'", *AccessMode);
445 iohandler ->ContextID = ContextID;
463 cmsIOHANDLER* CMSEXPORT cmsOpenIOhandlerFromStream(cmsContext ContextID, FILE* Stream)
471 cmsSignalError(ContextID, cmsERROR_FILE, "Cannot get size of stream");
475 iohandler = (cmsIOHANDLER*) _cmsMallocZero(ContextID, sizeof(cmsIOHANDLER));
478 iohandler -> ContextID = ContextID;
512 cmsHPROFILE CMSEXPORT cmsCreateProfilePlaceholder(cmsContext ContextID)
515 _cmsICCPROFILE* Icc = (_cmsICCPROFILE*) _cmsMallocZero(ContextID, sizeof(_cmsICCPROFILE));
518 Icc ->ContextID = ContextID;
530 Icc ->UsrMutex = _cmsCreateMutex(ContextID);
541 return Icc -> ContextID;
623 _cmsFree(Icc ->ContextID, Icc ->TagPtrs[i]);
631 LocalTypeHandler.ContextID = Icc ->ContextID; // As an additional parameter
661 cmsSignalError(Icc ->ContextID, cmsERROR_RANGE, "Too many tags (%d)", MAX_TABLE_TAG);
725 cmsSignalError(Icc ->ContextID, cmsERROR_BAD_SIGNATURE, "not an ICC profile, invalid signature");
762 cmsSignalError(Icc ->ContextID, cmsERROR_RANGE, "Too many tags (%d)", TagCount);
1055 cmsHPROFILE CMSEXPORT cmsOpenProfileFromIOhandlerTHR(cmsContext ContextID, cmsIOHANDLER* io)
1058 cmsHPROFILE hEmpty = cmsCreateProfilePlaceholder(ContextID);
1074 cmsHPROFILE CMSEXPORT cmsOpenProfileFromIOhandler2THR(cmsContext ContextID, cmsIOHANDLER* io, cmsBool write)
1077 cmsHPROFILE hEmpty = cmsCreateProfilePlaceholder(ContextID);
1100 cmsHPROFILE CMSEXPORT cmsOpenProfileFromFileTHR(cmsContext ContextID, const char *lpFileName, const char *sAccess)
1103 cmsHPROFILE hEmpty = cmsCreateProfilePlaceholder(ContextID);
1109 NewIcc ->IOhandler = cmsOpenIOhandlerFromFile(ContextID, lpFileName, sAccess);
1134 cmsHPROFILE CMSEXPORT cmsOpenProfileFromStreamTHR(cmsContext ContextID, FILE* ICCProfile, const char *sAccess)
1137 cmsHPROFILE hEmpty = cmsCreateProfilePlaceholder(ContextID);
1143 NewIcc ->IOhandler = cmsOpenIOhandlerFromStream(ContextID, ICCProfile);
1168 cmsHPROFILE CMSEXPORT cmsOpenProfileFromMemTHR(cmsContext ContextID, const void* MemPtr, cmsUInt32Number dwSize)
1173 hEmpty = cmsCreateProfilePlaceholder(ContextID);
1180 NewIcc ->IOhandler = cmsOpenIOhandlerFromMem(ContextID, (void*) MemPtr, dwSize, "r");
1237 Mem = _cmsMalloc(Icc ->ContextID, TagSize);
1242 _cmsFree(Icc ->ContextID, Mem);
1264 TagDescriptor = _cmsGetTagDescriptor(Icc-> ContextID, Icc -> TagNames[i]);
1276 TypeHandler = _cmsGetTagTypeHandler(Icc->ContextID, Type);
1279 cmsSignalError(Icc ->ContextID, cmsERROR_INTERNAL, "(Internal) no handler for tag %x", Icc -> TagNames[i]);
1288 LocalTypeHandler.ContextID = Icc ->ContextID;
1295 cmsSignalError(Icc ->ContextID, cmsERROR_WRITE, "Couldn't write type '%s'", String);
1346 cmsContext ContextID;
1350 if (!_cmsLockMutex(Icc->ContextID, Icc->UsrMutex)) return 0;
1353 ContextID = cmsGetProfileContextID(hProfile);
1354 PrevIO = Icc ->IOhandler = cmsOpenIOhandlerFromNULL(ContextID);
1356 _cmsUnlockMutex(Icc->ContextID, Icc->UsrMutex);
1381 _cmsUnlockMutex(Icc->ContextID, Icc->UsrMutex);
1389 _cmsUnlockMutex(Icc->ContextID, Icc->UsrMutex);
1398 cmsContext ContextID = cmsGetProfileContextID(hProfile);
1399 cmsIOHANDLER* io = cmsOpenIOhandlerFromFile(ContextID, FileName, "w");
1417 cmsContext ContextID = cmsGetProfileContextID(hProfile);
1418 cmsIOHANDLER* io = cmsOpenIOhandlerFromStream(ContextID, Stream);
1434 cmsContext ContextID = cmsGetProfileContextID(hProfile);
1446 io = cmsOpenIOhandlerFromMem(ContextID, MemPtr, *BytesNeeded, "w");
1482 LocalTypeHandler.ContextID = Icc ->ContextID; // As an additional parameters
1487 _cmsFree(Icc ->ContextID, Icc ->TagPtrs[i]);
1495 _cmsDestroyMutex(Icc->ContextID, Icc->UsrMutex);
1497 _cmsFree(Icc ->ContextID, Icc); // Free placeholder memory
1537 if (!_cmsLockMutex(Icc->ContextID, Icc ->UsrMutex)) return NULL;
1549 TagDescriptor = _cmsGetTagDescriptor(Icc-> ContextID, sig);
1555 _cmsUnlockMutex(Icc->ContextID, Icc ->UsrMutex);
1568 TagDescriptor = _cmsGetTagDescriptor(Icc-> ContextID, sig);
1576 cmsSignalError(Icc ->ContextID, cmsERROR_UNKNOWN_EXTENSION, "Unknown tag type '%s' found.", String);
1589 TypeHandler = _cmsGetTagTypeHandler(Icc ->ContextID, BaseType);
1597 LocalTypeHandler.ContextID = Icc ->ContextID;
1608 cmsSignalError(Icc ->ContextID, cmsERROR_CORRUPTION_DETECTED, "Corrupted tag '%s'", String);
1619 cmsSignalError(Icc ->ContextID, cmsERROR_CORRUPTION_DETECTED, "'%s' Inconsistent number of items: expected %d, got %d",
1625 _cmsUnlockMutex(Icc->ContextID, Icc ->UsrMutex);
1631 _cmsUnlockMutex(Icc->ContextID, Icc ->UsrMutex);
1666 if (!_cmsLockMutex(Icc->ContextID, Icc ->UsrMutex)) return FALSE;
1678 _cmsUnlockMutex(Icc->ContextID, Icc ->UsrMutex);
1694 TagDescriptor = _cmsGetTagDescriptor(Icc-> ContextID, sig);
1696 cmsSignalError(Icc ->ContextID, cmsERROR_UNKNOWN_EXTENSION, "Unsupported tag '%x'", sig);
1724 cmsSignalError(Icc ->ContextID, cmsERROR_UNKNOWN_EXTENSION, "Unsupported type '%s' for tag '%s'", TypeString, SigString);
1729 TypeHandler = _cmsGetTagTypeHandler(Icc->ContextID, Type);
1735 cmsSignalError(Icc ->ContextID, cmsERROR_UNKNOWN_EXTENSION, "Unsupported type '%s' for tag '%s'", TypeString, SigString);
1747 LocalTypeHandler.ContextID = Icc ->ContextID;
1755 cmsSignalError(Icc ->ContextID, cmsERROR_CORRUPTION_DETECTED, "Malformed struct in type '%s' for tag '%s'", TypeString, SigString);
1760 _cmsUnlockMutex(Icc->ContextID, Icc ->UsrMutex);
1764 _cmsUnlockMutex(Icc->ContextID, Icc ->UsrMutex);
1787 if (!_cmsLockMutex(Icc->ContextID, Icc ->UsrMutex)) return 0;
1809 _cmsUnlockMutex(Icc->ContextID, Icc ->UsrMutex);
1813 _cmsUnlockMutex(Icc->ContextID, Icc ->UsrMutex);
1829 _cmsUnlockMutex(Icc->ContextID, Icc ->UsrMutex);
1833 _cmsUnlockMutex(Icc->ContextID, Icc ->UsrMutex);
1840 _cmsUnlockMutex(Icc->ContextID, Icc ->UsrMutex);
1842 if (!_cmsLockMutex(Icc->ContextID, Icc ->UsrMutex)) return 0;
1857 TagDescriptor = _cmsGetTagDescriptor(Icc-> ContextID, sig);
1867 LocalTypeHandler.ContextID = Icc ->ContextID;
1884 _cmsUnlockMutex(Icc->ContextID, Icc ->UsrMutex);
1888 _cmsUnlockMutex(Icc->ContextID, Icc ->UsrMutex);
1901 if (!_cmsLockMutex(Icc->ContextID, Icc ->UsrMutex)) return 0;
1904 _cmsUnlockMutex(Icc->ContextID, Icc ->UsrMutex);
1914 Icc ->TagPtrs[i] = _cmsDupMem(Icc ->ContextID, data, Size);
1917 _cmsUnlockMutex(Icc->ContextID, Icc ->UsrMutex);
1932 if (!_cmsLockMutex(Icc->ContextID, Icc ->UsrMutex)) return FALSE;
1935 _cmsUnlockMutex(Icc->ContextID, Icc ->UsrMutex);
1948 _cmsUnlockMutex(Icc->ContextID, Icc ->UsrMutex);