PIPS
message.c File Reference
#include <stdlib.h>
#include <stdio.h>
#include <stdarg.h>
#include <ctype.h>
#include "genC.h"
#include "misc.h"
#include "linear.h"
#include <unistd.h>
+ Include dependency graph for message.c:

Go to the source code of this file.

Macros

#define LOG_FILE   "Logfile"
 
#define PIPS_THANKS_STRING(arch)
 The # "stringificator" only works in a macro expansion... More...
 
#define WARNING_FILE_NAME   "Warnings"
 USER_WARNING issues a warning and don't stop the program (cf. More...
 

Functions

bool properties_initialized_p (void)
 FC 2015-07-20: yuk, moved out to prevent an include cycle dependency include "properties.h". More...
 
bool get_bool_property (const string)
 FC 2015-07-20: yuk, moved out to prevent an include cycle dependency include "properties.h". More...
 
char * get_string_property (const char *)
 
int get_int_property (const string)
 
bool too_many_property_errors_pending_p (void)
 
void set_pips_current_computation (const char *rname, const char *oname)
 message.c More...
 
string get_pips_current_pass_name (void)
 Export this piece of information to customize warning functions in passes. More...
 
string get_pips_current_module (void)
 
void reset_pips_current_computation (void)
 
void set_pips_meta_informations (const char *revs, const char *date, const char *comp)
 
string default_user_request (const char *fmt, va_list *args)
 USER_REQUEST is a function that should be called to request some data from the user. More...
 
void close_log_file (void)
 
void open_log_file (const string dir)
 
void log_on_file (const char *desc)
 
static void pips_user_log_alist (const char *format, va_list *args)
 
void pips_user_log_func (const char *format,...)
 
void user_log (const char *format,...)
 
void pips_thanks (string name, string path)
 display pips thanks on startup, if it on a tty. More...
 
void open_warning_file (const char *dir)
 
void close_warning_file (void)
 
void append_to_warning_file (const char *calling_function_name, const char *format, va_list *args)
 To be used in error handling functions. More...
 
void pips_user_warning_alist (const char *function_name, const char *funcfile, const int funcline, const char *format, va_list *args)
 
void pips_user_warning_func (const char *calling_function_name, const char *funcfile, const int funcline, const char *format,...)
 
void pips_user_warning_func2 (const char *format,...)
 fallback version without a calling function name More...
 
static void _NORETURN_ pips_internal_error_alist (const char *funcname, const char *funcfile, const int funcline, const char *format, va_list *args)
 
void _NORETURN_ pips_internal_error_func (const char *funcname, const char *funcfile, const int funcline, const char *fmt,...)
 
void _NORETURN_ pips_internal_error_func2 (const char *format,...)
 
static void _NORETURN_ pips_user_error_alist (const char *calling_function_name, const char *funcfile, const int funcline, const char *format, va_list *args)
 
void _NORETURN_ pips_user_error_func (const char *func_name, const char *funcfile, const int funcline, const char *format,...)
 
void _NORETURN_ pips_user_error_func2 (const char *format,...)
 
void _NORETURN_ pips_user_irrecoverable_error_alist (const char *func_name, const char *funcfile, const int funcline, const char *format, va_list *args)
 
void _NORETURN_ pips_user_irrecoverable_error_func (const char *func_name, const char *funcfile, const int funcline, const char *format,...)
 
void _NORETURN_ pips_user_irrecoverable_error_func2 (const char *format,...)
 
bool function_same_string_p (const char *s1, const char *s2)
 
static void append_xml_attribute (string_buffer sb, const string attribute, const string value)
 generate xml: attribute="escaped-stuff" More...
 
void open_xml_logfile (const char *filename)
 
void close_xml_logfile (void)
 
static void append_xml_line_numbers (string_buffer sb, const string attribute, int val1, int val2)
 
static string pips_log_xml_tag (pips_log_t tag)
 
static void pips_log_xml_pips_level (string_buffer sb, const string pips_pass, const string pips_owner, const string pips_func, const string pips_file, const int pips_line)
 append pips-level stuff (function, file, line) to xml file More...
 
static void pips_log_xml (const pips_log_t tag, const string pips_pass, const string pips_owner, const string pips_func, const string pips_file, const int pips_line, const string user_func, const string user_file, const int user_line, const int user_line2, const string stmt, const string suggestion, const string description)
 add a full log entry to the xml log file More...
 
static string code2status (int code)
 
static void pips_stop_xml (pips_log_t tag, int code, const string pips_func, const string pips_file, const int pips_line, const string description)
 
static void pips_stop_file (FILE *out, pips_log_t tag, int code, const char *pips_func, const char *pips_file, const int pips_line, const string description)
 
static void _NORETURN_ pips_stop_desc (pips_log_t tag, int code, const string pips_func, const string pips_file, const int pips_line, const string desc)
 
static void _NORETURN_ pips_stop_alist (pips_log_t tag, int code, const string pips_func, const string pips_file, const int pips_line, const string format, va_list *args)
 
void _NORETURN_ pips_stop_func (const char *pips_func, const char *pips_file, const int pips_line, pips_log_t tag, int code, const string format,...)
 expecititely declare "noreturn" functions... More...
 
void _NORETURN_ pips_stop_func2 (pips_log_t tag, int code, const string format,...)
 
string pips_log_tag_name (pips_log_t tag)
 
static void pips_log_file (FILE *out, const pips_log_t tag, const string pips_pass, const string pips_owner, const string pips_func, const string pips_file, const int pips_line, const string user_func, const string user_file, const int user_line, const int user_line2, const string stmt, const string suggestion, const string description)
 
static void pips_log_display (const pips_log_t tag, const string pips_pass, const string pips_owner, const string pips_func, const string pips_file, const int pips_line, const string user_func, const string user_file, const int user_line, const int user_line2, const string stmt, const string suggestion, const string desc)
 manage "displaying" a log entry, on stderr, in files... More...
 
static void pips_log_in_progress (const char *pips_func, const char *pips_file, const int pips_line)
 
static void pips_log_done (void)
 
static void pips_log_end (pips_log_t tag)
 end of log entry (nothing, exception, abort, exit...) More...
 
void pips_log_desc (const pips_log_t tag, const string pips_pass, const string pips_owner, const string pips_func, const string pips_file, const int pips_line, const string user_func, const string user_file, const int user_line, const int user_line2, const string stmt, const string suggestion, const string description)
 log entry with preprocessed format/arguments More...
 
void pips_log_alist (const pips_log_t tag, const string pips_pass, const string pips_owner, const string pips_func, const string pips_file, const int pips_line, const string user_func, const string user_file, const int user_line, const int user_line2, const string stmt, const string suggestion, const string format, va_list *args)
 log entry with unprocessed format/alist arguments More...
 
void pips_log_func (const string pips_func, const string pips_file, const int pips_line, const pips_log_t tag, const string pips_pass, const string pips_owner, const string user_func, const string user_file, const int user_line, const int user_line2, const string stmt, const string suggestion, const string format,...)
 direct pips_log call with format and free arguments ("...") More...
 
void pips_log_stop (const char *function, const char *file, const int lineno, const pips_log_t tag, const int code, const string format,...)
 quick log and stop, called on timeout this must not invoke malloc as it may still held locks if interrupted this implementation is missing XML escapes... More...
 
int safe_vasprintf (char **strp, const char *fmt, va_list args)
 
int safe_asprintf (char **strp, const char *fmt,...)
 

Variables

static string current_phase = NULL
 CATCH/TRY/UNCATCH/THROW stuff is here. More...
 
static string current_module = NULL
 
static string pips_revisions = NULL
 
static string pips_date = NULL
 
static string pips_cc = NULL
 
string(* pips_request_handler )(const char *, va_list *)
 default assignment of pips_request_handler is default_user_request. More...
 
static FILE * log_file = NULL
 The log file is closed by default. More...
 
void(* pips_log_handler )(const char *fmt, va_list *args) = NULL
 USER_LOG is a function that should be called to log the current PIPS request, as soon as it is relevant. More...
 
static FILE * warning_file = NULL
 
static string warning_file_name = NULL
 
void(* pips_warning_handler )(const char *, const char *, va_list *) = NULL
 default assignment of pips_warning_handler is default_user_warning. More...
 
void(* pips_error_handler )(const char *, const char *, va_list *) = NULL
 PROMPT_USER schould be implemented. More...
 
void(* pips_internal_error_handler )(const char *, const char *,...) = NULL
 PIPS_ERROR is a function that should be called to terminate PIPS execution when data structures are corrupted. More...
 
static FILE * xml_logfile = NULL
 
static string xml_logfile_name = NULL
 
static int pips_log_recursion_count = 0
 

Macro Definition Documentation

◆ LOG_FILE

#define LOG_FILE   "Logfile"

Definition at line 155 of file message.c.

◆ PIPS_THANKS_STRING

#define PIPS_THANKS_STRING (   arch)
Value:
"%s (ARCH=" arch ")\n running as %s\n" \
"\n" \
" (c) 1989-2018 MINES ParisTech\n" \
" Centre de recherche en informatique.\n" \
"\n" \
" CRI URL: http://www.cri.mines-paristech.fr/\n" \
" PIPS URL: http://pips4u.org/\n" \
" EMAIL: pips-support at cri dot mines-paristech dot fr\n" \
"\n" \
" This software is provided as is, under the terms of the GPL.\n" \
" It includes and uses software from GNU (gnulib, readline),\n" \
" Berkeley (fsplit), INRIA, IRISA and others (polylib, janus)...\n" \
"\n"

