dtcm: make it build
[oweals/cde.git] / cde / lib / DtHelp / HelpUtil.c
index 8637c2fffbb2231b99ce8d1ed7e1320621b9aaf7..5aaec504ba7986e536a1e1adaa877ffbbe4e531d 100644 (file)
@@ -1,3 +1,25 @@
+/*
+ * CDE - Common Desktop Environment
+ *
+ * Copyright (c) 1993-2012, The Open Group. All rights reserved.
+ *
+ * These libraries and programs are free software; you can
+ * redistribute them and/or modify them under the terms of the GNU
+ * Lesser General Public License as published by the Free Software
+ * Foundation; either version 2 of the License, or (at your option)
+ * any later version.
+ *
+ * These libraries and programs are distributed in the hope that
+ * they will be useful, but WITHOUT ANY WARRANTY; without even the
+ * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU Lesser General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * 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
+ */
 /* $TOG: HelpUtil.c /main/19 1998/04/09 17:43:30 mgreess $ */
 /************************************<+>*************************************
  ****************************************************************************
@@ -37,7 +59,6 @@
 #include <Xm/MwmUtil.h>
 
 #include <Xm/MessageB.h>
-#include <X11/keysymdef.h>
 #include <X11/Shell.h>
 #include <X11/Intrinsic.h>
 #include <X11/cursorfont.h>
@@ -46,6 +67,7 @@
 #include "Access.h"
 #include "bufioI.h"
 #include "DisplayAreaI.h"
+#include "DisplayAreaP.h"
 
 #include <Dt/Help.h>
 #include "HelpI.h"
@@ -55,6 +77,8 @@
 #include "HelpDialogP.h"
 #include "HelpUtilI.h"
 #include "HelposI.h"
+#include "HyperTextI.h"
+#include "FormatI.h"
 #include "MessagesP.h"
 #include "HelpQuickD.h"
 #include "SetListI.h"
@@ -102,7 +126,7 @@ static void  CloseDefBoxCB(
 #define HUSET 8     /* message catalog set */
 
 /******** static variables ********/
-static char DirSlash[] = "/";
+
 
 /******** data structures ********/
 typedef struct ExecContext 
@@ -844,7 +868,6 @@ int _DtHelpFilterExecCmd(
    XmString labelString2;
    Widget  noexecBtn;
    Widget  execBtn;
-   Cursor  cursor;
 
    goodCmd = _DtHelpFilterExecCmdStr(helpWidget, executionPolicy, 
                  commandStr, &filteredCmdStr, &invalidAlias, 
@@ -860,6 +883,7 @@ int _DtHelpFilterExecCmd(
    if (False == useQueryDialog)
    {
       *ret_filteredCmdStr = NULL;
+      XtFree(filteredCmdStr);
       return -1;                          /* RETURN error */
    }
 
@@ -982,7 +1006,6 @@ void _DtHelpExecFilteredCmd(
    Boolean queryNeeded;
    char *  filteredCmdStr = NULL;
    ExecContext * execContext;
-   DtHelpListStruct *pHelpInfo;
    XmString labelString;
    XmString labelString2;
    Widget   msgDlg;
@@ -1002,7 +1025,9 @@ void _DtHelpExecFilteredCmd(
    following code can fail on IBM platform when XTHREADS and XUSE_MTSAFE_API
    are defined.
 */
+/*
    _Xgetpwparams pwd_buf;
+*/
    struct passwd * pwd_ret;
 
   /** -------------------------------------------------------------- *
@@ -1139,7 +1164,7 @@ static Widget  LocateWidgetId(
     Widget           shellWidget,
     Cursor           cursorIn)
 {
-    static Cursor    DfltOnItemCursor = NULL;
+    static Cursor    DfltOnItemCursor = 0;
     Widget           widget;
     Widget           child;
     CompositeWidget  comp_widget;
@@ -1158,7 +1183,7 @@ static Widget  LocateWidgetId(
 
  
     /* Make the target cursor */
-    if (cursorIn != NULL)
+    if (cursorIn != 0)
         cursor = cursorIn;
     else
 #if 0
@@ -1166,7 +1191,7 @@ static Widget  LocateWidgetId(
 #else
     {
         _DtHelpProcessLock();
-        if (NULL == DfltOnItemCursor)
+        if (0 == DfltOnItemCursor)
         {
             char        *bits;
             char        *maskBits;
@@ -1533,7 +1558,7 @@ char *_DtHelpParseIdString(
   char *pAccessFile = NULL;
   char *tmpSpec=NULL;
   char *returnStr=NULL;
-  char *strtok_ptr;
+  char *strtok_ptr=NULL;
 
   tmpSpec = XtNewString(specification);
 
@@ -1591,7 +1616,7 @@ char *_DtHelpParseAccessFile(
   char *pAccessFile = NULL;
   char *tmpSpec=NULL;
   char *returnStr=NULL;
-  char *strtok_ptr;
+  char *strtok_ptr=NULL;
 
   tmpSpec = XtNewString(specification);
 
@@ -2175,7 +2200,7 @@ void _DtHelpDisplayFormatError(
    /* Set the string to the current help dialog */
    (void) _DtHelpFormatAsciiStringDynamic(displayArea, userError, &topicHandle);
          
-   /* We ignor the status return here, because if we error out here we are
+   /* We ignore the status return here, because if we error out here we are
     * in big trouble because this is an error routine
     */