Output functions
[GridLAB-D Core]


Detailed Description

Implements functions that send output to the current environment's console, error stream, and test result string using printf style args.

Debug, warning, errors, fatal messages should provide an indicate of the context in which the message is generated.


Defines

#define CHECK   0xcdcd

Typedefs

typedef int(*) PRINTFUNCTION (char *,...)

Enumerations

enum  FILESTREAM { FS_IN = 0, FS_STD = 1, FS_ERR = 2 }

Functions

int output_debug (char *format,...)
 Output a debug message to the stdout stream using printf style argument processing.
int output_error (char *format,...)
 Output an error message to the stdout stream using printf style argument processing.
int output_fatal (char *format,...)
 Output a fatal error message.
int output_message (char *format,...)
 Output a message to the stdout stream using printf style argument processing.
int output_notify_error (void(*notify)(void))
int output_profile (char *format,...)
 Output a profiler message.
int output_progress ()
 Output a progress report.
int output_raw (char *format,...)
 Output a raw string to the stdout stream using printf style argument processing.
FILE * output_redirect (char *name, char *path)
FILE * output_redirect_stream (char *name, FILE *fp)
PRINTFUNCTION output_set_stderr (PRINTFUNCTION call)
 Set the stderr print function.
PRINTFUNCTION output_set_stdout (PRINTFUNCTION call)
 Set the stdout print function.
FILE * output_set_stream (FILESTREAM fs, FILE *newfp)
int output_test (char *format,...)
 Output an test message to the stdout stream using printf style argument processing.
int output_verbose (char *format,...)
 Output a verbose message to the stdout stream using printf style argument processing.
int output_warning (char *format,...)
 Output a warning message to the stdout stream using printf style argument processing.
int output_xsd (char *spec)
 Output the XSD snippet of a class.

Variables

void(*) notify_error (void) = NULL
int overflow = CHECK


Enumeration Type Documentation

enum FILESTREAM

Enumerator:
FS_IN 
FS_STD 
FS_ERR 

Definition at line 16 of file output.h.


Function Documentation

int output_debug ( char *  format,
  ... 
)

Output a debug message to the stdout stream using printf style argument processing.

output_debug() will produce output to the standard output stream only when the global_debug_output variable is not 0. Debug messages are always preceded by the string "DEBUG: " and a newline is always appended to the message.

Definition at line 335 of file output.c.

Referenced by dlload_error(), exec_debug(), exec_debug_cmd(), exec_sigint(), exec_start(), and timestamp_test().

int output_error ( char *  format,
  ... 
)

Output an error message to the stdout stream using printf style argument processing.

output_error() will produce output to the standard output stream. Error messages are always preceded by the string "ERROR: " and a newline is always appended to the message.

Definition at line 253 of file output.c.

References notify_error.

Referenced by aggregate_mkgroup(), gld_loadHndl::characters(), class_define_map(), class_define_type(), class_property_to_string(), class_register(), class_register_type(), class_string_to_property(), cmdarg_load(), cmex_create(), cmex_get(), cmex_getenv(), cmex_global(), cmex_list(), cmex_load(), cmex_module(), cmex_object_list(), cmex_set(), cmex_setenv(), cmex_start(), gld_loadHndl::endDocument(), environment_start(), gld_loadHndl::error(), exec_debug_cmd(), exec_sigint(), exec_start(), exec_test(), gld_loadHndl::fatalError(), find_objects(), global_init(), global_setvar(), load_java_module(), load_python_module(), load_tzspecs(), main(), mexFunction(), module_libinfo(), module_load(), object_dump(), object_get_value_by_addr(), object_set_double_by_name(), object_set_value_by_addr(), object_set_value_by_name(), output_xsd(), gld_loadHndl::startElement(), and unit_init().

int output_fatal ( char *  format,
  ... 
)

Output a fatal error message.

output_fatal() will produce output to the standard output stream. Error messages are always preceded by the string "FATAL: " and a newline is always appended to the message.