The # "stringificator" only works in a macro expansion...

Definition at line 247 of file message.c.

◆ WARNING_FILE_NAME

#define WARNING_FILE_NAME   "Warnings"

USER_WARNING issues a warning and don't stop the program (cf.

user_error for infos.)

Definition at line 281 of file message.c.

Function Documentation

◆ append_to_warning_file()

void append_to_warning_file ( const char *  calling_function_name,
const char *  format,
va_list *  args 
)

To be used in error handling functions.

Parameters
calling_function_namealling_function_name
formatormat
argsrgs

Definition at line 306 of file message.c.

310 {
311  if (properties_initialized_p() && get_bool_property("NO_USER_WARNING"))
312  return;
313 
316  (const string) calling_function_name, NULL, -1,
317  NULL, NULL, -1, -1,
318  NULL, NULL, (const string) format, args);
319 }
void pips_log_alist(const pips_log_t tag, const string pips_pass, const string pips_owner, const string pips_func, const string pips_file, const int pips_line, const string user_func, const string user_file, const int user_line, const int user_line2, const string stmt, const string suggestion, const string format, va_list *args)
log entry with unprocessed format/alist arguments
Definition: message.c:1200
bool properties_initialized_p(void)
FC 2015-07-20: yuk, moved out to prevent an include cycle dependency include "properties....
string get_pips_current_pass_name(void)
Export this piece of information to customize warning functions in passes.
Definition: message.c:77
string get_pips_current_module(void)
Definition: message.c:82
bool get_bool_property(const string)
FC 2015-07-20: yuk, moved out to prevent an include cycle dependency include "properties....
@ warning_log
Definition: misc-local.h:34

References get_bool_property(), get_pips_current_module(), get_pips_current_pass_name(), pips_log_alist(), properties_initialized_p(), and warning_log.

+ Here is the call graph for this function:

◆ append_xml_attribute()

static void append_xml_attribute ( string_buffer  sb,
const string  attribute,
const string  value 
)
static

generate xml: attribute="escaped-stuff"

Definition at line 595 of file message.c.

599 {
600  string_buffer_append(sb, attribute);
601  string_buffer_append(sb, "=\"");
602  if (value && *value)
604  string_buffer_append(sb, "\" ");
605 }
void string_buffer_append(string_buffer, const string)
append string s (if non empty) to string buffer sb, the duplication is done if needed according to th...
void string_buffer_append_xml_text(string_buffer, const string, bool)
append a string with XML escapes
Definition: statement.c:4047

References string_buffer_append(), and string_buffer_append_xml_text().

Referenced by open_xml_logfile(), pips_log_xml(), pips_log_xml_pips_level(), and pips_stop_xml().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ append_xml_line_numbers()

static void append_xml_line_numbers ( string_buffer  sb,
const string  attribute,
int  val1,
int  val2 
)
static

Definition at line 641 of file message.c.

645 {
646  if (val1 > 0)
647  {
648  if (val1 < val2)
649  string_buffer_printf(sb, "%s=\"%d-%d\" ", attribute, val1, val2);
650  else
651  string_buffer_printf(sb, "%s=\"%d\" ", attribute, val1);
652  }
653  else
654  string_buffer_printf(sb, "%s=\"\" ", attribute);
655 }
void string_buffer_printf(string_buffer, const string,...)
append a formatted string to sb

References string_buffer_printf().

Referenced by pips_log_xml(), and pips_log_xml_pips_level().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ close_log_file()

void close_log_file ( void  )

Definition at line 162 of file message.c.

163 {
164  if (log_file != NULL && get_bool_property("USER_LOG_P") )
165  if (fclose(log_file) != 0)
166  pips_internal_error("Could not close log file");
167  log_file = NULL;
168 }
static FILE * log_file
The log file is closed by default.
Definition: message.c:159
#define pips_internal_error
Definition: misc-local.h:149

References get_bool_property(), log_file, and pips_internal_error.

Referenced by check_delete_workspace(), close_workspace(), create_workspace(), gpips_main(), open_log_file(), and wpips_main().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ close_warning_file()

void close_warning_file ( void  )

Definition at line 293 of file message.c.

294 {
295  if (warning_file)
296  {
298 
299  warning_file = (FILE*) NULL;
301  warning_file_name = (string) NULL;
302  }
303 }
static FILE * warning_file
Definition: message.c:283
static string warning_file_name
Definition: message.c:284
int safe_fclose(FILE *stream, const char *filename)
Definition: file.c:77
void free(void *)
char * string
STRING.
Definition: newgen_types.h:39

References free(), safe_fclose(), warning_file, and warning_file_name.

Referenced by check_delete_workspace(), close_workspace(), and create_workspace().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ close_xml_logfile()

void close_xml_logfile ( void  )

Definition at line 631 of file message.c.

632 {
633  if (xml_logfile)
634  {
636  xml_logfile = NULL;
637  xml_logfile_name = NULL;
638  }
639 }
static string xml_logfile_name
Definition: message.c:568
static FILE * xml_logfile
Definition: message.c:567

References safe_fclose(), xml_logfile, and xml_logfile_name.

+ Here is the call graph for this function:

◆ code2status()

static string code2status ( int  code)
static

Definition at line 759 of file message.c.

760 {
761  switch (code)
762  {
763  case -1: return "ABORT";
764  case 0: return "OK";
765  case 1: return "INTERNAL_ERROR";
766  case TIMEOUT_CODE: return "TIMEOUT";
767  default: return "USER_ERROR";
768  }
769 }
#define TIMEOUT_CODE
Definition: misc-local.h:43

References TIMEOUT_CODE.

Referenced by pips_log_stop(), pips_stop_file(), and pips_stop_xml().

+ Here is the caller graph for this function:

◆ default_user_request()

string default_user_request ( const char *  fmt,
va_list *  args 
)

USER_REQUEST is a function that should be called to request some data from the user.

It returns the string typed by the user until the return key is typed. USER_REQUEST should be called as:

USER_REQUEST(format [, arg] ... )

where format and arg-list are passed as arguments to vprintf.

Parameters
fmtmt
argsrgs

Definition at line 124 of file message.c.

125 {
126  va_list acpy;
127  va_copy(acpy, *args);
128  fprintf(stdout, "\nWaiting for your response: ");
129  vfprintf(stdout, fmt, acpy);
130  fflush(stdout);
131  va_end(acpy);
132  return safe_readline(stdin);
133 }
char * safe_readline(FILE *file)
returns the allocated line read, whatever its length.
Definition: file.c:497
int fprintf()
test sc_min : ce test s'appelle par : programme fichier1.data fichier2.data ...

References fprintf(), and safe_readline().

+ Here is the call graph for this function:

◆ function_same_string_p()

bool function_same_string_p ( const char *  s1,
const char *  s2 
)
Parameters
s11
s22

Definition at line 560 of file message.c.

561 {
562  return strcmp(s1, s2) == 0;
563 }
s1
Definition: set.c:247

References s1.

◆ get_bool_property()

bool get_bool_property ( const  string)

FC 2015-07-20: yuk, moved out to prevent an include cycle dependency include "properties.h".

Definition at line 173 of file gfc2pips-stubs.c.

173  {
174  if ( strcmp( "PRETTYPRINT_LISTS_WITH_SPACES", name ) == 0
175  || strcmp( "PRETTYPRINT_REGENERATE_ALTERNATE_RETURNS", name ) == 0
176  || strcmp( "PRETTYPRINT_C_CODE", name ) == 0
177  || strcmp( "ABORT_ON_USER_ERROR", name ) == 0 ) {
178  return true;
179  }
180  if ( strcmp( "NO_USER_WARNING", name ) == 0 ) {
181  return false;
182  }
183  fprintf( stderr, "***** Property requested : %s ***** ", name );
184  STUB_WARNING();
185  return 0;
186 }
#define STUB_WARNING()

Referenced by append_to_warning_file(), close_log_file(), open_log_file(), pips_log_end(), and pips_user_warning_alist().

+ Here is the caller graph for this function:

◆ get_int_property()

int get_int_property ( const  string)

Definition at line 191 of file gfc2pips-stubs.c.

191  {
192  fprintf( stderr, "***** Property requested : %s ***** ", name );
193  STUB_ERROR();
194 }
#define STUB_ERROR()

References fprintf(), and STUB_ERROR.

Referenced by any_loop_to_points_to(), apply_a_rule(), copy_write_statement(), copy_write_statement_with_cumulated_regions(), create_common_parameters_h(), create_k_limited_stub_points_to(), do_kernelize(), do_solve_hardware_constraints_on_nb_proc(), do_solve_hardware_constraints_on_volume(), do_terapix_remove_divide(), freia_spoc_pipeline(), freia_terapix_call(), freia_unroll_while(), generate_opcode(), get_free_slot(), get_optimal_opcode(), get_output_slot(), hbdsc_parallelization(), if_conv_init_statement(), init_computation_intensity_param(), initialization(), internal_print_icfg(), loop_chunk_size_and_strip_mine(), make_eliminate_original_variables(), make_mpi_conversion(), match_expression(), maybe_unroll_while_rwt(), mppa_compile_dag(), mppa_dag_maybe_split_instrs_cmd(), mppa_dag_split(), new_any_loop_to_points_to(), normalize_points_to_graph(), offset_array_reference(), offset_points_to_cell(), pips_log_end(), pragma_build_if_condition(), reductions_rewrite(), reference_add_field_dimension(), replicate_declaration(), sc_delimiter(), simple_simd_unroll_rate(), spire_distributed_unstructured_to_structured(), spire_shared_unstructured_to_structured(), statement_to_postcondition(), statement_to_transformer(), statement_to_transformer_list(), terapix_gram_allocate(), terapix_gram_init(), text_complexity(), unroll(), unstructured_to_flow_sensitive_postconditions(), unstructured_to_transformer(), and whileloop_to_postcondition().

