ITK Function Reference

(V10000.1.0.60_20160308.00)
error.h
Go to the documentation of this file.
1 /*HEAD ERROR HHH SYSS */
2 /*==================================================================================================
3 
4  Copyright (c) 1992-2005 UGS Corp.
5  Unpublished - All rights reserved
6 
7 ====================================================================================================
8 File description:
9 
10 ERROR system include file
11 
12 ====================================================================================================
13  Date Name Description of Change
14 
15 20-June-1989 Hugh Stewart Written
16 20-Sep-1990 Terry Ploeger Add new func declarations.
17  2-Oct-1990 Bernard Solomon For GNU use __BASE_FILE__ to get better error messages
18 10-Oct-1990 Alan Braggins make lprintf return int cf. printf
19 15-Oct-1990 Alan Braggins declare ERROR_special_routine_name on SPARC
20 15-Oct-1990 Alan Braggins need dummy address_of_caller on sparc
21  5-Feb-1991 Daniel Dignam define ERROR_this_file-name for HP_68K:
22  6-Feb-1991 Daniel Dignam HP_68K port
23 28-Feb-1991 Daniel Dignam Add ERROR_set_system_log_name
24  8-Aug-1991 tim carter HP/RISC port
25 07-Feb-1992 bernard Initial revision of dev branch
26 20-Mar-1992 Tim Carter Port to DECstation
27 16-Apr-1992 Hugh Stewart declare ERROR_special_routine_name on HP
28 30-Apr-1992 Hugh Stewart lower case hp9000s300 defined name
29 11-May-1992 Mike Abbott Add UG headers
30 13-May-1992 Mike Abbott Add UG machine-dependent header card
31 14-May-1992 Bernie Solomon Use STDC signal prototype where necessary
32 06-Jul-1992 Bernie Solomon Add debug handler
33 07-Jul-1992 Bernie Solomon Add ERROR_reraise
34 07-Oct-1992 Bernie Solomon Add ERROR_PROTECT macros etc.
35 07-Oct-1992 Bernie Solomon Add
36 20-Oct-1992 Bernie Solomon Make filename args const
37 09-Nov-1992 Bernie Solomon Remove signal handling routines
38 09-Dec-1992 Mike Abbott Add ERROR_ask_system_log
39 07-Jan-1993 Alan Braggins jlint function pointer not void*
40 02-Dec-1992 Dennis Lavarini Include basic.h in this header file
41 17-Jan-1993 Daniel Dignam phase 8 ccr
42 22-Jan-1993 Mike Abbott Add error number decoder routines
43 23-Jan-1993 Daniel Dignam Should not include uguidefs.h
44 25-Jan-1993 Mike Abbott Take out PROMPT (char *) to keep things clean, and comment
45 25-Jan-1993 Mike Abbott Add warning about internationalisation
46 11-Mar-1993 Bernie Solomon Fix for OSF port
47 26-Mar-1993 Bernie Solomon Add a user signal routine so we can call KABORT for Parasolid
48 26-Mar-1993 Bernie Solomon Make ERROR_decode_in_table take void *
49 21-Apr-1993 Bernie Solomon Add in exception handling
50 07-May-1993 Alan Braggins ERROR_generic_routine_t to use generic_routine_t
51 14-May-1993 Bernie Solomon Add log file status stuff
52 18-May-1993 Daniel Dignam ERROR_system_log_name_len should be longer
53 15-Jun-1993 Mike Reger Removed SYS card
54 17-Jun-1993 Daniel Dignam Add protoype for error_get_stack
55 23-Jun-1993 Daniel Dignam IP1c integration
56 25-Jun-1993 Bernie Solomon Make ERROR_ask_system_log take void
57 25-Jun-1993 Keith Simpson IBM RS/6000 Port - Defined ERROR_this_file_name for IBM
58  platform by adding IBM_AIX to an #if
59 02-Jul-1993 Daniel Dignam 1f CCR
60 29-Jul-1993 Bernie Solomon Add ERROR_acknowledge_handled
61 30-Jul-1993 Bernie Solomon Replace leading underscores in ERROR_PROTECT macros
62 05-Jan-1994 Daniel Dignam ERROR_address_of_caller works on OSF as well
63 14-Jan-1994 Bernie Solomon Add ERROR_EXCEPTION_PROTECT
64 10-Feb-1994 Brian Eschner Remove ifdef around declaration of ERROR_special_routine_name
65 15-Nov-1993 Kurt Kohlhase Add ERROR_ask_base
66 06-Mar-1994 Daniel Dignam 2e integration
67 07-Mar-1994 Daniel Dignam Add error_cxx_demangle
68 27-May-1994 Bernie Solomon Fix example in comment to have better style
69  Add ERROR_init_module_no_log_file()
70 01-Jun-1994 Mark Fawcett add a more general version of ERROR_log_file_to_stdout
71 09-Jun-1994 Mike Sze Add prototype for ERROR_read_symbol_table, ERROR_save_symbol_table
72 24-Jun-1994 Mike Abbott Include unidefs.h before we obsolete basic.h
73 31-Aug-1994 Mike Abbott Phase 4 integration (Remove Mike Sze changes, basic.h)
74 18-Nov-1994 Bernie Solomon Add ERROR_user_abort and associated code ERROR_USER_ABORT
75  Rename ERROR_INTERNAL_ERROR as ERROR_INTERNAL_ERROR_CODE for Win NT clash
76 17-Mar-1995 Keith Hafen Move to product syss
77 22-Mar-1995 Alasdair Mackintosh Put correct head card into Jeeves
78 22-Mar-1995 Alasdair Mackintosh Put correct head card into Jeeves
79 31-Mar-1995 Alasdair Mackintosh Fix up head/class cards
80 14-Jul-1995 Daniel Dignam Add ERROR_shared_library_unloaded
81 19-Aug-1996 Tom Slossar Enable the suppression of error reporting
82 22-Aug-1996 Adrian Brown CCR Phase 10 of V12.0
83 19-Sep-1996 Daniel Dignam ip14 integration
84 16-Jan-1997 Adrian Brown Fix ERROR_PROTECT to pass new cc_check variable scope check
85 11-Feb-1997 Bernie Solomon Make ERROR_get_stack return a logical and document its interface
86 11-Feb-1997 Bernie Solomon Make ERROR_get_stack interface return a logical and document it
87 14-Feb-1997 Bernie Solomon Change for new exception & escape handling
88 22-Apr-1997 Bernie Solomon Add ERROR_ask_system_log_stream to get at the FILE * by routine call
89 09-Sep-1997 Jack Marr DLL breakup: make ERROR_system_log private to libsyss
90 18-Sep-1997 Mike Abbott Integrate v14.0 phase 4 changes
91 23-Oct-1997 Bernie Solomon lprintf clashes with Exceed V6 so rename it on WNT
92 11-Nov-1997 Keith Jaskot Added missing f to lprintf #define
93 14-Nov-1997 Bernie Solomon CCR time
94 20-Jul-1998 Adrian Brown Resynch Jeeves and CMS
95 11-Aug-1998 Bernie Solomon Reword comment on ERROR_exception as it has confused people
96 13-Nov-1998 Jack Marr Move error decoder stuff to error_decode.h
97 16-Nov-1998 Bernie Solomon Add extern "C" for C++ use
98 25-Jan-1999 Bernie Solomon V16.0 phase 1 CCR
99 08-Mar-1999 Reger Decorate prototypes with UGEXPORT;
100  remove VMSisms and other archaic
101  oddities
102 18-Mar-1999 Gary Smethers V16 phase 5 CCR
103 30-Jun-1999 Jack Marr Redo arg names to avoid conflict on WNT
104 08-Jul-1999 Alexandra Wagner ip13 CCR
105 06-Oct-1999 Lavarini Split the SYSSPRIVATE data into error_noexport.h
106  Use SYSSEXPORT to decorate prototypes
107 29-Oct-1999 Gary Smethers V16 phase 20 CCR
108 01-May-2000 Jack Marr Revise ERROR_cxx_demangle signature
109 20-Jun-2000 JS Modified for CFI long file name project.
110 19-Oct-2001 Bernie Solomon Add ERROR_set_raise_handler/ERROR_cancel_raise_handler
111 26-Oct-2001 Adrian Brown Add ERROR_ask_detailed_routine_name
112 07-Mar-2002 Jon Runyon Release V1804 projects into V19
113 16-Apr-2002 KHafen remove dependency on CFI
114 22-Nov-2002 Jack Marr Note that lprintf is printf-like
115 09-Dec-2002 Jack Marr Add const to ERROR_set_system_log arg
116 23-Jan-2003 Marjorie Anne Espinosa Make timestamp function extern
117 02-Apr-2003 Steve Kunkee ARCH0015a: C++ compatibility
118  change ifdef to if on __cplusplus and
119  CPLUSPLUS_COMPILE
120 03-Jun-2003 Alexandra Wagner PR#4782592: Add ERROR_note_traceback
121 23-Jun-2003 Jack Marr Remove aix-specific ERROR_cxx_demangle_ask_number_of_arguments()
122 NX3
123 17-Jul-2003 Lavarini Split off error_datatypes.h and error_protect.h
124 18-Jul-2003 Lavarini Enhance to use C++ throw/catch of class objects
125 26-Sep-2003 Lavarini Add pragma
126 02-Nov-2003 Lavarini Add uft_utils.h to pragma
127 12-Jan-2004 Lavarini Replace ERROR_raise_handler_t with
128  ERROR_raise_handler_fn_p_t
129 19-Jan-2004 Bernie Solomon Change the routine assertions call
130 21-Jan-2004 Bernie Solomon Add ERROR_trace_back_to_log
131 23-Jan-2004 Lavarini Re-implement ERROR debug handler in NX3
132 04-Feb-2004 KHafen Add support for a ui message in internal errors
133 04-Mar-2004 KHafen Remove C++ token that is no longer needed
134 28-Apr-2004 BJS Remove unimplemented version of ERROR_enter_debugger
135 02-Jun-2004 Bernie Solomon Add ERROR_severe
136 13-Dec-2004 Nilesh Lakhotia Added pvtrans*.h to pragma.
137 09-Feb-2005 Raman Garimella Added ERROR_ask_count_of_signal_errors
138 13-Apr-2005 Bernie Solomon Make ERROR_assertion_failed printf-like
139 03-May-2005 Lavarini Add jam_errors.h to pragma.
140 11-May-2005 Nilesh Lakhotia Delete pvtrans*.h from #pragma
141 13-Jul-2005 Alasdair Mackintosh Add ERROR_vraise
142 $HISTORY$
143 ==================================================================================================*/
144 #ifndef ERROR_H_INCLUDED
145 #define ERROR_H_INCLUDED
146 
147 /* <DJL> 26-Sep-2003
148 * The header files in the pragma are necessary for the most part because
149 * these header files define macros that raise errors or write to the system
150 * log. The header om.h is the exception; error.h needs to be removed from
151 * om.h.
152 */
153 /* <DJL> 03-May-2005
154 * Add jam_errors.h to pragma. This is necessary because the JA/JAX functions
155 * use the ERROR macros/functions, and they are picking up error.h because it is
156 * currently included in om.h. I have changed jam_errors.h so that JA/JAX functions
157 * can pick up error.h without depending on error.h being included in om.h.
158 */
159 #ifdef __lint
160 # pragma uginclude only_in_error "assert.h","cerr.h","debug_macros.h",\
161  "dss_regen_context_datatypes.h","dss_trace.h","error_noexport.h",\
162  "fa_error_codes.h","fcp.h","git_internal.h","gr_opman.h","jam_errors.h","rdebug.h",\
163  "sf_map_lp_kit.h","sf_mm_internal.h","sim_error.h","stl_stdpccts.h",\
164  "sv_error.h","tol_feat_internal_datatypes.h","uft_rl_tests.h",\
165  "uft_rte_tests.h","uft_utils.h","ugfont.h","*_definitions.h",\
166  "*.c","*.cpp","*.cxx","om.h";
167 #endif
168 
169 #include <stdarg.h>
170 #include <stdio.h>
171 
172 /*<KDH> 16-Apr-2002
173  WARNING: Do not add any other UG headers to this file, as the IMAN ITK releases
174  error.h with their product.
175 */
176 
177 /* <JLM> 13-May-98
178  Moved error decoder stuff to error_decode.h and error_decode_privileged.h
179  as a facet of the effort to eliminate nesting of error_bases.h. In order
180  to avoid having to edit many of the routines that included error.h to get
181  at the prototypes now in error_decode.h, we include that here, although
182  it should be included directly if needed. QAZ/cc_check warnings will
183  help nudge us in that direction.
184 
185  The prototypes for actually registering error codes are in
186  error_decode_privileged.h, which may not be nested.
187  */
188 
189 #include <error_datatypes.h>
190 #include <error_decode.h>
191 #include <error_protect.h>
192 
193 /* The following must be the last include file */
194 #include <libsyss_exports.h>
195 
196 /* ERROR_init_module
197 
198  Initialises error handling system. It is best if this is called
199  as early on in a run as possible.
200 */
201 extern SYSSEXPORT void ERROR_init_module(void);
202 extern SYSSEXPORT void ERROR_exit_module(void);
203 
204 /* <Haiming Gu> 03-Dec-2010
205  The following section of typedef and functions allows the libsyss comsumer
206  to define its own print_log and use the same upon proper initialization - this
207  can be done by invoking ERROR_set_print_log_replacement in the consumer code.
208  Additionally, an int argument (default to 1, meaning true) can be passed into
209  ERROR_set_print_log_replacement to decide if print_log should preserve the legacy
210  log entries, prior to making additional log.
211 */
212 typedef void (*ERROR_print_log_fn_t) (const char *type, const char *file_name, int line_number, const char *message);
213 extern SYSSEXPORT void ERROR_set_print_log_replacement(ERROR_print_log_fn_t function, int do_legacy);
214 
215 extern SYSSEXPORT int ERROR_needLegacyLog();
216 extern SYSSEXPORT void ERROR_doAdditionalLog(const char *type, const char *file_name, int line_number, const char *message);
217 
218 typedef void (*ERROR_display_fn_t) ( const int ifail, const int type, const char* message);
219 extern SYSSEXPORT void ERROR_register_display_fn(ERROR_display_fn_t);
220 
221 /* ERROR_init_module_no_log_file
222 
223  <BJS> 27-May-94
224  Initialise the ERROR module so that you can set error handlers
225  but the log file isn't open yet. Errors will go to stderr in this
226  case. A subsequent call to ERROR_init_module will complete the
227  initialisation and open the log file.
228 */
229 extern SYSSEXPORT void ERROR_init_module_no_log_file(void);
230 
231 /* ERROR_set_traceback
232 
233  Sets a flag (static to error.c) used to toggle whether to do a traceback
234  or not on an error. The initial state of this flag is true.
235 */
236 extern SYSSEXPORT void ERROR_set_traceback(logical state);
237 
238 /* ERROR_ask_traceback
239 
240  Returns the flag value set by ERROR_set_traceback.
241 */
242 extern SYSSEXPORT logical ERROR_ask_traceback(void);
243 
244 /* <BJS> 14-May-93
245  Routines to ask and set the current log file status
246 */
247 
248 extern SYSSEXPORT void ERROR_set_log_file_status(ERROR_log_file_status_t status);
249 extern SYSSEXPORT ERROR_log_file_status_t ERROR_ask_log_file_status(void);
250 
251 
252 /* ERROR_ask_signal_code
253 
254  Returns the last signal code raised by the OS as an offset
255  from ERROR_sig_base. The last signal can be found in ERROR_ask_failure_code
256 */
257 
258 extern SYSSEXPORT int ERROR_ask_signal_code(void);
259 
260 
261 /* ERROR_note
262 
263  Generates a warning message. Note this is totally transparent
264  to the user of the system.
265 
266  Prints suitable information somewhere.
267 
268  It will only produce a traceback if checking is turned on.
269 
270  Returns.
271 */
272 extern SYSSEXPORT void ERROR_note(const char *file_name, int line_number,
273  const char *control_string, ...);
274 
275 /* ERROR_note_traceback
276 
277  Generates a warning message. Note this is totally transparent
278  to the user of the system.
279 
280  Prints suitable information somewhere.
281 
282  It will produce a traceback independent of the checking level.
283 
284  PLEASE ONLY USE IF YOU ABSOLUTELY,POSITIVELY,DEFINITELY WANT
285  A TRACEBACK TO APPEAR IN CUSTOMER VERSIONS! Otherwise use
286  ERROR_note.
287 
288  Returns.
289 */
290 extern SYSSEXPORT void ERROR_note_traceback(const char *file_name, int line_number,
291  const char *control_string, ...);
292 
293 /* ERROR_vnote
294 
295  like ERROR_note but takes a va_list
296 */
297 extern SYSSEXPORT void ERROR_vnote(const char *file_name, int line_number,
298  const char *control_string, va_list args);
299 
300 /* ERROR_escape
301 
302  <BJS> 10-Feb-97
303  Generate an ESCAPE event which isn't caught be error handlers.
304  Only for use by CLINK and so on in UG. So no message arguments.
305 */
306 
307 extern SYSSEXPORT void ERROR_escape(const char *file_name, int line_number, int exception_code_);
308 
309 /* ERROR_exception
310 
311  <BJS> 11-Aug-98
312  This is identical to ERROR_raise but does not produce a traceback in the log file
313 */
314 
315 extern SYSSEXPORT void ERROR_exception(const char *file_name, int line_number, int exception_code_,
316  const char *control_string, ...);
317 
318 /* ERROR_raise
319 
320  Raise an error condition which will get returned through the procedural
321  interface as a failure_code code. This has a subsiduary string message which
322  is a standard printf control string and arguments.
323  The recovery algorithm is as follows. Note that if called with no handlers
324  set up it changes to a ERROR_collapse.
325 
326  Print suitable information somewhere.
327 
328  while (handler stack not empty)
329  { Take top handler off stack.
330  Note current handler stack height.
331  Call handler with result of ERROR_ask_failure_code as argument.
332  if (handler has changed the stack height)
333  { Note this error somewhere.
334  if (stack has grown)
335  { Reset stack to value before calling handler
336  i.e. ignore extra handlers.
337  }
338  else
339  { Continue calling the
340  handler on the current top of the stack.
341  }
342  }
343  }
344 
345  None of the handlers caught it properly all we can do is
346  change the call to an ERROR_collapse.
347 */
348 extern SYSSEXPORT void ERROR_raise(const char *file_name, int line_number, int failure_code,
349  const char *control_string, ...);
350 
351 /* ERROR_vraise
352 
353  Version of ERROR_raise that takes a va_list
354 
355 */
356 extern SYSSEXPORT void ERROR_vraise (const char *file_name, int line_number, int failure_code, const char *control_string, va_list ap);
357 
358 /* ERROR_severe
359 
360  Raise a severe error condition.
361  This has a subsiduary string message which is a standard printf control string and
362  arguments.
363  The recovery algorithm is as follows. Note that if called with no handlers
364  set up it changes to a ERROR_collapse.
365 
366  Print suitable information somewhere.
367 
368  while (handler stack not empty)
369  { Take top handler off stack.
370  Note current handler stack height.
371  Call handler with result of ERROR_ask_failure_code as argument.
372  if (handler has changed the stack height)
373  { Note this error somewhere.
374  if (stack has grown)
375  { Reset stack to value before calling handler
376  i.e. ignore extra handlers.
377  }
378  else
379  { Continue calling the
380  handler on the current top of the stack.
381  }
382  }
383  }
384 
385  If none of the handlers caught it properly all we can do is
386  change the call to an ERROR_collapse.
387 */
388 extern SYSSEXPORT void ERROR_severe(const char *file_name, int line_number, int failure_code,
389  const char *control_string, ...);
390 
391 /* ERROR_internal
392 
393  Raise an internal error condition which will get returned through the procedural
394  interface as specially-defined failure code generated from inside this function.
395 
396  This is equivalent to ERROR_severe being called with ERROR_INTERNAL_ERROR_CODE.
397 */
398 extern SYSSEXPORT void ERROR_internal(const char *file_name, int line_number, const char *control_string, ...);
399 
400 /* <BJS> 8-Jan-2004
401  Special routine for assertion failures.
402  <BJS> 13-Apr-2005
403  Made to take format string and substitutions
404 */
405 extern SYSSEXPORT void ERROR_assertion_failed(const char *file_name, int line_number, const char *format, ...);
406 
407 /* ERROR_collapse
408 
409  Prints suitable information somewhere.
410  Then calls exit(EXIT_FAILURE).
411 
412  Note this routine should only be called in desperate circumstances.
413 */
414 extern SYSSEXPORT void ERROR_collapse(const char *file_name, int line_number,
415  const char *control_string, ...);
416 
417 /* ERROR_vcollapse
418 
419  like ERROR_collapse but takes a va_list
420 */
421 extern SYSSEXPORT void ERROR_vcollapse(const char *file_name, int line_number,
422  const char *control_string, va_list args);
423 
424 /* <BJS> 18-Nov-94
425  Generate a user abort exception (well its really an error
426  so ERROR_PROTECT catches it).
427 */
428 
429 extern SYSSEXPORT void ERROR_user_abort(const char *file_name, int line_number);
430 
431 /* ERROR_ask_statistics
432 
433  Returns statistics as to how many notes, errors (from ERROR_(v)raise) and
434  internal errors (from ERROR_(v)internal) have been raised.
435  Note there is no point in having a value for collapses!
436 
437 */
438 extern SYSSEXPORT void ERROR_ask_statistics(int *number_of_notes, int *number_of_raises, int *number_of_internals);
439 
440 /* ERROR_ask_count_of_signal_errors
441 
442 Returns a count of the number of signal errors that
443 were raised during a session
444 
445 */
446 extern SYSSEXPORT int ERROR_ask_count_of_signal_errors( void );
447 
448 /* ERROR_log_file_to_stdout
449 
450  debugging routines:
451  - copies up to the last 4000 characters of log file to stdout
452  - copies up to the last <nbytes> characters of log file to <stream>
453 */
454 extern SYSSEXPORT void ERROR_log_file_to_stdout(void);
455 extern SYSSEXPORT void ERROR_log_file_to_stream (int nbytes, FILE * stream);
456 
457 /* ERROR_set_note_handler
458 
459  sets up a routine that is called every time an ERROR_note is provoked
460 */
461 extern SYSSEXPORT void ERROR_set_note_handler(ERROR_note_handler_t note_handler);
462 
463 /* ERROR_cancel_note_handler
464 
465  clears the routine that is called every time an ERROR_note is provoked
466 
467  essentially calls ERROR_set_note_handler(NULL);
468 */
469 extern SYSSEXPORT void ERROR_cancel_note_handler(void);
470 
471 /* ERROR_set_raise_handler
472 
473  <BJS> 19-Oct-01
474  Set up a handler to be called before any error is raiseed. Different
475  from ERROR_set_handler in that the handler is persistent and never
476  automatically cancelled. Can be use e.g. so Fusion can dump
477  extra info in the syslog on errors.
478  Returns an id for the set up handler so it can be removed.
479 */
481 (
482  ERROR_raise_handler_fn_p_t raise_handler
483 );
484 
485 /* ERROR_cancel_raise_handler
486 
487  <BJS> 19-Oct-01
488  Cancel a previously set up raise handler.
489 */
490 extern SYSSEXPORT void ERROR_cancel_raise_handler(ERROR_raise_handler_id_t id);
491 
492 /* <BJS> 26-Mar-93
493  Routines to manipulate user suppliable signal routine.
494  Is simply called with the signal number and may return to
495  faulting code (e.g. for ^C) or continue fault handling
496 */
497 
498 extern SYSSEXPORT void ERROR_set_signal_handler(ERROR_signal_fn_t signal_fn);
499 extern SYSSEXPORT ERROR_signal_fn_t ERROR_ask_signal_handler(void);
500 
501 /* <BJS> 06-Jul-92
502  These routines allow you to set up one and only one debug handler
503  or enquire what the current debug handler is. If there is a debug handler
504  then this is called before any other handlers.
505 
506  If there is no debug handler then ERROR_ask_debug_handler returns NULL
507  for the handler.
508 */
509 
510 extern SYSSEXPORT ERROR_debug_handler_t ERROR_set_debug_handler ( const ERROR_debug_handler_t *pHandler );
511 
512 /* <DRD> 28-Feb-1991
513 
514  Allow people to set the system log name
515 */
516 extern SYSSEXPORT void ERROR_set_system_log(const char *name);
517 
518 /* <MRA> 09-Dec-1992
519  I now need to be able to ask what the system log name has been set to.
520  The returned value points to the internal string, so must not be
521  SM_free'd or overwritten. No space need be allocated for it by the
522  caller either. WARNING: a call to ERROR_set_system_log after the
523  log has been created and written to has no effect on the log, but will
524  change the value returned by this routine.
525 */
526 extern SYSSEXPORT char *ERROR_ask_system_log(void);
527 
528 /*
529 To be decided:
530 
531 how do we generate failure_codes.
532 system vs user failures. <TP> partially covered by ERROR_internal etc.
533 suitable information somewhere - clarify.
534 how do signals fit in.
535 how do interrupts fit in.
536 */
537 
538 /* <BJS> 23-Oct-97
539  This is pretty ugly. With Exceed V6 we have a clash
540  with 'lprintf' as a symbol so we get link problems.
541  For expediency I am just renaming the symbol via a macro.
542 */
543 #ifdef WNT
544 #define lprintf ERROR_lprintf
545 #endif
546 
547 /* <BJS> I do not think this routine should be here
548  or it should be called something else! (lprintf)
549 */
550 /*PRINTFLIKE1*/
551 extern SYSSEXPORT int lprintf(const char *control_string,...);
552 
553 /* <BJS> 22-Apr-97
554  ERROR_ask_system_log_stream is provided as an alternative way to
555  get at ERROR_system_log but by a routine call. This makes access outside
556  a NT DLL easier.
557 */
558 
559 extern SYSSEXPORT FILE *ERROR_ask_system_log_stream(void);
560 
561 extern SYSSEXPORT void ERROR_trace_back(FILE *);
562 
563 /* <BJS> 21-Jan-2004
564  Send a traceback to the log file - avoids use of FILE * outside libsyss for TCEng
565 */
566 extern SYSSEXPORT void ERROR_trace_back_to_log(void);
567 
568 extern SYSSEXPORT void ERROR_trace_set_output(FILE *);
569 
570 /* <DRD> 14-Jul-1995
571 
572  Called to inform the trace back code that a library has been unloaded, returns true
573  if everything went okay, false if it didn't
574 */
575 
576 extern SYSSEXPORT logical ERROR_shared_library_unloaded(void);
577 
578 /* <AB> 24-Oct-2001
579  Returns the name of the given function. The buffer needs to be
580  "long enough" - whatever that means. 512 should be enough according
581  to a comment from Jack Marr in error_wnt_trace_back.c.
582 
583  ERROR_ask_detailed_routine_name is like ERROR_routine_name except
584  that it gives you a line-number if it can (currently only supported
585  on Windows). For ERROR_ask_detailed_routine_name, I've replicated
586  ERROR_routine_name's rather awkward prototype for the sake of consistency
587  (and because on some platforms it just calls ERROR_routine_name).
588 */
589 extern SYSSEXPORT int ERROR_routine_name(ERROR_generic_routine_t fn, char *name);
590 extern SYSSEXPORT int ERROR_ask_detailed_routine_name(ERROR_generic_routine_t pc, char *buffer);
591 
592 /* <BJS> 10-Feb-97
593  ERROR_get_stack
594 
595  Return a set of PCs in the PCS array.
596  MAX_DEPTH is the length of the PCS array.
597  DEPTH is set to the actual number of array entries filled in and
598  may be less than MAX_DEPTH (e.g. is you get to main)
599  STREAM is used for printing extra messages about problems.
600  The return result is true if nothing particular went wrong and false
601  if we had problems unwinding the stack at some stage.
602 
603  The traceback is in the order such that the mostly deeply nested
604  routine on the stack is PCS[0]. In fact PCS[0] is always an
605  address in the caller of ERROR_get_stack itself.
606 */
607 
608 extern SYSSEXPORT logical ERROR_get_stack(FILE *stream, int max_depth, int *depth, ERROR_generic_routine_t *pcs);
609 
610 /* <DRD> 07-Mar-1994
611  Add C++ demangle routine
612  <JLM> 01-May-2000
613  Revise signature to omit *args, require sizeof output buffer ("decoded").
614  Return value is true if demangling succeeded regardless of whether result
615  is truncated. The decoded string will always be null terminated.
616 */
617 
618 extern SYSSEXPORT logical ERROR_cxx_demangle(const char *encoded, char *decoded, size_t buflen);
619 
620 /* <KDS> IBM RS/6000 Port - Added support for IBM_AIX */
621 /* <BDE> 09Feb94
622  * Remove ifdef "list of all known platforms..."
623  */
624 extern SYSSEXPORT int ERROR_special_routine_name (ERROR_generic_routine_t, char *);
625 extern SYSSEXPORT ERROR_generic_routine_t ERROR_address_of_caller (void);
626 
627 /* <TAS> 19-Aug-96
628  This is a registered function that determines if the
629  error reporting mechinism should be suppressed.
630 */
632 
633 extern SYSSEXPORT char * ERROR_timestamp ( void );
634 
635 #undef EXPORTLIBRARY
636 
637 #endif /* ERROR_H_INCLUDED */