2 #define DEPENDS_COMMANDS " depends commands" 8 dbg_cmd_source(
char *psz_filename)
10 if (psz_filename && *psz_filename) {
12 char *psz_expanded_file;
15 glob(psz_filename, 0, NULL, &p);
16 if (0 == p.gl_pathc) {
18 int ret = stat(psz_filename, &stat_buf);
23 psz_expanded_file = psz_filename;
24 }
else if (1 != p.gl_pathc) {
25 dbg_errmsg(
"Expansion of %s doesn't lead to a single filename. \n" 27 psz_filename, (
size_t)p.gl_pathv);
31 psz_expanded_file = p.gl_pathv[0];
34 p_source_file = fopen(psz_expanded_file,
"r");
36 if (p_source_file != NULL) {
42 char *shut_up_gcc_warning = fgets(line, 2048, p_source_file);
43 if (feof(p_source_file))
break;
44 chomp(shut_up_gcc_warning);
47 fclose(p_source_file);
49 dbg_errmsg(
"error reading file %s (expanded to %s):\n\t%s",
50 psz_filename, psz_expanded_file, strerror(
errno));
61 dbg_cmd_source_init(
unsigned int c)
63 short_command[c].func = &dbg_cmd_source;
64 short_command[c].use =
_(
"source *file-glob*");
debug_return_t execute_line(char *psz_line)
char * stripwhite(char *string)
debug_return_t
Definition: trace.h:32
#define _(msgid)
Definition: make.h:293