#define LS_PROPOSED AGREE_PROPOSED
#define LS_SIGNED AGREE_SIGNED
-extern long get_outstand(int);
extern double loan_owed(struct lonstr *loan, time_t paytime);
#define getloan(n, p) ef_read(EF_LOAN, (n), (p))
extern char *trade_nameof(struct trdstr *, union trdgenstr *);
extern int trade_desc(struct trdstr *, union trdgenstr *);
extern int trade_getitem(struct trdstr *, union trdgenstr *);
-extern long get_couval(int);
#define gettrade(n, p) ef_read(EF_TRADE, (n), (p))
#define puttrade(n, p) ef_write(EF_TRADE, (n), (p))
return 1;
}
-long
-get_couval(int cnum)
-{
- struct sctstr *sp;
- int j, k, val;
- long secttot = 0;
-
- for (j = 0; NULL != (sp = getsectid(j)); j++) {
- if (sp->sct_own != cnum)
- continue;
- secttot += (long)(dchr[sp->sct_type].d_value *
- ((float)sp->sct_effic + 100.0));
- for (k = 0; ichr[k].i_name; k++) {
- if (ichr[k].i_value == 0 || ichr[k].i_uid == I_NONE)
- continue;
- val = sp->sct_item[ichr[k].i_uid];
- secttot += val * ichr[k].i_value;
- }
- }
- return secttot;
-}
-
-long
-get_outstand(int cnum)
-{
- struct lonstr loan;
- int j;
- long loantot = 0;
-
- for (j = 0; getloan(j, &loan); j++) {
- if (loan.l_status == LS_FREE)
- continue;
- if (loan.l_lonee == cnum)
- loantot += loan.l_amtdue;
- }
- return loantot;
-}
-
/*
* Return amount due for LOAN at time PAYTIME.
*/