• Home
  • Raw
  • Download

Lines Matching refs:iohandler

48 cmsUInt32Number NULLRead(cmsIOHANDLER* iohandler, void *Buffer, cmsUInt32Number size, cmsUInt32Numb…  in NULLRead()  argument
50 FILENULL* ResData = (FILENULL*) iohandler ->stream; in NULLRead()
60 cmsBool NULLSeek(cmsIOHANDLER* iohandler, cmsUInt32Number offset) in NULLSeek() argument
62 FILENULL* ResData = (FILENULL*) iohandler ->stream; in NULLSeek()
69 cmsUInt32Number NULLTell(cmsIOHANDLER* iohandler) in NULLTell() argument
71 FILENULL* ResData = (FILENULL*) iohandler ->stream; in NULLTell()
76 cmsBool NULLWrite(cmsIOHANDLER* iohandler, cmsUInt32Number size, const void *Ptr) in NULLWrite() argument
78 FILENULL* ResData = (FILENULL*) iohandler ->stream; in NULLWrite()
81 if (ResData ->Pointer > iohandler->UsedSpace) in NULLWrite()
82 iohandler->UsedSpace = ResData ->Pointer; in NULLWrite()
90 cmsBool NULLClose(cmsIOHANDLER* iohandler) in NULLClose() argument
92 FILENULL* ResData = (FILENULL*) iohandler ->stream; in NULLClose()
94 _cmsFree(iohandler ->ContextID, ResData); in NULLClose()
95 _cmsFree(iohandler ->ContextID, iohandler); in NULLClose()
102 struct _cms_io_handler* iohandler = NULL; in cmsOpenIOhandlerFromNULL() local
105 iohandler = (struct _cms_io_handler*) _cmsMallocZero(ContextID, sizeof(struct _cms_io_handler)); in cmsOpenIOhandlerFromNULL()
106 if (iohandler == NULL) return NULL; in cmsOpenIOhandlerFromNULL()
113 iohandler ->ContextID = ContextID; in cmsOpenIOhandlerFromNULL()
114 iohandler ->stream = (void*) fm; in cmsOpenIOhandlerFromNULL()
115 iohandler ->UsedSpace = 0; in cmsOpenIOhandlerFromNULL()
116 iohandler ->ReportedSize = 0; in cmsOpenIOhandlerFromNULL()
117 iohandler ->PhysicalFile[0] = 0; in cmsOpenIOhandlerFromNULL()
119 iohandler ->Read = NULLRead; in cmsOpenIOhandlerFromNULL()
120 iohandler ->Seek = NULLSeek; in cmsOpenIOhandlerFromNULL()
121 iohandler ->Close = NULLClose; in cmsOpenIOhandlerFromNULL()
122 iohandler ->Tell = NULLTell; in cmsOpenIOhandlerFromNULL()
123 iohandler ->Write = NULLWrite; in cmsOpenIOhandlerFromNULL()
125 return iohandler; in cmsOpenIOhandlerFromNULL()
128 if (iohandler) _cmsFree(ContextID, iohandler); in cmsOpenIOhandlerFromNULL()
147 cmsUInt32Number MemoryRead(struct _cms_io_handler* iohandler, void *Buffer, cmsUInt32Number size, c… in MemoryRead() argument
149 FILEMEM* ResData = (FILEMEM*) iohandler ->stream; in MemoryRead()
156 …cmsSignalError(iohandler ->ContextID, cmsERROR_READ, "Read from memory error. Got %d bytes, block … in MemoryRead()
170 cmsBool MemorySeek(struct _cms_io_handler* iohandler, cmsUInt32Number offset) in MemorySeek() argument
172 FILEMEM* ResData = (FILEMEM*) iohandler ->stream; in MemorySeek()
175 … cmsSignalError(iohandler ->ContextID, cmsERROR_SEEK, "Too few data; probably corrupted profile"); in MemorySeek()
185 cmsUInt32Number MemoryTell(struct _cms_io_handler* iohandler) in MemoryTell() argument
187 FILEMEM* ResData = (FILEMEM*) iohandler ->stream; in MemoryTell()
196 cmsBool MemoryWrite(struct _cms_io_handler* iohandler, cmsUInt32Number size, const void *Ptr) in MemoryWrite() argument
198 FILEMEM* ResData = (FILEMEM*) iohandler ->stream; in MemoryWrite()
212 if (ResData ->Pointer > iohandler->UsedSpace) in MemoryWrite()
213 iohandler->UsedSpace = ResData ->Pointer; in MemoryWrite()
220 cmsBool MemoryClose(struct _cms_io_handler* iohandler) in MemoryClose() argument
222 FILEMEM* ResData = (FILEMEM*) iohandler ->stream; in MemoryClose()
226 if (ResData ->Block) _cmsFree(iohandler ->ContextID, ResData ->Block); in MemoryClose()
229 _cmsFree(iohandler ->ContextID, ResData); in MemoryClose()
230 _cmsFree(iohandler ->ContextID, iohandler); in MemoryClose()
240 cmsIOHANDLER* iohandler = NULL; in cmsOpenIOhandlerFromMem() local
245 iohandler = (cmsIOHANDLER*) _cmsMallocZero(ContextID, sizeof(cmsIOHANDLER)); in cmsOpenIOhandlerFromMem()
246 if (iohandler == NULL) return NULL; in cmsOpenIOhandlerFromMem()
263 _cmsFree(ContextID, iohandler); in cmsOpenIOhandlerFromMem()
273 iohandler -> ReportedSize = size; in cmsOpenIOhandlerFromMem()
284 iohandler -> ReportedSize = 0; in cmsOpenIOhandlerFromMem()
292 iohandler ->ContextID = ContextID; in cmsOpenIOhandlerFromMem()
293 iohandler ->stream = (void*) fm; in cmsOpenIOhandlerFromMem()
294 iohandler ->UsedSpace = 0; in cmsOpenIOhandlerFromMem()
295 iohandler ->PhysicalFile[0] = 0; in cmsOpenIOhandlerFromMem()
297 iohandler ->Read = MemoryRead; in cmsOpenIOhandlerFromMem()
298 iohandler ->Seek = MemorySeek; in cmsOpenIOhandlerFromMem()
299 iohandler ->Close = MemoryClose; in cmsOpenIOhandlerFromMem()
300 iohandler ->Tell = MemoryTell; in cmsOpenIOhandlerFromMem()
301 iohandler ->Write = MemoryWrite; in cmsOpenIOhandlerFromMem()
303 return iohandler; in cmsOpenIOhandlerFromMem()
307 if (iohandler) _cmsFree(ContextID, iohandler); in cmsOpenIOhandlerFromMem()
315 cmsUInt32Number FileRead(cmsIOHANDLER* iohandler, void *Buffer, cmsUInt32Number size, cmsUInt32Numb… in FileRead() argument
317 … cmsUInt32Number nReaded = (cmsUInt32Number) fread(Buffer, size, count, (FILE*) iohandler->stream); in FileRead()
320 …cmsSignalError(iohandler ->ContextID, cmsERROR_FILE, "Read error. Got %d bytes, block should be of… in FileRead()
329 cmsBool FileSeek(cmsIOHANDLER* iohandler, cmsUInt32Number offset) in FileSeek() argument
331 if (fseek((FILE*) iohandler ->stream, (long) offset, SEEK_SET) != 0) { in FileSeek()
333 cmsSignalError(iohandler ->ContextID, cmsERROR_FILE, "Seek error; probably corrupted file"); in FileSeek()
342 cmsUInt32Number FileTell(cmsIOHANDLER* iohandler) in FileTell() argument
344 long t = ftell((FILE*)iohandler ->stream); in FileTell()
346 cmsSignalError(iohandler->ContextID, cmsERROR_FILE, "Tell error; probably corrupted file"); in FileTell()
355 cmsBool FileWrite(cmsIOHANDLER* iohandler, cmsUInt32Number size, const void* Buffer) in FileWrite() argument
359 iohandler->UsedSpace += size; in FileWrite()
360 return (fwrite(Buffer, size, 1, (FILE*)iohandler->stream) == 1); in FileWrite()
365 cmsBool FileClose(cmsIOHANDLER* iohandler) in FileClose() argument
367 if (fclose((FILE*) iohandler ->stream) != 0) return FALSE; in FileClose()
368 _cmsFree(iohandler ->ContextID, iohandler); in FileClose()
375 cmsIOHANDLER* iohandler = NULL; in cmsOpenIOhandlerFromFile() local
382 iohandler = (cmsIOHANDLER*) _cmsMallocZero(ContextID, sizeof(cmsIOHANDLER)); in cmsOpenIOhandlerFromFile()
383 if (iohandler == NULL) return NULL; in cmsOpenIOhandlerFromFile()
390 _cmsFree(ContextID, iohandler); in cmsOpenIOhandlerFromFile()
398 _cmsFree(ContextID, iohandler); in cmsOpenIOhandlerFromFile()
403 iohandler -> ReportedSize = (cmsUInt32Number) fileLen; in cmsOpenIOhandlerFromFile()
409 _cmsFree(ContextID, iohandler); in cmsOpenIOhandlerFromFile()
413 iohandler -> ReportedSize = 0; in cmsOpenIOhandlerFromFile()
417 _cmsFree(ContextID, iohandler); in cmsOpenIOhandlerFromFile()
422 iohandler ->ContextID = ContextID; in cmsOpenIOhandlerFromFile()
423 iohandler ->stream = (void*) fm; in cmsOpenIOhandlerFromFile()
424 iohandler ->UsedSpace = 0; in cmsOpenIOhandlerFromFile()
427 strncpy(iohandler -> PhysicalFile, FileName, sizeof(iohandler -> PhysicalFile)-1); in cmsOpenIOhandlerFromFile()
428 iohandler -> PhysicalFile[sizeof(iohandler -> PhysicalFile)-1] = 0; in cmsOpenIOhandlerFromFile()
430 iohandler ->Read = FileRead; in cmsOpenIOhandlerFromFile()
431 iohandler ->Seek = FileSeek; in cmsOpenIOhandlerFromFile()
432 iohandler ->Close = FileClose; in cmsOpenIOhandlerFromFile()
433 iohandler ->Tell = FileTell; in cmsOpenIOhandlerFromFile()
434 iohandler ->Write = FileWrite; in cmsOpenIOhandlerFromFile()
436 return iohandler; in cmsOpenIOhandlerFromFile()
442 cmsIOHANDLER* iohandler = NULL; in cmsOpenIOhandlerFromStream() local
452 iohandler = (cmsIOHANDLER*) _cmsMallocZero(ContextID, sizeof(cmsIOHANDLER)); in cmsOpenIOhandlerFromStream()
453 if (iohandler == NULL) return NULL; in cmsOpenIOhandlerFromStream()
455 iohandler -> ContextID = ContextID; in cmsOpenIOhandlerFromStream()
456 iohandler -> stream = (void*) Stream; in cmsOpenIOhandlerFromStream()
457 iohandler -> UsedSpace = 0; in cmsOpenIOhandlerFromStream()
458 iohandler -> ReportedSize = (cmsUInt32Number) fileSize; in cmsOpenIOhandlerFromStream()
459 iohandler -> PhysicalFile[0] = 0; in cmsOpenIOhandlerFromStream()
461 iohandler ->Read = FileRead; in cmsOpenIOhandlerFromStream()
462 iohandler ->Seek = FileSeek; in cmsOpenIOhandlerFromStream()
463 iohandler ->Close = FileClose; in cmsOpenIOhandlerFromStream()
464 iohandler ->Tell = FileTell; in cmsOpenIOhandlerFromStream()
465 iohandler ->Write = FileWrite; in cmsOpenIOhandlerFromStream()
467 return iohandler; in cmsOpenIOhandlerFromStream()