Commit | Line | Data |
---|---|---|
2986a63f JH |
1 | /********************************************************************** |
2 | * | |
3 | * C Source: type.c | |
4 | * Instance: idc_rads_2 | |
5 | * Description: DOS type Emulation | |
6 | * %created_by: smscm % | |
7 | * %date_created: Fri Apr 20 19:05:34 2001 % | |
8 | * | |
9 | **********************************************************************/ | |
10 | #ifndef lint | |
11 | static char *_csrc = "@(#) %filespec: type.c~1 % (%full_filespec: type.c~1:csrc:idc_rads#3 %)"; | |
12 | #endif | |
13 | ||
14 | #include <stdio.h> | |
15 | #include <nwfattr.h> | |
16 | #include "clibstuf.h" | |
17 | ||
18 | void main (int argc, char** argv) | |
19 | { | |
20 | FILE* pfile = NULL; | |
21 | int k; | |
22 | int thechar; | |
23 | char* defaultDir; | |
24 | ||
25 | fnInitGpfGlobals(); | |
26 | SetCurrentNameSpace(NWOS2_NAME_SPACE); | |
011f1a1a | 27 | defaultDir = (char *)getenv("PERL_ROOT"); |
2986a63f JH |
28 | if (!defaultDir || (strlen(defaultDir) == 0)) |
29 | defaultDir = "sys:\\perl\\scripts"; | |
30 | chdir(defaultDir); | |
31 | ||
32 | k = 1; | |
33 | while (k < argc) | |
34 | { | |
35 | // open the next file and print it out | |
36 | pfile = fopen(argv[k],"r"); | |
37 | if (pfile) | |
38 | { | |
39 | while ((thechar = getc(pfile)) != EOF) | |
40 | { | |
41 | if (thechar != 0x0d) | |
42 | printf("%c",thechar); | |
43 | } | |
44 | fclose (pfile); | |
45 | } | |
46 | k++; | |
47 | } | |
48 | } |