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.

89 lines
1.7 KiB

  1. #if 0
  2. // This is a sample of the convention followed in the source code.
  3. FUNCTION Return type:
  4. FunctionName(
  5. Arguments );
  6. /*****************************************************************************
  7. Purpose:
  8. In Arguments:
  9. Out Arguments:
  10. InOut Arguments:
  11. Return Arguments:
  12. Remarks:
  13. *****************************************************************************/
  14. {
  15. // Function body
  16. }
  17. DINGDONGTYPE
  18. GetPathType(
  19. char * pExt )
  20. /*****************************************************************************
  21. Purpose:
  22. Map the file extension to DINGDONGTYPE
  23. In:
  24. pExt - File Extension to map
  25. Out:
  26. None.
  27. InOut:
  28. None.
  29. Return:
  30. CLASSPATHTYPE of the file extension.
  31. Remarks:
  32. olb is apparently an extension that implies "old type library"-whatever
  33. that is.
  34. If no standard mapping is found, a DINGDONGTYPE of ExeNamePath is
  35. returned.
  36. *****************************************************************************/
  37. {
  38. // extensions to map.
  39. static char * ExtArray[] =
  40. { ".dll",
  41. ".exe",
  42. ".cab",
  43. ".tlb",
  44. ".inf",
  45. ".olb"
  46. };
  47. // DINGDONGTYPE to map the extensions to.
  48. static DINGDONGTYPE PathType[] =
  49. {
  50. DllNamePath,
  51. ExeNamePath,
  52. CabFilePath,
  53. TlbNamePath,
  54. InfFilePath,
  55. TlbNamePath
  56. };
  57. int index;
  58. int fFound = -1;
  59. for( index = 0;
  60. index < sizeof( ExtArray ) / sizeof( char * );
  61. ++index )
  62. {
  63. if( _stricmp( pExt, ExtArray[index] ) == 0 )
  64. {
  65. fFound = index;
  66. break;
  67. }
  68. }
  69. if( fFound != -1 )
  70. {
  71. return PathType[ index ];
  72. }
  73. else
  74. return ExeNamePath;
  75. }
  76. #endif // 0