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

Function builtin_glob

src/engine/builtins.cpp:772–803  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

770
771
772LIST * builtin_glob( FRAME * frame, int flags )
773{
774 LIST * const l = lol_get( frame->args, 0 );
775 LIST * const r = lol_get( frame->args, 1 );
776
777 LISTITER iter;
778 LISTITER end;
779 struct globbing globbing;
780
781 globbing.results = L0;
782 globbing.patterns = r;
783
784 globbing.case_insensitive =
785# if defined( OS_NT ) || defined( OS_CYGWIN ) || defined( OS_VMS )
786 l; /* Always case-insensitive if any files can be found. */
787# else
788 lol_get( frame->args, 2 );
789# endif
790
791 if ( globbing.case_insensitive )
792 globbing.patterns = downcase_list( r );
793
794 iter = list_begin( l );
795 end = list_end( l );
796 for ( ; iter != end; iter = list_next( iter ) )
797 file_dirscan( list_item( iter ), builtin_glob_back, &globbing );
798
799 if ( globbing.case_insensitive )
800 list_free( globbing.patterns );
801
802 return globbing.results;
803}
804
805
806static int has_wildcards( char const * const str )

Callers 1

globFunction · 0.85

Calls 6

lol_getFunction · 0.85
downcase_listFunction · 0.85
list_beginFunction · 0.85
list_endFunction · 0.85
file_dirscanFunction · 0.85
list_freeFunction · 0.85

Tested by

no test coverage detected