* 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
*/
#include <sys/types.h>
#include <stdio.h>
+#include <stdlib.h>
#include <sys/stat.h>
#include <signal.h>
-#ifdef __osf__
+#if defined(CSRG_BASED)
#include <sys/wait.h>
-#endif /* __osf__ */
+#endif /* CSRG_BASED */
#include <errno.h>
#include <pwd.h>
#include <Xm/RowColumn.h>
#include <Xm/MwmUtil.h>
+#include <Xm/IconFileP.h>
#include <Dt/Icon.h>
#include <Dt/IconP.h>
#include <Dt/IconFile.h>
#include <X11/Shell.h>
#include <X11/Xatom.h>
#include <Xm/Protocols.h>
-#include <X11/keysymdef.h>
#ifdef HAVE_EDITRES
#include <X11/Xmu/Editres.h>
#endif
#include <Dt/Session.h>
+#include <Dt/Dt.h>
#include <Dt/DtP.h>
#include <Dt/Connect.h>
#include <Dt/FileM.h>
#include <Dt/CommandM.h>
#include <Dt/EnvControlP.h>
#include <Dt/Dts.h>
+#include <Dt/SharedProcs.h>
#include "Encaps.h"
#include "SharedProcs.h"
#include "Find.h"
#include "ModAttr.h"
+/* From Command.c */
+extern void MoveCopyLinkHandler(Tt_message ttMsg, int opType);
+
+/* From Desktop.c */
+extern void PutOnWorkspaceHandler(Tt_message ttMsg);
+
+/* From Filter.c */
+extern void UpdateFilterAfterDBReread (DialogData * dialog_data);
+
+/* From ToolTalk.c */
+extern int InitializeToolTalkSession( Widget topLevel, int ttFd );
+extern Tt_status InitializeToolTalkProcid( int *ttFd, Widget topLevel, Boolean sendStarted );
+extern void FinalizeToolTalkSession();
+/* From Trash.c */
+void CloseTrash(Widget w, XtPointer client_data, XtPointer call_data) ;
+
+
+
/* When openDir resource is set to NEW
File Manager will use this prefix to find for a different icon
to display.
extern XtInputId ProcessToolTalkInputId;
-#ifdef __osf__
+#if defined(CSRG_BASED)
extern void sigchld_handler(int);
-#endif /* __osf__ */
+#endif /* CSRG_BASED */
-void
+int
main(
- unsigned int argc,
+ int argc,
char **argv )
{
#ifdef DT_PERFORMANCE
struct timeval update_time_fs;
#endif
struct passwd * pw;
- char current_directory[MAX_PATH];
+ char current_directory[MAX_PATH] = {0};
struct passwd * pwInfo;
char * homeDir;
XEvent event;
XtInputMask pending;
Boolean eventDebugging;
int offset;
- KeySym keysym;
int displayHeight;
int displayWidth;
Arg args[10];
Tt_pattern requests2Handle;
Tt_message msg;
Tt_status status;
-#ifdef __osf__
+#if defined(CSRG_BASED)
struct sigaction sa, osa;
-#endif /* __osf__ */
+#endif /* CSRG_BASED */
int session_flag = 0;
#ifdef DT_PERFORMANCE
(void) signal (SIGINT, (void (*)())Stop);
/* We don't want any zombie children, do we? */
-#ifdef __osf__
+#if defined(CSRG_BASED)
sa.sa_handler = sigchld_handler;
sigemptyset(&sa.sa_mask);
sa.sa_flags = 0;
;
#else
(void) signal (SIGCHLD, SIG_IGN);
-#endif /* __osf__ */
+#endif /* CSRG_BASED */
XtSetLanguageProc( NULL, NULL, NULL );
#ifdef DT_PERFORMANCE
option_list, XtNumber(option_list),
(int *)&argc, argv);
-/* MERGE START: May not need
-#ifdef __osf__
- _XmColorObjCreate ( toplevel, NULL, NULL );
-#endif
-*/
-
#ifdef DT_PERFORMANCE
gettimeofday(&update_time_f, NULL);
if (update_time_s.tv_usec > update_time_f.tv_usec) {
/* Default action: Open up pwd or home dir */
GetPWD(current_directory);
- if (current_directory[0] != NULL)
+ if (current_directory[0] != '\0')
{
msg = tttk_message_create( 0, TT_REQUEST, TT_SESSION, 0,
"DtFolder_Show",
/* Get users pwd so we can set the restricted dir to it */
GetPWD(current_directory);
- if (current_directory[0] != NULL)
+ if (current_directory[0] != '\0')
special_restricted = XtNewString(current_directory);
else
special_restricted = XtNewString("~");
mod_attr_dialog = _DtInstallDialog (modAttrClass, True, True);
help_dialog = _DtInstallDialog (helpClass, False, False);
- if(special_view == True && special_restricted != NULL);
+ if(special_view == True && special_restricted != NULL) {
if(strncmp(special_restricted, "~", 1) == 0)
{
char *ptr, *ptr1;
special_restricted = _DtChangeTildeToHome(special_restricted);
ptr = strrchr(special_restricted, '/');
ptr1 = ptr + 1;
- if(ptr1[0] == NULL)
+ if(ptr1[0] == '\0')
*ptr = '\0';
}
+ }
/* Setup the settings file if any to setup */
RestoreSettingsFile();
/* go build 10 desktop windows */
desktop_data = NULL;
InitializeDesktopWindows(10, display);
- InitializeDesktopGrid();
+ InitializeDesktopGrid(displayWidth, displayHeight);
LoadDesktopInfo(application_args.session);
/* Get users pwd so we can create a fileviewer window of it */
GetPWD(current_directory);
- if (current_directory[0] != NULL)
+ if (current_directory[0] != '\0')
{
if (!GetNewView (home_host_name, current_directory, NULL, NULL, 0))
ViewHomeDirectoryHandler (0);
if (event.type != 0)
XtDispatchEvent(&event);
}
+
+ return EXIT_SUCCESS;
}
template = (GETMESSAGE(18,23, message_string1));
fprintf (stderr, template, argv[0]);
template = (GETMESSAGE(18,24, message_string2));
- fprintf (stderr, template);
+ fprintf (stderr, "%s", template);
exit (0);
}
else
{
XtFree(dtPath);
- return; /* we are comming up in a system mode (e.g. default) */
+ return; /* we are coming up in a system mode (e.g. default) */
}
{
static char * name_list[] = { DTFILE_CLASS_NAME, NULL, NULL, NULL,
NULL, NULL};
- char view_number[5];
+ char view_number[11];
char number[5];
- char workspaceNumber[5];
+ char workspaceNumber[11];
int fd;
Atom * ws_presence = NULL;
char * workspace_name=NULL;
char * full_path = NULL;
Boolean status=False;
char * temp = NULL;
- char wsNum[5];
- char dialogNum[5];
+ char wsNum[11];
+ char dialogNum[11];
int num_sec_help_dialogs;
int i;
int j;
status = DtSessionRestorePath(toplevel, &full_path, path);
if (!status)
- return;
+ return(-1);
if (stat(full_path, &stat_buf) != 0)
{
/* first find out if it should show the file system */
xrm_name [0] = XrmStringToQuark (DTFILE_CLASS_NAME);
xrm_name [1] = XrmStringToQuark ("showFilesystem");
- xrm_name [2] = NULL;
+ xrm_name [2] = 0;
if (XrmQGetResource (db, xrm_name, xrm_name, &rep_type, &value))
{
if ((temp = (char *) value.addr) != NULL &&
/* find out if it should be in restricted mode */
xrm_name [0] = XrmStringToQuark (DTFILE_CLASS_NAME);
xrm_name [1] = XrmStringToQuark ("restrictMode");
- xrm_name [2] = NULL;
+ xrm_name [2] = 0;
if (XrmQGetResource (db, xrm_name, xrm_name, &rep_type, &value))
{
if ((temp = (char *) value.addr) != NULL &&
/* find out openFolder mode */
xrm_name [0] = XrmStringToQuark (DTFILE_CLASS_NAME);
xrm_name [1] = XrmStringToQuark ("openFolder");
- xrm_name [2] = NULL;
+ xrm_name [2] = 0;
if (XrmQGetResource (db, xrm_name, xrm_name, &rep_type, &value))
{
if ((temp = (char *) value.addr) != NULL &&
xrm_name [0] = XrmStringToQuark (DTFILE_CLASS_NAME);
xrm_name [1] = XrmStringToQuark ("view_count");
- xrm_name [2] = NULL;
+ xrm_name [2] = 0;
/* Load standard dtfile views */
if (XrmQGetResource (db, xrm_name, xrm_name, &rep_type, &value))
xrm_name [1] = XrmStringToQuark (WS_LOAD_RES_HEADER);
xrm_name [2] = XrmStringToQuark (wsNum);
xrm_name [3] = XrmStringToQuark (SEC_LOAD_HELP_RES_HEADER);
- xrm_name [4] = NULL;
+ xrm_name [4] = 0;
/* Load standard dtfile views */
if (XrmQGetResource (db, xrm_name, xrm_name, &rep_type, &value))
XrmRepresentation rep_type;
XrmValue value;
static char * name_list[] = { DTFILE_CLASS_NAME, NULL, NULL };
- char view_number[5];
+ char view_number[11];
DialogData * dialog_data;
FileMgrData * file_mgr_data;
char * workspaces;
/* and set the property for the view just created */
xrm_name [2] = XrmStringToQuark ("workspace");
- xrm_name [3] = NULL;
+ xrm_name [3] = 0;
if (XrmQGetResource (db, xrm_name, xrm_name, &rep_type, &value))
{
/* Get and set whether the view is iconic */
xrm_name [2] = XrmStringToQuark ("iconify");
- xrm_name [3] = NULL;
+ xrm_name [3] = 0;
if (XrmQGetResource (db, xrm_name, xrm_name, &rep_type, &value))
{
GetPWD(
char current_directory[] )
{
- FILE * pwd_file;
- register int i;
+ FILE * pwd_file = NULL;
+ int i = 0;
/* Open a pwd process and read the current working directory */
/* from it. If the open fails or a read fails, then display */
/* the users home directory. */
pwd_file = popen ("pwd", "r");
- i = 0;
- if (pwd_file != NULL)
+ if (pwd_file)
{
while (1)
{
i++;
}
}
- (void) pclose (pwd_file);
- current_directory[i] = NULL;
+ if (pwd_file)
+ pclose (pwd_file);
+
+ current_directory[i] = '\0';
}
/************************************************************************
{
separator = DtStrchr (directory_set, ',');
if (separator != NULL)
- *separator = NULL;
+ *separator = '\0';
_DtPathFromInput(directory_set, NULL, &host, &path);
CloseView(
DialogData *dialog_data )
{
- register int i;
- register int j;
+ int i;
+ int j;
FileMgrData * file_mgr_data;
DialogData * tmpDialog_data;
FileMgrRec * file_mgr_rec;
char current_directory[MAX_PATH];
GetPWD(current_directory);
- if (current_directory[0] != NULL)
+ if (current_directory[0] != '\0')
{
if (!GetNewView
(home_host_name, current_directory, NULL, NULL, 0))
XtFree(errTitle);
XtFree(errMsg);
XtFree(dmsg);
- return;
+ return NULL;
}
}
}
ViewHomeDirectoryHandler(
Tt_message msg)
{
- register int i, j, k;
+ int i, j, k;
struct passwd * pwInfo;
char * homeDir;
char * tmp_path;
ViewToolsDirectoryHandler(
Tt_message msg)
{
- register int i;
+ int i;
char * tmp_path = NULL;
char * tool_dir = NULL;
char * msgFile = NULL;
XRectangle textExtent;
Position x, y;
- if ((int) client_data == FM_POPUP)
+ if ((int)(XtArgVal) client_data == FM_POPUP)
mbar = XtParent(w);
else
mbar = XmGetPostedFromWidget(XtParent(w));
unsigned char **ppchNext)
{
unsigned char *pchR = pchIn;
- register int i;
-#ifdef MULTIBYTE
- register int chlen;
+ int i;
+ int chlen;
for (i = 0; ((chlen = mblen ((char *)pchIn, MB_CUR_MAX)) > 0); i++)
/* find end of word: requires singlebyte whitespace terminator */
pchIn += chlen;
}
-#else
- for (i = 0; *pchIn && !isspace (*pchIn); i++, pchIn++)
- /* find end of word */
- {
- }
-#endif
-
/* skip to next word */
-#ifdef MULTIBYTE
while (pchIn && (mblen ((char *)pchIn, MB_CUR_MAX) == 1) && isspace (*pchIn))
-#else
- while (pchIn && isspace (*pchIn))
-#endif
{
*pchIn++;
}
char * host_name,
char * directory_name)
{
- register int i;
- register int j;
- register int k;
+ int i;
+ int j;
+ int k;
Arg args[1];
FileViewData * file_view_data = NULL;
DialogData *dialog_data;
exit (1);
}
-#ifdef __osf__
+#if defined(CSRG_BASED)
extern void
sigchld_handler(int signo) /* Do not use the arg signo at the moment */
{
pid = waitpid(-1, &stat_loc, WNOHANG);
/* Child exit handling code follows, if any */
}
-#endif /* __osf__ */
+#endif /* CSRG_BASED */