|
1495
|
1 #include <MacHeaders>
|
|
|
2 #include <string.h>
|
|
|
3
|
|
|
4 /* Interface used by tokenizer.c */
|
|
|
5
|
|
|
6 guesstabsize(path)
|
|
|
7 char *path;
|
|
|
8 {
|
|
|
9 char s[256];
|
|
|
10 int refnum;
|
|
|
11 Handle h;
|
|
|
12 int tabsize = 0;
|
|
|
13 s[0] = strlen(path);
|
|
|
14 strncpy(s+1, path, s[0]);
|
|
|
15 refnum = OpenResFile(s);
|
|
|
16 /* printf("%s --> refnum=%d\n", path, refnum); */
|
|
|
17 if (refnum == -1)
|
|
|
18 return 0;
|
|
|
19 UseResFile(refnum);
|
|
|
20 h = GetIndResource('ETAB', 1);
|
|
|
21 if (h != 0) {
|
|
|
22 tabsize = (*(short**)h)[1];
|
|
|
23 /* printf("tabsize=%d\n", tabsize); */
|
|
|
24 }
|
|
|
25 CloseResFile(refnum);
|
|
|
26 return tabsize;
|
|
|
27 }
|