mirror of https://github.com/tongzx/nt5src
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
89 lines
1.7 KiB
#if 0
|
|
|
|
// This is a sample of the convention followed in the source code.
|
|
|
|
FUNCTION Return type:
|
|
FunctionName(
|
|
Arguments );
|
|
|
|
/*****************************************************************************
|
|
Purpose:
|
|
In Arguments:
|
|
Out Arguments:
|
|
InOut Arguments:
|
|
Return Arguments:
|
|
Remarks:
|
|
*****************************************************************************/
|
|
{
|
|
// Function body
|
|
}
|
|
|
|
|
|
DINGDONGTYPE
|
|
GetPathType(
|
|
char * pExt )
|
|
/*****************************************************************************
|
|
Purpose:
|
|
Map the file extension to DINGDONGTYPE
|
|
In:
|
|
pExt - File Extension to map
|
|
Out:
|
|
None.
|
|
InOut:
|
|
None.
|
|
Return:
|
|
CLASSPATHTYPE of the file extension.
|
|
Remarks:
|
|
olb is apparently an extension that implies "old type library"-whatever
|
|
that is.
|
|
If no standard mapping is found, a DINGDONGTYPE of ExeNamePath is
|
|
returned.
|
|
*****************************************************************************/
|
|
{
|
|
// extensions to map.
|
|
|
|
static char * ExtArray[] =
|
|
{ ".dll",
|
|
".exe",
|
|
".cab",
|
|
".tlb",
|
|
".inf",
|
|
".olb"
|
|
};
|
|
|
|
// DINGDONGTYPE to map the extensions to.
|
|
|
|
static DINGDONGTYPE PathType[] =
|
|
{
|
|
DllNamePath,
|
|
ExeNamePath,
|
|
CabFilePath,
|
|
TlbNamePath,
|
|
InfFilePath,
|
|
TlbNamePath
|
|
};
|
|
|
|
int index;
|
|
int fFound = -1;
|
|
|
|
|
|
for( index = 0;
|
|
index < sizeof( ExtArray ) / sizeof( char * );
|
|
++index )
|
|
{
|
|
if( _stricmp( pExt, ExtArray[index] ) == 0 )
|
|
{
|
|
fFound = index;
|
|
break;
|
|
}
|
|
}
|
|
|
|
if( fFound != -1 )
|
|
{
|
|
return PathType[ index ];
|
|
}
|
|
else
|
|
return ExeNamePath;
|
|
|
|
}
|
|
#endif // 0
|