/* * Copyright 1993-2002 Christopher Seiwald and Perforce Software, Inc. * * This file is part of Jam - see jam.c for Copyright information. */ /* * search.c - find a target along $(SEARCH) or $(LOCATE) * * 11/04/02 (seiwald) - const-ing for string literals */ # include "jam.h" # include "lists.h" # include "search.h" # include "timestamp.h" # include "pathsys.h" # include "variable.h" # include "newstr.h" const char * search( const char *target, time_t *time ) { PATHNAME f[1]; LIST *varlist; char buf[ MAXJPATH ]; /* Parse the filename */ path_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 ); path_build( f, buf, 1 ); if( DEBUG_SEARCH ) printf( "locate %s: %s\n", target, buf ); timestamp( buf, time ); return newstr( buf ); } else if( varlist = var_get( "SEARCH" ) ) { while( varlist ) { f->f_root.ptr = varlist->string; f->f_root.len = strlen( varlist->string ); path_build( f, buf, 1 ); if( DEBUG_SEARCH ) printf( "search %s: %s\n", target, buf ); timestamp( buf, time ); if( *time ) return newstr( buf ); varlist = 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; path_build( f, buf, 1 ); if( DEBUG_SEARCH ) printf( "search %s: %s\n", target, buf ); timestamp( buf, time ); return newstr( buf ); }
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#1 | 4381 | Lawrence You | Branch files for jam at change #3108 to prepare for a fix. | ||
//guest/perforce_software/jam/src/search.c | |||||
#5 | 2493 | rmg |
Rewrite the past: update all jam's source with comments to reflect changes since about 2.3, very early 2001. Whitespace only change. === computer:1666: Change 37660 by seiwald@play-seiwald on 2002/11/06 22:41:35 Note: I regenerated jamgram.c on my linux 7.3 system prior to the submit, since patch was so unhappy trying to lay down the changes from Christopher's change. Presumably this is just due to different yacc/bison/whatever particulars on the system where Christopher made the changes originally. - rmg |
||
#4 | 2491 | rmg |
Some consting in jam to make it more compilable by C++ compilers. No functional change. === computer:1666: Change 37433 by perforce@perforce on 2002/10/30 16:08:51 Recreational const-ing of jam, for compilers that don't allow "string" to be passed as a non-const char *. This included a few places where we were modifying what could possibly have been read-only storage, oddly enough. No functional change. === computer:1666: Change 37602 by seiwald@play-seiwald on 2002/11/04 17:25:40 |
||
#3 | 1319 | rmg |
Jam 2.3 + Perforce's internal changes. This change is a drop of the Perforce internal Jam changes since the 2.3 public release. The individual changes represented herein are preserved in the //guest/richard_geiger/intjam/ branch. The intent of this drop is to provide a base, from which other contributors' Jam branches may be integrated into. It is not intended to become a packaged release in this state. We will be integrating changes from other users prior to creating the next packaged release. Please refer to the src/RELNOTES file for an overview of the changes present in this integration. - Richard Geiger Open Source Engineer at Perforce |
||
#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 |