+ Here is the call graph for this function:

◆ get_pips_current_module()

◆ get_pips_current_pass_name()

string get_pips_current_pass_name ( void  )

Export this piece of information to customize warning functions in passes.

Passes are also called "phases" in PIPS jargon.

Definition at line 77 of file message.c.

78 {
79  return current_phase;
80 }
static string current_phase
CATCH/TRY/UNCATCH/THROW stuff is here.
Definition: message.c:62

References current_phase.

Referenced by append_to_warning_file(), c_parser_user_warning_alist(), csplit_parser_warning_alist(), pips_internal_error_alist(), pips_log_stop(), pips_stop_file(), pips_stop_xml(), pips_user_error_alist(), pips_user_irrecoverable_error_alist(), pips_user_warning_alist(), semantics_user_warning_alist(), and spear_log_alist().

+ Here is the caller graph for this function:

◆ get_string_property()

char* get_string_property ( const char *  )

◆ log_on_file()

void log_on_file ( const char *  desc)
Parameters
descesc

Definition at line 190 of file message.c.

191 {
192  pips_log_desc(info_log, NULL, NULL,
193  NULL, NULL, -1, NULL, NULL, -1, -1,
194  NULL, NULL, (const string) desc);
195 }
void pips_log_desc(const pips_log_t tag, const string pips_pass, const string pips_owner, const string pips_func, const string pips_file, const int pips_line, const string user_func, const string user_file, const int user_line, const int user_line2, const string stmt, const string suggestion, const string description)
log entry with preprocessed format/arguments
Definition: message.c:1173
@ info_log
Definition: misc-local.h:33

References info_log, and pips_log_desc().

Referenced by gpips_user_error_message(), gpips_user_log(), gpips_user_warning_message(), wpips_user_error_message(), wpips_user_log(), and wpips_user_warning_message().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ open_log_file()

void open_log_file ( const string  dir)
Parameters
dirir

Definition at line 171 of file message.c.

172 {
173  if (log_file != NULL)
174  close_log_file();
175 
176  if (get_bool_property("USER_LOG_P"))
177  {
178  string log_file_name = strdup(concatenate(dir, "/", LOG_FILE, NULL));
179 
180  if ((log_file = fopen(log_file_name, "a")) == NULL) {
181  pips_user_error("Cannot open log file in workspace %s. "
182  "Check access rights.");
183  }
184 
185  free(log_file_name);
186  }
187 }
void close_log_file(void)
Definition: message.c:162
#define LOG_FILE
Definition: message.c:155
#define pips_user_error
Definition: misc-local.h:147
string concatenate(const char *,...)
Return the concatenation of the given strings.
Definition: string.c:183
char * strdup()

References close_log_file(), concatenate(), free(), get_bool_property(), LOG_FILE, log_file, pips_user_error, and strdup().

Referenced by create_workspace(), and open_workspace().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ open_warning_file()

void open_warning_file ( const char *  dir)
Parameters
dirir

Definition at line 286 of file message.c.

287 {
288  assert(warning_file_name == NULL && warning_file == NULL);
291 }
#define WARNING_FILE_NAME
USER_WARNING issues a warning and don't stop the program (cf.
Definition: message.c:281
FILE * safe_fopen(const char *filename, const char *what)
Definition: file.c:67
#define assert(ex)
Definition: newgen_assert.h:41

References assert, concatenate(), safe_fopen(), strdup(), warning_file, WARNING_FILE_NAME, and warning_file_name.

Referenced by create_workspace(), and open_workspace().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ open_xml_logfile()

void open_xml_logfile ( const char *  filename)
Parameters
filenameilename

Definition at line 607 of file message.c.

608 {
609  xml_logfile_name = (string) filename;
610  xml_logfile = safe_fopen(filename, "w");
611 
612  // put version as an XML comment...
613  if (!getenv("PIPS_VALIDATION_IN_PROGRESS"))
614  {
616  string_buffer_append(sb, "<!-- pips informations:\n ");
617  append_xml_attribute(sb, "Architecture", STRINGIFY(SOFT_ARCH));
618  string_buffer_append(sb, "\n ");
619  append_xml_attribute(sb, "Revisions", pips_revisions);
620  string_buffer_append(sb, "\n ");
622  string_buffer_append(sb, "\n ");
623  append_xml_attribute(sb, "Compiler", pips_cc);
624  string_buffer_append(sb, "\n-->\n");
626  fflush(xml_logfile);
628  }
629 }
static string pips_revisions
Definition: message.c:98
static string pips_date
Definition: message.c:99
static string pips_cc
Definition: message.c:100
static void append_xml_attribute(string_buffer sb, const string attribute, const string value)
generate xml: attribute="escaped-stuff"
Definition: message.c:595
#define STRINGIFY(symbol)
If not using this 2-stage macro evaluation, the generated string is not the value of the macro but th...
Definition: misc-local.h:50
void string_buffer_to_file(const string_buffer, FILE *)
put string buffer into file.
void string_buffer_free(string_buffer *)
free string buffer structure, also free string contents according to the dup field
Definition: string_buffer.c:82
string_buffer string_buffer_make(bool dup)
allocate a new string buffer
Definition: string_buffer.c:58
internally defined structure.
Definition: string_buffer.c:47

References append_xml_attribute(), pips_cc, pips_date, pips_revisions, safe_fopen(), string_buffer_append(), string_buffer_free(), string_buffer_make(), string_buffer_to_file(), STRINGIFY, xml_logfile, and xml_logfile_name.

Referenced by parse_arguments().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ pips_internal_error_alist()

static void _NORETURN_ pips_internal_error_alist ( const char *  funcname,
const char *  funcfile,
const int  funcline,
const char *  format,
va_list *  args 
)
static

Definition at line 375 of file message.c.

381 {
385  (const string) funcname, (const string) funcfile, funcline,
386  NULL, NULL, -1, -1,
387  NULL, NULL, (const string) format, args);
388 
389  // dead code, stopped from pips_log_desc
390  abort();
391 }
@ internal_error_log
Definition: misc-local.h:38
#define abort()
Definition: misc-local.h:53

References abort, get_pips_current_module(), get_pips_current_pass_name(), internal_error_log, and pips_log_alist().

Referenced by pips_internal_error_func(), and pips_internal_error_func2().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ pips_internal_error_func()

void pips_internal_error_func ( const char *  funcname,
const char *  funcfile,
const int  funcline,
const char *  fmt,
  ... 
)
Parameters
funcnameuncname
funcfileuncfile
funclineuncline
fmtmt

Definition at line 394 of file message.c.

400 {
401  va_list args;
402  va_start(args, fmt);
403  pips_internal_error_alist(funcname, funcfile, funcline, fmt, &args);
404  va_end(args);
405 }
static void _NORETURN_ pips_internal_error_alist(const char *funcname, const char *funcfile, const int funcline, const char *format, va_list *args)
Definition: message.c:375

References pips_internal_error_alist().

+ Here is the call graph for this function:

◆ pips_internal_error_func2()

void pips_internal_error_func2 ( const char *  format,
  ... 
)
Parameters
formatormat

Definition at line 408 of file message.c.

411 {
412  va_list args;
413  va_start(args, format);
415  format, &args);
416  va_end(args);
417 }
#define pips_unknown_function
Definition: misc-local.h:63

References pips_internal_error_alist(), and pips_unknown_function.

+ Here is the call graph for this function:

◆ pips_log_alist()

void pips_log_alist ( const pips_log_t  tag,
const string  pips_pass,
const string  pips_owner,
const string  pips_func,
const string  pips_file,
const int  pips_line,
const string  user_func,
const string  user_file,
const int  user_line,
const int  user_line2,
const string  stmt,
const string  suggestion,
const string  format,
va_list *  args 
)

log entry with unprocessed format/alist arguments

Parameters
pips_passips_pass
pips_ownerips_owner
pips_funcips_func
pips_fileips_file
pips_lineips_line
user_funcser_func
user_fileser_file
user_lineser_line
user_line2ser_line2
stmttmt
suggestionuggestion
formatormat
argsrgs

Definition at line 1200 of file message.c.

