示例#1
0
文件: fsck.c 项目: AndSoAway/git
int is_valid_msg_type(const char *msg_id, const char *msg_type)
{
	if (parse_msg_id(msg_id) < 0)
		return 0;
	parse_msg_type(msg_type);
	return 1;
}
示例#2
0
static bool first_three_fields(struct fix_message *self)
{
	if (!parse_begin_string(self))
		return false;

	if (!parse_body_length(self))
		return false;

	return parse_msg_type(self);
}
示例#3
0
static int first_three_fields(struct fix_message *self)
{
	int ret;

	ret = parse_begin_string(self);
	if (ret)
		goto exit;

	ret = parse_body_length(self);
	if (ret)
		goto exit;

	return parse_msg_type(self);

exit:
	return ret;
}
示例#4
0
文件: fsck.c 项目: AndSoAway/git
void fsck_set_msg_type(struct fsck_options *options,
		const char *msg_id, const char *msg_type)
{
	int id = parse_msg_id(msg_id), type;

	if (id < 0)
		die("Unhandled message id: %s", msg_id);
	type = parse_msg_type(msg_type);

	if (type != FSCK_ERROR && msg_id_info[id].msg_type == FSCK_FATAL)
		die("Cannot demote %s to %s", msg_id, msg_type);

	if (!options->msg_type) {
		int i;
		int *msg_type = xmalloc(sizeof(int) * FSCK_MSG_MAX);
		for (i = 0; i < FSCK_MSG_MAX; i++)
			msg_type[i] = fsck_msg_type(i, options);
		options->msg_type = msg_type;
	}

	options->msg_type[id] = type;
}