projects
/
oweals
/
cde.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix typo in license headers
[oweals/cde.git]
/
cde
/
programs
/
dtcreate
/
main.c
diff --git
a/cde/programs/dtcreate/main.c
b/cde/programs/dtcreate/main.c
index 168cd8857e8743854cb557f892a564b2c5ef0f31..fbd49e6ac192f6e83ef16f7452f67ac7fce2a378 100644
(file)
--- a/
cde/programs/dtcreate/main.c
+++ b/
cde/programs/dtcreate/main.c
@@
-16,7
+16,7
@@
* details.
*
* You should have received a copy of the GNU Lesser General Public
* details.
*
* You should have received a copy of the GNU Lesser General Public
- * License along with these librar
ar
ies 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
*/
* to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
* Floor, Boston, MA 02110-1301 USA
*/
@@
-40,9
+40,14
@@
#include <Xm/Xm.h>
#include <Xm/Protocols.h>
#include <Xm/VendorSEP.h>
#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/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"
#define GETXMSTRING(s, m, d) XmStringCreateLocalized(GETMESSAGE(s,m,d))
#define CLASS_NAME "Dtcreate"
@@
-60,6
+65,8
@@
extern XmWidgetExtData _XmGetWidgetExtData(
#include "dtcreate.h"
#include "ca_aux.h"
#include "cmnrtns.h"
#include "dtcreate.h"
#include "ca_aux.h"
#include "cmnrtns.h"
+#include "ErrorDialog.h"
+#include "fileio.h"
#ifdef __TOOLTALK
#include <Tt/tttk.h>
#ifdef __TOOLTALK
#include <Tt/tttk.h>
@@
-89,7
+96,7
@@
int UxScreen;
* Insert application global declarations here
*---------------------------------------------*/
* 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 {
/* Structure used on a save session to see if a dt is iconic */
typedef struct {
@@
-156,7
+163,7
@@
void GetSessionInfo( void )
/*** now get the information we want from the database ***/
/*** make sure values are at least somewhat reasonable ***/
/*** 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 */
/*******************************/
/* get x position */
@@
-507,7
+514,6
@@
void RemoveTmpIconFiles( void )
unlink(maskFile);
}
if ( (IconDataList[i]->bmDirtyBit) &&
unlink(maskFile);
}
if ( (IconDataList[i]->bmDirtyBit) &&
- (IconDataList[i]->bmFileName) &&
(strlen(IconDataList[i]->bmFileName)) ) {
#ifdef DEBUG
printf("RemoveTmpIconFiles: unlink '%s'\n", IconDataList[i]->bmFileName); /* debug */
(strlen(IconDataList[i]->bmFileName)) ) {
#ifdef DEBUG
printf("RemoveTmpIconFiles: unlink '%s'\n", IconDataList[i]->bmFileName); /* debug */
@@
-533,7
+539,7
@@
void RemoveTmpIconFiles( void )
static void
ExitCB (Widget dialog, XtPointer client_data, XtPointer call_data)
{
static void
ExitCB (Widget dialog, XtPointer client_data, XtPointer call_data)
{
- exit((int) client_data);
+ exit((int)
(XtArgVal)
client_data);
}
void
}
void
@@
-548,6
+554,9
@@
DieFromToolTalkError(Widget parent, char *errfmt, Tt_status status)
if (! tt_is_err(status)) return;
statmsg = tt_status_message(status);
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);
errmsg = XtMalloc(strlen(errfmt) + strlen(statmsg) + 2);
sprintf(errmsg, errfmt, statmsg);
@@
-750,7
+759,7
@@
Tt_callback_action IconEdit_tt_handler( Tt_message m, Tt_pattern p )
display_error_message(XtParent(pIconData->wid), errPtr);
XtFree(errPtr);
tt_release( ttMark );
display_error_message(XtParent(pIconData->wid), errPtr);
XtFree(errPtr);
tt_release( ttMark );
- return;
+ return
(TT_CALLBACK_CONTINUE)
;
}
/*******************************************************************/
}
/*******************************************************************/
@@
-793,7
+802,7
@@
Tt_callback_action IconEdit_tt_handler( Tt_message m, Tt_pattern p )
XtFree(errPtr);
tt_release( ttMark );
if (tmpfd > -1) close(tmpfd);
XtFree(errPtr);
tt_release( ttMark );
if (tmpfd > -1) close(tmpfd);
- return;
+ return
(TT_CALLBACK_CONTINUE)
;
}
/*******************************************************************/
}
/*******************************************************************/
@@
-844,7
+853,7
@@
Tt_callback_action IconEdit_tt_handler( Tt_message m, Tt_pattern p )
XtFree(errPtr);
tt_release( ttMark );
if (tmpfd > -1) close(tmpfd);
XtFree(errPtr);
tt_release( ttMark );
if (tmpfd > -1) close(tmpfd);
- return;
+ return
(TT_CALLBACK_CONTINUE)
;
}
/****************************************************************/
}
/****************************************************************/
@@
-853,7
+862,7
@@
Tt_callback_action IconEdit_tt_handler( Tt_message m, Tt_pattern p )
if (tmp) {
tmp1 = strstr(tmp, "};");
}
if (tmp) {
tmp1 = strstr(tmp, "};");
}
- s
printf(tmpbuf
, "%s_m", tmpIconFile);
+ s
nprintf(tmpbuf, sizeof(tmpbuf)
, "%s_m", tmpIconFile);
if (tmp1) {
tmp1 += 2; /* Go one char past the ";" */
#ifdef DEBUG
if (tmp1) {
tmp1 += 2; /* Go one char past the ";" */
#ifdef DEBUG
@@
-870,7
+879,7
@@
Tt_callback_action IconEdit_tt_handler( Tt_message m, Tt_pattern p )
display_error_message(XtParent(pIconData->wid), errPtr);
XtFree(errPtr);
tt_release( ttMark );
display_error_message(XtParent(pIconData->wid), errPtr);
XtFree(errPtr);
tt_release( ttMark );
- return;
+ return
(TT_CALLBACK_CONTINUE)
;
}
#ifdef DEBUG
}
#ifdef DEBUG
@@
-897,7
+906,7
@@
Tt_callback_action IconEdit_tt_handler( Tt_message m, Tt_pattern p )
XtFree(errPtr);
tt_release( ttMark );
if (tmpfd > -1) close(tmpfd);
XtFree(errPtr);
tt_release( ttMark );
if (tmpfd > -1) close(tmpfd);
- return;
+ return
(TT_CALLBACK_CONTINUE)
;
}
/****************************************************************/
}
/****************************************************************/
@@
-1057,6
+1066,7
@@
void UxDoEditPixmap(Widget wid, char *fname)
display_error_message(XtParent(wid), errPtr);
XtFree(errPtr);
XtFree(mname);
display_error_message(XtParent(wid), errPtr);
XtFree(errPtr);
XtFree(mname);
+ if (fd1 > -1) close(fd1);
return;
} else {
/***************************************/
return;
} else {
/***************************************/
@@
-1093,6
+1103,8
@@
void UxDoEditPixmap(Widget wid, char *fname)
XtFree(errPtr);
if (mname) XtFree(mname);
XtFree((char *) buffer);
XtFree(errPtr);
if (mname) XtFree(mname);
XtFree((char *) buffer);
+ if (fd1 > -1) close(fd1);
+ if (fd2 > -1) close(fd2);
return;
}
if (lenFile2) {
return;
}
if (lenFile2) {
@@
-1117,11
+1129,13
@@
void UxDoEditPixmap(Widget wid, char *fname)
XtFree(errPtr);
XtFree((char *) buffer);
if (mname) XtFree(mname);
XtFree(errPtr);
XtFree((char *) buffer);
if (mname) XtFree(mname);
+ if (fd1 > -1) close(fd1);
+ if (fd2 > -1) close(fd2);
return;
}
}
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 */
#ifdef DEBUG
printf("final buffer = '%s'\n", buffer); /* debug */
@@
-1161,6
+1175,9
@@
void UxDoEditPixmap(Widget wid, char *fname)
TurnOnHourGlassAllWindows();
ttRc = tt_message_send( m );
DieFromToolTalkError( UxTopLevel, "tt_message_send", ttRc );
TurnOnHourGlassAllWindows();
ttRc = tt_message_send( m );
DieFromToolTalkError( UxTopLevel, "tt_message_send", ttRc );
+
+ if (fd1 > -1) close(fd1);
+ if (fd2 > -1) close(fd2);
}
#endif /* __TOOLTALK */
}
#endif /* __TOOLTALK */
@@
-1172,6
+1189,7
@@
void UxDoEditPixmap(Widget wid, char *fname)
/* */
/* */
/*****************************************************************************/
/* */
/* */
/*****************************************************************************/
+int
main(int argc, char *argv[])
{
/*-----------------------------------------------------------
main(int argc, char *argv[])
{
/*-----------------------------------------------------------