Beispiel #1
0
PrefHandler::PrefHandler()
	:
	fContainer('Pref')
{
	_LoadFromDefault(kTermDefaults);

	BPath path;
	GetDefaultPath(path);
	OpenText(path.Path());

	_ConfirmFont(PREF_HALF_FONT_FAMILY, be_fixed_font);
}
Beispiel #2
0
PrefHandler::PrefHandler(bool loadSettings)
	:
	fContainer('Pref')
{
	_LoadFromDefault(kTermDefaults);

	if (loadSettings) {
		BPath path;
		GetDefaultPath(path);
		OpenText(path.Path());
	}

	_ConfirmFont(be_fixed_font);
}
bool CMuleCollection::Open(const std::string &File)
{
	return OpenBinary(File) || OpenText(File);
}
Beispiel #4
0
void
Pass1(int argc, char *argv[]) {
	register int n;

	InitText(argc);
	InitTokenArray();

	/* assume all texts to be new */
	NumberOfNewTexts = NumberOfTexts;

	/* read the files */
	for (n = 0; n < NumberOfTexts; n++) {
		register char *fname = argv[n];
		register struct text *txt = &Text[n];

		fprintf(OutputFile, "File %s: ", fname);

		txt->tx_fname = fname;
		txt->tx_pos = 0;
		txt->tx_start =
		txt->tx_limit = TextLength();
		if (strcmp(fname, "/") == 0) {
			fprintf(OutputFile, "separator\n");
			NumberOfNewTexts = n;
		}
		else {
			if (!OpenText(First, txt)) {
				fprintf(OutputFile, ">>>> cannot open <<<< ");
				/*	the file has still been opened
					with a null file for uniformity
				*/
			}
			while (NextTextTokenObtained(First)) {
				if (!TOKEN_EQ(lex_token, EOL)) {
					StoreToken();
				}
			}
			CloseText(First, txt);
			txt->tx_limit = TextLength();

			/* report */
			print_count(txt->tx_limit - txt->tx_start, "token");
			if (lex_non_ascii_cnt) {
				fprintf(DebugFile, ", ");
				print_count(lex_non_ascii_cnt,
					"non-ASCII character"
				);
			}
			fprintf(OutputFile, "\n");
#ifdef	DB_TEXT
			db_print_text(txt);
#endif	/* DB_TEXT */
		}
		fflush(OutputFile);
	}

	/* report total */
	fprintf(OutputFile, "Total: ");
	print_count(TextLength() - 1, "token");
	fprintf(OutputFile, "\n\n");
	fflush(OutputFile);
}