MCPcopy Create free account
hub / github.com/boostorg/build / search

Function search

v2/engine/search.c:137–258  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

135 */
136
137OBJECT * search( OBJECT * target, timestamp * const time,
138 OBJECT * * another_target, int const file )
139{
140 PATHNAME f[ 1 ];
141 LIST * varlist;
142 string buf[ 1 ];
143 int found = 0;
144 OBJECT * boundname = 0;
145
146 if ( another_target )
147 *another_target = 0;
148
149 if ( !explicit_bindings )
150 explicit_bindings = hashinit( sizeof( BINDING ), "explicitly specified "
151 "locations" );
152
153 string_new( buf );
154
155 /* Parse the filename. */
156 path_parse( object_str( target ), f );
157
158 f->f_grist.ptr = 0;
159 f->f_grist.len = 0;
160
161 varlist = var_get( root_module(), constant_LOCATE );
162 if ( !list_empty( varlist ) )
163 {
164 OBJECT * key;
165 f->f_root.ptr = object_str( list_front( varlist ) );
166 f->f_root.len = strlen( object_str( list_front( varlist ) ) );
167
168 path_build( f, buf );
169
170 if ( DEBUG_SEARCH )
171 printf( "locate %s: %s\n", object_str( target ), buf->value );
172
173 key = object_new( buf->value );
174 timestamp_from_path( time, key );
175 object_free( key );
176 found = 1;
177 }
178 else if ( varlist = var_get( root_module(), constant_SEARCH ),
179 !list_empty( varlist ) )
180 {
181 LISTITER iter = list_begin( varlist );
182 LISTITER const end = list_end( varlist );
183 for ( ; iter != end; iter = list_next( iter ) )
184 {
185 BINDING * ba;
186 file_info_t * ff;
187 OBJECT * key;
188 OBJECT * test_path;
189
190 f->f_root.ptr = object_str( list_item( iter ) );
191 f->f_root.len = strlen( object_str( list_item( iter ) ) );
192
193 string_truncate( buf, 0 );
194 path_build( f, buf );

Callers 4

cache_nameFunction · 0.85
make1bindFunction · 0.85
make0Function · 0.85
function_runFunction · 0.85

Calls 15

hashinitFunction · 0.85
string_newFunction · 0.85
path_parseFunction · 0.85
object_strFunction · 0.85
var_getFunction · 0.85
root_moduleFunction · 0.85
path_buildFunction · 0.85
object_newFunction · 0.85
timestamp_from_pathFunction · 0.85
object_freeFunction · 0.85
list_beginFunction · 0.85
list_endFunction · 0.85

Tested by

no test coverage detected