| 1 | /* |
| 2 | Copyright (C) 2004, 2005 Free Software Foundation, Inc. |
| 3 | Copyright (C) 2008, 2020 R. Bernstein <[email protected]> |
| 4 | |
| 5 | This file is part of GNU Make. |
| 6 | |
| 7 | GNU Make is free software; you can redistribute it and/or modify |
| 8 | it under the terms of the GNU General Public License as published by |
| 9 | the Free Software Foundation; either version 2, or (at your option) |
| 10 | any later version. |
| 11 | |
| 12 | GNU Make is distributed in the hope that it will be useful, |
| 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 15 | GNU General Public License for more details. |
| 16 | |
| 17 | You should have received a copy of the GNU General Public License |
| 18 | along with GNU Make; see the file COPYING. If not, write to |
| 19 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
| 20 | Boston, MA 02111-1307, USA. */ |
| 21 | |
| 22 | /** \file src/print.h |
| 23 | * |
| 24 | * \brief Header for src/print.h - output or logging functions |
| 25 | */ |
| 26 | |
| 27 | |
| 28 | #ifndef PRINT_H |
| 29 | #define PRINT_H |
| 30 | |
| 31 | #include "variable.h" |
| 32 | #include "job.h" |
| 33 | #include "trace.h" |
| 34 | |
| 35 | /*! Versions of error and fatal with the ability to show call-stack. */ |
| 36 | void err_with_stack (target_stack_node_t *p_call, const char *fmt, ...) |
| 37 | __attribute__ ((__format__ (__printf__, 2, 3))); |
| 38 | void fatal_err (target_stack_node_t *p_call, const char *fmt, ...); |
| 39 | |
| 40 | /* Think of the below not as an enumeration but as #defines done in a |
| 41 | way that we'll be able to use the value in a gdb. */ |
| 42 | extern enum debug_print_enums_e { |
| 43 | MAX_STACK_SHOW = 1000, |
| 44 | } debug_print_enums1; |
| 45 | |
| 46 | /*! Under -d, write a message describing the current IDs. */ |
| 47 | extern void log_access (char *flavor); |
| 48 | |
| 49 | /*! Write a message indicating that we've just entered or |
| 50 | left (according to ENTERING) the current directory. */ |
| 51 | extern void log_working_directory (int); |
| 52 | |
| 53 | /*! Print an error message from errno. */ |
| 54 | extern void perror_with_name (const char *, const char *); |
| 55 | |
| 56 | /*! Print an error message from errno and exit. */ |
| 57 | extern void pfatal_with_name_err (const char *psz_name, int errnum); |
| 58 | |
| 59 | /*! Print an error message from errno and exit. */ |
| 60 | extern void pfatal_with_name (const char *psz_name); |
| 61 | |
| 62 | /*! Display a variable and its value. */ |
| 63 | extern void print_variable (variable_t *p_v); |
| 64 | |
| 65 | /*! Display a variable and its value with all substitutions included. */ |
| 66 | extern void print_variable_expand (variable_t *p_v); |
| 67 | |
| 68 | /*! Display common file target prefix message output file target. */ |
| 69 | extern void print_file_target_prefix (const file_t *p_target); |
| 70 | |
| 71 | /*! Display common target prefix message. */ |
| 72 | extern void print_target_prefix (const char *p_name); |
| 73 | |
| 74 | /*! Display common prefix message output file target. */ |
| 75 | extern void print_floc_prefix (const gmk_floc *p_floc); |
| 76 | |
| 77 | /*! Display common prefix message output file target. */ |
| 78 | extern debug_return_t print_child_cmd (child_t *p_child, |
| 79 | target_stack_node_t *p); |
| 80 | |
| 81 | extern void print_target_stack_entry(const file_t *p_target, int i, int i_pos); |
| 82 | |
| 83 | /*! Display the target stack i_pos is the position we are currently. |
| 84 | i_max is the maximum number of entries to show. |
| 85 | */ |
| 86 | extern void print_target_stack (target_stack_node_t *p, int i_pos, int i_max); |
| 87 | |
| 88 | /*! Display the Makefile read stack. i_pos is the position we are currently. |
| 89 | i_max is the maximum number of entries to show. */ |
| 90 | extern void print_floc_stack (int i_pos, int i_max); |
| 91 | |
| 92 | /*! Print the list makefiles read by read_makefiles(). */ |
| 93 | extern bool print_read_makefiles(const char *psz_filename); |
| 94 | |
| 95 | /*! Print the command line used to invode this program */ |
| 96 | extern void print_cmdline (void); |
| 97 | |
| 98 | #endif /*PRINT_H*/ |