#include "compile.h"
#include "constants.h"
#include "cwd.h"
+#include "debugger.h"
#include "filesys.h"
#include "frames.h"
#include "hash.h"
char const * args [] = { "path", 0 };
bind_builtin( "MAKEDIR", builtin_makedir, 0, args );
}
-
+
{
const char * args [] = { "path", 0 };
bind_builtin( "READLINK", builtin_readlink, 0, args );
}
+
{
char const * args[] = { "archives", "*",
":", "member-patterns", "*",
bind_builtin( "GLOB_ARCHIVE", builtin_glob_archive, 0, args );
}
+#ifdef JAM_DEBUGGER
+
+ {
+ const char * args[] = { "list", "*", 0 };
+ bind_builtin("__DEBUG_PRINT_HELPER__", builtin_debug_print_helper, 0, args);
+ }
+
+#endif
+
/* Initialize builtin modules. */
init_set();
init_path();
bufsize *= 2;
buf = BJAM_MALLOC( bufsize );
}
-
+
if ( buf != static_buf )
BJAM_FREE( buf );
#endif
}
+#ifdef JAM_DEBUGGER
+
+LIST *builtin_debug_print_helper( FRAME * frame, int flags )
+{
+ debug_print_result = list_copy( lol_get( frame->args, 0 ) );
+ return L0;
+}
+
+#endif
#ifdef HAVE_PYTHON
#endif /* defined(_MSC_VER) || defined(__BORLANDC__) */
-static char * rtrim( char * const s )
-{
- char * p = s;
- while ( *p ) ++p;
- for ( --p; p >= s && isspace( *p ); *p-- = 0 );
- return s;
-}
-
-
LIST * builtin_shell( FRAME * frame, int flags )
{
LIST * command = lol_get( frame->args, 0 );
buffer[ ret ] = 0;
if ( !no_output_opt )
{
- if ( strip_eol_opt )
- rtrim( buffer );
string_append( &s, buffer );
}
if ( feof( p ) ) break;
}
+ if ( strip_eol_opt )
+ string_rtrim( &s );
+
exit_status = pclose( p );
/* The command output is returned first. */