1221 {
1222  pips_log_in_progress(pips_func, pips_file, pips_line);
1223 
1224  // process issue description once and for all
1225  string description = NULL;
1226  va_list acpy;
1227  va_copy(acpy, *args);
1228  // BUG: if a timeout is raised while being in malloc, this call is deadlocked
1229  // as a lock is already held and vasprintf needs to allocate... Also, XML
1230  // output generation also requires malloc later on...
1231  vasprintf(&description, format, acpy);
1232  va_end(acpy);
1233 
1234  // trim leading newlines/tabs and trailing newlines/tabs/spaces
1235  string desc = description;
1236  while (*desc && (*desc == '\n' || *desc == '\t' || *desc == '\r'))
1237  desc ++;
1238  int last = strlen(desc) - 1;
1239  while (last >= 0 &&
1240  (desc[last] == '\n' || desc[last] == '\t' || desc[last] == ' ' ||
1241  desc[last] == '\r'))
1242  desc[last--] = '\0';
1243 
1244  // display part
1245  pips_log_display(tag, pips_pass, pips_owner,
1246  pips_func, pips_file, pips_line,
1247  user_func, user_file, user_line, user_line2,
1248  stmt, suggestion, desc);
1249 
1250  // cleanup
1251  free(description);
1252 
1253  // (legacy?) alist level callbacks...
1254  if (tag == info_log && pips_log_handler)
1255  {
1256  va_copy(acpy, *args);
1257  pips_log_handler(format, &acpy);
1258  va_end(acpy);
1259  }
1260  else if ((tag == warning_log || tag == spear_warning_log) &&
1262  {
1263  va_copy(acpy, *args);
1264  pips_warning_handler(pips_func, format, &acpy);
1265  va_end(acpy);
1266  }
1267  else if (tag == user_error_log && pips_error_handler)
1268  {
1269  va_copy(acpy, *args);
1270  pips_error_handler(pips_func, format, &acpy);
1271  va_end(acpy);
1272  }
1274  {
1275  va_copy(acpy, *args);
1276  pips_internal_error_handler(pips_func, format, &acpy);
1277  va_end(acpy);
1278  }
1279 
1280  // conclusion (exit, abort, whatever), although it may never be reached...
1281  pips_log_end(tag);
1282 }
static void pips_log_display(const pips_log_t tag, const string pips_pass, const string pips_owner, const string pips_func, const string pips_file, const int pips_line, const string user_func, const string user_file, const int user_line, const int user_line2, const string stmt, const string suggestion, const string desc)
manage "displaying" a log entry, on stderr, in files...
Definition: message.c:1040
void(* pips_internal_error_handler)(const char *, const char *,...)
PIPS_ERROR is a function that should be called to terminate PIPS execution when data structures are c...
Definition: message.c:511
static void pips_log_end(pips_log_t tag)
end of log entry (nothing, exception, abort, exit...)
Definition: message.c:1116
static void pips_log_in_progress(const char *pips_func, const char *pips_file, const int pips_line)
Definition: message.c:1089
void(* pips_log_handler)(const char *fmt, va_list *args)
USER_LOG is a function that should be called to log the current PIPS request, as soon as it is releva...
Definition: message.c:216
void(* pips_error_handler)(const char *, const char *, va_list *)
PROMPT_USER schould be implemented.
Definition: message.c:455
void(* pips_warning_handler)(const char *, const char *, va_list *)
default assignment of pips_warning_handler is default_user_warning.
Definition: message.c:325
static FILE * user_file
These functions implements the writing of objects.
Definition: genClib.c:1485
@ user_error_log
Definition: misc-local.h:37
@ spear_warning_log
Definition: misc-local.h:35
int tag
TAG.
Definition: newgen_types.h:92
Definition: statement.c:54
int vasprintf(char **resultp, const char *format, va_list args)
Formatted output to strings.
Definition: vasprintf.c:33

References free(), info_log, internal_error_log, pips_error_handler, pips_internal_error_handler, pips_log_display(), pips_log_end(), pips_log_handler, pips_log_in_progress(), pips_warning_handler, spear_warning_log, user_error_log, user_file, vasprintf(), and warning_log.

Referenced by append_to_warning_file(), c_parser_user_warning_alist(), csplit_parser_warning_alist(), pips_internal_error_alist(), pips_log_func(), pips_user_error_alist(), pips_user_irrecoverable_error_alist(), pips_user_log_alist(), pips_user_warning_alist(), semantics_user_warning_alist(), and spear_log_alist().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ pips_log_desc()

void pips_log_desc ( const pips_log_t  tag,
const string  pips_pass,
const string  pips_owner,
const string  pips_func,
const string  pips_file,
const int  pips_line,
const string  user_func,
const string  user_file,
const int  user_line,
const int  user_line2,
const string  stmt,
const string  suggestion,
const string  description 
)

log entry with preprocessed format/arguments

Parameters
pips_passips_pass
pips_ownerips_owner
pips_funcips_func
pips_fileips_file
pips_lineips_line
user_funcser_func
user_fileser_file
user_lineser_line
user_line2ser_line2
stmttmt
suggestionuggestion
descriptionescription

Definition at line 1173 of file message.c.

1187 {
1188  pips_log_in_progress(pips_func, pips_file, pips_line);
1189 
1190  pips_log_display(tag, pips_pass, pips_owner,
1191  pips_func, pips_file, pips_line,
1192  user_func, user_file, user_line, user_line2,
1193  stmt, suggestion, description);
1194 
1195  pips_log_end(tag);
1196 }

References pips_log_display(), pips_log_end(), pips_log_in_progress(), and user_file.

Referenced by log_on_file().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ pips_log_display()

static void pips_log_display ( const pips_log_t  tag,
const string  pips_pass,
const string  pips_owner,
const string  pips_func,
const string  pips_file,
const int  pips_line,
const string  user_func,
const string  user_file,
const int  user_line,
const int  user_line2,
const string  stmt,
const string  suggestion,
const string  desc 
)
static

manage "displaying" a log entry, on stderr, in files...

Definition at line 1040 of file message.c.

1054 {
1055  // always show on stderr
1056  pips_log_file(stderr, tag,
1057  pips_pass, pips_owner,
1058  pips_func, pips_file, pips_line,
1059  user_func, user_file, user_line, user_line2,
1060  stmt, suggestion, desc);
1061 
1062  // send to logfile if there
1063  if (log_file && tag == info_log)
1065  pips_pass, pips_owner,
1066  pips_func, pips_file, pips_line,
1067  user_func, user_file, user_line, user_line2,
1068  stmt, suggestion, desc);
1069 
1070  // send to WARNINGS?
1071  if (warning_file && tag >= warning_log)
1073  pips_pass, pips_owner,
1074  pips_func, pips_file, pips_line,
1075  user_func, user_file, user_line, user_line2,
1076  stmt, suggestion, desc);
1077 
1078  // XML output
1079  if (xml_logfile)
1080  pips_log_xml(tag,
1081  pips_pass, pips_owner,
1082  pips_func, pips_file, pips_line,
1083  user_func, user_file, user_line, user_line2,
1084  stmt, suggestion, desc);
1085 }
static void pips_log_file(FILE *out, const pips_log_t tag, const string pips_pass, const string pips_owner, const string pips_func, const string pips_file, const int pips_line, const string user_func, const string user_file, const int user_line, const int user_line2, const string stmt, const string suggestion, const string description)
Definition: message.c:954
static void pips_log_xml(const pips_log_t tag, const string pips_pass, const string pips_owner, const string pips_func, const string pips_file, const int pips_line, const string user_func, const string user_file, const int user_line, const int user_line2, const string stmt, const string suggestion, const string description)
add a full log entry to the xml log file
Definition: message.c:701

References info_log, log_file, pips_log_file(), pips_log_xml(), user_file, warning_file, warning_log, and xml_logfile.

Referenced by pips_log_alist(), and pips_log_desc().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ pips_log_done()

static void pips_log_done ( void  )
static

Definition at line 1109 of file message.c.

1110 {
1112 }
static int pips_log_recursion_count
Definition: message.c:1087

References pips_log_recursion_count.

Referenced by pips_log_end().

+ Here is the caller graph for this function:

◆ pips_log_end()

static void pips_log_end ( pips_log_t  tag)
static

end of log entry (nothing, exception, abort, exit...)

Definition at line 1116 of file message.c.

1117 {
1118  pips_log_done();
1119 
1120  if (tag <= spear_warning_log)
1121  return;
1122 
1123  // just in case, flush stuff before stopping?
1124  fflush(stderr);
1125  fflush(stdout);
1126  if (xml_logfile) fflush(xml_logfile);
1127  if (warning_file) fflush(warning_file);
1128  if (log_file) fflush(log_file);
1129 
1130  // ??? get_bool_property("CLOSE_WORKSPACE_AND_QUIT_ON_ERROR")
1131 
1132  // handle various stops
1133  if (tag == internal_error_log)
1134  pips_stop(tag, -1, "internal error raised");
1135 
1137  pips_stop(tag, 1, "irrecoverable error raised");
1138 
1139  if (tag == user_error_log || tag == spear_error_log)
1140  {
1141  if (properties_initialized_p() &&
1142  get_bool_property("CLOSE_WORKSPACE_AND_QUIT_ON_ERROR"))
1143  // the close workspace part only works for tpips user error handler
1144  pips_stop(tag, 2, "CLOSE_WORKSPACE_AND_QUIT_ON_ERROR");
1145 
1147  pips_stop(tag, -1, "too many property errors pending");
1148 
1149  if (properties_initialized_p() &&
1150  get_bool_property("ABORT_ON_USER_ERROR"))
1151  pips_stop(tag, -1, "ABORT_ON_USER_ERROR");
1152 
1153  static int user_error_called = 0;
1154 
1155  if (properties_initialized_p() &&
1156  user_error_called > get_int_property("MAXIMUM_USER_ERROR"))
1157  {
1159  "over MAXIMUM_USER_ERROR=%d user errors",
1160  get_int_property("MAXIMUM_USER_ERROR"));
1161  }
1162 
1163  user_error_called++;
1164 
1165  // throw according to linear exception stack
1166  // If it is OK there, we should do a reset_property_error()
1168  }
1169 }
bool too_many_property_errors_pending_p(void)
int get_int_property(const string)
static void pips_log_done(void)
Definition: message.c:1109
@ user_exception_error
#define THROW(what)
@ spear_error_log
Definition: misc-local.h:36
@ irrecoverable_error_log
Definition: misc-local.h:39
#define pips_stop
Definition: misc-local.h:151

References get_bool_property(), get_int_property(), internal_error_log, irrecoverable_error_log, log_file, pips_log_done(), pips_stop, properties_initialized_p(), spear_error_log, spear_warning_log, THROW, too_many_property_errors_pending_p(), user_error_log, user_exception_error, warning_file, and xml_logfile.

