Staging
v0.5.1
https://github.com/python/cpython
Raw File
Tip revision: 6c3a3aa17b028f6b93067083d32c7eaa4338757c authored by cvs2svn on 25 October 1996, 15:40:20 UTC
This commit was manufactured by cvs2svn to create tag 'release14'.
Tip revision: 6c3a3aa
macguesstabsize.c
#include <Types.h>
#include <Files.h>
#include <OSUtils.h>
#include <Resources.h>

#include <string.h>

/* Interface used by parsetok.c */

guesstabsize(path)
	char *path;
{
	Str255 s;
	int refnum;
	Handle h;
	int tabsize = 0;
	s[0] = strlen(path);
	memcpy(s+1, path, s[0]);
	refnum = OpenResFile(s);
	if (refnum == -1)
		return 0;
	UseResFile(refnum);
	h = GetIndResource('ETAB', 1);
	if (h != 0) {
		tabsize = (*(short**)h)[1];
	}
	CloseResFile(refnum);
	return tabsize;
}
back to top