/* * PushDirectory */ void PushDirectory( char *orig ) { orig = orig; oldPath[0] = 0; GetCWD2( oldPath, FILENAME_MAX ); } /* PushDirectory */
/* * PushDirectory */ void PushDirectory( const char *orig ) { oldPath[0] = '\0'; GetCWD2( oldPath, sizeof( oldPath ) ); ChangeDirectory( orig ); } /* PushDirectory */
/* * PushDirectory - save the current directory */ void PushDirectory( char *orig ) { orig = orig; oldPath[0] = 0; GetCWD2( oldPath, _MAX_PATH ); } /* PushDirectory */
/* * PushDirectory */ void PushDirectory( char *orig ) { unsigned c; oldPath[0] = 0; _dos_getdrive( &c ); oldDrive = (char) c; if( orig[1] == ':' ) { ChangeDrive( orig[0] ); } GetCWD2( oldPath, _MAX_PATH ); } /* PushDirectory */
/* * PushDirectory - save the current directory */ void PushDirectory( char *orig ) { STUPID_UINT c; unsigned long map; oldPath[0] = 0; DosQCurDisk( &c, &map ); oldDisk = (char) c; if( orig[1] == ':' ) { ChangeDrive( orig[0] ); } GetCWD2( oldPath, sizeof( oldPath ) ); } /* PushDirectory */
/* * FileSPVAR - build file special variables */ void FileSPVAR( void ) { char path[FILENAME_MAX]; char drive[_MAX_DRIVE], dir[_MAX_DIR], fname[_MAX_FNAME], ext[_MAX_EXT]; int i; /* * build path */ if( CurrentFile == NULL ) { VarAddGlobalStr( "F", "" ); VarAddGlobalStr( "H", "" ); drive[0] = dir[0] = fname[0] = ext[0] = 0; } else { VarAddGlobalStr( "F", CurrentFile->name ); VarAddGlobalStr( "H", CurrentFile->home ); ConditionalChangeDirectory( CurrentFile->home ); _splitpath( CurrentFile->name, drive, dir, fname, ext ); } VarAddGlobalStr( "P1", dir ); VarAddGlobalStr( "D1", drive ); strcpy( path, drive ); strcat( path, dir ); i = strlen( path ) - 1; if( path[i] == FILE_SEP && i > 0 ) { path[i] = 0; } if( CurrentFile != NULL ) { PushDirectory( path ); ChangeDirectory( path ); GetCWD2( path, FILENAME_MAX ); PopDirectory(); } else { path[0] = 0; } if( path[strlen(path) - 1] == FILE_SEP ) { StrMerge( 2, path, fname, ext ); } else { StrMerge( 3, path,FILE_SEP_STR, fname, ext ); } _splitpath( path, drive, dir, fname, ext ); VarAddGlobalStr( "D", drive ); VarAddGlobalStr( "P", dir ); VarAddGlobalStr( "N", fname ); VarAddGlobalStr( "E", ext ); } /* FileSPVAR */
/* * SearchForTags - search up the directory tree to see if there are any * tagfiles kicking around */ FILE *SearchForTags( void ) { char path[FILENAME_MAX]; char *eop; if( CurrentFile && CurrentFile->name ) { _fullpath(path, CurrentFile->name, FILENAME_MAX); /* * Remove trailing filename. */ eop = strrchr(path, '\\'); if (eop) { *eop = 0x00; } } else { GetCWD2( path, FILENAME_MAX ); } eop = &path[strlen( path ) - 1]; while( eop >= path ) { strcpy( eop + 1, TAGFILE ); if( !access( path, F_OK ) ) { return fopen( path, "r" ); } while( eop >= path && *eop != '\\' ) { --eop; } if( eop >= path ) { *eop-- = 0x00; } } /* while */ return( NULL ); } /* SearchForTags() */