/*乗乗乗乗乗乗乗乗乗乗乗乗乗乗乗乗乗乗乗乗乗乗乗乗乗乗乗乗乗乗乗乗乗乗乗乗乗乗//
    bolext.c
//乗乗乗乗乗乗乗乗乗乗乗乗乗乗乗乗乗乗乗乗乗乗乗乗乗乗乗乗乗乗乗乗乗乗乗乗乗乗*/

#include <windows.h>

#define  _USE_MATH_DEFINES
#include <math.h>
#include <stdarg.h>
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#include <bolalg.h>
#include <bolbas.h>
#include <bolcom.h>
#define  OWN_USE
#include <boldbe.h>
#include "bolext.h"

#define  MODNAM  "BOLEXT"
#define  MODVER  OCTVAL(2,6,0,0)

//乗乗乗乗乗乗乗乗乗乗乗乗乗乗乗乗乗乗乗乗乗乗乗乗乗乗乗乗乗乗乗乗乗乗乗乗乗乗//

  // 僶僀僩僐乕僪
static HBCD hbCur, hbAct;
static HBCD hbMain;
static HBCD hbAddIn;

pANY LOCALF tp_fscnb(pANY pv, rSTR st, rCOLI co)
{ // 暥帤楍偐傜撉崬
  U1B ar[12], rv[4];

  if (ColumnType(co)->flg & CF_OSC) {
    *(pP4B)ar = pv; *(pP4B)(ar + 4) = (P4B)st; *(pP4B)(ar + 8) = (P4B)co;
    CallBCD(rv, hbCur, (I4B)ColumnType(co)->fscn, ar);
    return pv;
  }
  return ColumnType(co)->fscn(pv, st, co);
}

pSTR LOCALF tp_fprnb(pSTR st, rANY pv, rCOLI co)
{ // 暥帤楍偵彂弌
  U1B ar[12], rv[4];

  if (ColumnType(co)->flg & CF_OPR) {
    *(pP4B)ar = st; *(pP4B)(ar + 4) = (P4B)pv; *(pP4B)(ar + 8) = (P4B)co;
    CallBCD(rv, hbCur, (I4B)ColumnType(co)->fprn, ar);
    return st;
  }
  return ColumnType(co)->fprn(st, pv, co);
}

I4B  LOCALF tp_fcmpb(rANY p1, rANY p2, rCOLI co)
{ // 斾妑
  U1B ar[12], rv[4];

  if (ColumnType(co)->flg & CF_OCM) {
    *(pP4B)ar = (P4B)p1; *(pP4B)(ar + 4) = (P4B)p2; *(pP4B)(ar + 8) = (P4B)co;
    CallBCD(rv, hbCur, (I4B)ColumnType(co)->fcmp, ar);
    return *(rI4B)rv;
  }
  return ColumnType(co)->fcmp(p1, p2, co);
}

uANY LOCALF tp_flstb(I4B im, rCOLI co)
{ // 儕僗僩崁栚
  U1B ar[8], rv[4];

  if (ColumnType(co)->flg & CF_OLS) {
    *(pI4B)ar = im; *(pP4B)(ar + 4) = (P4B)co;
    CallBCD(rv, hbCur, (I4B)ColumnType(co)->flst, ar);
    return *(rU4B)rv;
  }
  return ColumnType(co)->flst(im, co);
}

pANY LOCALF co_fcalb(pANY pv, rANY pb, rCOLI co)
{ // 寁嶼崁栚
  U1B ar[12], rv[4];

  if (co->flg & CF_OCL) {
    *(pP4B)ar = pv; *(pP4B)(ar + 4) = (P4B)pb; *(pP4B)(ar + 8) = (P4B)co;
    CallBCD(rv, hbCur, (I4B)co->fcal, ar);
    return pv;
  }
  return co->fcal(pv, pb, co);
}

BOOL LOCALF co_fchkb(rANY pb, rCOLI co)
{ // 僠僃僢僋
  U1B ar[8], rv[4];

  if (co->flg & CF_OCK) {
    *(pP4B)ar = (P4B)pb; *(pP4B)(ar + 4) = (P4B)co;
    CallBCD(rv, hbCur, (I4B)co->fchk, ar);
    return *(rI4B)rv;
  }
  return co->fchk(pb, co);
}

BOOL LOCALF RegisterColumnTypeB(rTYPI tp)
{ // 宆偺搊榐
  return RegisterColumnTypeX(tp, TRUE);
}

BOOL LOCALF tb_ftrgb(HTBL tb, I4B msg, I4B ir, pANY pb)
{ // 僩儕僈娭悢屇傃弌偟
  U1B ar[16], rv[4];

  if (TableFlags(tb) & TF_OTR) {
    *(pP4B)ar = tb; *(pI4B)(ar + 4) = msg; *(pI4B)(ar + 8) = ir; *(pP4B)(ar + 12) = pb;
    CallBCD(rv, hbCur, (I4B)tb->ftrg, ar);
    return *(rI4B)rv;
  }
  return tb->ftrg(tb, msg, ir, pb);
}

HTBL LOCALF CreateTableXB(pANY pv, I4B len, I4B cap, rTBLI ti)
{ // 昞嶌惉
  I4B i, nc;
  HTBL tb;
  pCOLI co, ci;

  tb = CreateTableX(pv, len, cap, ti); if (!tb) return NULL;
  nc = tb->cs->nc; co = tb->cs->co;
  for (i = 0, ci = co; i < nc; i++, ci++) {
    if (ti->cs->co[i].fcal) { ci->flg |= CF_OCL;}
    if (ti->cs->co[i].fchk) { ci->flg |= CF_OCK;}
  }
  if (ti->ftrg) { tb->flg |= TF_OTR;}
  return tb;
}

HTBL LOCALF CreateTableB(I4B cap, rTBLI ti)
{ // 昞嶌惉
  return CreateTableXB(NULL, 0, cap, ti);
}

BOOL LOCALF fselBCD(I4B ent, rANY pb, uANY pa)
{ // 慖戰娭悢
  U1B ar[8], rv[4];

  if (!ent) return TRUE;
  *(pP4B)ar = (P4B)pb; *(pU4B)(ar + 4) = pa;
  CallBCD(rv, hbAct, ent, ar);
  return *(rI4B)rv;
}

I4B  LOCALF SearchTableRowXB(HTBL tb, I4B i0, FSEL fsel, uANY pa)
{ // 僒乕僠
  I4B i, ln = NTableRows(tb);

  if (i0 < 0 || i0 > ln) { ierr(E_IRO); return -1;}
  if (!(hbAct = hbAddIn? hbAddIn: hbMain)) { ierr(E_NOA); return i0;}
  for (i = i0; i < ln; i++) {
    if (fselBCD((I4B)fsel, Row(tb, i), pa)) { return i;}
  }
  return -1;
}

I4B  LOCALF CountTableRowsXB(HTBL tb, FSEL fsel, uANY pa)
{ // 僇僂儞僩
  I4B i, n, ln = NTableRows(tb);

  if (!(hbAct = hbAddIn? hbAddIn: hbMain)) { ierr(E_NOA); return ln;}
  for (n = i = 0; i < ln; i++) {
    if (fselBCD((I4B)fsel, Row(tb, i), pa)) { n++;}
  }
  return n;
}

I4B  LOCALF SelectTableRowsXB(HTBL tb, FSEL fsel, uANY pa)
{ // 峣傝崬傒
  I4B i, n, ln = NTableRows(tb), sz = TableRowSize(tb);

  if (tb->flg & TF_RDO) { ierr(E_RDO); return ln;}
  if (tb->flg & TF_FIX) { ierr(E_FIX); return ln;}
  if (!(hbAct = hbAddIn? hbAddIn: hbMain)) { ierr(E_NOA); return ln;}
  for (n = i = 0; i < ln; i++) {
    if (fselBCD((I4B)fsel, Row(tb, i), pa)) {
      if (i > n) { memcpy(Row(tb, n), Row(tb, i), sz);}
      n++;
    }
  }
  return SetLen(tb->mb, n);
}

I4B  LOCALF InvSelectTableRowsXB(HTBL tb, FSEL fsel, uANY pa)
{ // 峣傝崬傒(忦審斀揮)
  I4B i, n, ln = NTableRows(tb), sz = TableRowSize(tb);

  for (n = i = 0; i < ln; i++) {
    if (!fselBCD((I4B)fsel, Row(tb, i), pa)) {
      if (i > n) { memcpy(Row(tb, n), Row(tb, i), sz);}
      n++;
    }
  }
  return SetLen(tb->mb, n);
}

HTBL LOCALF SelectCopyTableXB(HTBL tb, HTBL tx, FSEL fsel, uANY pa)
{ // 峣傝崬傒僐僺乕
  I4B i, ln, sz;

  if (!IsCompatible(tb, tx)) { ierr(E_CMP); return tb;}
  if (tb->flg & TF_RDO) { ierr(E_RDO); return tb;}
  if (tb->flg & TF_FIX) { ierr(E_FIX); return tb;}
  if (!(hbAct = hbAddIn? hbAddIn: hbMain)) { ierr(E_NOA); return tb;}
  DeleteTableRows(tb, 0, NTableRows(tb));
  ln = NTableRows(tx); sz = TableRowSize(tx);
  for (i = 0; i < ln; i++) {
    if (fselBCD((I4B)fsel, Row(tx, i), pa)) {
      memcpy(NewTableRow(tb), Row(tx, i), sz);
    }
  }
  return tb;
}

HTBL LOCALF SelectMergeTableXB(HTBL tb, HTBL tx, FSEL fsel, uANY pa)
{ // 峣傝崬傒儅乕僕(抲姺)
  I4B i, ln, sz;

  if (!IsCompatible(tb, tx)) { ierr(E_CMP); return tb;}
  if (tb->flg & TF_RDO) { ierr(E_RDO); return tb;}
  if (tb->flg & TF_FIX) { ierr(E_FIX); return tb;}
  if (!(hbAct = hbAddIn? hbAddIn: hbMain)) { ierr(E_NOA); return tb;}
  InvSelectTableRowsXB(tb, fsel, pa);
  ln = NTableRows(tx); sz = TableRowSize(tx);
  for (i = 0; i < ln; i++) {
    if (fselBCD((I4B)fsel, Row(tx, i), pa)) {
      memcpy(NewTableRow(tb), Row(tx, i), sz);
    }
  }
  return tb;
}

