/* * Copyright 1993, 1995 Christopher Seiwald. * * This file is part of Jam - see jam.c for Copyright information. */ #include "Search.hpp" #include "FileSystem.hpp" #include "String.hpp" #include "Timestamp.hpp" #include "Variable.hpp" using Jam::List; using Jam::String; /* * search.c - find a target along $(SEARCH) or $(LOCATE) */ char * search( const char *target, time_t *time ) { FILENAME f[1]; List *varlist; char buf[ MAXJPATH ]; /* Parse the filename */ file_parse( target, f ); f->f_grist.ptr = 0; f->f_grist.len = 0; if( varlist = var_get( "LOCATE" ) ) { f->f_root.ptr = varlist->string; f->f_root.len = strlen( varlist->string ); file_build( f, buf, 1 ); if( DEBUG_SEARCH ) printf( "locate %s: %s\n", target, buf ); timestamp( buf, time ); return String::newstr( buf ); } else if( varlist = var_get( "SEARCH" ) ) { while( varlist ) { f->f_root.ptr = varlist->string; f->f_root.len = strlen( varlist->string ); file_build( f, buf, 1 ); if( DEBUG_SEARCH ) printf( "search %s: %s\n", target, buf ); timestamp( buf, time ); if( *time ) { return String::newstr( buf ); } varlist = List::list_next( varlist ); } } /* Look for the obvious */ /* This is a questionable move. Should we look in the */ /* obvious place if SEARCH is set? */ f->f_root.ptr = 0; f->f_root.len = 0; file_build( f, buf, 1 ); if( DEBUG_SEARCH ) printf( "search %s: %s\n", target, buf ); timestamp( buf, time ); return String::newstr( buf ); }
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#6 | 1162 | bob_summerwill | Converted LIST into a List class, with all static methods. | ||
#5 | 1153 | bob_summerwill | NewStr has been renamed as String. | ||
#4 | 1146 | bob_summerwill | Moved the NewStr global functions into a static class Jam::String. | ||
#3 | 1138 | bob_summerwill | Removed all extern "C" wrappers, so the program now has C++ linkage throughout, ready for refactoring. | ||
#2 | 1134 | bob_summerwill | Renamed the file system source files. | ||
#1 | 1132 | bob_summerwill | All of the non-generated, non-platform-specific files are now mixed-case C++ source files. | ||
//guest/bob_summerwill/jam/src/search.c | |||||
#4 | 1130 | bob_summerwill | More .C to .CPP conversions. | ||
#3 | 1126 | bob_summerwill | #include dependencies between headers are now modelled explicitly, with #includes as required in header files, rather than it being a client-code responsibility. | ||
#2 | 1120 | bob_summerwill | A fair-size chunk of char* const-correctness modifications. | ||
#1 | 1106 | bob_summerwill | Integrated Jam from "public" to "guest/bob_summerwill". | ||
//guest/perforce_software/jam/src/search.c | |||||
#2 | 486 | Perforce staff |
Jam 2.3. See RELNOTES for a list of changes from 2.2.x. Just about every source file was touched when jam got ANSI-fied. |
||
#1 | 2 | laura | Add Jam/MR 2.2 source |