Referenced by pips_log_alist(), and pips_log_desc().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ pips_log_file()

static void pips_log_file ( FILE *  out,
const pips_log_t  tag,
const string  pips_pass,
const string  pips_owner,
const string  pips_func,
const string  pips_file,
const int  pips_line,
const string  user_func,
const string  user_file,
const int  user_line,
const int  user_line2,
const string  stmt,
const string  suggestion,
const string  description 
)
static

Definition at line 954 of file message.c.

969 {
970  // whether to add a new line after line headers
971  bool nl = false;
972 
973  if (pips_pass) {
974  fprintf(out, "%s[%s] ", pips_pass, pips_owner? pips_owner: "?");
975  }
976 
977  if (pips_func && tag >= warning_log)
978  fprintf(out, "(%s) ", pips_func);
979 
980  if (tag >= user_error_log)
981  fprintf(out, "[%s] ", pips_log_tag_name(tag));
982 
983  if (pips_file && tag >= internal_error_log) {
984  fprintf(out, "(%s:%d) ", pips_file, pips_line);
985  nl = true;
986  }
987 
988  if (user_func && !pips_owner) {
989  fprintf(out, "in function %s ", user_func);
990  nl = true;
991  }
992 
993  if (user_file)
994  {
995  fprintf(out, "(\"%s\"", user_file);
996  if (user_line >= 0)
997  {
998  fprintf(out, ":%d", user_line);
999  if (user_line < user_line2)
1000  fprintf(out, "-%d", user_line2);
1001  }
1002  fputs(") ", out);
1003  nl = true;
1004  }
1005  else
1006  {
1007  if (user_line >= 0)
1008  {
1009  fprintf(out, "line %d", user_line);
1010  if (user_line < user_line2)
1011  fprintf(out, "-%d", user_line2);
1012  fputs(" ", out);
1013  nl = true;
1014  }
1015  }
1016 
1017  if (nl || stmt) fputc('\n', out);
1018 
1019  if (stmt) {
1020  string s = stmt;
1021  while (*s && *s == '\n') s++; // skip leading newlines
1022  fprintf(out, "at statement:\n\n\t%s\n\n", s);
1023  }
1024 
1025  if (description) {
1026  fputs(description, out);
1027  fputc('\n', out);
1028  }
1029 
1030  if (suggestion) {
1031  fputs(suggestion, out);
1032  fputc('\n', out);
1033  }
1034 
1035  fflush(out);
1036 }
string pips_log_tag_name(pips_log_t tag)
Definition: message.c:938
static FILE * out
Definition: alias_check.c:128

References fprintf(), internal_error_log, out, pips_log_tag_name(), user_error_log, user_file, and warning_log.

Referenced by pips_log_display().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ pips_log_func()

void pips_log_func ( const string  pips_func,
const string  pips_file,
const int  pips_line,
const pips_log_t  tag,
const string  pips_pass,
const string  pips_owner,
const string  user_func,
const string  user_file,
const int  user_line,
const int  user_line2,
const string  stmt,
const string  suggestion,
const string  format,
  ... 
)

direct pips_log call with format and free arguments ("...")

Parameters
pips_funcips_func
pips_fileips_file
pips_lineips_line
pips_passips_pass
pips_ownerips_owner
user_funcser_func
user_fileser_file
user_lineser_line
user_line2ser_line2
stmttmt
suggestionuggestion
formatormat

Definition at line 1286 of file message.c.

1308 {
1309  va_list args;
1310  va_start(args, format);
1312  pips_pass, pips_owner,
1313  pips_func, pips_file, pips_line,
1314  user_func, user_file, user_line, user_line2,
1315  stmt, suggestion, format, &args);
1316  va_end(args);
1317 }

References pips_log_alist(), and user_file.

+ Here is the call graph for this function:

◆ pips_log_in_progress()

static void pips_log_in_progress ( const char *  pips_func,
const char *  pips_file,
const int  pips_line 
)
static

Definition at line 1089 of file message.c.

1093 {
1094  // deep recursion detection, should never get there...
1095  if (pips_log_recursion_count ++ > 3)
1096  {
1097  // hmmm... cannot call pips_log!
1098  fprintf(stderr, "pips_log recursion (%d) from %s (%s:%d)\n",
1099  pips_log_recursion_count, pips_func, pips_file, pips_line);
1100  fflush(stderr);
1101 
1102  if (pips_log_recursion_count > 10)
1103  pips_stop_func(pips_func, pips_file, pips_line,
1104  internal_error_log, -1,
1105  "deep pips_log recursion (%d)", pips_log_recursion_count);
1106  }
1107 }
void _NORETURN_ pips_stop_func(const char *pips_func, const char *pips_file, const int pips_line, pips_log_t tag, int code, const string format,...)
expecititely declare "noreturn" functions...
Definition: message.c:904

References fprintf(), internal_error_log, pips_log_recursion_count, and pips_stop_func().

Referenced by pips_log_alist(), and pips_log_desc().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ pips_log_stop()

void pips_log_stop ( const char *  function,
const char *  file,
const int  lineno,
const pips_log_t  tag,
const int  code,
const string  format,
  ... 
)

quick log and stop, called on timeout this must not invoke malloc as it may still held locks if interrupted this implementation is missing XML escapes...

Parameters
functionunction
fileile
linenoineno
codeode
formatormat

Definition at line 1323 of file message.c.

1331 {
1332  // STDERR
1333  va_list args;
1334  va_start(args, format);
1335  fprintf(stderr, "(%s) [%s] stopping pips on code %d (%s) for ",
1336  function, pips_log_tag_name(tag), code, code2status(code));
1337  vfprintf(stderr, format, args);
1338  va_end(args);
1339  fputs("\n", stderr);
1340  fflush(stderr);
1341 
1342  // XML
1343  if (xml_logfile)
1344  {
1346  "<Exit Code=\"%d\" Status=\"%s\" Source=\"%s\">\n",
1348 
1349  string
1350  pass = get_pips_current_pass_name(),
1352 
1354  " <Description AppFunction=\"\" AppFile=\"\" "
1355  "AppLine=\"\" Statement=\"\" Proposition=\"\" "
1356  "Pass=\"%s\" Owner=\"%s\" PipsFunction=\"%s\" ",
1357  pass? pass: "", module? module: "", function);
1358 
1359  if (file && getenv("PIPS_VALIDATION_IN_PROGRESS"))
1360  {
1361  // just show a short version of the file & hide the line
1362  string short_file = strstr(file, "/src/");
1364  "PipsFile=\"%s\" PipsLine=\"...\" ",
1365  short_file? short_file: "...");
1366  }
1367  else
1368  {
1369  fprintf(xml_logfile, "PipsFile=\"%s\" PipsLine=\"%d\" ", file, lineno);
1370  }
1371 
1372  fprintf(xml_logfile, "Message=\"");
1373 
1374  va_start(args, format);
1375  vfprintf(xml_logfile, format, args);
1376  va_end(args);
1377 
1378  fprintf(xml_logfile, "\" />\n</Exit>\n");
1379  fflush(xml_logfile);
1380  }
1381 
1382  exit(code);
1383 }
static string code2status(int code)
Definition: message.c:759
#define exit(code)
Definition: misc-local.h:54
static char * module
Definition: pips.c:74

References code2status(), exit, fprintf(), get_pips_current_module(), get_pips_current_pass_name(), module, pips_log_tag_name(), and xml_logfile.

Referenced by pips_timeout_callback().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ pips_log_tag_name()

string pips_log_tag_name ( pips_log_t  tag)

Definition at line 938 of file message.c.

939 {
940  switch (tag)
941  {
942  case none_log: return "none";
943  case info_log: return "information";
944  case warning_log: return "warning";
945  case spear_warning_log: return "spear warning";
946  case spear_error_log: return "spear error";
947  case user_error_log: return "user error";
948  case internal_error_log: return "internal error";
949  case irrecoverable_error_log: return "irrecoverable error";
950  default: return "<missing tag name>";
951  }
952 }
@ none_log
Definition: misc-local.h:32

References info_log, internal_error_log, irrecoverable_error_log, none_log, spear_error_log, spear_warning_log, user_error_log, and warning_log.

Referenced by pips_log_file(), pips_log_stop(), pips_stop_file(), and pips_stop_xml().

+ Here is the caller graph for this function:

◆ pips_log_xml()

static void pips_log_xml ( const pips_log_t  tag,
const string  pips_pass,
const string  pips_owner,
const string  pips_func,
const string  pips_file,
const int  pips_line,
const string  user_func,
const string  user_file,
const int  user_line,
const int  user_line2,
const string  stmt,
const string  suggestion,
const string  description 
)
static

add a full log entry to the xml log file

Definition at line 701 of file message.c.

