+/*
+ * 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 librararies and programs; if not, write
+ * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
+ * Floor, Boston, MA 02110-1301 USA
+ */
/* $TOG: main.c /main/11 1999/09/17 17:22:06 mgreess $ */
/*****************************************************************************/
/* */
#include <Xm/Xm.h>
#include <Xm/Protocols.h>
#include <Xm/VendorSEP.h>
+#include <Xm/XmPrivate.h> /* XmeFlushIconFileCache */
+#include <Dt/Action.h>
+#include <Dt/GetDispRes.h>
#include <Dt/Icon.h>
#include <Dt/EnvControlP.h>
#include <Dt/UserMsg.h>
+#include <Dt/Session.h>
+#include <Dt/Wsm.h>
#define GETXMSTRING(s, m, d) XmStringCreateLocalized(GETMESSAGE(s,m,d))
#define CLASS_NAME "Dtcreate"
#include "dtcreate.h"
#include "ca_aux.h"
#include "cmnrtns.h"
+#include "ErrorDialog.h"
+#include "fileio.h"
#ifdef __TOOLTALK
#include <Tt/tttk.h>
* Insert application global declarations here
*---------------------------------------------*/
-extern Dimension wintypeheight;
+extern XtArgVal /* Dimension */ wintypeheight;
/* Structure used on a save session to see if a dt is iconic */
typedef struct {
/*** now get the information we want from the database ***/
/*** make sure values are at least somewhat reasonable ***/
- xrm_name[1] = NULL;
+ xrm_name[1] = '\0';
/*******************************/
/* get x position */
unlink(maskFile);
}
if ( (IconDataList[i]->bmDirtyBit) &&
- (IconDataList[i]->bmFileName) &&
(strlen(IconDataList[i]->bmFileName)) ) {
#ifdef DEBUG
printf("RemoveTmpIconFiles: unlink '%s'\n", IconDataList[i]->bmFileName); /* debug */
static void
ExitCB (Widget dialog, XtPointer client_data, XtPointer call_data)
{
- exit((int) client_data);
+ exit((int)(XtArgVal) client_data);
}
void
if (! tt_is_err(status)) return;
statmsg = tt_status_message(status);
+ /* Solaris dtcreate ignores this so we should too */
+ if(status == TT_ERR_PTYPE)
+ return;
errmsg = XtMalloc(strlen(errfmt) + strlen(statmsg) + 2);
sprintf(errmsg, errfmt, statmsg);
display_error_message(XtParent(pIconData->wid), errPtr);
XtFree(errPtr);
tt_release( ttMark );
- return;
+ return (TT_CALLBACK_CONTINUE);
}
/*******************************************************************/
XtFree(errPtr);
tt_release( ttMark );
if (tmpfd > -1) close(tmpfd);
- return;
+ return (TT_CALLBACK_CONTINUE);
}
/*******************************************************************/
XtFree(errPtr);
tt_release( ttMark );
if (tmpfd > -1) close(tmpfd);
- return;
+ return (TT_CALLBACK_CONTINUE);
}
/****************************************************************/
if (tmp) {
tmp1 = strstr(tmp, "};");
}
- sprintf(tmpbuf, "%s_m", tmpIconFile);
+ snprintf(tmpbuf, sizeof(tmpbuf), "%s_m", tmpIconFile);
if (tmp1) {
tmp1 += 2; /* Go one char past the ";" */
#ifdef DEBUG
display_error_message(XtParent(pIconData->wid), errPtr);
XtFree(errPtr);
tt_release( ttMark );
- return;
+ return (TT_CALLBACK_CONTINUE);
}
#ifdef DEBUG
XtFree(errPtr);
tt_release( ttMark );
if (tmpfd > -1) close(tmpfd);
- return;
+ return (TT_CALLBACK_CONTINUE);
}
/****************************************************************/
display_error_message(XtParent(wid), errPtr);
XtFree(errPtr);
XtFree(mname);
+ if (fd1 > -1) close(fd1);
return;
} else {
/***************************************/
XtFree(errPtr);
if (mname) XtFree(mname);
XtFree((char *) buffer);
+ if (fd1 > -1) close(fd1);
+ if (fd2 > -1) close(fd2);
return;
}
if (lenFile2) {
XtFree(errPtr);
XtFree((char *) buffer);
if (mname) XtFree(mname);
+ if (fd1 > -1) close(fd1);
+ if (fd2 > -1) close(fd2);
return;
}
}
- if (fd1 > -1) close(fd1);
- if (fd2 > -1) close(fd2);
+ if (fd1 > -1) close(fd1); fd1 = -1;
+ if (fd2 > -1) close(fd2); fd2 = -1;
#ifdef DEBUG
printf("final buffer = '%s'\n", buffer); /* debug */
TurnOnHourGlassAllWindows();
ttRc = tt_message_send( m );
DieFromToolTalkError( UxTopLevel, "tt_message_send", ttRc );
+
+ if (fd1 > -1) close(fd1);
+ if (fd2 > -1) close(fd2);
}
#endif /* __TOOLTALK */
/* */
/* */
/*****************************************************************************/
+int
main(int argc, char *argv[])
{
/*-----------------------------------------------------------