I4B  LOCALF AggregateTableXB(HTBL tb, FSEL fsel, uANY ps, FAGG fagg, uANY pa)
{ // 廤寁
  I4B i, n, ln = NTableRows(tb);

  if (!(hbAct = hbAddIn? hbAddIn: hbMain)) { ierr(E_NOA); return ln;}
  for (n = i = 0; i < ln; i++) {
    if (fselBCD((I4B)fsel, Row(tb, i), ps) && fselBCD((I4B)fagg, Row(tb, i), pa)) { n++;}
  }
  return n;
}

I4B  LOCALF fcmpBCD(I4B ent, rANY p1, rANY p2, uANY pa)
{ // 斾妑娭悢
  U1B ar[12], rv[4];

  if (!ent) return 0;
  *(pP4B)ar = (P4B)p1; *(pP4B)(ar + 4) = (P4B)p2; *(pU4B)(ar + 8) = pa;
  CallBCD(rv, hbAct, ent, ar);
  return *(rI4B)rv;
}

  // 暲傋懼偊梡僨乕僞
typedef struct {
  I4B   ent;
  uANY  pa;
} SRTP;

I4B  LOCALF fsrtBCD(rANY p1, rANY p2, SRTP *pa)
{ // 斾妑娭悢
  return fcmpBCD(pa->ent, p1, p2, pa->pa);
}

void LOCALF SortTableRowsXB(HTBL tb, FSRT fsrt, uANY pa)
{ // 暲傋懼偊
  I4B ln = NTableRows(tb);
  SRTP spa;

  if (tb->flg & TF_RDO) { ierr(E_RDO); return;}
  if (!(hbAct = hbAddIn? hbAddIn: hbMain)) { ierr(E_NOA); return;}
  spa.ent = (I4B)fsrt;
  spa.pa  = pa;
  SortItems(tb->mb, (FSRT)fsrtBCD, (uANY)&spa);
}

HBUF LOCALF CreateRowBufXB(pANY pv, rTBLI ti)
{ // 峴僶僢僼傽嶌惉
  HBUF rb;

  rb = CreateRowBufX(pv, ti); if (!rb) return NULL;
  if (ti->ftrg) { rb->flg |= TF_OTR;}
  return rb;
}

I4B  LOCALF SelectViewRowsXB(HVIW vw, FSEL fsel, uANY pa);
void LOCALF SortViewRowsXB(HVIW vw, FSRT fsrt, uANY pa);

HVIW LOCALF CreateViewXB(HTBL tb, rIDXS pa, FSEL fsel, uANY ps, FSRT fsrt, uANY pc)
{ // 價儏乕嶌惉
  HVIW vw;

  vw = CreateView0(tb); if (!vw) return NULL;
  ArrangeViewColumnsX(vw, pa);
  SelectViewRowsXB(vw, fsel, ps);
  SortViewRowsXB(vw, fsrt, pc);
  return vw;
}

I4B  LOCALF SearchViewRowXB(HVIW vw, I4B i0, FSEL fsel, uANY pa)
{ // 僒乕僠
  I4B i, nv = vw->vr->ni;
  rI4B vi = vw->vr->pi;

  if (i0 < 0 || i0 > nv) { ierr(E_IRO); return -1;}
  if (!(hbAct = hbAddIn? hbAddIn: hbMain)) { ierr(E_NOA); return i0;}
  for (i = i0; i < nv; i++) {
    if (fselBCD((I4B)fsel, Row((HTBL)vw, vi[i]), pa)) { return i;}
  }
  return -1;
}

I4B  LOCALF CountViewRowsXB(HVIW vw, FSEL fsel, uANY pa)
{ // 僇僂儞僩
  I4B i, n, nv = vw->vr->ni;
  rI4B vi = vw->vr->pi;

  if (!(hbAct = hbAddIn? hbAddIn: hbMain)) { ierr(E_NOA); return nv;}
  for (n = i = 0; i < nv; i++) {
    if (fselBCD((I4B)fsel, Row((HTBL)vw, vi[i]), pa)) { n++;}
  }
  return n;
}

I4B  LOCALF SelectViewRowsXB(HVIW vw, FSEL fsel, uANY pa)
{ // 峣傝崬傒
  I4B i, n, nv = vw->vr->ni, ln = NTableRows((HTBL)vw);
  pI4B vi = vw->vr->pi;

  if (!(hbAct = hbAddIn? hbAddIn: hbMain)) { ierr(E_NOA); return nv;}
  for (n = i = 0; i < ln; i++) {
    if (fselBCD((I4B)fsel, Row((HTBL)vw, i), pa)) {
      vi[n++] = i;
    }
  }
  return vw->vr->ni = n;
}

void LOCALF SortViewRowsXB(HVIW vw, FSRT fsrt, uANY pa)
{ // 暲傋懼偊
  I4B g, i, j, s, t, nv = vw->vr->ni;
  pI4B vi = vw->vr->pi;

  if (!(hbAct = hbAddIn? hbAddIn: hbMain)) { ierr(E_NOA); return;}
  if (!fsrt || nv <= 1) return;
  g = nv;
  do {
    switch (g = g * 10 / 13) {
    case 0: g = 1; break;
    case 9: case 10: g = 11; break;
    }
    s = 0;
    for (i = 0, j = g; j < nv; i++, j++) {
      if (fcmpBCD((I4B)fsrt, Row((HTBL)vw, vi[i]), Row((HTBL)vw, vi[j]), pa) > 0) {
        t = vi[i]; vi[i] = vi[j]; vi[j] = t;
        s = 1;
      }
    }
  } while (s != 0 || g > 1);
}

#define  EXT_DEF  ".BCF"
#define  EXT_OPR  ".BCO"
#define  EXT_REP  ".BCR"

typedef struct {
  rSTR  ext;
  rSTR  ent;
  rSTR  mai;
} BCDI;
  // 僄儞僩儕娭悢忣曬
static BCDI BCI[] = {
  { ".BCD",  "main",        "void main(void)" },
  { EXT_DEF, "ConnectMain", "BOOL ConnectMain(void);" },
  { EXT_OPR, "CommandMain", "void CommandMain(HWND hwnd);" },
  { EXT_REP, "ReportMain",  "BOOL ReportMain(HREP rp, I4B msg, I4B pg, uANY pa);" },
};

rSTR WINAPI BCDExt(I4B pro)
{ // 僶僀僩僐乕僪偺奼挘巕
  return (pro > 0 && pro < _countof(BCI))? BCI[pro].ext: BCI[0].ext;
}

rSTR WINAPI BCDMain(I4B pro)
{ // 僄儞僩儕娭悢愰尵
  return (pro > 0 && pro < _countof(BCI))? BCI[pro].mai: BCI[0].mai;
}

I4B  LOCALF strpro(rSTR st)
{ // 僄儞僩儕娭悢柤偐傜僾儘僔乕僕儍庬暿傪媮傔傞
  I4B i;

  for (i = PRO_DEF; i < _countof(BCI); i++) {
    if (strfind(st, BCI[i].ent)) { return i;}
  }
  return 0;
}

HBLK WINAPI CreateTMP(rPROI pi)
{ // 僥儞僾儗乕僩嶌惉
  HBLK xb;
  rSTR tmpstr1a =
    "COLI ciTMP[1] = {\r\n"
    "  { STR(64),  0, \"cnam\", \"楍僞僀僩儖\", \"楍愢柧\", CF_KEY, },\r\n"
    "};\r\n"
    "COLS csTMP = { ciTMP, _countof(ciTMP) };\r\n"
    "\r\n"
    "TBLI tiTMP[1] = {\r\n"
    "  { &csTMP, NULL, \"TNAM\",  \"昞僞僀僩儖\", \"昞愢柧\", },\r\n"
    "};\r\n"
    "TBLS tsTMP = { tiTMP, _countof(tiTMP) };\r\n"
    "\r\n"
    "BDBI dbTMP = { &tsTMP, ";
  rSTR tmpstr1b =
    "};\r\n"
    "\r\n"
    "BOOL ConnectMain(void)\r\n"
    "{ // 僒儞僾儖\r\n"
    "  I4B re;\r\n"
    "\r\n"
    "  re = ConnectDBX(&dbTMP);\r\n"
    "  if (re) NewDBFiles();\r\n"
    "  return re;\r\n"
    "}\r\n";
  rSTR tmpstr2 =
    "void CommandMain(HWND hwnd)\r\n"
    "{ // 僒儞僾儖\r\n"
    "  OkBox(hwnd, \"hello, world\", NULL);\r\n"
    "}\r\n";
  rSTR tmpstr3 =
    "BOOL ReportMain(HREP rp, I4B msg, I4B pg, uANY pa)\r\n"
    "{ // 僒儞僾儖\r\n"
    "  static CELL cel = { 20.0, 80.0, 190.0, 100.0 };\r\n"
    "\r\n"
    "  if (msg == REPM_DRAWPAGE) {\r\n"
    "    SetTextFont(rp, NULL, 15.0, 0, 0);\r\n"
    "    CellText(rp, &cel, \"hello, world\", DT_CEN);\r\n"
    "  }\r\n"
    "  return TRUE;\r\n"
    "}\r\n";

  xb = CreateTXT(256); if (!xb) return NULL;
  if (pi->nam[0]) {
    AddStr(xb, format("// info  nam=\"%s\"", pi->nam));
    if (pi->tit[0]) { AddStr(xb, format("  tit=\"%s\"", pi->tit));}
    if (pi->dsc[0]) { AddStr(xb, format("  dsc=\"%s\"", pi->dsc));}
    if (pi->pro)    { AddStr(xb, format("  pro=%d", pi->pro));}
    AddStr(xb, "\r\n\r\n");
  }
  switch (pi->pro) {
  case PRO_DEF:
    AddStr(xb, tmpstr1a);
    AddStr(xb, format("\"%s\", ", pi->nam[0]? pi->nam: "俢俛柤"));
    AddStr(xb, format("\"%s\", ", pi->tit[0]? pi->tit: "俢俛僞僀僩儖"));
    AddStr(xb, format("\"%s\" ",  pi->dsc[0]? pi->dsc: "俢俛愢柧"));
    AddStr(xb, tmpstr1b);
    break;
  case PRO_OPR:
    AddStr(xb, tmpstr2);
    break;
  case PRO_REP:
    AddStr(xb, tmpstr3);
    break;
  }
  return xb;
}

