err.h 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290
  1. /*++
  2. Copyright (c) 2016 Minoca Corp.
  3. This file is licensed under the terms of the GNU Lesser General Public
  4. License version 3. Alternative licensing terms are available. Contact
  5. info@minocacorp.com for details.
  6. Module Name:
  7. err.h
  8. Abstract:
  9. This header contains definitions for the old err/warn functions.
  10. Author:
  11. Evan Green 25-Jul-2016
  12. --*/
  13. #ifndef _ERR_H
  14. #define _ERR_H
  15. //
  16. // ------------------------------------------------------------------- Includes
  17. //
  18. #include <libcbase.h>
  19. #include <stdarg.h>
  20. #include <stddef.h>
  21. //
  22. // ---------------------------------------------------------------- Definitions
  23. //
  24. #ifdef __cplusplus
  25. extern "C" {
  26. #endif
  27. //
  28. // ------------------------------------------------------ Data Type Definitions
  29. //
  30. //
  31. // -------------------------------------------------------------------- Globals
  32. //
  33. //
  34. // -------------------------------------------------------- Function Prototypes
  35. //
  36. LIBC_API
  37. void
  38. err (
  39. int ExitCode,
  40. const char *Format,
  41. ...
  42. );
  43. /*++
  44. Routine Description:
  45. This routine prints the program name, the given printf-style formatted
  46. string, and the string of the current errno, separated by a colon and a
  47. space. This routine then exits the current program with the given exit
  48. value.
  49. Arguments:
  50. ExitCode - Supplies the value to pass to exit.
  51. Format - Supplies the printf style format string.
  52. ... - Supplies the remaining arguments to the string.
  53. Return Value:
  54. This routine does not return, as it calls exit.
  55. --*/
  56. LIBC_API
  57. void
  58. verr (
  59. int ExitCode,
  60. const char *Format,
  61. va_list Arguments
  62. );
  63. /*++
  64. Routine Description:
  65. This routine prints the program name, the given printf-style formatted
  66. string, and the string of the current errno, separated by a colon and a
  67. space. This routine then exits the current program with the given exit
  68. value.
  69. Arguments:
  70. ExitCode - Supplies the value to pass to exit.
  71. Format - Supplies the printf style format string.
  72. Arguments - Supplies the remaining arguments to the string.
  73. Return Value:
  74. This routine does not return, as it calls exit.
  75. --*/
  76. LIBC_API
  77. void
  78. errx (
  79. int ExitCode,
  80. const char *Format,
  81. ...
  82. );
  83. /*++
  84. Routine Description:
  85. This routine prints the program name, and the given printf-style formatted
  86. string, separated by a colon and a space. This routine then exits the
  87. current program with the given exit value.
  88. Arguments:
  89. ExitCode - Supplies the value to pass to exit.
  90. Format - Supplies the printf style format string.
  91. ... - Supplies the remaining arguments to the string.
  92. Return Value:
  93. This routine does not return, as it calls exit.
  94. --*/
  95. LIBC_API
  96. void
  97. verrx (
  98. int ExitCode,
  99. const char *Format,
  100. va_list Arguments
  101. );
  102. /*++
  103. Routine Description:
  104. This routine prints the program name, and the given printf-style formatted
  105. string, separated by a colon and a space. This routine then exits the
  106. current program with the given exit value.
  107. Arguments:
  108. ExitCode - Supplies the value to pass to exit.
  109. Format - Supplies the printf style format string.
  110. Arguments - Supplies the remaining arguments to the string.
  111. Return Value:
  112. This routine does not return, as it calls exit.
  113. --*/
  114. LIBC_API
  115. void
  116. warn (
  117. const char *Format,
  118. ...
  119. );
  120. /*++
  121. Routine Description:
  122. This routine prints the program name, the given printf-style formatted
  123. string, and the string of the current errno, separated by a colon and a
  124. space.
  125. Arguments:
  126. Format - Supplies the printf style format string.
  127. ... - Supplies the remaining arguments to the string.
  128. Return Value:
  129. None.
  130. --*/
  131. LIBC_API
  132. void
  133. vwarn (
  134. const char *Format,
  135. va_list Arguments
  136. );
  137. /*++
  138. Routine Description:
  139. This routine prints the program name, the given printf-style formatted
  140. string, and the string of the current errno, separated by a colon and a
  141. space.
  142. Arguments:
  143. Format - Supplies the printf style format string.
  144. Arguments - Supplies the remaining arguments to the string.
  145. Return Value:
  146. None.
  147. --*/
  148. LIBC_API
  149. void
  150. warnx (
  151. const char *Format,
  152. ...
  153. );
  154. /*++
  155. Routine Description:
  156. This routine prints the program name, and the given printf-style formatted
  157. string, separated by a colon and a space.
  158. Arguments:
  159. Format - Supplies the printf style format string.
  160. ... - Supplies the remaining arguments to the string.
  161. Return Value:
  162. None.
  163. --*/
  164. LIBC_API
  165. void
  166. vwarnx (
  167. const char *Format,
  168. va_list Arguments
  169. );
  170. /*++
  171. Routine Description:
  172. This routine prints the program name, and the given printf-style formatted
  173. string, separated by a colon and a space.
  174. Arguments:
  175. Format - Supplies the printf style format string.
  176. Arguments - Supplies the remaining arguments to the string.
  177. Return Value:
  178. None.
  179. --*/
  180. #ifdef __cplusplus
  181. }
  182. #endif
  183. #endif