Beispiel #1
0
static enum parser_error helper_char1(struct parser *p) {
	char c0 = parser_getchar(p, "c0");
	char c1 = parser_getchar(p, "c1");
	int i0 = parser_getint(p, "i0");
	const char *s = parser_getstr(p, "s");
	int *wasok = parser_priv(p);

	if (c0 != ':' || c1 != ':' || i0 != 34 || !streq(s, "lala"))
		return PARSE_ERROR_GENERIC;
	*wasok = 1;
	return PARSE_ERROR_NONE;
}
Beispiel #2
0
static enum parser_error parse_r_g(struct parser *p) {
	struct monster_race *r = parser_priv(p);

	/* If the display character is specified, it overrides any template */
	r->d_char = parser_getchar(p, "glyph");

	return PARSE_ERROR_NONE;
}
Beispiel #3
0
static enum parser_error helper_char0(struct parser *p) {
	char c = parser_getchar(p, "c");
	int *wasok = parser_priv(p);

	if (c != 'C')
		return PARSE_ERROR_GENERIC;
	*wasok = 1;
	return PARSE_ERROR_NONE;
}
Beispiel #4
0
static enum parser_error parse_rb_g(struct parser *p) {
	struct monster_base *rb = parser_priv(p);

	if (!rb)
		return PARSE_ERROR_MISSING_RECORD_HEADER;

	rb->d_char = parser_getchar(p, "glyph");
	return PARSE_ERROR_NONE;
}