Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

54 lines
1.6 KiB

  1. /****************************** Module Header ******************************\
  2. * Module Name: hsutil.c
  3. *
  4. * Copyright (c) 1985-96, Microsoft Corporation
  5. *
  6. * 09/05/96 GerardoB Created
  7. \***************************************************************************/
  8. #include "hsplit.h"
  9. /***************************************************************************\
  10. * soLosgMsg
  11. \***************************************************************************/
  12. void __cdecl hsLogMsg(DWORD dwFlags, char *pszfmt, ...)
  13. {
  14. static BOOL gfAppending = FALSE;
  15. va_list va;
  16. if (!(dwFlags & HSLM_NOLABEL)) {
  17. if (gfAppending) {
  18. fprintf(stdout, "\r\n");
  19. }
  20. fprintf(stdout, "HSPLIT: ");
  21. }
  22. if (dwFlags & HSLM_ERROR) {
  23. if (dwFlags & HSLM_NOLINE) {
  24. hsLogMsg (HSLM_NOLABEL | HSLM_NOEOL, "Error: ");
  25. } else {
  26. hsLogMsg (HSLM_NOLABEL | HSLM_NOEOL, "Error (line %d): ", gdwLineNumber);
  27. }
  28. } else if (dwFlags & HSLM_WARNING) {
  29. if (dwFlags & HSLM_NOLINE) {
  30. hsLogMsg (HSLM_NOLABEL | HSLM_NOEOL, "Warning: ");
  31. } else {
  32. hsLogMsg (HSLM_NOLABEL | HSLM_NOEOL, "Warning (line %d): ", gdwLineNumber);
  33. }
  34. }
  35. va_start(va, pszfmt);
  36. vfprintf(stdout, pszfmt, va);
  37. va_end(va);
  38. if (dwFlags & HSLM_API) {
  39. hsLogMsg (HSLM_NOLABEL | HSLM_NOEOL, " Failed. GetLastError: %d", GetLastError());
  40. } else if (dwFlags & HSLM_UNEXPECTEDEOF) {
  41. hsLogMsg (HSLM_NOLABEL | HSLM_NOEOL, " found unexpected end of file");
  42. }
  43. gfAppending = (dwFlags & HSLM_NOEOL);
  44. if (!gfAppending) {
  45. fprintf(stdout, "\r\n");
  46. }
  47. }