remove ultrix support
[oweals/cde.git] / cde / programs / dtpad / main.c
index 0691e8911cd2265586e383852a31904de6c58364..8cf93e37952cd63a73ee1b391c96fdce1976a676 100644 (file)
@@ -16,7 +16,7 @@
  * details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with these librararies and programs; if not, write
+ * License along with these libraries and programs; if not, write
  * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
  * Floor, Boston, MA 02110-1301 USA
  */
@@ -44,7 +44,7 @@
 **  This file contains the routines that control the client/server architecture
 **  of dtpad and creation of the top level widgets.
 **
-**  See the comments preceeding main() for a description of the        client/server
+**  See the comments preceding main() for a description of the client/server
 **  architecture of dtpad as well as an overview of the routine hierarchy of
 **  dtpad.  The widget hierarchy of dtpad goes something like this:
 **
 # if !defined(NL_CAT_LOCALE)
 #  define NL_CAT_LOCALE 0
 # endif
-# ifdef __ultrix
-#  define _DTPAD_CAT_NAME "dtpad.cat"
-# else  /* __ultrix */
 static const char catalogName[] = "dtpad";
-#  define _DTPAD_CAT_NAME catalogName
-# endif /* __ultrix */
+# define _DTPAD_CAT_NAME catalogName
 #endif
 
 
@@ -276,7 +272,7 @@ static int dtpadXIOErrorHandler(
  *                             edit window)
  *
  ************************************************************************/ 
-void 
+int 
 main(
         int argc,
         char **argv )
@@ -439,11 +435,6 @@ main(
       
     } else {
 
-#ifdef __osf__
-/* Temporary work around for action database problem(platinum BL5 03/29/95). */
-      StartDbUpdate((XtPointer) NULL);
-#endif
-
        /*--------------------------------------------------------
         * Requestor Mode
         *
@@ -517,7 +508,7 @@ CreateFirstPad(
     char **argv_l, **c_argv_l;
     Editor *pPad;
     Arg al[10];
-    register int ac;
+    int ac;
     Widget foo;
     int i;
     /* Added for the argument fix*/
@@ -633,6 +624,11 @@ CreateFirstPad(
        initialServerResources = pPad->xrdb;
        initialServerResources.server = False; /* so window will be mapped */ 
        initialServerGeometry = pPad->geometry;
+       if(pPad->xrdb.workspaceList)
+               pPad->xrdb.workspaceList = strdup(pPad->xrdb.workspaceList);
+       if(pPad->xrdb.session)
+               pPad->xrdb.session = strdup(pPad->xrdb.session);
+       pPad->geometry = strdup(pPad->geometry);
     }
 
     /* Set some initial Editor instance values */
@@ -924,7 +920,7 @@ SendMessageToServer(
      ttdt_subcontract_manage(msg,
                        pStatusCB,
                        NULL,
-                       (void *) ((int) pPad->xrdb.blocking));/* client data */
+                       (void *) ((XtArgVal) pPad->xrdb.blocking));/* client data */
 
      /* Add pArgs to msg using tt_message_context_set */
      SetupLoadArgs(msg, pPad);
@@ -1007,7 +1003,7 @@ RealizeNewPad(
         Editor *pPad)
 {
     Arg al[5];                 /* arg list */
-    register int ac;           /* arg count */
+    int ac;            /* arg count */
 
     /* Create the title */
     pPad->dialogTitle = DialogTitle(pPad);
@@ -1163,7 +1159,7 @@ StartDbUpdate(
 void
 exitCB(Widget w, XtPointer callData, XtPointer clientData)
 {
-    exit((int) clientData);
+    exit((XtArgVal) clientData);
 }
 
 /************************************************************************
@@ -1232,7 +1228,7 @@ GetAdjustedResizeHints(
         XSizeHints *pHints)
 {
     Arg al[2];                 /* arg list */
-    register int ac;           /* arg count */
+    int ac;            /* arg count */
     Dimension MBheight;
 
     /* get Dt Editor widget size hints */
@@ -1357,7 +1353,7 @@ SetWindowSize(
         Editor *pPad)
 {
     Arg al[10];                        /* arg list */
-    register int ac;           /* arg count */
+    int ac;            /* arg count */
     XSizeHints  size_hints;
     XWMHints   *wmhints;
     long supplied_return;
@@ -1677,7 +1673,6 @@ RestoreInitialServerResources(
        XtFree(pPad->geometry );
 
     pPad->xrdb = initialServerResources;
-    pPad->geometry = initialServerGeometry;
 
     /* -----> duplicate resource strings */
     if (initialServerResources.workspaceList != (char *)NULL)
@@ -1818,7 +1813,7 @@ Usage(
 
    template = (GETMESSAGE(7,10, message_string2));
 
-   fprintf (stderr, template);
+   fprintf (stderr, "%s", template);
 
    exit (0);
 }
@@ -1844,7 +1839,7 @@ dtpadXErrorHandler(
     _DtSimpleError("dtpad", DtWarning, NULL, msg, NULL);
 
     /*
-     * if the error occured on the print display we're going to set
+     * if the error occurred on the print display we're going to set
      * a variable so that and when the job is done, right before calling
      * XpEndJob, we call XpCancelJob, and notify the user.
      */
@@ -1877,4 +1872,8 @@ dtpadXIOErrorHandler(
 
     fprintf(stderr, "X IO Error");
     PanicSave();
+
+    /* Man page for XSetIOErrorhandler says this is a fatal error and
+     * should not return */
+    exit(EXIT_FAILURE);
 }