error.h.html 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. <?xml version='1.0' encoding='iso-8859-1'?>
  2. <!doctype html public '-//W3C//DTD XHTML 1.0 Strict//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
  3. <html xmlns='http://www.w3c.org/1999/xhtml' lang='en-us'>
  4. <head>
  5. <title>
  6. error.h
  7. </title>
  8. <meta http-equiv='content-type' content='text/html;iso-8859-1'/>
  9. <meta name='generator' content='motley-tools 1.9.4 13:40:33 Feb 18 2015'/>
  10. <meta name='author' content='cmaier@cmassoc.net'/>
  11. <meta name='robots' content='noindex,nofollow'/>
  12. <link href='toolkit.css' rel='stylesheet' type='text/css'/>
  13. </head>
  14. <body>
  15. <div class='headerlink'>
  16. [<a href='endian.h.html' title=' endian.h '>PREV</a>]
  17. [<a href='toolkit.html' title=' Index '>HOME</a>]
  18. [<a href='ether.h.html' title=' ether.h '>NEXT</a>]
  19. </div>
  20. <pre>
  21. /*====================================================================*
  22. *
  23. * error.h - error function definitions and declarations;
  24. *
  25. * this file is an alterantive to GNU header file of the same
  26. * name; in addition to standard GNU error function declarations,
  27. * some additional functions are declared;
  28. *
  29. * Motley Tools by Charles Maier &lt;cmaier@cmassoc.net&gt;;
  30. * Copyright 2001-2006 by Charles Maier Associates;
  31. * Licensed under the Internet Software Consortium License;
  32. *
  33. *--------------------------------------------------------------------*/
  34. #ifndef ERROR_HEADER
  35. #define ERROR_HEADER
  36. /*====================================================================*
  37. * system header files;
  38. *--------------------------------------------------------------------*/
  39. #include &lt;errno.h&gt;
  40. /*====================================================================*
  41. * custom header files;
  42. *--------------------------------------------------------------------*/
  43. #include &quot;../tools/types.h&quot;
  44. /*====================================================================*
  45. *
  46. *--------------------------------------------------------------------*/
  47. #if defined (WIN32)
  48. #define __func__ __FUNCTION__
  49. #endif
  50. /*====================================================================*
  51. * define error codes for systems that do not support POSIX codes;
  52. *--------------------------------------------------------------------*/
  53. #ifndef ECANCELED
  54. #define ECANCELED 0
  55. #endif
  56. #ifndef ENOTSUP
  57. #define ENOTSUP EPERM
  58. #endif
  59. #ifndef EBADMSG
  60. #define EBADMSG 0
  61. #endif
  62. #ifndef EPROTONOSUPPORT
  63. #define EPROTONOSUPPORT 124
  64. #endif
  65. #ifndef ENODATA
  66. #define ENODATA 0
  67. #endif
  68. #ifndef EOVERFLOW
  69. #define EOVERFLOW 0
  70. #endif
  71. /*====================================================================*
  72. * define common error message strings;
  73. *--------------------------------------------------------------------*/
  74. #define ERROR_NOTROOT &quot;This program needs root privileges&quot;
  75. #define ERROR_TOOMANY &quot;Too many command line arguments&quot;
  76. #define CANT_START_TIMER &quot;function %s can't start timer&quot;, __func__
  77. #define CANT_RESET_TIMER &quot;function %s can't reset timer&quot;, __func__
  78. /*====================================================================*
  79. *
  80. *--------------------------------------------------------------------*/
  81. #define TRACE error (0, 0, &quot;%s (%d)&quot;, __FILE__, __LINE__);
  82. /*====================================================================*
  83. * declare GNU error() and error_at_line() functions;
  84. *--------------------------------------------------------------------*/
  85. #ifdef __GNUC__
  86. __attribute__ ((format (printf, 3, 4)))
  87. #endif
  88. signed error (signed status, errno_t number, char const * format, ...);
  89. #ifdef __GNUC__
  90. __attribute__ ((format (printf, 3, 4)))
  91. #endif
  92. signed debug (signed status, char const * string, char const * format, ...);
  93. signed extra (signed status, errno_t number, int argc, char const * argv []);
  94. /*====================================================================*
  95. * end definitions and declarations;
  96. *--------------------------------------------------------------------*/
  97. #endif
  98. </pre>
  99. <div class='footerlink'>
  100. [<a href='endian.h.html' title=' endian.h '>PREV</a>]
  101. [<a href='toolkit.html' title=' Index '>HOME</a>]
  102. [<a href='ether.h.html' title=' ether.h '>NEXT</a>]
  103. </div>
  104. </body>
  105. </html>