| 274 | |
| 275 | |
| 276 | void import_module( LIST * module_names, module_t * target_module ) |
| 277 | { |
| 278 | PROFILE_ENTER( IMPORT_MODULE ); |
| 279 | |
| 280 | struct hash * h; |
| 281 | LISTITER iter; |
| 282 | LISTITER end; |
| 283 | |
| 284 | if ( !target_module->imported_modules ) |
| 285 | target_module->imported_modules = hashinit( sizeof( char * ), "imported" |
| 286 | ); |
| 287 | h = target_module->imported_modules; |
| 288 | |
| 289 | iter = list_begin( module_names ); |
| 290 | end = list_end( module_names ); |
| 291 | for ( ; iter != end; iter = list_next( iter ) ) |
| 292 | { |
| 293 | int found; |
| 294 | OBJECT * const s = list_item( iter ); |
| 295 | OBJECT * * const ss = (OBJECT * *)hash_insert( h, s, &found ); |
| 296 | if ( !found ) |
| 297 | *ss = object_copy( s ); |
| 298 | } |
| 299 | |
| 300 | PROFILE_EXIT( IMPORT_MODULE ); |
| 301 | } |
| 302 | |
| 303 | |
| 304 | static void add_module_name( void * r_, void * result_ ) |
no test coverage detected