Initial import of the CDE 2.1.30 sources from the Open Group.

This commit is contained in:
Peter Howkins
2012-03-10 18:21:40 +00:00
commit 83b6996daa
18978 changed files with 3945623 additions and 0 deletions

View File

@@ -0,0 +1,50 @@
/* $XConsortium: SearchPath.h /main/3 1996/08/21 15:47:25 drk $ */
// SearchPath.h
#ifndef SRH_PATH_HDR
#define SRH_PATH_HDR
#include <stdarg.h>
#include "dti_cc/CC_Slist.h"
#include "dti_cc/CC_String.h"
class SearchPath {
private:
CC_TPtrSlist<CC_String> *search_path_table;
CC_String *new_path;
public:
/* the search path order is significant because they are searched in that
* order
*/
/*
* Usage :: SearchPath *ptr = new SearchPath ( "dir1", "dir2", "dir3" );
* and later on when I invoked ptr->get_real_path( "file_name" );
* dir1, dir2 and dir3 will be searched in order to determine if file_name
* exists in any one of the directories.
*
* The first directory which contains "file_name" will be returned by
* get_real_path( "file_name" );
*
*/
SearchPath(const char *path, ... );
/*
* Usage: replace_file_scope checks if we are in a file that is outside the
* the build directory and the source directory, if so , it will
* get rid of that directory, and prepend the new one at the front
* of the search path table list. This is primarily tied to the
* the ESIS format for the display of current file name and line
* number.
*
*/
void replace_file_scope( const char *path );
char *get_real_path( const char *file_name );
~SearchPath() { if ( search_path_table ) delete search_path_table; }
};
#endif