syslog.h 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. /*
  2. +----------------------------------------------------------------------+
  3. | Copyright (c) The PHP Group |
  4. +----------------------------------------------------------------------+
  5. | This source file is subject to version 3.01 of the PHP license, |
  6. | that is bundled with this package in the file LICENSE, and is |
  7. | available through the world-wide-web at the following url: |
  8. | https://www.php.net/license/3_01.txt |
  9. | If you did not receive a copy of the PHP license and are unable to |
  10. | obtain it through the world-wide-web, please send a note to |
  11. | license@php.net so we can mail you a copy immediately. |
  12. +----------------------------------------------------------------------+
  13. | Author: Sterling Hughes <sterling@php.net> |
  14. +----------------------------------------------------------------------+
  15. */
  16. #ifndef SYSLOG_H
  17. #define SYSLOG_H
  18. #define WIN32_LEAN_AND_MEAN
  19. #include <windows.h>
  20. #define LOG_EMERG 1
  21. #define LOG_ALERT 1
  22. #define LOG_CRIT 1
  23. #define LOG_ERR 4
  24. #define LOG_WARNING 5
  25. #define LOG_NOTICE 6
  26. #define LOG_INFO 6
  27. #define LOG_DEBUG 6
  28. #define LOG_PRIMASK 0x07
  29. #define LOG_PRI(p) ((p) & LOG_PRIMASK)
  30. #define LOG_MAKEPRI(fac, pri) (((fac) << 3) | (pri))
  31. #define LOG_KERN (0<<3)
  32. #define LOG_USER (1<<3)
  33. #define LOG_MAIL (2<<3)
  34. #define LOG_DAEMON (3<<3)
  35. #define LOG_AUTH (4<<3)
  36. #define LOG_SYSLOG (5<<3)
  37. #define LOG_LPR (6<<3)
  38. #define LOG_NEWS (7<<3)
  39. #define LOG_UUCP (8<<3)
  40. #define LOG_CRON (9<<3)
  41. #define LOG_AUTHPRIV (10<<3)
  42. #define LOG_NFACILITIES 10
  43. #define LOG_FACMASK 0x03f8
  44. #define LOG_FAC(p) (((p) & LOG_FACMASK) >> 3)
  45. #define LOG_MASK(pri) (1 << (pri))
  46. #define LOG_UPTO(pri) ((1 << ((pri)+1)) - 1)
  47. /*
  48. * Option flags for openlog.
  49. *
  50. * LOG_ODELAY no longer does anything.
  51. * LOG_NDELAY is the inverse of what it used to be.
  52. */
  53. #define LOG_PID 0x01 /* log the pid with each message */
  54. #define LOG_CONS 0x02 /* log on the console if errors in sending */
  55. #define LOG_ODELAY 0x04 /* delay open until first syslog() (default) */
  56. #define LOG_NDELAY 0x08 /* don't delay open */
  57. #define LOG_NOWAIT 0x10 /* don't wait for console forks: DEPRECATED */
  58. #define LOG_PERROR 0x20 /* log to stderr as well */
  59. extern void closelog(void);
  60. extern void openlog(const char *, int, int);
  61. extern void syslog(int, const char *, ...);
  62. extern void vsyslog(int, const char *, va_list ap);
  63. #endif /* SYSLOG_H */