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

Function var_get

src/engine/variable.cpp:166–264  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

164 */
165
166LIST * var_get( struct module_t * module, OBJECT * symbol )
167{
168 LIST * result = L0;
169#ifdef OPT_AT_FILES
170 /* Some "fixed" variables... */
171 if ( object_equal( symbol, constant_TMPDIR ) )
172 {
173 list_free( saved_var );
174 result = saved_var = list_new( object_new( path_tmpdir()->value ) );
175 }
176 else if ( object_equal( symbol, constant_TMPNAME ) )
177 {
178 list_free( saved_var );
179 result = saved_var = list_new( path_tmpnam() );
180 }
181 else if ( object_equal( symbol, constant_TMPFILE ) )
182 {
183 list_free( saved_var );
184 result = saved_var = list_new( path_tmpfile() );
185 }
186 else if ( object_equal( symbol, constant_STDOUT ) )
187 {
188 list_free( saved_var );
189 result = saved_var = list_new( object_copy( constant_STDOUT ) );
190 }
191 else if ( object_equal( symbol, constant_STDERR ) )
192 {
193 list_free( saved_var );
194 result = saved_var = list_new( object_copy( constant_STDERR ) );
195 }
196 else
197#endif
198 {
199 VARIABLE * v;
200 int n;
201
202 if ( ( n = module_get_fixed_var( module, symbol ) ) != -1 )
203 {
204 if ( DEBUG_VARGET )
205 var_dump( symbol, module->fixed_variables[ n ], "get" );
206 result = module->fixed_variables[ n ];
207 }
208 else if ( module->variables && ( v = (VARIABLE *)hash_find(
209 module->variables, symbol ) ) )
210 {
211 if ( DEBUG_VARGET )
212 var_dump( v->symbol, v->value, "get" );
213 result = v->value;
214 }
215
216#ifdef OS_VMS
217 else if ( ( module->name && object_equal( module->name, constant_ENVIRON ) )
218 || root_module() == module )
219 {
220 /* On VMS, when a variable from root or ENVIRON module is not found,
221 * explicitly request it from the process.
222 * By design, process variables (and logicals) are not made available
223 * to C main(), and thus will not get loaded in bulk to root/ENVRON.

Callers 15

headersFunction · 0.85
call_timing_ruleFunction · 0.85
call_action_ruleFunction · 0.85
make1cmdsFunction · 0.85
make1settingsFunction · 0.85
variableClass · 0.85
bjam_variableFunction · 0.85
make0Function · 0.85
mainFunction · 0.85
function_get_variableFunction · 0.85

Calls 15

object_equalFunction · 0.85
list_freeFunction · 0.85
list_newFunction · 0.85
object_newFunction · 0.85
path_tmpdirFunction · 0.85
path_tmpnamFunction · 0.85
path_tmpfileFunction · 0.85
object_copyFunction · 0.85
module_get_fixed_varFunction · 0.85
var_dumpFunction · 0.85
hash_findFunction · 0.85
root_moduleFunction · 0.85

Tested by

no test coverage detected