372 373 static void closeMem(void* pStream) { 374 } 375 376 int SplashStreamInitFile(SplashStream * pStream, const char* filename) { 377 pStream->arg.stdio.f = fopen(filename, "rb"); 378 pStream->read = readFile; 379 pStream->peek = peekFile; 380 pStream->close = closeFile; 381 return pStream->arg.stdio.f != 0; 382 } 383 384 int SplashStreamInitMemory(SplashStream * pStream, void* pData, int size) { 385 pStream->arg.mem.pData = (unsigned char*)pData; 386 pStream->arg.mem.pDataEnd = (unsigned char*)pData + size; 387 pStream->read = readMem; 388 pStream->peek = peekMem; 389 pStream->close = closeMem; 390 return 1; 391 } | 372 373 static void closeMem(void* pStream) { 374 } 375 376 int SplashStreamInitFile(SplashStream * pStream, const char* filename) { 377 pStream->arg.stdio.f = fopen(filename, "rb"); 378 pStream->read = readFile; 379 pStream->peek = peekFile; 380 pStream->close = closeFile; 381 return pStream->arg.stdio.f != 0; 382 } 383 384 int SplashStreamInitMemory(SplashStream * pStream, void* pData, int size) { 385 pStream->arg.mem.pData = (unsigned char*)pData; 386 pStream->arg.mem.pDataEnd = (unsigned char*)pData + size; 387 pStream->read = readMem; 388 pStream->peek = peekMem; 389 pStream->close = closeMem; 390 return 1; 391 } 392 393 SPLASHEXPORT int 394 SplashGetScaledImgNameMaxPstfixLen(const char *fileName){ 395 return strlen(fileName) + strlen(".java-scale-200") + 1; 396 } |