Documentatioî foò CVLIÂ 0.´ 9/30/89 CVLIÂ ió á seô oæ routineó thaô allo÷ accesó tï thå ZCPR³ TCAÐ anä implemenô simplå Ã callablå routineó foò functionó supporteä bù thå TCAP® Iô ió hopeä thaô Ã programmeró usinç Ú systeí wilì uså theså routineó tï builä full-screeî applications® Tï encouragå this¬ thå sourcå codå foò CVLIÂ wilì releaseä tï thå publiã domaiî foò non-commerciaì uså wheî iô ió debuggeä fullù anä stable. Thió librarù musô bå initalizeä aô thå start oæ thå prograí bù callinç thå z3viniô functioî witè á pointeò tï Z3ENV. Alì functionó returî thå thå valuå TRUÅ oò FALSÅ tï thå caller® TRUÅ indicateó thå operatioî waó successful¬ whilå FALSÅ indicateó thå TCAÐ doeó noô supporô thå requesteä function. Theså moduleó anä thå headeò fileó uså somå definitionó thaô maù neeä alteratioî foò somå compilers® Thió librarù haó beeî testeä witè BDSÚ Ã 1.± (thå Z-Systeí versioî oæ 1.60c)¬ EcoSofô Ã versioî 3.1° (adä thå linå #definå ECOC ± tï STDIO.H)¬ anä Softwarå Toolworkó C-8° V2.° witè aî expaneä librarù (bdos(© functioî added). CVLIÂ anä itó associateä routineó arå copyrighô (c© 198¹ bù Cameroî W® Cotrill®                  Functionó containeä iî CVLIÂ module: inô ckcol(col©      inô col; Checkó thå columî numbeò [1..Ý passeä tï iô againsô thå maximuí valuå specifieä iî thå ENV® Iæ thå columî ió greateò thaî thå ENÖ maximuí value¬ thå ENÖ maximuí valuå ió returned® Otherwise¬ thå columî valuå ió returneä aó ió tï thå caller. inô ckrow(row©      inô row; Checkó thå ro÷ numbeò [1..Ý passeä tï iô againsô thå maximuí valuå specifieä iî thå ENV® Iæ thå ro÷ ió greateò thaî thå ENÖ maximuí value¬ thå ENÖ maximuí valuå ió returned® Otherwise¬ thå ro÷ valuå ió returneä aó ió tï thå caller. inô _cout(c©      inô c; Thió routinå ió thå onlù onå whicè wilì causå problemó witè portability® Iô musô outpuô thå characteò passeä tï iô bù usinç eitheò BDOÓ functioî ¶ oò á direcô BIOÓ conouô call® Thió versioî ió foò thå BDÓ compileò oò thå EcoSofô Compiler® Foò otheò compilers¬ thió functioî wilì neeä tï bå implementeä iî assemblù language. inô _fdtcap(s,dly©      chaò *s»      inô dly; Thió routinå ió used bù CVFUNÃ functionó tï outpuô controì stringó tï thå consolå thaô havå delaù valueó associateä witè them® Aô thå presenô time¬ thå delaù valuå ió ignored. inô _ftcap(s©      chaò *s; Thió routinå ió useä bù CVFUNÃ functionó tï outpuô controì stringó tï thå consolå whicè havå nï delaù valuå associateä witè them. inô goxy(row¬ col©      inô row¬ col; Movå thå cursoò tï thå specifieä ro÷ anä columî (origiî ió 1,1)® Iæ illegaì valueó foò ro÷ anä columî arå specified¬ thå corrospondinç maximuí froí thå ENÖ wilì bå substituted. voiä _scout(str©      chaò *str; Lo÷ leveì strinç outpuô routinå useä tï outpuô alì terminaì controì strings® Calló _couô foò eacè characteò iî thå string. inô z3vinit(env)      chaò *env; Initalizå thå CVLIÂ routines® MUSÔ bå calleä aô thå beginninç oæ á prograí BEFORÅ anù otheò CVLIB, CVFUNC¬ oò LINEBOØ routineó arå called¡ Á pointeò tï thå ENÖ musô bå supplieä tï thå function® Iî thå Z-Systeí versioî oæ BDS-C¬ á calì tï zenv(© wilì returî thå needeä value® Iî otheò C's¬ thå easiesô methoä ió tï linë Z3HDR.REÌ aó thå firsô modulå iî thå linë (thió assumeó thaô youò compileò putó ouô somethinç thaô caî bå assembleä tï microsofô REÌ formaô anä linkeä witè thå systeí librarù bù linkeró sucè aó l80¬ zmaclnk¬ oò slrnk)® CVFUNÃ functions CVFUNÃ ió handleä twï differenô ways¬ dependinç oî thå compileò iî use® Iî mosô subseô compileró (BDÓ anä C-80)¬ CVFUNÃ compileó tï á modulå thaô musô bå linkeä witè thå finaì program® Iî fulì C'ó thaô supporô parameterizeä macros¬ thå functionó iî thió sectioî arå macroó thaô arå expandeä aô compilå timå tï inlinå calló tï _ftcap(© anä _fdtcap® Alì moduleó thaô uså theså functionó musô #includå "CVFUNC.H"® Thió resultó iî smalleò runtimå codå whicè thå fulì compileró REALLÙ need¡ Eveî witè thió trick¬ C-8° anä BDÓ producå mucè smalleò code® Alì routineó returî á valuå oæ TRUÅ oò FALSÅ tï thå caller¬ dependinç oî whetheò thå associateä TCAÐ strinç ió null® Iæ thå strinç ió null¬ FALSÅ ió returned. inô clreol() Eraså froí thå currenô cursoò positioî tï thå enä oæ thå currenô displaù row. inô clreos() Eraså froí thå currenô cursoò positioî tï thå enä oæ thå screen® Thå cursoò positioî ió noô changed. inô cls(© { Cleaò thå screeî anä homå thå cursoò (locatioî 1,1). inô cur_off() Turî ofæ thå cursoò display. inô cur_on() Enablå thå cursoò display. inô delline() Deletå thå currenô linå anä movå alì lineó oî thå screeî uð bù onå line® Á blanë linå ió theî inserteä aô thå bottoí oæ thå screen® Thå cursoò positioî ió noô changed. inô insline() Inserô á blanë linå aô thå currenô line® Alì lineó aô oò belo÷ thå currenô linå arå moveä dowî bù onå line® Thå cursoò positioî ió noô changed. inô isc_any(c©      inô c; Tesô iæ ã ió anù cursoò controì keù defineä iî thå tcap. inô isc_dn(c©      inô c; Tesô iæ ã ió cursoò dowî key. inô isc_l(c©      inô c; Tesô iæ ã ió cursoò lefô key. inô isc_r(c©      inô c; Tesô iæ ã ió cursoò right. inô isc_up(c©      inô c; Tesô iæ ã ió cursoò uð key. inô standout() Turî standouô videï on® Thió ió typicallù brighô oò reverså videï dependinç oî thå terminal. inô standend() Restorå standarä videï outpuô attribute. inô tflags(©      return(tcap.flags); Returî tcað flags® Thå flagó arå bitmappeä anä providå informatioî abouô capabilitieó oæ thå terminal. inô tinit() Initalizå terminal® Thió functioî shoulä bå calleä immediatelù afteò á successfuì calì tï z3vinit(). inô tdinit() Restorå terminaì setting® Thió functioî shoulä bå calleä beforå exitinç á program. Businesó Graphicó Support Thå followinç calló definå thå businesó graphicó primativeó thaô arå availablå iî thå TCAÐ extensionó supporteä bù thå Versioî ´ libraries® Yoõ musô uså onå oæ theså extendeä TCAPÓ iî ordeò tï uså theså functions. inô gm_off() Enä graphicó outpuô sequence® Thió functioî musô bå calleä beforå anù outpuô oæ "normal¢ ascié characteró wheî gm_on(© waó called. inô gm_on() Enablå graphicó mode® Thió functioî musô bå calleä beforå anù oæ thå g_????(© arå calleä tï outpuô businesó graphicó characters. inô g_gulc() Outpuô uppeò lefô corneò finelinå graphiã character® Thå graphicó modå musô bå enableä bù callinç thå gm_on(© functioî prioò tï output. inô g_gurc() Outpuô uppeò righô corneò finelinå graphiã character. inô g_gllc() Outpuô loweò lefô corneò finelinå graphiã character. inô g_glrc() Outpuô loweò righô corner finelinå graphiã character. inô g_ghl() Outpuô horizontaì linå finelinå graphiã character. inô g_gvl() Outpuô verticaì linå finelinå graphiã character. inô g_gfb() Outpuô fulì blocë character. inô g_ghb() Outpuô hasheä blocë character. inô g_gui() Outpuô finelinå uppeò intersectioî character. inô g_gli() Outpuô finelinå loweò intersectioî character. inô g_gis() Outpuô findlinå intersectioî character. inô g_grti() Outpuô finelinå righô intersectioî character. inô g_glti() Outpuô finelinå lefô intersectioî character.                     Linå anä Boø Dra÷ Routines Theså routineó (witè thå exceptioî oæ _cbox()© requirå thå businesó graphicó TCAPÓ extensioî useä iî thå versioî ´ libraries® Theù providå primativeó foò drawinç boxeó anä lineó (horizontaì anä vertical© usinç thå TCAÐ graphics® Alì outpuô froí theså routineó ió "clipped¢ tï thå screeî sizå specifieä iî thå ENV. Thå parameteró passeä tï theså routineó arå similar® Iî alì cases¬ thå uppeò lefô corneò oæ thå linå oò boø ió specified® Next¬ thå dimensionó oæ thå boø oò linå iî characteró arå specified® Theså dimensionó arå RELATIVÅ tï thå starô oæ thå box® Therefore¬ á ³ bù ´ boø drawî witè thå fulì blocë characteò startinç aô 1,² woulä bå drawî witè thå callº      fbox(1,2,3,4,0); Theså routineó returî TRUÅ iæ thå origiî specifieä ió oî screen. Theså routineó arå containeä iî LINEBOX.Ã anä musô bå compileä anä linkeä witè CVLIÂ anä CVFUNC. inô _box(ulr,ulc,rsize,csize,fill,c,gflag©      inô ulr,ulc,rsize,csize,fill,gflag»      chaò *c; Lo÷ leveì boø draw® Plotó boø witè á chaò strinç sï ZCPÒ tcað businesó graphicó caî bå supported® Iæ á graphicó strinç ió useä gflaç musô bå TRUE¬ otherwiså iô musô bå FALSE® Sincå á singlå characteò ió used¬ boø sizå caî bå aó smalì aó 1x1® Iæ largeò thaî 2x2¬ thå boø maù bå spacå filleä (filì ½ TRUE© oò maù bå "seå thru¢ (fill ½ FALSE)® Thió routinå maù bå useä tï dra÷ horizontaì oò verticaì lineó aó welì aó boxes. inô box(ulr,ulc,rsize,csize,fill©      inô ulr,ulc,rsize,csize,fill; Boø dra÷ routinå usinç graphicó lineó anä corners® Giveî uppeò lefô row,col anä boø size¬ dra÷ á graphicó boø (2x² minimum)® Iæ largeò thaî 2x2¬ thå boø maù bå spacå filleä oò "seå thru¢ baseä oî thå valuå passeä iî fill. inô _cbox(ulr,ulc,rsize,csize,fill,c©      unsigneä ulr,ulc,rsize,csize,fill»      inô c; Dra÷ boø witè ascié chaò c® Thió calì differó froí thå otheò boø routineó iî thaô á singlå ascié characteò ió passeä tï thió routine® Sincå á singlå characteò ió used¬ boø sizå caî bå aó smalì aó 1x1® Iæ largeò thaî 2x2¬ thå boø maù bå spacå filleä (filì ½ TRUE© oò maù bå "seå thru¢ (filì ½ FALSE)® Thió routinå maù bå useä tï dra÷ horizontaì oò verticaì lineó aó welì aó boxes. inô erabox(ulr,ulc,rsize,csize,fill©      unsigneä ulr,ulc,rsize,csize,fill; Eraså boø routine® Drawó oveò thå borderó oæ á boø witè spaces® Thå centeò oæ thå boø maù alsï bå cleareä bù specifinç filì aó TRUE. inô fbox(ulr,ulc,rsize,csize,fill©      unsigneä ulr,ulc,rsize,csize,fill; Drawó á boø usinç thå fulì blocë character. inô hbox(ulr,ulc,rsize,csize,fill©      unsigneä ulr,ulc,rsize,csize,fill; Drawó á boø usinç thå hasheä blocë character. inô hline(row,lcol,length,string,gflag©      inô row,lcol,length,gflag»      chaò *string; Dra÷ á horizontaì linå startinç aô row¬ lcol® Linå ió tï bå lengtè characteró long® Á singlå characteò null-terminateä strinç specifieó thå characteò oò businesó graphicó characteò tï uså tï dra÷ thå line® Iæ á businesó graphiã strinç froí thå TCAÐ ió used¬ gflag musô bå TRUE® Iæ á normaì ascié characteò strinç ió used¬ seô gflaç FALSE. inô vline(trow,lcol,length,string,gflag©      inô trow,lcol,length,gflag»      chaò *string; Dra÷ á verticaì linå startinç aô trow¬ lcol® Linå ió drawî dowî froí thå origiî foò lengtè characters® Á singlå characteò null-terminateä strinç specifieó thå characteò oò businesó graphicó characteò tï uså tï dra÷ thå line® Iæ á businesó graphiã strinç froí thå TCAÐ ió used¬ gflaç musô bå TRUE® Iæ á normaì ascié characteò strinç ió used¬ seô gflaç FALSE. inô vline2(trow,lcol,length,string,gflag©      inô trow,lcol,length,gflag»      chaò *string; Dra÷ á verticaì linå twï characteró widå startinç aô trow¬ lcol® Linå ió drawî dowî froí thå origiî foò lengtè characters® Á singlå characteò null-terminateä strinç specifieó thå characteò oò businesó graphicó characteò tï uså tï dra÷ thå line® Iæ á businesó graphiã strinç froí thå TCAÐ ió used¬ gflaç musô bå TRUE® Iæ á normaì ascié characteò strinç ió used¬ seô gflaç FALSE®