home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Simtel MSDOS 1992 September
/
Simtel20_Sept92.cdr
/
msdos
/
turbo_c
/
tc130.arc
/
EXTTYP.DOC
< prev
next >
Wrap
Text File
|
1987-08-20
|
1KB
|
39 lines
NAME
exttyp -- check a filename for a particular extension
SYNOPSIS
r = exttyp(filename, extn);
int r; returns TRUE if match, else FALSE
char *filename filename to test
char *extn extension string for match
DESCRIPTION
This function makes no changes to either entry parameter,
but simply returns TRUE if the specified extension is found in
the filename, or FALSE (0) if it is not. Case of the characters is
ignored. The function is most useful to insure that a particular
program will only use an extension of a specified type.
EXAMPLE
(assume argv[1] is string "foobar.com")
if(exttyp(argv[1], "COM")) printf("File is executable");
else printf("File is not executable");
This function is found in SMTCx.LIB for the Turbo-C Compiler.