GnuCash  2.6.99
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
finproto.h
1 /***************************************************************************
2  * -------------------
3  * create : Tue Jul 11 20:21:18 2000
4  * copyright: (C) 2000 by Terry D. Boldt
5  * email : [email protected]
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 
32 unsigned fi_calc_num_payments (fi_ptr fi);
33 
34 double
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 
44 double fi_calc_interest (fi_ptr fi);
45 
46 double
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 
56 double fi_calc_present_value (fi_ptr fi);
57 
58 double
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 
68 double fi_calc_payment (fi_ptr fi);
69 
70 double
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 
80 double fi_calc_future_value (fi_ptr fi);
81 
82 double
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 
92 void set_default (fi_ptr fi);
93 
94 unsigned long julian_day_number (unsigned year, unsigned month, unsigned day);
95 
96 amort_sched_ptr Amortization_init (amort_sched_ptr amortsched);
97 
98 amort_sched_ptr Amortization_Schedule (amort_sched_ptr amortsched);
99 
100 void Amortization_free (amort_sched_ptr amortsched);
101 
102 
103 /*==================================================*/
104 /* expression_parser.c */
105 
106 void exit_parser (parser_env_ptr pe);
107 
108 ParseError get_parse_error (parser_env_ptr pe);
109 
110 var_store_ptr parser_get_vars (parser_env_ptr pe);
111 
112 unsigned delete_var (char *var_name, parser_env_ptr pe);
113 
114 char *parse_string (var_store_ptr value,
115  const char *string, parser_env_ptr pe);
116 
117 
118 /*==================================================*/
119 /* amort_opt.c */
120 amort_sched_ptr amort_opt (amort_sched_ptr amortsched, void *parse_env);
121 
122 
123 /*==================================================*/
124 /* amort_prt.c */
125 void prt_amortization_schedule (amort_sched_ptr amortsched, FILE * ofile);
126 
127 #endif