static COLI ciPRO[] = {
  { TID_U4B,  0, "pro", },
  { STR(16),  0, "nam", },
  { STR(32),  0, "tit", },
  { STR(64),  0, "dsc", },
};
static COLS csPRO = { ciPRO, _countof(ciPRO) };
static TBLI tiPRO = { &csPRO, };

void WINAPI ScanProcInfo(pPROI pi, HBLK xb)
{ // 僾儘僔乕僕儍忣曬偺庢摼
  rSTR pt, st = Ptr(xb);

  memset(pi, 0, sizeof(PROI));
  if (!!(pt = strfind(st, "info "))) {
    ReadATR(pi, &tiPRO, pt + 5);
  }
  if (pi->pro <= 0 || pi->pro >= _countof(BCI)) { pi->pro = strpro(st);}
}

I4B  LOCALF EnumBCD(HTBL tb, rSTR nam, I4B app, I4B pro)
{ // 僶僀僩僐乕僪偺儕僗僩嶌惉
  HFIL hf;
  FFDI ffd;
  BCDH bhd;
  BSDI dat;

  hf = find_first_file(nam, &ffd); if (!hf) return 0;
  do {
    if (!ReadBCDHeader(&bhd, ffd.nam)) continue;
    if (app != 0 && LOU2B(bhd.app) != LOU2B(app)) continue;
    if (pro != 0 && bhd.pro != pro) continue;
    strcpyx(dat.nam, basnamx(ffd.nam), sizeof(dat.nam) - 1);
    strcpyx(dat.tit, bhd.tit, sizeof(dat.tit) - 1);
    strcpyx(dat.dsc, bhd.dsc, sizeof(dat.dsc) - 1);
    *(pBSDI)NewTableRow(tb) = dat;
  } while (find_next_file(hf, &ffd));
  find_close(hf);
  return NTableRows(tb);
}

I4B  LOCALF db_fenmb(HTBL tb, I4B pro)
{ // 僶僀僩僐乕僪偺儕僗僩嶌惉
  return EnumBCD(tb, addext("*", BCDExt(pro)), IAPP, pro);
}

BOOL LOCALF ConnectDBXB(rBDBI db)
{ // 俢俛傊愙懕
  return ConnectDBXX(db, CreateTableB);
}

BOOL WINAPI ConnectDB(rSTR nam)
{ // 俢俛傊愙懕(俢俛掕媊僶僀僩僐乕僪偺幚峴)
  U1B ar[4], rv[4];

  if (CurAuth() == 0) { return (BOOL)ierr(E_NOL);}
  if (CurDBStatus()) { return (BOOL)ierr(E_DUC);}
  hbCur = hbMain = LoadBCD(addext(nam, EXT_DEF), IAPP, PRO_DEF, 0); if (!hbMain) return FALSE;
  ExecBCD(rv, hbMain, ar);
  return *(rI4B)rv;
}

void LOCALF db_fdisb(void)
{ // 俢俛傊偺愙懕夝彍
  if (hbMain) {
    UnloadBCD(hbMain); hbMain = NULL; hbCur = hbAddIn;
  }
}

BOOL WINAPI CallCommandMain(rSTR nam, HWND hwnd)
{ // 堦妵張棟僶僀僩僐乕僪偺幚峴
  U1B ar[4], rv[4];

  if (hbAddIn) { UnloadBCD(hbAddIn);}
  hbCur = hbAddIn = LoadBCD(addext(nam, EXT_OPR), IAPP, PRO_OPR, 0); if (!hbAddIn) return FALSE;
  *(pP4B)ar = hwnd;
  ExecBCD(rv, hbAddIn, ar);
  UnloadBCD(hbAddIn); hbCur = hbAddIn = NULL;
  return TRUE;
}

BOOL WINAPI LoadReportBCD(rSTR nam)
{ // 挔昜嶌惉僶僀僩僐乕僪僼傽僀儖撉崬
  if (hbAddIn) { UnloadBCD(hbAddIn);}
  hbCur = hbAddIn = LoadBCD(addext(nam, EXT_REP), IAPP, PRO_REP, 0); if (!hbAddIn) return FALSE;
  return TRUE;
}

void WINAPI UnloadReportBCD(void)
{ // 挔昜嶌惉僶僀僩僐乕僪偺嶍彍
  UnloadBCD(hbAddIn); hbCur = hbAddIn = NULL;
}

BOOL WINAPI CallReportMain(pANY rp, I4B msg, I4B pg, uANY pa)
{ // 挔昜嶌惉僶僀僩僐乕僪偺幚峴
  U1B ar[16], rv[4];

  if (!hbAddIn) { return (BOOL)ierr(E_NOA);}
  *(pP4B)ar = rp; *(pI4B)(ar + 4) = msg; *(pI4B)(ar + 8) = pg; *(pU4B)(ar + 12) = pa;
  ExecBCD(rv, hbAddIn, ar);
  return *(rI4B)rv;
}

//乗乗乗乗乗乗乗乗乗乗乗乗乗乗乗乗乗乗乗乗乗乗乗乗乗乗乗乗乗乗乗乗乗乗乗乗乗乗//

void LOCALF fi_I4BBox(pBIN sp)
{ // I4BBox
  *(pP4B)sp = (P4B)I4BBox(*(rI4B)sp);
}

void LOCALF fi_I8BBox(pBIN sp)
{ // I8BBox
  *(pP4B)(sp + 4) = (P4B)I8BBox(*(rI8B)sp);
}

void LOCALF fi_F4BBox(pBIN sp)
{ // F4BBox
  *(pP4B)sp = (P4B)F4BBox(*(rF4B)sp);
}

void LOCALF fi_F8BBox(pBIN sp)
{ // F8BBox
  *(pP4B)(sp + 4) = (P4B)F8BBox(*(rF8B)sp);
}

void LOCALF fi_RegisterColumnType(pBIN sp)
{ // RegisterColumnType(B)
  *(pI4B)sp = RegisterColumnTypeB(*(rP4B)sp);
}

void LOCALF fi_ColumnScan(pBIN sp)
{ // ColumnScan
  *(pP4B)(sp + 8) = ColumnScan(*(pP4B)sp, *(rP4B)(sp + 4), *(rP4B)(sp + 8));
}

void LOCALF fi_ColumnPrint(pBIN sp)
{ // ColumnPrint
  *(pP4B)(sp + 8) = ColumnPrint(*(pP4B)sp, *(rP4B)(sp + 4), *(rP4B)(sp + 8));
}

void LOCALF fi_ColumnList(pBIN sp)
{ // ColumnList
  *(pI4B)(sp + 4) = ColumnList(*(rI4B)sp, *(rP4B)(sp + 4));
}

void LOCALF fi_VPtr(pBIN sp)
{ // VPtr
  *(pP4B)(sp + 4) = (P4B)VPtr(*(rP4B)sp, *(rP4B)(sp + 4));
}

void LOCALF fi_CHTBL(pBIN sp)
{ // CHTBL
  *(pP4B)sp = CHTBL(*(rP4B)sp);
}

void LOCALF fi_CreateTableX(pBIN sp)
{ // CreateTableX(B)
  *(pP4B)(sp +12) = CreateTableXB(*(pP4B)sp, *(rI4B)(sp + 4), *(rI4B)(sp + 8), *(rP4B)(sp +12));
}

void LOCALF fi_CreateTable(pBIN sp)
{ // CreateTable(B)
  *(pP4B)(sp + 4) = CreateTableB(*(rI4B)sp, *(rP4B)(sp + 4));
}

void LOCALF fi_DeleteTable(pBIN sp)
{ // DeleteTable
  DeleteTable(*(rP4B)sp);
}

void LOCALF fi_NTableKeys(pBIN sp)
{ // NTableKeys
  *(pI4B)sp = NTableKeys(*(rP4B)sp);
}

void LOCALF fi_NTableRefs(pBIN sp)
{ // NTableRefs
  *(pI4B)(sp + 4) = NTableRefs(*(rP4B)sp, *(pP4B)(sp + 4));
}

void LOCALF fi_CreateCompatibleTable(pBIN sp)
{ // CreateCompatibleTable
  *(pP4B)(sp + 4) = CreateCompatibleTable(*(rP4B)sp, *(rI4B)(sp + 4));
}

void LOCALF fi_IsCompatible(pBIN sp)
{ // IsCompatible
  *(pI4B)(sp + 4) = IsCompatible(*(rP4B)sp, *(rP4B)(sp + 4));
}

void LOCALF fi_DuplicateTable(pBIN sp)
{ // DuplicateTable
  *(pP4B)sp = DuplicateTable(*(rP4B)sp);
}

void LOCALF fi_TableRowSize(pBIN sp)
{ // TableRowSize
  *(pI4B)sp = TableRowSize(*(rP4B)sp);
}

void LOCALF fi_NTableRows(pBIN sp)
{ // NTableRows
  *(pI4B)sp = NTableRows(*(rP4B)sp);
}

void LOCALF fi_TablePtr(pBIN sp)
{ // TablePtr
  *(pP4B)sp = TablePtr(*(rP4B)sp);
}

