summaryrefslogtreecommitdiffstats
path: root/read_functions.c
blob: 3433a8440f911d84c643609e9bb9a4615858cb2c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
#include "loans.h"

loan_type read_loan_type(char **contract_subtypes, char *lt) {
	int i = 0;
	for (i = 0; lt[i]; i++)
		if (lt[i] == ' ')
			lt[i] = '\0';

	for (i = 0; contract_subtypes[i]; i++)
		if (!strcmp(contract_subtypes[i], lt))
			return (loan_type)i;
	return MORTGAGE;
}