715 {
716  // only tag warnings & above...
717  if (tag == info_log) return;
718 
719  assert(xml_logfile != NULL);
720 
721  // build XML in a string buffer
723  string field = pips_log_xml_tag(tag);
724 
725  string_buffer_cat(sb, "<", field, ">\n <Description ", NULL);
726  // user level information
727  append_xml_attribute(sb, "AppFunction", user_func);
728  append_xml_attribute(sb, "AppFile", user_file);
729  append_xml_line_numbers(sb, "AppLine", user_line, user_line2);
730 
731  pips_log_xml_pips_level(sb, pips_pass, pips_owner,
732  pips_func, pips_file, pips_line);
733 
734  if (stmt)
735  {
736  char * s = stmt;
737  while (*s && (*s == '\n' || *s == '\t' || *s == ' ')) s++;
738  append_xml_attribute(sb, "Statement", s);
739  }
740  else
741  append_xml_attribute(sb, "Statement", NULL);
742 
743  // remove leading spaces for xml
744  string desc = description;
745  while (desc && *desc && *desc == ' ') desc++;
746 
747  append_xml_attribute(sb, "Message", desc);
748  append_xml_attribute(sb, "Proposition", suggestion);
749  string_buffer_cat(sb, "/>\n</", field, ">\n", NULL);
750 
753 
754  fflush(xml_logfile);
755 }
static string pips_log_xml_tag(pips_log_t tag)
Definition: message.c:657
static void pips_log_xml_pips_level(string_buffer sb, const string pips_pass, const string pips_owner, const string pips_func, const string pips_file, const int pips_line)
append pips-level stuff (function, file, line) to xml file
Definition: message.c:673
static void append_xml_line_numbers(string_buffer sb, const string attribute, int val1, int val2)
Definition: message.c:641
void string_buffer_cat(string_buffer, const string,...)
append a NULL terminated list of string to sb.

References append_xml_attribute(), append_xml_line_numbers(), assert, info_log, pips_log_xml_pips_level(), pips_log_xml_tag(), string_buffer_cat(), string_buffer_free(), string_buffer_make(), string_buffer_to_file(), user_file, and xml_logfile.

Referenced by pips_log_display().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ pips_log_xml_pips_level()

static void pips_log_xml_pips_level ( string_buffer  sb,
const string  pips_pass,
const string  pips_owner,
const string  pips_func,
const string  pips_file,
const int  pips_line 
)
static

append pips-level stuff (function, file, line) to xml file

Definition at line 673 of file message.c.

680 {
681  // pips level information
682  append_xml_attribute(sb, "Pass", pips_pass);
683  append_xml_attribute(sb, "Owner", pips_owner);
684  append_xml_attribute(sb, "PipsFunction", pips_func);
685  if (pips_file && getenv("PIPS_VALIDATION_IN_PROGRESS"))
686  {
687  // just show a short version of the file & hide the line
688  string short_file = strstr(pips_file, "/src/");
689  append_xml_attribute(sb, "PipsFile", short_file? short_file: "...");
690  append_xml_attribute(sb, "PipsLine", "...");
691  }
692  else
693  {
694  append_xml_attribute(sb, "PipsFile", pips_file);
695  append_xml_line_numbers(sb, "PipsLine", pips_line, 0);
696  }
697 }

References append_xml_attribute(), and append_xml_line_numbers().

Referenced by pips_log_xml(), and pips_stop_xml().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ pips_log_xml_tag()

static string pips_log_xml_tag ( pips_log_t  tag)
static

Definition at line 657 of file message.c.

658 {
659  switch (tag) {
660  case info_log: return "Info";
661  case warning_log: return "Warning";
662  case spear_warning_log: return "SpearWarning";
663  case spear_error_log: return "SpearError";
664  case user_error_log: return "UserError";
665  case internal_error_log: return "InternalError";
666  case irrecoverable_error_log: return "InternalError";
667  default: abort();
668  }
669 }

References abort, info_log, internal_error_log, irrecoverable_error_log, spear_error_log, spear_warning_log, user_error_log, and warning_log.

Referenced by pips_log_xml().

+ Here is the caller graph for this function:

◆ pips_stop_alist()

static void _NORETURN_ pips_stop_alist ( pips_log_t  tag,
int  code,
const string  pips_func,
const string  pips_file,
const int  pips_line,
const string  format,
va_list *  args 
)
static

Definition at line 883 of file message.c.

891 {
892  string description;
893  va_list acpy;
894  va_copy(acpy, *args);
895  vasprintf(&description, format, acpy);
896  va_end(acpy);
897 
898  pips_stop_desc(tag, code, pips_func, pips_file, pips_line, description);
899 
900  free(description);
901 }
static void _NORETURN_ pips_stop_desc(pips_log_t tag, int code, const string pips_func, const string pips_file, const int pips_line, const string desc)
Definition: message.c:845

References free(), pips_stop_desc(), and vasprintf().

Referenced by pips_stop_func(), and pips_stop_func2().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ pips_stop_desc()

static void _NORETURN_ pips_stop_desc ( pips_log_t  tag,
int  code,
const string  pips_func,
const string  pips_file,
const int  pips_line,
const string  desc 
)
static

Definition at line 845 of file message.c.

852 {
853  // trace
854  pips_stop_file(stderr, tag, code, pips_func, pips_file, pips_line, desc);
855 
856  if (log_file && tag == info_log)
857  pips_stop_file(log_file, tag, code, pips_func, pips_file, pips_line, desc);
858 
859  if (log_file)
860  fclose(log_file);
861 
862  if (warning_file && tag >= warning_log)
864  tag, code, pips_func, pips_file, pips_line, desc);
865 
866  if (warning_file)
867  fclose(warning_file);
868 
869  if (xml_logfile)
870  {
871  pips_stop_xml(tag, code, pips_func, pips_file, pips_line, desc);
872  fclose(xml_logfile);
873  }
874 
875  // do the deed
876  if (code < 0)
877  abort();
878  else
879  exit(code);
880 }
static void pips_stop_xml(pips_log_t tag, int code, const string pips_func, const string pips_file, const int pips_line, const string description)
Definition: message.c:771
static void pips_stop_file(FILE *out, pips_log_t tag, int code, const char *pips_func, const char *pips_file, const int pips_line, const string description)
Definition: message.c:801

References abort, exit, info_log, log_file, pips_stop_file(), pips_stop_xml(), warning_file, warning_log, and xml_logfile.

Referenced by pips_stop_alist().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ pips_stop_file()

static void pips_stop_file ( FILE *  out,
pips_log_t  tag,
int  code,
const char *  pips_func,
const char *  pips_file,
const int  pips_line,
const string  description 
)
static

Definition at line 801 of file message.c.

809 {
810  if (code)
811  {
812  // some error, precise report
813  string
816 
817  if (pass)
818  fprintf(out, "%s[%s] ", pass, owner? owner: "<unknown");
819 
820  if (pips_func)
821  fprintf(out, "(%s) ", pips_func);
822 
823  fprintf(out, "[%s] ", pips_log_tag_name(tag));
824 
825  fprintf(out, "stopping pips on code %d (%s) ", code, code2status(code));
826 
827  // not good for validation, this might move easily... so only on abort
828  if (pips_file && code == -1)
829  fprintf(out, "at (\"%s\":%d) ", pips_file, pips_line);
830 
831  if (description && *description)
832  {
833  fputs("for ", out);
834  fputs(description, out);
835  }
836  fputs("\n", out);
837  }
838  else // short output for normal exit(0)
839  fprintf(out, "Pips is done: %s\n", description);
840 
841  fflush(out);
842 }

References code2status(), fprintf(), get_pips_current_module(), get_pips_current_pass_name(), out, and pips_log_tag_name().

Referenced by pips_stop_desc().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ pips_stop_func()

void pips_stop_func ( const char *  pips_func,
const char *  pips_file,
const int  pips_line,
pips_log_t  tag,
int  code,
const  string,
  ... 
)

expecititely declare "noreturn" functions...

because cproto generated headers seem to ignore attributes

Parameters
pips_funcips_func
pips_fileips_file
pips_lineips_line
codeode
formatormat

Definition at line 904 of file message.c.

914 {
915  va_list args;
916  va_start(args, format);
918  (const string) pips_func, (const string) pips_file, pips_line,
919  format, &args);
920  va_end(args);
921 }
static void _NORETURN_ pips_stop_alist(pips_log_t tag, int code, const string pips_func, const string pips_file, const int pips_line, const string format, va_list *args)
Definition: message.c:883

References pips_stop_alist().

Referenced by pips_log_in_progress().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ pips_stop_func2()

void pips_stop_func2 ( pips_log_t  tag,
int  code,
const string  format,
  ... 
)
Parameters
codeode
formatormat

Definition at line 924 of file message.c.

929 {
930  va_list args;
931  va_start(args, format);
932  pips_stop_alist(tag, code, NULL, NULL, -1, format, &args);
933  va_end(args);
934 }

References pips_stop_alist().

+ Here is the call graph for this function:

◆ pips_stop_xml()

static void pips_stop_xml ( pips_log_t  tag,
int  code,
const string  pips_func,
const string  pips_file,
const int  pips_line,
const string  description 
)
static

Definition at line 771 of file message.c.

778 {
779  assert(xml_logfile != NULL);
780 
783  "<Exit Code=\"%d\" Status=\"%s\" Source=\"%s\">\n",
785  code? pips_log_tag_name(tag): "pips");
787  " <Description AppFunction=\"\" AppFile=\"\" "
788  "AppLine=\"\" Statement=\"\" Proposition=\"\" ");
791  pips_func, pips_file, pips_line);
792  append_xml_attribute(sb, "Message", description);
793  string_buffer_append(sb, "/>\n</Exit>\n");
794 
796  fflush(xml_logfile);
797 
799 }

References append_xml_attribute(), assert, code2status(), get_pips_current_module(), get_pips_current_pass_name(), pips_log_tag_name(), pips_log_xml_pips_level(), string_buffer_append(), string_buffer_free(), string_buffer_make(), string_buffer_printf(), string_buffer_to_file(), and xml_logfile.

Referenced by pips_stop_desc().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ pips_thanks()

void pips_thanks ( string  name,
string  path 
)

display pips thanks on startup, if it on a tty.

