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.

65 lines
1.6 KiB

  1. /******************************************************************************
  2. * BeVersion.cpp *
  3. *---------------*
  4. *
  5. *------------------------------------------------------------------------------
  6. * Copyright (C) 1998 Entropic, Inc
  7. * Copyright (C) 2000 Microsoft Corporation Date: 03/02/00
  8. * All Rights Reserved
  9. *
  10. ********************************************************************* PACOG ***/
  11. #include "BeVersion.h"
  12. #include <stdlib.h>
  13. #include <string.h>
  14. #include <assert.h>
  15. const char * const BendVersion::pszVersion = "2.3.0";
  16. /*****************************************************************************
  17. * BendVersion::WriteVersionString *
  18. *---------------------------------*
  19. * Description:
  20. *
  21. ******************************************************************* PACOG ***/
  22. void BendVersion::WriteVersionString( FILE* fp)
  23. {
  24. assert (fp);
  25. if (fp )
  26. {
  27. fprintf (fp, "%s\n", pszVersion);
  28. }
  29. }
  30. /*****************************************************************************
  31. * BendVersion::CheckVersionString *
  32. *---------------------------------*
  33. * Description:
  34. *
  35. ******************************************************************* PACOG ***/
  36. bool BendVersion::CheckVersionString( FILE* fp)
  37. {
  38. char str[_MAX_PATH+1];
  39. char* ptr;
  40. assert (fp);
  41. if (fp && fgets(str, _MAX_PATH, fp))
  42. {
  43. ptr = (str + strlen(str)-1); // Strip last carriage return
  44. if ( *ptr == '\n')
  45. {
  46. *ptr = '\0';
  47. }
  48. if (strcmp(str, pszVersion) == 0)
  49. {
  50. return true;
  51. }
  52. }
  53. return false;
  54. }