File bibview-2.2.dif of Package bibview
--- BibView.eng.ad
+++ BibView.eng.ad 2004-04-27 13:47:57.000000000 +0200
@@ -275,7 +275,7 @@ BibView*cardWin*userFldHead.borderWidth:
BibView*cardWin*userFldHead.justify: center
! general resources for all card types
-BibView*cardWin.carddesk*font: iso1.16
+BibView*cardWin.carddesk*font: 8x16
BibView*cardWin.carddesk*Label*borderWidth: 0
BibView*cardWin.carddesk.defaultDistance: 0
--- BibView.ger.ad
+++ BibView.ger.ad 2004-04-27 13:48:07.000000000 +0200
@@ -54,7 +54,7 @@ BibView*servicesMenu*item3*label: Druck
BibView*servicesMenu*item4*label: Makros editieren
BibView*servicesMenu*item5*label: Konfiguration laden
-BibView*mainwin*options.label: Optionen
+BibView*mainwin*options.label: Optionen
BibView*mainwin*options.menuName: optionsMenu
BibView*mainwin*options*leftMargin: 20
BibView*optionsMenu.label: Optionen-Menue
@@ -273,7 +273,7 @@ BibView*cardWin*userFldHead.borderWidth:
BibView*cardWin*userFldHead.justify: center
! general resources for all card types
-BibView*cardWin.carddesk*font: iso1.16
+BibView*cardWin.carddesk*font: 8x16
BibView*cardWin.carddesk*Label*borderWidth: 0
BibView*cardWin.carddesk.defaultDistance: 0
--- ComboBo.c
+++ ComboBo.c 2004-04-27 13:51:12.000000000 +0200
@@ -89,7 +89,6 @@ static XtResource resources[] = {
#define Name(w) (((ComboBoxWidget) w)->comboBox.name)
#define RcList(w) (((ComboBoxWidget) w)->comboBox.rclist)
-
static char listTranslations[] =
"<Btn1Up>(2): Set() Nominate() Unset()\n\
<Btn1Down>,<Btn1Up>: Set() Notify() \n\
@@ -105,7 +104,6 @@ static XtActionsRec pathActions[] = {
"Nominate", Nominate,
};
-static void ChangeDir();
static void FillWindow();
static void ReplaceFilename();
static void AsciiSourceChanged();
@@ -222,7 +220,7 @@ PositionChildren(fnw)
2 * Child(fnw,name_widget)->core.border_width -
2 * fnw->comboBox.margin,
Child(fnw,name_widget)->core.border_width);
- }
+ }
if (fnw->comboBox.margin == 0)
{
@@ -249,7 +247,7 @@ PositionChildren(fnw)
2 * Child(fnw,filename_widget)->core.border_width -
2 * fnw->comboBox.margin,
Child(fnw,filename_widget)->core.border_width);
- }
+ }
}
/****************/
@@ -640,7 +638,6 @@ ReplaceFilename(w, client_data, call_dat
NULL);
XawTextSetInsertionPoint(Child(fnw,filename_widget),
-
(XawTextPosition) strlen(list->string));
WatchForChanges(fnw);
@@ -655,7 +652,7 @@ XtPointer client_data, call_data;
{
ComboBoxWidget fnw = (ComboBoxWidget) client_data;
- DontWatchForChanges(fnw);
+ DontWatchForChanges((Widget)fnw);
XawListUnhighlight(Child(fnw,list_widget));
}
@@ -667,7 +664,7 @@ WatchForChanges(fnw)
if (!WatchingChanges(fnw))
{
XtAddCallback(XawTextGetSource(Child(fnw,filename_widget)), XtNcallback,
- AsciiSourceChanged, (XtPointer) fnw);
+ (XtCallbackProc)AsciiSourceChanged, (XtPointer) fnw);
WatchingChanges(fnw) = True;
}
@@ -678,7 +675,7 @@ DontWatchForChanges(fnw)
Widget fnw;
{
XtRemoveCallback(XawTextGetSource(Child(fnw,filename_widget)), XtNcallback,
- AsciiSourceChanged, (XtPointer) fnw);
+ (XtCallbackProc)AsciiSourceChanged, (XtPointer) fnw);
WatchingChanges(fnw) = False;
}
@@ -739,9 +736,9 @@ Widget fnw;
if (XtIsSubclass(fnw, comboBoxWidgetClass))
{
-
+#if 0
ComboBoxStruct data = Nomination(fnw);
-
+#endif
XtPopdown(Child(fnw, shell_widget));
XtVaGetValues(Child(fnw,filename_widget),
XtNstring, &ausgabe,
--- ComboBo.h
+++ ComboBo.h 2004-04-27 12:25:05.000000000 +0200
@@ -23,7 +23,9 @@
#define XtNselectCallback "selectCallback"
#define XtNselectMenu "selectMenu"
+#ifndef XtNcancelCallback
#define XtNcancelCallback "cancelCallback"
+#endif
#define XtNmargin "margin"
#define XtNnumberRows "numberRows"
#define XtNshowDotFiles "showDotFiles"
--- FileNom.c
+++ FileNom.c 2004-04-27 13:36:53.000000000 +0200
@@ -141,9 +141,10 @@ static char selectMenuTranslations[] =
static void MakeMenu(), Nominate(), ToggleDotFiles();
static XtActionsRec pathActions[] = {
- "MakeMenu", MakeMenu,
- "Nominate", Nominate,
- "ToggleDotFiles", ToggleDotFiles,
+ { "MakeMenu", MakeMenu },
+ { "Nominate", Nominate },
+ { "ToggleDotFiles", ToggleDotFiles },
+ { NULL, NULL }
};
static void CancelCallback();
@@ -278,7 +279,7 @@ PositionChildren(fnw)
2 * Child(fnw,select_widget)->core.border_width -
4 * fnw->fileNominator.margin,
Child(fnw,filename_widget)->core.border_width);
- }
+ }
if (fnw->fileNominator.margin == 0)
{
@@ -379,7 +380,7 @@ Initialize(req, new, args, num_args)
List(new) = NULL;
Nomination(new).directoryPart = NULL;
Nomination(new).filenamePart = NULL;
-#ifdef SYSV
+#if defined(SYSV) || defined(linux)
(void) getcwd(CurrentDir(new), MAXPATHLEN);
#else
(void) getwd(CurrentDir(new));
@@ -466,7 +467,7 @@ Initialize(req, new, args, num_args)
XtOverrideTranslations(Child(fnw,select_widget),
XtParseTranslationTable(selectMenuTranslations));
-
+
XtFree(menuList);
}
@@ -620,7 +621,7 @@ MakeMenu(w, event, params, num_params)
XtVaSetValues(menu,
XtNpopupOnEntry, menuEntry,
NULL);
-
+
XtFree(where);
}
@@ -736,7 +737,7 @@ Nominate(w, event, params, num_params)
strcat(selection, name_ende);
}
}
- else if (home = getenv("HOME"))
+ else if ((home = getenv("HOME")))
strcpy(selection, home);
}
@@ -822,20 +823,19 @@ FillWindow(fnw)
Dimension height, internalHeight, rowSpacing;
int num, newNum, idx;
struct dirent **namelist;
- #ifndef HAVE_DIR
+#ifndef HAVE_DIR
DIR *dirp;
struct dirent *direntp;
int direntp_size;
- #else
+#else
extern int alphasort();
- #endif
+#endif
char buf[MAXPATHLEN], *bp;
String name;
struct stat fstats;
- unsigned int namlen;
- #ifdef HAVE_DIR
+#ifdef HAVE_DIR
num = scandir(CurrentDir(fnw), &namelist, (int(*)())0, alphasort);
- #else
+#else
/* Read the directory `CurrentDir(fnw)'
and set the `dirent's in `namelist'. */
dirp = opendir( CurrentDir(fnw) );
@@ -860,7 +860,7 @@ FillWindow(fnw)
/* Sort the directory entries in `namelist'. */
qsort( namelist, num, sizeof(struct dirent*), direntpcmp );
- #endif
+#endif
if (num <= 0)
{
@@ -982,7 +982,7 @@ XtPointer client_data, call_data;
{
FileNominatorWidget fnw = (FileNominatorWidget) client_data;
- DontWatchForChanges(fnw);
+ DontWatchForChanges((Widget)fnw);
XawListUnhighlight(Child(fnw,list_widget));
}
@@ -994,7 +994,7 @@ WatchForChanges(fnw)
if (!WatchingChanges(fnw))
{
XtAddCallback(XawTextGetSource(Child(fnw,filename_widget)), XtNcallback,
- AsciiSourceChanged, (XtPointer) fnw);
+ (XtCallbackProc)AsciiSourceChanged, (XtPointer) fnw);
WatchingChanges(fnw) = True;
}
@@ -1005,7 +1005,7 @@ DontWatchForChanges(fnw)
Widget fnw;
{
XtRemoveCallback(XawTextGetSource(Child(fnw,filename_widget)), XtNcallback,
- AsciiSourceChanged, (XtPointer) fnw);
+ (XtCallbackProc)AsciiSourceChanged, (XtPointer) fnw);
WatchingChanges(fnw) = False;
}
--- FileNom.h
+++ FileNom.h 2004-04-27 12:25:05.000000000 +0200
@@ -52,7 +52,9 @@
#define XtNselectCallback "selectCallback"
#define XtNselectMenu "selectMenu"
+#ifndef XtNcancelCallback
#define XtNcancelCallback "cancelCallback"
+#endif
#define XtNmargin "margin"
#define XtNnumberRows "numberRows"
#define XtNshowDotFiles "showDotFiles"
--- Geometry.c
+++ Geometry.c 2004-04-27 12:58:36.000000000 +0200
@@ -0,0 +1,475 @@
+/* $XConsortium: Geometry.c /main/64 1996/09/28 16:45:54 rws $ CHECKEDOUT */
+
+/***********************************************************
+Copyright 1987, 1988 by Digital Equipment Corporation, Maynard, Massachusetts
+Copyright 1993 by Sun Microsystems, Inc. Mountain View, CA.
+
+ All Rights Reserved
+
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose and without fee is hereby granted,
+provided that the above copyright notice appear in all copies and that
+both that copyright notice and this permission notice appear in
+supporting documentation, and that the names of Digital or Sun not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.
+
+DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
+ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+SOFTWARE.
+
+SUN DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FIT-
+NESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SUN BE LI-
+ABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
+ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
+PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
+OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
+THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
+******************************************************************/
+
+/*
+
+Copyright (c) 1987, 1988, 1994 X Consortium
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of the X Consortium shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from the X Consortium.
+
+*/
+
+//#include "IntrinsicI.h"
+#include <X11/Intrinsic.h>
+#include <X11/IntrinsicP.h>
+#include <X11/Shell.h>
+#include <X11/ShellP.h>
+#include <X11/StringDefs.h>
+#include <X11/Intrinsic.h>
+
+#define LOCK_PROCESS
+#define UNLOCK_PROCESS
+#define LOCK_APP(app)
+#define UNLOCK_APP(app)
+#define INIT_APP_LOCK(app)
+#define FREE_APP_LOCK(app)
+#define WIDGET_TO_APPCON(w)
+#define DPY_TO_APPCON(d)
+#define CALLGEOTAT(f)
+extern String XtCXtToolkitError;
+
+typedef struct _HookObjRec *HookObject;
+typedef struct _HookObjPart {
+ /* resources */
+ XtCallbackList createhook_callbacks;
+ XtCallbackList changehook_callbacks;
+ XtCallbackList confighook_callbacks;
+ XtCallbackList geometryhook_callbacks;
+ XtCallbackList destroyhook_callbacks;
+ WidgetList shells;
+ Cardinal num_shells;
+ /* private data */
+ Cardinal max_shells;
+ Screen* screen;
+}HookObjPart;
+
+typedef struct _HookObjRec {
+ ObjectPart object;
+ HookObjPart hooks;
+} HookObjRec;
+
+static void ClearRectObjAreas(r, old)
+ RectObj r;
+ XWindowChanges* old;
+{
+ Widget pw = _XtWindowedAncestor((Widget)r);
+ int bw2;
+
+ bw2 = old->border_width << 1;
+ XClearArea( XtDisplay(pw), XtWindow(pw),
+ old->x, old->y,
+ old->width + bw2, old->height + bw2,
+ TRUE );
+
+ bw2 = r->rectangle.border_width << 1;
+ XClearArea( XtDisplay(pw), XtWindow(pw),
+ (int)r->rectangle.x, (int)r->rectangle.y,
+ (unsigned int)(r->rectangle.width + bw2),
+ (unsigned int)(r->rectangle.height + bw2),
+ TRUE );
+}
+
+/*
+ * Internal function used by XtMakeGeometryRequest and XtSetValues.
+ * Returns more data than the public interface. Does not convert
+ * XtGeometryDone to XtGeometryYes.
+ *
+ * clear_rect_obj - *** RETURNED ***
+ * TRUE if the rect obj has been cleared, false otherwise.
+ */
+
+XtGeometryResult
+_XtMakeGeometryRequest (widget, request, reply, clear_rect_obj)
+ Widget widget;
+ XtWidgetGeometry *request, *reply;
+ Boolean * clear_rect_obj;
+{
+ XtWidgetGeometry junk;
+ XtGeometryHandler manager = (XtGeometryHandler)0;
+ XtGeometryResult returnCode;
+ Widget parent = widget->core.parent;
+ Boolean managed = False, parentRealized = False, rgm = False;
+ XtConfigureHookDataRec req;
+ Widget hookobj;
+
+ *clear_rect_obj = FALSE;
+
+ CALLGEOTAT(_XtGeoTrace(widget,
+ "\"%s\" is making a %sgeometry request to its parent \"%s\".\n",
+ XtName(widget),
+ ((request->request_mode & XtCWQueryOnly))? "query only ":"",
+ (XtParent(widget))?XtName(XtParent(widget)):"Root"));
+ CALLGEOTAT(_XtGeoTab(1));
+
+ if (XtIsShell(widget)) {
+ ShellClassExtension ext;
+ LOCK_PROCESS;
+ for (ext = (ShellClassExtension)((ShellWidgetClass)XtClass(widget))
+ ->shell_class.extension;
+ ext != NULL && ext->record_type != NULLQUARK;
+ ext = (ShellClassExtension)ext->next_extension);
+
+ if (ext != NULL) {
+ if ( ext->version == XtShellExtensionVersion
+ && ext->record_size == sizeof(ShellClassExtensionRec)) {
+ manager = ext->root_geometry_manager;
+ rgm = True;
+ } else {
+ String params[1];
+ Cardinal num_params = 1;
+ params[0] = XtClass(widget)->core_class.class_name;
+ XtAppErrorMsg(XtWidgetToApplicationContext(widget),
+ "invalidExtension", "xtMakeGeometryRequest",
+ XtCXtToolkitError,
+ "widget class %s has invalid ShellClassExtension record",
+ params, &num_params);
+ }
+ } else {
+ XtAppErrorMsg(XtWidgetToApplicationContext(widget),
+ "internalError", "xtMakeGeometryRequest",
+ XtCXtToolkitError,
+ "internal error; ShellClassExtension is NULL",
+ NULL, NULL);
+ }
+ managed = True;
+ parentRealized = TRUE;
+ UNLOCK_PROCESS;
+ } else if (parent == NULL) {
+ XtAppErrorMsg(XtWidgetToApplicationContext(widget),
+ "invalidParent","xtMakeGeometryRequest",XtCXtToolkitError,
+ "non-shell has no parent in XtMakeGeometryRequest",
+ (String *)NULL, (Cardinal *)NULL);
+ } else /* not shell */ {
+ managed = XtIsManaged(widget);
+
+ if (XtIsComposite(parent)) {
+ parentRealized = XtIsRealized(parent);
+ LOCK_PROCESS;
+ manager = ((CompositeWidgetClass) (parent->core.widget_class))
+ ->composite_class.geometry_manager;
+ UNLOCK_PROCESS;
+ } else if (managed) {
+ /* Should never happen - XtManageChildren should have checked */
+ XtAppErrorMsg(XtWidgetToApplicationContext(widget),
+ "invalidParent", "xtMakeGeometryRequest",
+ XtCXtToolkitError,
+ "XtMakeGeometryRequest - parent not composite",
+ (String *)NULL, (Cardinal *)NULL);
+ } else {
+ /* no need to waste time checking if parent is actually realized
+ * at this point; since the child is unmanaged we need to perform
+ * the configure iff the child is realized, so we dummy the
+ * parentRealized checks below.
+ */
+ parentRealized = TRUE;
+ }
+ }
+
+ if (managed && manager == (XtGeometryHandler) NULL) {
+ XtErrorMsg("invalidGeometryManager","xtMakeGeometryRequest",
+ XtCXtToolkitError,
+ "XtMakeGeometryRequest - parent has no geometry manager",
+ (String *)NULL, (Cardinal *)NULL);
+ }
+
+ if (widget->core.being_destroyed) {
+ CALLGEOTAT(_XtGeoTab(-1));
+ CALLGEOTAT(_XtGeoTrace(widget,
+ "It is being destroyed, just return XtGeometryNo.\n"));
+ return XtGeometryNo;
+ }
+
+ /* see if requesting anything to change */
+ req.changeMask = 0;
+ if (request->request_mode & CWStackMode
+ && request->stack_mode != XtSMDontChange) {
+ req.changeMask |= CWStackMode;
+ CALLGEOTAT(_XtGeoTrace(widget,
+ "Asking for a change in StackMode!\n"));
+ if (request->request_mode & CWSibling) {
+ XtCheckSubclass(request->sibling, rectObjClass,
+ "XtMakeGeometryRequest");
+ req.changeMask |= CWSibling;
+ }
+ }
+ if (request->request_mode & CWX
+ && widget->core.x != request->x) {
+ CALLGEOTAT(_XtGeoTrace(widget,
+ "Asking for a change in x: from %d to %d.\n",
+ widget->core.x, request->x));
+ req.changeMask |= CWX;
+ }
+ if (request->request_mode & CWY
+ && widget->core.y != request->y) {
+ CALLGEOTAT(_XtGeoTrace(widget,
+ "Asking for a change in y: from %d to %d.\n",
+ widget->core.y, request->y));
+ req.changeMask |= CWY;
+ }
+ if (request->request_mode & CWWidth
+ && widget->core.width != request->width) {
+ CALLGEOTAT(_XtGeoTrace(widget,"Asking for a change in width: from %d to %d.\n",
+ widget->core.width, request->width));
+ req.changeMask |= CWWidth;
+ }
+ if (request->request_mode & CWHeight
+ && widget->core.height != request->height) {
+ CALLGEOTAT(_XtGeoTrace(widget,
+ "Asking for a change in height: from %d to %d.\n",
+ widget->core.height, request->height));
+ req.changeMask |= CWHeight;
+ }
+ if (request->request_mode & CWBorderWidth
+ && widget->core.border_width != request->border_width){
+ CALLGEOTAT(_XtGeoTrace(widget,
+ "Asking for a change in border_width: from %d to %d.\n",
+ widget->core.border_width, request->border_width));
+ req.changeMask |= CWBorderWidth;
+ }
+ if (! req.changeMask) {
+ CALLGEOTAT(_XtGeoTrace(widget,
+ "Asking for nothing new,\n"));
+ CALLGEOTAT(_XtGeoTab(-1));
+ CALLGEOTAT(_XtGeoTrace(widget,
+ "just return XtGeometryYes.\n"));
+ return XtGeometryYes;
+ }
+ req.changeMask |= (request->request_mode & XtCWQueryOnly);
+
+ if ( !(req.changeMask & XtCWQueryOnly) && XtIsRealized(widget) ) {
+ /* keep record of the current geometry so we know what's changed */
+ req.changes.x = widget->core.x ;
+ req.changes.y = widget->core.y ;
+ req.changes.width = widget->core.width ;
+ req.changes.height = widget->core.height ;
+ req.changes.border_width = widget->core.border_width ;
+ }
+
+ if (!managed || !parentRealized) {
+ CALLGEOTAT(_XtGeoTrace(widget,
+ "Not Managed or Parent not realized.\n"));
+ /* Don't get parent's manager involved--assume the answer is yes */
+ if (req.changeMask & XtCWQueryOnly) {
+ /* He was just asking, don't change anything, just tell him yes */
+ CALLGEOTAT(_XtGeoTrace(widget,"QueryOnly request\n"));
+ CALLGEOTAT(_XtGeoTab(-1));
+ CALLGEOTAT(_XtGeoTrace(widget,"just return XtGeometryYes.\n"));
+ return XtGeometryYes;
+ } else {
+ CALLGEOTAT(_XtGeoTrace(widget,
+ "Copy values from request to widget.\n"));
+ /* copy values from request to widget */
+ if (request->request_mode & CWX)
+ widget->core.x = request->x;
+ if (request->request_mode & CWY)
+ widget->core.y = request->y;
+ if (request->request_mode & CWWidth)
+ widget->core.width = request->width;
+ if (request->request_mode & CWHeight)
+ widget->core.height = request->height;
+ if (request->request_mode & CWBorderWidth)
+ widget->core.border_width = request->border_width;
+ if (!parentRealized) {
+ CALLGEOTAT(_XtGeoTab(-1));
+ CALLGEOTAT(_XtGeoTrace(widget,"and return XtGeometryYes.\n"));
+ return XtGeometryYes;
+ }
+ else returnCode = XtGeometryYes;
+ }
+ } else {
+ /* go ask the widget's geometry manager */
+ CALLGEOTAT(_XtGeoTrace(widget,
+ "Go ask the parent geometry manager.\n"));
+ if (reply == (XtWidgetGeometry *) NULL) {
+ returnCode = (*manager)(widget, request, &junk);
+ } else {
+ returnCode = (*manager)(widget, request, reply);
+ }
+ }
+
+ /*
+ * If Unrealized, not a XtGeometryYes, or a query-only then we are done.
+ */
+
+ if ((returnCode != XtGeometryYes) ||
+ (req.changeMask & XtCWQueryOnly) || !XtIsRealized(widget)) {
+
+#ifdef XT_GEO_TATTLER
+ switch(returnCode){
+ case XtGeometryNo:
+ CALLGEOTAT(_XtGeoTab(-1));
+ CALLGEOTAT(_XtGeoTrace(widget,"\"%s\" returns XtGeometryNo.\n",
+ (XtParent(widget))?XtName(XtParent(widget)):"Root"));
+ /* check for no change */
+ break ;
+ case XtGeometryDone:
+ CALLGEOTAT(_XtGeoTab(-1));
+ CALLGEOTAT(_XtGeoTrace(widget,"\"%s\" returns XtGeometryDone.\n",
+ (XtParent(widget))?XtName(XtParent(widget)):"Root"));
+ /* check for no change in queryonly */
+ break ;
+ case XtGeometryAlmost:
+ CALLGEOTAT(_XtGeoTab(-1));
+ CALLGEOTAT(_XtGeoTrace(widget,"\"%s\" returns XtGeometryAlmost.\n",
+ (XtParent(widget))?XtName(XtParent(widget)):"Root"));
+ CALLGEOTAT(_XtGeoTab(1));
+ CALLGEOTAT(_XtGeoTrace(widget,"Proposal: width %d height %d.\n",
+ (reply)?reply->width:junk.width,
+ (reply)?reply->height:junk.height));
+ CALLGEOTAT(_XtGeoTab(-1));
+
+ /* check for no change */
+ break ;
+ case XtGeometryYes:
+ if (req.changeMask & XtCWQueryOnly) {
+ CALLGEOTAT(_XtGeoTrace(widget,
+ "QueryOnly specified, no configuration.\n"));
+ }
+ if (!XtIsRealized(widget)) {
+ CALLGEOTAT(_XtGeoTrace(widget,
+ "\"%s\" not realized, no configuration.\n",
+ XtName(widget)));
+ }
+ CALLGEOTAT(_XtGeoTab(-1));
+ CALLGEOTAT(_XtGeoTrace(widget,"\"%s\" returns XtGeometryYes.\n",
+ (XtParent(widget))?XtName(XtParent(widget)):"Root"));
+ break ;
+ }
+#endif
+ return returnCode;
+ }
+
+ CALLGEOTAT(_XtGeoTab(-1));
+ CALLGEOTAT(_XtGeoTrace(widget,"\"%s\" returns XtGeometryYes.\n",
+ (XtParent(widget))?XtName(XtParent(widget)):"Root"));
+
+ if (XtIsWidget(widget)) { /* reconfigure the window (if needed) */
+
+ if (rgm) return returnCode;
+
+ if (req.changes.x != widget->core.x) {
+ req.changeMask |= CWX;
+ req.changes.x = widget->core.x;
+ CALLGEOTAT(_XtGeoTrace(widget,
+ "x changing to %d\n",widget->core.x));
+ }
+ if (req.changes.y != widget->core.y) {
+ req.changeMask |= CWY;
+ req.changes.y = widget->core.y;
+ CALLGEOTAT(_XtGeoTrace(widget,
+ "y changing to %d\n",widget->core.y));
+ }
+ if (req.changes.width != widget->core.width) {
+ req.changeMask |= CWWidth;
+ req.changes.width = widget->core.width;
+ CALLGEOTAT(_XtGeoTrace(widget,
+ "width changing to %d\n",widget->core.width));
+ }
+ if (req.changes.height != widget->core.height) {
+ req.changeMask |= CWHeight;
+ req.changes.height = widget->core.height;
+ CALLGEOTAT(_XtGeoTrace(widget,
+ "height changing to %d\n",widget->core.height));
+ }
+ if (req.changes.border_width != widget->core.border_width) {
+ req.changeMask |= CWBorderWidth;
+ req.changes.border_width = widget->core.border_width;
+ CALLGEOTAT(_XtGeoTrace(widget,
+ "border_width changing to %d\n",
+ widget->core.border_width));
+ }
+ if (req.changeMask & CWStackMode) {
+ req.changes.stack_mode = request->stack_mode;
+ CALLGEOTAT(_XtGeoTrace(widget,"stack_mode changing\n"));
+ if (req.changeMask & CWSibling) {
+ if (XtIsWidget(request->sibling))
+ req.changes.sibling = XtWindow(request->sibling);
+ else
+ req.changeMask &= ~(CWStackMode | CWSibling);
+ }
+ }
+
+#ifdef XT_GEO_TATTLER
+ if (req.changeMask) {
+ CALLGEOTAT(_XtGeoTrace(widget,
+ "XConfigure \"%s\"'s window.\n",
+ XtName(widget)));
+ } else {
+ CALLGEOTAT(_XtGeoTrace(widget,
+ "No window configuration needed for \"%s\".\n",
+ XtName(widget)));
+ }
+#endif
+
+ XConfigureWindow(XtDisplay(widget), XtWindow(widget),
+ req.changeMask, &req.changes);
+ }
+ else { /* RectObj child of realized Widget */
+ *clear_rect_obj = TRUE;
+ CALLGEOTAT(_XtGeoTrace(widget,
+ "ClearRectObj on \"%s\".\n",XtName(widget)));
+
+ ClearRectObjAreas((RectObj)widget, &req.changes);
+ }
+ hookobj = XtHooksOfDisplay(XtDisplayOfObject(widget));;
+ if (XtHasCallbacks(hookobj, XtNconfigureHook) == XtCallbackHasSome) {
+ req.type = XtHconfigure;
+ req.widget = widget;
+ XtCallCallbackList(hookobj,
+ ((HookObject)hookobj)->hooks.confighook_callbacks,
+ (XtPointer)&req);
+ }
+
+ return returnCode;
+} /* _XtMakeGeometryRequest */
--- Imakefile
+++ Imakefile 2004-04-27 12:25:05.000000000 +0200
@@ -8,8 +8,7 @@
#define German NO
-/* nothing needs to be modified below this point */
-CFLAGS = $(STD_CPP_DEFINES)
+CC = gcc
#ifdef NeXTArchitecture
SYS_LIBRARIES = XawClientLibs -lm -lsys_s
@@ -33,7 +32,7 @@ CC = cc
#else /* Others */ /* END SGIArchitecture */
-CC = gcc -fstrength-reduce -fpcc-struct-return
+CC = gcc -g
#endif
#endif
@@ -46,13 +45,13 @@ SRCS = bibview.c FileNom.c gui_main.c ct
gui_bibl.c gui_help.c ctl_srch.c gui_widg.c ctl_save.c\
gui_list.c gui_card.c ctl_card.c ctl_serv.c\
db_tree.c bib_file.c globdata.c bib_flex.c\
- ComboBo.c rc_file.c ctl_prt.c gui_edit.c
+ ComboBo.c rc_file.c ctl_prt.c gui_edit.c Geometry.c
OBJS = bibview.o FileNom.o gui_main.o ctl_open.o ctl_opt.o\
gui_bibl.o gui_help.o ctl_srch.o gui_widg.o ctl_save.o\
gui_list.o gui_card.o ctl_card.o ctl_serv.o\
db_tree.o bib_file.o globdata.o bib_flex.o\
- ComboBo.o rc_file.o ctl_prt.o gui_edit.o
+ ComboBo.o rc_file.o ctl_prt.o gui_edit.o Geometry.o
PROGRAMS = bibview
all:: $(PROGRAMS)
--- IntrinsicI.h
+++ IntrinsicI.h 2004-04-27 12:25:05.000000000 +0200
@@ -0,0 +1,279 @@
+/* $TOG: IntrinsicI.h /main/47 1997/05/15 17:30:09 kaleb $ */
+
+/***********************************************************
+
+Copyright (c) 1987, 1988, 1994 X Consortium
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of the X Consortium shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from the X Consortium.
+
+
+Copyright 1987, 1988 by Digital Equipment Corporation, Maynard, Massachusetts.
+
+ All Rights Reserved
+
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose and without fee is hereby granted,
+provided that the above copyright notice appear in all copies and that
+both that copyright notice and this permission notice appear in
+supporting documentation, and that the name of Digital not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.
+
+DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
+ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+SOFTWARE.
+
+******************************************************************/
+/* $XFree86: xc/lib/Xt/IntrinsicI.h,v 3.2.2.1 1997/05/17 12:24:55 dawes Exp $ */
+
+#ifndef _XtintrinsicI_h
+#define _XtintrinsicI_h
+
+#include "Xtos.h"
+#include "IntrinsicP.h"
+#ifdef WIN32
+#define _WILLWINSOCK_
+#endif
+#include <X11/Xos.h>
+
+#include "Object.h"
+#include "RectObj.h"
+#include "ObjectP.h"
+#include "RectObjP.h"
+
+#include "ConvertI.h"
+#include "TranslateI.h"
+#include "CallbackI.h"
+#include "EventI.h"
+#include "HookObjI.h"
+#include "PassivGraI.h"
+#include "ThreadsI.h"
+#include "InitialI.h"
+#include "ResourceI.h"
+#include "StringDefs.h"
+
+#define RectObjClassFlag 0x02
+#define WidgetClassFlag 0x04
+#define CompositeClassFlag 0x08
+#define ConstraintClassFlag 0x10
+#define ShellClassFlag 0x20
+#define WMShellClassFlag 0x40
+#define TopLevelClassFlag 0x80
+
+/*
+ * The following macros, though very handy, are not suitable for
+ * IntrinsicP.h as they violate the rule that arguments are to
+ * be evaluated exactly once.
+ */
+
+#define XtDisplayOfObject(object) \
+ (XtIsWidget(object) ? (object)->core.screen->display : \
+ _XtIsHookObject(object) ? ((HookObject)(object))->hooks.screen->display : \
+ _XtWindowedAncestor(object)->core.screen->display)
+
+#define XtScreenOfObject(object) \
+ (XtIsWidget(object) ? (object)->core.screen : \
+ _XtIsHookObject(object) ? ((HookObject)(object))->hooks.screen : \
+ _XtWindowedAncestor(object)->core.screen)
+
+#define XtWindowOfObject(object) \
+ ((XtIsWidget(object) ? (object) : _XtWindowedAncestor(object)) \
+ ->core.window)
+
+#define XtIsManaged(object) \
+ (XtIsRectObj(object) ? (object)->core.managed : False)
+
+#define XtIsSensitive(object) \
+ (XtIsRectObj(object) ? ((object)->core.sensitive && \
+ (object)->core.ancestor_sensitive) : False)
+
+
+/****************************************************************
+ *
+ * Byte utilities
+ *
+ ****************************************************************/
+
+#define _XBCOPYFUNC _XtBcopy
+#include <X11/Xfuncs.h>
+
+/* If the alignment characteristics of your machine are right, these may be
+ faster */
+
+#ifdef UNALIGNED
+
+#define XtMemmove(dst, src, size) \
+ if (size == sizeof(int)) \
+ *((int *) (dst)) = *((int *) (src)); \
+ else if (size == sizeof(char)) \
+ *((char *) (dst)) = *((char *) (src)); \
+ else if (size == sizeof(short)) \
+ *((short *) (dst)) = *((short *) (src)); \
+ else \
+ (void) memcpy((char *) (dst), (char *) (src), (int) (size))
+
+#define XtBZero(dst, size) \
+ if (size == sizeof(int)) \
+ *((int *) (dst)) = 0; \
+ else \
+ bzero((char *) (dst), (int) (size))
+
+#define XtMemcmp(b1, b2, size) \
+ (size == sizeof(int) ? \
+ *((int *) (b1)) != *((int *) (b2)) \
+ : memcmp((char *) (b1), (char *) (b2), (int) (size)) \
+ )
+
+#else
+
+#define XtMemmove(dst, src, size) \
+ (void) memcpy((char *) (dst), (char *) (src), (int) (size))
+
+#define XtBZero(dst, size) \
+ bzero((char *) (dst), (int) (size))
+
+#define XtMemcmp(b1, b2, size) \
+ memcmp((char *) (b1), (char *) (b2), (int) (size))
+
+#endif
+
+
+/****************************************************************
+ *
+ * Stack cache allocation/free
+ *
+ ****************************************************************/
+
+#define XtStackAlloc(size, stack_cache_array) \
+ ((size) <= sizeof(stack_cache_array) \
+ ? (XtPointer)(stack_cache_array) \
+ : XtMalloc((unsigned)(size)))
+
+#define XtStackFree(pointer, stack_cache_array) \
+ if ((pointer) != ((XtPointer)(stack_cache_array))) XtFree(pointer); else
+
+/***************************************************************
+ *
+ * Filename defines
+ *
+ **************************************************************/
+
+/* used by XtResolvePathname */
+#ifndef XFILESEARCHPATHDEFAULT
+#define XFILESEARCHPATHDEFAULT "/usr/lib/X11/%L/%T/%N%S:/usr/lib/X11/%l/%T/%N%S:/usr/lib/X11/%T/%N%S"
+#endif
+
+/* the following two were both "X Toolkit " prior to R4 */
+#ifndef XTERROR_PREFIX
+#define XTERROR_PREFIX ""
+#endif
+
+#ifndef XTWARNING_PREFIX
+#define XTWARNING_PREFIX ""
+#endif
+
+#ifndef ERRORDB
+#define ERRORDB "/usr/lib/X11/XtErrorDB"
+#endif
+
+extern String XtCXtToolkitError;
+
+extern void _XtAllocError(
+#if NeedFunctionPrototypes
+ String /* alloc_type */
+#endif
+);
+
+extern void _XtCompileResourceList(
+#if NeedFunctionPrototypes
+ XtResourceList /* resources */,
+ Cardinal /* num_resources */
+#endif
+);
+
+extern XtGeometryResult _XtMakeGeometryRequest(
+#if NeedFunctionPrototypes
+ Widget /* widget */,
+ XtWidgetGeometry* /* request */,
+ XtWidgetGeometry* /* reply_return */,
+ Boolean* /* clear_rect_obj */
+#endif
+);
+
+extern Boolean _XtIsHookObject(
+#if NeedFunctionPrototypes
+ Widget /* widget */
+#endif
+);
+
+extern void _XtAddShellToHookObj(
+#if NeedFunctionPrototypes
+ Widget /* widget */
+#endif
+);
+
+/** GeoTattler stuff */
+
+#ifdef XT_GEO_TATTLER
+
+extern void _XtGeoTab ();
+extern void _XtGeoTrace (
+#if NeedVarargsPrototypes
+ Widget widget,
+ ...
+#endif
+);
+
+#define CALLGEOTAT(f) f
+
+#else /* XT_GEO_TATTLER */
+
+#define CALLGEOTAT(f)
+
+#endif /* XT_GEO_TATTLER */
+
+#ifndef XTTRACEMEMORY
+
+extern char* __XtMalloc (
+#if NeedFunctionPrototypes
+ unsigned /* size */
+#endif
+);
+extern char* __XtCalloc (
+#if NeedFunctionPrototypes
+ unsigned /* num */,
+ unsigned /* size */
+#endif
+);
+
+#else
+
+#define __XtMalloc XtMalloc
+#define __XtCalloc XtCalloc
+#endif
+
+#endif /* _XtintrinsicI_h */
+/* DON'T ADD STUFF AFTER THIS #endif */
--- Makefile.Linux
+++ Makefile.Linux 2004-04-27 12:25:05.000000000 +0200
@@ -0,0 +1,20 @@
+#
+#
+#
+# Makefile.Linux to integrate package into source tree of SuSE Linux.
+#
+# Copyright (c) 1995-2000 SuSE Gmbh Nuernberg, Germany. All rights reserved.
+#
+#
+
+
+compile:
+ xmkmf -a
+ make
+
+install:
+ make install
+ make install.man
+ install -c -m 0444 BibView.ger.ad /usr/X11R6/lib/X11/app-defaults/BibView.ger
+
+
--- bib_file.c
+++ bib_file.c 2004-04-27 13:53:19.000000000 +0200
@@ -1,4 +1,5 @@
#include <stdio.h>
+#include <stdlib.h>
#include <ctype.h>
#include <X11/Intrinsic.h>
#include <unistd.h>
@@ -16,7 +17,7 @@ int ueIdx = 0;
FILE *tempDatei;
extern FILE *yyin;
-extern YY_NEW_FILE;
+extern int YY_NEW_FILE;
extern int yy_init;
extern int fld_indent, cont_indent, newline_indent, max_fields;
@@ -35,6 +36,7 @@ int yynline;
int yynflexcalls;
int yynerrs;
char errorstr[MAX_ERRORSTRLEN];
+int yyparse();
/*******************************************/
/* Lokale Variablen */
@@ -91,6 +93,10 @@ static long WriteLineToFile(FILE *datei,
extern void yyerror(char *);
extern int yylex();
}
+#else
+# include <stdio.h>
+ extern void yyerror(char *);
+ extern int yylex();
#endif /* __cplusplus */
# define COMMENT 257
# define STRING 258
@@ -140,7 +146,7 @@ typedef int yytabelem;
static int SkipApe(char *text)
{
- int erg, back;
+ int erg;
erg = 0;
while (erg < ueIdx) {
@@ -451,7 +457,9 @@ static int SetInputFile(char *file)
Errcode bifFileRead(BibPtr bp)
{
int erg;
+#ifdef NO_TEMPNAM
char *tempName;
+#endif
yynline = 1;
yynflexcalls = 0;
@@ -466,8 +474,8 @@ Errcode bifFileRead(BibPtr bp)
bp->macrofile = (char *)XtMalloc(strlen(tempName)+1);
strcpy(bp->macrofile,tempName);
#else
- bp->tempfile = (char *)tempnam(NULL, NULL);
- bp->macrofile = (char *)tempnam(NULL, NULL);
+ bp->tempfile = (char *)mytempnam(NULL, NULL);
+ bp->macrofile = (char *)mytempnam(NULL, NULL);
#endif
tempDatei = fopen(bp->macrofile, "w" );
@@ -554,7 +562,6 @@ Errcode bifFileWrite(BibPtr bp)
Errcode bifFileListWrite(BibPtr bp, CardListNode *list, String fname)
{
CardListNode *hlist;
- Errcode erg;
char sysStr[2*MAX_FILEPATHLEN];
if (bp->macrofile!=NULL){
@@ -764,19 +771,15 @@ static void WriteRecToFile(CardData *car
fprintf(datei,"\n}\n\n");
}
-
-
static int StringIsPeteEmpty(char *text)
{
if (text == NULL || *text == '\0') return 1;
return 0;
}
-
-
+void
yyerror(char *s)
{
-
fputs(s, stderr);
putc('\n', stderr);
}
--- bibview.c
+++ bibview.c 2006-11-30 12:12:10.000000000 +0100
@@ -21,8 +21,10 @@
#include <stdio.h>
+#include <stdlib.h>
#include <unistd.h>
#include <sys/param.h>
+#include <signal.h>
#include <X11/Intrinsic.h>
#include <X11/StringDefs.h>
#include <X11/Shell.h>
@@ -53,6 +55,9 @@
#include "bitmaps/proginfo.xbm"
#endif
+/* external global functions */
+/* ------------------------- */
+extern int gwmMainWin(void);
/* external global variables */
/* ------------------------- */
@@ -67,7 +72,6 @@ extern PredefLists predefLst;
extern listEntry *list_layout;
-
/* exported global variables */
/* ------------------------- */
XtAppContext app_context;
@@ -170,9 +174,9 @@ int max_bibtex_types;
/* fallback resources */
static char *fallback_resources[] = {
#ifdef GERMAN
- #include "fb_ger.h"
+# include "fb_ger.h"
#else
- #include "fb_res.h"
+# include "fb_res.h"
#endif
NULL
};
@@ -252,11 +256,11 @@ static void processCommandlineOptions (v
static Boolean readBibfile (XtPointer clientData);
static void makeIconPixmaps (void);
static void installErrorHandlers (void);
-static XtErrorHandler Xt_warningHandler (String warn);
-static XtErrorHandler Xt_errorHandler (String error);
+static void Xt_warningHandler (String warn);
+static void Xt_errorHandler (String error);
static int X_errorHandler (Display *dsp, XErrorEvent *event);
static int IO_errorHandler (Display *dsp);
-static void signalHandler (int signal, int code);
+static void signalHandler (int signal);
static void initializeFields (void);
@@ -308,7 +312,7 @@ int i;
initializeFields();
-#ifdef SYSV
+#if defined(SYSV) || defined(linux)
(void) getcwd(actual_path, MAX_FILEPATHLEN);
#else
(void) getwd(actual_path);
@@ -365,6 +369,7 @@ int i;
rcfSetPrintMode(FALSE);
rcfReadOptions(FALSE);
XtAppMainLoop(app_context);
+ return -1; /* NOTREACHED */
}
@@ -475,7 +480,7 @@ Errcode status;
}
strcpy(bp->filename, filename);
if ((filename[0]!='/') && (filename[0]!='~')){
-#ifdef SYSV
+#if defined(SYSV) || defined(linux)
(void) getcwd(bp->filepath, MAX_FILEPATHLEN);
#else
(void) getwd(bp->filepath);
@@ -827,8 +832,8 @@ int i;
signal(i, signalHandler);
/* install Xtoolkit handlers */
- XtSetWarningHandler((XtErrorHandler)Xt_warningHandler);
- XtSetErrorHandler((XtErrorHandler)Xt_errorHandler);
+ XtSetWarningHandler(Xt_warningHandler);
+ XtSetErrorHandler(Xt_errorHandler);
/* install X error handler */
XSetErrorHandler(X_errorHandler);
@@ -840,7 +845,7 @@ int i;
/* Xt_warningHandler: */
/* Xt warning handler */
/*********************************************************************/
-static XtErrorHandler
+static void
Xt_warningHandler (String warn)
{
}
@@ -850,7 +855,7 @@ Xt_warningHandler (String warn)
/* Xt_errorHandler: */
/* Xt warning handler */
/*********************************************************************/
-static XtErrorHandler
+static void
Xt_errorHandler (String error)
{
}
@@ -889,7 +894,7 @@ IO_errorHandler (Display *dsp)
/* Service signals */
/*********************************************************************/
static void
-signalHandler (int s, int code)
+signalHandler (int s)
{
signal(s, signalHandler);
}
--- bibview.h
+++ bibview.h 2004-04-27 13:28:16.000000000 +0200
@@ -486,6 +486,7 @@ Errcode gubCascade(void);
Errcode gubSetWindowCoords (Boolean calcOnly);
Errcode gubSetIconCoords (Boolean calcOnly);
Errcode gubUnsetIconCoords (Boolean calcOnly);
+extern void gubSetSensitive (BibPtr bib, Boolean sensitive);
/* ctl_srch.c */
void csrSearchCmd (Widget w, XtPointer clientData, XtPointer callData);
@@ -562,6 +563,7 @@ Errcode gueUnsetIconCoords (BibPtr bp, B
Errcode gueOpenBibErrWin(BibPtr bp, int line);
Errcode gueCloseBibErrWin (BibPtr bp);
void gueCloseBibErrWinCmd (Widget w, XtPointer clientData, XtPointer callData);
+Errcode gueOpenMacroWin (BibPtr bp);
/* gui_widg.c */
Errcode guwSelectBib (String head, CtlFuncPtr fct);
@@ -649,3 +651,27 @@ Errcode dbtListAppend (ListNode **list,
Errcode dbtCardListDelete(CardListNode **list);
Errcode dbtCardListInsert(CardListNode **list, CardData *card, int sortedby);
Errcode dbtCardListSortIns(CardListNode **list, CardData *card, int sortedby);
+Errcode dbtMakeUserFld(UserFld **list);
+Errcode CopyCard(CardData **c, CardData *c2);
+Errcode dbtDeleteAllUserFld(UserFld **list);
+Errcode DupCard(CardData **c, CardData *c2, int type);
+
+/* replace tempnam() */
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+static inline char* mytempnam(const char *d1, const char *d2)
+{
+ char tmp[] = "bibviewXXXXXX", *ret;
+ int fd;
+ if ((fd = mkstemp(tmp)) < 0) {
+ perror("mkstemp");
+ exit (1);
+ }
+ close(fd);
+ if (!(ret = strdup(tmp))) {
+ perror("strdup");
+ exit (1);
+ }
+ return ret;
+}
--- ctl_card.c
+++ ctl_card.c 2004-04-27 13:13:33.000000000 +0200
@@ -35,6 +35,7 @@
#include <X11/Xaw/SmeLine.h>
#include <X11/Xaw/Text.h>
#include <X11/Xaw/AsciiText.h>
+#include <X11/Xaw/Template.h>
#include "bibview.h"
@@ -659,15 +660,15 @@ String hlpstring;
sprintf(aw->shellName, "%s: NEW", glbFldToName(nannote));
else
sprintf(aw->shellName, "%s: %s", glbFldToName(nannote), cp->cd->mainkey);
- #ifdef ACTION_PROBLEM
+#ifdef ACTION_PROBLEM
if (first_in){
- #endif
+#endif
XtAppAddActions(XtWidgetToApplicationContext(topLevel), annote_actions,
XtNumber(annote_actions));
- #ifdef ACTION_PROBLEM
+#ifdef ACTION_PROBLEM
first_in = 0;
}
- #endif
+#endif
aw->annoteShell = XtVaCreatePopupShell("AnnoteShell",
topLevelShellWidgetClass, topLevel,
XtNtitle, aw->shellName,
--- ctl_open.c
+++ ctl_open.c 2004-04-27 13:26:07.000000000 +0200
@@ -91,10 +91,10 @@ char *tempName;
/* build new noname filename */
sprintf(bp->filename, "%s%d%s", NN_FILENAME, nnCnt+1, NN_FILEEXT);
/*
-#ifdef SYSV
+#if defined(SYSV) || defined(linux)
(void) getcwd(bp->filepath, MAX_FILEPATHLEN);
#else
- (void) getwd(bp->filepath, MAX_FILEPATHLEN);
+ (void) getwd(bp->filepath);
#endif
*/
strcpy(bp->filepath, actual_path);
@@ -112,7 +112,7 @@ char *tempName;
bp->tempfile = (char *)XtMalloc(strlen(tempName)+1);
strcpy(bp->tempfile,tempName);
#else
- bp->tempfile = (char *)tempnam(NULL, NULL);
+ bp->tempfile = (char *)mytempnam(NULL, NULL);
#endif
tempFile = fopen(bp->tempfile, "w" );
fclose(tempFile);
--- ctl_save.c
+++ ctl_save.c 2004-04-27 12:42:24.000000000 +0200
@@ -21,6 +21,7 @@
/*********************************************************************/
#include <stdio.h>
+#include <stdlib.h>
#include <X11/Intrinsic.h>
#include <X11/StringDefs.h>
#include <X11/Shell.h>
--- ctl_serv.c
+++ ctl_serv.c 2004-04-27 13:38:13.000000000 +0200
@@ -21,6 +21,11 @@
/*********************************************************************/
#include <stdio.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <unistd.h>
#include <X11/Intrinsic.h>
#include <X11/StringDefs.h>
#include <X11/Shell.h>
@@ -63,7 +68,7 @@ static void LoadCfgFile (Widget w, XtPoi
/* local global variables */
/* ---------------------- */
static BibPtr gbp = NULL;
-static chkOkMsg = True;
+static int chkOkMsg = True;
/*********************************************************************/
@@ -307,7 +312,7 @@ char *tempName;
bp->macrofile = (char *)XtMalloc(strlen(tempName)+1);
strcpy(bp->macrofile,tempName);
#else
- bp->macrofile = (char *)tempnam(NULL, NULL);
+ bp->macrofile = (char *)mytempnam(NULL, NULL);
#endif
if (bp->macrofile == NULL)
return(ERR_NOMALLOC);
--- db_tree-regexp.c
+++ db_tree-regexp.c 2004-04-27 12:25:05.000000000 +0200
@@ -31,7 +31,7 @@
#define _WCHAR_T
#endif
/*
- #include <string.h>
+#include <string.h>
*/
#include "bibview.h"
--- db_tree.c
+++ db_tree.c 2004-04-27 13:35:11.000000000 +0200
@@ -23,13 +23,16 @@
#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <ctype.h>
#include <X11/Intrinsic.h>
#ifndef __hpux
#define _WCHAR_T
#endif
/*
- #include <string.h>
+#include <string.h>
*/
#include "bibview.h"
--- globdata.c
+++ globdata.c 2004-04-27 13:52:02.000000000 +0200
@@ -21,6 +21,7 @@
/*********************************************************************/
#include <stdio.h>
+#include <stdlib.h>
#include <ctype.h>
#include <unistd.h>
#include <X11/Intrinsic.h>
@@ -794,9 +795,10 @@ CardPtr cp = NULL;
***************************************************/
int glbContIllegalChar(char *dateiName)
{
+/*
FILE *dptr;
int inh;
-
+ */
return 0;
/*
dptr = fopen(dateiName, "r");
@@ -907,7 +909,6 @@ void string_event(w, event, params, npar
XawTextBlock textblock;
XawTextPosition textins;
char *textstr = *params;
- int i;
int len;
if (!((strcmp(XtName(w),"field")==0) ||
@@ -955,7 +956,7 @@ void string_event(w, event, params, npar
CardPtr getCardPtr(Widget w)
{
BibPtr bp;
- CardPtr cp;
+ CardPtr cp = (CardPtr)0;
CardWidgetsPtr cwp;
int i;
@@ -978,5 +979,6 @@ CardPtr getCardPtr(Widget w)
}
bp = glbNextBibListEl(bp);
}
+ return (CardPtr)0;
}
--- gui_bibl.c
+++ gui_bibl.c 2004-04-27 12:27:27.000000000 +0200
@@ -47,7 +47,7 @@ typedef struct {
/* local function prototypes */
/* ------------------------- */
static Errcode calcNextBibWinPos (int n, Position *x, Position *y);
-static Errcode calcNextBibIconPos (int curIcon, Position *x, Position *y);
+static void calcNextBibIconPos (int curIcon, Position *x, Position *y);
static void createMenu (String menuName, MenuEntry item[], Widget parent, Widget *menu, BibPtr bp);
/* external global variables */
@@ -457,7 +457,7 @@ calcNextBibWinPos (int n, Position *x, P
/* calcNextBibIconPos: */
/* Calculate coords of next bibliography window icon */
/*********************************************************************/
-static Errcode
+static void
calcNextBibIconPos (int curIcon, Position *x, Position *y)
{
Position curX, curY;
--- gui_card.c
+++ gui_card.c 2004-04-27 13:13:18.000000000 +0200
@@ -35,6 +35,7 @@
#include <X11/Xaw/Text.h>
#include <X11/Xaw/AsciiText.h>
#include <X11/Xaw/Viewport.h>
+#include <X11/Xaw/Template.h>
#include "bibview.h"
@@ -45,7 +46,7 @@
/* local function prototypes */
/* ------------------------- */
static Errcode calcNextCardWinPos (Widget desk, int n, Position *x, Position *y);
-static Errcode calcNextCardIconPos (Widget desk, int curIcon, Position *x, Position *y);
+static void calcNextCardIconPos (Widget desk, int curIcon, Position *x, Position *y);
static void createWidgets (BibPtr bp, CardPtr cp);
static Errcode saveWidgets (CardPtr cp);
@@ -370,15 +371,15 @@ CardWinPtr cw;
CardWidgetsPtr cwp;
Dimension height;
- #ifdef ACTION_PROBLEM
+#ifdef ACTION_PROBLEM
if (first_in){
- #endif
+#endif
XtAppAddActions(XtWidgetToApplicationContext(topLevel), actions,
XtNumber(actions));
- #ifdef ACTION_PROBLEM
+#ifdef ACTION_PROBLEM
first_in = 0;
}
- #endif
+#endif
reqback = options.reqColor;
auth_ed_back = options.authedColor;
@@ -995,7 +996,7 @@ Dimension dwidth, dheight;
/* calcNextCardIconPos: */
/* Calculate coords of next card window icon */
/*********************************************************************/
-static Errcode
+static void
calcNextCardIconPos (Widget desk, int curIcon, Position *x, Position *y)
{
Position curX, curY;
--- gui_edit.c
+++ gui_edit.c 2004-04-27 13:10:08.000000000 +0200
@@ -60,6 +60,7 @@ extern listEntry *list_layout;
/* ---------------------- */
void gueSetEditChangeFlag (Widget w, XtPointer clientData, XtPointer callData);
void gueSaveBibErrWinCmd (Widget w, XtPointer clientData, XtPointer callData);
+Errcode gueSaveBibErrWin (BibPtr bp);
--- gui_widg.c
+++ gui_widg.c 2004-04-27 12:42:31.000000000 +0200
@@ -20,6 +20,7 @@
/*********************************************************************/
#include <stdio.h>
+#include <stdlib.h>
#include <X11/Intrinsic.h>
#include <X11/StringDefs.h>
#include <X11/Shell.h>
@@ -330,12 +331,12 @@ unsigned int key_buttons;
XtNfromHoriz, warnIcon, NULL);
sprintf(textLabel, "msgText%d", abs((int)errcode));
if (errcode >= 200){
- #ifdef GERMAN
+#ifdef GERMAN
sprintf(warnLabel, "Karte unvollstaendig: kein %s",
glbFldToName(errcode-200));
- #else
+#else
sprintf(warnLabel, "Card incomplete: no %s", glbFldToName(errcode-200));
- #endif
+#endif
warnText = XtVaCreateManagedWidget(textLabel,
labelWidgetClass, warnForm,
XtNjustify, XtJustifyLeft,
--- rc_file.c
+++ rc_file.c 2004-04-27 13:49:58.000000000 +0200
@@ -20,6 +20,7 @@
/*********************************************************************/
#include <stdio.h>
+#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <ctype.h>
@@ -97,7 +98,9 @@ static int procStyleFileLine (ch
static int procSearchFieldLine (char *str);
static int procListFieldLine (char *str);
static int procAnnoteFieldLine (char *str);
+#if 0
static int build_path (char *str1, char *str2);
+#endif
/* exported variables */
@@ -346,8 +349,7 @@ procOptionLine (char *str)
char token[MAX_TAGLEN+1] = "",
value[MAX_CFGLINELEN+1] = "";
char *p;
-int width, fieldnr;
-
+
if ((p = strchr(str, ':')) == NULL) {
if (prtToStd)
fprintf(stderr, "bibview: illegal [Options] format: %s\n", str);
@@ -423,8 +425,7 @@ procIndentLine (char *str)
char token[MAX_TAGLEN+1] = "",
value[MAX_CFGLINELEN+1] = "";
char *p;
-int width, fieldnr;
-
+
if ((p = strchr(str, ':')) == NULL) {
if (prtToStd)
fprintf(stderr, "bibview: illegal [Indent] format: %s\n", str);
@@ -469,7 +470,7 @@ procPredefLine (char *str)
{
char field[MAX_TAGLEN+1] = "",
data[MAX_CFGLINELEN+1] = "";
-ListNode **lnp;
+ListNode **lnp = NULL;
char *p;
int found, i;
@@ -839,7 +840,7 @@ procSortFieldLine (char *str)
char field[MAX_TAGLEN+1] = "",
data[MAX_CFGLINELEN+1] = "";
char *p;
-int i, type, fieldnr;
+int i, fieldnr;
p = strchr(str, ':');
if (p!=NULL){
@@ -934,7 +935,6 @@ static int
procAnnoteFieldLine (char *str)
{
char field[MAX_TAGLEN+1] = "";
-int fieldnr;
strcpy(field, strlower(str));
glbTrimString(field);
--- flexsrc/b.l
+++ flexsrc/b.l 2004-04-27 12:51:51.000000000 +0200
@@ -1,5 +1,6 @@
%{
#include "b.tab.h"
+#include <unistd.h>
#include <X11/Intrinsic.h>
#include "bibview.h"