This file contains the main for wpips.

This file contains the main for tpips.

This file contains the main for pips.

This file contains the main for fpips.

Parameters
nameame
pathath

Definition at line 265 of file message.c.

266 {
267  if (isatty(fileno(stdout)))
268  {
269  fprintf(stdout, PIPS_THANKS_STRING(STRINGIFY(SOFT_ARCH)), name, path);
270  fflush(stdout);
271  }
272 }
#define PIPS_THANKS_STRING(arch)
The # "stringificator" only works in a macro expansion...
Definition: message.c:247

References fprintf(), PIPS_THANKS_STRING, and STRINGIFY.

Referenced by main().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ pips_user_error_alist()

static void _NORETURN_ pips_user_error_alist ( const char *  calling_function_name,
const char *  funcfile,
const int  funcline,
const char *  format,
va_list *  args 
)
static

Definition at line 458 of file message.c.

464 {
469  (const string) calling_function_name, (const string) funcfile, funcline,
470  NULL, NULL, -1, -1,
471  NULL, NULL, (const string) format, args);
472 
473  // dead code, should not get there...
474  abort();
475 }

References abort, get_pips_current_module(), get_pips_current_pass_name(), pips_log_alist(), and user_error_log.

Referenced by pips_user_error_func(), and pips_user_error_func2().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ pips_user_error_func()

void pips_user_error_func ( const char *  func_name,
const char *  funcfile,
const int  funcline,
const char *  format,
  ... 
)
Parameters
func_nameunc_name
funcfileuncfile
funclineuncline
formatormat

Definition at line 478 of file message.c.

484 {
485  va_list args;
486  va_start(args, format);
487  pips_user_error_alist(func_name, funcfile, funcline, format, &args);
488  va_end(args);
489 }
static void _NORETURN_ pips_user_error_alist(const char *calling_function_name, const char *funcfile, const int funcline, const char *format, va_list *args)
Definition: message.c:458

References pips_user_error_alist().

+ Here is the call graph for this function:

◆ pips_user_error_func2()

void pips_user_error_func2 ( const char *  format,
  ... 
)
Parameters
formatormat

Definition at line 492 of file message.c.

495 {
496  va_list args;
497  va_start(args, format);
498  pips_user_error_alist(pips_unknown_function, NULL, -1, format, &args);
499  va_end(args);
500 }

References pips_unknown_function, and pips_user_error_alist().

+ Here is the call graph for this function:

◆ pips_user_irrecoverable_error_alist()

void pips_user_irrecoverable_error_alist ( const char *  func_name,
const char *  funcfile,
const int  funcline,
const char *  format,
va_list *  args 
)
Parameters
func_nameunc_name
funcfileuncfile
funclineuncline
formatormat
argsrgs

Definition at line 516 of file message.c.

522 {
526  (const string) func_name, (const string) funcfile, funcline,
527  NULL, NULL, -1, -1,
528  NULL, NULL, (const string) format, args);
529 
530  // dead code, stopped in previous call
531  exit(1);
532 }

References exit, get_pips_current_module(), get_pips_current_pass_name(), irrecoverable_error_log, and pips_log_alist().

Referenced by pips_user_irrecoverable_error_func(), and pips_user_irrecoverable_error_func2().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ pips_user_irrecoverable_error_func()

void pips_user_irrecoverable_error_func ( const char *  func_name,
const char *  funcfile,
const int  funcline,
const char *  format,
  ... 
)
Parameters
func_nameunc_name
funcfileuncfile
funclineuncline
formatormat

Definition at line 535 of file message.c.

541 {
542  va_list args;
543  va_start(args, format);
544  pips_user_irrecoverable_error_alist(func_name, funcfile, funcline,
545  format, &args);
546  va_end(args);
547 }
void _NORETURN_ pips_user_irrecoverable_error_alist(const char *func_name, const char *funcfile, const int funcline, const char *format, va_list *args)
Definition: message.c:516

References pips_user_irrecoverable_error_alist().

+ Here is the call graph for this function:

◆ pips_user_irrecoverable_error_func2()

void pips_user_irrecoverable_error_func2 ( const char *  format,
  ... 
)
Parameters
formatormat

Definition at line 550 of file message.c.

553 {
554  va_list args;
555  va_start(args, format);
556  pips_user_irrecoverable_error_alist("UNKNOWN...", NULL, -1, format, &args);
557  va_end(args);
558 }

References pips_user_irrecoverable_error_alist().

+ Here is the call graph for this function:

◆ pips_user_log_alist()

static void pips_user_log_alist ( const char *  format,
va_list *  args 
)
static

Definition at line 218 of file message.c.

219 {
220  pips_log_alist(info_log, NULL, NULL,
221  NULL, NULL, -1, NULL, NULL, -1, -1,
222  NULL, NULL, (const string) format, args);
223 }

References info_log, and pips_log_alist().

Referenced by pips_user_log_func(), and user_log().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ pips_user_log_func()

void pips_user_log_func ( const char *  format,
  ... 
)
Parameters
formatormat

Definition at line 225 of file message.c.

226 {
227  va_list args;
228  va_start(args, format);
229  pips_user_log_alist(format, &args);
230  va_end(args);
231 }
static void pips_user_log_alist(const char *format, va_list *args)
Definition: message.c:218

References pips_user_log_alist().

+ Here is the call graph for this function:

◆ pips_user_warning_alist()

void pips_user_warning_alist ( const char *  function_name,
const char *  funcfile,
const int  funcline,
const char *  format,
va_list *  args 
)
Parameters
function_nameunction_name
funcfileuncfile
funclineuncline
formatormat
argsrgs

Definition at line 328 of file message.c.

334 {
335  if (properties_initialized_p() && get_bool_property("NO_USER_WARNING"))
336  return;
337 
340  (const string) function_name, (const string)funcfile, funcline,
341  NULL, NULL, -1, -1,
342  NULL, NULL, (const string) format, args);
343 }

References get_bool_property(), get_pips_current_module(), get_pips_current_pass_name(), pips_log_alist(), properties_initialized_p(), and warning_log.

Referenced by pips_user_warning_func(), and pips_user_warning_func2().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ pips_user_warning_func()

void pips_user_warning_func ( const char *  calling_function_name,
const char *  funcfile,
const int  funcline,
const char *  format,
  ... 
)
Parameters
calling_function_namealling_function_name
funcfileuncfile
funclineuncline
formatormat

Definition at line 346 of file message.c.

352 {
353  va_list args;
354  va_start(args, format);
355  pips_user_warning_alist(calling_function_name, funcfile, funcline,
356  format, &args);
357  va_end(args);
358 }
void pips_user_warning_alist(const char *function_name, const char *funcfile, const int funcline, const char *format, va_list *args)
Definition: message.c:328

References pips_user_warning_alist().

+ Here is the call graph for this function:

◆ pips_user_warning_func2()

void pips_user_warning_func2 ( const char *  format,
  ... 
)

fallback version without a calling function name

Parameters
formatormat

Definition at line 362 of file message.c.

365 {
366  va_list args;
367  va_start(args, format);
368  pips_user_warning_alist(pips_unknown_function, NULL, -1, format, &args);
369  va_end(args);
370 }

References pips_unknown_function, and pips_user_warning_alist().

+ Here is the call graph for this function:

◆ properties_initialized_p()

bool properties_initialized_p ( void  )

FC 2015-07-20: yuk, moved out to prevent an include cycle dependency include "properties.h".

Definition at line 206 of file gfc2pips-stubs.c.

206  {
207  STUB_WARNING_MSG("unimplemented in gfc2pips !");
208  return true;
209 }
#define STUB_WARNING_MSG(msg)

References STUB_WARNING_MSG.

Referenced by append_to_warning_file(), pips_log_end(), pips_user_warning_alist(), and tpips_user_error().

+ Here is the caller graph for this function:

◆ reset_pips_current_computation()

void reset_pips_current_computation ( void  )

Definition at line 87 of file message.c.

88 {
89  pips_assert("some current computation", current_module && current_phase);
90 
93 }
#define pips_assert(what, predicate)
common macros, two flavors depending on NDEBUG
Definition: misc-local.h:172

References current_module, current_phase, free(), and pips_assert.

Referenced by create_workspace(), and reset_current_phase_context().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ safe_asprintf()

int safe_asprintf ( char **  strp,
const char *  fmt,
  ... 
)
Parameters
strptrp
fmtmt

Definition at line 1408 of file message.c.

1409 {
1410  va_list args;
1411  va_start(args, fmt);
1412  return safe_vasprintf(strp, fmt, args);
1413  va_end(args);
1414 }
int safe_vasprintf(char **strp, const char *fmt, va_list args)
Definition: message.c:1398

References safe_vasprintf().

+ Here is the call graph for this function:

◆ safe_vasprintf()

int safe_vasprintf ( char **  strp,
const char *  fmt,
va_list  args 
)
Parameters
strptrp
fmtmt
argsrgs

Definition at line 1398 of file message.c.

1399 {
1400  va_list acpy;
1401  va_copy(acpy, args);
1402  int ret = vasprintf(strp, fmt, acpy);
1403  pips_assert("vasprintf is ok", ret >= 0);
1404  va_end(acpy);
1405  return ret;
1406 }
#define ret(why, what)
true if not a remapping for old.
Definition: dynamic.c:986

References pips_assert, ret, and vasprintf().

Referenced by safe_asprintf().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ set_pips_current_computation()

void set_pips_current_computation ( const char *  rname,
const char *  oname 
)

message.c

Parameters
rnamename
onamename

