PageRenderTime 48ms CodeModel.GetById 18ms RepoModel.GetById 0ms app.codeStats 0ms

/src/wml_backend/p4_gm4/lib/error.h

https://bitbucket.org/shlomif/website-meta-language
C Header | 77 lines | 32 code | 13 blank | 32 comment | 10 complexity | 8caadfff2a664e8775cfeadf43ea9e66 MD5 | raw file
Possible License(s): GPL-2.0, AGPL-1.0, LGPL-2.0
  1. /* Declaration for error-reporting function
  2. Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
  3. This file is part of the GNU C Library. Its master source is NOT part of
  4. the C library, however. The master source lives in /gd/gnu/lib.
  5. The GNU C Library is free software; you can redistribute it and/or
  6. modify it under the terms of the GNU Library General Public License as
  7. published by the Free Software Foundation; either version 2 of the
  8. License, or (at your option) any later version.
  9. The GNU C Library is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  12. Library General Public License for more details.
  13. You should have received a copy of the GNU Library General Public
  14. License along with the GNU C Library; see the file COPYING.LIB. If not,
  15. write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  16. Boston, MA 02111-1307, USA. */
  17. #ifndef _ERROR_H
  18. #define _ERROR_H 1
  19. #ifndef __attribute__
  20. /* This feature is available in gcc versions 2.5 and later. */
  21. # if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) || __STRICT_ANSI__
  22. # define __attribute__(Spec) /* empty */
  23. # endif
  24. /* The __-protected variants of `format' and `printf' attributes
  25. are accepted by gcc versions 2.6.4 (effectively 2.7) and later. */
  26. # if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7)
  27. # define __format__ format
  28. # define __printf__ printf
  29. # endif
  30. #endif
  31. #ifdef __cplusplus
  32. extern "C" {
  33. #endif
  34. #if defined (__STDC__) && __STDC__
  35. /* Print a message with `fprintf (stderr, FORMAT, ...)';
  36. if ERRNUM is nonzero, follow it with ": " and strerror (ERRNUM).
  37. If STATUS is nonzero, terminate the program with `exit (STATUS)'. */
  38. extern void error (int, int, const char *, ...)
  39. __attribute__ ((__format__ (__printf__, 3, 4)));
  40. extern void error_at_line (int, int, const char *,
  41. unsigned int, const char *, ...)
  42. __attribute__ ((__format__ (__printf__, 5, 6)));
  43. /* If NULL, error will flush stdout, then print on stderr the program
  44. name, a colon and a space. Otherwise, error will call this
  45. function without parameters instead. */
  46. extern void (*error_print_progname) (void);
  47. #else
  48. void error ();
  49. void error_at_line ();
  50. extern void (*error_print_progname) ();
  51. #endif
  52. /* This variable is incremented each time `error' is called. */
  53. extern unsigned int error_message_count;
  54. /* Sometimes we want to have at most one error per line. This
  55. variable controls whether this mode is selected or not. */
  56. extern int error_one_per_line;
  57. #ifdef __cplusplus
  58. }
  59. #endif
  60. #endif /* error.h */