void LOCALF fi_TableRow(pBIN sp)
{ // TableRow
  *(pP4B)(sp + 4) = TableRow(*(rP4B)sp, *(rI4B)(sp + 4));
}

void LOCALF fi_TableRowIndex(pBIN sp)
{ // TableRowIndex
  *(pI4B)(sp + 4) = TableRowIndex(*(rP4B)sp, *(rP4B)(sp + 4));
}

void LOCALF fi_TableCapacity(pBIN sp)
{ // TableCapacity
  *(pI4B)sp = TableCapacity(*(rP4B)sp);
}

void LOCALF fi_ChangeTableCapacity(pBIN sp)
{ // ChangeTableCapacity
  *(pI4B)(sp + 4) = ChangeTableCapacity(*(rP4B)sp, *(rI4B)(sp + 4));
}

void LOCALF fi_TableName(pBIN sp)
{ // TableName
  *(pP4B)sp = (P4B)TableName(*(rP4B)sp);
}

void LOCALF fi_SetTableTitle(pBIN sp)
{ // SetTableTitle
  SetTableTitle(*(rP4B)sp, *(rP4B)(sp + 4));
}

void LOCALF fi_TableTitle(pBIN sp)
{ // TableTitle
  *(pP4B)sp = (P4B)TableTitle(*(rP4B)sp);
}

void LOCALF fi_SetTableDescription(pBIN sp)
{ // SetTableDescription
  SetTableDescription(*(rP4B)sp, *(rP4B)(sp + 4));
}

void LOCALF fi_TableDescription(pBIN sp)
{ // TableDescription
  *(pP4B)sp = (P4B)TableDescription(*(rP4B)sp);
}

void LOCALF fi_SetTableFlags(pBIN sp)
{ // SetTableFlags
  SetTableFlags(*(rP4B)sp, *(rI4B)(sp + 4));
}

void LOCALF fi_TableFlags(pBIN sp)
{ // TableFlags
  *(pI4B)sp = TableFlags(*(rP4B)sp);
}

void LOCALF fi_SetTableFileName(pBIN sp)
{ // SetTableFileName
  SetTableFileName(*(rP4B)sp, *(rP4B)(sp + 4));
}

void LOCALF fi_TableFileName(pBIN sp)
{ // TableFileName
  *(pP4B)sp = (P4B)TableFileName(*(rP4B)sp);
}

void LOCALF fi_SetTableExtra(pBIN sp)
{ // SetTableExtra
  SetTableExtra(*(rP4B)sp, *(rI4B)(sp + 4));
}

void LOCALF fi_TableExtra(pBIN sp)
{ // TableExtra
  *(pI4B)sp = TableExtra(*(rP4B)sp);
}

void LOCALF fi_DefaultTableTrigger(pBIN sp)
{ // DefaultTableTrigger
  *(pI4B)(sp +12) = DefaultTableTrigger(*(rP4B)sp, *(rI4B)(sp + 4), *(rI4B)(sp + 8), *(pP4B)(sp +12));
}

void LOCALF fi_TableTrigger(pBIN sp)
{ // TableTrigger
  *(pI4B)(sp +12) = TableTrigger(*(rP4B)sp, *(rI4B)(sp + 4), *(rI4B)(sp + 8), *(pP4B)(sp +12));
}

void LOCALF fi_EnableTableTrigger(pBIN sp)
{ // EnableTableTrigger
  *(pI4B)sp = EnableTableTrigger(*(rP4B)sp);
}

void LOCALF fi_DisableTableTrigger(pBIN sp)
{ // DisableTableTrigger
  *(pI4B)sp = DisableTableTrigger(*(rP4B)sp);
}

void LOCALF fi_NTableColumns(pBIN sp)
{ // NTableColumns
  *(pI4B)sp = NTableColumns(*(rP4B)sp);
}

void LOCALF fi_TableColumnInfo(pBIN sp)
{ // TableColumnInfo
  *(pP4B)(sp + 4) = (P4B)TableColumnInfo(*(rP4B)sp, *(rI4B)(sp + 4));
}

void LOCALF fi_SetTableColumnWidth(pBIN sp)
{ // SetTableColumnWidth
  SetTableColumnWidth(*(rP4B)sp, *(rI4B)(sp + 4), *(rI4B)(sp + 8));
}

void LOCALF fi_TableColumnWidth(pBIN sp)
{ // TableColumnWidth
  *(pI4B)(sp + 4) = TableColumnWidth(*(rP4B)sp, *(rI4B)(sp + 4));
}

void LOCALF fi_SetTableColumnTextAlign(pBIN sp)
{ // SetTableColumnTextAlign
  SetTableColumnTextAlign(*(rP4B)sp, *(rI4B)(sp + 4), *(rI4B)(sp + 8));
}

void LOCALF fi_TableColumnTextAlign(pBIN sp)
{ // TableColumnTextAlign
  *(pI4B)(sp + 4) = TableColumnTextAlign(*(rP4B)sp, *(rI4B)(sp + 4));
}

void LOCALF fi_TableColumnOffset(pBIN sp)
{ // TableColumnOffset
  *(pI4B)(sp + 4) = TableColumnOffset(*(rP4B)sp, *(rI4B)(sp + 4));
}

void LOCALF fi_TableColumnName(pBIN sp)
{ // TableColumnName
  *(pP4B)(sp + 4) = (P4B)TableColumnName(*(rP4B)sp, *(rI4B)(sp + 4));
}

void LOCALF fi_TableColumnIndex(pBIN sp)
{ // TableColumnIndex
  *(pI4B)(sp + 4) = TableColumnIndex(*(rP4B)sp, *(rP4B)(sp + 4));
}

void LOCALF fi_SetTableColumnTitle(pBIN sp)
{ // SetTableColumnTitle
  SetTableColumnTitle(*(rP4B)sp, *(rI4B)(sp + 4), *(rP4B)(sp + 8));
}

void LOCALF fi_TableColumnTitle(pBIN sp)
{ // TableColumnTitle
  *(pP4B)(sp + 4) = (P4B)TableColumnTitle(*(rP4B)sp, *(rI4B)(sp + 4));
}

void LOCALF fi_SetTableColumnDescription(pBIN sp)
{ // SetTableColumnDescription
  SetTableColumnDescription(*(rP4B)sp, *(rI4B)(sp + 4), *(rP4B)(sp + 8));
}

void LOCALF fi_TableColumnDescription(pBIN sp)
{ // TableColumnDescription
  *(pP4B)(sp + 4) = (P4B)TableColumnDescription(*(rP4B)sp, *(rI4B)(sp + 4));
}

void LOCALF fi_SetTableColumnFlags(pBIN sp)
{ // SetTableColumnFlags
  SetTableColumnFlags(*(rP4B)sp, *(rI4B)(sp + 4), *(rI4B)(sp + 8));
}

void LOCALF fi_TableColumnFlags(pBIN sp)
{ // TableColumnFlags
  *(pI4B)(sp + 4) = TableColumnFlags(*(rP4B)sp, *(rI4B)(sp + 4));
}

void LOCALF fi_SetTableColumnExtra(pBIN sp)
{ // SetTableColumnExtra
  SetTableColumnExtra(*(rP4B)sp, *(rI4B)(sp + 4), *(rI4B)(sp + 8));
}

void LOCALF fi_TableColumnExtra(pBIN sp)
{ // TableColumnExtra
  *(pI4B)(sp + 4) = TableColumnExtra(*(rP4B)sp, *(rI4B)(sp + 4));
}

void LOCALF fi_SetTableCellValue(pBIN sp)
{ // SetTableCellValue
  *(pI4B)(sp +12) = SetTableCellValue(*(rP4B)sp, *(rI4B)(sp + 4), *(rI4B)(sp + 8), *(rP4B)(sp +12));
}

void LOCALF fi_GetTableCellValue(pBIN sp)
{ // GetTableCellValue
  *(pP4B)(sp +12) = GetTableCellValue(*(pP4B)sp, *(rP4B)(sp + 4), *(rI4B)(sp + 8), *(rI4B)(sp +12));
}

void LOCALF fi_ScanTableCellValue(pBIN sp)
{ // ScanTableCellValue
  *(pI4B)(sp +12) = ScanTableCellValue(*(rP4B)sp, *(rI4B)(sp + 4), *(rI4B)(sp + 8), *(rP4B)(sp +12));
}

void LOCALF fi_PrintTableCellValue(pBIN sp)
{ // PrintTableCellValue
  *(pP4B)(sp +12) = PrintTableCellValue(*(pP4B)sp, *(rP4B)(sp + 4), *(rI4B)(sp + 8), *(rI4B)(sp +12));
}

void LOCALF fi_ClearTableRow(pBIN sp)
{ // ClearTableRow
  *(pI4B)(sp + 4) = ClearTableRow(*(rP4B)sp, *(rI4B)(sp + 4));
}

void LOCALF fi_ClearTableRows(pBIN sp)
{ // ClearTableRows
  *(pI4B)(sp + 8) = ClearTableRows(*(rP4B)sp, *(rI4B)(sp + 4), *(rI4B)(sp + 8));
}

void LOCALF fi_InsertTableRow(pBIN sp)
{ // InsertTableRow
  *(pI4B)(sp + 4) = InsertTableRow(*(rP4B)sp, *(rI4B)(sp + 4));
}

void LOCALF fi_InsertTableRows(pBIN sp)
{ // InsertTableRows
  *(pI4B)(sp + 8) = InsertTableRows(*(rP4B)sp, *(rI4B)(sp + 4), *(rI4B)(sp + 8));
}

void LOCALF fi_DeleteTableRow(pBIN sp)
{ // DeleteTableRow
  *(pI4B)(sp + 4) = DeleteTableRow(*(rP4B)sp, *(rI4B)(sp + 4));
}

void LOCALF fi_DeleteTableRows(pBIN sp)
{ // DeleteTableRows
  *(pI4B)(sp + 8) = DeleteTableRows(*(rP4B)sp, *(rI4B)(sp + 4), *(rI4B)(sp + 8));
}

