diff options
| author | gonzo <gonzo@toniatuh.com> | 2023-05-19 22:17:58 +0200 |
|---|---|---|
| committer | gonzo <gonzo@toniatuh.com> | 2023-05-19 22:17:58 +0200 |
| commit | 0751b55f611b889f63dfc2bc2705e7537703cb43 (patch) | |
| tree | 3a996ccde1904e92b910900d8d25c55424fff33d /loans.h | |
| parent | d01fc15a98e5ede02e3f9aff04e3d4014e6e484c (diff) | |
| download | loan_calc-0751b55f611b889f63dfc2bc2705e7537703cb43.tar.gz | |
added loan struct to abstract over loan types
Diffstat (limited to 'loans.h')
| -rw-r--r-- | loans.h | 19 |
1 files changed, 19 insertions, 0 deletions
@@ -3,6 +3,20 @@ #include <math.h> #include "contract.h" +typedef enum loan_type { + BULLET, + STRAIGHTLINE, + MORTGAGE, +} loan_type; + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wpadded" +typedef struct loan { + loan_type type; + contract *c; +} loan; +#pragma clang diagnostic pop + /**** BULLET LOAN ****/ contract *bullet_init(int n, int d, float r, float P); float bullet_update(contract *); @@ -17,3 +31,8 @@ void sl_free(contract *); contract *mort_init(int n, int d, float r, float P); float mort_update(contract *); void mort_free(contract *); + +/**** GENERAL LOAN STUFF ****/ +loan loan_init(loan_type type, int n, int d, float r, float P); +float loan_update(loan); +void loan_free(loan); |
