home *** CD-ROM | disk | FTP | other *** search
- /*
- * x.c --
- *
- * Routines that handle the window interface.
- *
- * Copyright 1989 Regents of the University of California
- * Permission to use, copy, modify, and distribute this
- * software and its documentation for any purpose and without
- * fee is hereby granted, provided that the above copyright
- * notice appear in all copies. The University of California
- * makes no representations about the suitability of this
- * software for any purpose. It is provided "as is" without
- * express or implied warranty.
- *
- * Author: Gary Shea, UC Berkeley, Dept. of Chemistry
- */
-
- static char rcsid[] = "$Header: x.c,v 1.3 89/07/18 00:04:39 garys Exp $";
-
- #include "xf.h"
-
- /* Local declarations. */
-
- static void BuildDialogBox( void ) ;
-
- static XtSetDataStruct **BuildSetData( DirTree *dirPtr ) ;
-
- static void ConfirmButtonPushed( Widget w,
- caddr_t client_data, caddr_t call_data ) ;
- static void DoneButtonPushed( Widget w,
- caddr_t client_data, caddr_t call_data ) ;
- static void EnterFileName( Widget w,
- caddr_t client_data, caddr_t call_data ) ;
- static void OpenDirDown( Widget w,
- caddr_t client_data, caddr_t call_data ) ;
- static void OutputFileNames( DirTree *dirTreePtr,
- void *clientData ) ;
- static void QuitButtonPushed( Widget w,
- caddr_t client_data, caddr_t call_data ) ;
- static void UpButtonPushed( Widget w,
- caddr_t client_data, caddr_t call_data ) ;
-
- /* Information about the dialog box where file names are entered. */
-
- static struct
- {
- Widget shellW ;
- Widget dialogW ;
- Widget textW ;
- Widget labelW ;
- Widget confComW ;
- char fileName[ MAXPATHLEN + 1 ] ;
- }
- dialogBox ;
-
-
- /*
- *----------------------------------------------------------------------
- *
- * BuildDialogBox --
- *
- * Create (realize but don't display) the dialog box that
- * the user can enter a filename into. It is displayed
- * when XtPopup is called.
- *
- * Results:
- * None.
- *
- * Side effects:
- * A shell widget and dialog box are instantiated, but not displayed.
- *
- * Arguments:
- * None.
- *
- *----------------------------------------------------------------------
- */
-
- static void
- BuildDialogBox( void )
- {
- char errLine[ ERRLINE_LEN ] ;
- char *pLocName = "BuildDialogBox()" ;
-
- int n ;
- Arg args[ 10 ] ;
-
- XtCallbackRec callbacks[ 5 ] = { {NULL,NULL}, {NULL,NULL} } ;
-
- char *label =
- "Enter File Name " ;
-
- #ifdef DEBUG
- fprintf ( pErrFp, "\n%s:\n", pLocName ) ;
- #endif
-
- /* Make a pop up shell to hold the mess. */
-
- dialogBox.shellW = XtCreatePopupShell ( "Enter Directory Name",
- applicationShellWidgetClass, topLevelW, NULL, 0 ) ;
-
- /* Make the Dialog widget that will get popped up.
- * Be sure the fileName string is blank initially.
- */
-
- strcpy ( dialogBox.fileName, "" ) ;
-
- n = 0 ;
- #ifdef NOAPPDEFAULTS
- XtSetArg( args[n], XtNlabel, label ) ; ++n ;
- XtSetArg( args[n], XtNmaximumLength, MAXPATHLEN ) ; ++n ;
- #endif
- XtSetArg( args[n], XtNvalue, dialogBox.fileName ) ; ++n ;
- dialogBox.dialogW = XtCreateManagedWidget ( "dialog", dialogWidgetClass,
- dialogBox.shellW, args, n ) ;
-
- /* Find the id of the Text widget holding the string. */
-
- dialogBox.textW = XtNameToWidget ( dialogBox.dialogW, "value" ) ;
- dialogBox.labelW = XtNameToWidget ( dialogBox.dialogW, "label" ) ;
-
- #ifdef DEBUG
- fprintf ( pErrFp, "\tdialogW=%d, textW=%d, labelW=%d\n",
- dialogBox.dialogW, dialogBox.textW, dialogBox.labelW ) ;
- #endif
-
- callbacks[0].callback = ConfirmButtonPushed ;
- n = 0 ;
- XtSetArg( args[n], XtNcallback, callbacks ) ; ++n ;
- #ifdef NOAPPDEFAULTS
- XtSetArg( args[n], XtNlabel, "Confirm" ) ; ++n ;
- #endif
- dialogBox.confComW = XtCreateManagedWidget ( "confirm", commandWidgetClass,
- dialogBox.dialogW, args, n ) ;
- callbacks[0].callback = NULL ;
-
- /* Allow the user to short-circuit the stupid Dialog widget. */
-
- XtInstallAccelerators ( dialogBox.textW, dialogBox.confComW );
- XtRealizeWidget ( dialogBox.shellW ) ;
- }
-
-
- /*
- *----------------------------------------------------------------------
- *
- * BuildDirBox --
- *
- * Make the widget-conglomerate that will display one dir's
- * information.
- *
- * Results:
- * The id of the applicationShellWidget that holds everything.
- *
- * Side effects:
- * Lots.
- *
- * Arguments:
- * dirPtr - DirTree that holds this dir box's info.
- *
- *----------------------------------------------------------------------
- */
-
- Widget
- BuildDirBox( DirTree *dirPtr )
- {
- char errLine[ ERRLINE_LEN ] ;
- char *pLocName = "BuildDirBox()" ;
-
- int n ;
- Arg args[ 10 ] ;
- XtCallbackRec callbacks[ 5 ] = { {NULL,NULL}, {NULL,NULL} } ;
-
-
- #ifdef DEBUG
- fprintf( pErrFp, "\n%s:\n", pLocName );
- #endif
-
- /* Make a pop up shell to hold the mess. */
-
- dirPtr->shellW = XtCreatePopupShell ( StrSave( dirPtr->fullName ),
- applicationShellWidgetClass, topLevelW, NULL, 0 ) ;
-
- /* Make the Frame widget that will hold everyone. */
-
- dirPtr->frameW = XtCreateManagedWidget ( "form", formWidgetClass,
- dirPtr->shellW, NULL, 0 ) ;
-
- /* Make the Label for the top. */
-
- n = 0 ;
- XtSetArg( args[n], XtNlabel, dirPtr->fullName ) ; ++n ;
- dirPtr->labelW = XtCreateManagedWidget ( "label", labelWidgetClass,
- dirPtr->frameW, args, n ) ;
-
- /* Make the Set to put in the middle. First get the
- * set of stuff to put in it.
- */
-
- if ( ( dirPtr->setPtr = BuildSetData( dirPtr ) ) == NULL )
- FatalError ( pLocName, "Null BuildSetData()" ) ;
-
- callbacks[0].callback = OpenDirDown ;
- n = 0 ;
- #ifdef NOAPPDEFAULTS
- XtSetArg( args[n], XtNdefaultColumns, 5 ) ; ++n ;
- XtSetArg( args[n], XtNcolumnSpacing, 20 ) ; ++n ;
- XtSetArg( args[n], XtNfromVert, dirPtr->labelW ) ; ++n ;
- #endif
- XtSetArg( args[n], XtNset, dirPtr->setPtr ) ; ++n ;
- XtSetArg( args[n], XtNnumberStrings, dirPtr->fileCnt ) ; ++n ;
- XtSetArg( args[n], XtNcallbackB, callbacks ) ; ++n ;
- dirPtr->setW = XtCreateManagedWidget ( "set", setWidgetClass,
- dirPtr->frameW, args, n ) ;
- callbacks[0].callback = NULL ;
-
- /* Make the Up button on the far left. */
-
- callbacks[0].callback = UpButtonPushed ;
- n = 0 ;
- #ifdef NOAPPDEFAULTS
- XtSetArg( args[n], XtNlabel, "Up" ) ; ++n ;
- XtSetArg( args[n], XtNfromVert, dirPtr->setW ) ; ++n ;
- XtSetArg( args[n], XtNleft, XtChainLeft ) ; ++n ;
- XtSetArg( args[n], XtNright, XtChainLeft ) ; ++n ;
- #endif
- XtSetArg( args[n], XtNcallback, callbacks ) ; ++n ;
- dirPtr->upComW = XtCreateManagedWidget ( "up", commandWidgetClass,
- dirPtr->frameW, args, n ) ;
- callbacks[0].callback = NULL ;
-
- /* Put the Quit button in the middle. */
-
- callbacks[0].callback = QuitButtonPushed ;
- n = 0 ;
- #ifdef NOAPPDEFAULTS
- XtSetArg( args[n], XtNlabel, "Quit" ) ; ++n ;
- XtSetArg( args[n], XtNfromVert, dirPtr->setW ) ; ++n ;
- XtSetArg( args[n], XtNfromHoriz, dirPtr->upComW ) ; ++n ;
- XtSetArg( args[n], XtNleft, XtChainLeft ) ; ++n ;
- XtSetArg( args[n], XtNright, XtChainRight ) ; ++n ;
- #endif
- XtSetArg( args[n], XtNcallback, callbacks ) ; ++n ;
- dirPtr->quitComW = XtCreateManagedWidget ( "quit", commandWidgetClass,
- dirPtr->frameW, args, n ) ;
- callbacks[0].callback = NULL ;
-
- /* Put the Done button in the middle too. */
-
- callbacks[0].callback = DoneButtonPushed ;
- n = 0 ;
- #ifdef NOAPPDEFAULTS
- XtSetArg( args[n], XtNlabel, "Done" ) ; ++n ;
- XtSetArg( args[n], XtNfromVert, dirPtr->setW ) ; ++n ;
- XtSetArg( args[n], XtNfromHoriz, dirPtr->quitComW ) ; ++n ;
- XtSetArg( args[n], XtNleft, XtChainLeft ) ; ++n ;
- XtSetArg( args[n], XtNright, XtChainRight ) ; ++n ;
- #endif
- XtSetArg( args[n], XtNcallback, callbacks ) ; ++n ;
- dirPtr->doneComW = XtCreateManagedWidget ( "done", commandWidgetClass,
- dirPtr->frameW, args, n ) ;
- callbacks[0].callback = NULL ;
-
- /* Put the fileName button to the right. */
-
- callbacks[0].callback = EnterFileName ;
- n = 0 ;
- #ifdef NOAPPDEFAULTS
- XtSetArg( args[n], XtNlabel, "Enter Filename" ) ; ++n ;
- XtSetArg( args[n], XtNfromVert, dirPtr->setW ) ; ++n ;
- XtSetArg( args[n], XtNfromHoriz, dirPtr->doneComW ) ; ++n ;
- XtSetArg( args[n], XtNleft, XtChainRight ) ; ++n ;
- XtSetArg( args[n], XtNright, XtChainRight ) ; ++n ;
- #endif
- XtSetArg( args[n], XtNcallback, callbacks ) ; ++n ;
- dirPtr->fileComW = XtCreateManagedWidget ( "dir_name", commandWidgetClass,
- dirPtr->frameW, args, n ) ;
- callbacks[0].callback = NULL ;
-
- XtPopup ( dirPtr->shellW, XtGrabNone ) ;
- dirPtr->isDisplayed = TRUE ;
-
- return( dirPtr->shellW ) ;
- }
-
-
- /*
- *----------------------------------------------------------------------
- *
- * BuildSetData --
- *
- * Given a pointer to a DirTree struct, use its files and
- * stat info to build and initialize the XtSetDataStruct
- * array used by the Set widget.
- *
- * Results:
- * A pointer to the newly created array of XtSetDataStruct *.
- *
- * Side effects:
- * Space is allocated, strings are copied into new space,
- * the entries of the XtSetDataStruct array are initialized.
- *
- * Arguments:
- * dirPtr - Pointer to the dir struct to do this for.
- *
- *----------------------------------------------------------------------
- */
-
- static XtSetDataStruct **
- BuildSetData( DirTree *dirPtr )
- {
- char errLine[ ERRLINE_LEN ] ;
- char *pLocName = "BuildSetData()" ;
-
- int i ;
- XtSetDataStruct **setPtr ;
- char s[ BUFSIZ ] ;
-
-
- #ifdef DEBUG
- fprintf( pErrFp, "\n%s: in <%s>\n",
- pLocName, dirPtr->name );
- #endif
-
- /* First make sure there are some files to do this for...
- * This could be kind of weird.
- */
-
- if ( dirPtr->fileCnt == 0 )
- return ( NULL ) ;
-
- /* Make the basic array of XtSetDataStruct pointers. */
-
- if ( ( setPtr = (XtSetDataStruct **)
- calloc ( dirPtr->fileCnt, sizeof (XtSetDataStruct *)) ) == NULL )
- FatalError( pLocName, "Out of Memory (calloc)" ) ;
-
- /* For each filename, build the XtSetDataStruct and make the
- * string to be displayed... for now assume that the -F stuff
- * is desired...
- */
-
- for ( i = 0 ; i < dirPtr->fileCnt ; ++i )
- {
- XtSetDataStruct *aPtr ;
-
- if ( ( aPtr = (XtSetDataStruct *)
- malloc (sizeof (XtSetDataStruct)) ) == NULL )
- FatalError( pLocName, "out of memory" ) ;
-
- strcpy ( s, dirPtr->files[ i ].file ) ;
- if ( (dirPtr->files[ i ].statMode & S_GFMT) == S_GFDIR )
- strcat ( s, "/" ) ;
- else if ( (dirPtr->files[ i ].statMode & S_GFMT) == S_GFLNK)
- strcat ( s, "@" ) ;
- else if ( (dirPtr->files[ i ].statMode & S_GFMT) == S_GFSOCK)
- strcat ( s, "=" ) ;
- else if ( dirPtr->files[ i ].statMode & S_IXUSR
- || dirPtr->files[ i ].statMode & S_IXGRP
- || dirPtr->files[ i ].statMode & S_IXOTH )
- strcat ( s, "*" ) ;
-
- aPtr->string = StrSave( s ) ;
- aPtr->is_lit = FALSE ;
-
- setPtr[ i ] = aPtr ;
-
- #ifdef DEBUG
- fprintf ( pErrFp, "\t\t%d: <%s>, is_lit=%d\n",
- i, setPtr[i]->string, setPtr[i]->is_lit ) ;
- #endif
-
- }
-
- return ( setPtr ) ;
- }
-
-
- /*
- *----------------------------------------------------------------------
- *
- * ConfirmButtonPushed --
- *
- * Callback for pressing the Confirm button on the
- * filename popup.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Opens a window for the input pathname, if possible.
- *
- * Arguments:
- * w - The calling widget's id.
- * client_data - Null, since no data passed to callback list.
- * call_data - Undefined by the Command widget.
- *
- *----------------------------------------------------------------------
- */
-
- static void
- ConfirmButtonPushed( Widget w, caddr_t client_data, caddr_t call_data )
- {
- char errLine[ ERRLINE_LEN ] ;
- char *pLocName = "PopupConfirm()" ;
-
- char *fileNamePtr ;
- DirTree *dtPtr ;
-
-
- #ifdef DEBUG
- fprintf ( pErrFp, "\n%s:\n", pLocName ) ;
- #endif
-
- /* Get the contents of the filename string. */
-
- if ( ( fileNamePtr
- = XtDialogGetValueString ( dialogBox.dialogW ))
- == NULL )
- InternalError ( pLocName,
- "Null string from XtDialogGetValueString" ) ;
-
- #ifdef DEBUG
- fprintf ( pErrFp, "\t<%s>\n", fileNamePtr ) ;
- #endif
-
- /* Have the directory tree expand as necessary. */
-
- if ( ( dtPtr = DirTree_Find ( fileNamePtr ) ) == NULL )
- return ;
-
- /* Arrange for this directory to be displayed. */
-
- if ( ! dtPtr->isDisplayed )
- BuildDirBox ( dtPtr ) ;
- }
-
-
- /*
- *----------------------------------------------------------------------
- *
- * DoneButtonPushed --
- *
- * The callback for the Done button. The stored-up
- * selections are all output, and the program terminates.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Output is done to the stdio, all X resources
- * are released, the program exits.
- *
- * Arguments:
- * w - The calling widget's id.
- * client_data - Null, since no data passed to callback list.
- * call_data - Undefined by the Command widget.
- *
- *----------------------------------------------------------------------
- */
-
- static void
- DoneButtonPushed( Widget w, caddr_t client_data, caddr_t call_data )
- {
- char errLine[ ERRLINE_LEN ] ;
- char *pLocName = "DoneButtonPushed()" ;
-
-
- #ifdef DEBUG
- fprintf( pErrFp, "\n%s:\n", pLocName );
- #endif
-
- /* Have the names dumped to the stdout. */
-
- DirTree_TreeTrav ( dirRootPtr, PostOrder, OutputFileNames, NULL ) ;
-
- /* We're done, close up shop. */
-
- XtDestroyApplicationContext ( appContext ) ;
- exit ( 0 ) ;
- }
-
-
- /*
- *----------------------------------------------------------------------
- *
- * EnterFileName --
- *
- * Called when the "Enter File Name" button is pushed on
- * the dirbox. Pops up the dialog widget. This is the
- * only place where the dialog widget is manipulated.
- *
- * Results:
- * None.
- *
- * Side effects:
- * The dialog widget is constructed and popped up.
- *
- * Arguments:
- * w - The calling widget's id.
- * client_data - Null, since no data passed to callback list.
- * call_data - Undefined by the Command widget.
- *
- *----------------------------------------------------------------------
- */
-
- static void
- EnterFileName( Widget w, caddr_t client_data, caddr_t call_data )
- {
- char errLine[ ERRLINE_LEN ] ;
- char *pLocName = "EnterFileName()" ;
-
- static int boxBuilt = FALSE ;
-
-
- #ifdef DEBUG
- fprintf ( pErrFp, "\n%s:\n", pLocName ) ;
- #endif
-
- if ( ! boxBuilt )
- {
- boxBuilt = TRUE ;
- BuildDialogBox() ;
- XtPopup ( dialogBox.shellW, XtGrabNone ) ;
- }
- }
-
-
- /*
- *----------------------------------------------------------------------
- *
- * OpenDirDown --
- *
- * A button has been pushed that is to be interpreted
- * as a request to open the selected item as a directory.
- * This routine makes an honest effort to do so.
- *
- * Results:
- * None.
- *
- * Side effects:
- * With any luck a popup is made to display the directory.
- *
- * Arguments:
- * w - The calling widget's id.
- * client_data - Null, since no data passed to callback list.
- * call_data - XtSetReturnStruct *.
- *
- *----------------------------------------------------------------------
- */
-
- static void
- OpenDirDown( Widget w, caddr_t client_data, caddr_t call_data )
- {
- char errLine[ ERRLINE_LEN ] ;
- char *pLocName = "OpenDirDown()" ;
-
- DirTree *dtPtr, *newDirPtr ;
- char path[ MAXPATHLEN ] ;
- int branchIdx ;
-
- XtSetReturnStruct *retPtr = (XtSetReturnStruct *) call_data ;
-
-
- /* First find the DirTree struct this happened in. */
-
- if ( ( dtPtr = DirTree_FindWidget ( dirRootPtr, SetW, w )) == NULL )
- InternalError ( pLocName, "Searching for the Set widget" ) ;
-
- #ifdef DEBUG
- fprintf ( pErrFp, "\n%s:\n", pLocName ) ;
- fprintf ( pErrFp, "\tstring=<%s>, index=%d\n",
- retPtr->string, retPtr->index ) ;
- #endif
-
- /* If it's not a subdirectory, just do nothing. */
-
- if ( ( newDirPtr = DirTree_AddBranch( dtPtr, retPtr->index )) == NULL )
- return ;
-
- /* If there's a relative path name for the directory we're
- * going down from, then construct one for the directory we're
- * going down to. This keeps all 'local' references local, and
- * will be used to generate the names at 'done' time.
- */
-
- #ifdef DEBUG
- fprintf ( pErrFp, "\trelName=0x%x\n", dtPtr->relName ) ;
- #endif
-
- if ( dtPtr->relName != NULL )
- {
- char path[ MAXPATHLEN + 1 ] ;
-
- strcpy ( path, dtPtr->relName ) ;
- strcat ( path, dtPtr->files[ retPtr->index ].file ) ;
- strcat ( path, "/" ) ;
- if ( newDirPtr->relName == NULL
- || ( newDirPtr->relName != NULL
- && strlen ( path ) < strlen ( newDirPtr->relName ) ) )
- newDirPtr->relName = StrSave( path ) ;
- }
-
- /* If it isn't being displayed already, then make
- * it show up.
- */
-
- if ( ! newDirPtr->isDisplayed ) BuildDirBox ( newDirPtr ) ;
- }
-
-
- /*
- *----------------------------------------------------------------------
- *
- * OutputFileNames --
- *
- * Client routine of DirTree_TreeTrav(), this routine takes
- * a DirTree struct and outputs the names of the selected files
- * to stdout, with format depending on the availability of relName.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Output to stdio.
- *
- * Arguments:
- * dirTreePtr - DirTree struct to dump the contents of.
- * clientData - Anonymous data which will be ignored.
- *
- *----------------------------------------------------------------------
- */
-
- static void
- OutputFileNames( DirTree *dirTreePtr, void *clientData )
- {
- char errLine[ ERRLINE_LEN ] ;
- char *pLocName = "OutputFileNames()" ;
-
- XtSetDataStruct **setPtr = dirTreePtr->setPtr ;
-
- int i ;
-
-
- #ifdef DEBUG
- fprintf ( pErrFp, "\n%s: <%s>\n",
- pLocName, dirTreePtr->fullName ) ;
- #endif
-
- /* Don't bother messing around if there is nothing here. */
-
- if ( ! dirTreePtr->isDisplayed ) return ;
-
- #ifdef DEBUG
- fprintf ( pErrFp, "\tIs displayed\n" ) ;
- #endif
-
- for ( i = 0 ; i < dirTreePtr->fileCnt ; ++i )
- {
- char path [ MAXPATHLEN + 1 ] ;
-
- if ( setPtr[i]->is_lit )
- {
-
- #ifdef DEBUG
- fprintf ( pErrFp, "\t%d: set=<%s>, files=<%s>\n",
- i,
- setPtr[i]->string,
- dirTreePtr->files[i].file ) ;
- #endif
-
- if ( dirTreePtr->relName != NULL )
- strcpy ( path, dirTreePtr->relName ) ;
- else
- strcpy ( path, dirTreePtr->fullName ) ;
-
- strcat ( path, dirTreePtr->files[i].file ) ;
- strcat ( path, " " ) ;
- printf ( path ) ;
- }
- }
- }
-
-
- /*
- *----------------------------------------------------------------------
- *
- * QuitButtonPushed --
- *
- * The callback for pushing the Quit button.
- *
- * Results:
- * None.
- *
- * Side effects:
- * Blows out of the application abruptly.
- *
- * Arguments:
- * w - The calling widget's id.
- * client_data - Null, since no data passed to callback list.
- * call_data - Undefined by the Command widget.
- *
- *----------------------------------------------------------------------
- */
-
- static void
- QuitButtonPushed( Widget w, caddr_t client_data, caddr_t call_data )
- {
- char errLine[ ERRLINE_LEN ] ;
- char *pLocName = "QuitButtonPushed()" ;
-
-
- #ifdef DEBUG
- fprintf( pErrFp, "\n%s:\n", pLocName );
- #endif
-
- XtDestroyApplicationContext ( appContext ) ;
- exit ( 1 ) ;
- }
-
-
- /*
- *----------------------------------------------------------------------
- *
- * UpButtonPushed --
- *
- * The callback for pressing the Up button. A dir box
- * is opened on the ancestor of the directory in which
- * the button was pushed.
- *
- * Results:
- * None.
- *
- * Side effects:
- * If everthing goes well, the relative name of the
- * ancestor may be updated, and a dir box is constructed
- * and displayed.
- *
- * Arguments:
- * w - The calling widget's id.
- * client_data - Null, since no data passed to callback list.
- * call_data - Undefined by the Command widget.
- *
- *----------------------------------------------------------------------
- */
-
- static void
- UpButtonPushed( Widget w, caddr_t client_data, caddr_t call_data )
- {
- char errLine[ ERRLINE_LEN ] ;
- char *pLocName = "UpButtonPushed()" ;
-
- DirTree *dtPtr ;
-
- #ifdef DEBUG
- fprintf( pErrFp, "\n%s:\n", pLocName );
- #endif
-
- /* First find the DirTree struct this happened in. */
-
- if ( ( dtPtr = DirTree_FindWidget ( dirRootPtr, UpW, w )) == NULL )
- InternalError ( pLocName, "Searching for the Up widget" ) ;
-
- /* Don't bother hanging out if this is the top of the tree...
- * can't go up from here.
- */
-
- if ( dtPtr->rootPtr == NULL ) return ;
-
- /* If there's a relative path name for the directory we're
- * going up from, then construct one for the directory we're
- * going up to. This keeps all 'local' references local, and
- * will be used to generate the names at 'done' time.
- */
-
- #ifdef DEBUG
- fprintf ( pErrFp, "\trelName=0x%x\n", dtPtr->relName ) ;
- #endif
-
- if ( dtPtr->relName != NULL )
- {
- char path[ MAXPATHLEN + 1 ] ;
-
- strcpy ( path, dtPtr->relName ) ;
- strcat ( path, "../" ) ;
- if ( dtPtr->rootPtr->relName == NULL
- || ( dtPtr->rootPtr->relName != NULL
- && strlen ( path ) < strlen ( dtPtr->rootPtr->relName ) ) )
- dtPtr->rootPtr->relName = StrSave( path ) ;
- }
-
- /* Build and display a box for the root of this directory,
- * if it hasn't been done already.
- */
-
- if ( ! dtPtr->rootPtr->isDisplayed )
- BuildDirBox ( dtPtr->rootPtr ) ;
- }
-
-
-