repo.or.cz
/
python
/
dscho.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
changes by Barry, e.g. font lock & email addresses
[python/dscho.git]
/
Mac
/
Python
/
macguesstabsize.c
blob
ec4af3d699582cdcc0aa2850ec65ac05cc922f39
1
#include <Types.h>
2
#include <Files.h>
3
#include <OSUtils.h>
4
#include <Resources.h>
5
6
#include <string.h>
7
8
/* Interface used by parsetok.c */
9
10
guesstabsize
(
path
)
11
char
*
path
;
12
{
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
];
26
}
27
CloseResFile
(
refnum
);
28
return
tabsize
;
29
}