/contrib/ntp/include/isc/result.h

https://bitbucket.org/freebsd/freebsd-head/ · C++ Header · 106 lines · 73 code · 10 blank · 23 comment · 0 complexity · f5672f077ace9a43271f3ab8a26242a9 MD5 · raw file

  1. /*
  2. * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
  3. * Copyright (C) 1998-2001, 2003 Internet Software Consortium.
  4. *
  5. * Permission to use, copy, modify, and distribute this software for any
  6. * purpose with or without fee is hereby granted, provided that the above
  7. * copyright notice and this permission notice appear in all copies.
  8. *
  9. * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
  10. * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
  11. * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
  12. * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
  13. * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
  14. * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  15. * PERFORMANCE OF THIS SOFTWARE.
  16. */
  17. /* $Id: result.h,v 1.57.2.2.8.5 2004/05/15 03:46:13 jinmei Exp $ */
  18. #ifndef ISC_RESULT_H
  19. #define ISC_RESULT_H 1
  20. #include <isc/lang.h>
  21. #include <isc/types.h>
  22. #define ISC_R_SUCCESS 0 /* success */
  23. #define ISC_R_NOMEMORY 1 /* out of memory */
  24. #define ISC_R_TIMEDOUT 2 /* timed out */
  25. #define ISC_R_NOTHREADS 3 /* no available threads */
  26. #define ISC_R_ADDRNOTAVAIL 4 /* address not available */
  27. #define ISC_R_ADDRINUSE 5 /* address in use */
  28. #define ISC_R_NOPERM 6 /* permission denied */
  29. #define ISC_R_NOCONN 7 /* no pending connections */
  30. #define ISC_R_NETUNREACH 8 /* network unreachable */
  31. #define ISC_R_HOSTUNREACH 9 /* host unreachable */
  32. #define ISC_R_NETDOWN 10 /* network down */
  33. #define ISC_R_HOSTDOWN 11 /* host down */
  34. #define ISC_R_CONNREFUSED 12 /* connection refused */
  35. #define ISC_R_NORESOURCES 13 /* not enough free resources */
  36. #define ISC_R_EOF 14 /* end of file */
  37. #define ISC_R_BOUND 15 /* socket already bound */
  38. #define ISC_R_RELOAD 16 /* reload */
  39. #define ISC_R_LOCKBUSY 17 /* lock busy */
  40. #define ISC_R_EXISTS 18 /* already exists */
  41. #define ISC_R_NOSPACE 19 /* ran out of space */
  42. #define ISC_R_CANCELED 20 /* operation canceled */
  43. #define ISC_R_NOTBOUND 21 /* socket is not bound */
  44. #define ISC_R_SHUTTINGDOWN 22 /* shutting down */
  45. #define ISC_R_NOTFOUND 23 /* not found */
  46. #define ISC_R_UNEXPECTEDEND 24 /* unexpected end of input */
  47. #define ISC_R_FAILURE 25 /* generic failure */
  48. #define ISC_R_IOERROR 26 /* I/O error */
  49. #define ISC_R_NOTIMPLEMENTED 27 /* not implemented */
  50. #define ISC_R_UNBALANCED 28 /* unbalanced parentheses */
  51. #define ISC_R_NOMORE 29 /* no more */
  52. #define ISC_R_INVALIDFILE 30 /* invalid file */
  53. #define ISC_R_BADBASE64 31 /* bad base64 encoding */
  54. #define ISC_R_UNEXPECTEDTOKEN 32 /* unexpected token */
  55. #define ISC_R_QUOTA 33 /* quota reached */
  56. #define ISC_R_UNEXPECTED 34 /* unexpected error */
  57. #define ISC_R_ALREADYRUNNING 35 /* already running */
  58. #define ISC_R_IGNORE 36 /* ignore */
  59. #define ISC_R_MASKNONCONTIG 37 /* addr mask not contiguous */
  60. #define ISC_R_FILENOTFOUND 38 /* file not found */
  61. #define ISC_R_FILEEXISTS 39 /* file already exists */
  62. #define ISC_R_NOTCONNECTED 40 /* socket is not connected */
  63. #define ISC_R_RANGE 41 /* out of range */
  64. #define ISC_R_NOENTROPY 42 /* out of entropy */
  65. #define ISC_R_MULTICAST 43 /* invalid use of multicast */
  66. #define ISC_R_NOTFILE 44 /* not a file */
  67. #define ISC_R_NOTDIRECTORY 45 /* not a directory */
  68. #define ISC_R_QUEUEFULL 46 /* queue is full */
  69. #define ISC_R_FAMILYMISMATCH 47 /* address family mismatch */
  70. #define ISC_R_FAMILYNOSUPPORT 48 /* AF not supported */
  71. #define ISC_R_BADHEX 49 /* bad hex encoding */
  72. #define ISC_R_TOOMANYOPENFILES 50 /* too many open files */
  73. #define ISC_R_NOTBLOCKING 51 /* not blocking */
  74. #define ISC_R_UNBALANCEDQUOTES 52 /* unbalanced quotes */
  75. #define ISC_R_INPROGRESS 53 /* operation in progress */
  76. #define ISC_R_CONNECTIONRESET 54 /* connection reset */
  77. #define ISC_R_SOFTQUOTA 55 /* soft quota reached */
  78. #define ISC_R_BADNUMBER 56 /* not a valid number */
  79. #define ISC_R_DISABLED 57 /* disabled */
  80. #define ISC_R_MAXSIZE 58 /* max size */
  81. #define ISC_R_BADADDRESSFORM 59 /* invalid address format */
  82. /*
  83. * Not a result code: the number of results.
  84. */
  85. #define ISC_R_NRESULTS 60
  86. ISC_LANG_BEGINDECLS
  87. const char *
  88. isc_result_totext(isc_result_t);
  89. /*
  90. * Convert an isc_result_t into a string message describing the result.
  91. */
  92. isc_result_t
  93. isc_result_register(unsigned int base, unsigned int nresults,
  94. const char **text, isc_msgcat_t *msgcat, int set);
  95. ISC_LANG_ENDDECLS
  96. #endif /* ISC_RESULT_H */