void LOCALF fi_AddTableRow(pBIN sp)
{ // AddTableRow
  *(pI4B)sp = AddTableRow(*(rP4B)sp);
}

void LOCALF fi_NewTableRow(pBIN sp)
{ // NewTableRow
  *(pP4B)sp = NewTableRow(*(rP4B)sp);
}

void LOCALF fi_CopyTable(pBIN sp)
{ // CopyTable
  *(pP4B)(sp + 4) = CopyTable(*(rP4B)sp, *(rP4B)(sp + 4));
}

void LOCALF fi_MergeTableX(pBIN sp)
{ // MergeTableX
  *(pP4B)(sp + 4) = MergeTableX(*(rP4B)sp, *(rP4B)(sp + 4));
}

void LOCALF fi_CompareTable(pBIN sp)
{ // CompareTable
  *(pI4B)(sp + 4) = CompareTable(*(rP4B)sp, *(rP4B)(sp + 4));
}

void LOCALF fi_SearchTableRowX(pBIN sp)
{ // SearchTableRowX(B)
  *(pI4B)(sp +12) = SearchTableRowXB(*(rP4B)sp, *(rI4B)(sp + 4), *(rP4B)(sp + 8), *(rI4B)(sp +12));
}

void LOCALF fi_CountTableRowsX(pBIN sp)
{ // CountTableRowsX(B)
  *(pI4B)(sp + 8) = CountTableRowsXB(*(rP4B)sp, *(rP4B)(sp + 4), *(rI4B)(sp + 8));
}

void LOCALF fi_SelectTableRowsX(pBIN sp)
{ // SelectTableRowsX(B)
  *(pI4B)(sp + 8) = SelectTableRowsXB(*(rP4B)sp, *(rP4B)(sp + 4), *(rI4B)(sp + 8));
}

void LOCALF fi_SelectCopyTableX(pBIN sp)
{ // SelectCopyTableX(B)
  *(pP4B)(sp +12) = SelectCopyTableXB(*(rP4B)sp, *(rP4B)(sp + 4), *(rP4B)(sp + 8), *(rI4B)(sp +12));
}

void LOCALF fi_SelectMergeTableX(pBIN sp)
{ // SelectMergeTableX(B)
  *(pP4B)(sp +12) = SelectMergeTableXB(*(rP4B)sp, *(rP4B)(sp + 4), *(rP4B)(sp + 8), *(rI4B)(sp +12));
}

void LOCALF fi_AggregateTableX(pBIN sp)
{ // AggregateTableX(B)
  *(pI4B)(sp +16) = AggregateTableXB(*(rP4B)sp, *(rP4B)(sp + 4), *(rI4B)(sp + 8), *(rP4B)(sp +12), *(rI4B)(sp +16));
}

void LOCALF fi_SortTableRowsX(pBIN sp)
{ // SortTableRowsX(B)
  SortTableRowsXB(*(rP4B)sp, *(rP4B)(sp + 4), *(rI4B)(sp + 8));
}

void LOCALF fi_SearchTableCellValue(pBIN sp)
{ // SearchTableCellValue
  *(pI4B)(sp +12) = SearchTableCellValue(*(rP4B)sp, *(rI4B)(sp + 4), *(rI4B)(sp + 8), *(rP4B)(sp +12));
}

void LOCALF fi_SearchTableCellText(pBIN sp)
{ // SearchTableCellText
  *(pI4B)(sp +16) =
    SearchTableCellText(*(rP4B)sp, *(rI4B)(sp + 4), *(rI4B)(sp + 8), *(rP4B)(sp +12), *(rI4B)(sp +16));
}

void LOCALF fi_SearchAlt(pBIN sp)
{ // SearchAlt
  *(pI4B)(sp + 8) = SearchAlt(*(rP4B)sp, *(rI4B)(sp + 4), *(rP4B)(sp + 8));
}

void LOCALF fi_CheckTable(pBIN sp)
{ // CheckTable
  *(pI4B)sp = CheckTable(*(rP4B)sp);
}

void LOCALF fi_LoadBTB(pBIN sp)
{ // LoadBTB
  *(pI4B)sp = LoadBTB(*(rP4B)sp);
}

void LOCALF fi_SaveBTB(pBIN sp)
{ // SaveBTB
  *(pI4B)sp = SaveBTB(*(rP4B)sp);
}

void LOCALF fi_CreateRowBufX(pBIN sp)
{ // CreateRowBufX(B)
  *(pP4B)(sp + 4) = CreateRowBufXB(*(pP4B)sp, *(rP4B)(sp + 4));
}

void LOCALF fi_CreateRowBuf(pBIN sp)
{ // CreateRowBuf
  *(pP4B)sp = CreateRowBuf(*(rP4B)sp);
}

void LOCALF fi_DeleteRowBuf(pBIN sp)
{ // DeleteRowBuf
  DeleteRowBuf(*(rP4B)sp);
}

void LOCALF fi_DuplicateRowBuf(pBIN sp)
{ // DuplicateRowBuf
  *(pP4B)sp = DuplicateRowBuf(*(rP4B)sp);
}

void LOCALF fi_RowBufHTBL(pBIN sp)
{ // RowBufHTBL
  *(pP4B)sp = RowBufHTBL(*(rP4B)sp);
}

void LOCALF fi_RowBufPtr(pBIN sp)
{ // RowBufPtr
  *(pP4B)sp = RowBufPtr(*(rP4B)sp);
}

void LOCALF fi_MakeRowBuf(pBIN sp)
{ // MakeRowBuf
  *(pP4B)(sp + 4) = MakeRowBuf(*(rP4B)sp, *(pP4B)(sp + 4));
}

void LOCALF fi_TableRowBuf(pBIN sp)
{ // TableRowBuf
  *(pP4B)(sp + 4) = TableRowBuf(*(rP4B)sp, *(rI4B)(sp + 4));
}

void LOCALF fi_NewTableRowBuf(pBIN sp)
{ // NewTableRowBuf
  *(pP4B)sp = NewTableRowBuf(*(rP4B)sp);
}

void LOCALF fi_SetRowBufCellValue(pBIN sp)
{ // SetRowBufCellValue
  *(pI4B)(sp + 8) = SetRowBufCellValue(*(rP4B)sp, *(rI4B)(sp + 4), *(rP4B)(sp + 8));
}

void LOCALF fi_GetRowBufCellValue(pBIN sp)
{ // GetRowBufCellValue
  *(pP4B)(sp + 8) = GetRowBufCellValue(*(pP4B)sp, *(rP4B)(sp + 4), *(rI4B)(sp + 8));
}

void LOCALF fi_ScanRowBufCellValue(pBIN sp)
{ // ScanRowBufCellValue
  *(pI4B)(sp + 8) = ScanRowBufCellValue(*(rP4B)sp, *(rI4B)(sp + 4), *(rP4B)(sp + 8));
}

void LOCALF fi_PrintRowBufCellValue(pBIN sp)
{ // PrintRowBufCellValue
  *(pP4B)(sp + 8) = PrintRowBufCellValue(*(pP4B)sp, *(rP4B)(sp + 4), *(rI4B)(sp + 8));
}

void LOCALF fi_ClearRowBuf(pBIN sp)
{ // ClearRowBuf
  *(pI4B)sp = ClearRowBuf(*(rP4B)sp);
}

void LOCALF fi_CopyRowBuf(pBIN sp)
{ // CopyRowBuf
  *(pP4B)(sp + 4) = CopyRowBuf(*(rP4B)sp, *(rP4B)(sp + 4));
}

void LOCALF fi_SetTableRow(pBIN sp)
{ // SetTableRow
  *(pI4B)(sp + 8) = SetTableRow(*(rP4B)sp, *(rI4B)(sp + 4), *(rP4B)(sp + 8));
}

void LOCALF fi_GetTableRow(pBIN sp)
{ // GetTableRow
  *(pP4B)(sp + 8) = GetTableRow(*(rP4B)sp, *(rP4B)(sp + 4), *(rI4B)(sp + 8));
}

void LOCALF fi_SetNewTableRow(pBIN sp)
{ // SetNewTableRow
  *(pI4B)(sp + 4) = SetNewTableRow(*(rP4B)sp, *(rP4B)(sp + 4));
}

void LOCALF fi_CopyValues(pBIN sp)
{ // CopyValues
  *(pP4B)(sp + 4) = CopyValues(*(rP4B)sp, *(rP4B)(sp + 4));
}

void LOCALF fi_CopyKey(pBIN sp)
{ // CopyKey
  *(pP4B)(sp + 4) = CopyKey(*(rP4B)sp, *(rP4B)(sp + 4));
}

void LOCALF fi_CompareRowBuf(pBIN sp)
{ // CompareRowBuf
  *(pI4B)(sp + 4) = CompareRowBuf(*(rP4B)sp, *(rP4B)(sp + 4));
}

void LOCALF fi_SearchKey(pBIN sp)
{ // SearchKey
  *(pI4B)(sp + 4) = SearchKey(*(rP4B)sp, *(rP4B)(sp + 4));
}

void LOCALF fi_MergeTable(pBIN sp)
{ // MergeTable
  *(pP4B)(sp + 4) = MergeTable(*(rP4B)sp, *(rP4B)(sp + 4));
}

void LOCALF fi_UniqueKey(pBIN sp)
{ // UniqueKey
  *(pI4B)(sp +12) = UniqueKey(*(rP4B)sp, *(rI4B)(sp + 4), *(rI4B)(sp + 8), *(rI4B)(sp +12));
}

void LOCALF fi_CreateSummaryV(pBIN sp)
{ // CreateSummaryV
  *(pP4B)(sp +12) = CreateSummaryV(*(rP4B)sp, *(rP4B)(sp + 4), *(rP4B)(sp + 8), *(rP4B)(sp +12));
}

