GnuCash c935c2f+
Loading...
Searching...
No Matches
finproto.h
1/***************************************************************************
2 * -------------------
3 * create : Tue Jul 11 20:21:18 2000
4 * copyright: (C) 2000 by Terry D. Boldt
5 * email : tboldt@attglobal.net
6 * -------------------
7 ***************************************************************************/
8/***************************************************************************
9 * *
10 * This program is free software; you can redistribute it and/or modify *
11 * it under the terms of the GNU General Public License as published by *
12 * the Free Software Foundation; either version 2 of the License, or *
13 * (at your option) any later version. *
14 * *
15 ***************************************************************************/
16/***************************************************************************
17 * Global Function Prototypes
18 * Tue Jul 11 20:21:18 2000
19 *
20 ***************************************************************************/
21
22#ifndef FINPROTO_H
23#define FINPROTO_H
24
25#include <stdio.h>
26
27#include "finvar.h"
28
29/*==================================================*/
30/* fin.c */
31
32unsigned fi_calc_num_payments (fi_ptr fi);
33
34double
35_fi_calc_num_payments (double nint, /* nominal interest rate */
36 double pv, /* present value */
37 double pmt, /* periodic payment */
38 double fv, /* future value */
39 unsigned CF, /* compounding frequency */
40 unsigned PF, /* payment frequency */
41 unsigned disc, /* discrete/continuous compounding */
42 unsigned bep); /* beginning/end of period payment */
43
44double fi_calc_interest (fi_ptr fi);
45
46double
47_fi_calc_interest (unsigned per, /* number of periods */
48 double pv, /* present value */
49 double pmt, /* periodic payment */
50 double fv, /* future value */
51 unsigned CF, /* compounding frequency */
52 unsigned PF, /* payment frequency */
53 unsigned disc, /* discrete/continuous compounding */
54 unsigned bep); /* beginning/end of period payment */
55
56double fi_calc_present_value (fi_ptr fi);
57
58double
59_fi_calc_present_value (unsigned per, /* number of periods */
60 double nint, /* nominal interest rate */
61 double pmt, /* periodic payment */
62 double fv, /* future value */
63 unsigned CF, /* compounding frequency */
64 unsigned PF, /* payment frequency */
65 unsigned disc, /* discrete/continuous compounding */
66 unsigned bep); /* beginning/end of period payment */
67
68double fi_calc_payment (fi_ptr fi);
69
70double
71_fi_calc_payment (unsigned per, /* number of periods */
72 double nint, /* nominal interest rate */
73 double pv, /* present value */
74 double fv, /* future value */
75 unsigned CF, /* compounding frequency */
76 unsigned PF, /* payment frequency */
77 unsigned disc, /* discrete/continuous compounding */
78 unsigned bep); /* beginning/end of period payment */
79
80double fi_calc_future_value (fi_ptr fi);
81
82double
83_fi_calc_future_value (unsigned per, /* number of periods */
84 double nint, /* nominal interest rate */
85 double pv, /* present value */
86 double pmt, /* periodic payment */
87 unsigned CF, /* compounding frequency */
88 unsigned PF, /* payment frequency */
89 unsigned disc, /* discrete/continuous compounding */
90 unsigned bep); /* beginning/end of period payment */
91
92void set_default (fi_ptr fi);
93
94unsigned long julian_day_number (unsigned year, unsigned month, unsigned day);
95
96amort_sched_ptr Amortization_init (amort_sched_ptr amortsched);
97
98amort_sched_ptr Amortization_Schedule (amort_sched_ptr amortsched);
99
100void Amortization_free (amort_sched_ptr amortsched);
101
102
103/*==================================================*/
104/* expression_parser.c */
105
106void exit_parser (parser_env_ptr pe);
107
108ParseError get_parse_error (parser_env_ptr pe);
109
110var_store_ptr parser_get_vars (parser_env_ptr pe);
111
112unsigned delete_var (char *var_name, parser_env_ptr pe);
113
114char *parse_string (var_store_ptr value,
115 const char *string, parser_env_ptr pe);
116
117
118/*==================================================*/
119/* amort_opt.c */
120amort_sched_ptr amort_opt (amort_sched_ptr amortsched, void *parse_env);
121
122
123/*==================================================*/
124/* amort_prt.c */
125void prt_amortization_schedule (amort_sched_ptr amortsched, FILE * ofile);
126
127#endif