const char *GetCurTarg( void ) /***********************************/ { struct exStack cur; cur = exGetCurVars(); if( cur.targ == NULL ) { return( NULL ); } return( cur.targ->node.name ); }
const char *GetFirstDep( void ) /************************************/ { struct exStack cur; cur = exGetCurVars(); if( cur.impDep != NULL ) { cur.dep = cur.impDep; } if( cur.dep != NULL && cur.dep->targs != NULL ) { return( cur.dep->targs->target->node.name ); } return( NULL ); }
char *GetCurDeps( BOOLEAN younger, BOOLEAN isMacInf ) /**********************************************************/ { TLIST *walk; VECSTR vec; BOOLEAN written; TARGET *targ; struct exStack cur; const char *formattedString; char *ret; cur = exGetCurVars(); // This is for Glob.microsoft and Glob.posix // $< and $** are different if( isMacInf ) { cur.dep = cur.impDep; } else { if( cur.dep == NULL ) { cur.dep = cur.impDep; } } if( (younger && cur.targ == NULL) || cur.dep == NULL || cur.dep->targs == NULL ) { return( StrDupSafe( "" ) ); } vec = StartVec(); written = FALSE; walk = cur.dep->targs; while( walk != NULL ) { targ = walk->target; if( !younger || dateCmp( cur.targ->date, targ->date ) < 0 ) { if( written ) { WriteVec( vec, " " ); } formattedString = procPath( targ->node.name ); WriteVec( vec, formattedString ); written = TRUE; } walk = walk->next; } ret = FinishVec( vec ); return( ret ); }
char *GetCurDeps( bool younger, bool isMacInf ) /*********************************************/ { TLIST *tlist; VECSTR vec; bool written; TARGET *targ; struct exStack cur; const char *formattedString; char *ret; cur = exGetCurVars(); // This is for Glob.compat_nmake and Glob.compat_posix // $< and $** are different if( isMacInf ) { cur.dep = cur.impDep; } else { if( cur.dep == NULL ) { cur.dep = cur.impDep; } } if( (younger && cur.targ == NULL) || cur.dep == NULL || cur.dep->targs == NULL ) { return( StrDupSafe( "" ) ); } vec = StartVec(); written = false; for( tlist = cur.dep->targs; tlist != NULL; tlist = tlist->next ) { targ = tlist->target; if( !younger || dateCmp( cur.targ->date, targ->date ) < 0 ) { if( written ) { WriteVec( vec, " " ); } formattedString = procPath( targ->node.name ); WriteVec( vec, formattedString ); written = true; } } ret = FinishVec( vec ); return( ret ); }
const char *GetLastDep( void ) /***********************************/ { struct exStack cur; TLIST *tlist; cur = exGetCurVars(); if( cur.impDep != NULL ) { cur.dep = cur.impDep; } if( cur.dep != NULL && cur.dep->targs != NULL ) { tlist = cur.dep->targs; while( tlist->next != NULL ) { tlist = tlist->next; } return( tlist->target->node.name ); } return( NULL ); }