#include <stdio.h>

/*
*************************************************************************

 ##                                      ##   ##                
 ##                                      ### ###                
 ##       ####    ####   #####    #####  #######  #####   ## ###
 ##      ##  ##      ##  ##  ##  ##      ## # ## ##  ##   ####  
 ##      ##  ##   #####  ##  ##   ####   ##   ## ##  ##   ###   
 ##      ##  ##  ##  ##  ##  ##      ##  ##   ##  #####   ##    
 ######   ####    ###### ##  ##  #####   ##   ##     ##   ##    
                                                 #####          

*************************************************************************

 Module:      LOANTYPE.DEF


 Description: This module defines all of the types and defines that are 
              common to 2 or more of LoansMgr's modules.


 Version:     1.0 (MS-DOS 6.2, Borland C++ 3.0)

 Author:      Michael A. Campbell

****************************************************************************
*/

/* Basic logic definitions, to make code more readable                    */

#define TRUE  1
#define FALSE 0


/* Constants related to date tables                                       */

#define NUM_MONTHS          12
#define NUM_YEARS           60



/* Type to hold the payment interval                                      */

struct t_pi {
   double n;                  /* The interval increment                   */
   double ny;                 /* The number of payments per year          */
   char   filler;             /* Force word alignment for this entity     */
   char   units;              /* The interval units: W (weeks) M (months) */
   char   str[82];            /* The above, as a printable string         */
};


/* Type to hold date control information during loan schedule generation  */

struct t_date_ctl {
   int     month;             /* Index into month table                    */
   int     year;              /* Index into year table                     */
   int     payment_number;    /* The number of this payment                */
   double  time_ctr;          /* Elapsed time counter, in units (above)    */
   char    date_str[8];       /* The string for the current date           */
};

/* Type to hold amortization file formatting information                   */

struct t_fmt_ctl {
   char    *loan_name;        /* User supplied name of loan                */
   char    *version;          /* Version of LoansMgr                       */
   int     lines_per_page;    /* Number of lines per page in amort. file   */
   int     page_num;          /* Current page number                       */
   int     lines_printed;     /* Number of lines printed on this page      */
   double  l;                 /* Loan size                                 */
   double  p;                 /* Payment size                              */
   double  i;                 /* Quoted interest rate                      */
   double  c;                 /* Compounding periods per year              */
   char   *pi_str;            /* Payment Interval as a printable string    */
   char   *start_date_str;    /* Starting date as a printable string       */
};
