summaryrefslogtreecommitdiffstats
path: root/read_functions.c
diff options
context:
space:
mode:
Diffstat (limited to 'read_functions.c')
-rw-r--r--read_functions.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/read_functions.c b/read_functions.c
new file mode 100644
index 0000000..d60b19e
--- /dev/null
+++ b/read_functions.c
@@ -0,0 +1,12 @@
+#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;
+}