void LOCALF fi_IsConflict(pBIN sp)
{ // IsConflict
  *(pI4B)(sp + 4) = IsConflict(*(rP4B)sp, *(rP4B)(sp + 4));
}

void LOCALF fi_IsDependent(pBIN sp)
{ // IsDependent
  *(pI4B)(sp +16) = IsDependent(*(rP4B)sp, *(rI4B)(sp + 4), *(rI4B)(sp + 8), *(rP4B)(sp +12), *(rP4B)(sp +16));
}

void LOCALF fi_CreateViewX(pBIN sp)
{ // CreateViewX(B)
  *(pP4B)(sp +20) =
    CreateViewXB(*(rP4B)sp, *(rP4B)(sp + 4), *(rP4B)(sp + 8), *(rI4B)(sp +12), *(rP4B)(sp +16), *(rI4B)(sp +20));
}
void LOCALF fi_CreateView(pBIN sp)
{ // CreateView
  *(pP4B)(sp +12) = CreateView(*(rP4B)sp, *(rP4B)(sp + 4), *(rP4B)(sp + 8), *(rP4B)(sp +12));
}

void LOCALF fi_DeleteView(pBIN sp)
{ // DeleteView
  DeleteView(*(rP4B)sp);
}

void LOCALF fi_ViewHTBL(pBIN sp)
{ // ViewHTBL
  *(pP4B)sp = ViewHTBL(*(rP4B)sp);
}

void LOCALF fi_NViewRows(pBIN sp)
{ // NViewRows
  *(pI4B)sp = NViewRows(*(rP4B)sp);
}

void LOCALF fi_ViewRow(pBIN sp)
{ // ViewRow
  *(pP4B)(sp + 4) = ViewRow(*(rP4B)sp, *(rI4B)(sp + 4));
}

void LOCALF fi_ViewRowIndex(pBIN sp)
{ // ViewRowIndex
  *(pI4B)(sp + 4) = ViewRowIndex(*(rP4B)sp, *(rI4B)(sp + 4));
}

void LOCALF fi_NViewColumns(pBIN sp)
{ // NViewColumns
  *(pI4B)sp = NViewColumns(*(rP4B)sp);
}

void LOCALF fi_ViewColumnInfo(pBIN sp)
{ // ViewColumnInfo
  *(pP4B)(sp + 4) = (P4B)ViewColumnInfo(*(rP4B)sp, *(rI4B)(sp + 4));
}

void LOCALF fi_SetViewColumnWidth(pBIN sp)
{ // SetViewColumnWidth
  SetViewColumnWidth(*(rP4B)sp, *(rI4B)(sp + 4), *(rI4B)(sp + 8));
}

void LOCALF fi_ViewColumnWidth(pBIN sp)
{ // ViewColumnWidth
  *(pI4B)(sp + 4) = ViewColumnWidth(*(rP4B)sp, *(rI4B)(sp + 4));
}

void LOCALF fi_ViewColumnWidthF(pBIN sp)
{ // ViewColumnWidthF
  *(pI4B)(sp + 4) = ViewColumnWidthF(*(rP4B)sp, *(rI4B)(sp + 4));
}

void LOCALF fi_SetViewColumnTextAlign(pBIN sp)
{ // SetViewColumnTextAlign
  SetViewColumnTextAlign(*(rP4B)sp, *(rI4B)(sp + 4), *(rI4B)(sp + 8));
}

void LOCALF fi_ViewColumnTextAlign(pBIN sp)
{ // ViewColumnTextAlign
  *(pI4B)(sp + 4) = ViewColumnTextAlign(*(rP4B)sp, *(rI4B)(sp + 4));
}

void LOCALF fi_ViewColumnTextAlignF(pBIN sp)
{ // ViewColumnTextAlignF
  *(pI4B)(sp + 4) = ViewColumnTextAlignF(*(rP4B)sp, *(rI4B)(sp + 4));
}

void LOCALF fi_ViewColumnName(pBIN sp)
{ // ViewColumnName
  *(pP4B)(sp + 4) = (P4B)ViewColumnName(*(rP4B)sp, *(rI4B)(sp + 4));
}

void LOCALF fi_ViewColumnIndex(pBIN sp)
{ // ViewColumnIndex
  *(pI4B)(sp + 4) = ViewColumnIndex(*(rP4B)sp, *(rI4B)(sp + 4));
}

void LOCALF fi_SetViewColumnTitle(pBIN sp)
{ // SetViewColumnTitle
  SetViewColumnTitle(*(rP4B)sp, *(rI4B)(sp + 4), *(rP4B)(sp + 8));
}

void LOCALF fi_ViewColumnTitle(pBIN sp)
{ // ViewColumnTitle
  *(pP4B)(sp + 4) = (P4B)ViewColumnTitle(*(rP4B)sp, *(rI4B)(sp + 4));
}

void LOCALF fi_SetViewColumnDescription(pBIN sp)
{ // SetViewColumnDescription
  SetViewColumnDescription(*(rP4B)sp, *(rI4B)(sp + 4), *(rP4B)(sp + 8));
}

void LOCALF fi_ViewColumnDescription(pBIN sp)
{ // ViewColumnDescription
  *(pP4B)(sp + 4) = (P4B)ViewColumnDescription(*(rP4B)sp, *(rI4B)(sp + 4));
}

void LOCALF fi_ViewColumnDescriptionR(pBIN sp)
{ // ViewColumnDescriptionR
  *(pP4B)(sp + 4) = (P4B)ViewColumnDescriptionR(*(rP4B)sp, *(rI4B)(sp + 4));
}

void LOCALF fi_SetViewColumnFlags(pBIN sp)
{ // SetViewColumnFlags
  SetViewColumnFlags(*(rP4B)sp, *(rI4B)(sp + 4), *(rI4B)(sp + 8));
}

void LOCALF fi_ViewColumnFlags(pBIN sp)
{ // ViewColumnFlags
  *(pI4B)(sp + 4) = ViewColumnFlags(*(rP4B)sp, *(rI4B)(sp + 4));
}

void LOCALF fi_ViewColumnFlagsF(pBIN sp)
{ // ViewColumnFlagsF
  *(pI4B)(sp + 4) = ViewColumnFlagsF(*(rP4B)sp, *(rI4B)(sp + 4));
}

void LOCALF fi_SetViewColumnExtra(pBIN sp)
{ // SetViewColumnExtra
  SetViewColumnExtra(*(rP4B)sp, *(rI4B)(sp + 4), *(rI4B)(sp + 8));
}

void LOCALF fi_ViewColumnExtra(pBIN sp)
{ // ViewColumnExtra
  *(pI4B)(sp + 4) = ViewColumnExtra(*(rP4B)sp, *(rI4B)(sp + 4));
}

void LOCALF fi_SetViewCellValue(pBIN sp)
{ // SetViewCellValue
  *(pI4B)(sp +12) = SetViewCellValue(*(rP4B)sp, *(rI4B)(sp + 4), *(rI4B)(sp + 8), *(rP4B)(sp +12));
}

void LOCALF fi_GetViewCellValue(pBIN sp)
{ // GetViewCellValue
  *(pP4B)(sp +12) = GetViewCellValue(*(pP4B)sp, *(rP4B)(sp + 4), *(rI4B)(sp + 8), *(rI4B)(sp +12));
}

void LOCALF fi_ScanViewCellValue(pBIN sp)
{ // ScanViewCellValue
  *(pI4B)(sp +12) = ScanViewCellValue(*(rP4B)sp, *(rI4B)(sp + 4), *(rI4B)(sp + 8), *(rP4B)(sp +12));
}

void LOCALF fi_ScanViewCellValueF(pBIN sp)
{ // ScanViewCellValueF
  *(pI4B)(sp +12) = ScanViewCellValueF(*(rP4B)sp, *(rI4B)(sp + 4), *(rI4B)(sp + 8), *(rP4B)(sp +12));
}

void LOCALF fi_PrintViewCellValue(pBIN sp)
{ // PrintViewCellValue
  *(pP4B)(sp +12) = PrintViewCellValue(*(pP4B)sp, *(rP4B)(sp + 4), *(rI4B)(sp + 8), *(rI4B)(sp +12));
}

void LOCALF fi_PrintViewCellValueF(pBIN sp)
{ // PrintViewCellValueF
  *(pP4B)(sp +16) =
    PrintViewCellValueF(*(pP4B)sp, *(rP4B)(sp + 4), *(rI4B)(sp + 8), *(rI4B)(sp +12), *(rI4B)(sp +16));
}

void LOCALF fi_ClearViewRow(pBIN sp)
{ // ClearViewRow
  *(pI4B)(sp + 4) = ClearViewRow(*(rP4B)sp, *(rI4B)(sp + 4));
}

void LOCALF fi_ClearViewRows(pBIN sp)
{ // ClearViewRows
  *(pI4B)(sp + 8) = ClearViewRows(*(rP4B)sp, *(rI4B)(sp + 4), *(rI4B)(sp + 8));
}

void LOCALF fi_InsertViewRow(pBIN sp)
{ // InsertViewRow
  *(pI4B)(sp + 4) = InsertViewRow(*(rP4B)sp, *(rI4B)(sp + 4));
}

void LOCALF fi_InsertViewRows(pBIN sp)
{ // InsertViewRows
  *(pI4B)(sp + 8) = InsertViewRows(*(rP4B)sp, *(rI4B)(sp + 4), *(rI4B)(sp + 8));
}

void LOCALF fi_DeleteViewRow(pBIN sp)
{ // DeleteViewRow
  *(pI4B)(sp + 4) = DeleteViewRow(*(rP4B)sp, *(rI4B)(sp + 4));
}

void LOCALF fi_DeleteViewRows(pBIN sp)
{ // DeleteViewRows
  *(pI4B)(sp + 8) = DeleteViewRows(*(rP4B)sp, *(rI4B)(sp + 4), *(rI4B)(sp + 8));
}

void LOCALF fi_AddViewRow(pBIN sp)
{ // AddViewRow
  *(pI4B)sp = AddViewRow(*(rP4B)sp);
}