Definition at line 233 of file output.c.

Referenced by class_register(), cmdarg_load(), environment_start(), index_insert(), load_module_list(), local_datetime(), main(), object_tree_delete(), and throw_exception().

int output_message ( char *  format,
  ... 
)

Output a message to the stdout stream using printf style argument processing.

output_message() will produce output to the standard output stream only when the global_quiet_mode variable is not 0. A newline is always appended to the message.

Definition at line 382 of file output.c.

Referenced by cmex_getenv(), cmex_load(), cmex_module(), environment_start(), exec_debug_cmd(), exec_start(), global_dump(), legal_license(), legal_notice(), load_latitude(), load_longitude(), main(), output_profile(), output_progress(), output_xsd(), and syntax_error().

int output_raw ( char *  format,
  ... 
)

Output a raw string to the stdout stream using printf style argument processing.

output_raw() will produce output to the standard output stream only when the global_quiet_mode variable is not 0.

Definition at line 448 of file output.c.

Referenced by exec_debug(), mexFunction(), module_libinfo(), and output_progress().

PRINTFUNCTION output_set_stderr ( PRINTFUNCTION  call  ) 

Set the stderr print function.

The default function sends error message strings to the stderr stream. Applications that need a handle such messages differently can request they be sent to the function call.

Parameters:
call  The printf style function to call to send text to stderr

Definition at line 220 of file output.c.

Referenced by mexFunction().

PRINTFUNCTION output_set_stdout ( PRINTFUNCTION  call  ) 

Set the stdout print function.

The default function sends normal message strings to the stdout stream. Applications that need a handle such messages differently can request they be sent to the function call.

Parameters:
call  The printf style function to call to send text to stdout

Definition at line 207 of file output.c.

Referenced by mexFunction().

int output_test ( char *  format,
  ... 
)

Output an test message to the stdout stream using printf style argument processing.

output_test() will produce output to the test output file defined by the variable global_testoutputfile. A newline is always appended to the message.

Definition at line 276 of file output.c.

References global_getvar().

Referenced by debug_traverse_tree(), random_test(), timestamp_test(), and unit_test().

int output_verbose ( char *  format,
  ... 
)

Output a verbose message to the stdout stream using printf style argument processing.

output_verbose() will produce output to the standard output stream only when the global_verbose_mode variable is not 0. Verbose message always have leading spaces and an ellipsis printed before the string, and a newline is always appended to the message.

Definition at line 360 of file output.c.

Referenced by class_define_map(), class_get_class_from_classname(), class_register(), cmex_module(), gld_loadHndl::endDocument(), environment_start(), exec_debug_cmd(), exec_start(), exec_test(), gld_loadHndl::ignorableWhitespace(), index_create(), index_insert(), index_shuffle(), load_tzspecs(), main(), module_load(), timestamp_test(), unit_init(), and unit_test().

int output_warning ( char *  format,
  ... 
)

Output a warning message to the stdout stream using printf style argument processing.

output_warning() will produce output to the standard output stream only when the global_warn_mode variable is not 0. Warning messages are always preceded by the string "WARNING: " and a newline is always appended to the message.

Definition at line 311 of file output.c.

Referenced by class_define_map(), cmdarg_load(), gld_loadHndl::endDocument(), mexFunction(), random_bernoulli(), random_degenerate(), random_exponential(), random_normal(), random_pareto(), random_sampled(), random_test(), random_uniform(), unit_init(), and gld_loadHndl::warning().

int output_xsd ( char *  spec  ) 

Output the XSD snippet of a class.

is this needed? -mh

Definition at line 472 of file output.c.

References class_get_class_from_classname(), class_get_first_class(), class_get_xsd(), module_load(), s_class_list::next, output_error(), and output_message().

Referenced by cmdarg_load().


GridLAB-DTM Version 1.0
An open-source project initiated by the US Department of Energy