[gs-cvs] rev 7974 - branches/gs-esp-gpl-merger/contrib
giles at ghostscript.com
giles at ghostscript.com
Mon May 14 10:21:52 PDT 2007
Author: giles
Date: 2007-05-14 10:21:52 -0700 (Mon, 14 May 2007)
New Revision: 7974
Modified:
branches/gs-esp-gpl-merger/contrib/gomni.c
Log:
Port the omni printer driver from fprintf(stderr, ...) to use the
graphics library error reporting. The lprintf("error was here.\n")
is an attempt to best preserve the behaviour of the previous code.
Otherwise, errors use eprintf and debug messages use dprintf.
Modified: branches/gs-esp-gpl-merger/contrib/gomni.c
===================================================================
--- branches/gs-esp-gpl-merger/contrib/gomni.c 2007-05-14 17:20:20 UTC (rev 7973)
+++ branches/gs-esp-gpl-merger/contrib/gomni.c 2007-05-14 17:21:52 UTC (rev 7974)
@@ -379,31 +379,31 @@
int min_band_height;
int max_src_image_row;
- if (fDebugOutput) fprintf (stderr, "OpenDevice: pDev = %p, pDev->hmodOmni = %p\n", pDev, pDev->hmodOmni);
+ if (fDebugOutput) dprintf2 ("OpenDevice: pDev = %p, pDev->hmodOmni = %p\n", pDev, pDev->hmodOmni);
if (!pDev)
{
- fprintf (stderr, "\n<<<<<<<<<<<<<<<<<<<<<< ERROR >>>>>>>>>>>>>>>>>>>>>>>\n\n");
- fprintf (stderr, "Error: No pDev in OpenDevice.\n");
- if (fDebugOutput) fprintf (stderr, "@ line %d gomni.c\n", __LINE__);
+ eprintf ("\n<<<<<<<<<<<<<<<<<<<<<< ERROR >>>>>>>>>>>>>>>>>>>>>>>\n\n");
+ eprintf ("Error: No pDev in OpenDevice.\n");
+ if (fDebugOutput) lprintf ("error was here.\n");
return e_Fatal;
}
if (!pDev->hmodOmni)
{
- fprintf (stderr, "\n<<<<<<<<<<<<<<<<<<<<<< ERROR >>>>>>>>>>>>>>>>>>>>>>>\n\n");
- fprintf (stderr, "Error: Could not load libomni.so\n");
- if (fDebugOutput) fprintf (stderr, "@ line %d gomni.c\n", __LINE__);
+ eprintf ("\n<<<<<<<<<<<<<<<<<<<<<< ERROR >>>>>>>>>>>>>>>>>>>>>>>\n\n");
+ eprintf ("Error: Could not load libomni.so\n");
+ if (fDebugOutput) lprintf ("error was here.\n");
return e_Fatal;
}
if (!pDev->pcoreOmni->cDeviceName[0])
{
- fprintf (stderr, "\n<<<<<<<<<<<<<<<<<<<<<< ERROR >>>>>>>>>>>>>>>>>>>>>>>\n\n");
- fprintf (stderr, "Error: -sDeviceName=XXX was not defined\n");
- if (fDebugOutput) fprintf (stderr, "@ line %d gomni.c\n", __LINE__);
+ eprintf ("\n<<<<<<<<<<<<<<<<<<<<<< ERROR >>>>>>>>>>>>>>>>>>>>>>>\n\n");
+ eprintf ("Error: -sDeviceName=XXX was not defined\n");
+ if (fDebugOutput) lprintf ("error was here.\n");
return e_Fatal;
}
@@ -434,7 +434,7 @@
if (!pDev->iGSMono)
{
- if (fDebugOutput) fprintf(stderr, "Remapping color pointers\n");
+ if (fDebugOutput) dprintf("Remapping color pointers\n");
set_dev_proc(pdev, map_rgb_color, bmp_map_16m_rgb_color);
set_dev_proc(pdev, map_color_rgb, bmp_map_16m_color_rgb);
@@ -479,13 +479,13 @@
gx_device_omni * const pwdev = (gx_device_omni *)pdev;
PDEVSTRUCT pDev = pwdev->pDev;
- if (fDebugOutput) fprintf (stderr, "CloseDevice: pDev = %p, pDev->pcoreOmni->pDevice = %p\n", pDev, pDev->pcoreOmni->pDevice);
+ if (fDebugOutput) dprintf2 ("CloseDevice: pDev = %p, pDev->pcoreOmni->pDevice = %p\n", pDev, pDev->pcoreOmni->pDevice);
if (!pDev)
{
- fprintf (stderr, "\n<<<<<<<<<<<<<<<<<<<<<< ERROR >>>>>>>>>>>>>>>>>>>>>>>\n\n");
- fprintf (stderr, "Error: No device handle in CloseDevice\n");
- if (fDebugOutput) fprintf (stderr, "@ line %d gomni.c\n", __LINE__);
+ eprintf ("\n<<<<<<<<<<<<<<<<<<<<<< ERROR >>>>>>>>>>>>>>>>>>>>>>>\n\n");
+ eprintf ("Error: No device handle in CloseDevice\n");
+ if (fDebugOutput) lprintf ("error was here.\n");
return_error (gs_error_Fatal); /* handle no pDev */
}
@@ -568,7 +568,7 @@
unsigned long ulPelSizeCorrection = 100;
bool bPersist = false;
- if (fDebugOutput) fprintf (stderr, "GetDeviceParams: pDev = %p\n", pDev);
+ if (fDebugOutput) dprintf1 ("GetDeviceParams: pDev = %p\n", pDev);
iReturnCode = gdev_prn_get_params (pgxdev, plist);
@@ -584,13 +584,13 @@
pszServer = pDev->pcoreOmni->cServer;
}
- if (fDebugOutput) fprintf (stderr, "GetDeviceParams: pszDeviceName = %s\n", pszDeviceName);
- if (fDebugOutput) fprintf (stderr, "GetDeviceParams: pszDebug = %s\n", pszDebug);
- if (fDebugOutput) fprintf (stderr, "GetDeviceParams: pszOther = %s\n", pszOther);
- if (fDebugOutput) fprintf (stderr, "GetDeviceParams: pszAsync = %s\n", pszAsync);
- if (fDebugOutput) fprintf (stderr, "GetDeviceParams: ulPelSizeCorrection = %ld\n", ulPelSizeCorrection);
- if (fDebugOutput) fprintf (stderr, "GetDeviceParams: pszMonoDither = %s\n", pszMonoDither);
- if (fDebugOutput) fprintf (stderr, "GetDeviceParams: pszServer = %s\n", pszServer);
+ if (fDebugOutput) dprintf1 ("GetDeviceParams: pszDeviceName = %s\n", pszDeviceName);
+ if (fDebugOutput) dprintf1 ("GetDeviceParams: pszDebug = %s\n", pszDebug);
+ if (fDebugOutput) dprintf1 ("GetDeviceParams: pszOther = %s\n", pszOther);
+ if (fDebugOutput) dprintf1 ("GetDeviceParams: pszAsync = %s\n", pszAsync);
+ if (fDebugOutput) dprintf1 ("GetDeviceParams: ulPelSizeCorrection = %ld\n", ulPelSizeCorrection);
+ if (fDebugOutput) dprintf1 ("GetDeviceParams: pszMonoDither = %s\n", pszMonoDither);
+ if (fDebugOutput) dprintf1 ("GetDeviceParams: pszServer = %s\n", pszServer);
strdata.data = pszDeviceName;
strdata.size = strlen(pszDeviceName);
@@ -641,7 +641,7 @@
iReturnCode = param_write_long(plist,"PelSizeCorrection",&ulPelSizeCorrection);
- if (fDebugOutput) fprintf (stderr, "GetDeviceParams returning %d\n", iReturnCode);
+ if (fDebugOutput) dprintf1 ("GetDeviceParams returning %d\n", iReturnCode);
return iReturnCode;
}
@@ -685,7 +685,7 @@
PRINTMODE prtMode; /* definition of printed output Bpp ..*/
gs_param_string fname;
- if (fDebugOutput) fprintf (stderr, "SetupDevice: pDev = %p\n", pDev);
+ if (fDebugOutput) dprintf1 ("SetupDevice: pDev = %p\n", pDev);
/* Do we have a handle? */
if (pDev == NULL)
@@ -695,9 +695,9 @@
p = (PDEVSTRUCT)gs_malloc (gs_lib_ctx_get_non_gc_memory_t(), 1, sizeof (Omni_Dev), "omni/instance");
if (!p)
{
- fprintf (stderr, "<<<<<<<<<<<<<<<<<<<<<< ERROR >>>>>>>>>>>>>>>>>>>>>>>\n\n");
- fprintf (stderr, "Error: Failed allocation in SetupDevice\n");
- if (fDebugOutput) fprintf (stderr, "@ line %d gomni.c\n", __LINE__);
+ dprintf ("<<<<<<<<<<<<<<<<<<<<<< ERROR >>>>>>>>>>>>>>>>>>>>>>>\n\n");
+ dprintf ("Error: Failed allocation in SetupDevice\n");
+ if (fDebugOutput) lprintf ("error was here.\n");
return_error (gs_error_VMerror);
}
@@ -710,9 +710,9 @@
if (!pDev->pcoreOmni)
{
- fprintf (stderr, "<<<<<<<<<<<<<<<<<<<<<< ERROR >>>>>>>>>>>>>>>>>>>>>>>\n\n");
- fprintf (stderr, "Error: Failed allocation in SetupDevice\n");
- if (fDebugOutput) fprintf (stderr, "@ line %d gomni.c\n", __LINE__);
+ eprintf ("<<<<<<<<<<<<<<<<<<<<<< ERROR >>>>>>>>>>>>>>>>>>>>>>>\n\n");
+ eprintf ("Error: Failed allocation in SetupDevice\n");
+ if (fDebugOutput) lprintf ("error was here.\n");
return_error (gs_error_VMerror);
}
@@ -724,7 +724,7 @@
pDev->pcoreOmni->cbSize = sizeof (core_omni_device);
}
- if (fDebugOutput) fprintf (stderr, "SetupDevice: pDev->hmodOmni = %p\n", pDev->hmodOmni);
+ if (fDebugOutput) dprintf1 ("SetupDevice: pDev->hmodOmni = %p\n", pDev->hmodOmni);
/* Is the handle initialized? */
if (!pDev->hmodOmni)
@@ -766,7 +766,7 @@
pDev->hmodOmni = g_module_open (pszDeviceLib, (GModuleFlags)0);
- if (fDebugOutput) fprintf (stderr, "SetupDevice: Trying to load %s = %p\n", pszDeviceLib, pDev->hmodOmni);
+ if (fDebugOutput) dprintf2 ("SetupDevice: Trying to load %s = %p\n", pszDeviceLib, pDev->hmodOmni);
}
gs_free (gs_lib_ctx_get_non_gc_memory_t(), pszDeviceLib, strlen (pszDeviceLib) + 1, 1, "Devicestring");
}
@@ -776,9 +776,9 @@
GModule *pModule = 0;
/* Failure! */
- fprintf (stderr, "<<<<<<<<<<<<<<<<<<<<<< ERROR >>>>>>>>>>>>>>>>>>>>>>>\n\n");
- fprintf (stderr, "Error: Could not load libomni.so\n");
- if (fDebugOutput) fprintf (stderr, "@ line %d gomni.c\n", __LINE__);
+ eprintf ("<<<<<<<<<<<<<<<<<<<<<< ERROR >>>>>>>>>>>>>>>>>>>>>>>\n\n");
+ eprintf ("Error: Could not load libomni.so\n");
+ if (fDebugOutput) lprintf ("error was here.\n");
for (i = 0; i < sizeof (apszLibraryPaths)/sizeof (apszLibraryPaths[0]) && !pDev->hmodOmni; i++)
{
@@ -795,7 +795,7 @@
if (!pModule)
{
- fprintf (stderr, "Error: Loading \"%s\" returns \"%s\"\n", pszDeviceLib, g_module_error ());
+ eprintf2 ("Error: Loading \"%s\" returns \"%s\"\n", pszDeviceLib, g_module_error ());
}
else
{
@@ -818,18 +818,17 @@
{
if (!fFailure)
{
- fprintf (stderr, "\n<<<<<<<<<<<<<<<<<<<<<< ERROR >>>>>>>>>>>>>>>>>>>>>>>\n\n");
+ eprintf ("\n<<<<<<<<<<<<<<<<<<<<<< ERROR >>>>>>>>>>>>>>>>>>>>>>>\n\n");
}
- fprintf (stderr, "Error: Could not load required entry point \"%s\" from libomni.so\n", aeplEntryPoints[i].pszEntryPoint);
+ eprintf1 ("Error: Could not load required entry point \"%s\" from libomni.so\n", aeplEntryPoints[i].pszEntryPoint);
fFailure = TRUE;
}
if (fDebugOutput)
- fprintf (stderr,
- "SetupDevice: g_module_symbol (%s) = %p\n",
- aeplEntryPoints[i].pszEntryPoint,
+ dprintf2 ("SetupDevice: g_module_symbol (%s) = %p\n",
+ aeplEntryPoints[i].pszEntryPoint,
*aeplEntryPoints[i].pfnEntryPoint);
}
@@ -857,7 +856,7 @@
{
memset (&fname, 0, sizeof (fname));
iReturnCode = param_read_string (plist, "DeviceName", &fname);
- if (fDebugOutput) fprintf (stderr, "param_read_string of DeviceName = %d, fname.size = %d\n", iReturnCode, fname.size);
+ if (fDebugOutput) dprintf2 ("param_read_string of DeviceName = %d, fname.size = %d\n", iReturnCode, fname.size);
if ( (iReturnCode < 1)
&& (fname.size > 0)
@@ -873,7 +872,7 @@
{
memset (&fname, 0, sizeof (fname));
iReturnCode = param_read_string (plist, "dbgout", &fname);
- if (fDebugOutput) fprintf (stderr, "param_read_string of dbgout = %d, fname.size = %d\n", iReturnCode, fname.size);
+ if (fDebugOutput) dprintf2 ("param_read_string of dbgout = %d, fname.size = %d\n", iReturnCode, fname.size);
if ( (iReturnCode < 1)
&& (fname.size > 0)
@@ -889,7 +888,7 @@
{
memset (&fname, 0, sizeof (fname));
iReturnCode = param_read_string (plist, "async", &fname);
- if (fDebugOutput) fprintf (stderr, "param_read_string of async = %d, fname.size = %d\n", iReturnCode, fname.size);
+ if (fDebugOutput) dprintf2 ("param_read_string of async = %d, fname.size = %d\n", iReturnCode, fname.size);
if ( (iReturnCode < 1)
&& (fname.size > 0)
)
@@ -910,7 +909,7 @@
}
iReturnCode = param_read_long (plist, "PelSizeCorrection", &pDev->ulPelSizeCorrection);
- if (fDebugOutput) fprintf (stderr, "param_read_long of PelSizeCorrection = %d, ulPelSizeCorrection = %ld\n", iReturnCode, pDev->ulPelSizeCorrection);
+ if (fDebugOutput) dprintf2 ("param_read_long of PelSizeCorrection = %d, ulPelSizeCorrection = %ld\n", iReturnCode, pDev->ulPelSizeCorrection);
/*
* Set user options for the job
@@ -919,7 +918,7 @@
{
memset (&fname, 0, sizeof (fname));
iReturnCode = param_read_string (plist, "properties", &fname);
- if (fDebugOutput) fprintf (stderr, "param_read_string of properties = %d, fname.size = %d\n", iReturnCode, fname.size);
+ if (fDebugOutput) dprintf2 ("param_read_string of properties = %d, fname.size = %d\n", iReturnCode, fname.size);
if ( (iReturnCode < 1)
&& (fname.size > 0)
@@ -937,7 +936,7 @@
{
memset (&fname, 0, sizeof (fname));
iReturnCode = param_read_string (plist, "monodither", &fname);
- if (fDebugOutput) fprintf (stderr, "param_read_string of monodither = %d, fname.size = %d\n", iReturnCode, fname.size);
+ if (fDebugOutput) dprintf2 ("param_read_string of monodither = %d, fname.size = %d\n", iReturnCode, fname.size);
if ( (iReturnCode < 1)
&& (fname.size > 0)
@@ -948,7 +947,7 @@
if (!strcmp (pDev->cMonoDither, "GSMONO"))
{
- if (fDebugOutput) fprintf (stderr, "turning on GSMONO dither\n");
+ if (fDebugOutput) dprintf ("turning on GSMONO dither\n");
pDev->iGSMono = 1;
}
@@ -964,7 +963,7 @@
{
memset (&fname, 0, sizeof (fname));
iReturnCode = param_read_string (plist, "server", &fname);
- if (fDebugOutput) fprintf (stderr, "param_read_string of server = %d, fname.size = %d\n", iReturnCode, fname.size);
+ if (fDebugOutput) dprintf2 ("param_read_string of server = %d, fname.size = %d\n", iReturnCode, fname.size);
if ( (iReturnCode < 1)
&& (fname.size > 0)
@@ -974,7 +973,7 @@
pDev->pcoreOmni->cServer[fname.size] = '\0';
- fprintf (stderr, "Utilizing Server - %s \n", pDev->pcoreOmni->cServer);;
+ dprintf1 ("Utilizing Server - %s \n", pDev->pcoreOmni->cServer);;
pDev->iUseServer = 1;
}
@@ -987,11 +986,11 @@
{
memset (&fname, 0, sizeof (fname));
iReturnCode = param_read_string (plist, "jobdialog", &fname);
- if (fDebugOutput) fprintf (stderr, "param_read_string of jobdialog = %d, fname.size = %d\n", iReturnCode, fname.size);
+ if (fDebugOutput) dprintf2 ("param_read_string of jobdialog = %d, fname.size = %d\n", iReturnCode, fname.size);
if (!iReturnCode)
{
- if (fDebugOutput) fprintf (stderr, "Utilizing dialog\n");
+ if (fDebugOutput) dprintf ("Utilizing dialog\n");
pDev->iUseDialog = 1;
}
@@ -1002,10 +1001,10 @@
)
{
/* create a device based on the user supplied inputs */
- if (fDebugOutput) fprintf(stderr, "setting following options on CreateDevice\n");
- if (fDebugOutput) fprintf(stderr, "DeviceName = %s\n", pDev->pcoreOmni->cDeviceName );
- if (fDebugOutput) fprintf(stderr, "pszJobOptions = %s\n", pDev->pcoreOmni->pszJobOptions);
- if (fDebugOutput) fprintf(stderr, "debug parameter = %s \n", pDev->pcoreOmni->cDebugFile );
+ if (fDebugOutput) dprintf ("setting following options on CreateDevice\n");
+ if (fDebugOutput) dprintf1 ("DeviceName = %s\n", pDev->pcoreOmni->cDeviceName );
+ if (fDebugOutput) dprintf1 ("pszJobOptions = %s\n", pDev->pcoreOmni->pszJobOptions);
+ if (fDebugOutput) dprintf1 ("debug parameter = %s \n", pDev->pcoreOmni->cDebugFile );
if (pDev->iUseDialog)
{
@@ -1028,7 +1027,7 @@
{
sprintf (pszDeviceLib, "%s%s", apszLibraryPaths[i], cDialogName);
- if (fDebugOutput) fprintf (stderr, "attempting to load - %s\n", pszDeviceLib);
+ if (fDebugOutput) dprintf1 ("attempting to load - %s\n", pszDeviceLib);
pModule = g_module_open (pszDeviceLib, (GModuleFlags)0);
}
@@ -1038,8 +1037,8 @@
if (!pModule)
{
/* Print the error messages! */
- fprintf (stderr, "\n<<<<<<<<<<<<<<<<<<<<<< ERROR >>>>>>>>>>>>>>>>>>>>>>>\n\n");
- fprintf (stderr, "Error: Could not load %s\n", cDialogName);
+ eprintf ("\n<<<<<<<<<<<<<<<<<<<<<< ERROR >>>>>>>>>>>>>>>>>>>>>>>\n\n");
+ eprintf1 ("Error: Could not load %s\n", cDialogName);
for (i = 0; i < sizeof (apszLibraryPaths)/sizeof (apszLibraryPaths[0]) && !pModule; i++)
{
@@ -1058,7 +1057,7 @@
if (!pModule)
{
- fprintf (stderr, "Error: Loading \"%s\" returns \"%s\"\n", pszDeviceLib, g_module_error ());
+ eprintf2 ("Error: Loading \"%s\" returns \"%s\"\n", pszDeviceLib, g_module_error ());
}
else
{
@@ -1090,7 +1089,7 @@
strcpy (pDev->pcoreOmni->pszJobOptions, pszSelectedJobProperties);
- if (fDebugOutput) fprintf (stderr, "options = %s\n", pDev->pcoreOmni->pszJobOptions);
+ if (fDebugOutput) dprintf1 ("options = %s\n", pDev->pcoreOmni->pszJobOptions);
g_module_symbol (pModule, "FreeOmniJobProperties", (gpointer *)&pfnFreeDialogMemory);
@@ -1098,12 +1097,12 @@
{
pfnFreeDialogMemory (&pszSelectedJobProperties);
- if (fDebugOutput) fprintf (stderr, "Freeing Dialog Memory\n");
+ if (fDebugOutput) dprintf ("Freeing Dialog Memory\n");
}
}
else
{
- fprintf (stderr, "Error: Unable to find <<GetOmniJobProperties>> in <<%s>>.\n", cDialogName);
+ eprintf1 ("Error: Unable to find <<GetOmniJobProperties>> in <<%s>>.\n", cDialogName);
}
g_module_close (pModule);
@@ -1120,8 +1119,8 @@
{
pDev->pfnGIInit ((void*)pDev->pcoreOmni);
- if (fDebugOutput) fprintf(stderr, "core_omni_device size = %d\n",pDev->pcoreOmni->cbSize);
- if (fDebugOutput) fprintf(stderr, "GI version = %s\n",pDev->pcoreOmni->cVersion);
+ if (fDebugOutput) dprintf1 ("core_omni_device size = %d\n",pDev->pcoreOmni->cbSize);
+ if (fDebugOutput) dprintf1 ("GI version = %s\n",pDev->pcoreOmni->cVersion);
pDev->pCallPtr = (void *)pDev->pcoreOmni;
}
@@ -1136,22 +1135,22 @@
if (!pDev->pcoreOmni->pDevice)
{
- fprintf (stderr, "<<<<<<<<<<<<<<<<<<<<<< ERROR >>>>>>>>>>>>>>>>>>>>>>>\n\n");
- fprintf (stderr, "Error: Unable create a omni device\n");
- if (fDebugOutput) fprintf (stderr, "@ line %d gomni.c\n", __LINE__);
+ eprintf ("<<<<<<<<<<<<<<<<<<<<<< ERROR >>>>>>>>>>>>>>>>>>>>>>>\n\n");
+ eprintf ("Error: Unable create a omni device\n");
+ if (fDebugOutput) lprintf ("error was here.\n");
return_error (gs_error_Fatal); /* fail if no device was created */
}
- if (fDebugOutput) fprintf (stderr, "Device = %p\n", pDev->pcoreOmni->pDevice);
- if (fDebugOutput) fprintf (stderr, "Omni version = %s\n", pDev->pcoreOmni->cOmniVersion);
- if (fDebugOutput) fprintf (stderr, "Device = \"%s\"\n", pDev->pcoreOmni->cDeviceName);
+ if (fDebugOutput) dprintf1 ("Device = %p\n", pDev->pcoreOmni->pDevice);
+ if (fDebugOutput) dprintf1 ("Omni version = %s\n", pDev->pcoreOmni->cOmniVersion);
+ if (fDebugOutput) dprintf1 ("Device = \"%s\"\n", pDev->pcoreOmni->cDeviceName);
bRet = pDev->pfnGetPrintModeInfo ((void*)pDev->pCallPtr, &prtMode);
- if (fDebugOutput) fprintf(stderr, "GetPrintModeInfo returns %d\n", bRet);
- if (fDebugOutput) fprintf(stderr, "GetPrintModeInfo.iBitCount = %d\n", prtMode.iBitCount);
- if (fDebugOutput) fprintf(stderr, "GetPrintModeInfo.iPlanes = %d\n", prtMode.iPlanes);
+ if (fDebugOutput) dprintf1 ("GetPrintModeInfo returns %d\n", bRet);
+ if (fDebugOutput) dprintf1 ("GetPrintModeInfo.iBitCount = %d\n", prtMode.iBitCount);
+ if (fDebugOutput) dprintf1 ("GetPrintModeInfo.iPlanes = %d\n", prtMode.iPlanes);
if (bRet)
{
@@ -1160,7 +1159,7 @@
&& pDev->iGSMono
)
{
- if (fDebugOutput) fprintf (stderr, "Turning off GSMONO - prtMode.iBitCount = %d\n", prtMode.iBitCount);
+ if (fDebugOutput) dprintf1 ("Turning off GSMONO - prtMode.iBitCount = %d\n", prtMode.iBitCount);
pDev->iGSMono = 0;
}
}
@@ -1173,9 +1172,9 @@
if (!bRet)
{
- fprintf (stderr, "<<<<<<<<<<<<<<<<<<<<<< ERROR >>>>>>>>>>>>>>>>>>>>>>>\n\n");
- fprintf (stderr, "Error: Failed GetResolutionInfo in SetupDevice\n");
- if (fDebugOutput) fprintf (stderr, "@ line %d gomni.c\n", __LINE__);
+ eprintf ("<<<<<<<<<<<<<<<<<<<<<< ERROR >>>>>>>>>>>>>>>>>>>>>>>\n\n");
+ eprintf ("Error: Failed GetResolutionInfo in SetupDevice\n");
+ if (fDebugOutput) lprintf ("error was here.\n");
return_error (gs_error_Fatal);
}
@@ -1186,20 +1185,20 @@
if (!bRet)
{
- fprintf (stderr, "<<<<<<<<<<<<<<<<<<<<<< ERROR >>>>>>>>>>>>>>>>>>>>>>>\n\n");
- fprintf (stderr, "Error: Failed GetMarginInfo in SetupDevice\n");
- if (fDebugOutput) fprintf (stderr, "@ line %d gomni.c\n", __LINE__);
+ eprintf ("<<<<<<<<<<<<<<<<<<<<<< ERROR >>>>>>>>>>>>>>>>>>>>>>>\n\n");
+ eprintf ("Error: Failed GetMarginInfo in SetupDevice\n");
+ if (fDebugOutput) lprintf ("error was here.\n");
return_error (gs_error_Fatal);
}
- if (fDebugOutput) fprintf (stderr, "GetMarginInfo returns %d\n", bRet);
- if (fDebugOutput) fprintf (stderr, "GetMarginInfo.fLeftClip = %f\n", hwMargins.fLeftClip);
- if (fDebugOutput) fprintf (stderr, "GetMarginInfo.fBottomClip = %f\n", hwMargins.fBottomClip);
- if (fDebugOutput) fprintf (stderr, "GetMarginInfo.fRightClip = %f\n", hwMargins.fRightClip);
- if (fDebugOutput) fprintf (stderr, "GetMarginInfo.fTopClip = %f\n", hwMargins.fTopClip);
- if (fDebugOutput) fprintf (stderr, "GetMarginInfo.fxWidth = %f\n", hwMargins.fxWidth);
- if (fDebugOutput) fprintf (stderr, "GetMarginInfo.fyHeight = %f\n", hwMargins.fyHeight);
+ if (fDebugOutput) dprintf1 ("GetMarginInfo returns %d\n", bRet);
+ if (fDebugOutput) dprintf1 ("GetMarginInfo.fLeftClip = %f\n", hwMargins.fLeftClip);
+ if (fDebugOutput) dprintf1 ("GetMarginInfo.fBottomClip = %f\n", hwMargins.fBottomClip);
+ if (fDebugOutput) dprintf1 ("GetMarginInfo.fRightClip = %f\n", hwMargins.fRightClip);
+ if (fDebugOutput) dprintf1 ("GetMarginInfo.fTopClip = %f\n", hwMargins.fTopClip);
+ if (fDebugOutput) dprintf1 ("GetMarginInfo.fxWidth = %f\n", hwMargins.fxWidth);
+ if (fDebugOutput) dprintf1 ("GetMarginInfo.fyHeight = %f\n", hwMargins.fyHeight);
/*
* We have to let GS know about our page and resolution parameters
@@ -1234,21 +1233,21 @@
prgxdev->pDev->iVertDots = (float)hwRes.fScanDots; /* fill in the scan line */
- if (fDebugOutput) fprintf (stderr, "left margin pts = %f \n", prgxdev->HWMargins[0]);
- if (fDebugOutput) fprintf (stderr, "bottom margin pts = %f \n", prgxdev->HWMargins[1]);
- if (fDebugOutput) fprintf (stderr, "right margin pts = %f \n", prgxdev->HWMargins[2]);
- if (fDebugOutput) fprintf (stderr, "top margin pts = %f \n", prgxdev->HWMargins[3]);
+ if (fDebugOutput) dprintf1 ("left margin pts = %f \n", prgxdev->HWMargins[0]);
+ if (fDebugOutput) dprintf1 ("bottom margin pts = %f \n", prgxdev->HWMargins[1]);
+ if (fDebugOutput) dprintf1 ("right margin pts = %f \n", prgxdev->HWMargins[2]);
+ if (fDebugOutput) dprintf1 ("top margin pts = %f \n", prgxdev->HWMargins[3]);
if (!pDev->iGSMono)
{
/* 1,1,1,0,2,0 - mono */
/* 3, 24,255,255,5,5 - color */
- if (fDebugOutput) fprintf (stderr, "depth = %d \n", prgxdev->color_info.depth );
- if (fDebugOutput) fprintf (stderr, "num_comp = %d \n", prgxdev->color_info.num_components );
- if (fDebugOutput) fprintf (stderr, "max_gray = %d \n", prgxdev->color_info.max_gray );
- if (fDebugOutput) fprintf (stderr, "max_color = %d \n", prgxdev->color_info.max_color );
- if (fDebugOutput) fprintf (stderr, "dither_grays = %d \n", prgxdev->color_info.dither_grays );
- if (fDebugOutput) fprintf (stderr, "dither_colors = %d \n", prgxdev->color_info.dither_colors );
+ if (fDebugOutput) dprintf1 ("depth = %d \n", prgxdev->color_info.depth );
+ if (fDebugOutput) dprintf1 ("num_comp = %d \n", prgxdev->color_info.num_components );
+ if (fDebugOutput) dprintf1 ("max_gray = %d \n", prgxdev->color_info.max_gray );
+ if (fDebugOutput) dprintf1 ("max_color = %d \n", prgxdev->color_info.max_color );
+ if (fDebugOutput) dprintf1 ("dither_grays = %d \n", prgxdev->color_info.dither_grays );
+ if (fDebugOutput) dprintf1 ("dither_colors = %d \n", prgxdev->color_info.dither_colors );
prgxdev->color_info.depth = 24;
prgxdev->color_info.num_components = 3;
@@ -1261,7 +1260,7 @@
iReturnCode = gdev_prn_put_params ((gx_device *)prgxdev, plist);
- if (fDebugOutput) fprintf (stderr, "SetupDevice returning %d\n", iReturnCode);
+ if (fDebugOutput) dprintf1 ("SetupDevice returning %d\n", iReturnCode);
return iReturnCode; /* likely not be a failure */
}
@@ -1327,9 +1326,9 @@
|| !pDev->pcoreOmni->pDevice
)
{
- fprintf (stderr, "<<<<<<<<<<<<<<<<<<<<<< ERROR >>>>>>>>>>>>>>>>>>>>>>>\n\n");
- fprintf (stderr, "Error: -sDeviceName=XXX is not specified\n");
- if (fDebugOutput) fprintf (stderr, "@ line %d gomni.c\n", __LINE__);
+ eprintf ("<<<<<<<<<<<<<<<<<<<<<< ERROR >>>>>>>>>>>>>>>>>>>>>>>\n\n");
+ eprintf ("Error: -sDeviceName=XXX is not specified\n");
+ if (fDebugOutput) lprintf ("error was here.\n");
return_error (gs_error_Fatal);
}
@@ -1351,9 +1350,9 @@
pbmi = (PBITMAPINFO2)gs_malloc (gs_lib_ctx_get_non_gc_memory_t(), 1, iBytesToAlloc, "Bmpi Memory");
if (!pbmi)
{
- fprintf(stderr, "<<<<<<<<<<<<<<<<<<<<<< ERROR >>>>>>>>>>>>>>>>>>>>>>>\n\n");
- fprintf(stderr, "Error: Failed allocation of pbmi in PrintPage\n");
- if (fDebugOutput) fprintf (stderr, "@ line %d gomni.c\n", __LINE__);
+ eprintf("<<<<<<<<<<<<<<<<<<<<<< ERROR >>>>>>>>>>>>>>>>>>>>>>>\n\n");
+ eprintf("Error: Failed allocation of pbmi in PrintPage\n");
+ if (fDebugOutput) lprintf ("error was here.\n");
return_error (gs_error_VMerror);
}
@@ -1425,13 +1424,13 @@
pbmi->cx = pgx_prt_dev->width;
- if (fDebugOutput) fprintf (stderr, "***************************************************************\n");
- if (fDebugOutput) fprintf (stderr, "ulTrgBytesPerLine = %ld\n", ImageInfo.ulTrgBytesPerLine);
- if (fDebugOutput) fprintf (stderr, "ulBytesPerLine = %d\n", uiBytesPerLine);
- if (fDebugOutput) fprintf (stderr, "ulLineSize = %d\n", uiLineSize);
- if (fDebugOutput) fprintf (stderr, "width = %d\n", pgx_prt_dev->width);
- if (fDebugOutput) fprintf (stderr, "height = %d\n", pgx_prt_dev->height);
- if (fDebugOutput) fprintf (stderr, "***************************************************************\n");
+ if (fDebugOutput) dprintf ("***************************************************************\n");
+ if (fDebugOutput) dprintf1 ("ulTrgBytesPerLine = %ld\n", ImageInfo.ulTrgBytesPerLine);
+ if (fDebugOutput) dprintf1 ("ulBytesPerLine = %d\n", uiBytesPerLine);
+ if (fDebugOutput) dprintf1 ("ulLineSize = %d\n", uiLineSize);
+ if (fDebugOutput) dprintf1 ("width = %d\n", pgx_prt_dev->width);
+ if (fDebugOutput) dprintf1 ("height = %d\n", pgx_prt_dev->height);
+ if (fDebugOutput) dprintf ("***************************************************************\n");
pbmi->cPlanes = prtMode.iPlanes; /* Number of bit planes */
pbmi->cBitCount = prtMode.iBitCount; /* number of bits per pel */
@@ -1478,9 +1477,9 @@
if(!pBitmapMem)
{
- fprintf (stderr, "<<<<<<<<<<<<<<<<<<<<<< ERROR >>>>>>>>>>>>>>>>>>>>>>>\n\n");
- fprintf (stderr, "Error: Failed allocation of pBitmapMem in PrintPage\n");
- if (fDebugOutput) fprintf (stderr, "@ line %d gomni.c\n", __LINE__);
+ eprintf ("<<<<<<<<<<<<<<<<<<<<<< ERROR >>>>>>>>>>>>>>>>>>>>>>>\n\n");
+ eprintf ("Error: Failed allocation of pBitmapMem in PrintPage\n");
+ if (fDebugOutput) lprintf ("error was here.\n");
return_error (gs_error_VMerror);
}
@@ -1498,9 +1497,9 @@
}
else
{
- fprintf(stderr, "<<<<<<<<<<<<<<<<<<<<<< ERROR >>>>>>>>>>>>>>>>>>>>>>>\n\n");
- fprintf(stderr, "Error: Bitmap memory alloc Failed\n");
- if (fDebugOutput) fprintf (stderr, "@ line %d gomni.c\n", __LINE__);
+ eprintf("<<<<<<<<<<<<<<<<<<<<<< ERROR >>>>>>>>>>>>>>>>>>>>>>>\n\n");
+ eprintf("Error: Bitmap memory alloc Failed\n");
+ if (fDebugOutput) lprintf ("error was here.\n");
return_error (gs_error_VMerror);
}
@@ -1595,9 +1594,9 @@
}
else
{
- fprintf (stderr, "<<<<<<<<<<<<<<<<<<<<<< ERROR >>>>>>>>>>>>>>>>>>>>>>>\n\n");
- fprintf (stderr, "Error: Failed allocation of pMonoData in PrintPage\n");
- if (fDebugOutput) fprintf (stderr, "@ line %d gomni.c\n", __LINE__);
+ eprintf ("<<<<<<<<<<<<<<<<<<<<<< ERROR >>>>>>>>>>>>>>>>>>>>>>>\n\n");
+ eprintf ("Error: Failed allocation of pMonoData in PrintPage\n");
+ if (fDebugOutput) lprintf ("error was here.\n");
return_error (gs_error_VMerror);
}
@@ -1641,15 +1640,15 @@
}
else
{ /* non-mono device -- Send the rgb bitmap to the dither and rasterize routines */
- if (fDebugOutput) fprintf(stderr, "rendering band lines %d - %d w/%d \n", (int)rectPageLocation.yTop, (int)rectPageLocation.yBottom, iYBand);
+ if (fDebugOutput) dprintf3 ("rendering band lines %d - %d w/%d \n", (int)rectPageLocation.yTop, (int)rectPageLocation.yBottom, iYBand);
- if (fDebugOutput) fprintf(stderr, "***************************************************************\n");
- if (fDebugOutput) fprintf(stderr, "***************************************************************\n");
- if (fDebugOutput) fprintf(stderr, "Number of lines in band = %d\n", iYBand);
- if (fDebugOutput) fprintf(stderr, "rectPageLocation - Top = %ld\n", rectPageLocation.yTop);
- if (fDebugOutput) fprintf(stderr, "rectPageLocation - Bot = %ld\n", rectPageLocation.yBottom);
- if (fDebugOutput) fprintf(stderr, "***************************************************************\n");
- if (fDebugOutput) fprintf(stderr, "***************************************************************\n");
+ if (fDebugOutput) dprintf ("***************************************************************\n");
+ if (fDebugOutput) dprintf ("***************************************************************\n");
+ if (fDebugOutput) dprintf1 ("Number of lines in band = %d\n", iYBand);
+ if (fDebugOutput) dprintf1 ("rectPageLocation - Top = %ld\n", rectPageLocation.yTop);
+ if (fDebugOutput) dprintf1 ("rectPageLocation - Bot = %ld\n", rectPageLocation.yBottom);
+ if (fDebugOutput) dprintf ("***************************************************************\n");
+ if (fDebugOutput) dprintf ("***************************************************************\n");
pDev->pfnRasterize ((void*)pasyncDev->pDev->pCallPtr,
pBitmapTop - ((iYBand-1) * uiBytesPerLine),
@@ -1684,7 +1683,7 @@
done:
gs_free (gs_lib_ctx_get_non_gc_memory_t(), (char *) pBitmapMem, uiBytesPerLine * ulBandLength, 1, "Bitmap Memory");
- fprintf (stderr, "Page Completed\n");
+ dprintf ("Page Completed\n");
gs_free (gs_lib_ctx_get_non_gc_memory_t(), (char *)pGSData, uiBytesPerLine, 1, "bmp file buffer");
gs_free (gs_lib_ctx_get_non_gc_memory_t(), (char *)pbmi, uiBytesPerLine, 1, "Bpmi Memory");
More information about the gs-cvs
mailing list