Staging
v0.8.1
https://github.com/python/cpython
Raw File
Tip revision: 7c7fa46d204679287b48f1cf8d867aab4de2894e authored by cvs2svn on 10 November 1994, 23:06:54 UTC
This commit was manufactured by cvs2svn to create tag 'release111'.
Tip revision: 7c7fa46
macguesstabsize.c
#include <Types.h>
#include <Files.h>
#include <OSUtils.h>
#include <Resources.h>

#include <string.h>

/* Interface used by tokenizer.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);
/* printf("%s --> refnum=%d\n", path, refnum); */
	if (refnum == -1)
		return 0;
	UseResFile(refnum);
	h = GetIndResource('ETAB', 1);
	if (h != 0) {
		tabsize = (*(short**)h)[1];
/* printf("tabsize=%d\n", tabsize); */
	}
	CloseResFile(refnum);
	return tabsize;
}
back to top