Index: gv-3.6.2/src/main.c =================================================================== --- gv-3.6.2.orig/src/main.c 2006-10-16 20:55:40.280698642 +0200 +++ gv-3.6.2/src/main.c 2006-10-16 21:05:42.041789721 +0200 @@ -592,10 +592,8 @@ /*### getting resources ############################################*/ { - XrmDatabase db; INFMESSAGE(getting resources) - db = resource_buildDatabase(gv_display,gv_class,gv_name,&argc,argv); - XrmCombineDatabase(db,&gv_database,False); + resource_updateDatabase(gv_display,gv_class,gv_name,&gv_database,&argc,argv); } /*### initializing widget set and creating application shell #########################*/ Index: gv-3.6.2/src/resource.c =================================================================== --- gv-3.6.2.orig/src/resource.c 2005-08-10 13:33:21.000000000 +0200 +++ gv-3.6.2/src/resource.c 2006-10-16 21:23:11.885580469 +0200 @@ -110,13 +110,14 @@ } /*####################################################### - resource_buildDatabase + resource_updateDatabase #######################################################*/ -XrmDatabase resource_buildDatabase(display,app_class,app_name,argcP,argv) +void resource_updateDatabase(display,app_class,app_name,dbp,argcP,argv) Display *display; char *app_class; char *app_name; + XrmDatabase *dbp; int *argcP; char **argv; { @@ -126,8 +127,7 @@ char *spartan_filename; char tmp[GV_MAX_FILENAME_LENGTH]; - - BEGINMESSAGE(resource_buildDatabase) + BEGINMESSAGE(resource_updateDatabase) /* ### class resources ################# */ INFMESSAGE(merging class resources into database) @@ -146,6 +146,8 @@ XrmCombineFileDatabase(rpath,&db,True); resource_system_file = rpath; } + XrmCombineDatabase(db,dbp,False); + db = NULL; /* ### user resources ################# */ INFMESSAGE(checking for user resources) @@ -166,6 +168,9 @@ resource_user_file = GV_XtNewString(tmp); } + XrmCombineDatabase(db,dbp,True); + db = *dbp; + /* ### command line resources ################# */ /* @@ -177,35 +182,35 @@ if (antialias_p) { - resource_putResource (&db, app_name, ".antialias", "True"); + resource_putResource (dbp, app_name, ".antialias", "True"); } if (noantialias_p) { - resource_putResource (&db, app_name, ".antialias", "False"); + resource_putResource (dbp, app_name, ".antialias", "False"); } if (safer_p) { - resource_putResource (&db, app_name, ".gsSafer", "True"); + resource_putResource (dbp, app_name, ".gsSafer", "True"); } if (nosafer_p) { - resource_putResource (&db, app_name, ".gsSafer", "False"); + resource_putResource (dbp, app_name, ".gsSafer", "False"); } if (pixmap_p) { - resource_putResource (&db, app_name, ".useBackingPixmap", "True"); + resource_putResource (dbp, app_name, ".useBackingPixmap", "True"); } if (nopixmap_p) { - resource_putResource (&db, app_name, ".useBackingPixmap", "False"); + resource_putResource (dbp, app_name, ".useBackingPixmap", "False"); } if (color_p) { - resource_putResource (&db, app_name, "*Ghostview.palette", "Color"); + resource_putResource (dbp, app_name, "*Ghostview.palette", "Color"); } if (grayscale_p) { - resource_putResource (&db, app_name, "*Ghostview.palette", "Grayscale"); + resource_putResource (dbp, app_name, "*Ghostview.palette", "Grayscale"); } if (spartan_p) { @@ -214,109 +219,109 @@ spartan_filename[0] = '\0'; strcat(spartan_filename, GV_LIBDIR); strcat(spartan_filename, "/gv_spartan.dat"); - resource_putResource (&db, app_name, ".style", spartan_filename); + resource_putResource (dbp, app_name, ".style", spartan_filename); GV_XtFree (spartan_filename); } if (quiet_p) { - resource_putResource (&db, app_name, ".gsQuiet", "True"); + resource_putResource (dbp, app_name, ".gsQuiet", "True"); } if (monochrome_p) { - resource_putResource (&db, app_name, "*Ghostview.palette", "Monochrome"); + resource_putResource (dbp, app_name, "*Ghostview.palette", "Monochrome"); } if (noquiet_p) { - resource_putResource (&db, app_name, ".gsQuiet", "False"); + resource_putResource (dbp, app_name, ".gsQuiet", "False"); } if (media_p) { - resource_putResource (&db, app_name, ".pageMedia", media_value); + resource_putResource (dbp, app_name, ".pageMedia", media_value); } if (orientation_p) { - resource_putResource (&db, app_name, ".orientation", orientation_value); + resource_putResource (dbp, app_name, ".orientation", orientation_value); } if (page_p) { - resource_putResource (&db, app_name, ".page", page_value); + resource_putResource (dbp, app_name, ".page", page_value); } if (center_p) { - resource_putResource (&db, app_name, ".autoCenter", "True"); + resource_putResource (dbp, app_name, ".autoCenter", "True"); } if (nocenter_p) { - resource_putResource (&db, app_name, ".autoCenter", "False"); + resource_putResource (dbp, app_name, ".autoCenter", "False"); } if (scale_p) { - resource_putResource (&db, app_name, ".scale", scale_value); + resource_putResource (dbp, app_name, ".scale", scale_value); } if (magstep_p) { - resource_putResource (&db, app_name, ".scale", magstep_value); + resource_putResource (dbp, app_name, ".scale", magstep_value); } if (scalebase_p) { - resource_putResource (&db, app_name, ".scaleBase", scalebase_value); + resource_putResource (dbp, app_name, ".scaleBase", scalebase_value); } if (resize_p) { - resource_putResource (&db, app_name, ".autoResize", "True"); + resource_putResource (dbp, app_name, ".autoResize", "True"); } if (noresize_p) { - resource_putResource (&db, app_name, ".autoResize", "False"); + resource_putResource (dbp, app_name, ".autoResize", "False"); } if (swap_p) { - resource_putResource (&db, app_name, ".swapLandscape", "True"); + resource_putResource (dbp, app_name, ".swapLandscape", "True"); } if (noswap_p) { - resource_putResource (&db, app_name, ".swapLandscape", "False"); + resource_putResource (dbp, app_name, ".swapLandscape", "False"); } if (dsc_p) { - resource_putResource (&db, app_name, ".respectDSC", "True"); + resource_putResource (dbp, app_name, ".respectDSC", "True"); } if (nodsc_p) { - resource_putResource (&db, app_name, ".respectDSC", "False"); + resource_putResource (dbp, app_name, ".respectDSC", "False"); } if (eof_p) { - resource_putResource (&db, app_name, ".ignoreEOF", "True"); + resource_putResource (dbp, app_name, ".ignoreEOF", "True"); } if (noeof_p) { - resource_putResource (&db, app_name, ".ignoreEOF", "False"); + resource_putResource (dbp, app_name, ".ignoreEOF", "False"); } if (watch_p) { - resource_putResource (&db, app_name, ".watchFile", "True"); + resource_putResource (dbp, app_name, ".watchFile", "True"); } if (nowatch_p) { - resource_putResource (&db, app_name, ".watchFile", "False"); + resource_putResource (dbp, app_name, ".watchFile", "False"); } if (ad_p) { - resource_putResource (&db, app_name, ".ad", ad_value); + resource_putResource (dbp, app_name, ".ad", ad_value); } if (style_p) { - resource_putResource (&db, app_name, ".style", style_value); + resource_putResource (dbp, app_name, ".style", style_value); } if (arguments_p) { - resource_putResource (&db, app_name, ".arguments", arguments_value); + resource_putResource (dbp, app_name, ".arguments", arguments_value); } INFMESSAGE(parsing command line) - XrmParseCommand(&db,options,XtNumber(options),app_name,argcP,argv); + XrmParseCommand(dbp,options,XtNumber(options),app_name,argcP,argv); /* ### style resources ######################## */ INFMESSAGE(checking for style resources) @@ -354,7 +359,7 @@ */ INFSMESSAGE(merging style resource file into database,s) - t = resource_mergeFileIntoDatabase(&db,s); + t = resource_mergeFileIntoDatabase(dbp,s); if (!t) { fprintf(stderr,"%s: Style file '%s' not found - ignored\n",app_name,s); s=NULL; @@ -384,8 +389,7 @@ if (t) GV_XtFree(t); } - ENDMESSAGE(resource_buildDatabase) - return(db); + ENDMESSAGE(resource_updateDatabase) } /*####################################################### Index: gv-3.6.2/src/resource.h =================================================================== --- gv-3.6.2.orig/src/resource.h 2004-12-06 13:52:10.000000000 +0100 +++ gv-3.6.2/src/resource.h 2006-10-16 21:24:43.243115805 +0200 @@ -38,11 +38,12 @@ #endif ); -extern XrmDatabase resource_buildDatabase ( +extern void resource_updateDatabase ( #if NeedFunctionPrototypes Display *, char *, char *, + XrmDatabase *, int *, char ** #endif