void LOCALF fi_NewViewRow(pBIN sp)
{ // NewViewRow
  *(pP4B)sp = NewViewRow(*(rP4B)sp);
}

void LOCALF fi_ArrangeViewColumnsX(pBIN sp)
{ // ArrangeViewColumnsX
  ArrangeViewColumnsX(*(rP4B)sp, *(rP4B)(sp + 4));
}

void LOCALF fi_SearchViewRowX(pBIN sp)
{ // SearchViewRowX(B)
  *(pI4B)(sp +12) = SearchViewRowXB(*(rP4B)sp, *(rI4B)(sp + 4), *(rP4B)(sp + 8), *(rI4B)(sp +12));
}

void LOCALF fi_CountViewRowsX(pBIN sp)
{ // CountViewRowsX(B)
  *(pI4B)(sp + 8) = CountViewRowsXB(*(rP4B)sp, *(rP4B)(sp + 4), *(rI4B)(sp + 8));
}

void LOCALF fi_SelectViewRowsX(pBIN sp)
{ // SelectViewRowsX(B)
  *(pI4B)(sp + 8) = SelectViewRowsXB(*(rP4B)sp, *(rP4B)(sp + 4), *(rI4B)(sp + 8));
}

void LOCALF fi_SortViewRowsX(pBIN sp)
{ // SortViewRowsX(B)
  SortViewRowsXB(*(rP4B)sp, *(rP4B)(sp + 4), *(rI4B)(sp + 8));
}

void LOCALF fi_ArrangeViewColumns(pBIN sp)
{ // ArrangeViewColumns
  ArrangeViewColumns(*(rP4B)sp, *(rP4B)(sp + 4));
}

void LOCALF fi_SearchViewRow(pBIN sp)
{ // SearchViewRow
  *(pI4B)(sp + 8) = SearchViewRow(*(rP4B)sp, *(rI4B)(sp + 4), *(rP4B)(sp + 8));
}

void LOCALF fi_CountViewRows(pBIN sp)
{ // CountViewRows
  *(pI4B)(sp + 4) = CountViewRows(*(rP4B)sp, *(rP4B)(sp + 4));
}

void LOCALF fi_SelectViewRows(pBIN sp)
{ // SelectViewRows
  *(pI4B)(sp + 4) = SelectViewRows(*(rP4B)sp, *(rP4B)(sp + 4));
}

void LOCALF fi_SortViewRows(pBIN sp)
{ // SortViewRows
  SortViewRows(*(rP4B)sp, *(rP4B)(sp + 4));
}

void LOCALF fi_SortTableRowsByView(pBIN sp)
{ // SortTableRowsByView
  SortTableRowsByView(*(rP4B)sp);
}

void LOCALF fi_CreateSummary(pBIN sp)
{ // CreateSummary
  *(pP4B)(sp + 4) = CreateSummary(*(rP4B)sp, *(rP4B)(sp + 4));
}

void LOCALF fi_SearchViewCellValue(pBIN sp)
{ // SearchViewCellValue
  *(pI4B)(sp +12) = SearchViewCellValue(*(rP4B)sp, *(rI4B)(sp + 4), *(rI4B)(sp + 8), *(rP4B)(sp +12));
}

void LOCALF fi_SearchViewCellText(pBIN sp)
{ // SearchViewCellText
  *(pI4B)(sp +16) =
    SearchViewCellText(*(rP4B)sp, *(rI4B)(sp + 4), *(rI4B)(sp + 8), *(rP4B)(sp +12), *(rI4B)(sp +16));
}

void LOCALF fi_ReadCSV(pBIN sp)
{ // ReadCSV
  *(pI4B)(sp + 8) = ReadCSV(*(rP4B)sp, *(rP4B)(sp + 4), *(rP4B)(sp + 8));
}

void LOCALF fi_WriteCSV(pBIN sp)
{ // WriteCSV
  *(pI4B)(sp + 8) = WriteCSV(*(rP4B)sp, *(rP4B)(sp + 4), *(rP4B)(sp + 8));
}

void LOCALF fi_SiteName(pBIN sp)
{ // SiteName
  *(pP4B)(sp - 4) = (P4B)SiteName();
}

void LOCALF fi_SiteTitle(pBIN sp)
{ // SiteTitle
  *(pP4B)(sp - 4) = (P4B)SiteTitle();
}

void LOCALF fi_SiteDescription(pBIN sp)
{ // SiteDescription
  *(pP4B)(sp - 4) = (P4B)SiteDescription();
}

void LOCALF fi_TaxRate(pBIN sp)
{ // TaxRate
  *(pF8B)(sp - 8) = TaxRate();
}

void LOCALF fi_FYearMonth(pBIN sp)
{ // FYearMonth
  *(pI4B)(sp - 4) = FYearMonth();
}

void LOCALF fi_NMonthFYear(pBIN sp)
{ // NMonthFYear
  *(pI4B)(sp - 4) = NMonthFYear();
}

void LOCALF fi_UserPath(pBIN sp)
{ // UserPath
  *(pP4B)(sp - 4) = (P4B)UserPath();
}

void LOCALF fi_SetCurDate(pBIN sp)
{ // SetCurDate
  SetCurDate(*(rI4B)sp);
}

void LOCALF fi_CurDate(pBIN sp)
{ // CurDate
  *(pI4B)(sp - 4) = CurDate();
}

void LOCALF fi_BFYear(pBIN sp)
{ // BFYear
  *(pI4B)(sp - 4) = BFYear();
}

void LOCALF fi_EFYear(pBIN sp)
{ // EFYear
  *(pI4B)(sp - 4) = EFYear();
}

void LOCALF fi_BMonth(pBIN sp)
{ // BMonth
  *(pI4B)(sp - 4) = BMonth();
}

void LOCALF fi_EMonth(pBIN sp)
{ // EMonth
  *(pI4B)(sp - 4) = EMonth();
}

void LOCALF fi_CurUser(pBIN sp)
{ // CurUser
  *(pP4B)(sp - 4) = (P4B)CurUser();
}

void LOCALF fi_CurAuth(pBIN sp)
{ // CurAuth
  *(pI4B)(sp - 4) = CurAuth();
}

void LOCALF fi_ConnectDBX(pBIN sp)
{ // ConnectDBX(B)
  *(pI4B)sp = ConnectDBXB(*(rP4B)sp);
}

void LOCALF fi_ConnectDB(pBIN sp)
{ // ConnectDB
  *(pI4B)sp = ConnectDB(*(rP4B)sp);
}

void LOCALF fi_DisconnectDB(pBIN sp)
{ // DisconnectDB
  DisconnectDB();
}

void LOCALF fi_CurDBName(pBIN sp)
{ // CurDBName
  *(pP4B)(sp - 4) = (P4B)CurDBName();
}

void LOCALF fi_CurDBTitle(pBIN sp)
{ // CurDBTitle
  *(pP4B)(sp - 4) = (P4B)CurDBTitle();
}

void LOCALF fi_CurDBDescription(pBIN sp)
{ // CurDBDescription
  *(pP4B)(sp - 4) = (P4B)CurDBDescription();
}

void LOCALF fi_CurDBStatus(pBIN sp)
{ // CurDBStatus
  *(pI4B)(sp - 4) = CurDBStatus();
}

void LOCALF fi_NDBTables(pBIN sp)
{ // NDBTables
  *(pI4B)(sp - 4) = NDBTables();
}

void LOCALF fi_DBTable(pBIN sp)
{ // DBTable
  *(pP4B)sp = DBTable(*(rI4B)sp);
}

void LOCALF fi_DBTableName(pBIN sp)
{ // DBTableName
  *(pP4B)sp = (P4B)DBTableName(*(rI4B)sp);
}

void LOCALF fi_DBTableTitle(pBIN sp)
{ // DBTableTitle
  *(pP4B)sp = (P4B)DBTableTitle(*(rI4B)sp);
}

void LOCALF fi_DBTableDescription(pBIN sp)
{ // DBTableDescription
  *(pP4B)sp = (P4B)DBTableDescription(*(rI4B)sp);
}

void LOCALF fi_DBTableFileName(pBIN sp)
{ // DBTableFileName
  *(pP4B)sp = (P4B)DBTableFileName(*(rI4B)sp);
}

void LOCALF fi_DBTableVIWS(pBIN sp)
{ // DBTableVIWS
  *(pP4B)sp = (P4B)DBTableVIWS(*(rI4B)sp);
}

void LOCALF fi_DBTableIndex(pBIN sp)
{ // DBTableIndex
  *(pI4B)sp = DBTableIndex(*(rP4B)sp);
}

void LOCALF fi_DBHTBL(pBIN sp)
{ // DBHTBL
  *(pP4B)sp = DBHTBL(*(rP4B)sp);
}

void LOCALF fi_OpenTableX(pBIN sp)
{ // OpenTableX
  *(pP4B)(sp + 4) = OpenTableX(*(rP4B)sp, *(rI4B)(sp + 4));
}

void LOCALF fi_OpenTable(pBIN sp)
{ // OpenTable
  *(pP4B)(sp + 4) = OpenTable(*(rP4B)sp, *(rI4B)(sp + 4));
}

void LOCALF fi_SaveTable(pBIN sp)
{ // SaveTable
  *(pI4B)sp = SaveTable(*(rP4B)sp);
}

void LOCALF fi_CloseTable(pBIN sp)
{ // CloseTable
  *(pI4B)(sp + 4) = CloseTable(*(rP4B)sp, *(rI4B)(sp + 4));
}

void LOCALF fi_OHTBL(pBIN sp)
{ // OHTBL
  *(pP4B)sp = OHTBL(*(rP4B)sp);
}

void LOCALF fi_NOTables(pBIN sp)
{ // NOTables
  *(pI4B)sp = NOTables(*(rP4B)sp);
}

void LOCALF fi_OTable(pBIN sp)
{ // OTable
  *(pP4B)(sp + 4) = OTable(*(rP4B)sp, *(rI4B)(sp + 4));
}

