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.

73 lines
1.4 KiB

  1. /*++
  2. Copyright (c) 1992 Microsoft Corporation
  3. Module Name:
  4. undname.c
  5. Abstract:
  6. This is the main source file for the UNDNAME utility program.
  7. This is a simple command line utility for undecorating C++ symbol
  8. names.
  9. Author:
  10. Weslwy Witt (wesw) 09-June-1993
  11. Revision History:
  12. --*/
  13. #include <private.h>
  14. #include <ntverp.h>
  15. #include <common.ver>
  16. void
  17. Usage( void )
  18. {
  19. fprintf( stderr,
  20. "usage: UNDNAME [-f] decorated-names...\n"
  21. " -f Undecorate fully. Default is to only undecorate the class::member\n");
  22. exit( 1 );
  23. }
  24. int __cdecl
  25. main(
  26. int argc,
  27. char *argv[],
  28. char *envp[]
  29. )
  30. {
  31. char UnDecoratedName[4000];
  32. DWORD Flags;
  33. fputs(VER_PRODUCTNAME_STR "\nUNDNAME Version " VER_PRODUCTVERSION_STR, stderr );
  34. fputs(VER_LEGALCOPYRIGHT_STR "\n\n", stderr);
  35. if (argc <= 1) {
  36. Usage();
  37. }
  38. if ((argv[1][0] == '-') && (argv[1][1] == 'f')) {
  39. Flags = UNDNAME_COMPLETE;
  40. argc--;
  41. argv++;
  42. } else {
  43. Flags = UNDNAME_NAME_ONLY;
  44. }
  45. if (argc <= 1) {
  46. Usage();
  47. }
  48. while (--argc) {
  49. UnDecorateSymbolName( *++argv, UnDecoratedName, sizeof(UnDecoratedName), Flags );
  50. printf( ">> %s == %s\n", *argv, UnDecoratedName );
  51. }
  52. exit( 0 );
  53. return 0;
  54. }