changes by Barry, e.g. font lock & email addresses
[python/dscho.git] / Mac / Python / macguesstabsize.c
blobec4af3d699582cdcc0aa2850ec65ac05cc922f39
1 #include <Types.h>
2 #include <Files.h>
3 #include <OSUtils.h>
4 #include <Resources.h>
6 #include <string.h>
8 /* Interface used by parsetok.c */
10 guesstabsize(path)
11 char *path;
13 Str255 s;
14 int refnum;
15 Handle h;
16 int tabsize = 0;
17 s[0] = strlen(path);
18 memcpy(s+1, path, s[0]);
19 refnum = OpenResFile(s);
20 if (refnum == -1)
21 return 0;
22 UseResFile(refnum);
23 h = GetIndResource('ETAB', 1);
24 if (h != 0) {
25 tabsize = (*(short**)h)[1];
27 CloseResFile(refnum);
28 return tabsize;