void LOCALF fi_IsReadOnly(pBIN sp)
{ // IsReadOnly
  *(pI4B)sp = IsReadOnly(*(rP4B)sp);
}

void LOCALF fi_IsLocked(pBIN sp)
{ // IsLocked
  *(pI4B)sp = IsLocked(*(rP4B)sp);
}

void LOCALF fi_IsModified(pBIN sp)
{ // IsModified
  *(pI4B)sp = IsModified(*(rP4B)sp);
}

void LOCALF fi_NewDBFiles(pBIN sp)
{ // NewDBFiles
  *(pI4B)(sp - 4) = NewDBFiles();
}

void LOCALF fi_BackupDBFiles(pBIN sp)
{ // BackupDBFiles
  *(pI4B)sp = BackupDBFiles(*(rP4B)sp);
}

void LOCALF fi_TrashDBFiles(pBIN sp)
{ // TrashDBFiles
  *(pI4B)sp = TrashDBFiles(*(rP4B)sp);
}

static BFNC fiDBE[] = {
  // 284-287
  fi_I4BBox,                   fi_I8BBox,                   fi_F4BBox,                   fi_F8BBox,
  // 288-319
  fi_I4BBox,                   fi_I8BBox,                   fi_F4BBox,                   fi_F8BBox,
  fi_0, /* FSCN */             fi_0, /* FPRN */             fi_0, /* FCMP */             fi_0, /* FLST */
  fi_RegisterColumnType,       fi_0, /* FCAL */             fi_0, /* FCHK */             fi_ColumnScan,
  fi_ColumnPrint,              fi_ColumnList,               fi_VPtr,                     fi_CHTBL,
  fi_0, /* FTRG */             fi_CreateTableX,             fi_CreateTable,              fi_DeleteTable,
  fi_NTableKeys,               fi_NTableRefs,               fi_CreateCompatibleTable,    fi_IsCompatible,
  fi_DuplicateTable,           fi_TableRowSize,             fi_NTableRows,               fi_TablePtr,
  fi_TableRow,                 fi_TableRowIndex,            fi_TableCapacity,            fi_ChangeTableCapacity,
  // 320-351
  fi_TableName,                fi_SetTableTitle,            fi_TableTitle,               fi_SetTableDescription,
  fi_TableDescription,         fi_SetTableFlags,            fi_TableFlags,               fi_SetTableFileName,
  fi_TableFileName,            fi_SetTableExtra,            fi_TableExtra,               fi_DefaultTableTrigger,
  fi_TableTrigger,             fi_EnableTableTrigger,       fi_DisableTableTrigger,      fi_NTableColumns,
  fi_TableColumnInfo,          fi_SetTableColumnWidth,      fi_TableColumnWidth,         fi_SetTableColumnTextAlign,
  fi_TableColumnTextAlign,     fi_TableColumnOffset,        fi_TableColumnName,          fi_TableColumnIndex,
  fi_SetTableColumnTitle,      fi_TableColumnTitle,         fi_SetTableColumnDescription,fi_TableColumnDescription,
  fi_SetTableColumnFlags,      fi_TableColumnFlags,         fi_SetTableColumnExtra,      fi_TableColumnExtra,
  // 352-383
  fi_SetTableCellValue,        fi_GetTableCellValue,        fi_ScanTableCellValue,       fi_PrintTableCellValue,
  fi_ClearTableRow,            fi_ClearTableRows,           fi_InsertTableRow,           fi_InsertTableRows,
  fi_DeleteTableRow,           fi_DeleteTableRows,          fi_AddTableRow,              fi_NewTableRow,
  fi_CopyTable,                fi_MergeTableX,              fi_CompareTable,             fi_0, /* FSEL */
  fi_SearchTableRowX,          fi_CountTableRowsX,          fi_SelectTableRowsX,         fi_SelectCopyTableX,
  fi_SelectMergeTableX,        fi_0, /* FAGG */             fi_AggregateTableX,          fi_0, /* FSRT */
  fi_SortTableRowsX,           fi_SearchTableCellValue,     fi_SearchTableCellText,      fi_SearchAlt,
  fi_CheckTable,               fi_LoadBTB,                  fi_SaveBTB,                  fi_0, /* 383 */
  // 384-415
  fi_CreateRowBufX,            fi_CreateRowBuf,             fi_DeleteRowBuf,             fi_DuplicateRowBuf,
  fi_RowBufHTBL,               fi_RowBufPtr,                fi_MakeRowBuf,               fi_TableRowBuf,
  fi_NewTableRowBuf,           fi_SetRowBufCellValue,       fi_GetRowBufCellValue,       fi_ScanRowBufCellValue,
  fi_PrintRowBufCellValue,     fi_ClearRowBuf,              fi_CopyRowBuf,               fi_SetTableRow,
  fi_GetTableRow,              fi_SetNewTableRow,           fi_CopyValues,               fi_CopyKey,
  fi_CompareRowBuf,            fi_SearchKey,                fi_MergeTable,               fi_UniqueKey,
  fi_CreateSummaryV,           fi_IsConflict,               fi_IsDependent,              fi_0, /* 411 */
  fi_CreateViewX,              fi_CreateView,               fi_DeleteView,               fi_ViewHTBL,
  // 416-447
  fi_NViewRows,                fi_ViewRow,                  fi_ViewRowIndex,             fi_NViewColumns,
  fi_ViewColumnInfo,           fi_SetViewColumnWidth,       fi_ViewColumnWidth,          fi_ViewColumnWidthF,
  fi_SetViewColumnTextAlign,   fi_ViewColumnTextAlign,      fi_ViewColumnTextAlignF,     fi_ViewColumnName,
  fi_ViewColumnIndex,          fi_SetViewColumnTitle,       fi_ViewColumnTitle,          fi_SetViewColumnDescription,
  fi_ViewColumnDescription,    fi_ViewColumnDescriptionR,   fi_SetViewColumnFlags,       fi_ViewColumnFlags,
  fi_ViewColumnFlagsF,         fi_SetViewColumnExtra,       fi_ViewColumnExtra,          fi_SetViewCellValue,
  fi_GetViewCellValue,         fi_ScanViewCellValue,        fi_ScanViewCellValueF,       fi_PrintViewCellValue,
  fi_PrintViewCellValueF,      fi_ClearViewRow,             fi_ClearViewRows,            fi_InsertViewRow,
  // 448-479
  fi_InsertViewRows,           fi_DeleteViewRow,            fi_DeleteViewRows,           fi_AddViewRow,
  fi_NewViewRow,               fi_ArrangeViewColumnsX,      fi_SearchViewRowX,           fi_CountViewRowsX,
  fi_SelectViewRowsX,          fi_SortViewRowsX,            fi_ArrangeViewColumns,       fi_SearchViewRow,
  fi_CountViewRows,            fi_SelectViewRows,           fi_SortViewRows,             fi_SortTableRowsByView,
  fi_CreateSummary,            fi_SearchViewCellValue,      fi_SearchViewCellText,       fi_ReadCSV,
  fi_WriteCSV,                 fi_0, /* 469 */              fi_0, /* 470 */              fi_0, /* 471 */
  fi_SiteName,                 fi_SiteTitle,                fi_SiteDescription,          fi_TaxRate,
  fi_FYearMonth,               fi_NMonthFYear,              fi_UserPath,                 fi_SetCurDate,
  // 480-495
  fi_CurDate,                  fi_BFYear,                   fi_EFYear,                   fi_BMonth,
  fi_EMonth,                   fi_0, /* 485 */              fi_0, /* 486 */              fi_0, /* 487 */
  fi_CurUser,                  fi_CurAuth,                  fi_ConnectDBX,               fi_ConnectDB,
  fi_DisconnectDB,             fi_CurDBName,                fi_CurDBTitle,               fi_CurDBDescription,
  fi_CurDBStatus,              fi_NDBTables,                fi_DBTable,                  fi_DBTableName,
  fi_DBTableTitle,             fi_DBTableDescription,       fi_DBTableFileName,          fi_DBTableVIWS,
  fi_DBTableIndex,             fi_DBHTBL,                   fi_OpenTableX,               fi_OpenTableX,
  fi_OpenTable,                fi_OpenTable,                fi_SaveTable,                fi_SaveTable,
  // 512-527
  fi_CloseTable,               fi_CloseTable,               fi_OHTBL,                    fi_NOTables,
  fi_OTable,                   fi_IsReadOnly,               fi_IsLocked,                 fi_IsModified,
  fi_NewDBFiles,               fi_BackupDBFiles,            fi_TrashDBFiles,             fi_0, /* 523 */
  fi_0, /* 524 */              fi_0, /* 525 */              fi_0, /* 526 */              fi_0, /* 527 */
};
static BFNS fsDBE = { fiDBE, _countof(fiDBE) };

U4B  WINAPI BOLEXTVer(void)
{ // 僶乕僕儑儞忣曬
  return MODVER;
}

BOOL WINAPI InitBOLEXT(uANY pa)
{ // 奐巒張棟
  RegisterAPIs(&fsDBE);
  override_tp_fscn(tp_fscnb);
  override_tp_fprn(tp_fprnb);
  override_tp_fcmp(tp_fcmpb);
  override_tp_flst(tp_flstb);
  override_co_fcal(co_fcalb);
  override_co_fchk(co_fchkb);
  override_tb_ftrg(tb_ftrgb);
  override_db_fenm(db_fenmb);
  override_db_fdis(db_fdisb);
  return TRUE;
}

void WINAPI TermBOLEXT(void)
{ // 廔椆張棟
  if (hbAddIn) { UnloadBCD(hbAddIn);}
  if (hbMain) { UnloadBCD(hbMain);}
}

//乗乗乗乗乗乗乗乗乗乗乗乗乗乗乗乗乗乗乗乗乗乗乗乗乗乗乗乗乗乗乗乗乗乗乗乗乗乗//
