FDK/Tools/Programs/makeotf/source/cb.c
/* [hot callback] Close temporary file */
[hot callback] Close temporary file
[ hot callback ] Close temporary file
static void tmpClose(void *ctx)
	{
	cbCtx h = ctx;
	if (h->tmp.file.fp != NULL)
		fileClose(&h->tmp.file);
# if CID_CFF_DEBUG	
	if (h->tmp.file.name != NULL)
		{
		FILE *tmp_fp;
		size_t n;
		char str[1024];
		sprintf(str,"Saving temp CFF file to: %s%s", h->tmp.file.name, ".cff");
		message(h, hotNOTE,str );
		sprintf(str,"%s%s", h->tmp.file.name, ".cff");
		tmp_fp = fopen(str, "wb");
		if (tmp_fp == NULL)
			cbFatal(h, "file error <%s> [%s]", strerror(errno), str);
		n = fwrite(h->cff.buf.array, 1,h->cff.buf.cnt, tmp_fp);
		if (n == 0 && ferror(tmp_fp))
			cbFatal(h, "file error <%s> [%s]", strerror(errno), str);
		fclose(tmp_fp);
		}
#endif	
	}
static void tmpClose ( void * ctx ) { cbCtx h = ctx ; if ( h -> tmp . file . fp != NULL ) fileClose ( & h -> tmp . file ) ; # if CID_CFF_DEBUG if ( h -> tmp . file . name != NULL ) { FILE * tmp_fp ; size_t n ; char str [ 1024 ] ; sprintf ( str , " " , h -> tmp . file . name , " " ) ; message ( h , hotNOTE , str ) ; sprintf ( str , " " , h -> tmp . file . name , " " ) ; tmp_fp = fopen ( str , " " ) ; if ( tmp_fp == NULL ) cbFatal ( h , " " , strerror ( errno ) , str ) ; n = fwrite ( h -> cff . buf . array , 1 , h -> cff . buf . cnt , tmp_fp ) ; if ( n == 0 && ferror ( tmp_fp ) ) cbFatal ( h , " " , strerror ( errno ) , str ) ; fclose ( tmp_fp ) ; } #endif }
[hot callback] Close temporary file
[ hot callback ] Close temporary file
/* turn this on to write  CFF file, for debugging CID CFF creation */