Leaked source code of windows server 2003
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.

101 lines
1.7 KiB

  1. /*++
  2. Copyright (c) 1998-1999 Microsoft Corporation
  3. Module Name:
  4. flbuild.cpp
  5. Abstract:
  6. this file uses filelist.lib to build a dat file from xml file
  7. Author:
  8. Kanwaljit Marok (kmarok) 01-May-2000
  9. Revision History:
  10. --*/
  11. #include "flstructs.h"
  12. #include "flbuilder.h"
  13. #ifdef _ASSERT
  14. #undef _ASSERT
  15. #endif
  16. #include <dbgtrace.h>
  17. #ifdef THIS_FILE
  18. #undef THIS_FILE
  19. #endif
  20. static char __szTraceSourceFile[] = __FILE__;
  21. #define THIS_FILE __szTraceSourceFile
  22. #define TRACE_FILEID 0
  23. #define FILEID 0
  24. int _cdecl main(int argc, char* argv[])
  25. {
  26. INT returnCde = 0;
  27. CFLDatBuilder datbuild;
  28. InitAsyncTrace();
  29. if( argc != 3 )
  30. {
  31. fprintf(stderr, "usage: %s <in.xml> <out.dat>\n", argv[0]);
  32. returnCde = 1;
  33. }
  34. else
  35. {
  36. LPTSTR pFileList, pDatFile;
  37. #ifdef UNICODE
  38. TCHAR tFileList[MAX_PATH];
  39. TCHAR tDatFile[MAX_PATH];
  40. MultiByteToWideChar(
  41. CP_ACP,
  42. 0,
  43. argv[1],
  44. -1,
  45. tFileList,
  46. sizeof(tFileList)/sizeof(TCHAR)
  47. );
  48. MultiByteToWideChar(
  49. CP_ACP,
  50. 0,
  51. argv[2],
  52. -1,
  53. tDatFile,
  54. sizeof(tDatFile)/sizeof(TCHAR)
  55. );
  56. pFileList = tFileList;
  57. pDatFile = tDatFile;
  58. #else
  59. pFileList = argv[1];
  60. pDatFile = argv[2];
  61. #endif
  62. if( !datbuild.BuildTree(pFileList, pDatFile) )
  63. {
  64. fprintf(stderr, "Error building dat\n");
  65. returnCde = 1;
  66. }
  67. }
  68. return returnCde;
  69. }