Definition at line 65 of file message.c.

66 {
67  pips_assert("no current computation", !current_module && !current_phase);
68 
69  current_phase = strdup(rname);
70  current_module = strdup(oname);
71 }

References current_module, current_phase, pips_assert, and strdup().

Referenced by create_workspace(), and set_current_phase_context().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ set_pips_meta_informations()

void set_pips_meta_informations ( const char *  revs,
const char *  date,
const char *  comp 
)
Parameters
revsevs
dateate
compomp

Definition at line 102 of file message.c.

106 {
107  pips_revisions = (string) revs;
108  pips_date = (string) date;
109  pips_cc = (string) comp;
110 }

References pips_cc, pips_date, and pips_revisions.

Referenced by atinit(), gpips_main(), pips_init(), pips_main(), tpips_main(), and wpips_main().

+ Here is the caller graph for this function:

◆ too_many_property_errors_pending_p()

bool too_many_property_errors_pending_p ( void  )

Definition at line 203 of file gfc2pips-stubs.c.

203  {
204  STUB_WARNING_MSG("unimplemented in gfc2pips !");
205 }

References STUB_WARNING_MSG.

Referenced by pips_log_end().

+ Here is the caller graph for this function:

◆ user_log()

void user_log ( const char *  format,
  ... 
)
Parameters
formatormat

Definition at line 234 of file message.c.

235 {
236  va_list args;
237  va_start(args, format);
238  pips_user_log_alist(format, &args);
239  va_end(args);
240 }

References pips_user_log_alist().

Referenced by abc_with_allocation_size(), add_new_compilation_unit(), add_new_module_from_text(), alias_check(), apply_a_rule(), array_bound_check_instrumentation(), array_bound_check_interprocedural(), array_dfg(), atomizer(), bottom_up_abc_base_reference_implied_do(), bottom_up_abc_call(), bottom_up_abc_reference(), check_input_file_syntax(), checkpoint_workspace(), clean_up_sequences_rewrite(), continue_create_workspace_notify(), create_workspace(), db_close_module(), db_save_workspace(), delete_some_resources(), display_alias_check_statistics(), display_alias_propagation_statistics(), display_bottom_up_abc_statistics(), display_clean_up_sequences_statistics(), display_impact_alias_statistics(), display_interprocedural_abc_statistics(), display_top_down_abc_statistics(), display_unspaghettify_statistics(), display_used_before_set_statistics(), do_resource_usage_check(), end_directory_notify(), find_statements_interactively_walker(), formal_array_resizing_bottom_up(), full_unroll(), full_unroll_pragma(), get_view_file(), gpips_display_graph_file_display(), gpips_user_request(), impact_check(), initialize_and_verify_common_variable(), initialize_and_verify_local_variable(), interactive_hyperplane_direction(), interactive_partitioning_matrix(), interprocedural_abc_arrays(), interprocedural_abc_statement_rwt(), lazy_open_module(), LinkInstToCurrentBlock(), logs_off(), loop_chunk_size_and_strip_mine(), main(), make_close_workspace(), make_special_value(), NewStmt(), notify_hpfc_file_view(), open_module(), open_workspace(), open_workspace_notify(), options_select(), parse_arguments(), pips_main(), pips_signal_handler(), print_array_dfg(), print_bdt(), print_code_static_control(), print_plc(), process_user_file(), put_summary(), referencenodeclfilter(), reindexing(), safe_concurrent_apply(), safe_do_something(), safe_set_property(), select_a_module_by_default(), select_rule(), set_env_log_and_free(), single_assign(), static_controlize(), stmt_flt(), strip_mine(), SubstituteAlternateReturns(), text_comp_region(), text_region_no_action(), top_down_abc_array(), tp_system(), unroll(), update_options(), UpdateEntity(), wpips_display_graph_file_display(), wpips_interrupt_pipsmake(), and wpips_user_request().

+ Here is the call graph for this function:

Variable Documentation

◆ current_module

◆ current_phase

string current_phase = NULL
static

CATCH/TRY/UNCATCH/THROW stuff is here.

pips meta information from pipsmake are made available here... (current phase and module...)

Definition at line 62 of file message.c.

Referenced by get_pips_current_pass_name(), reset_pips_current_computation(), and set_pips_current_computation().

◆ log_file

FILE* log_file = NULL
static

The log file is closed by default.

Definition at line 159 of file message.c.

Referenced by close_log_file(), open_log_file(), pips_log_display(), pips_log_end(), and pips_stop_desc().

◆ pips_cc

string pips_cc = NULL
static

Definition at line 100 of file message.c.

Referenced by open_xml_logfile(), and set_pips_meta_informations().

◆ pips_date

string pips_date = NULL
static

Definition at line 99 of file message.c.

Referenced by open_xml_logfile(), and set_pips_meta_informations().

◆ pips_error_handler

void(* pips_error_handler) (const char *, const char *, va_list *) ( const char *  ,
const char *  ,
va_list *   
) = NULL

PROMPT_USER schould be implemented.

(its a warning with consent of the user) The question is: how schould it be called? USER_ERROR is a function that should be called to terminate the current PIPS request execution or to restore the previous saved stack environment when an error in a Fortran file or elsewhere is detected. USER_ERROR first prints on stderr a description of the error, then tests the property ABORT_ON_USER_ERROR and aborts case true. Else it will restore the last saved stack environment (ie. come back to the last executed setjmp(pips_top_level) ), except for eventuality it has already been called. In this case, it terminates execution with exit. USER_ERROR should be called as:

USER_ERROR(fonction, format [, arg] ... )

where function is a string containing the name of the function calling USER_ERROR, and where format and arg-list are passed as arguments to vprintf.

Modifications:

  • user_error() was initially called when a Fortran syntax error was encountered by the parser; execution was stopped; this had to be changed because different kind of errors can occur and because pips is no longer structured using exec(); one has to go back to PIPS top level, in tpips or in wpips; (Francois Irigoin, 19 November 1990)
  • user_error() calls (* pips_error_handler) which can either be default_user_error or a user_error function specific to the used top-level. But each user_error function should have the same functionalities. default assignment of pips_error_handler is default_user_error. Some top-level (eg. wpips) may need a special user_error proceedure; they should let pips_error_handler point toward it.

Definition at line 455 of file message.c.

Referenced by atinit(), gpips_main(), pips_log_alist(), tpips_init(), and wpips_main().

◆ pips_internal_error_handler

void(* pips_internal_error_handler) (const char *, const char *,...) ( const char *  ,
const char *  ,
  ... 
) = NULL

PIPS_ERROR is a function that should be called to terminate PIPS execution when data structures are corrupted.

PIPS_ERROR should be called as: PIPS_ERROR(fonction, format [, arg] ... ) where function is a string containing the name of the function calling PIPS_ERROR, and where format and arg-list are passed as arguments to vprintf. PIPS_ERROR terminates execution with abort.

Definition at line 511 of file message.c.

Referenced by pips_log_alist(), and tpips_init().

◆ pips_log_handler

void(* pips_log_handler) (const char *fmt, va_list *args) ( const char *  fmt,
va_list *  args 
) = NULL

USER_LOG is a function that should be called to log the current PIPS request, as soon as it is relevant.

loging will occure if property USER_LOG_P is TRUE. USER_LOG should be called as:

USER_LOG(format [, arg] ... )

where format and arg-list are passed as arguments to vprintf. default assignment of pips_log_handler is default_user_log. Some top-level (eg. wpips) may need a special user_log proceedure; they should let pips_log_handler point toward it.

Every procedure pointed to by pips_log_handler must test the property USER_LOG_P; this is necessary because (* pips_log_handler) may be called anywhere (because VARARGS), whithout verifying it.

Definition at line 216 of file message.c.

Referenced by atinit(), gpips_main(), pips_log_alist(), and wpips_main().

◆ pips_log_recursion_count

int pips_log_recursion_count = 0
static

Definition at line 1087 of file message.c.

Referenced by pips_log_done(), and pips_log_in_progress().

◆ pips_request_handler

string(* pips_request_handler) (const char *, va_list *) ( const char *  ,
va_list *   
)
default

default assignment of pips_request_handler is default_user_request.

Some top-level (eg. wpips) may need a special user_request proceedure; they should let pips_request_handler point toward it.

Definition at line 139 of file message.c.

145 {
146  va_list args;
147  va_start(args, a_message_format);
148  string str = (* pips_request_handler)(a_message_format, &args);
149  va_end(args);
150  return str;
151 }

Referenced by gpips_main(), tpips_init(), and wpips_main().

◆ pips_revisions

string pips_revisions = NULL
static

Definition at line 98 of file message.c.

Referenced by open_xml_logfile(), and set_pips_meta_informations().

◆ pips_warning_handler

void(* pips_warning_handler) (const char *, const char *, va_list *) ( const char *  ,
const char *  ,
va_list *   
) = NULL

default assignment of pips_warning_handler is default_user_warning.

Some top-level (eg. wpips) may need a special user_warning proceedure; they should let pips_warning_handler point toward it.

Definition at line 325 of file message.c.

Referenced by gpips_main(), pips_log_alist(), and wpips_main().

◆ warning_file

FILE* warning_file = NULL
static

◆ warning_file_name

string warning_file_name = NULL
static

Definition at line 284 of file message.c.

Referenced by close_warning_file(), and open_warning_file().

◆ xml_logfile

FILE* xml_logfile = NULL
static

◆ xml_logfile_name

string xml_logfile_name = NULL
static

Definition at line 568 of file message.c.

Referenced by close_xml_logfile(), and open_xml_logfile().