OPENDOOR.TXT 699 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805
  1. ÛÛÛÛÛÛÛÛÛÛ ÛÛÛÛÛÛÛÜ
  2. ÛÛÛßßßßÛÛÛ ÛÛÛßßßÛÛÛ
  3. ÛÛÛ ÛÛÛ ÜÜÜÜÜÜÜ ÜÜÜÜÜÜÜ ÜÜÜÜÜÜÜ ÛÛÛ ÛÛÛ ÜÜÜÜÜÜÜ ÜÜÜÜÜÜÜ ÜÜÜÜÜÜ ÜÜÜÜÜÜÜ
  4. ÛÛÛ ÛÛÛ ÛÛÛßÛÛÛ ÛÛÛßÛÛÛ ÛÛÛßÛÛÛ ÛÛÛ ÛÛÛ ÛÛÛßÛÛÛ ÛÛÛßÛÛÛ ÛÛÛßßß ÛÛÛßßßß
  5. ÛÛÛÜÜÜÜÛÛÛ ÛÛÛ ÛÛÛ ÛÛÛßßßß ÛÛÛ ÛÛÛ ÛÛÛÜÜÜÛÛÛ ÛÛÛ ÛÛÛ ÛÛÛ ÛÛÛ ÛÛÛ ßßßßÛÛÛ
  6. ÛÛÛÛÛÛÛÛÛÛ ÛÛÛÛÛÛÛ ÛÛÛÛÛÛÛ ÛÛÛ ÛÛÛ ÛÛÛÛÛÛÛß ÛÛÛÛÛÛÛ ÛÛÛÛÛÛÛ ÛÛÛ ÛÛÛÛÛÛÛ
  7. ÛÛÛ
  8. ÛÛÛ
  9. ßßß Online Software Programming Toolkit
  10. ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
  11. Programmer's Manual
  12. Version 6.00
  13. DOS and Win32 Editions
  14. NOTE: Since you will likely want to refer to this manual while
  15. working with OpenDoors, it is highly recommended that you take
  16. the time to print it out. Simply type COPY OPENDOOR.TXT PRN
  17. from your DOS prompt. With the exception of this title page,
  18. this document contains only 7-bit ASCII characters.
  19. (C) Copyright 1991 - 1996 by Brian Pirie. All Rights Reserved.
  20. TABLE OF CONTENTS
  21. CHAPTER 1 - INTRODUCTION TO OPENDOORS.......................................5
  22. WELCOME! ...............................................................5
  23. FEATURES OF THE OPENDOORS TOOLKIT ......................................6
  24. CHAPTER 2 - ABOUT THIS EVALUATION COPY AND ORDERING.........................9
  25. THE EVALUATION COPY & BENEFITS OF REGISTERING ..........................9
  26. HOW TO ORDER ...........................................................10
  27. HOW TO ORDER BY MAIL ...................................................11
  28. SENDING YOUR ORDER FEE IN THE MAIL .....................................12
  29. ORDERING BY CREDIT CARD ................................................14
  30. HOW YOU CAN RECEIVE YOUR ORDER .........................................15
  31. ORDERING THE SOURCE CODE ...............................................17
  32. OPENDOORS 6.00 ORDER FORM ..............................................18
  33. OPENDOORS 6.00 FEEDBACK FORM ...........................................19
  34. TERMS OF REGISTRATION AND SOURCE CODE USE ..............................20
  35. CHAPTER 3 - OPENDOORS TUTORIAL..............................................21
  36. ABOUT THIS MANUAL ......................................................21
  37. COMPILING A PROGRAM WITH OPENDOORS .....................................22
  38. LINKING WITH OPENDOORS USING A DOS COMPILER ............................23
  39. LINKING WITH OPENDOORS USING A WINDOWS COMPILER ........................24
  40. RUNNING A DOOR PROGRAM WRITTEN WITH OPENDOORS ..........................26
  41. RUNNING DOS-BASED DOOR PROGRAMS ........................................26
  42. RUNNING WINDOWS 95/NT DOOR PROGRAMS ....................................26
  43. BASICS OF DOOR PROGRAMMING WITH OPENDOORS ..............................29
  44. TOUR OF A SAMPLE DOOR PROGRAM: "EX_VOTE" ...............................33
  45. OTHER EXAMPLE PROGRAMS INCLUDED WITH OPENDOORS .........................38
  46. CHAPTER 4 - THE OPENDOORS API FUNCTIONS.....................................40
  47. OVERVIEW ...............................................................40
  48. TABLE OF MOST COMMONLY USED FUNCTIONS ..................................41
  49. TABLE OF ALL FUNCTIONS .................................................42
  50. OD_ADD_PERSONALITY() ...................................................47
  51. OD_AUTODETECT() ........................................................48
  52. OD_CHAT() ..............................................................50
  53. OD_CARRIER() ...........................................................51
  54. OD_CLEAR_KEYBUFFER() ...................................................53
  55. OD_CLR_LINE() ..........................................................55
  56. OD_CLR_SCR() ...........................................................57
  57. OD_COLOR_CONFIG() ......................................................59
  58. OD_DISP() ..............................................................60
  59. OD_DISP_EMU() ..........................................................62
  60. OD_DISP_STR() ..........................................................63
  61. OD_DRAW_BOX() ..........................................................65
  62. OD_EDIT_STR() ..........................................................68
  63. OD_EXIT() ..............................................................79
  64. OD_GET_ANSWER() ........................................................81
  65. OD_GET_INPUT() .........................................................82
  66. OD_GET_KEY() ...........................................................85
  67. ===============================================================================
  68. OpenDoors 6.00 Manual End of Page 2
  69. OD_GETTEXT() ...........................................................89
  70. OD_HOTKEY_MENU() .......................................................90
  71. OD_INIT() ..............................................................92
  72. OD_INPUT_STR() .........................................................95
  73. OD_KERNEL() ............................................................97
  74. OD_LIST_FILES() ........................................................98
  75. OD_LOG_WRITE() .........................................................100
  76. OD_MULTILINE_EDIT() ....................................................101
  77. OD_PAGE() ..............................................................104
  78. OD_PARSE_CMD_LINE() ....................................................105
  79. OD_POPUP_MENU() ........................................................107
  80. OD_PRINTF() ............................................................110
  81. OD_PUTCH() .............................................................115
  82. OD_PUTTEXT() ...........................................................116
  83. OD_REPEAT() ............................................................118
  84. OD_RESTORE_SCREEN() ....................................................120
  85. OD_SAVE_SCREEN() .......................................................121
  86. OD_SCROLL() ............................................................123
  87. OD_SEND_FILE() .........................................................124
  88. OD_SET_ATTRIB() ........................................................128
  89. OD_SET_COLOR() .........................................................131
  90. OD_SET_CURSOR() ........................................................134
  91. OD_SET_DTR() ...........................................................135
  92. OD_SET_PERSONALITY() ...................................................136
  93. OD_SET_STATUSLINE() ....................................................137
  94. OD_SLEEP() .............................................................139
  95. OD_SPAWN() .............................................................141
  96. OD_SPAWNVPE() ..........................................................143
  97. OD_WINDOW_CREATE() .....................................................145
  98. OD_WINDOW_REMOVE() .....................................................147
  99. CHAPTER 5 - THE OPENDOORS CONTROL STRUCTURE.................................148
  100. INTRODUCTION TO THE CONTROL STRUCTURE ..................................148
  101. CONTROL STRUCTURE - DOOR INFO FILE STATS ...............................150
  102. CONTROL STRUCTURE - SERIAL PORT SETTINGS ...............................153
  103. CONTROL STRUCTURE - BBS AND CALLER INFORMATION .........................158
  104. CONTROL STRUCTURE - DOOR SETTINGS ......................................182
  105. CONTROL STRUCTURE - DIAGNOSTICS ........................................185
  106. CONTROL STRUCTURE - OPENDOORS CUSTOMIZATION ............................187
  107. CONTROL STRUCTURE - FUNCTION KEYS ......................................212
  108. CONTROL STRUCTURE - COLOR CUSTOMIZATION ................................216
  109. CONTROL STRUCTURE - TEXT CUSTOMIZATION .................................217
  110. CHAPTER 6 - SPECIAL TOPICS..................................................220
  111. ADDITIONAL INFORMATION ON THE WIN32 VERSION ............................220
  112. CONFIGURATION FILE SYSTEM ..............................................225
  113. DEFINING CUSTOM DOOR INFORMATION FILE FORMATS ..........................230
  114. MULTIPLE PERSONALITY SYSTEM ............................................233
  115. LOG FILE SYSTEM ........................................................235
  116. MAKING DOORS MULTI-NODE-AWARE ..........................................237
  117. CHAPTER 7 - TROUBLESHOOTING AND GETTING ASSISTANCE WITH OPENDOORS...........242
  118. ===============================================================================
  119. OpenDoors 6.00 Manual End of Page 3
  120. ABOUT THIS CHAPTER .....................................................242
  121. TROUBLESHOOTING PROBLEMS ...............................................242
  122. SOLUTIONS TO COMMON PROBLEMS ...........................................244
  123. OPENDOORS SUPPORT ......................................................245
  124. THE OPENDOORS SUPPORT BBS ..............................................245
  125. THE OPENDOORS WORD WIDE WEB SITE .......................................246
  126. THE OPENDOORS CONFERENCE ...............................................246
  127. GETTING IN TOUCH WITH ME ...............................................247
  128. APPENDIX A - CONTENTS OF PACKAGE............................................249
  129. APPENDIX B - CHANGES FOR THIS VERSION.......................................250
  130. APPENDIX C - FUTURE VERSIONS................................................254
  131. APPENDIX D - SPECIAL THANKS.................................................255
  132. GLOSSARY....................................................................256
  133. INDEX.......................................................................267
  134. ===============================================================================
  135. OpenDoors 6.00 Manual End of Page 4
  136. 11
  137. 111
  138. 11
  139. 11
  140. 11
  141. 11
  142. 1111
  143. -------------------------------------------------------------------------------
  144. CHAPTER 1 - INTRODUCTION TO OPENDOORS
  145. WELCOME!
  146. -------------------------------------------------------------------------------
  147. Welcome to OpenDoors! OpenDoors is a POWERFUL and EASY TO USE
  148. online software programming toolkit for C and C++. While
  149. OpenDoors is most often used to create add-on "door" programs
  150. that run under BBS systems, it can also be used for many other
  151. online software applications. By using OpenDoors, you are
  152. joining over 500 other programmers from around the world who
  153. have used it since it was first released to the public in 1991.
  154. Over the years, OpenDoors has grown from a simple BBS door
  155. programming library to what is perhaps the most sophisticated,
  156. widely used and supported package of its type.
  157. What exactly is OpenDoors? OpenDoors provides a complete system
  158. that allows you to quickly and easily write spectacular,
  159. professional quality interactive online software. With
  160. OpenDoors, you can write software such as BBS door programs just
  161. as you would write any other program - without having to worry
  162. about the many of the internal details of door programming.
  163. OpenDoors looks after communicating through the modem, providing
  164. ANSI/AVATAR/RIP terminal support and interfacing with a wide
  165. variety of BBS packages through door information files (such as
  166. DOOR.SYS, DORINFO1.DEF, etc.). OpenDoors also looks after status
  167. lines and sysop function keys for DOS shells, chatting, hanging
  168. up, and so on. In addition, OpenDoors carries out all the work
  169. involved in keeping track of carrier detection, user timeouts
  170. and much, much more. OpenDoors is also highly flexible, allowing
  171. you to take as little or as much control of your program's
  172. behavior as you wish.
  173. This package includes both DOS and Win32 versions of OpenDoors.
  174. This allows you to build a plain-DOS version of your program to
  175. run under a variety of platforms (DOS, DesqView, Windows 3.x,
  176. NT, 95 and OS/2), to build a Win32 version that takes special
  177. advantage of Windows 95 / NT, or build both versions of your
  178. program - the choice is yours. The DOS version of OpenDoors
  179. performs its serial I/O using either a FOSSIL driver, or built-
  180. in serial I/O capabilities, making the use of a FOSSIL driver
  181. ===============================================================================
  182. OpenDoors 6.00 Manual End of Page 5
  183. optional. The Win32 version takes special advantage of 32-bit
  184. programming, multithreading and the Windows GUI, and allows you
  185. to access many services that are provided by Windows, such as
  186. ODBC (for database access) and MAPI (for email and messaging).
  187. Both the DOS and Win32 versions of OpenDoors can be run under
  188. both DOS and Windows-based BBS packages. The DOS version of
  189. OpenDoors can also be run under OS/2-based BBS packages.
  190. The following section provides more detailed information on the
  191. features and capabilities that OpenDoors provides.
  192. FEATURES OF THE OPENDOORS TOOLKIT
  193. -------------------------------------------------------------------------------
  194. You will find that OpenDoors provides a solid platform to build
  195. BBS door programs and other online software on top of. You may
  196. want to write simple utility door programs, on-line games or
  197. sophisticated applications. Perhaps you are interested in
  198. getting into the market of selling online software, or perhaps
  199. you just wish to write some custom door programs for a
  200. particular BBS system. With OpenDoors, you can accomplish all of
  201. these things - and do it much more easily than ever before. Some
  202. of the features that OpenDoors provides to :
  203. - OpenDoors handles all the "dirty" work involved in writing
  204. BBS door programs. Since OpenDoors looks after all the door-
  205. related operations for you, you need do next to nothing
  206. different when writing door programs than you would when
  207. writing any other program. You simply call OpenDoor's simple
  208. functions to input, output and control door operation. In
  209. fact, many people have converted non-door programs to door
  210. programs in only a matter of minutes using OpenDoors. One of
  211. the most common comments I receive about OpenDoors is how
  212. easy it is to use.
  213. - OpenDoors allows you to write software that DIRECTLY support
  214. a wide variety of BBS systems, including RemoteAccess,
  215. QuickBBS, PC-Board, Maximus, Opus, Wildcat!, WWIV, Spitfire,
  216. SuperBBS, Telegard, TriBBS, GAP, and others.
  217. - As you would expect, OpenDoors flawlessly monitors the
  218. modem's carrier detect signal, to automatically recover when
  219. a user hangs up - without your having to do anything extra in
  220. your program. OpenDoors also monitors how much time the user
  221. has left in the door, and provides a fully adjustable
  222. inactivity timeout monitor.
  223. - OpenDoors takes care of all the work involved in reading and
  224. writing BBS door information files, such as DORINFO1.DEF,
  225. ===============================================================================
  226. OpenDoors 6.00 Manual End of Page 6
  227. EXITINFO.BBS, CHAIN.TXT, DOOR.SYS, etc. If the particular
  228. information is available to OpenDoors, it will provide you
  229. with just about everything you could ever want to know about
  230. the user on-line, the system your door is running under, and
  231. so on. In addition to the many door information file formats
  232. supported by OpenDoors, you are also able to define your own
  233. custom formats.
  234. - OpenDoors also does all the work involved in displaying and
  235. automatically updating the door's status line, with
  236. information available to the sysop such as user name,
  237. location, baud rate, time left, function keys,
  238. ANSI/AVATAR/RIP settings, and so on. Using OpenDoors, you can
  239. choose from a number of different "personalities". These
  240. personalities allows OpenDoors to mimic the status lines and
  241. sysop function keys used in various BBS packages. OpenDoors
  242. includes personalities that mimic RemoteAccess, PC-Board and
  243. Wildcat! OpenDoors also allows you to create your own
  244. personalities to mimic any other BBS system.
  245. - OpenDoors automatically provides the sysop with all the
  246. standard function keys for adjusting user time, hanging up on
  247. or even locking out the user, and so on. OpenDoors also
  248. provides you with a chat mode, which is available to the
  249. sysop by pressing Alt-C. In addition, OpenDoors has full
  250. support for sysop shell to DOS, activated by the Alt-J key.
  251. - What's more, OpenDoors is designed to be very easy to use.
  252. Even the most novice 'C' programmers are able to write
  253. professional-quality doors with OpenDoors. It takes care of
  254. just about every detail for you, yet still gives you the
  255. ability to completely control and customize every detail of
  256. your door's behavior. There are even people who begin door
  257. programming with OpenDoors, having never programmed in C in
  258. the past.
  259. - OpenDoors supports both FOSSIL-based and built-in serial I/O
  260. capabilities. FOSSIL-based serial I/O can be used for maximum
  261. compatibility with various systems and serial ports,
  262. including multiple-port serial cards such as DigiBoard.
  263. OpenDoors can also operate without a FOSSIL driver, using
  264. it's own serial I/O capabilities. OpenDoor's built-in
  265. asynchronous communications supports baud rates of up to
  266. 115,200 and non-standard serial port configurations.
  267. OpenDoors also has the ability to automatically detect which
  268. of the two serial I/O methods should be used on a particular
  269. system.
  270. - OpenDoors also automatically detects when the BBS system is
  271. operating in local mode, and supports full local mode
  272. operations itself.
  273. ===============================================================================
  274. OpenDoors 6.00 Manual End of Page 7
  275. - Other OpenDoors functions include a built in sysop-page
  276. function that will ask the user why they wish to chat, and
  277. then proceed to page the sysop, just as any BBS package
  278. would. OpenDoors also provides screen clearing functions
  279. (which will detect whether the user has screen clearing
  280. turned on), and various ANSI/AVATAR/RIP control functions
  281. (which again detect if the user has graphics mode turned on).
  282. - In addition to the basic display features of OpenDoors there
  283. are also a number of advanced screen control functions. These
  284. include functions to save and restore the entire screen,
  285. along with functions to save, restore or scroll portions of
  286. the screen. Other functions allow you to provide overlapping
  287. windows and pop-up menus with highlighted selection bars.
  288. - OpenDoors provides a multi-line text editor that you can use
  289. to allow the user to enter or edit text files, email
  290. messages, or any other text that spans multiple lines. You
  291. can customize many of the editor's settings to suit your
  292. needs.
  293. - OpenDoors has a number of special sub-systems that you may
  294. elect to include in your doors. Among these, is a log-file
  295. system that allows you to add log file support to your doors
  296. with only a single line of programming.
  297. - Another valuable OpenDoors sub-system is the configuration
  298. file system. Again using only a single line of code, you can
  299. add configuration file support to your doors. OpenDoors
  300. configuration files permit the sysop using the door to
  301. customize the door's behavior to their own preferences.
  302. - OpenDoors can also be fully customized in order that you may
  303. write door programs that use languages other than English.
  304. - Among the ANSI/AVATAR/RIP features found in OpenDoors is the
  305. ability to send ANSI/AVATAR/RIP files from disk. This allows
  306. you to easily design program screens, and incorporate them
  307. into your doors.
  308. - OpenDoors also comes with the source code for a number of
  309. example doors, which you can modify, or simply extract bits
  310. and pieces for use in your own doors. Plus, this manual
  311. contains many examples of C source code, to help you in
  312. writing nearly any door program you might wish to build.
  313. - You may also elect to purchase the source code for OpenDoors,
  314. which will permit you to make modifications to any portion of
  315. OpenDoors, use any portions of the OpenDoors source code in
  316. other programs you write, or merely learn how communications-
  317. type programs are written.
  318. ===============================================================================
  319. OpenDoors 6.00 Manual End of Page 8
  320. 2222
  321. 22 22
  322. 22
  323. 22
  324. 22
  325. 22
  326. 222222
  327. -------------------------------------------------------------------------------
  328. CHAPTER 2 - ABOUT THIS EVALUATION COPY AND ORDERING
  329. THE EVALUATION COPY & BENEFITS OF REGISTERING
  330. -------------------------------------------------------------------------------
  331. OpenDoors is distributed and sold using the conventional
  332. "shareware" approach. This complete package can be freely
  333. distributed, both online (through BBS systems and the Internet)
  334. and on CD-ROMs or other media. This gives you the chance to try
  335. OpenDoors before you buy it. Unlike traditional commercial
  336. software, you have the opportunity to see OpenDoors first-hand,
  337. and determine whether it meets your needs without first paying
  338. for it. However, before registering you are only permitted to
  339. use it under the following conditions:
  340. 1.)You may only use this package for a one month period, and
  341. for evaluation purposes only.
  342. 2.) Programs written with this package may not be distributed.
  343. Also, before registering, any program written with OpenDoors
  344. will display a message to the user indicating that OpenDoors is
  345. not registered. Of course, this message is removed once you have
  346. registered.
  347. If you decided to register OpenDoors, you will become the
  348. licensed owner of a powerful tool for creating BBS door programs
  349. and other online software. Registered (licensed) owners of
  350. OpenDoors are entitled to:
  351. 1.)Virtually unlimited use of OpenDoors. You may write as many
  352. programs as you wish using OpenDoors, and do what you please
  353. with these programs. They may be freely distributed, or even
  354. sold. What's more, there are no additional royalty fees.
  355. Your one time purchase of OpenDoors entitles you to use it
  356. as you please.
  357. 2.)Your registration entitles you to use both the DOS and Win32
  358. versions of OpenDoors.
  359. ===============================================================================
  360. OpenDoors 6.00 Manual End of Page 9
  361. 3.)You will also be entitled to free upgrades to newer versions
  362. of OpenDoors. In addition to the great many features and the
  363. quality that this version of OpenDoors has to offer, I am
  364. currently working on a great many additions and enhancements
  365. for the next version. (See the end of this document for an
  366. outline of features currently "in the works".) Any programs
  367. you write using this version will also automatically take on
  368. many of these new features when you upgrade to the new
  369. version.
  370. Perhaps the best news of all is the price of OpenDoors. Similar
  371. packages sell for $50, $75, or even more. However, this version
  372. of OpenDoors will only cost you $28 US Dollars, $34 Canadian
  373. Dollars, or the equivalent in your country's currency! (Note
  374. that this price will increase in future versions. By registering
  375. now, you will save by being able to upgrade to all future
  376. versions at no additional charge.)
  377. Also, the source code for OpenDoors is now available to licensed
  378. users for an additional $28US / $34CDN / equivalent. Ordering a
  379. copy of the source code will allow you to customize OpenDoors
  380. for your own use, making any changes or additions that you wish.
  381. It also gives you the opportunity to see how OpenDoors works,
  382. and to use any portions of the OpenDoors code in any other
  383. programs you wish to write. If you think you might be interested
  384. in ordering the OpenDoors source code, please be sure to read
  385. the section entitled "Ordering The Source Code", located on page
  386. 20.
  387. HOW TO ORDER
  388. -------------------------------------------------------------------------------
  389. There are to ways of ordering and OpenDoors license
  390. (registration):
  391. -The most common way to order is by mailing the OpenDoors order
  392. form along with a cheque, money order or cash to the address
  393. on this order form.
  394. - You may order using a major credit card. OpenDoors credit card
  395. orders are handled by a third-party credit card order service,
  396. named PsL.
  397. The following sections provide more information on how to order
  398. using each of these options.
  399. ===============================================================================
  400. OpenDoors 6.00 Manual End of Page 10
  401. HOW TO ORDER BY MAIL
  402. -------------------------------------------------------------------------------
  403. To order OpenDoors by mailing a cheque, money order or cash,
  404. simply follow these three steps:
  405. 1.) Fill out the registration form. Information on filling out
  406. the form is located on page 15.
  407. 2.) Send the appropriate payment, $28US/$34CDN/equivalent for
  408. the registration or $56US/$68CDN/equivalent for both the
  409. registration and source code. If you wish more detailed
  410. instructions on sending the registration fee, see the
  411. section that begins page on 12. Included in that section is
  412. a list of equivalent prices for a number of other
  413. countries.
  414. 3.) Send the above two items to me at:
  415. Brian Pirie
  416. 117 Cedarock Drive
  417. Kanata ON K2M 2H5
  418. Canada
  419. Many people who register OpenDoors also order the source code
  420. package. You may wish to consider the benefits of having the
  421. OpenDoors source code - it allows you to learn how OpenDoors and
  422. communications software is written, it allows you to modify and
  423. customize OpenDoors to suit your own preferences, and it also
  424. allows you to use portions of OpenDoors for other non-door
  425. programming projects. If you think you might also be interested
  426. in the OpenDoors source code, be sure to read the section on the
  427. source code, which begins on page 20.
  428. Also, you may wish to send the OpenDoors feedback form (located
  429. on page 19), along with your registration. The feedback form
  430. gives you a chance to tell me what you think of OpenDoors, and
  431. what changes you would like to see in future versions. In fact,
  432. the majority of suggestions made on these forms in the past have
  433. already been implemented in the current version of OpenDoors.
  434. If you have printed the OpenDoors manual, you can simply remove
  435. and mail the forms on pages 18 and 19. If you have not already
  436. printed a copy of the manual, and you have a printer, you can
  437. quickly print these forms by printing the ORDER.FRM file
  438. included in the OpenDoors distribution archive. (Type COPY
  439. ORDER.FRM PRN from your DOS prompt.)
  440. NO PRINTER? Alternatively, if you do not have a printer, simply send a hand-
  441. written version of the order form.
  442. ===============================================================================
  443. OpenDoors 6.00 Manual End of Page 11
  444. If you have any special instructions for me, or anything that
  445. you would like to say when you register, feel free to write this
  446. on the back of the registration form, or on a separate piece of
  447. paper.
  448. When filling out the OpenDoors registration form, be sure to
  449. indicate how you would prefer to receive your OpenDoors
  450. registration key and/or source code. The following options are
  451. available:
  452. - Having me send the registration and/or source code
  453. by conventional mail
  454. - Internet E-Mail (the fastest option)
  455. - By Fax
  456. - Having me call to your BBS
  457. - You calling the OpenDoors support BBS
  458. - FidoNet "CrashMail"
  459. Once you have decided which means you would prefer to receive
  460. your order by, please read the detailed instructions on your
  461. order method, below. Also, if you are ordering the source code,
  462. please be sure to read the section on ordering the source code,
  463. which begins on page 20.
  464. SENDING YOUR ORDER FEE IN THE MAIL
  465. -------------------------------------------------------------------------------
  466. The price of OpenDoors is 34 Canadian Dollars, 28 U.S. Dollars,
  467. or equivalent for the registration. The source code costs an
  468. additional 34 Canadian Dollars, 28 U.S. Dollars, or equivalent.
  469. For your convenience, the equivalent value in a number of other
  470. country's currencies, at the time of this writing, is as
  471. follows:
  472. -----------------------------------------------
  473. REGISTRATION
  474. REGISTRATION ONLY AND SOURCE CODE
  475. -----------------------------------------------
  476. 34 Canadian Dollars 68 Canadian Dollars
  477. 28 US Dollars 56 US Dollars
  478. 18 British Pounds 36 British Pounds
  479. 150 French Francs 300 French Francs
  480. 44 German Marks 88 German Marks
  481. 50 Netherland Gilders 100 Netherland Gilders
  482. 39 Australian Dollars 78 Australian Dollars
  483. -----------------------------------------------
  484. If you are ordering by mail, this order fee may be paid using
  485. any of the following methods:
  486. ===============================================================================
  487. OpenDoors 6.00 Manual End of Page 12
  488. -Cheque or Money Order in Canadian currency, drawn upon a
  489. Canadian bank. In this case, your order fee will be either
  490. $34CDN for just the registration, or $68CDN for both the
  491. registration and source code.
  492. -Cheque or Money Order in U.S. currency, drawn upon a U.S. bank.
  493. In this case, your order fee will be either $28US for just the
  494. registration, or $56US for both the registration and source
  495. code.
  496. -An International Money Order or International Bank Draft
  497. (available from your bank, post office or companies such as
  498. American Express), in Canadian currency. Depending on the
  499. particular case, your order fee MAY be sent to me by the postal
  500. service, and you will mail your order form by itself. You
  501. should have the money order drawn in either $34CDN for just the
  502. registration, or $68CDN for both the registration and source
  503. code.
  504. -A cheque drawn on any bank in the world, IN THAT COUNTRY'S
  505. CURRENCY, equivalent to 34 Canadian dollars. For instance, a
  506. cheque for the appropriate number of British Pounds, drawn on a
  507. British bank, is perfectly acceptable. However, I am unable to
  508. accept a cheque for $34 Canadian dollars, drawn on a British
  509. Bank. UNFORTUNATELY, THE BANKS IN CANADA ARE CURRENTLY
  510. UNWILLING TO ACCEPT EUROCHEQUES.
  511. -Cash. Please note that it is not usually recommended that cash
  512. be sent in the mail, and that I cannot be responsible for any
  513. cash lost in the mail. Simply put, if you wish to order by
  514. cash, it is your responsibility to get the cash to me. However,
  515. if I do receive your order in the form of cash, it will be
  516. perfectly acceptable to me. I would like to mention that many
  517. people have already ordered OpenDoors by sending cash, and I
  518. have yet to run across any case of cash being lost in the mail.
  519. Nonetheless, if you wish to send cash, you may wish to consider
  520. doing so by registered mail, for your added security.
  521. If you are ordering OpenDoors from within Canada, you will most
  522. likely choose the first option (a Canadian cheque or money
  523. order). If you are ordering OpenDoors from within the United
  524. States, you will most likely choose the second option (an
  525. American cheque or money order). If you are ordering from
  526. outside Canada and the U.S., it would be ideal if you could send
  527. your fee by an international money order. However, it should be
  528. noted that any of the above order methods will be acceptable
  529. from any location. Also, it is quite possible that I may be able
  530. to accept other means of sending your order fee. If you are
  531. unsure about sending your order fee, please feel free to get in
  532. touch with me by any of the means listed on page 247.
  533. ===============================================================================
  534. OpenDoors 6.00 Manual End of Page 13
  535. ORDERING BY CREDIT CARD
  536. -------------------------------------------------------------------------------
  537. This information applies to CREDIT CARD ORDERS ONLY. Please read
  538. this entire section before ordering OpenDoors by credit card.
  539. In order to cover the additional costs of processing credit card
  540. orders, an $8 shipping and handling fee applies to all OpenDoors
  541. orders made through PsL. As such, the total prices you will pay
  542. are:
  543. - Just registration ($28 + $8 Handling) = $36 U.S.
  544. - Registration and Source Code ($56 + $8 Handling) = $64 U.S.
  545. (All prices will be charged to your credit card in U.S.
  546. Dollars.)
  547. You can order OpenDoors with MC, Visa, Amex, or Discover from
  548. Public (software) Library by calling 800-2424-PsL or 713-524-6394
  549. or by FAX to 713-524-6398 or by CIS Email to 71355,470. You can
  550. also order online through the World Wide Web. For more
  551. information on how to do this, visit the OpenDoors Web site.
  552. (Information on the OpenDoors web site is provided on page 246.)
  553. You can also mail credit card orders to PsL at P.O.Box 35705,
  554. Houston, TX 77235-5705. When ordering by phone, you must call
  555. between 6:00am and 6:00pm CST on Monday to Thursday, or between
  556. 6:00am and 12:30pm on Fridays.
  557. THE ABOVE NUMBERS ARE FOR CREDIT CARD ORDERS ONLY.
  558. THE AUTHOR OF THIS PROGRAM CANNOT BE REACHED AT THESE NUMBERS.
  559. Any questions about the status of the shipment of the order,
  560. refunds, registration options, product details, technical
  561. support, volume discounts, dealer pricing, site licenses, non-
  562. credit card orders, etc., must be directed to:
  563. Brian Pirie
  564. 117 Cedarock Drive
  565. Kanata ON K2M 2H5
  566. Canada
  567. To insure that you get the latest version, PsL will notify me the
  568. day of your order and I will ship OpenDoors directly to you. I
  569. will send OpenDoors by conventional mail unless I have previously
  570. heard from you, asking me to send your order by some other means.
  571. When ordering by credit card through PsL, please be sure to
  572. indicate whether you wish to order just the OpenDoors
  573. registration, or both the registration and source code. Also,
  574. please be sure to include your credit card billing address.
  575. Without this information, PsL will be unable to process your
  576. order.
  577. ===============================================================================
  578. OpenDoors 6.00 Manual End of Page 14
  579. HOW YOU CAN RECEIVE YOUR ORDER
  580. -------------------------------------------------------------------------------
  581. For your convenience, I can send your OpenDoors registration key
  582. and/or source code by any of the following methods. If you are
  583. ordering OpenDoors by mail, simply check one of these options on
  584. your order form. If you are ordering through the third-party
  585. credit card service, I will automatically send your order by
  586. Internet email or conventional mail unless I receive a message
  587. from you before you order, asking me to send it by some other
  588. means.
  589. -------------------------------------------------------------------------------
  590. RECEIVING If you wish to receive your OpenDoors registration key by
  591. ORDER BY Internet E-Mail (including Internet E-Mail to a CompuServe
  592. INTERNET account), fill out the order form and mail it along with your
  593. E-MAIL payment as described below. Be sure to include your e-mail
  594. address on your order form. Note that the source code cannot be
  595. sent via Internet e-mail.
  596. -------------------------------------------------------------------------------
  597. RECEIVING In order to receive your OpenDoors registration key and/or
  598. ORDER source code by conventional mail, simply fill out the order
  599. BY MAIL form and mail it along with your payment as described below. I
  600. will cover the cost of postage. If your address contains non-
  601. Roman characters, also enclose a self-addressed envelope or
  602. mailing label.
  603. -------------------------------------------------------------------------------
  604. RECEIVING If you wish to receive your OpenDoors registration key by
  605. ORDER BY FAX, fill out the order form and mail it along with your payment
  606. FAX as described below. Be sure to include your fax number on your
  607. order form. Do to choose this method if you are ordering the
  608. source code.
  609. -------------------------------------------------------------------------------
  610. RECEIVING You may choose to receive your OpenDoors registration and/or
  611. ORDER BY source code by calling the OpenDoors BBS after your registration
  612. CALLING form and order fee have been received here. If you are unable to
  613. OPENDOORS receive your order by any other electronic means (such as a call
  614. BBS to your BBS, or by electronic mail), this may be the quickest
  615. way for you to receive your registration information and/or
  616. source code. The obvious disadvantage with to option is the fact
  617. that you will have to estimate when your order will arrive here
  618. in order to receive it as quickly as possible. You may end up
  619. calling the OpenDoors BBS more than once before your order has
  620. arrived. After your order form has arrived, your registration
  621. key and/or source code will be placed on hold for you, and you
  622. ===============================================================================
  623. OpenDoors 6.00 Manual End of Page 15
  624. will be able to receive it on your first call to the BBS. The
  625. phone number of the BBS is:
  626. +1 (613) 599-5554
  627. -------------------------------------------------------------------------------
  628. RECEIVING In order to receive your OpenDoors registration key and/or
  629. ORDER BY source code by a message and/or upload to your BBS, fill out
  630. CALL TO the order form and mail it along with your payment as described
  631. YOUR BBS below. Be sure to include the phone number, baud rate, and my
  632. login and password for the BBS to which you would like me to
  633. call. As always, I will cover any long distance costs. If, for
  634. some reason, I am unable to connect to your BBS (not because it
  635. is busy, but, for example, if your BBS is no longer online), I
  636. will send your order by conventional mail instead.
  637. -------------------------------------------------------------------------------
  638. RECEIVING In order to receive your OpenDoors registration key and/or
  639. ORDER BY source code by FidoNet CrashMail, simply fill out the order
  640. FIDONET form and mail it along with your payment as described below.
  641. CRASHMAIL Be sure to include the FidoNet node address to which you wish to
  642. have your registration key and/or source code sent to (via
  643. CrashMail). Again I will cover any long distance costs. If, for
  644. some reason, I am unable to connect to your FidoNet system, I
  645. will send your order by conventional mail instead.
  646. ===============================================================================
  647. OpenDoors 6.00 Manual End of Page 16
  648. ORDERING THE SOURCE CODE
  649. -----------------------------------------------------------------------------
  650. Many people also choose to order the source code along with
  651. their OpenDoors registration. Ordering the source code will
  652. allow you to customize OpenDoors for your own use, use parts of
  653. the OpenDoors source code in other programs, and learn more
  654. about how OpenDoors works. If you have any ideas for changes
  655. that you would like to see in OpenDoors, either large or small,
  656. ordering the source code will allow you to makes these changes
  657. yourself, creating your own customized version of OpenDoors. You
  658. will be able to remove copyright notices, change the way certain
  659. OpenDoors functions work, or add new capabilities to OpenDoors
  660. in surprisingly little time. You will also be able to use any of
  661. the OpenDoors source code, be it the DesqView-aware code,
  662. EMS/disk swapping routines, configuration file system,
  663. communications routines, or anything else, in any other programs
  664. that you write. Also, ordering the OpenDoors source code will
  665. allow you to learn more about how OpenDoors works, and how to
  666. program communications software and BBS door programs.
  667. When you order the OpenDoors source code, you will receive the
  668. source code package. The source code package also includes a
  669. short "Source Code Manual", with a description of how the
  670. OpenDoors source code is organized, instructions on how to
  671. recompile the source code, and more. If you choose to receive
  672. the source code package electronically, you will receive it in
  673. the form of a single .ZIP file. If you choose to receive the
  674. source code package by mail, you will receive it on a 3-1/2"
  675. diskette.
  676. REQUIREMENTS Due to the wide variety of compilers that are available, and the
  677. differences between them, I have been unable to test the
  678. OpenDoors source code with every compiler. This means that you
  679. may need to make some changes to the source code in order to
  680. compile it with certain compilers.
  681. In order to compile the DOS version of OpenDoors, you must be
  682. using a compiler that supports inline assembly language
  683. keywords. This includes all Borland compilers released since
  684. 1991, and many other compilers. The one notable exception is
  685. Watcom's compiler, which does not support inline assembly
  686. language at the time of this writing.
  687. For your information, the DOS OpenDoors libraries included with
  688. this package were compiled using Turbo C++ 1.0 Professional. The
  689. Win32 libraries included with this package were compiled using
  690. Microsoft Visual C++ 2.0. This means that you can be reasonably
  691. certain that OpenDoors will compile with these compilers and any
  692. more recent compilers by these companies without any changes.
  693. ===============================================================================
  694. OpenDoors 6.00 Manual End of Page 17
  695. --------------------------------------------------------------------------
  696. OPENDOORS 6.00 ORDER FORM
  697. --------------------------------------------------------------------------
  698. REGISTRATION NAME : _______________________________ (AS SHOULD APPEAR IN
  699. REGISTRATION)
  700. YOUR NAME : _______________________________ (IF DIFFERENT)
  701. POSTAL ADDRESS : ______________________________________________________
  702. ______________________________________________________
  703. ______________________________________________________
  704. E-MAIL ADDRESSES : ____________________________________ (IF APPLICABLE)
  705. ADDITIONAL INFO : ______________________________________________________
  706. (EG FAX/BBS PHONE NUMBER & BRIAN'S PASSWORD, IF NEEDED)
  707. I WISH TO RECEIVE MY ORDER BY:
  708. ___ ___
  709. | | - INTERNET E-MAIL (FASTEST) | | - I WILL CALL BRIAN'S BBS
  710. |___| |___|
  711. ___ ___
  712. | | - CONVENTIONAL MAIL | | - CALL TO MY BBS
  713. |___| |___| (INCLUDE LOGIN INFO)
  714. ___ ___
  715. | | - FAX (INCLUDE FAX #) | | - FIDONET "CRASHMAIL"
  716. |___| |___|
  717. ___
  718. I WOULD LIKE TO ORDER: | | - BOTH REGISTRATION KEY AND SOURCE CODE
  719. |___| ($56 US, $68 CANADIAN, OR EQUIVALENT FUNDS)
  720. ___
  721. | | - JUST MY REGISTRATION KEY
  722. |___| ($28 US, $34 CANADIAN, OR EQUIVALENT FUNDS)
  723. ___
  724. | | - UPGRADE TO SOURCE CODE (ONLY IF ALREADY
  725. |___| REGISTERED) ($28 US, $34 CANADIAN OR EQUIV.)
  726. I AGREE TO THE REGISTRATION TERMS, ____________________________
  727. SET FORTH ON PAGE 20 OF THE MANUAL (SIGNATURE)
  728. MAKE CHEQUES PAYABLE TO: BRIAN PIRIE
  729. 117 CEDAROCK DRIVE
  730. KANATA ON K2M 2H5
  731. CANADA
  732. +-- OFFICIAL USE ONLY ----------------------------------------------------+
  733. | |
  734. | S.N. : _____________ SENT : _________________________________________ |
  735. +-------------------------------------------------------------------------+
  736. ===============================================================================
  737. OpenDoors 6.00 Manual End of Page 18
  738. --------------------------------------------------------------------------
  739. OPENDOORS 6.00 FEEDBACK FORM
  740. --------------------------------------------------------------------------
  741. YOUR NAME : _______________________________
  742. WHICH OPENDOORS LIBRARY(S) DO YOU EXPECT TO USE:
  743. ___
  744. | | - DOS VERSION, MEMORY MODELS: _________________________
  745. |___|
  746. ___
  747. | | - WINDOWS (WIN32) VERSION
  748. |___|
  749. HOW DID YOU FIRST LEARN OF OPENDOORS?
  750. ____________________________________________________________
  751. WHICH COMPILER(S) AND VERSION(S) ARE YOU USING?
  752. ____________________________________________________________
  753. WHAT DO YOU LIKE MOST ABOUT OPENDOORS?
  754. ____________________________________________________________
  755. ____________________________________________________________
  756. WHAT CHANGES OR ADDITIONS WOULD YOU LIKE TO SEE IN FUTURE VERSIONS?
  757. ____________________________________________________________
  758. ____________________________________________________________
  759. DO YOU HAVE ANY ADDITIONAL COMMENTS?
  760. ____________________________________________________________
  761. ____________________________________________________________
  762. ____________________________________________________________
  763. -----------------------------------------------------------------------------
  764. ===============================================================================
  765. OpenDoors 6.00 Manual End of Page 19
  766. TERMS OF REGISTRATION AND SOURCE CODE USE
  767. -----------------------------------------------------------------------------
  768. When you purchase an OpenDoors registration and/or source code
  769. license, you are entitled to almost unlimited use of all
  770. versions of OpenDoors. However, in order to protect my
  771. investment of time and effort in developing OpenDoors, you must
  772. also agree to the terms outlined below when licensing OpenDoors
  773. and/or the source code. These terms are intended to be very
  774. reasonable, and are in no way intended to limit your use of
  775. OpenDoors. The primary intent of these terms is that you are not
  776. permitted to disclose your OpenDoors registration information,
  777. or the OpenDoors source code, to other individuals. The terms of
  778. registration and source code use are as follows:
  779. For the purpose of these terms, "OpenDoors" is defined to be the
  780. library files, header files, example programs and programmer's
  781. manual of all versions, past and present, for all languages and
  782. platforms of the OpenDoors online software programming toolkit.
  783. In the case of a source code license, OpenDoors also refers to
  784. the source code that is used to build OpenDoors. Upon licensing
  785. OpenDoors, the individual or organization named on the order
  786. form (the licensee) is entitled to use of all versions of
  787. OpenDoors, within the terms set forth below. Violation of these
  788. terms will be considered copyright infringement, and grounds for
  789. the termination of the registration agreement. The licensee is
  790. entitled, at no additional cost, to use, distribute or sell the
  791. executable (.EXE or .COM) files that are built from OpenDoors.
  792. The licensee is also entitled to use, distribute or sell the
  793. example programs, example configuration files and portions of
  794. the manual. If licensing the source code, the licensee is also
  795. entitled to distribute or sell any executable files that result
  796. from using altered versions of the source code, or portions
  797. thereof, provided that it is not possible for other programmers
  798. to access the OpenDoors API functions through this executable
  799. file. The licensee is NOT entitled to distribute the
  800. registration key number that is provided by Brian Pirie, nor any
  801. portions of the OpenDoors source code. For the purposes of these
  802. terms, an organization is considered to be a company or non-
  803. profit organization. If the licensee is an organization, the
  804. registration key and source code may be shared among members of
  805. the organization, under the condition that these individuals are
  806. using the registration and/or source code only for official
  807. activities of that organization. These terms in no way suggest
  808. an agreement on the part of Brian Pirie to develop any future
  809. versions of OpenDoors, or fix any bugs in current versions of
  810. OpenDoors. OpenDoors is offered "as is", and no warrantees are
  811. expressed or implied. In no event shall Brian Pirie be liable
  812. for any loss of profit or any other damage, including but not
  813. limited to special, incidental, consequential or other damages.
  814. ===============================================================================
  815. OpenDoors 6.00 Manual End of Page 20
  816. 3333
  817. 33 33
  818. 33
  819. 333
  820. 33
  821. 33 33
  822. 3333
  823. -------------------------------------------------------------------------------
  824. CHAPTER 3 - OPENDOORS TUTORIAL
  825. ABOUT THIS MANUAL
  826. -------------------------------------------------------------------------------
  827. The OpenDoors programmer's manual is intended to serve as a
  828. complete tutorial, guide and reference to writing programs with
  829. OpenDoors. Chapter 1 of this manual, beginning on page 5,
  830. provides an introduction and overview of the features of
  831. OpenDoors. If you are unsure of what OpenDoors will do for you,
  832. begin with Chapter 1. Chapter 2, beginning on page 9, provides
  833. important information related to this evaluation copy of
  834. OpenDoors, and how to register your copy. Chapter 3 serves as a
  835. tutorial on OpenDoors and BBS door programming in general.
  836. Chapter 4 provides a reference to the OpenDoors API functions
  837. which you can use in your programs. Chapter 5 provides a
  838. reference to the "OpenDoors control structure", which gives you
  839. access to a wide array of information, and allows you to
  840. customize OpenDoor's appearance and behavior. Chapter 6 provides
  841. information on special OpenDoors features and advanced door
  842. programming topics. Among the subjects discussed in chapter 6
  843. are the Win32 version of OpenDoors, configuration files, multi-
  844. node operation, RIP graphics, logfile support, defining custom
  845. door information file formats, and more.
  846. Chapter 7 (which begins on page 242) gives instructions on
  847. troubleshooting programs written with OpenDoors, lists solutions
  848. to common difficulties, and has information about the many
  849. sources for OpenDoors support. If at any time you are having
  850. difficulty with OpenDoors, be sure to refer to this chapter for
  851. complete step-by-step instruction on tracing the source of your
  852. problem, and for solutions to common difficulties with
  853. OpenDoors. This chapter also directs you to some of the major
  854. sources of support, including information on the OpenDoors email
  855. conference, the OpenDoors support BBS, and how to get in touch
  856. with me.
  857. You will also find many useful tools in this manual, which will
  858. no doubt come in useful while working with OpenDoors. Beginning
  859. on page 2 is a basic table of contents, showing you how the
  860. manual is organized, and helping you to locate general topics.
  861. ===============================================================================
  862. OpenDoors 6.00 Manual End of Page 21
  863. At the end of the manual, beginning on page 267, is an index to
  864. help you locate more information on specific topics. The manual
  865. also includes a glossary, on page 256, which will help you in
  866. understanding new terms that you may come across while reading
  867. the manual. At the end of the manual, you will also find several
  868. useful sections, such as information on what is new in this
  869. version, information on how to contact me, and information about
  870. new OpenDoors features currently in the works.
  871. You will likely want to print this manual, to make reading and
  872. reference while programming easier. To print this manual, simply
  873. type the following line from your DOS prompt. If you are worried
  874. about the size of this manual, you might consider using a
  875. utility that can print multiple pages of a text file on a single
  876. sheet of paper. Printing two manual pages per side of paper
  877. should certainly be legible, and even four-up would give you
  878. text about the size of average newspaper text. Printing on both
  879. sides, you should be able to fit the manual on about 34 sheets
  880. of paper (269/8 < 34).
  881. COMPILING A PROGRAM WITH OPENDOORS
  882. -------------------------------------------------------------------------------
  883. The process of compiling a program written with OpenDoors is
  884. very similar to that of compiling any other program. However,
  885. there are two additional steps which you must be sure to
  886. remember:
  887. 1.) You must include the OPENDOOR.H header file.
  888. 2.) You must link your program with the appropriate OpenDoors
  889. library file.
  890. All programs written with OpenDoors, must "include" the
  891. OPENDOOR.H header file. If you have placed the OPENDOOR.H header
  892. file in the same directory as your program's source code, place
  893. the following line at the beginning of your .C or .CPP file(s):
  894. #include "opendoor.h"
  895. If you have placed the OPENDOOR.H header file in the same
  896. directory as other standard header files (such as stdio.h),
  897. place the following line at the beginning of your .C or .CPP
  898. file(s):
  899. #include <opendoor.h>
  900. ===============================================================================
  901. OpenDoors 6.00 Manual End of Page 22
  902. In addition to including the OpenDoors header file in your
  903. source code modules, you must also "link" the appropriate
  904. OpenDoors library file with your program. The procedure for
  905. doing this depends upon which compiler you are using. The
  906. following sections describe how to link with the OpenDoors
  907. libraries using various compilers.
  908. LINKING WITH OPENDOORS USING A DOS COMPILER
  909. -------------------------------------------------------------------------------
  910. This section describes how to link with the provided OpenDoors
  911. library files under a variety of DOS compilers. If you are using
  912. a compiler other than those described here, refer to your
  913. compiler's manual for information on how to link with third-
  914. party libraries.
  915. If you are using Borland Turbo C 2.00 or earlier, you can cause
  916. your compiler to link your program with the OpenDoors library by
  917. creating a text file with a .PRJ extension. In this text file,
  918. you should list the names of your program's .C modules, along
  919. with the name of the appropriate OpenDoors library file, as
  920. listed in the table at the end of this section. You should then
  921. select this Project file from within the Turbo C IDE prior to
  922. compiling your program.
  923. If you are using Turbo C++ or Borland C++, you can set your
  924. compiler to link your program with the OpenDoors library by
  925. creating a project file from within the IDE. To do this, choose
  926. the Open Project command from the Project menu, and enter the
  927. name for your new project file in the Load Project dialog box.
  928. Then add the names of your program's .C/.CPP modules, along with
  929. the name of the appropriate OpenDoors library file, by pressing
  930. [Insert] in the project window. When you return to Turbo C++ or
  931. Borland C++ again, you can work with the same project file by
  932. using the Open command from the Project menu.
  933. If you are using any Microsoft C compiler, such as Quick C,
  934. Microsoft C or Visual C++, you can set your compiler to link
  935. your program with the OpenDoors library by creating a makefile.
  936. You can create a new project file from within Quick C by using
  937. the Set Program List option from the Make menu. You can do this
  938. from within Visual C++ by using the New command from the Project
  939. menu. You should add the names of your program's .C/.CPP source
  940. files, along with the name of the appropriate OpenDoors library
  941. file, to the newly create makefile.
  942. There are several different DOS library files included with
  943. OpenDoors, each one for use with a different memory model. The
  944. following chart lists the library file names, along with their
  945. corresponding memory model. It is important that you use the
  946. ===============================================================================
  947. OpenDoors 6.00 Manual End of Page 23
  948. library file which corresponds to the memory model you are
  949. using. Whenever you change your compiler to use a different
  950. memory model, it is important to rebuild all of your source
  951. files (using the "Build All" or "Rebuild All" command) in
  952. addition to changing the library that your program is being
  953. linked with. If you are unfamiliar with the concept of memory
  954. models, you should refer to your compiler's manuals. If you are
  955. unsure as to what memory model your compiler is currently using,
  956. check this setting in the compile options dialog box or command
  957. line reference information.
  958. +------------------------------------------------+
  959. | Library | Memory |
  960. | Filename | Model |
  961. |-------------|----------------------------------|
  962. | ODOORS.LIB | DOS small memory model library |
  963. | | |
  964. | ODOORM.LIB | DOS medium memory model library |
  965. | | (Available separately) |
  966. | | |
  967. | ODOORC.LIB | DOS compact memory model library |
  968. | | (Available separately) |
  969. | | |
  970. | ODOORL.LIB | DOS large memory model library |
  971. | | |
  972. | ODOORH.LIB | DOS huge memory model library |
  973. +------------------------------------------------+
  974. To understand how to compile a program written with OpenDoors,
  975. it is a good idea to try compiling one of the example programs,
  976. such as ex_hello.c, that are included in the OpenDoors package.
  977. LINKING WITH OPENDOORS USING A WINDOWS COMPILER
  978. -------------------------------------------------------------------------------
  979. The Win32 version of OpenDoors resides in a DLL, ODOORS60.DLL.
  980. In order to use OpenDoors from a Win32 program, you will
  981. typically link to an import library (although it is also
  982. possible to use load-time dynamic linking through the use of
  983. LoadLibrary() and GetProcAddress()). The OpenDoors package
  984. includes a COFF-format import library for use Microsoft
  985. compilers, named ODOORW.LIB. If you are using a compiler that
  986. uses OMF-format object files, such as a Borland compiler, you
  987. will need to create your own version of the odoorw.lib import
  988. library, by using the implib utility provided with your
  989. compiler.
  990. When compiling an OpenDoors program with a Windows compiler, be
  991. sure that either the WIN32 or __WIN32__ constant is defined.
  992. ===============================================================================
  993. OpenDoors 6.00 Manual End of Page 24
  994. Microsoft and Borland compilers define one of these constants by
  995. default. However, if you are using a compiler from another
  996. company, you may need to explicitly configure your compiler to
  997. define one of these preprocessor constants.
  998. If you are using Microsoft Visual C++ 2.0 or later, you can
  999. setup your compiler to link with the OpenDoors import library by
  1000. creating a makefile (choose File|New|Project) and adding both
  1001. your program's .C/.CPP source file(s) and the odoorw.lib import
  1002. library to the project. When prompted for the Project type,
  1003. choose "Application", not a "MFC AppWizard". If you are using
  1004. Visual C++ 2.0, then you must manually edit the .mak file using
  1005. a text editor. In this file, replace all occurrences of
  1006. "/SUBSYSTEM:windows" with "/SUBSYSTEM:windows,4.0". This
  1007. instructs the linker to create an executable file that is
  1008. targeted for Windows 95. If you do not do this, some of the
  1009. OpenDoors visual elements will not appear correctly. Later
  1010. versions of Microsoft's compiler default to using
  1011. "/SUBSYSTEM:windows,4.0", and so this step is no longer
  1012. necessary with those compilers.
  1013. If you are using Borland C++ 4.50 or later, you must create an
  1014. OpenDoors import library for ODOORS60.DLL before you can compile
  1015. your first OpenDoors program. To do this, go to the directory
  1016. where ODOORS60.DLL is located, move the original odoorw.lib to a
  1017. backup location, and issue the command:
  1018. IMPLIB ODOORW.LIB ODOORS60.DLL
  1019. This will create a new import library (ODOORW.LIB) which you can
  1020. then use with your compiler. To compile an OpenDoors program
  1021. from the command line, issue the command:
  1022. BCC32 -tW your_program.c ODOORW.LIB
  1023. To compile an OpenDoors program from within the IDE, create a
  1024. new project file, and add both your program's source file(s) and
  1025. the OpenDoors import library to that project. If you are
  1026. compiling from within the IDE, check the TargetExpert and be
  1027. sure that you are using the multithreaded version of the the
  1028. runtime libraries. By default, the Borland IDE compiles single-
  1029. threaded, which will not work with OpenDoors.
  1030. Additional information on the Win32 version of OpenDoors is
  1031. provided in chapter 6.
  1032. ===============================================================================
  1033. OpenDoors 6.00 Manual End of Page 25
  1034. RUNNING A DOOR PROGRAM WRITTEN WITH OPENDOORS
  1035. -------------------------------------------------------------------------------
  1036. This section provides information on how to run a BBS door
  1037. program that has been written with OpenDoors. If you are using
  1038. OpenDoors to write some other form of online software, the
  1039. information provided here will apply to different degrees,
  1040. depending on the nature of your program.
  1041. OpenDoors supports both local and remote modes. In the normal
  1042. mode of operation, remote mode, your program's output will be
  1043. displayed to both the local screen and the remote user's screen.
  1044. To run your program in remote mode, you will usually set it up
  1045. to run under some BBS package. However, for testing purposes, it
  1046. is often convenient to run your program in local mode.
  1047. There are several ways to start your program in local mode. The
  1048. first method is to place the example DORINFO1.DEF file in the
  1049. same directory as your program. If your program uses the
  1050. OpenDoors command line processing function, od_parse_cmd_line(),
  1051. then you can start your program in local mode by simply
  1052. specifying -local on your program's command line. For example,
  1053. you can try the example program include with OpenDoors by
  1054. issuing the command VOTEDOS -LOCAL (for the DOS version) or
  1055. VOTEWIN -LOCAL (for the Windows 95/NT version). OpenDoors will
  1056. also run in local mode if you set it up to run under a BBS
  1057. package, and log into the BBS in local mode. When the BBS runs
  1058. your door program, OpenDoors will automatically run in local
  1059. mode.
  1060. To run your program in remote mode, you will probably want to
  1061. run it under a BBS system. If you don't have a BBS package for
  1062. testing purposes, you might want to obtain a popular BBS package
  1063. such as Wildcat!, Maximus (which is free) or RemoteAccess.
  1064. RUNNING DOS-BASED DOOR PROGRAMS
  1065. -------------------------------------------------------------------------------
  1066. DOS BBS packages typically run door programs using one of two
  1067. methods. Either the BBS package directly loads and executes the
  1068. program, or it exits to a DOS batch file, which in turn executes
  1069. the door program. In either case, the BBS package produces a
  1070. door information file, common called a "drop file", which
  1071. provides information to the door program such as the name of the
  1072. current user. OpenDoors automatically supports the common drop
  1073. file formats, including DORINFOx.DEF and DOOR.SYS.
  1074. RUNNING WINDOWS 95/NT DOOR PROGRAMS
  1075. ===============================================================================
  1076. OpenDoors 6.00 Manual End of Page 26
  1077. -------------------------------------------------------------------------------
  1078. This section provides information specific to running door
  1079. programs that are compiled with the Win32 version of OpenDoors.
  1080. Please feel free to include this information in your program's
  1081. manual.
  1082. Since the Win32 version of OpenDoors resides in a DLL,
  1083. ODOORS60.DLL, this file must be present on any system where your
  1084. program will be run. Although Windows 95/NT will find this file
  1085. if it is located in the same directory as your program's
  1086. executable file, it is a good idea to install this DLL into the
  1087. Windows system directory. This way, all programs using the Win32
  1088. version of OpenDoors can share the same copy of the DLL,
  1089. reducing the amount of disk space that is used.
  1090. The required setup for a Windows 95/NT door will depend upon
  1091. what BBS system it is being run under. If you the program is
  1092. being run under a native Windows 95/NT BBS system, then ideally
  1093. that BBS system will provide the ability to pass a live serial
  1094. port handle to the door program, on the program's command line.
  1095. Otherwise, you should run the door from a batch file, following
  1096. the instructions provided below for running the program under a
  1097. DOS-based BBS system. If the BBS system is able to pass a live
  1098. Window communications handle on the door's command line, and you
  1099. are using the OpenDoors standard command-line processing
  1100. function (od_parse_cmd_line()), then you can just setup the BBS
  1101. to run the program directly, using the command line:
  1102. YourProgramName.exe -handle xxxxxxxxxx
  1103. where xxxxxxxxx is the serial port handle, in decimal format.
  1104. You do not need to use the start command, nor the DTRON utility,
  1105. and you do not have to change the COM<n>AutoAssign setting in
  1106. the system.ini file.
  1107. If you are running the Win32 door program under a DOS-based BBS
  1108. system, or a Windows-based BBS system that is unable to pass a
  1109. live serial port handle to the door program, then follow these
  1110. steps:
  1111. 1.Add a line of the form "COM<n>AutoAssign=<x>" to the [386Enh]
  1112. section of your system.ini file. Here, <n> specifies the
  1113. serial port number that the BBS's modem is connected to, and
  1114. <x> will usually be 0. For example, if your modem is
  1115. connected to COM1, you would add a line such as
  1116. "COM1AutoAssign=0" (sans quotes). You will then have to re-
  1117. start your computer for this change to take effect. If you do
  1118. not do this, the Windows-based door program will not be able
  1119. to access the modem.
  1120. ===============================================================================
  1121. OpenDoors 6.00 Manual End of Page 27
  1122. 2.Setup the BBS software to run the Windows-based door program
  1123. just as you would any other door program. You will probably
  1124. want to do this from a batch file. The command line that runs
  1125. the Windows program should be of the form:
  1126. start /w /m YourProgramName.exe [any command line
  1127. parameters]
  1128. This will cause the Windows-based door program to start in
  1129. minimized mode, and cause the calling MS-DOS session to wait
  1130. until the Windows program exits before continuing. If you do
  1131. not wish the program to be started in minimized mode, remove
  1132. the /m from the command line. If you attempt to start the
  1133. door program by calling it directly, rather than using the
  1134. "start /w" command, the BBS software will immediately start
  1135. again, cause it to attempt to run simultaneously with the
  1136. door program.
  1137. 3.After running the start command, use DTRON.EXE or a similar
  1138. utility to re-enable DTR detection by the modem. Normally,
  1139. this command line will be of the form:
  1140. dtron /port x /bps y
  1141. Where x is the serial port number (0 for COM1, 1 for COM2,
  1142. etc.) and y is the locked bps rate. For example, if your
  1143. serial port is locked at 38400 bps and is connected to COM2,
  1144. you would use:
  1145. dtron /port 1 /bps 38400
  1146. For full information on the DTRON utility, simply type the
  1147. command line:
  1148. dtron /help
  1149. You may freely redistribute the DTRON utility that is
  1150. included in this package with your program.
  1151. Additional information on the Win32 version of OpenDoors, and
  1152. further explanation of some of these steps, is provided in
  1153. chapter 6.
  1154. ===============================================================================
  1155. OpenDoors 6.00 Manual End of Page 28
  1156. BASICS OF DOOR PROGRAMMING WITH OPENDOORS
  1157. -------------------------------------------------------------------------------
  1158. This section provides a complete tutorial to the basics of
  1159. writing BBS door programs using OpenDoors. If you are using
  1160. OpenDoors to write other online software, much of this
  1161. information will still be relevant.
  1162. In addition to reading this section, I would encourage you to
  1163. look at the example programs included int the OpenDoors
  1164. packages. These programs, which are described beginning on page
  1165. 38, will give you a much better idea of what an OpenDoors
  1166. program will look like. These programs can also serve as a great
  1167. starting point for writing your own programs using OpenDoors.
  1168. Probably the best means of introduction to door programming with
  1169. OpenDoors is by doing it yourself. As such, I strongly encourage
  1170. you to try compiling and running the simple introduction program
  1171. below. For instructions on compiling programs written with
  1172. OpenDoors, see page 22.
  1173. DOS version:
  1174. #include "opendoor.h"
  1175. main()
  1176. {
  1177. od_printf("Welcome to my first door program!\n\r");
  1178. od_printf("Press a key to return to BBS!\n\r");
  1179. od_get_key(TRUE);
  1180. od_exit(0, FALSE);
  1181. }
  1182. Win32 version:
  1183. #include "opendoor.h"
  1184. int WINAPI WinMain(HINSTANCE hInstance,
  1185. HINSTANCE hPrevInstance,LPSTR lpszCmdLine,int nCmdShow)
  1186. {
  1187. od_printf("Welcome to my first door program!\n\r");
  1188. od_printf("Press a key to return to BBS!\n\r");
  1189. od_get_key(TRUE);
  1190. od_exit(0, FALSE);
  1191. }
  1192. Keep in mind that even this simple program will automatically
  1193. have all of the door capabilities we have already mentioned.
  1194. Notice the line that reads #include "opendoor.h". All programs
  1195. written with OpenDoors must include the OPENDOOR.H header file
  1196. in order to compile correctly. The first two lines in the
  1197. main/WinMain function simply call the OpenDoors od_printf()
  1198. ===============================================================================
  1199. OpenDoors 6.00 Manual End of Page 29
  1200. function. od_printf() is similar to the printf() function that C
  1201. programmers will already be familiar with. However, unlike
  1202. printf(), the od_printf() function sends the output to both the
  1203. modem and the local screen. Notice that the lines of text
  1204. displayed by the od_printf() function end with a "\n\r"
  1205. sequence, instead of the normal "\n". This is because the
  1206. terminal emulation software that is running on the remote user's
  1207. system usually requires both a carriage return and a line feed
  1208. to correctly begin a new line. The next line in our example
  1209. program is the OpenDoors single-key input function,
  1210. od_get_key(). The TRUE value causes OpenDoors to wait for a key
  1211. to be pressed (again, either from remote or local keyboard)
  1212. before returning. The last line of the main/WinMain function is
  1213. a call to od_exit(). Any program using OpenDoors should call
  1214. this function. For the time being, you can always use the (0,
  1215. FALSE) parameters.
  1216. Once again, you are encouraged to try compiling and running this
  1217. program, as described above. Congratulations, you have written
  1218. your first door program! Feel free to make any changes to this
  1219. program, and see what effects your changes have.
  1220. To simplify this example, separate versions of this program are
  1221. shown for the DOS and Win32 versions of OpenDoors. However, you
  1222. would typically write your program so that it could be compiled
  1223. using either the DOS or Win32 versions of OpenDoors, by
  1224. beginning the mainline function as follows:
  1225. #ifdef ODPLAT_WIN32
  1226. int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE
  1227. hPrevInstance,
  1228. LPSTR lpszCmdLine, int nCmdShow)
  1229. #else
  1230. int main(int argc, char *argv[])
  1231. #endif
  1232. In case you are not entirely familiar with the operation of door
  1233. programs, we will now provide an introduction to the internals
  1234. of a door's operation. Keep in mind that OpenDoors automatically
  1235. carries out most of these tasks for you. When any door program
  1236. starts up, one of the first things it must do is to read the
  1237. door information file(s) (sometimes called a "drop file") passed
  1238. to it by the BBS. When a user is on-line, and wishes to run a
  1239. door, they will most likely select a command from a menu. At
  1240. this point, the BBS system (such as RemoteAccess, Maximus, PC-
  1241. Board or whatever), will create a file of information about the
  1242. system, who is currently on-line, and so on. Various BBS
  1243. packages produce various styles of door information files.
  1244. OpenDoors automatically recognizes and reads a wide variety of
  1245. door information file formats. As a result, your doors will be
  1246. able to run on a almost any BBS system.
  1247. ===============================================================================
  1248. OpenDoors 6.00 Manual End of Page 30
  1249. Fortunately, OpenDoors takes care of all the work involved in
  1250. detecting and reading the door information file, and then
  1251. initializing and communicating with the serial port for you. In
  1252. order to carry out these tasks, along with setting up the status
  1253. line, and so on, OpenDoors provides a function called od_init().
  1254. If you do not explicitly call this function, the first call to
  1255. any other OpenDoors function (such as the first time your door
  1256. program outputs anything) will automatically cause the od_init()
  1257. function to be called. As a result, upon the first call to an
  1258. OpenDoors function, all of the initialization tasks for the door
  1259. will automatically be carried out. However, there may be times
  1260. when you will want your program to have access information about
  1261. the user who is on-line, or carry out other actions which
  1262. require od_init() to have been executed - prior to the point
  1263. where you call any other OpenDoors functions. In this case, you
  1264. will have to call od_init() yourself before you do any of these
  1265. things.
  1266. OpenDoors provides you with a C/C++ structure, by the name of
  1267. od_control, which allows you to access all the available
  1268. information about the user who is on-line, the system your door
  1269. is running on, and also allows you to adjust various OpenDoors
  1270. parameters. Depending on what BBS system your door is running
  1271. under, the actual information available from the od_control
  1272. structure will vary. For more information on the od_control
  1273. structure, see the section on the control structure, beginning
  1274. on page 148.
  1275. Once the door has initialized itself, it will then begin
  1276. communications with the user who is online. OpenDoors takes care
  1277. of all communications, through its various input and display
  1278. functions. When the door has finished, it will then write any
  1279. information that has changed back to the door information file
  1280. (if applicable), finish communicating with the modem, and return
  1281. to the BBS. In OpenDoors, these shut-down operations are
  1282. automatically performed you call the od_exit() function. This
  1283. function will terminate the door's activity, OPTIONALLY hang up
  1284. on the user (allowing you to provide either return to BBS or
  1285. logoff options for exiting), and then exit with the specified
  1286. errorlevel.
  1287. One other important OpenDoors function that you should be aware
  1288. of is the od_kernel() function. od_kernel() is the central
  1289. OpenDoors control function, and is responsible for much of
  1290. OpenDoor's updating of the status line, monitoring the carrier
  1291. detect and user timeout status, responding to sysop function
  1292. keys, and so on. The od_kernel() function is called
  1293. automatically by OpenDoors, within the other OpenDoors
  1294. functions. As a result, since most door programs will call some
  1295. OpenDoors function on a regular basis, you will most often have
  1296. no need to call the od_kernel() function yourself. However, if
  1297. your door is going to perform some action, such as updating data
  1298. ===============================================================================
  1299. OpenDoors 6.00 Manual End of Page 31
  1300. files, during which it will not call any OpenDoors function for
  1301. more than a few seconds, you should then call the od_kernel()
  1302. function yourself. For more information on the od_kernel()
  1303. function, see page 97.
  1304. For more information on the functions available from OpenDoors,
  1305. or the control structure, see the corresponding sections in this
  1306. manual.
  1307. ===============================================================================
  1308. OpenDoors 6.00 Manual End of Page 32
  1309. TOUR OF A SAMPLE DOOR PROGRAM: "EX_VOTE"
  1310. ------------------------------------------------------------------------------
  1311. One of the best ways to see how OpenDoors works, and the
  1312. potential that it has, is to look at the example programs
  1313. included in the OpenDoors package. A brief description of each
  1314. of these programs can be found on page 38. This section takes a
  1315. closer look at one of the example programs, EX_VOTE.C. Unlike
  1316. our simple example in the previous section, EX_VOTE.C is a much
  1317. more complicated program, taking advantage of many of the
  1318. advanced features of OpenDoors. Even if you do not understand
  1319. everything that EX_VOTE.C does, you should be able to make use
  1320. of various elements demonstrated here, in your own programs.
  1321. The OpenDoors package includes a two compiled versions of
  1322. EX_VOTE. VOTEDOS.EXE is a plain-DOS program which can run under
  1323. DOS, Windows or OS/2. VOTEWIN.EXE was compiled using the Win32
  1324. version of OpenDoors, and so it runs only on Windows 95/NT. The
  1325. OpenDoors package also contains a sample door information file,
  1326. DORINFO1.DEF. You can use this file to test any doors in local
  1327. mode. If you wish to manually create your own DORINFO1.DEF file,
  1328. you can do so very easily. The DORINFO1.DEF door information
  1329. file is a simple text file which lists a different piece of
  1330. information on each line, in the following format:
  1331. +----------------------------------------------------------+
  1332. | LINE NUMBER | DESCRIPTION | EXAMPLE |
  1333. +-------------+------------------------+-------------------|
  1334. | 1 | Name of the BBS | MY OWN BBS |
  1335. | 2 | Sysop's first name | BRIAN |
  1336. | 3 | Sysop's last name | PIRIE |
  1337. | 4 | Com Port modem is on | COM0 |
  1338. | 5 | Baud rate, etc. | 0 BAUD,N,8,1 |
  1339. | 6 | Unused | 0 |
  1340. | 7 | User's first name | JOHN |
  1341. | 8 | User's last name | PUBLIC |
  1342. | 9 | Caller's location | OTTAWA, ON |
  1343. | 10 | ANSI mode (0=off, 1=on)| 1 |
  1344. | 11 | User's security level | 32000 |
  1345. | 12 | User's time left | 60 |
  1346. +----------------------------------------------------------+
  1347. Feel free to make any changes you wish to EX_VOTE.C, and
  1348. recompile it. One of the most effective and enjoyable ways to
  1349. learn OpenDoors is by experimenting. If you are a registered
  1350. owner of OpenDoors, you may even distribute your own versions of
  1351. this door. Also, you may find that EX_VOTE.C serves as a good
  1352. framework for building your own door programs.
  1353. The EX_VOTE.C door behaves similarly to most other door
  1354. programs, and will have a fair bit in common with any other door
  1355. ===============================================================================
  1356. OpenDoors 6.00 Manual End of Page 33
  1357. you write in OpenDoors. What you see in the output window is
  1358. identical to what a remote user will be seeing. If the user has
  1359. ANSI, AVATAR or RIP mode turned on, you will see the same colors
  1360. as they do, and if they have screen clearing turned on, your
  1361. screen will be cleared when theirs is. The status line at the
  1362. bottom of the window will list the name of the user currently
  1363. on-line (if you are using the sample DORINFO1.DEF file, the
  1364. user's name will be "The Sysop"), the user's location, and the
  1365. user's baud rate (0 if the door is operating in local mode). The
  1366. local display also shows how much time the user has left,
  1367. whether the user has paged the system operator for a chat, and
  1368. other information.
  1369. There are a number of special commands that are only available
  1370. to the system operator on the local keyboard. These commands
  1371. allow the system operator to hang up on the user, adjust the
  1372. amount of time the user may remain online, enter chat mode with
  1373. the user, enter a DOS shell (in the DOS version), and so on. In
  1374. the DOS version, help on these commands is available on the
  1375. status line by pressing the [F9] key. In the Windows version,
  1376. these commands are listed on the menu that appears at the top of
  1377. the window.
  1378. Now, let us take a closer look at the actual source code for the
  1379. EX_VOTE.C door. If you have not already printed out a copy of
  1380. this manual, and possibly the EX_VOTE.C file as well, it would
  1381. probably be a good idea to do so now.
  1382. Notice that near the top of the program, along with all the
  1383. standard header files, the OPENDOOR.H file is included. This
  1384. file must be included in all programs written under OpenDoors.
  1385. If you are placing the OPENDOOR.H file in the same directory as
  1386. the door you are compiling, simply include the line:
  1387. #include "opendoor.h"
  1388. in your program.
  1389. The main()/WinMain() function of the EX_VOTE.C program has a
  1390. for(;;) loop that repeatedly displays the main menu, obtains a
  1391. choice from the user and responds to the command, until the user
  1392. chooses to exit the program. Before the main menu is displayed,
  1393. the screen is cleared by calling od_clr_scr(). The od_clr_scr()
  1394. function will clear both the local and remote screens, but only
  1395. if the user has screen clearing enabled. Refer to page 57 for
  1396. information on how to force the screen to be cleared, regardless
  1397. of the user's screen clearing setting. The main menu is
  1398. displayed using the od_printf() function, one of the most common
  1399. OpenDoors functions you will use. Next, od_get_answer() is used
  1400. to obtain a menu choice from the user from the specified set of
  1401. keys. Next, a switch() statement is used to respond to the
  1402. user's command appropriately. If the user presses the P key to
  1403. ===============================================================================
  1404. OpenDoors 6.00 Manual End of Page 34
  1405. page the system operator, od_page() is called. If the user
  1406. chooses to return to the BBS, od_exit() is called to terminate
  1407. OpenDoor's activities and return control to the BBS. The FALSE
  1408. parameter passed to od_exit() indicates that OpenDoors should
  1409. not disconnect (hangup) before exiting. If the user chooses to
  1410. log off, EX_VOTE.C first confirms this action with the user, and
  1411. then calls od_exit() with the TRUE parameter. The numerical
  1412. parameter passed to od_exit() sets the errorlevel that OpenDoors
  1413. will exit with.
  1414. In its ChooseQuestion() function, EX_VOTE.C uses the OpenDoors
  1415. function od_get_key(). This function is similar to the
  1416. od_get_answer() function that we have already seen. However,
  1417. unlike od_get_answer() which will wait until the user presses
  1418. some key from the list of possibilities you provide,
  1419. od_get_key() will allow the user to press any key. od_get_key()
  1420. accepts a single parameter. If this parameter is TRUE,
  1421. od_get_key() will wait for the user to press a key before
  1422. returning. If this parameter is FALSE, od_get_key() will return
  1423. immediately with a value of 0 if there are no keys waiting in
  1424. the inbound buffer, and returning the next key if there are
  1425. characters waiting.
  1426. In a number of places, EX_VOTE.C also uses the od_input_str()
  1427. function. Unlike od_get_key() and od_get_answer() which return a
  1428. single character, od_input_str() allows the user to input and
  1429. edit a string of many characters. You will only receive the
  1430. string entered by the user after they press the enter key.
  1431. od_input_str() accepts four parameters: the string where the
  1432. user's input should be stored, the maximum number of characters
  1433. to input, the minimum character value to accept and the maximum
  1434. character value to accept.
  1435. Another new feature of OpenDoors that is used by EX_VOTE.C is
  1436. the OpenDoors control structure, od_control. This global
  1437. structure is documented in chapter 5 of this manual. The
  1438. OpenDoors control structure allows you to access a wide variety
  1439. of information about the user who is currently online, the BBS
  1440. system your program is running on, and also allows you to
  1441. control various OpenDoors settings. For example, EX_VOTE.C
  1442. compares the current user name (od_control.od_user_name) with
  1443. the name of the system operator (od_control.od_sysop_name) to
  1444. determine whether it is the system operator who using the
  1445. program.
  1446. EX_VOTE.C uses two data files, the first of which contains a
  1447. record for every user, and the second of which contains a record
  1448. for every question. EX_VOTE.C accesses these data files in a
  1449. controlled manner in order to permit the program to be running
  1450. simultaneously on multiple lines on a multi-node BBS system.
  1451. When EX_VOTE.C needs to update a data file, it opens it for
  1452. exclusive access, so that only one node can access the file at
  1453. ===============================================================================
  1454. OpenDoors 6.00 Manual End of Page 35
  1455. any given time. Since the data file could have been changed by
  1456. another node since the time that EX_VOTE.C last read the file,
  1457. it always reads a record, makes changes to it and then re-writes
  1458. the record while it has the file open for exclusive access. It
  1459. then closes the file as soon as possible after opening the file,
  1460. in order to permit other nodes to once again access the file.
  1461. Because EX_VOTE.C keeps track of which questions each user has
  1462. voted on, along with the questions and results of voting on each
  1463. question, its data file format is more complex than many door
  1464. programs (although not as complex as others).
  1465. EX_VOTE.C also uses color. One of the easiest ways to use
  1466. different colors in an OpenDoors program is to use the
  1467. OpenDoor's print color-setting extensions. You can change the
  1468. color of text display at any point in an od_printf() format
  1469. string using by enclosing the name of new display color in back
  1470. quote characters (`, not '). For example:
  1471. od_printf("`red`This is in red `green`This is green\n\r");
  1472. Would cause the words "This is in red" to be displayed in red,
  1473. and the words "This is in green" to be displayed in green.
  1474. EX_VOTE.C also takes advantage of a number of OpenDoors
  1475. capabilities that you can optionally choose to include in your
  1476. door programs. You will notice that there are a number of new
  1477. lines at the beginning of the main() function, all of which
  1478. change settings in the OpenDoors control structure. The line:
  1479. od_control.od_config_file = INCLUDE_CONFIG_FILE;
  1480. causes the OpenDoors configuration file system to be included in
  1481. your program. Using this system, OpenDoors automatically reads a
  1482. configuration file that can be used by the system operator to
  1483. change various program settings. Refer to the included door.cfg
  1484. file for an example OpenDoors configuration file. In addition to
  1485. the configuration file settings automatically supported by the
  1486. configuration file system, you can also add your own
  1487. configuration file settings. To do this, you simply supply
  1488. OpenDoors with a callback function that it will call whenever it
  1489. encounters an unrecognized keyword in the configuration file.
  1490. The line:
  1491. od_control.od_config_function = CustomConfigFunction;
  1492. Causes OpenDoors to call the function CustomConfigFunction() in
  1493. EX_VOTE.C for this purpose. You will notice that the
  1494. CustomConfigFunction() receives two parameters - the first is
  1495. the unrecognized keyword, and the second is any parameters that
  1496. follow the keyword in the configuration file. EX_VOTE.C checks
  1497. for two special configuration file lines - one to set whether or
  1498. ===============================================================================
  1499. OpenDoors 6.00 Manual End of Page 36
  1500. not users can add questions, and one to set whether or not users
  1501. can view the results of a question before voting on it.
  1502. The next line in the main() function,
  1503. od_control.od_mps = INCLUDE_MPS;
  1504. causes the OpenDoors "Multiple Personality System" to be
  1505. included in program. This allows the sysop to choose from a
  1506. number of status line / sysop function key "personalities" that
  1507. mimic a number of different BBS systems, using the Personality
  1508. setting in the configuration file.
  1509. The line:
  1510. od_control.od_logfile = INCLUDE_LOGFILE;
  1511. causes the OpenDoors log file system to be included in the
  1512. program. The OpenDoors log file system automatically records the
  1513. date and time of program startup, exit and other major actions
  1514. in the specified file. EX_VOTE.C also writes its own log file
  1515. entries by calling the od_log_write() function.
  1516. EX_VOTE.C also provides the ability for the sysop to provide
  1517. their own ASCII/ANSI/AVATAR/RIP files to be displayed in place
  1518. of the normal main menu. EX_VOTE.C uses the od_hotkey_menu()
  1519. function to display a VOTE.ASC/.ANS/.AVT/.RIP file for the main
  1520. menu, if such a file exists. If the file is not available, the
  1521. normal EX_VOTE.C menu is used instead. The od_hotkey_menu()
  1522. function will automatically select the appropriate file
  1523. (.ASC/.ANS/.AVT/.RIP) for the current display mode, and the user
  1524. is able to make a menu choice at any time. If a menu choice is
  1525. made before the menu is entirely displayed, the function will
  1526. stop displaying the menu and return immediately.
  1527. ===============================================================================
  1528. OpenDoors 6.00 Manual End of Page 37
  1529. OTHER EXAMPLE PROGRAMS INCLUDED WITH OPENDOORS
  1530. ------------------------------------------------------------------------------
  1531. In addition to the EX_VOTE.C program, which is discussed in
  1532. detail in the previous section, a number of other example
  1533. programs are included with OpenDoors. These programs help to
  1534. demonstrate what is possible with OpenDoors. They can also serve
  1535. as excellent tools to help you learn OpenDoors. In addition, you
  1536. are free to include any portions of any of these example
  1537. programs in your own programs. Below is a summary of each of
  1538. these example programs:
  1539. -------------------------------------------------------------------------------
  1540. EX_HELLO.C This an example of a very simple door program that displays a
  1541. short message and prompts for the user to press a key. After the
  1542. user presses a key, the door exits and control is returned to
  1543. the main BBS software. Despite the fact that it only consists of
  1544. a few lines of code, EX_HELLO remains a fully functional door
  1545. program. For information on compiling an OpenDoors door program,
  1546. see the section that begins on page 22.
  1547. -------------------------------------------------------------------------------
  1548. EX_CHAT.C This program is an example of a multi-window full-screen chat
  1549. door written with OpenDoors. EX_CHAT demonstrates the ease of
  1550. using sophisticated ANSI / AVATAR / RIP terminal features within
  1551. OpenDoors programs. For instructions on how to compile this
  1552. program, see the section that begins on page 22.
  1553. This program create two windows on the screen, separated by a
  1554. bar with user name / sysop name information. This program
  1555. permits communication between the local sysop and remote user by
  1556. displaying the text typed by the user in one window, and the
  1557. text typed by the sysop in the other window. When either
  1558. person's typing reaches the bottom of the window, the contents
  1559. of the window is scrolled up to provide more room for typing.
  1560. Words are also wrapped when either typist reaches the end of a
  1561. line. The advantage of a split-screen chat program is that it
  1562. permits both sysop and user to type at the same time without
  1563. difficulty. The chat function automatically invokes OpenDoor's
  1564. internal chat mode if ANSI, AVATAR or RIP modes are not
  1565. available. The display colors, window sizes and locations, and
  1566. distance to scroll a window's contents are configurable by
  1567. setting the appropriate variables, below. When the Sysop invokes
  1568. a DOS shell, a pop-up window is displayed to indicate to the
  1569. user that the door program has been suspended.
  1570. The chat feature of this program can also be easily integrated
  1571. into other doors you write, and may be used to replace the
  1572. existing OpenDoors line-oriented chat system.
  1573. ===============================================================================
  1574. OpenDoors 6.00 Manual End of Page 38
  1575. -------------------------------------------------------------------------------
  1576. EX_MUSIC.C This example door demonstrates how to play "ANSI" music and
  1577. sound effects in an OpenDoors door. Included in this program is
  1578. a function to send "ANSI" music to the remote system, and a
  1579. function to text the remote system's ability to play "ANSI"
  1580. music. You may use both of these functions in your own doors, if
  1581. you wish to add music or sound effect capabilities. This program
  1582. can be compiled by following the instructions that begin on page
  1583. 22.
  1584. -------------------------------------------------------------------------------
  1585. EX_SKI.C This is a simple but addictive online game that is written using
  1586. OpenDoors. In this action game, the player must control a skier
  1587. through a downhill slalom course. The user may turn the skier
  1588. left or right, and the game ends as soon as the player skis
  1589. outside the marked course. The game begins at an easy level, but
  1590. quickly becomes more and more difficult as the course to be
  1591. navigated becomes more and more narrow. The game maintains a
  1592. list of players with high scores, and this list may be viewed
  1593. from the main menu.
  1594. -------------------------------------------------------------------------------
  1595. EX_VOTE.C The EX_VOTE.C file contain the source code for the Vote example
  1596. door, as is described beginning on page 38. The Vote example
  1597. door allows users to vote on up to 200 different "polls", view
  1598. the results of voting on each question, and optionally add their
  1599. own questions for other users to answer.
  1600. ===============================================================================
  1601. OpenDoors 6.00 Manual End of Page 39
  1602. 444
  1603. 4444
  1604. 44 44
  1605. 44444444
  1606. 44
  1607. 44
  1608. 44
  1609. -------------------------------------------------------------------------------
  1610. CHAPTER 4 - THE OPENDOORS API FUNCTIONS
  1611. OVERVIEW
  1612. ------------------------------------------------------------------------------
  1613. OpenDoors provides a wide set of features that you can take
  1614. advantage of in your program. You control these features and
  1615. access OpenDoors from your program using two facilities - the
  1616. OpenDoors API functions, and the OpenDoors control structure. In
  1617. general, the API functions are used to actually accomplish a
  1618. task, such as displaying something to the user, or retrieving
  1619. input from the user. The OpenDoors control structure, on the
  1620. other hand, is used to alter OpenDoors settings or retrieve
  1621. specific information.
  1622. Any program written with OpenDoors makes use of the OpenDoors
  1623. API functions for all of its door-related input and output. In
  1624. addition to the common input and output tasks, the OpenDoors API
  1625. functions provide access to many special capabilities, such as
  1626. displaying ASCII/ANSI/AVATAR/RIP files, providing pop-up windows
  1627. and menus, and much more. Much of the information about the user
  1628. who is online, information about the system your door is running
  1629. on, and settings which customize OpenDoor's behavior are
  1630. controlled through the OpenDoors control structure. The control
  1631. structure is described in the section beginning on page 148.
  1632. This chapter is divided into the following sections:
  1633. i.) TABLE OF MOST COMMONLY USED FUNCTIONS (Page 41)
  1634. ii.) TABLE OF ALL OPENDOORS FUNCTIONS (Page 42)
  1635. iii.) DETAILED INFORMATION ON EACH FUNCTION (Pages 47 - 147)
  1636. The two tables list the names of the OpenDoors functions, along
  1637. with a brief description of the task performed by each function,
  1638. and the page number on which the detailed description of that
  1639. function can be found. The first table lists only the most
  1640. commonly used OpenDoors functions, to allow you to quickly find
  1641. the function you are most likely looking for. The second table
  1642. lists all of the OpenDoors functions, grouped according to
  1643. general categories of functionality.
  1644. ===============================================================================
  1645. OpenDoors 6.00 Manual End of Page 40
  1646. The section containing detailed information lists all of the
  1647. functions in alphabetical order, with the information about each
  1648. function beginning on a new page. This section includes a brief
  1649. description of each function's purpose, a detailed description
  1650. of how to use the function, the function call format, a list of
  1651. related functions, and in many cases example source code showing
  1652. you a typical use of the function.
  1653. TABLE OF MOST COMMONLY USED FUNCTIONS
  1654. ------------------------------------------------------------------------------
  1655. od_printf() Displays text, with the ability to change
  1656. display color. (page 110)
  1657. od_clr_scr() Clears the screen. (Page 57)
  1658. od_input_str() Inputs a string of one or more characters
  1659. from the user. (Page 95)
  1660. od_get_answer() Inputs a single key from a list of possible
  1661. choices ignoring upper/lower case. (Page 81)
  1662. od_get_key() Inputs any single key from the user.
  1663. (Page 82)
  1664. od_set_cursor() Positions the cursor in ANSI/AVATAR/RIP
  1665. modes. (Page 134)
  1666. od_hotkey_menu() Displays an ASCII/ANSI/AVATAR/RIP file, with
  1667. the option of watching for a keypress from
  1668. the user. (Page 90)
  1669. od_popup_menu() Displays a popup menu in ANSI/AVATAR/RIP
  1670. modes. (Page 105)
  1671. od_window_create() Creates a popup window in ANSI/AVATAR/RIP
  1672. modes. (Page 145)
  1673. od_window_remove() Removes a popup window in, restoring screen
  1674. contents "underneath" window. (Page 147)
  1675. ===============================================================================
  1676. OpenDoors 6.00 Manual End of Page 41
  1677. TABLE OF ALL FUNCTIONS
  1678. -------------------------------------------------------------------------------
  1679. OUTPUT TEXT DISPLAY FUNCTIONS
  1680. FUNCTIONS ----------------------
  1681. od_disp_str() Displays a normal, NULL-terminated
  1682. string. (page 63)
  1683. od_disp() Sends the specified number of
  1684. characters to the modem, with or
  1685. without local echo. (page 60)
  1686. od_printf() Performs formatted output, as the
  1687. printf() function does. Also allows
  1688. imbedded codes to change display color.
  1689. (page 110)
  1690. od_putch() Displays a single character. (page 115)
  1691. od_disp_emu() Displays a string, interpreting
  1692. imbedded ANSI/AVATAR terminal emulation
  1693. codes. (page 62)
  1694. od_repeat() Displays the same character any number
  1695. of times, using AVATAR optimization, if
  1696. possible. (page 118)
  1697. COLOR AND CURSOR CONTROL
  1698. ------------------------
  1699. od_set_color() Sets current color to specified
  1700. foreground and background settings.
  1701. (page 131)
  1702. od_set_attrib() Sets current color to specified IBM-PC
  1703. display attribute. (page 128)
  1704. od_set_cursor() Sets the position of the cursor, if
  1705. ANSI/AVATAR/RIP mode is enabled. (page
  1706. 134)
  1707. SCREEN MANIPULATION
  1708. -------------------
  1709. od_clr_scr() Clears the screen, if user has screen
  1710. clearing enabled. (page 57)
  1711. od_save_screen() Stores the current contents of the
  1712. screen, to be later redisplayed using
  1713. od_restore_screen(). Works in all
  1714. display modes. (page 121)
  1715. od_restore_screen() Restores the contents of the screen, as
  1716. previously stored using
  1717. ===============================================================================
  1718. OpenDoors 6.00 Manual End of Page 42
  1719. od_save_screen(). Works in all display
  1720. modes. (page 120)
  1721. BLOCK MANIPULATION
  1722. ------------------
  1723. od_clr_line() Clears the remainder of current line.
  1724. (page 55)
  1725. od_gettext() Stores any area of the screen, to later
  1726. be displayed by od_puttext(). Requires
  1727. ANSI/AVATAR/RIP graphics mode. (page
  1728. 89)
  1729. od_puttext() Displays text with color information,
  1730. as previously stored using
  1731. od_gettext(). Requires ANSI/AVATAR/RIP
  1732. graphics mode. (page 116)
  1733. od_scroll() Scrolls a portion of the screen in
  1734. ANSI/AVATAR/RIP graphics modes. (page
  1735. 123)
  1736. POPUP WINDOWS AND MENUS
  1737. -----------------------
  1738. od_draw_box() Draws a box on the screen in
  1739. ANSI/AVATAR/RIP graphics mode. (page
  1740. 65)
  1741. od_window_create() Displays a popup window, storing the
  1742. screen contents "under" the window.
  1743. Requires ANSI/AVATAR/RIP graphics mode.
  1744. (page 145)
  1745. od_window_remove() Removes a popup window displayed with
  1746. od_window_create(), restoring the
  1747. original screen contents "under" the
  1748. window. Requires ANSI/AVATAR/RIP
  1749. graphics mode. (page 147)
  1750. od_popup_menu() Displays a menu in a popup window,
  1751. allowing the user to choose menu items
  1752. either by pressing a "hot" key, or
  1753. moving a highlighted selection bar.
  1754. After menu selection, the menu may be
  1755. removed, restoring the original screen
  1756. contents "under" the window. Requires
  1757. ANSI/AVATAR/RIP graphics mode. (page
  1758. 105)
  1759. ===============================================================================
  1760. OpenDoors 6.00 Manual End of Page 43
  1761. FILE DISPLAY FUNCTIONS
  1762. ----------------------
  1763. od_send_file() Displays an ASCII/ANSI/AVATAR/RIP file
  1764. (for instance, an .ANS file created by
  1765. a program such as "TheDraw" (page 124)
  1766. od_hotkey_menu() Displays an ASCII/ANSI/AVATAR/RIP menu
  1767. file, with hotkeys active. (page 90)
  1768. od_list_files() Lists the files available for download
  1769. in an area, using a FILES.BBS file.
  1770. (page 98)
  1771. -------------------------------------------------------------------------------
  1772. INPUT od_get_answer() Inputs a single key from the keyboard,
  1773. FUNCTIONS allowing only particular responses.
  1774. (page 81)
  1775. od_get_input() A more flexible version of
  1776. od_get_key(), that also supports
  1777. extended keys such as arrow keys,
  1778. insert, etc. (page 82)
  1779. od_get_key() Inputs a single key from the keyboard,
  1780. optionally waiting if a key is not
  1781. available. (page 82)
  1782. od_input_str() Inputs a string of specified length,
  1783. from the keyboard. (page 95)
  1784. od_edit_str() Formatted string editing function,
  1785. requiring ANSI/AVATAR/RIP graphics.
  1786. (page 68)
  1787. od_multiline_edit() Provides a text editor that allows the
  1788. user to enter or edit text that spans
  1789. multiple lines, such as email messages
  1790. or text files. (page 101)
  1791. od_clear_keybuffer() Removes any waiting keys from the
  1792. keyboard input queue. (page 53)
  1793. -------------------------------------------------------------------------------
  1794. COMMON od_page() Allows the user to page the sysop.
  1795. DOOR (page 101)
  1796. ACTIVITY
  1797. FUNCTIONS od_spawn() OpenDoors "quick" spawn function.
  1798. Executes an external program (eg. file
  1799. compressor, external protocol, etc.) on
  1800. ===============================================================================
  1801. OpenDoors 6.00 Manual End of Page 44
  1802. a separate screen, restoring the
  1803. OpenDoors screen afterwards. (page 139)
  1804. od_spawnvpe() OpenDoors full-featured spawn function.
  1805. Executes an external program on a
  1806. separate screen, searching the path for
  1807. the program, allowing you to specify an
  1808. environment to pass to the child
  1809. process, and returning the errorlevel
  1810. returned by the child process. (page
  1811. 143)
  1812. od_log_write() Adds an entry to the end of the log
  1813. file. (page 100)
  1814. od_parse_cmd_line() Handle standard command line options.
  1815. (page 105)
  1816. -------------------------------------------------------------------------------
  1817. SPECIAL od_init() Begins door operation by setting up
  1818. CONTROL the OpenDoors control structure,
  1819. FUNCTIONS setting up the local screen,
  1820. initializing the serial port (if
  1821. applicable), and reading the door
  1822. information file. (page 92)
  1823. od_color_config() Transfers a color configuration line to
  1824. a color attribute value. (page 59)
  1825. od_add_personality() Adds a custom status line/control key
  1826. personality to OpenDoors. (page 47)
  1827. od_set_statusline() Temporarily alters the setting of the
  1828. current OpenDoors status line. (page
  1829. 137)
  1830. od_autodetect() Automatically determines the remote
  1831. terminal software's graphical
  1832. capabilities. (page 48)
  1833. od_kernel() The central OpenDoors control function,
  1834. which should be executed every few
  1835. seconds. (page 97)
  1836. od_exit() Ends door operations, closing the
  1837. serial port driver, re-writing the door
  1838. information file, and optionally
  1839. returning control to the BBS. (page 79)
  1840. ===============================================================================
  1841. OpenDoors 6.00 Manual End of Page 45
  1842. od_carrier() Allows detection of carrier signal in
  1843. programs that have disabled OpenDoors
  1844. internal checking. (page 51)
  1845. od_set_dtr() Controls the DTR signal to the modem.
  1846. Can be used to manually disconnect a
  1847. remote user, in order to perform
  1848. activities such as call back
  1849. verification. (page 135)
  1850. od_chat() Forces OpenDoors to enter chat mode,
  1851. even if sysop did not press the "chat"
  1852. key. (page 50)
  1853. od_sleep() Suspends program execution, yielding
  1854. control to other tasks in a
  1855. multitasking environment. (page 139)
  1856. ===============================================================================
  1857. OpenDoors 6.00 Manual End of Page 46
  1858. OD_ADD_PERSONALITY()
  1859. -------------------------------------------------------------------------------
  1860. PURPOSE Installs a custom status line / sysop function key personality
  1861. into OpenDoors.
  1862. FORMAT BOOL od_add_personality(char *pszName, BYTE btOutputTop,
  1863. BYTE btOutputBottom, OD_PERSONALITY_PROC *pfPerFunc);
  1864. RETURNS TRUE on success
  1865. FALSE on failure
  1866. DESCRIPTION If used, this function should be called before any other
  1867. OpenDoors API functions. This function installs a new
  1868. personality into OpenDoors. The first parameter specifies the
  1869. string that will be used to identify the personality. This is
  1870. the string that the user will be able to supply in the
  1871. configuration file to select this personality, and is also the
  1872. string that can be passed to od_set_personality() to manually
  1873. switch to this personality. The second and third parameters
  1874. specify the 1-based to and bottom line numbers of the output
  1875. window to be used with this personality. For instance, a top
  1876. value of 1 and bottom value of 23 would cause all door output to
  1877. be displayed on the first 23 lines of the screen, leaving the
  1878. bottom two lines for use by the personality's status line. The
  1879. last parameter is a pointer to the personality function, which
  1880. OpenDoors will call to perform various operations with that
  1881. involve the personality. For more information on personalities
  1882. and the OpenDoors Multiple Personality System, see the section
  1883. which begins on page 233.
  1884. This function only has an effect under the DOS version of
  1885. OpenDoors.
  1886. SEE ALSO od_set_personality(), od_set_statusline()
  1887. ===============================================================================
  1888. OpenDoors 6.00 Manual End of Page 47
  1889. OD_AUTODETECT()
  1890. -------------------------------------------------------------------------------
  1891. PURPOSE Attempts to automatically determine the terminal capabilities of
  1892. the remote system.
  1893. FORMAT void od_autodetect(int nFlags);
  1894. RETURNS N/A
  1895. DESCRIPTION This function can be used to determine whether or not the remote
  1896. terminal supports ANSI and/or RIP (Remote Imaging Protocol)
  1897. graphics modes. This information is usually supplied to the door
  1898. by the BBS software, through the door information file. For this
  1899. reason, most door programs do not need to make used of this
  1900. function. However, if your door will be running under any BBS
  1901. software that does not report the ANSI or RIP capabilities of
  1902. the remote system, you may wish to use this function.
  1903. od_autodetect() will set either of the following OpenDoors
  1904. control structure variables to TRUE if the corresponding
  1905. graphics mode is detected:
  1906. od_control.user_ansi - TRUE if ANSI mode is available
  1907. od_control.user_rip - TRUE if RIP mode is available
  1908. However, if either of these variables have previously been set
  1909. to TRUE (either explicitly by your program, or due to the
  1910. corresponding modes being enabled in the door information file),
  1911. and od_autodetect() does not detect the corresponding graphics
  1912. mode, they will not be set to FALSE. Not all terminal software
  1913. that supports ANSI or RIP graphics mode will necessarily have
  1914. the ability to report their graphics mode capabilities to the
  1915. door. For this reason, failure to detect either of these modes
  1916. does not necessarily indicate that they are not available.
  1917. However, if these modes are detected by od_autodetect(), it is
  1918. safe to assume that the remote system does support the detected
  1919. mode.
  1920. The nFlags parameter is reserved for future use, and should
  1921. always be set to DETECT_NORMAL.
  1922. This function cannot auto-detect AVATAR mode, because there is
  1923. no standard means of determining whether a remote system
  1924. supports AVATAR mode.
  1925. EXAMPLE Below is an example of using od_autodetect() in determining the
  1926. remote terminal's graphics capabilities. Since not all terminal
  1927. software supports auto-detection, this example will also prompt
  1928. ===============================================================================
  1929. OpenDoors 6.00 Manual End of Page 48
  1930. the user to determine their software's capabilities if
  1931. od_autodetect() fails to detect ANSI mode. This code assumes
  1932. that if the terminal software supports the autodetection of ANSI
  1933. mode, that it will also support the autodetection of RIP mode.
  1934. OpenDoors assumes that ANSI mode is always available in
  1935. conjunction with RIP mode.
  1936. /* Call the automatic terminal detection function */
  1937. od_autodetect();
  1938. /* If ANSI mode was not detected, ask the user about
  1939. if(!od_control.user_ansi)
  1940. {
  1941. /* Prompt the user for ANSI capabilities */
  1942. od_clr_scr();
  1943. od_printf("Does your system support ANSI graphics?");
  1944. od_printf(" (Y/N)");
  1945. /* If the user chooses [Y]es */
  1946. if(od_get_answer("YN") == 'Y')
  1947. {
  1948. /* Turn on ANSI mode */
  1949. od_control.user_ansi = TRUE;
  1950. /* Since ANSI mode is present, RIP mode may also */
  1951. /* be available. Prompt the user for RIP. */
  1952. od_printf("\r\n\n");
  1953. od_printf("Does your system support RIP graphics?");
  1954. od_printf(" (Y/N)");
  1955. /* If the user chooses [Y]es */
  1956. if(od_get_answer("YN") == 'Y')
  1957. /* Turn on RIP mode */
  1958. od_control.user_rip = TRUE;
  1959. /* Since ANSI mode is present, AVATAR mode may */
  1960. /* also be available. Prompt the user for AVATAR. */
  1961. od_printf("\r\n\n");
  1962. od_printf("Does your system support AVATAR ");
  1963. od_printf("graphics? (Y/N)");
  1964. /* If the user chooses [Y]es */
  1965. if(od_get_answer("YN") == 'Y')
  1966. /* Turn on AVATAR mode */
  1967. od_control.user_avatar = TRUE;
  1968. }
  1969. od_printf("\r\n\n");
  1970. }
  1971. ===============================================================================
  1972. OpenDoors 6.00 Manual End of Page 49
  1973. OD_CHAT()
  1974. -------------------------------------------------------------------------------
  1975. PURPOSE Manually invokes sysop chat mode.
  1976. FORMAT void od_chat(void);
  1977. RETURNS N/A
  1978. DESCRIPTION Normally, the OpenDoors sysop chat mode will only be invoked
  1979. when the sysop explicitly requests it using the sysop chat key.
  1980. However, there may be some cases where you wish to manually
  1981. invoke the sysop chat mode. One example is when you are
  1982. replacing the OpenDoors built-in chat mode with your own, but
  1983. still wish to use the OpenDoors chat mode under some
  1984. circumstances. For instance, you may wish to use your own split-
  1985. screen chat routine if ANSI, AVATAR or RIP graphics mode is
  1986. available, and use the OpenDoors line-oriented chat mode if only
  1987. ASCII mode is available.
  1988. SEE ALSO od_page()
  1989. EXAMPLE For an example of using the od_chat() function, see the
  1990. ex_chat.c example door, which is described on page 38.
  1991. ===============================================================================
  1992. OpenDoors 6.00 Manual End of Page 50
  1993. OD_CARRIER()
  1994. -------------------------------------------------------------------------------
  1995. PURPOSE To determine the status of the carrier detect signal, in
  1996. programs where OpenDoors' internal carrier detection has been
  1997. disabled.
  1998. FORMAT BOOL od_carrier(void);
  1999. RETURNS TRUE if a carrier is present, or
  2000. FALSE if no carrier is present, or in local mode.
  2001. DESCRIPTION Usually, you will not have any use for the od_carrier()
  2002. function, as OpenDoors automatically monitor's the carrier
  2003. detect signal, and will correctly recover if the carrier detect
  2004. signal is lost while the door is operating in remote mode.
  2005. However, in some programs, you may wish to disable OpenDoors'
  2006. internal carrier detection routines, using the
  2007. od_control.od_disable variable. Two such cases in which you
  2008. might want to do this, are a call-back verification door, which
  2009. disconnects the user and attempts to call them back, or in a
  2010. terminal program, which is in fact not a door at all (and as
  2011. such you would not want to have OpenDoors exit when the carrier
  2012. detect signal is lost). In cases like these, you will then be
  2013. able to use the od_carrier() function in order to determine the
  2014. state of the carrier detect signal.
  2015. This function will return a Boolean value (for more information
  2016. on Boolean values, see the Glossary which begins on page 256),
  2017. of either TRUE or FALSE. If a carrier detect signal is present
  2018. when the function is called, it will return TRUE, and if no
  2019. carrier detect signal is detected, it will return FALSE. Since
  2020. there is no remote connection, and thus no carrier when
  2021. OpenDoors is operating in local mode, this function will always
  2022. return a value of FALSE in local mode.
  2023. SEE ALSO od_set_dtr()
  2024. EXAMPLE As an example of the use of this function, let us consider a
  2025. call back verification door, which hangs up on the user, and
  2026. then calls the user back at their entered phone number, in order
  2027. to verify the correctness of that number. This program would
  2028. probably contain a function that is responsible for
  2029. disconnecting the user, waiting for the connection to be broken,
  2030. and then phoning the user. At some point in this function,
  2031. likely just prior to the point where the function hangs up on
  2032. ===============================================================================
  2033. OpenDoors 6.00 Manual End of Page 51
  2034. the user, you would disable OpenDoors' internal carrier
  2035. detection, using the line:
  2036. od_control.od_disable |= DIS_CARRIERDETECT;
  2037. You would then want to have a piece of code which would simply
  2038. wait up to a given amount of time for the carrier signal to
  2039. drop. If this occurs, you would continue to place the call, and
  2040. if it does not occur, you would probably try your hangup
  2041. procedure one or two more times. In this example, the function
  2042. will return with a value of FALSE if the carrier signal does not
  2043. drop, and will return a value of TRUE if it does.
  2044. char hangup(void)
  2045. {
  2046. clock_t timer;
  2047. char to_return = FALSE;
  2048. od_set_dtr(FALSE); /* Hangup modem */
  2049. /* Wait up to 30secs */
  2050. timer = clock() + CLOCKS_PER_SEC * 30;
  2051. while(timer >= clock())
  2052. { /* If carrier has been lost, return with success */
  2053. if(!od_carrier())
  2054. {
  2055. to_return = TRUE;
  2056. break;
  2057. }
  2058. }
  2059. od_set_dtr(TRUE); /* Re-enable DTR signal */
  2060. return(to_return);
  2061. }
  2062. ===============================================================================
  2063. OpenDoors 6.00 Manual End of Page 52
  2064. OD_CLEAR_KEYBUFFER()
  2065. -------------------------------------------------------------------------------
  2066. PURPOSE Function to clear the input keyboard buffer
  2067. FORMAT void od_clear_keybuffer(void);
  2068. RETURNS N/A
  2069. DESCRIPTION OpenDoors maintains its own keyboard input buffer, in order to
  2070. permit the user to "type ahead" - to send input to the door
  2071. prior to the time when it is ready to process those key presses.
  2072. For example, the user could begin to type a command while a menu
  2073. is still being displayed, and when your door reaches the point
  2074. of inputting the menu command, the characters already typed by
  2075. the user will already be waiting for the OpenDoors input
  2076. functions. Note that the keyboard input buffer will include both
  2077. the keys hit by the user on-line, and the non-function keys (ie,
  2078. Alt-C will not appear in the OpenDoors keyboard buffer), hit by
  2079. the sysop. This allows both the user on-line and the sysop to
  2080. control the door at any time. If the sysop wishes to temporarily
  2081. prevent the user from having any control over the door, the
  2082. sysop may use the Alt-K (user-keyboard off) key. The key strokes
  2083. placed in the OpenDoors type-ahead buffer will be retrieved by
  2084. the od_get_key() and od_input_str() functions. The keyboard
  2085. buffer can contain a maximum of 64 user keystrokes in this
  2086. version of OpenDoors, after which any additional keystrokes will
  2087. simply be discarded by OpenDoors.
  2088. There are times, however, when you will want to erase any keys
  2089. that have been hit by the user, to prevent them from typing
  2090. ahead. For example, if your door has been busy doing some
  2091. processing for a few moments, they user may have been pressing
  2092. keys on their keyboard - perhaps in the hope that doing so will
  2093. speed things up. These keys will be waiting in the type-ahead
  2094. buffer, and if one of the keys the user entered was a valid
  2095. response to the next prompt in your door, the user may find that
  2096. they have accidentally made a choice they did not wish to. A
  2097. well designed door will simply erase the contents of the type-
  2098. ahead buffer after any long period of internal processing, etc.
  2099. Keep in mind that too much use of the od_clear_keybuffer()
  2100. function can be just as undesirable as not using it all, as
  2101. there are times when the presence of the keyboard buffer can
  2102. prove to be very useful for the user of a door.
  2103. To erase the contents of the type-ahead buffer, you simply call
  2104. the od_clear_keybuffer() function. This function takes no
  2105. parameters, and does not return any value.
  2106. ===============================================================================
  2107. OpenDoors 6.00 Manual End of Page 53
  2108. SEE ALSO od_get_key(), od_input_str(), od_edit_str()
  2109. EXAMPLE For one example of the use of the od_clear_keybuffer() function,
  2110. see the example program EX_VOTE.C, which is described beginning
  2111. on page 38. Below is another example of using this function. In
  2112. this case, we present a simple function, wait_for_return(),
  2113. which simply pauses for the user to press their [Enter]/[Return]
  2114. key. The function begins by displaying a prompt asking for the
  2115. [Enter] or [Return] key to be pressed. The function then clears
  2116. the keyboard input buffer, and waits until the user presses the
  2117. carriage return key, using the od_get_key() function. Note also
  2118. that this function will only continue if the user has pressed
  2119. the correct key. This is a good idea in all door programs, as it
  2120. allows your door to distinguish between a character pressed by
  2121. the user, and a "line noise" character.
  2122. void wait_for_return(void)
  2123. { /* Display prompt */
  2124. od_disp_str("Please Press [Enter] to continue...\n\r");
  2125. od_clear_keybuffer(); /* Clear keyboard buffer */
  2126. while(od_get_key(TRUE) != 13); /* Wait for Enter key */
  2127. }
  2128. ===============================================================================
  2129. OpenDoors 6.00 Manual End of Page 54
  2130. OD_CLR_LINE()
  2131. -------------------------------------------------------------------------------
  2132. PURPOSE Clears the rest of the current display line
  2133. FORMAT void od_clr_line(void);
  2134. RETURNS N/A
  2135. DESCRIPTION This function clears the line that the cursor is on, from the
  2136. cursor position to the end of the line. After the rest of the
  2137. line is cleared, the cursor is automatically returned to the
  2138. position it was at prior to issuing the command. Hence, if the
  2139. display line the cursor was located on looked as follows, with
  2140. the underscore (_) character representing the cursor position:
  2141. This is a_line of text!
  2142. With the cursor between the words "a" and "line", after the
  2143. od_clr_line command is issued, the line would appear as follows:
  2144. This is a_
  2145. With the cursor directly following the word "a". Note that this
  2146. function places a space character at the cursor location, and
  2147. every location up to the end of the line.
  2148. When the door is running in plain ASCII mode, this command will
  2149. simply clear the rest of the line by manually sending a series
  2150. of space and backspace characters. When ANSI, AVATAR or RIP
  2151. modes are active, the corresponding ANSI/AVATAR control sequence
  2152. will be sent in order to accomplish the line clear. Since the
  2153. graphics mode sequences are much shorter than the sequence that
  2154. would be required to clear the line manually, the use of this
  2155. function will cause your door's graphics to display much more
  2156. quickly when ANSI, AVATAR or RIP modes are active. Also note
  2157. that in ANSI, AVATAR or RIP graphics modes, the line will be
  2158. cleared with the currently selected color attribute. Thus, if
  2159. you wanted to place a blue background on a particular line, you
  2160. would use the od_set_color() (or od_set_attrib()) function, then
  2161. use the od_set_cursor() function to locate the cursor at the
  2162. beginning of the desired line, followed by the od_clr_line()
  2163. function. Just such a procedure is demonstrated in the example,
  2164. below.
  2165. SEE ALSO od_clr_scr(), od_set_cursor()
  2166. ===============================================================================
  2167. OpenDoors 6.00 Manual End of Page 55
  2168. EXAMPLE Below, is an example of a function that clears an entire line
  2169. with a specified color. Since this function performs operations
  2170. that require ANSI, AVATAR or RIP graphics mode, it should only
  2171. be used in a case where these modes are known to be available.
  2172. For example, this function would be useful in a full-screen
  2173. editor or viewer, or when performing ANSI animations. The
  2174. function accepts three parameters: the line to be cleared (where
  2175. 1 is the first line, 2 the second, and so on), the foreground
  2176. color of this line, and the background color of this line.
  2177. This function differs from the od_clr_line() function itself in
  2178. several important manners. First of all, this function clears
  2179. the entire line, whereas the od_clr_line() function can be used
  2180. to clear only the remaining characters of the line, after any
  2181. particular location. Also, as mentioned before, this function
  2182. selects a color to clear the line to, and moves the cursor to
  2183. the line which is to be cleared - neither of which is done by
  2184. the od_clr_line() function.
  2185. void clear_line(char line_number,char foreground,char
  2186. background)
  2187. {
  2188. od_set_cursor(line_number,1); /* move to correct line */
  2189. od_set_color(foreground,background); /* set color */
  2190. od_clr_line(); /* clear entire line */
  2191. }
  2192. ===============================================================================
  2193. OpenDoors 6.00 Manual End of Page 56
  2194. OD_CLR_SCR()
  2195. ------------------------------------------------------------------------------
  2196. PURPOSE The OpenDoors clear screen function
  2197. FORMAT void od_clr_scr(void);
  2198. RETURNS N/A
  2199. DESCRIPTION The od_clr_scr() function can be used to clear the output
  2200. screen. (ie, the user's screen and local screen with the
  2201. exception of the status line are cleared.) This function will
  2202. only clear the screen if screen clearing is enabled. If your
  2203. program will be running under BBS systems that do not pass the
  2204. user's screen clearing setting to the door, you may wish to
  2205. determine yourself whether or not the user's system supports
  2206. screen clearing codes, during the first time the user uses the
  2207. door. You will then be able to store this setting in a data
  2208. file. The example below demonstrates how to detect whether or
  2209. not the user's system supports screen clearing.
  2210. You should note that the ability for the user's terminal to
  2211. support screen clearing codes is independent of the user's ANSI
  2212. / AVATAR / RIP graphics mode settings.
  2213. For more information on the user's screen clearing setting,
  2214. please refer to the user_attrib variable in the OpenDoors
  2215. Control Structure chapter of this manual. If you wish to force a
  2216. screen clear, regardless of the user's screen clearing setting,
  2217. simply use the function call:
  2218. od_disp_emu("\xc", TRUE);
  2219. SEE ALSO od_clr_line()
  2220. EXAMPLE Below is an example of a function which determines whether or
  2221. not the user's system supports screen clearing. This function
  2222. will return a value of TRUE if screen clearing is supported, and
  2223. will return a value of FALSE if screen clearing is not
  2224. supported:
  2225. int user_supports_screen_clearing(void)
  2226. {
  2227. char answer;
  2228. /* display instructions to user */
  2229. od_disp_str("In order for this door to function\n\r");
  2230. od_disp_str("correctly, we must know whether or not\n\r");
  2231. ===============================================================================
  2232. OpenDoors 6.00 Manual End of Page 57
  2233. od_disp_str("your system supports screen clearing.\n\r");
  2234. od_disp_str("In a moment, we will attempt to clear\n\r");
  2235. od_disp_str(
  2236. "your screen in order to test your system's\n\r");
  2237. od_disp_str("capabilities.\n\r\n\r");
  2238. od_disp_str("Please press [Enter]/[Return] when you\n\r");
  2239. od_disp_str("are ready to perform this test.\n\r");
  2240. while(od_get_key(TRUE)!=13); /* wait for [Return] key */
  2241. od_clr_scr(); /* attempt to clear screen */
  2242. /* ask user if their screen cleared */
  2243. od_disp_str("Did your screen just clear? (Y/N)\n\r");
  2244. for(;;) /* loop until user chooses [Y]es or [N]o */
  2245. {
  2246. answer=od_get_key(TRUE); /* Get user's answer */
  2247. if(answer=='y' || answer=='Y') return(TRUE);
  2248. if(answer=='n' || answer=='N') return(FALSE);
  2249. }
  2250. }
  2251. ===============================================================================
  2252. OpenDoors 6.00 Manual End of Page 58
  2253. OD_COLOR_CONFIG()
  2254. -------------------------------------------------------------------------------
  2255. PURPOSE Parses a color configuration line from the configuration file,
  2256. generating a color attribute value.
  2257. FORMAT BYTE od_color_config(char *pszColorDesc);
  2258. RETURNS Color attribute value
  2259. DESCRIPTION This function will be of use if you are using the configuration
  2260. file system of OpenDoors, and wish to allow the sysop to specify
  2261. text colors to be used in your door. While OpenDoors
  2262. automatically recognizes color configuration settings for things
  2263. such as sysop chat mode and FILES.BBS listings, you may wish to
  2264. add additional color configuration options. In this case, you
  2265. could call the od_color_config() function from your custom line
  2266. function. For more information on the custom line function, see
  2267. the section on the OpenDoors configuration file system, which
  2268. begins on page 224.
  2269. To use this function, simply pass the configuration file line
  2270. you wish to have parsed to the function in it's single
  2271. parameter. The function will then return a color attribute value
  2272. in the same format that is used but the od_set_attrib()
  2273. function. Colors are specified using a string of the format:
  2274. {Flashing} {Bright} [foreground] on [background]
  2275. Where "Flashing" is an optional keyword indicating that the text
  2276. should be flashing. "Bright" is an optional keyword indicating
  2277. that the foreground color should be bright. Foreground is the
  2278. name of a foreground color, and background is the name of a
  2279. background color. Case (upper or lower) is not significant.
  2280. The color keywords are language configurable, using the array
  2281. od_control.od_color_names.
  2282. EXAMPLE See the example accompanying in the section on the OpenDoors
  2283. configuration file system, which begins on page 224.
  2284. ===============================================================================
  2285. OpenDoors 6.00 Manual End of Page 59
  2286. OD_DISP()
  2287. ------------------------------------------------------------------------------
  2288. PURPOSE Sends a buffer of text with optional local echo
  2289. FORMAT void od_disp(char *pachBuffer, INT nSize, BOOL bLocalEcho);
  2290. RETURNS N/A
  2291. DESCRIPTION This function allows you to send a buffer of text of any
  2292. specified length, with the option of enabling or disabling local
  2293. echo. You will probably have little use for this function -
  2294. instead you will most likely display strings using either the
  2295. od_disp_str() or od_printf() functions, depending on whether or
  2296. not you wish to use printf()'s formatting options. For a
  2297. breakdown of the uses of the various OpenDoors display
  2298. functions, see the description of the od_disp_str() function, on
  2299. page 63.
  2300. There are two cases when this function will come in useful:
  2301. 1.)If you wish to display a buffer of characters of known
  2302. length, which may contain null (ASCII 0) characters.
  2303. Since this character is used by the C language to
  2304. indicate the end of a string, the other two string
  2305. display functions (od_disp_str() and od_printf()) will
  2306. not send this character to the remote system.
  2307. 2.)If you wish to send text to the remote system without
  2308. having it displayed on the local screen, or if you wish
  2309. to send strings to the modem when it is in command
  2310. mode, without having these characters displayed on the
  2311. local screen.
  2312. The od_disp() function is called with three parameters. The
  2313. first parameter, pachBuffer, is a pointer to a buffer of
  2314. characters you wish to have displayed. The second parameter,
  2315. nSize, is simply the number of characters in the buffer to be
  2316. displayed. If the third parameter, bLocalEcho, is set to TRUE,
  2317. then all characters sent to the modem will also be displayed on
  2318. the local screen. If the third parameter is set to FALSE, then
  2319. the buffer will be sent to the modem without being echoed to the
  2320. sysop's screen.
  2321. SEE ALSO od_disp_str(), od_printf(), od_putch(), od_repeat(),
  2322. od_disp_emu()
  2323. ===============================================================================
  2324. OpenDoors 6.00 Manual End of Page 60
  2325. EXAMPLES The following are a few examples of the use of the od_disp()
  2326. function:
  2327. In order to display a single character, contained in the
  2328. variable "character", without echo to the local screen:
  2329. od_disp(&character,1,FALSE);
  2330. In order to send a command to the modem (only if you know that
  2331. the modem is in command mode), with the command contained in the
  2332. null-terminated string "string":
  2333. od_disp(string,strlen(string),FALSE);
  2334. In order to send exactly 5 characters from the buffer "buffer",
  2335. WITH echo to the local screen:
  2336. od_disp(buffer,5,TRUE);
  2337. ===============================================================================
  2338. OpenDoors 6.00 Manual End of Page 61
  2339. OD_DISP_EMU()
  2340. -------------------------------------------------------------------------------
  2341. PURPOSE Displays a string with ANSI/AVATAR terminal emulation
  2342. FORMAT void od_disp_emu(char *pszToDisplay, BOOL bRemoteEcho);
  2343. RETURNS N/A
  2344. DESCRIPTION The od_disp_emu() function allows you to display your own ANSI /
  2345. AVATAR graphics sequences. This function passes the characters
  2346. you wish to display to the OpenDoors terminal emulator, which is
  2347. fully documented in the description of the od_send_file()
  2348. function, on page 124. This function can be used to send these
  2349. control sequences to the user's terminal, and also have them
  2350. displayed on the local screen as they will appear to the user.
  2351. The string passed to od_disp_emu() contains any stream of text
  2352. to display, and may include both normal text and terminal
  2353. emulation control sequences. If the bRemoteEcho parameter is set
  2354. to TRUE, the string passed to od_disp_emu() will be sent to the
  2355. remote terminal in addition to being displayed locally. If this
  2356. parameter is set to FALSE, the string will only be displayed
  2357. locally.
  2358. Note that if you wish to display an entire file containing
  2359. ANSI/AVATAR/RIP graphics sequences (perhaps as your program's
  2360. menu or title screen), you can use the od_send_file() function.
  2361. SEE ALSO od_send_file(), od_disp(), od_disp_str() od_printf().
  2362. For a breakdown of the uses of the various OpenDoors display
  2363. functions, see the od_disp_str() function, on page 63.
  2364. EXAMPLE For an example of the use of the od_disp_emu() function, see the
  2365. SpaceRight() and MoveLeft() functions included in the example
  2366. program ex_ski.c.
  2367. ===============================================================================
  2368. OpenDoors 6.00 Manual End of Page 62
  2369. OD_DISP_STR()
  2370. -------------------------------------------------------------------------------
  2371. PURPOSE Displays a string to the screen (remote and local)
  2372. FORMAT od_disp_str(char *pszToDisplay);
  2373. RETURNS N/A
  2374. DESCRIPTION The two functions most often used for displaying strings within
  2375. a door are the od_disp_str() and od_printf() functions. The
  2376. od_printf() function allows for formatted output, whereas the
  2377. od_disp_str function simply displays the actual contents of the
  2378. string passed to it. If you wish to display a single character,
  2379. use the od_putch() function. If you wish to send a string or
  2380. buffer to the modem without local echo, use the od_disp()
  2381. function. If you wish to send a sequence of the same character
  2382. to the modem, the od_repeat() function will use graphics control
  2383. codes, if available to display the sequence much faster than
  2384. simply sending the same character in repetition. Also, if you
  2385. wish to send ANSI, AVATAR or RIP graphics control codes, and
  2386. have them emulated on the local screen, use the od_disp_emu()
  2387. function.
  2388. The od_disp_str() function displays the contents of the null-
  2389. terminated string pointed to by *string. Display is sent to both
  2390. the local screen and modem (presuming the door is not running in
  2391. local mode).
  2392. An important thing to keep in mind when using the od_disp_str()
  2393. function, is that you should use "/n/r" instead of simply "/n"
  2394. for a new line. This is due to the fact that terminal programs
  2395. usually require a carriage-return line-feed sequence (/n/r),
  2396. instead of just a line-feed (/n). For example, instead of using:
  2397. od_disp_str("Hello world!\n");
  2398. You should use:
  2399. od_disp_str("Hello world!\n\r");
  2400. To change the cursor color or location of output with the
  2401. od_disp_str() function, refer to the od_set_cursor() and the
  2402. od_set_attrib() functions.
  2403. SEE ALSO od_disp(), od_printf(), od_putch(), od_repeat(), od_disp_emu()
  2404. ===============================================================================
  2405. OpenDoors 6.00 Manual End of Page 63
  2406. EXAMPLES Below are a few examples of various uses of the od_disp_str()
  2407. function:
  2408. Displaying three string constants on separate lines:
  2409. od_disp_str("This is an example\n\r");
  2410. od_disp_str("of the OpenDoors\n\r");
  2411. od_disp_str("od_disp_str() function\n\r");
  2412. Displaying three string constants on the same line:
  2413. od_disp_str("Another ");
  2414. od_disp_str("od_disp_str() ");
  2415. od_disp_str("example\n\r");
  2416. Displaying a string variable:
  2417. char string[80];
  2418. strcpy(string,"This is a string!\n\r");
  2419. od_disp_str(string);
  2420. ===============================================================================
  2421. OpenDoors 6.00 Manual End of Page 64
  2422. OD_DRAW_BOX()
  2423. -------------------------------------------------------------------------------
  2424. PURPOSE Draws a box on the screen in ANSI, AVATAR or RIP graphics modes.
  2425. FORMAT BOOL od_draw_box(BYTE btLeft, BYTE btTop, BYTE btRight, BYTE
  2426. btBottom);
  2427. RETURNS TRUE on success, FALSE on failure
  2428. DESCRIPTION This function is for use in ANSI, AVATAR or RIP graphics modes.
  2429. This function will draw a box in the current display attribute,
  2430. at the specified location on the screen. The boarder of the box
  2431. is made up of the characters specified in the od_control.
  2432. od_box_chars[] array. If AVATAR graphics mode is available, this
  2433. function uses AVATAR control codes to display the box in less
  2434. than 1/10 the length of time required to display the box in ANSI
  2435. mode.
  2436. The first two parameters of this function, btLeft and btTop,
  2437. specify the coordinates of the top, left-hand corner of the box
  2438. to be draw. The third and fourth parameters, btRight and
  2439. btBottom, specify the coordinates of the bottom, left-hand
  2440. corner of the box. Like the values passed to the od_set_cursor()
  2441. function, these coordinates are relative to the upper left-hand
  2442. corner of the screen, with the position (1,1) being this corner.
  2443. As mentioned above, this function will display the window in the
  2444. current text color. Thus, before calling this function, you
  2445. should use either the od_set_color() or the od_set_attrib()
  2446. function to specify the color in which you would like to have
  2447. the window displayed.
  2448. Normally, the boarder of the window will be displayed using the
  2449. IBM extended ASCII characters which produce a single line
  2450. boarder. However, you may wish to have the boarder displayed
  2451. using different characters. In this case, the characters used to
  2452. display the boarder can be specified by the od_control.
  2453. od_box_chars variable, described in the OpenDoors control
  2454. structure section of this manual.
  2455. SEE ALSO od_set_color(), od_set_attrib(), od_clr_scr(), od_edit_str(),
  2456. od_set_cursor()
  2457. EXAMPLE As an example of the use of the od_draw_box() function in
  2458. conjunction with the od_edit_str() function, we show a portion
  2459. of a program which displays a window, and allows the user to
  2460. input the name of a file they would like to upload, a
  2461. ===============================================================================
  2462. OpenDoors 6.00 Manual End of Page 65
  2463. description of the file, and whether they want it to be a
  2464. private upload. The user is able to move among fields using the
  2465. tab key, and select a "continue" button when they are finished.
  2466. The function returns TRUE if the user selects continue, and
  2467. FALSE if the user presses [ESCape].
  2468. // Main "dialog box" function
  2469. int get_information(char *filename, char *description,
  2470. char *private)
  2471. {
  2472. char current_field=1; // Currently selected field
  2473. int choice; // User's choice
  2474. od_set_color(L_WHITE,D_BLUE); // Display window
  2475. od_draw_box(10,5,70,13);
  2476. od_set_cursor(5,25); // Display window title
  2477. od_set_color(L_GREEN,D_BLUE);
  2478. od_disp_str(" ENTER FILENAME INFORMATION ");
  2479. od_set_color(L_CYAN,D_BLUE); // Display fields and titles
  2480. od_set_cursor(6,15);
  2481. od_disp_str("FILENAME : ");
  2482. od_repeat(176,13);
  2483. od_set_cursor(7,12);
  2484. od_disp_str("DESCRIPTION : ");
  2485. od_repeat(176,43);
  2486. od_set_cursor(8,16);
  2487. od_disp_str("PRIVATE : ");
  2488. od_repeat(176,2);
  2489. draw_button();
  2490. filename[0]='\0'; // Blank out contents of input variables
  2491. description[0]='\0';
  2492. private[0]='\0';
  2493. for(;;) // Main dialog box loop
  2494. {
  2495. if(current_field==4) // If field is the button
  2496. {
  2497. od_set_color(L_GREEN,D_BLUE); // Highlight button
  2498. draw_button();
  2499. do // Loop until user presses [TAB], [ENTER], or [ESC]
  2500. {
  2501. choice=od_get_key(TRUE);
  2502. } while(choice!=9 && choice!=13 && choice!=27);
  2503. od_set_color(L_CYAN,D_BLUE); // Un-highlight button
  2504. draw_button();
  2505. if(choice==13) return(TRUE); // If [ENTER] was pressed
  2506. ===============================================================================
  2507. OpenDoors 6.00 Manual End of Page 66
  2508. if(choice==27) return(FALSE); // If [ESC] was pressed
  2509. current_field=1; // Otherwise, [TAB] was pressed
  2510. }
  2511. switch(current_field) // According to selected field
  2512. { // Input from the appropriate line
  2513. case 1:
  2514. choice=od_edit_str(filename,"FFFFFFFFFFFF",6,26,
  2515. 0x1b,0x1a,176,
  2516. EDIT_FLAG_EDIT_STRING|
  2517. EDIT_FLAG_ALLOW_CANCEL|
  2518. EDIT_FLAG_FIELD_MODE|
  2519. EDIT_FLAG_KEEP_BLANK);
  2520. break;
  2521. case 2:
  2522. choice=od_edit_str(description,
  2523. "*******************",
  2524. 7,26,0x1b,0x1a,176,
  2525. EDIT_FLAG_EDIT_STRING|
  2526. EDIT_FLAG_ALLOW_CANCEL|
  2527. EDIT_FLAG_FIELD_MODE|
  2528. EDIT_FLAG_KEEP_BLANK);
  2529. break;
  2530. case 3:
  2531. choice=od_edit_str(private,"Y",8,26,
  2532. 0x1b,0x1a,176,
  2533. EDIT_FLAG_EDIT_STRING|
  2534. EDIT_FLAG_ALLOW_CANCEL|
  2535. EDIT_FLAG_FIELD_MODE);
  2536. }
  2537. // If user pressed [ESCape]
  2538. if(choice==EDIT_RETURN_CANCEL) return(FALSE);
  2539. // If user choice to go to previous field
  2540. if(choice==EDIT_RETURN_PREVIOUS)
  2541. {
  2542. if(current_field==1) // If at first field
  2543. current_field=4; // Go to last field
  2544. else // If not at first field
  2545. --current_field; // Go to previous field
  2546. }
  2547. else // If user chose next field
  2548. ++current_field; // Go to next field
  2549. }
  2550. }
  2551. void draw_button(void) // Function to display the button
  2552. {
  2553. od_draw_box(12,10,23,12); // Draw box for button
  2554. od_set_cursor(11,14);
  2555. od_disp_str("Continue"); // Display text in button
  2556. }
  2557. ===============================================================================
  2558. OpenDoors 6.00 Manual End of Page 67
  2559. OD_EDIT_STR()
  2560. -------------------------------------------------------------------------------
  2561. PURPOSE Allows you to perform formatted input with full line editing
  2562. features, etc., in ANSI/AVATAR/RIP graphics mode.
  2563. FORMAT WORD od_edit_str(char *pszInput, char *pszFormat, INT nRow,
  2564. INT nColumn, BYTE btNormalColor, BYTE btHighlightColor,
  2565. char chBlank, WORD nFlags);
  2566. RETURNS This function will return one of the following values:
  2567. EDIT_RETURN_ERROR Indicates that an error has occurred,
  2568. and the edit function was unable to
  2569. run. This will occur if there is an
  2570. error in one of the parameters, or if
  2571. ANSI/AVATAR/RIP graphics is not
  2572. available
  2573. EDIT_RETURN_CANCEL Indicates that the user pressed the
  2574. cancel key [ESC], and that the string
  2575. was left unaltered.
  2576. EDIT_RETURN_ACCEPT Indicates that the user pressed the
  2577. accept key [Enter], or that the auto-
  2578. enter feature was activated.
  2579. EDIT_RETURN_PREVIOUS Indicates that the user wishes to move
  2580. to the previous field, by pressing [UP
  2581. ARROW], [SHIFT]-[TAB], etc.
  2582. EDIT_RETURN_NEXT Indicates that the user wishes to move
  2583. to the next field, by pressing [DOWN
  2584. ARROW], [TAB], etc.
  2585. DESCRIPTION To perform string input within OpenDoors, one of two functions
  2586. can be used, od_input_str() and od_edit_str(). The first
  2587. function, od_input_str(), allows simple line input and editing,
  2588. and can be used in ASCII, ANSI, AVATAR and RIP modes. The second
  2589. function, od_edit_str(), allows many formatted input options,
  2590. advanced line editing, and other features, but requires the use
  2591. of ANSI, AVATAR or RIP terminal modes.
  2592. As mentioned above, the od_edit_str() function allows for
  2593. advanced line editing, such as inputting and deleting text from
  2594. the middle of the string (whereas the od_input_str() function
  2595. only allows editing from the end of the string, such as
  2596. backspacing to erase a mistake). The edit functions available
  2597. from the od_edit_str() are listed below. Note that some of these
  2598. ===============================================================================
  2599. OpenDoors 6.00 Manual End of Page 68
  2600. functions may or may not be available, depending upon the
  2601. capabilities of the user's terminal program. While there is no
  2602. single standard used for the transmission of special edit keys
  2603. such as the arrow keys, the od_edit_str() function makes as much
  2604. effort as possible to make all of the edit features available to
  2605. most terminal programs. Many of the edit functions can be
  2606. accesses using either [CONTROL]-key combinations or special keys
  2607. such as the arrow keys, delete key, and so on. OpenDoors will
  2608. recognize most of these special control keys when sent as either
  2609. an ANSI control sequence (which is sent by most terminal
  2610. programs), or as a DoorWay style scan code / ASCII code sequence
  2611. (which is also available from many terminal programs, but is not
  2612. usually required). The od_edit_str() edit functions are as
  2613. follows. Note that all edit functions are always available from
  2614. the local keyboard.
  2615. HOME - Moves the cursor to the beginning of the line being
  2616. edited. Press the [HOME] key, either in DoorWay mode
  2617. or from the local keyboard.
  2618. END - Moves the cursor to the end of the line being edited.
  2619. Press the [END] key, either in DoorWay mode or from
  2620. the local keyboard.
  2621. DELETE CHARACTER - Deletes the character under the cursor. Press
  2622. [DELete] on the local keyboard, in DoorWay mode, and
  2623. under many terminal programs without DoorWay mode.
  2624. Alternatively, press [CONTROL]-[G].
  2625. BACKSPACE - Deletes the character left of the cursor. Press
  2626. [BACKSPACE] or [CONTROL]-[H].
  2627. TOGGLE INSERT MODE - Switches the od_edit_str() function between
  2628. insert mode and overwrite mode. Press [INSert], either
  2629. in DoorWay mode, or from the local keyboard.
  2630. Alternatively, press [CONTROL]-[V].
  2631. CURSOR LEFT - Moves the cursor left one character. Press [LEFT
  2632. ARROW] on the local keyboard, in DoorWay mode, and
  2633. under many terminal programs without DoorWay mode.
  2634. Alternatively, press [CONTROL]-[S].
  2635. CURSOR RIGHT - Moves the cursor right one character. Press
  2636. [RIGHT ARROW] on the local keyboard, in DoorWay mode,
  2637. and under many terminal programs without DoorWay mode.
  2638. Alternatively, press [CONTROL]-[D].
  2639. ERASE ENTIRE LINE - Press [CONTROL]-[Y].
  2640. ACCEPT INPUT - Press the [ENTER] / [RETURN] line to accept the
  2641. input. Alternatively, press [CONTROL]-[Z]. Note that
  2642. this key will only work when the current input is
  2643. ===============================================================================
  2644. OpenDoors 6.00 Manual End of Page 69
  2645. "valid" (ie, it conforms to the format string, which
  2646. is described below)
  2647. CANCEL INPUT - Only available if specifically enabled on the
  2648. od_edit_str() command line. Press [ESCape].
  2649. NEXT FIELD - If enabled, allows the user to move to the next
  2650. field in a dialog box / form. Press [DOWN ARROW] in
  2651. DoorWay mode and under many terminal programs without
  2652. DoorWay mode. Alternatively, press [TAB]. Note that
  2653. the [DOWN ARROW] key is NOT usually available from the
  2654. local keyboard, as it is usually used to adjust the
  2655. user's remaining time.
  2656. PREVIOUS FIELD - If enabled, allows the user to move to the
  2657. previous field in a dialog box / form. Press [UP
  2658. ARROW] in DoorWay mode and under many terminal
  2659. programs without DoorWay mode. Alternatively, press
  2660. [SHIFT]-[TAB] on the local keyboard or in DoorWay
  2661. mode. Again, note that the [UP ARROW] key is NOT
  2662. usually available from the local keyboard, as it is
  2663. usually used to adjust the user's remaining time.
  2664. Let us now look at the parameters which the od_edit_str()
  2665. function accepts. The first parameter, pszInput, is a pointer to
  2666. the string where the user's input should be stored. It is
  2667. important that this string be long enough to accommodate the
  2668. longest input your format string will permit, including the '\0'
  2669. C string terminator (ie, the string should be one character
  2670. greater than the length of the format string, not including the
  2671. format string's ' and " characters).
  2672. The second parameter, pszFormat, is a pointer to a string which
  2673. specifies the format and maximum length of the input the
  2674. od_edit_str() function should accept. Using the format string,
  2675. not only do you specify the length of the input field, but you
  2676. can also force the user's input into certain formats. For
  2677. example, if you wished to input a North American style phone
  2678. number, you could use a format string of "###-###-####". Then
  2679. regardless of whether the user typed any dash character or not,
  2680. their input would be converted, as they type, to the format of
  2681. the phone number 613-599-5554. You could also specify a format
  2682. string such of "MMMMMMMMMMMMMMMMMMMMMMMMMMMMMM", which would
  2683. permit the user to enter a name of up to 30 characters. Note
  2684. that since the cursor can be moved to the position immediately
  2685. following the last character, a the input field for a 30
  2686. character string will occupy 31 columns on the screen. The
  2687. od_edit_str() function would then automatically capitalize the
  2688. name, so that the first character of each word is capitalized,
  2689. and the remain characters of the word is in lower case. Even if
  2690. the user were to move the cursor to the middle of the string
  2691. ===============================================================================
  2692. OpenDoors 6.00 Manual End of Page 70
  2693. they had entered, and add or delete a space (and thus either
  2694. make one work two or two words one), od_edit_str() would re-
  2695. format the string to reflect the change. The valid characters
  2696. for the format sting, along with their meanings, are listed
  2697. below. Note that the format string is NOT case sensitive (except
  2698. for literal strings delimited by the '' or "" characters), and
  2699. space characters can be added at any point to increase
  2700. legibility.
  2701. # Indicates that numeric characters from '0' to '9' are valid
  2702. for this position
  2703. % Indicates that numeric characters from '0' to '9', and the
  2704. space character (' ') are valid for this position.
  2705. 9 Indicates that numeric characters from '0' to '9', along
  2706. with '.', '-' and '+' are valid for this position. This
  2707. format style is intended for floating-point numeric input.
  2708. ? Indicates that any character is valid for this position.
  2709. * Indicates that any printable character, from ASCII 32 to
  2710. ASCII 127, is valid for this position.
  2711. A Indicates that alphabetical characters 'A' to 'Z', 'a' to
  2712. 'z' and space (' ') are valid for this position.
  2713. C Indicates that city name characters are valid for this
  2714. position. As with the 'M' format character, words are
  2715. automatically capitalized so that the first letter is in
  2716. upper case, and all subsequent letters are in lower case.
  2717. In addition to permitting alphabetical characters and the
  2718. space (' ') character, the ',' and '.' characters are also
  2719. accepted in this position.
  2720. D Indicates that date characters '0' to '9', '-' and '/' are
  2721. valid for this position.
  2722. F Indicates that MS-DOS filename characters are valid for
  2723. this position.
  2724. H Indicates that hexidecimal character '0' to '9', 'A' to 'F'
  2725. and 'a' to 'f' are valid for this position.
  2726. L Indicates that only lower case alphabetical characters 'a'
  2727. to 'z', and the space (' ') character is valid for this
  2728. position. However, if the user attempts to enter an upper
  2729. case alphabetical character in this position, it will
  2730. automatically be converted to the lower case equivalent.
  2731. M Indicates that name characters are valid for this position.
  2732. These characters are the alphabetical characters 'A' to
  2733. ===============================================================================
  2734. OpenDoors 6.00 Manual End of Page 71
  2735. 'Z', 'a' to 'z', and the space character (' '). A
  2736. character's case is converted such that the first character
  2737. of a word is in upper case, and all other letters are in
  2738. lower case.
  2739. T Indicates that telephone number character '0' to '9', '(',
  2740. ')', '-' and ' ' are valid for this position.
  2741. U Indicates that only upper case alphabetical characters 'A'
  2742. to 'Z', and the space (' ') character is valid for this
  2743. position. However, if the user attempts to enter a lower
  2744. case alphabetical character in this position, it will
  2745. automatically be converted to the upper case equivalent.
  2746. W Indicates that MS-DOS filename characters are permitted in
  2747. this position, including the '*' and '?' wildcard
  2748. characters.
  2749. X Indicates that alphanumeric characters 'A' to 'Z', 'a' to
  2750. 'z', '0' to '9' and ' ' are valid for this position.
  2751. Y Indicates that yes/no characters 'Y', 'N', 'y', 'n' are
  2752. valid for this position. The characters are automatically
  2753. converted to upper case.
  2754. '/" Single or double quotes can be used to specify sequences of
  2755. characters that should appear at the same location in the
  2756. input string (referred to elsewhere as "literal strings").
  2757. When the user is entering the string, these characters are
  2758. automatically supplied, and the user is not required to
  2759. type them. Literal strings must begin and end with the same
  2760. quote character. Remember that the double quote (")
  2761. character must be imbedded in C strings by preceding the
  2762. quote character with a \ (backslash) character.
  2763. The third and fourth parameters, nRow and nColumn specify the
  2764. location on the screen where the first (left most) character of
  2765. the input field should be located. These parameters are
  2766. identical to the nRow and nColumn parameters passed to the
  2767. od_set_cursor() function. In other words, nRow specifies the
  2768. line number on the screen, where 1 is the first line, and
  2769. nColumn specifies the column across the screen, where 1 is the
  2770. first column.
  2771. The fifth and sixth parameters, btNormalColor and
  2772. btHighlightColor, allow you to specify the color of the input
  2773. field. The fifth parameter, btNormalColor, specifies the color
  2774. of the input field when input is not taking place and the sixth
  2775. parameter, btHighlightColor, specifies the color of the field
  2776. while input is taking place. Thus, if you had several input
  2777. fields on the screen at one time, you would be able to make is
  2778. easier for the user to identify the currently active field by
  2779. ===============================================================================
  2780. OpenDoors 6.00 Manual End of Page 72
  2781. having the field currently accepting input highlighted in a
  2782. color distinct from the other fields. When the od_edit_str()
  2783. function begins, it will change the current color of the field
  2784. from the normal color to the highlighted color. Then, when the
  2785. od_edit_str() function exits, it will change the current color
  2786. of the field back to its normal color. If you do not wish to
  2787. have the field highlighted, you can set both of these parameters
  2788. to the same value, and disable field re-drawing by using the
  2789. eighth parameter, flags.
  2790. The seventh parameter accepted by the od_edit_str() function,
  2791. chBlank, will serve one of two purposes. Normally, this
  2792. parameter will specify a background character to display in the
  2793. unfilled portion at the end of the input field. This can be set
  2794. to a character, such as the ASCII 177 grey block character, to
  2795. produce a visual background to the field. Doing this will show
  2796. the user visually how long the field is, and how many character
  2797. they will be permitted to type into the field. Normally, this
  2798. field will be displayed during input, and removed when the
  2799. od_edit_str() function exits. However, you may cause the
  2800. background to remain in place using the eighth parameter, flags.
  2801. If you do not wish to have this "background" visual field
  2802. effect, simply set the character parameter to a space (ASCII
  2803. 32). In password input mode, this parameter will instead specify
  2804. the character to display in place of characters typed by the
  2805. user. In this case, the background display character defaults to
  2806. the space (ASCII 32) character.
  2807. The eighth, and last, parameter accepted by the od_edit_str()
  2808. function is the nFlags parameter. This parameter is a bit-mapped
  2809. flags variable which allows you to control special features of
  2810. the od_edit_str() function. More than one of these settings may
  2811. be specified by listing a chain of the values, separated by the
  2812. bitwise-or (|) operator. If you do not wish to turn on any of
  2813. these modes, simply pass the EDIT_FLAG_NORMAL value as the flags
  2814. parameter.
  2815. EDIT_FLAG_NORMAL - Default setting, use this value of none of
  2816. the other flags below are active.
  2817. EDIT_FLAG_NO_REDRAW - When set, prevents the od_edit_str()
  2818. function from re-drawing the input string and field
  2819. when it starts up and exits. If you set this flag, the
  2820. normal color and highlight color should contain the
  2821. same value. If background character (the character
  2822. parameter) is not a space (ASCII 32) character, you
  2823. must draw the field background prior to calling
  2824. od_edit_str(). Also, if you are calling od_edit_str()
  2825. with the EDIT_FLAG_EDIT_STRING flag set, you must
  2826. display the existing string in the field prior to
  2827. calling od_edit_str().
  2828. ===============================================================================
  2829. OpenDoors 6.00 Manual End of Page 73
  2830. EDIT_FLAG_FIELD_MODE - Setting this flag specifies that
  2831. od_edit_str() should operate in field input mode. In
  2832. field input mode, the user may finish entering their
  2833. input by pressing the previous field or next field
  2834. button (arrow keys, tab keys, etc.), as described
  2835. above. If the user chooses to finish and accept their
  2836. input by pressing one of these keys, the od_edit_str()
  2837. return value will reflect which choice they made. This
  2838. will allow you to make it possible for the user to
  2839. move between a number of input fields in a form /
  2840. dialog box, as demonstrated in the example
  2841. accompanying the od_draw_box() function.
  2842. EDIT_FLAG_EDIT_STRING - Setting this flag specifies that
  2843. od_edit_str() should edit a pre-existing string,
  2844. instead of starting with a blank string. In this case,
  2845. the input_string parameter MUST point to an
  2846. initialized string. This string may either contain
  2847. some text, or be empty, but od_edit_str() will expect
  2848. to find a string terminator ('\0') character, and will
  2849. begin editing the contents of the string prior to that
  2850. character. If you do not set the EDIT_FLAG_EDIT_STRING
  2851. flag, the previous contents of the input_string
  2852. parameter is not significant, as od_edit_str() will
  2853. automatically start with a blank string.
  2854. EDIT_FLAG_STRICT_INPUT - Setting this flag causes the
  2855. od_edit_str() function to operate in "strict" input
  2856. mode, which may be desirable if your input format
  2857. contains more than one type of input. Normally, if you
  2858. were inputting such a string, the user would be able
  2859. to move to the middle of the string, and insert any
  2860. text. Doing so would cause the rest of the input line
  2861. to shift right. However, in cases where your format
  2862. string specifies different types of character to be
  2863. permitted in different positions, this can cause the
  2864. input to be changed so that it no longer conforms to
  2865. the format string. In this case, the user's input will
  2866. no longer be valid, and the user will not be able to
  2867. exit the function by pressing [ENTER] (although
  2868. [ESCAPE] will still be available, if you activated it)
  2869. until they change their input. However, when strict
  2870. input mode is turned on, od_edit_str() will restrict
  2871. the ways in which the user is permitted to edit the
  2872. string, to prevent just such a case from occurring.
  2873. EDIT_FLAG_PASSWORD_MODE - Setting this flag causes the
  2874. od_edit_str() function to operate in "password" mode.
  2875. In password mode, the characters typed by the user
  2876. will be hidden, displayed instead as the blank
  2877. character specified in the "character" parameter.
  2878. ===============================================================================
  2879. OpenDoors 6.00 Manual End of Page 74
  2880. EDIT_FLAG_ALLOW_CANCEL - When this flag is set, the user will be
  2881. able to cancel their current input and abort the
  2882. editing process by pressing their [ESCAPE] key. When
  2883. they do so, any changes they have made to the input
  2884. field will be canceled, and replaced by the original
  2885. contents of the string. The od_edit_str() function
  2886. will then exit, indicating that the user has canceled
  2887. their input.
  2888. EDIT_FLAG_FILL_STRING - When set, this flag will force the user
  2889. to enter a string that fills the entire length of the
  2890. format string. Normally, the user will be able to
  2891. enter a string of any length up to the maximum length
  2892. specified by the format string. However in some cases,
  2893. such as when inputting a date, you will want to have
  2894. the input field filled. (Otherwise, the user would be
  2895. able to enter only the first part of the date.)
  2896. EDIT_FLAG_AUTO_ENTER - When set, this flag will cause the
  2897. od_edit_str() function to automatically simulate
  2898. pressing of the [ENTER] key when the string is filled.
  2899. This can be used to cause the od_edit_str() function
  2900. to finish inputting as soon as a valid string is
  2901. entered, instead of having to wait for the user to
  2902. press [ENTER] / [RETURN].
  2903. EDIT_FLAG_AUTO_DELETE - When set, along with the
  2904. EDIT_FLAG_EDIT_STRING flag, this flag will activate
  2905. the auto-delete feature of the od_edit_str() function.
  2906. When auto-delete is active, if the first key pressed
  2907. by the user is not an edit control key, the existing
  2908. text will automatically be deleted, and a totally new
  2909. string accepted from the user. This could be useful
  2910. when you are allowing the user to go back to edit a
  2911. previous input. If the user wishes to only change part
  2912. of the old string, they can move the cursor to the
  2913. location where they wish to make the change, and
  2914. perform their editing. However, if the user wishes to
  2915. completely replace the old string with a new one, they
  2916. can simply begin to type, and the old string will
  2917. automatically be deleted, and the new string accepted.
  2918. EDIT_FLAG_KEEP_BLANK - Normally, OpenDoors will only display the
  2919. input field background (as passed in the "character"
  2920. parameter) while the user is editing the string, and
  2921. will remove it when the od_edit_str() function exits.
  2922. However, you may wish to continue having this field
  2923. displayed after input has taken place, and the
  2924. od_edit_str() function has exited. In this case,
  2925. setting this flag will cause the background characters
  2926. to remain visible after input has finished.
  2927. ===============================================================================
  2928. OpenDoors 6.00 Manual End of Page 75
  2929. EDIT_FLAG_PERMALITERAL - When the format string contains literal
  2930. characters (such as forcing a ':' character to be
  2931. added to a time input by using the format string
  2932. "##':'##':'##"), the od_edit_str() function can
  2933. operate in one of two modes. In the default mode, the
  2934. literal characters will only be displayed when they
  2935. have been automatically added to the string. For
  2936. instance, if you were inputting the current time using
  2937. the above format string, this mode would result in the
  2938. input field initially being blank. When the user types
  2939. the first digit of the time, that number would appear.
  2940. When the user types the second digit of the time, that
  2941. number will appear, and then the colon character will
  2942. automatically be added by OpenDoors. However, you can
  2943. also set the od_edit_str() function to operate in
  2944. "PermaLiteral" mode, by setting this flag. When the
  2945. EDIT_FLAG_PERMALITERAL flag is set, the input field
  2946. will initially contain the literal characters (ie, the
  2947. colons in our example), with the cursor still located
  2948. at the leftmost position in the input field. In this
  2949. mode, the literal character become a permanent part of
  2950. the input field, and can not be moved or deleted by
  2951. the user - instead the cursor simply skips over the
  2952. literal character's position.
  2953. EDIT_FLAG_LEAVE_BLANK - This flag applies to the special case
  2954. where the first character or characters of the format
  2955. string are literals. By default, the od_edit_str()
  2956. function will always return a string containing at
  2957. least these first literal characters. However, you can
  2958. alter this behaviors by setting this flag. When set,
  2959. if no non-literal characters have been entered in the
  2960. string, od_edit_str() will return an empty string.
  2961. EDIT_FLAG_SHOW_SIZE - Normally, od_edit() adds an extra blank to
  2962. the end of the input field, to give the cursor a space
  2963. to move into when the field is full. However, you may
  2964. prefer to have the input field be shown as exactly the
  2965. maximum size of input that is permitted. Setting
  2966. EDIT_FLAG_SHOW_SIZE does just this. In this case, the
  2967. cursor will be positioned immediately past the end of
  2968. the input field when the maximum number of characters
  2969. have been entered.
  2970. SEE ALSO od_input_str(), od_get_char(), od_clear_keybuffer()
  2971. EXAMPLE Below are several examples of typical uses of the od_edit_str()
  2972. function. For the sake of simplicity, all of these examples
  2973. perform their input beginning at the top, left hand corner of
  2974. the screen, and store the user's input in the string variable
  2975. ===============================================================================
  2976. OpenDoors 6.00 Manual End of Page 76
  2977. named "string". For an example of the user of the od_edit_str()
  2978. function in a dialog-box / form entry application, see the
  2979. example accompanying the od_draw_box() function.
  2980. To input a name with a maximum of 25 characters, having the
  2981. first letter of each word automatically capitalized:
  2982. od_edit_str(string, "MMMMMMMMMMMMMMMMMMMMMMMMM", 1, 1,
  2983. 0x03, 0x21, 176, EDIT_FLAG_NORMAL);
  2984. To input a North American style phone number, requiring that all
  2985. digits be filled, and running in "strict input" mode:
  2986. od_edit_str(string, "###'-'###'-'####",
  2987. 1, 1, 0x03, 0x21, 176,
  2988. EDIT_FLAG_FILL_STRING|
  2989. EDIT_FLAG_STRICT_INPUT);
  2990. To allow the user to edit a previously entered 20 character
  2991. string, with auto-delete mode on. Any characters will be
  2992. permitted in the string. Remember that when the
  2993. EDIT_FLAG_EDIT_STRING flag is set, the string must be
  2994. initialized prior to calling the od_edit_str() function.
  2995. od_edit_str(string, "????????????????????",
  2996. 1, 1, 0x03, 0x21, 176,
  2997. EDIT_FLAG_EDIT_STRING|
  2998. EDIT_FLAG_AUTO_DELETE);
  2999. To input a password of up to 16 characters from the user. Here,
  3000. the password will only be permitted to contain upper case
  3001. characters, and the od_edit_str() password mode is used, with a
  3002. small block displayed in place of any characters typed:
  3003. od_edit_str(string, "UUUUUUUUUUUUUUUU",
  3004. 1, 1, 0x03, 0x21, 254,
  3005. EDIT_FLAG_PASSWORD_MODE);
  3006. To input a two-digit number from the user, requiring that both
  3007. digits be filled, and automatically accepting the input after
  3008. the two digits have been entered (not requiring the user to
  3009. press [ENTER]):
  3010. od_edit_str(string, "##", 1, 1, 0x03, 0x21, 176,
  3011. EDIT_FLAG_FILL_STRING|
  3012. EDIT_FLAG_AUTO_ENTER);
  3013. To input a filename to download, as a field in a dialog box.
  3014. Here, the filename will be permitted to contain valid filename
  3015. characters, and the od_input_str() function will operate in
  3016. field mode, with the cancel [ESCape] key enabled. Also, string
  3017. ===============================================================================
  3018. OpenDoors 6.00 Manual End of Page 77
  3019. edit mode will be enabled, allowing the user to edit a
  3020. previously entered line, and the EDIT_FLAG_KEEP_BLANK flag will
  3021. be set, causing the field background to remain displayed after
  3022. the user exits. This time, however, auto-delete mode will not be
  3023. used. Note that this combination of parameters expects that the
  3024. field and it's contents will have already been displayed, prior
  3025. to calling the od_edit_str() function.
  3026. od_edit_str(string, "WWWWWWWWWWWW",
  3027. 1, 1, 0x03, 0x21, 176,
  3028. EDIT_FLAG_EDIT_STRING|
  3029. EDIT_FLAG_FIELD_MODE|
  3030. EDIT_FLAG_ALLOW_CANCEL|
  3031. EDIT_FLAG_KEEP_BLANK);
  3032. To input a string without the field background and line
  3033. redrawing before and after input takes place:
  3034. od_edit_str(string, "******************************",
  3035. 1, 1, 0x07, 0x07, ' ',
  3036. EDIT_FLAG_NO_REDRAW);
  3037. To input a date, using PermaLiteral mode. Here, the month is
  3038. entered by a three digit short form ("JAN", "FEB", etc.), and
  3039. the literal characters such as the '-' and the "19" are a
  3040. permanent part of the input field:
  3041. od_edit_str(string,"UUU'-'##'-19'##",
  3042. 1, 1, 0x03, 0x21, 176,
  3043. EDIT_FLAG_PERMALITERAL|
  3044. EDIT_FLAG_FILL_STRING);
  3045. ===============================================================================
  3046. OpenDoors 6.00 Manual End of Page 78
  3047. OD_EXIT()
  3048. -------------------------------------------------------------------------------
  3049. PURPOSE The OpenDoors program termination function
  3050. FORMAT void od_exit(INT nErrorLevel, BOOL bTermCall);
  3051. RETURNS N/A
  3052. DESCRIPTION You MUST USE THIS FUNCTION when you want your program to exit.
  3053. This function will close the serial port, re-write changed
  3054. information to the door information (drop), call your end-of-
  3055. program function (if any), and then exit with the errorlevel
  3056. specified in the first parameter.
  3057. Also, if the second parameter, bTermCall, is set to TRUE,
  3058. od_exit() will also log the user off (for options such as
  3059. logging off within the door - as shown in the example below).
  3060. This is accomplished by lowering the DTR line to the modem,
  3061. causing the modem to hangup. When control is returned to the
  3062. BBS, it will then detect that the user is no longer online, and
  3063. will carry out its own logoff processing.
  3064. If you wish for your program to always perform any activities
  3065. prior to exiting, such as updating or closing data files, you
  3066. should set a function to be executed from within the od_exit()
  3067. function. This is accomplished by using the od_control.
  3068. od_before_exit variable, as described in the section on the
  3069. OpenDoors control structure in chapter 5. Use of this variable
  3070. will allow your program to always carry out these activates,
  3071. even if OpenDoors decides to call the od_exit() function itself,
  3072. such as when a user hangs up on the door.
  3073. Note that in special cases, you may use the
  3074. od_control.od_disable variable to prevent the od_exit() function
  3075. from re-writing the door information file. Also, you may use the
  3076. od_control.od_noexit variable to shutdown door operations
  3077. without actually exiting your program. Both of these variables
  3078. are described in chapter 5.
  3079. SEE ALSO od_init()
  3080. EXAMPLE The example below demonstrates a function which a door could
  3081. execute when the user chooses to exit the door. This function
  3082. will ask the user whether they wish to exit the door and return
  3083. to the BBS, simply logoff of the BBS, or continue using the
  3084. door. The example function will then call od_exit() if the user
  3085. ===============================================================================
  3086. OpenDoors 6.00 Manual End of Page 79
  3087. wishes to exit the door, or return control to the function which
  3088. called it, if the user does not wish to exit:
  3089. void goodbye(void)
  3090. {
  3091. char pressed;
  3092. /* Display choices to user */
  3093. od_disp_str("You have chosen to exit this door.\n\r");
  3094. od_disp_str("Do you wish to:\n\r");
  3095. od_disp_str(" [R]eturn to the BBS\n\r");
  3096. od_disp_str(" [L]ogoff of the BBS\n\r");
  3097. od_disp_str(" [C]ontinue using the door\n\r");
  3098. for(;;) /* loop until user makes valid choice */
  3099. {
  3100. pressed=od_get_key(TRUE); /* Get key from user */
  3101. /* If user selects R, exit without hanging up */
  3102. if(pressed=='R' || pressed=='r') od_exit(40,FALSE);
  3103. /* If user selects L, hangup and then exit */
  3104. if(pressed=='L' || pressed=='l') od_exit(41,TRUE);
  3105. /* If user selects C, return and allow door to continue */
  3106. if(pressed=='C' || pressed=='c') return;
  3107. }
  3108. }
  3109. ===============================================================================
  3110. OpenDoors 6.00 Manual End of Page 80
  3111. OD_GET_ANSWER()
  3112. -------------------------------------------------------------------------------
  3113. PURPOSE Function to allow the user to respond to a prompt using only
  3114. certain keys.
  3115. FORMAT char od_get_answer(char *pszOptions);
  3116. RETURNS Character that user entered
  3117. DESCRIPTION This function can be used to get a response from the user, when
  3118. only particular responses should be accepted. The parameter to
  3119. the od_get_answer() function is simply a string listing the
  3120. valid responses. The function will wait until the user selects
  3121. one of the valid responses, and then return that response. The
  3122. function is case insensitive, and will return the character in
  3123. the same case that was supplied to it in the string.
  3124. SEE ALSO od_get_key(), od_hotkey_menu()
  3125. EXAMPLES od_get_answer("YN");
  3126. - If the user presses 'y', will return 'Y'.
  3127. od_get_answer("yn");
  3128. - If the user presses 'y', will return 'y'.
  3129. od_get_answer("ABC 123\n\rZ");
  3130. - Valid responses will be: [A], [B], [C], [SPACE],
  3131. [1], [2], [3], [ENTER], [Z]
  3132. ===============================================================================
  3133. OpenDoors 6.00 Manual End of Page 81
  3134. OD_GET_INPUT()
  3135. -------------------------------------------------------------------------------
  3136. PURPOSE This function allows a single input event (e.g. keystroke) to be
  3137. retrieved, optionally translating extended key sequences such as
  3138. arrow keys and the insert key.
  3139. FORMAT BOOL od_get_input(tODInputEvent *pInputEvent,
  3140. tODMilliSec TimeToWait, WORD wFlags);
  3141. RETURNS TRUE on success, FALSE if no input event was retrieved.
  3142. DESCRIPTION Like od_get_key(), od_get_input() can be used to retrieve a
  3143. single key of input from the user. However, od_get_input() has
  3144. been designed to be easily extended in future versions of
  3145. OpenDoors. The information retrieved by this new function is
  3146. placed in a structure, which contains information on whether the
  3147. input event was generated by the remote user or the local
  3148. console, and what type of input event it was. This function also
  3149. has built-in the ability to recognize and translate the multiple-
  3150. character sequences that are generated when the user presses
  3151. extended keys such as arrow keys, insert, delete, etc.
  3152. The first parameter points to a tODInputEvent structure, which is
  3153. defined as follows:
  3154. typedef struct
  3155. {
  3156. tODInputEventType EventType;
  3157. BOOL bFromRemote;
  3158. char chKeyPress;
  3159. } tODInputEvent;
  3160. When od_get_input() successfully retrieves an input event, this
  3161. structure is filled with information about the input. The
  3162. EventType member can be either EVENT_CHARACTER (indicating a
  3163. single character keystroke) or EVENT_EXTENDED_KEY (indicating an
  3164. extended key, such as an arrow key). In the case of
  3165. EVENT_CHARACTER, chKeyPress is set to the character that was
  3166. received. In the case of EVENT_EXTENDED_KEY, chKeyPress is set to
  3167. one of the following values:
  3168. ===============================================================================
  3169. OpenDoors 6.00 Manual End of Page 82
  3170. +------------------+---------------+-------------------------+
  3171. | chKeyPress Value | Meaning | Control Key Alternative |
  3172. +------------------+---------------+-------------------------+
  3173. | OD_KEY_F1 | [F1] | None |
  3174. | OD_KEY_F2 | [F2] | None |
  3175. | OD_KEY_F3 | [F3] | None |
  3176. | OD_KEY_F4 | [F4] | None |
  3177. | OD_KEY_F5 | [F5] | None |
  3178. | OD_KEY_F6 | [F6] | None |
  3179. | OD_KEY_F7 | [F7] | None |
  3180. | OD_KEY_F8 | [F8] | None |
  3181. | OD_KEY_F9 | [F9] | None |
  3182. | OD_KEY_F10 | [F10] | None |
  3183. | OD_KEY_UP | [UP ARROW] | [CTRL]-[E] |
  3184. | OD_KEY_DOWN | [DOWN ARROW] | [CTRL]-[X] |
  3185. | OD_KEY_LEFT | [LEFT ARROW] | [CTRL]-[S] |
  3186. | OD_KEY_RIGHT | [RIGHT ARROW] | [CTRL]-[D] |
  3187. | OD_KEY_INSERT | [INSERT] | [CTRL]-[V] |
  3188. | OD_KEY_DELETE | [DELETE] | [CTRL]-[G] |
  3189. | OD_KEY_HOME | [HOME] | None |
  3190. | OD_KEY_END | [END] | None |
  3191. | OD_KEY_PGUP | [PAGE UP] | None |
  3192. | OD_KEY_PGDN | [PAGE DOWN] | None |
  3193. | OD_KEY_SHIFTTAB | [SHIFT]-[TAB] | None |
  3194. +------------------+---------------+-------------------------+
  3195. The bFromRemote member of the tODInputEvent structure will be set
  3196. to TRUE if the input event originated from the remote system, or
  3197. FALSE if the event originated from the local system.
  3198. The second parameter, TimeToWait specifies how long the function
  3199. should wait for input before returning, in milliseconds. A value
  3200. of 0 causes the function to return immediately if no input is
  3201. waiting in OpenDoor's internal input buffer. The is equivalent to
  3202. a value of FALSE being passed to the od_get_key() function. A
  3203. value of OD_NO_TIMEOUT causes this function to wait and only
  3204. return after the next input event has been received. This is
  3205. equivalent to a value of TRUE being passed to the od_get_key()
  3206. function. An other value specifies the maximum number of
  3207. milliseconds that od_get_input() should wait for input. If input
  3208. is received before this time elapses, od_get_key() will return
  3209. immediately with a value of TRUE, and the tODInputEvent structure
  3210. will be fill accordingly. If no input is received before this
  3211. time elapses, od_get_key() will return FALSE. The number of
  3212. milliseconds to wait is rounded to the nearest 55 milliseconds in
  3213. the DOS version of OpenDoors.
  3214. The third parameter allows you to specify flags to further
  3215. control the behavior of od_get_input(). Normally, this parameter
  3216. will be set to GETIN_NORMAL. However, you can disable all
  3217. translation of extended keystrokes by setting this value to
  3218. GETIN_RAW. In this mode, od_get_input() works just like
  3219. ===============================================================================
  3220. OpenDoors 6.00 Manual End of Page 83
  3221. od_get_key(), returning every individual character received from
  3222. the remote system.
  3223. Since extended keys are not directly supported by all terminal
  3224. programs, od_get_input() provides alternatives for some of the
  3225. extended keys, in the form of control-key combinations. The
  3226. control key combinations recognized by od_get_input() are listed
  3227. in the table above. However, these control key alternatives can
  3228. be ignored by setting the GETIN_RAWCTRL flag.
  3229. The od_get_input() function is used internally by
  3230. od_popup_menu(), od_edit_str() and od_multiline_edit().
  3231. SEE ALSO od_get_key(), od_clear_keybuffer()
  3232. EXAMPLE The following example shows the structure of how od_get_input()
  3233. might be used in your program:
  3234. tODInputEvent InputEvent;
  3235. od_get_input(&InputEvent, OD_NO_TIMEOUT, GETIN_NORMAL);
  3236. if(InputEvent.EventType == EVENT_EXTENDED_KEY)
  3237. {
  3238. switch(InputEvent.chKeyPress)
  3239. {
  3240. case OD_KEY_UP:
  3241. /* The up arrow key has been pressed. */
  3242. break;
  3243. case OD_KEY_DOWN:
  3244. /* The down arrow key has been pressed. */
  3245. break;
  3246. }
  3247. }
  3248. else if(InputEvent.EventType == EVENT_CHARACTER)
  3249. {
  3250. /* A single character key has been pressed, and is */
  3251. /* stored in InputEvent.chKeyPress. */
  3252. }
  3253. ===============================================================================
  3254. OpenDoors 6.00 Manual End of Page 84
  3255. OD_GET_KEY()
  3256. -------------------------------------------------------------------------------
  3257. PURPOSE Function to input a key from the user
  3258. FORMAT char od_get_key(BOOL bWait);
  3259. RETURNS The next key waiting from the keyboard, or 0 if none.
  3260. DESCRIPTION This function retrieves the next key waiting in the OpenDoors
  3261. keyboard buffer (see the description of the od_clear_keybuffer()
  3262. function, on page 53, for more information on the OpenDoors
  3263. keyboard buffer). The od_get_key() function allows your door to
  3264. retrieve both those keystrokes pressed by the user, and the
  3265. keystrokes pressed on the sysop keyboard (other than the sysop
  3266. function keys), in the sequence they were pressed. Since input
  3267. is accepted from both sources, it is possible for the sysop, as
  3268. well as the remote user, to make selections and control the
  3269. door.
  3270. Door input with OpenDoors can be accomplished with this
  3271. function, with the od_input_str() function or with the
  3272. od_edit_str() function. The od_input_str() and od_edit_str()
  3273. functions is used to input an entire sequence of characters from
  3274. the user (a string), and requires the user to press the [Enter]
  3275. key when they are finished typing their input. On the other
  3276. hand, the od_get_key() function is used to input a single
  3277. keystroke (one character) from the user, and allows the user to
  3278. make choices without having to press the enter key.
  3279. The od_get_key() function accepts a single parameter, which
  3280. determines whether or not it should wait for the user to press a
  3281. key, if they have not already done so. If you pass a FALSE value
  3282. to od_get_key(), then the function will not wait for a key to be
  3283. pressed at the keyboard, but instead return a 0 if there are no
  3284. keys waiting in the buffer. If you pass a TRUE value to
  3285. od_get_key(), then this function will instead wait for a key to
  3286. be pressed. Also, while waiting for the user to press a key, the
  3287. od_get_key() function will give up the processor to other
  3288. waiting programs, if you door is running under DesqView.
  3289. If you are waiting for the user to make a choice from a menu or
  3290. list of options, you will most likely pass a TRUE to the
  3291. od_get_key() function, indicating that you wish for it to wait
  3292. until a key is pressed. However, if you wish to continue other
  3293. processing if no key is yet available from the keyboard, you
  3294. should pass a FALSE to the od_get_key() function. For example,
  3295. if you are displaying a screen of text, and wish to allow the
  3296. user to pause or abort the display, you would simply call the
  3297. ===============================================================================
  3298. OpenDoors 6.00 Manual End of Page 85
  3299. od_get_key() function every few moments, passing it a value of
  3300. FALSE. You would then be able to check if any control keys have
  3301. been pressed, and if not, continue displaying text.
  3302. The od_get_key() function returns the ASCII value representing
  3303. the keystroke that was made. If you are waiting for the user to
  3304. make a particular choice, perhaps from a menu, you will most
  3305. likely store the value returned by od_get_key() in a variable of
  3306. type char. For example:
  3307. char key;
  3308. ...
  3309. key=od_get_key(TRUE);
  3310. You would then be able to determine which key the user pressed
  3311. by testing the value of key, either by comparing it's numerical
  3312. ASCII value, or by comparing it to a character constant. If you
  3313. are testing for a non-character key, such as [ESCape], [Tab] or
  3314. [Return], you may wish to use the ASCII value of that key. For
  3315. example, if you wished to take some action in the case that the
  3316. user presses the [Enter]/[Return] key, who's ASCII value is 13,
  3317. you could do:
  3318. key=od_get_key(TRUE); /* Get keypress from user */
  3319. if(key==13) /* If key was [Enter]/[Return] */
  3320. {
  3321. ... /* Whatever you want to do */
  3322. }
  3323. If you wish, instead, to respond to the user pressing a
  3324. character key (perhaps as a choice from a menu), you can do so
  3325. by using character constants, such as 'c', '6', or 'F'. Also,
  3326. when testing for an alphabetical character, you will probably
  3327. want to check for the user pressing either the upper or lower-
  3328. case version of the letter. For example, if you wished to have
  3329. the user press the [Y] key to continue, you could test for
  3330. either an upper or lower-case Y as follows:
  3331. key=od_get_key(TRUE); /* Get keypress from user */
  3332. if(key=='y' || key=='Y') /* If key was [y]/[Y] */
  3333. {
  3334. ... /* Whatever you want to do */
  3335. }
  3336. The charts on the following page lists the decimal value and corresponding
  3337. keystroke(s) of each of the ASCII values from 0 to 127.
  3338. ===============================================================================
  3339. OpenDoors 6.00 Manual End of Page 86
  3340. ASCII KEYSTROKE | ASCII KEYSTROKE
  3341. ----- ------------------------------ | ----- ----------------------
  3342. 0 [Control]-[@] | 15 [Control]-[O]
  3343. 1 [Control]-[A] | 16 [Control]-[P]
  3344. 2 [Control]-[B] | 17 [Control]-[Q]
  3345. 3 [Control]-[C] | 18 [Control]-[R]
  3346. 4 [Control]-[D] | 19 [Control]-[S]
  3347. 5 [Control]-[E] | 20 [Control]-[T]
  3348. 6 [Control]-[F] | 21 [Control]-[U]
  3349. 7 [Control]-[G] | 22 [Control]-[V]
  3350. 8 [Control]-[H]/[Backspace] | 23 [Control]-[W]
  3351. 9 [Control]-[I]/[Tab] | 24 [Control]-[X]
  3352. 10 [Control]-[J] | 25 [Control]-[Y]
  3353. 11 [Control]-[K] | 26 [Control]-[Z]
  3354. 12 [Control]-[L] | 27 [ESCape]
  3355. 13 [Control]-[M]/[Enter]/[Return] | 32 [SpaceBar]
  3356. 14 [Control]-[N] |
  3357. ASCII KEYSTROKE | ASCII KEYSTROKE | ASCII KEYSTROKE | ASCII KEYSTROKE
  3358. ----- --------- | ----- --------- | ----- --------- | ----- ---------
  3359. 33 '!' | 57 '9' | 80 'P' | 104 'h'
  3360. 34 '"' | 58 ':' | 81 'Q' | 105 'i'
  3361. 35 '#' | 59 ';' | 82 'R' | 106 'j'
  3362. 36 '$' | 60 '<' | 83 'S' | 107 'k'
  3363. 37 '%' | 61 '=' | 84 'T' | 108 'l'
  3364. 38 '&' | 62 '>' | 85 'U' | 109 'm'
  3365. 39 '\'' (') | 63 '?' | 86 'V' | 110 'n'
  3366. 40 '(' | 64 '@' | 87 'W' | 111 'o'
  3367. 41 ')' | 65 'A' | 88 'X' | 112 'p'
  3368. 42 '*' | 66 'B' | 89 'Y' | 113 'q'
  3369. 43 '+' | 67 'C' | 90 'Z' | 114 'r'
  3370. 44 ',' | 68 'D' | 91 '[' | 115 's'
  3371. 45 '-' | 69 'E' | 92 '\\' (\) | 116 't'
  3372. 46 '.' | 70 'F' | 93 ']' | 117 'u'
  3373. 47 '/' | 71 'G' | 94 '^' | 118 'v'
  3374. 48 '0' | 72 'H' | 95 '_' | 119 'w'
  3375. 49 '1' | 73 'I' | 96 '`' | 120 'x'
  3376. 50 '2' | 74 'J' | 98 'b' | 121 'y'
  3377. 51 '3' | 75 'K' | 99 'c' | 122 'z'
  3378. 52 '4' | 76 'L' | 100 'd' | 123 '{'
  3379. 53 '5' | 77 'M' | 101 'e' | 124 '|'
  3380. 54 '6' | 78 'N' | 102 'f' | 125 '}'
  3381. 55 '7' | 79 'O' | 103 'g' | 126 '~'
  3382. 56 '8' | | | 127 [DELete]
  3383. ===============================================================================
  3384. OpenDoors 6.00 Manual End of Page 87
  3385. SEE ALSO od_get_input(), od_input_str(), od_edit_str(),
  3386. od_clear_keybuffer()
  3387. EXAMPLE For examples of the use of the od_get_key() function, see the
  3388. examples in the description portion, above, and the examples for
  3389. the od_exit() and od_clear_keybuffer() functions. For further
  3390. examples of this function, see the example program EX_VOTE.C,
  3391. described in the section beginning on page 38.
  3392. ===============================================================================
  3393. OpenDoors 6.00 Manual End of Page 88
  3394. OD_GETTEXT()
  3395. -------------------------------------------------------------------------------
  3396. PURPOSE Stores a rectangular region of the screen in an array, to later
  3397. be redrawn using od_puttext(). Requires ANSI, AVATAR or RIP
  3398. modes.
  3399. FORMAT BOOL od_gettext(INT nLeft, INT nTop, INT nRight, INT nBottom,
  3400. void *pBlock);
  3401. RETURNS TRUE on success
  3402. FALSE on failure
  3403. DESCRIPTION This function stores the contents (both text and color
  3404. information) of the rectangular portion of the screen denoted by
  3405. the variables nLeft, nTop, nRight and nBottom into the buffer
  3406. pointed to by pBlock. The saved portion of the screen may then
  3407. be restored using od_puttext(). The buffer must be large enough
  3408. to store two bytes for every character in the specified
  3409. rectangle. In other words, the required size of the buffer, in
  3410. bytes, is:
  3411. length * width * 2
  3412. The parameters nLeft and nRight are column numbers from 1 to 80,
  3413. and the parameters nTop and nBottom are row numbers between 1
  3414. and 23.
  3415. This function has no effect on the current text color or cursor
  3416. position. ANSI, AVATAR or RIP mode is required for this
  3417. function. If you wish to save and restore the entire screen, you
  3418. may use the od_save_screen() and od_restore_screen() functions,
  3419. which can be used in all display modes.
  3420. If this function fails for any reason, a value of FALSE is
  3421. returned, and the od_control.od_error variable is set to
  3422. indicate the reason for the failure. For more information on the
  3423. od_control.od_error variable, see page 185.
  3424. SEE ALSO od_puttext(), od_save_screen(), od_restore_screen(),
  3425. od_scroll(), od_window_create(), od_window_remove()
  3426. ===============================================================================
  3427. OpenDoors 6.00 Manual End of Page 89
  3428. OD_HOTKEY_MENU()
  3429. -------------------------------------------------------------------------------
  3430. PURPOSE Function to display a menu file with hotkeys
  3431. FORMAT char od_hotkey_menu(char *pszFileName, char *pszHotKeys, BOOL
  3432. bWait);
  3433. RETURNS Key pressed in response to menu, or '\0' if none.
  3434. DESCRIPTION This function can be used to display a menu from an ASCII, ANSI,
  3435. AVATAR or RIP file, allowing the user to select an option at any
  3436. time while the menu is being displayed. The od_hotkey_menu()
  3437. function is quite similar to the od_send_file() function, and
  3438. you should probably familiarize yourself with that function if
  3439. you are going to use od_hotkey_menu(). Like od_send_file(),
  3440. od_hotkey_menu() will display the file specified by pszFileName,
  3441. using the appropriate terminal emulation. If no extension is
  3442. provided for the filename, OpenDoors will automatically search
  3443. for matching files ending in .ASC, .ANS and .AVT extensions.
  3444. OpenDoors will the select the appropriate file to display, based
  3445. on the available files and available terminal emulation.
  3446. The second parameter, pszHotKeys, is a string specifying the
  3447. valid responses to the menu, in the same format as the string
  3448. passed to the od_get_answer() function. If any of the characters
  3449. listed in this string are pressed, either uppercase or lowercase
  3450. versions, OpenDoors will immediately stop displaying the menu,
  3451. and return with the value of the key pressed. The case (upper or
  3452. lower) returned will always be identical to the case used in the
  3453. hotkeys string. You can include the [ENTER] key as a valid hot
  3454. key by including the \n character in the hotkey string.
  3455. The third parameter passed to od_hotkey_menu(), bWait, specifies
  3456. whether OpenDoors should wait after displaying the menu for the
  3457. user to make a valid selection from the menu (TRUE), or if it
  3458. should exit immediately (FALSE). Normally, you will want to use
  3459. the TRUE value when calling this function. This will allow you
  3460. to use a single function call that will display the menu and
  3461. always return the user's selection. If you wish to gain control
  3462. as soon as OpenDoors has displayed the menu, you may specify
  3463. FALSE for this parameter. In this case, if the user does not
  3464. press any of the valid hot keys while the menu is being sent,
  3465. the function will return the character '\0'.
  3466. SEE ALSO od_send_file(), od_get_answer()
  3467. ===============================================================================
  3468. OpenDoors 6.00 Manual End of Page 90
  3469. EXAMPLE As an example of the use of the od_hotkey_menu() function,
  3470. consider the following code fragment:
  3471. for(;;) /* Main program loop */
  3472. { /* Display menu and get user's choice */
  3473. char choice=od_hotkey_menu("MAINMENU","123Q",TRUE");
  3474. switch(choice) /* Perform the appropriate action */
  3475. {
  3476. case '1':
  3477. od_printf("You selected one.\n\r");
  3478. break;
  3479. case '2':
  3480. od_printf("You selected two.\n\r");
  3481. break;
  3482. case '3':
  3483. od_printf("You selected three.\n\r");
  3484. break;
  3485. case 'Q':
  3486. od_exit(FALSE,10);
  3487. }
  3488. }
  3489. This is an example of the main menu loop of a simple door that
  3490. uses the od_hotkey_menu() function. The program will continue
  3491. executing the for(;;) loop until the user chooses to exit the
  3492. door. On each iteration of the loop, the od_hotkey_menu()
  3493. function is called, to display the door's menu from the file
  3494. MAINMENU.A??. The appropriate .ASC/.ANS/.AVT file will be chosen
  3495. and displayed as the menu. The possible choices that may be made
  3496. from the menu are specified by the string "123Q". Thus, whenever
  3497. the user presses one of the keys [1], [2], [3] or [Q], the
  3498. od_hotkey_menu() function will return immediately with the value
  3499. of the key pressed. If the menu is still being displayed at the
  3500. time when the key was pressed, menu display will cease at that
  3501. moment. The program then executes a case statement, to respond
  3502. to the user's key appropriately. If the user presses [1], [2] or
  3503. [3] this door will output a simple message to the screen. If the
  3504. user presses the [Q] key, the door will pass control back to the
  3505. BBS.
  3506. ===============================================================================
  3507. OpenDoors 6.00 Manual End of Page 91
  3508. OD_INIT()
  3509. -------------------------------------------------------------------------------
  3510. PURPOSE To initialize OpenDoors activities
  3511. FORMAT void od_init(void);
  3512. RETURNS N/A
  3513. DESCRIPTION This function initializes OpenDoors. This function must be
  3514. called manually if you wish to access data about the user, etc.,
  3515. before you call any other OpenDoors functions. However, if you
  3516. do not explicitly call the od_init() function, it will be called
  3517. automatically on the first call to most other OpenDoors
  3518. functions. The only functions that should be called before
  3519. od_init() are od_add_personality() and od_parse_cmd_line(). The
  3520. od_init() function reads information from the door information
  3521. file, initializes communications with the modem, displays the
  3522. status line, and sets up OpenDoors' internal data structures.
  3523. For more information on what data is and is not available before
  3524. od_init() has been called, please refer to the chapter on the
  3525. OpenDoors control structure, which begins on page 148.
  3526. The od_init() function will read the door information file which
  3527. is located in the directory specified by the variable
  3528. od_control.info_path. If this variable has not been set prior to
  3529. calling the od_init() function, OpenDoors will expect to find
  3530. the door information file in the current directory. Thus, if you
  3531. wish your door to be able to be run in a directory other than
  3532. the BBS system directory, it would be a good idea to allow the
  3533. sysop using your door to specify the location of the door
  3534. information file. For an example of setting the
  3535. od_control.info_path variable, please see the example program
  3536. located on page 150.
  3537. Also note that you can prevent the od_init() function from
  3538. carrying out some of it's normal activities, such as attempting
  3539. to read a door information file, by the use of the
  3540. od_control.od_disable variable, as described in the section on
  3541. the OpenDoors control structure, which begins on page 148.
  3542. SEE ALSO od_exit()
  3543. EXAMPLE At times, you may wish to write a door program which will
  3544. require a maintenance utility to be run on a regular basis. For
  3545. example, a game door may have to have its system files updated
  3546. on a daily basis, by having a utility program run in a system
  3547. ===============================================================================
  3548. OpenDoors 6.00 Manual End of Page 92
  3549. event each day at midnight. One way of accomplishing this would
  3550. be to have your door package include two .EXE files, one being
  3551. the actual door program, and the other being a utility program.
  3552. However, another option would be to have both the door and
  3553. maintenance functions to be accessible from a single .EXE file,
  3554. in order to simplify use of the door for the sysop. In this
  3555. case, you would want to test the command line to determine
  3556. whether your program should run in door mode or maintenance
  3557. mode. You would then only execute the od_init() function, along
  3558. with the rest of your door code, if you program were running in
  3559. "door mode".
  3560. The program below demonstrates one method of doing just this. In
  3561. this case, the program would include two functions, door(),
  3562. which would carry out all of the door-related activities, and
  3563. maint(), which would carry out all of the maintenance-related
  3564. activities. In this simple example, if the command line includes
  3565. a "-M" or "/M", the program will run in maintenance mode,
  3566. otherwise it will run in door mode. Also, if it is running in
  3567. door mode, the program will take the first command-line
  3568. parameter, if any, as a path to the location of the door
  3569. information file.
  3570. #include "opendoor.h"
  3571. void door(void);
  3572. void maint(void);
  3573. int main(int argc, char *argv[])
  3574. {
  3575. int counter;
  3576. /* Check any command line parameters for /M or -M */
  3577. for(counter=1;counter<argc;++counter)
  3578. {
  3579. if((argv[counter])[1]=='m' || (argv[counter])[1]=='M')
  3580. {
  3581. maint(); /* Then carry out maintenance */
  3582. exit(20); /* And exit */
  3583. }
  3584. }
  3585. /* If there was no -M or /M, then run in door mode */
  3586. /* If there are any command-line parameters take the first */
  3587. /* as the path to the door information file */
  3588. if(argc>1) strncpy(od_control.info_path,argv[1],59);
  3589. od_init(); /* call the od_init() function */
  3590. door(); /* Run the door portion of the program */
  3591. od_exit(30,FALSE); /* Shutdown the door */
  3592. ===============================================================================
  3593. OpenDoors 6.00 Manual End of Page 93
  3594. }
  3595. void maint(void)
  3596. {
  3597. ... /* Carry out maintenance activities here */
  3598. }
  3599. void door(void)
  3600. {
  3601. ... /* Carry out door activities here */
  3602. }
  3603. ===============================================================================
  3604. OpenDoors 6.00 Manual End of Page 94
  3605. OD_INPUT_STR()
  3606. -------------------------------------------------------------------------------
  3607. PURPOSE Inputs a string from the user
  3608. FORMAT void od_input_str(char *pszInput, INT nMaxLength,
  3609. unsigned char chMin, unsigned char chMax);
  3610. RETURNS N/A
  3611. DESCRIPTION To perform string input within OpenDoors, one of two functions
  3612. can be used, od_input_str() and od_edit_str(). The first
  3613. function, od_input_str(), allows simple line input and editing,
  3614. and can be used in ASCII, ANSI, AVATAR and RIP modes. The second
  3615. function, od_edit_str(), allows many formatted input options,
  3616. advanced line editing, and other features, but requires the use
  3617. of ANSI, AVATAR or RIP graphics modes.
  3618. The od_input_str() function allows you to input a string from
  3619. the user. The string will be permitted to have up to the number
  3620. of characters specified by the max_len parameter, and all
  3621. characters must be between the values of the min_char and
  3622. max_char parameters. This function will wait until the user
  3623. presses the [Enter] key to finish inputting the string.
  3624. The first parameter passed to this function should be a pointer
  3625. to the string where the user's input should be stored. So, if
  3626. you wanted to store a string of up to 30 characters inputted by
  3627. the user, you might define this string as follows:
  3628. char input_string[31];
  3629. Notice here than the string must be long enough to hold the
  3630. thirty characters which can be entered by the user, along with
  3631. the additional "null" character which is used to indicate the
  3632. end of a string in C. Hence, the length of the string should
  3633. always be at least one greater than the total number of
  3634. characters the user is permitted to enter, passed in the
  3635. nMaxLength parameter.
  3636. The second parameter passed to the od_input_str() function
  3637. should be an integer value indicating the maximum number of
  3638. characters which can be input by the user. For example, if this
  3639. parameter had a value of 10, the user would be able to enter a
  3640. string containing any number of characters up to and including
  3641. 10 characters. If this parameter had a value of 1, the user
  3642. would only be able to enter a single character. However, the
  3643. user would be able to backspace, change the character, and press
  3644. [Enter] when they were satisfied with their entry. Note that
  3645. ===============================================================================
  3646. OpenDoors 6.00 Manual End of Page 95
  3647. even if you only ask the od_input_str() function to input a
  3648. single character, it will still expect a STRING to be passed to
  3649. it, and will return a string with either zero or one character,
  3650. followed by a null (string terminator) character.
  3651. The third and fourth parameters passed to this function allow
  3652. you to control what characters the user will be permitted to
  3653. enter as part of the string. For example, you could set the
  3654. minimum character to the '0' character and the maximum character
  3655. to the '9' character, permitting the user to only enter numeric
  3656. characters. On the other hand, you could permit the user to
  3657. enter all ASCII characters in the range from 32 to 127. The
  3658. od_input_str() function will permit characters in the range
  3659. beginning with the character passed as minchar, up to and
  3660. including the character passed as maxchar.
  3661. SEE ALSO od_edit_str(), od_get_key(), od_clear_keybuffer()
  3662. EXAMPLE Below are a number of examples of the use of the od_input_str()
  3663. function in various applications:
  3664. - To input a two character number (only digits from 0-9):
  3665. od_input_str(string, 2, '0', '9');
  3666. - To input a 35 character name (characters from Space to
  3667. ASCII 127):
  3668. od_input_str(string, 35, 32, 127);
  3669. ===============================================================================
  3670. OpenDoors 6.00 Manual End of Page 96
  3671. OD_KERNEL()
  3672. -------------------------------------------------------------------------------
  3673. PURPOSE The OpenDoors Central Control function.
  3674. FORMAT void od_kernel(void);
  3675. RETURNS N/A
  3676. DESCRIPTION In the DOS version of OpenDoors, the od_kernel() function is
  3677. responsible for many vital OpenDoors tasks, such as monitoring
  3678. the carrier detect signal, monitoring the amount of time that
  3679. the user has remaining, updating the status line, responding to
  3680. sysop hotkeys, and reading characters which are received from
  3681. the modem. The od_kernel() function is automatically called on a
  3682. frequent basis by the other OpenDoors functions, so most often
  3683. you will not need to be concerned with this function. However,
  3684. in order that OpenDoors can carry out the activities mentioned
  3685. above with a quick response, it is important that od_kernel(),
  3686. or some other OpenDoors function be called at least once every
  3687. second. Thus, if your program will be carrying out some
  3688. processing, in which it will not be calling any OpenDoors
  3689. functions for more than a second or so, you should call the
  3690. od_kernel() function yourself. The example below demonstrates
  3691. one method of doing just this.
  3692. Note that if for some reason or other, it is not possible for
  3693. your program to call the od_kernel() function, or any other
  3694. OpenDoors functions for a period of several seconds, this will
  3695. not cause your door to crash or fail in any way. The only
  3696. problem will be that OpenDoors will not be able to respond to
  3697. any action, such as the sysop pressing a function key, or the
  3698. user dropping carrier, until such time as you next call
  3699. od_kernel(), or some OpenDoors function. Hence, use of the
  3700. od_kernel() function will improve the quality and response time
  3701. of your program, but calling it or some OpenDoors function on a
  3702. regular basis is not absolutely vital.
  3703. This function has no effect in the Win32 version of OpenDoors.
  3704. SEE ALSO od_sleep()
  3705. ===============================================================================
  3706. OpenDoors 6.00 Manual End of Page 97
  3707. OD_LIST_FILES()
  3708. -------------------------------------------------------------------------------
  3709. PURPOSE Lists files in a particular file area (using FILES.BBS)
  3710. FORMAT BOOL od_list_files(char *pszFileSpec);
  3711. RETURNS TRUE if successful, FALSE if unsuccessful
  3712. DESCRIPTION This function allows you to display a list of files available
  3713. for download from a particular file area, as any BBS system
  3714. would. The file names and descriptions are taken from the
  3715. FILES.BBS located in the directory pointed to by pszFileSpec.
  3716. Thus, to list the files available for download in
  3717. C:\BBS\FILES\UPLOADS, simply:
  3718. od_list_files("C:\\BBS\\FILES\\UPLOADS");
  3719. OpenDoors uses a third-generation FILES.BBS format, that is
  3720. compatible with other FILES.BBS formats, but adds some
  3721. additional features. Each line in the FILES.BBS file lists a
  3722. filename, along with it's description. Thus, a typical FILES.BBS
  3723. file might look as follows:
  3724. PKZ110.EXE PKZip file compressor, version 1.10
  3725. ODOORS60.ZIP The newest version of OpenDoors
  3726. REC*.ZIP A Record file
  3727. C:\BBS\*.* All BBS files.
  3728. When displayed, OpenDoors will list the size of each file found
  3729. in the FILES.BBS file beside it's name, if the file is found. If
  3730. the file does not exist, then a "[OFFLINE]" string is displayed
  3731. in the file size column. Title lines may also be added to the
  3732. FILES.BBS, by indenting them one or more columns. Thus, you
  3733. could have something like:
  3734. NEWEST UPLOADS
  3735. ~~~~~~~~~~~~~~
  3736. PKZ110.EXE PKZip file compressor, version 1.10
  3737. ODOORS60.ZIP The newest version of OpenDoors
  3738. REC*.ZIP A Record file
  3739. C:\BBS\*.* All BBS files.
  3740. In addition to this standard FILES.BBS format, OpenDoors will
  3741. also permit wildcards to be used in FILES.BBS filenames (ie
  3742. FNEWS???.*), or full directory paths to allow files from several
  3743. different directories to be included in the same files area.
  3744. ===============================================================================
  3745. OpenDoors 6.00 Manual End of Page 98
  3746. You may alter the colors used to display the various portions of
  3747. the files list using the od_control variables:
  3748. od_control.od_list_title_col
  3749. od_control.od_list_name_col
  3750. od_control.od_list_size_col
  3751. od_control.od_list_comment_col
  3752. od_control.od_list_offline_col
  3753. which are documented in the OpenDoors control structure section
  3754. on this manual, which begins on page 148.
  3755. SEE ALSO od_send_file()
  3756. ===============================================================================
  3757. OpenDoors 6.00 Manual End of Page 99
  3758. OD_LOG_WRITE()
  3759. -------------------------------------------------------------------------------
  3760. PURPOSE Function to write an entry to the log file
  3761. FORMAT BOOL od_log_write(char *pszMessage);
  3762. RETURNS TRUE on success, or FALSE on failure
  3763. DESCRIPTION This function can be used to write entries to the log file. If
  3764. the logfile has not already been opened when you call this
  3765. function for the first time, OpenDoors will automatically open
  3766. the log file at that time.
  3767. To create an entry in the log file, simply call the
  3768. od_log_write() function, passing to it the string of the text
  3769. you wish to write. You should not include any control characters
  3770. in this string, simply the text that should appear on the line.
  3771. OpenDoors will automatically format the log file, adding the
  3772. time information and other control characters. It is recommended
  3773. that the length of the string passed to od_log_write() not
  3774. exceed 67 characters, in order that logfile lines will all be
  3775. less than 80 characters in length.
  3776. Log file entries do not usually contain periods or other
  3777. punctuation at the end of the line. Also, log file entries are
  3778. usually written in the present tense. The first character of the
  3779. entry is usually upper-case, with all other entries in lower
  3780. case. Also, since excessive numbers or lengths of log file
  3781. entries can quickly use a lot of disk space, it is best to think
  3782. carefully about what events should be recorded in the log file.
  3783. It is also a good idea to minimize the number of words used in
  3784. the entry, without being too cryptic. As an example, "User
  3785. entering options menu" should be used instead of "user entered
  3786. the options menu."
  3787. SEE ALSO Page 224.
  3788. EXAMPLE Calling the od_log_write() function is as simple as follows:
  3789. od_log_write("Awarding user with 5 minutes more time");
  3790. ===============================================================================
  3791. OpenDoors 6.00 Manual End of Page 100
  3792. OD_MULTILINE_EDIT()
  3793. -------------------------------------------------------------------------------
  3794. PURPOSE Provides a multiple line text editor which can be used for
  3795. entering editing any text that spans more than one line, such as
  3796. messages or text files.
  3797. FORMAT INT od_multiline_edit(char *pszBufferToEdit, UINT unBufferSize,
  3798. tODEditOptions *pEditOptions);
  3799. RETURNS OD_MULTIEDIT_SUCCESS on success, or OD_MULTIEDIT_ERROR on
  3800. failure
  3801. DESCRIPTION This function provides a text editor with optional word wrap
  3802. capabilities. This editor can be used for entering or editing
  3803. text files, messages or other information that spans multiple
  3804. lines. The editor can be configured to operate in full-screen
  3805. mode, or to occupy any smaller area of the screen that you
  3806. specify. It provides the navigation (home / end / page up / arrow
  3807. keys) features and editing features (insert / overwrite mode,
  3808. Ctrl-Y to delete a line, etc.) that you would expect.
  3809. The od_multiline_edit() function is designed to be both easy to
  3810. use and very flexible. To that end, the function only takes three
  3811. parameters. The first two parameters are required, and the third
  3812. parameter is an optional options structure. The first parameter,
  3813. pszBufferToEdit, is a pointer to the buffer of text to edit. This
  3814. buffer must always be a '\0'-terminated string. This buffer must
  3815. be initialized before calling od_multiline_edit(). The second
  3816. parameter, unBufferSize, indicates the size of the buffer that is
  3817. passed in pszBufferToEdit. Note that this should be the total
  3818. amount of space that is available in the buffer for text entered
  3819. by the user, not the length of data that is actually initially in
  3820. the buffer. If you do not wish to customize any of the
  3821. od_multiline_edit() options, then you may simply set the third
  3822. parameter to 0. Hence, a simple example of how to use
  3823. od_multiline_edit() is:
  3824. char szMyEditBuffer[4000] = "";
  3825. od_multiline_edit(szMyEditBuffer, sizeof(szMyEditBuffer),
  3826. NULL);
  3827. If you wish to customize od_multiline_edit(), you should pass a
  3828. pointer to a tODEditOptions structure as the third parameter. You
  3829. should initialize this entire structure to zeros before
  3830. attempting to use it. You can then set any values of this
  3831. structure which you wish to change from their default. Any values
  3832. that are left at 0 will automatically revert to their defaults.
  3833. For example, if you wanted to specify a text format other than
  3834. ===============================================================================
  3835. OpenDoors 6.00 Manual End of Page 101
  3836. the default, you could create, initialize and pass in a
  3837. tODEditOptions structure as follows:
  3838. char szMyEditBuffer[4000] = "";
  3839. tODEditOptions MyEditOptions;
  3840. memset(&MyEditOptions, 0, sizeof(MyEditOptions));
  3841. MyEditOptions.TextFormat = FORMAT_LINE_BREAKS;
  3842. od_multiline_edit(szMyEditBuffer, sizeof(szMyEditBuffer),
  3843. &MyEditOptions);
  3844. The definition of the tODEditOptions structure is as follows:
  3845. typedef struct
  3846. {
  3847. INT nAreaLeft;
  3848. INT nAreaTop;
  3849. INT nAreaRight;
  3850. INT nAreaBottom;
  3851. tODEditTextFormat TextFormat;
  3852. tODEditMenuResult (*pfMenuCallback)(void *pUnused);
  3853. void * (*pfBufferRealloc)(void *pOriginalBuffer,
  3854. UINT unNewSize);
  3855. DWORD dwEditFlags;
  3856. char *pszFinalBuffer;
  3857. UINT unFinalBufferSize;
  3858. } tODEditOptions;
  3859. nAreaLeft, nAreaTop, nAreaRight, nAreaBottom allows you to
  3860. specify the portion of the screen that the text editor should
  3861. use. This defaults to 1, 1 - 80, 23.
  3862. TextFormat allows you to specify what format the text should be
  3863. stored in the buffer using. The default is
  3864. FORMAT_PARAGRAPH_BREAKS, which specifies that a line break only
  3865. appears at the end of each paragraph, and that the contents of a
  3866. paragraph are word wrapped. FORMAT_LINE_BREAKS specifies that a
  3867. line break appears at the end of each line of text on the screen,
  3868. and that newly entered text is word wrapped. FORMAT_NO_WORDWRAP
  3869. is equivalent to FORMAT_LINE_BREAKS, except that newly entered
  3870. text is not word wrapped. Instead, lines may be arbitrarily long.
  3871. For each of these text formats, od_multiline_edit() automatically
  3872. decides whether line breaks should take the form of a carriage
  3873. return ('\r'), line feed ('\n'), or some combination of these,
  3874. based on what it sees in the buffer that you supply. If no line
  3875. breaks are found in the buffer, then the default is to use just a
  3876. line feed ('\n') character. FORMAT_FTSC_MESSAGE specifies a FTSC-
  3877. compliant message, such as is used in a *.MSG message file. Among
  3878. other things, this specifies that carriage returns ('\r') end
  3879. paragraphs, and that line feeds ('\n') should be ignored.
  3880. pfMenuCallback allows you to provide a callback function that
  3881. will be called when the user presses the escape (or control-Z)
  3882. ===============================================================================
  3883. OpenDoors 6.00 Manual End of Page 102
  3884. key. This allows you to provide a menu that can be accessed from
  3885. within the text editor. This function should return
  3886. EDIT_MENU_DO_NOTHING if the editor should continue normally, or
  3887. EDIT_MENU_EXIT_EDITOR if the od_multiline_edit() should return.
  3888. If no menu callback function is provided, then
  3889. od_multiline_edit() always returns when the escape or control-z
  3890. key is pressed.
  3891. pfBufferRealloc allows you to provide a function which will
  3892. attempt to reallocate a larger buffer if the user enters more
  3893. text than will fit in the originally supplied buffer. You should
  3894. only do this if you have dynamically allocated the buffer that
  3895. you initially passed into od_multiline_edit(). If you allocated
  3896. the buffer using malloc() or calloc(), then pfBufferRealloc can
  3897. be set to point to the realloc() function. If you allocated the
  3898. buffer using the C++ new operator, then you must write a your own
  3899. reallocation function which obeys the same semantics as the C
  3900. realloc() function. If no buffer reallocation function is
  3901. provided, then od_multiline_edit() will never allow the user to
  3902. enter more text than will fit in the buffer that you initially
  3903. supply. If you are using the buffer reallocation option, you can
  3904. obtain a pointer to the final buffer, and the size of the final
  3905. buffer, from the pszFinalBuffer and unFinalBufferSize members.
  3906. SEE ALSO od_input_str(), od_edit_str(), od_get_input()
  3907. ===============================================================================
  3908. OpenDoors 6.00 Manual End of Page 103
  3909. OD_PAGE()
  3910. -------------------------------------------------------------------------------
  3911. PURPOSE Function to allow user to page the sysop
  3912. FORMAT void od_page(void);
  3913. RETURNS N/A
  3914. DESCRIPTION This function can be called to allow the user to page the sysop.
  3915. This function will ask the user why they wish to chat with the
  3916. sysop, and then page the sysop. The sysop will then be free to
  3917. break into chat at any time. Sysop paging will also be aborted
  3918. by the user, simply by pressing [Enter] when asked for a reason
  3919. for chat. When the user pages the sysop, the [Wants-Chat]
  3920. indicator will begin to flash on the main status line, and the
  3921. status line will switch to show the user's reason for wanting to
  3922. chat. Also, the user's total number of pages will be
  3923. incremented.
  3924. Depending upon the setting of the od_control.od_okaytopage
  3925. variable, this function will also optionally check sysop paging
  3926. hours, and only allow the user to page the sysop during valid
  3927. paging hours. For information on the variables containing the
  3928. user's total number of pages, the user's want-chat status, valid
  3929. sysop paging hours, and the od_control.od_okaytopage variable,
  3930. see the section on the OpenDoors control structure, which begins
  3931. on page 148.
  3932. EXAMPLE For an example of the use of the od_page() function, see the
  3933. EX_VOTE.C example program, which is described beginning on page
  3934. 38.
  3935. ===============================================================================
  3936. OpenDoors 6.00 Manual End of Page 104
  3937. OD_PARSE_CMD_LINE()
  3938. -------------------------------------------------------------------------------
  3939. PURPOSE Handles standard command line options.
  3940. FORMAT Under DOS Version:
  3941. void od_parse_cmd_line(INT nArgCount, char *papszArguments[]);
  3942. Under Win32 Version:
  3943. void od_parse_cmd_line(LPSTR pszCmdLine);
  3944. RETURNS N/A
  3945. DESCRIPTION This is the only OpenDoors function that uses a different
  3946. calling format in the DOS and Win32 versions of OpenDoors. The
  3947. reason for this is that od_parse_cmd_line() always allows you to
  3948. pass command line parameters in the same format that the
  3949. operating system passes them to you. Under the DOS version of
  3950. OpenDoors, you should pass the argc and argv values that were
  3951. passed to your main function as the two parameters to
  3952. od_parse_cmd_line(). Under the Win32 version of OpenDoors, you
  3953. should pass the pszCmdLine values that were passed to your
  3954. WinMain() function as the one parameter to od_parse_cmd_line().
  3955. The od_parse_cmd_line() function should be called before your
  3956. first call to any other OpenDoors function, with the possible
  3957. exception of the od_add_personality() function.
  3958. It is recommended that any program which uses OpenDoors call
  3959. od_parse_cmd_line() as part of its startup procedure. This
  3960. allows your program to automatically handle many common command
  3961. line options that will make it easier to setup and run your
  3962. program. Among the helpful command line options processed by
  3963. od_parse_cmd_line() are options to set serial port information
  3964. (including information on non-standard serial port setups),
  3965. specify the location of configuration and drop files, force the
  3966. program to run in silent mode (without no local display), pass
  3967. in user information, and the ability to start the program in
  3968. local mode without a drop file. For a complete list of the
  3969. options supported by od_parse_cmd_line(), run the example Vote
  3970. door that is included in the OpenDoors packages, specifying -
  3971. help on the command line.
  3972. If you wish to process your own command line parameters in
  3973. addition to those supported by OpenDoors, simply check the
  3974. command-line for your own parameters after calling
  3975. od_parse_cmd_line(). You can do this in the same way that you
  3976. would handle command line options if you weren't using
  3977. od_parse_cmd_line(). The od_parse_cmd_line() function does not
  3978. ===============================================================================
  3979. OpenDoors 6.00 Manual End of Page 105
  3980. generate an error message if it encounters unrecognized command
  3981. line options. You can supply your own text to display when the
  3982. user chooses the /Help option by setting
  3983. od_control.od_cmd_line_help to point to your own string. Separate
  3984. lines in your string with the \n character, and align text using
  3985. the \t character.
  3986. SEE ALSO od_init()
  3987. EXAMPLE The following example shows how a program that uses
  3988. od_parse_cmd_line() should be structured in order to compile
  3989. under either DOS or Win32 versions of OpenDoors:
  3990. #include "opendoor.h"
  3991. /* main() or WinMain() function - Program begins here. */
  3992. #ifdef ODPLAT_WIN32
  3993. int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
  3994. LPSTR lpszCmdLine, int nCmdShow)
  3995. #else
  3996. int main(int argc, char *argv[])
  3997. #endif
  3998. {
  3999. #ifdef ODPLAT_WIN32
  4000. #endif
  4001. /* Set program's name for use by OpenDoors. */
  4002. #ifdef ODPLAT_WIN32
  4003. /* In Windows, pass in nCmdShow value to OpenDoors. */
  4004. od_control.od_cmd_show = nCmdShow;
  4005. /* Call od_parse_cmd_line. */
  4006. od_parse_cmd_line(lpszCmdLine);
  4007. #else
  4008. od_parse_cmd_line(argc, argv);
  4009. #endif
  4010. /* Start the rest of your program here. */
  4011. }
  4012. ===============================================================================
  4013. OpenDoors 6.00 Manual End of Page 106
  4014. OD_POPUP_MENU()
  4015. -------------------------------------------------------------------------------
  4016. PURPOSE Creates a popup menu which allows the user to make a selection
  4017. by pressing a single key, or selecting the item with a highlight
  4018. bar. After the user has made a selection, the menu may be
  4019. removed from the screen, restoring the original screen contents
  4020. "beneath" the window.
  4021. FORMAT INT od_popup_menu(char *pszTitle, char *pszText, INT nLeft,
  4022. INT nTop, INT nLevel, WORD uFlags);
  4023. RETURNS POPUP_ERROR On error (od_control.od_error is set to
  4024. indicate type of error).
  4025. POPUP_ESCAPE If user exited menu by pressing [ESCape].
  4026. POPUP_LEFT If user exited menu by pressing the left arrow
  4027. key.
  4028. POPUP_RIGHT If user exited menu by pressing the right arrow
  4029. key.
  4030. Or, a postive integer indicating the menu item that was chosen
  4031. if a selection was made.
  4032. DESCRIPTION od_popup_menu() creates a popup window with a menu of choices,
  4033. for use in ANSI/AVATAR/RIP modes. The user is able to choose an
  4034. item from the menu by moving the highlighted selection bar with
  4035. the arrow keys, or by pressing a key associated with a
  4036. particular menu item. The contents of the menu are defined by
  4037. the string pointed to by the pszText parameter. This menu
  4038. definition string contains each menu option, separated by a '|'
  4039. (pipe) character. Keys associated with each menu entry can be
  4040. defined by proceeding the letter with a '^' (carat) character.
  4041. For example, the string:
  4042. "^Save|^Load|E^xit"
  4043. would produce a menu with three options: Save, Load and Exit.
  4044. The user would be able to select the Save option by pressing the
  4045. [S] key, the Load option by pressing the [L] key, and the Exit
  4046. option by pressing the [X] key. Furthermore, the characters
  4047. corresponding to each menu item would be displayed in a
  4048. highlighted color.
  4049. Menus displayed with od_popup_menu() may optionally have a
  4050. title, as specified by the pszTitle parameter. If this parameter
  4051. is set to NULL, no title will be displayed. If this parameter is
  4052. not NULL, the specified string will be displayed as a title on
  4053. the window.
  4054. ===============================================================================
  4055. OpenDoors 6.00 Manual End of Page 107
  4056. The nLeft and nTop parameters specify the left and top locations
  4057. of the menu window, were 1, 1 is the upper right corner of the
  4058. screen. The bottom and right corners of the menu are
  4059. automatically determined by the size and number of menu entries
  4060. in the menu definition string.
  4061. The nLevel parameter specifies the menu level, an integer from 0
  4062. to 10. Unless you are using the MENU_KEEP flag, this parameter
  4063. can always be 0.
  4064. The uFlags parameter specifies one or more of the following
  4065. options, joined by the bitwise-OR operator (|).
  4066. MENU_NORMAL Has no effect.
  4067. MENU_ALLOW_CANCEL Allow user to exit menu with [ESCape].
  4068. MENU_PULLDOWN Allow exit with arrow keys.
  4069. MENU_KEEP Leave menu active on selection.
  4070. MENU_DESTROY Remove a currently active menu.
  4071. If you are not using any of the other flags, you can use
  4072. MENU_NORMAL as a place-holder for this parameter. If you specify
  4073. MENU_ALLOW_CANCEL, the user will be able to exit the menu
  4074. without making a selection by pressing the [ESCape] key. If the
  4075. user presses [ESCape], od_popup_menu() returns POPUP_ESCAPE.
  4076. You can use the MENU_PULLDOWN option with od_popup_menu() to
  4077. implement a set of pulldown menus. In this case, if the user
  4078. presses the left arrow key or right arrow key while the menu is
  4079. being displayed, od_popup_menu() returns with POPUP_LEFT or
  4080. POPUP_RIGHT, allowing you to display a different menu.
  4081. Normally, od_popup_menu() will remove the menu from the screen
  4082. as soon as the user makes a selection. However, there may be
  4083. some cases when you want the menu to continue to be visible
  4084. after the user makes a selection. For example, you may want some
  4085. menu options to lead to further sub-menus, or you may wish to
  4086. display a popup window, and return to this menu after the user
  4087. has exited from the popup window. If the MENU_KEEP flag is
  4088. specified, the menu will remain active (on-screen) after the
  4089. user makes a selection. However, the menu will still be
  4090. destroyed if the user cancels out of the menu (this will only
  4091. happen if you have specified MENU_ALLOW_CANCEL), or if the user
  4092. moves to another menu by pressing the left or right arrow keys
  4093. (this will only happen if you have specified MENU_PULLDOWN). If
  4094. MENU_KEEP has been specified, and the user makes a selection,
  4095. you must eventually either return to the menu, or destroy it by
  4096. calling MENU_DESTROY. If you want to return to the menu, simply
  4097. call od_popup_menu() again with the same level value that was
  4098. used to originally create the menu. The user will now be able to
  4099. make another selection from the menu, and od_popup_menu() will
  4100. once again return that selection to you. If you want to destroy
  4101. the menu, simply call od_popup_menu() with the MENU_DESTROY flag
  4102. ===============================================================================
  4103. OpenDoors 6.00 Manual End of Page 108
  4104. set, and the same level value that was used to create the
  4105. original menu. If you wish to create another popup menu while
  4106. the first one is still active, simply call od_popup_menu()
  4107. again, this time with a different level value. The colors used
  4108. by the od_popup_menu() function are set by the following
  4109. OpenDoors control structure settings:
  4110. char od_control.od_menu_title_col;
  4111. char od_control.od_menu_border_col;
  4112. char od_control.od_menu_text_col;
  4113. char od_control.od_menu_key_col;
  4114. char od_control.od_menu_highlight_col;
  4115. char od_control.od_menu_highkey_col;
  4116. SEE ALSO od_window_create(), od_window_remove(), od_draw_box(),
  4117. od_hotkey_menu()
  4118. EXAMPLE The following example shows the use of multiple-level menus:
  4119. #include <stdlib.h>
  4120. #include "opendoor.h"
  4121. main()
  4122. {
  4123. for(;;)
  4124. {
  4125. switch(od_popup_menu("Main Menu",
  4126. "^Files|^Electronic Mail|^News|E^xit",
  4127. 20, 5, 0, MENU_NORMAL | MENU_KEEP))
  4128. {
  4129. case 1:
  4130. od_popup_menu("Files Menu",
  4131. "^Search For Files|^Download|^Upload",
  4132. 30, 7, 2, MENU_NORMAL | MENU_ALLOW_CANCEL);
  4133. break;
  4134. case 2:
  4135. od_popup_menu("EMail Menu",
  4136. "Get ^New Mail|^Send Mail|Send ^Fax",
  4137. 30, 8, 1, MENU_NORMAL | MENU_ALLOW_CANCEL);
  4138. break;
  4139. case 3:
  4140. od_popup_menu("News Menu",
  4141. "Choose News^Group|^Read News|^Post News",
  4142. 30, 9, 1, MENU_NORMAL | MENU_ALLOW_CANCEL);
  4143. break;
  4144. case 4:
  4145. od_popup_menu(NULL, NULL, 0, 0, 0, MENU_DESTROY);
  4146. return(0);
  4147. }
  4148. }
  4149. }
  4150. ===============================================================================
  4151. OpenDoors 6.00 Manual End of Page 109
  4152. OD_PRINTF()
  4153. -------------------------------------------------------------------------------
  4154. PURPOSE Performs formatted output (remote & local), with the ability to
  4155. change display colors.
  4156. FORMAT void od_printf(char * pszFormat,...);
  4157. RETURNS N/A
  4158. DESCRIPTION This is one of two OpenDoors function which allows you to
  4159. display a string of characters, the other being the
  4160. od_disp_str() function. For a complete comparison of the various
  4161. OpenDoors display function, see the description of the
  4162. od_disp_str() function, on page 63. Like the od_disp_str()
  4163. function, the od_printf() function will display its output both
  4164. on the local screen, and on the remote user's screen (if the
  4165. door is not operating in local mode). However, the od_printf()
  4166. function also allows for formatted output, just as the printf()
  4167. function does. In addition to providing all of the features of
  4168. the normal C printf() function, the od_printf() function allows
  4169. you to include codes to change the color of the display of text.
  4170. This unique feature allows you to display multi-colored text,
  4171. without having to use chains of alternating od_disp_str() and
  4172. od_set_color() calls.
  4173. As with the printf() function, the od_printf() function accepts
  4174. one or more parameters, the first parameter being the format
  4175. string to be displayed, and the additional parameters being data
  4176. to be displayed within the string. The OpenDoors od_printf()
  4177. function recognizes all of the control characters and options
  4178. recognized by the normal printf() function. For example, to
  4179. display the amount of time that a user has left online, the
  4180. following line would be a valid use of the od_printf() function:
  4181. od_printf("Time Left:%d\n\r", od_control.user_timelimit);
  4182. Note that a full discussion of the printf() function is beyond
  4183. the scope of this manual. For more information on using
  4184. printf(), please see your Turbo C(++) / Borland C++ manuals.
  4185. In addition to the normal control sequences, such as "%s", "%d",
  4186. or "%12.12s", the od_printf() function also allows you to
  4187. include special color-setting codes within the format string.
  4188. These color code sequences BEGIN and END with a delimiter
  4189. character, which is used to indicate that the sequence is a
  4190. color setting. Consider, for example, the following line of
  4191. code, which displays text in various colors:
  4192. ===============================================================================
  4193. OpenDoors 6.00 Manual End of Page 110
  4194. od_printf("`blue`Blue `green`Green `red`Red \n\r");
  4195. In this case (assuming of course that a color monitor is being
  4196. used) the word "Blue" will be displayed in the color blue, the
  4197. word "Green" will be displayed in the color green, and the word
  4198. "Red" will be displayed in the color red. In this case, the
  4199. sequence `blue` sets the display color to dark blue on black.
  4200. Here, the back-quote (`) is the delimiter character which
  4201. indicates the beginning and end of the color sequence. Be sure
  4202. not to confuse the back-quote character (`) with the normal
  4203. forward quote ('). THIS IS THE MOST COMMON DIFFICULTY
  4204. EXPERIENCED WITH THE OD_PRINTF() FUNCTION. The text between the
  4205. back-quote characters indicates the color that should be set.
  4206. This text can include the name of the foreground color, the name
  4207. of the background color, the "bright" keyword and the "flashing"
  4208. keyword. The first color mentioned is taken to be the foreground
  4209. color, and the second the background color. Case is not
  4210. sensitive, additional words can be included for legibility.
  4211. Thus:
  4212. `bright white cyan`
  4213. is equivalent to:
  4214. `Bright white on a cyan background`.
  4215. The "bright" keyword indicates that the foreground color should
  4216. be displayed in high intensity, and the "flashing" keyword
  4217. indicates that the text should be flashing. If no background is
  4218. specified, the background color defaults to black. If no
  4219. foreground or background colors are specified, the color
  4220. defaults to white on black.
  4221. The od_printf() function will automatically determine whether
  4222. the user has ANSI, AVATAR or RIP graphics enabled, and will send
  4223. the appropriate color codes to change the color of displayed
  4224. text. If the user does not have either ANSI or AVATAR graphics
  4225. modes turned on, then the od_printf() function will not send any
  4226. color codes. Thus, a door program using color codes would work
  4227. just as well when ANSI/AVATAR/RIP graphics are not available,
  4228. except that all text will appear in the same color.
  4229. You may prefer to set colors by using the od_set_color() or
  4230. od_set_attrib() functions, instead of using these cryptic color
  4231. codes imbedded in od_printf() functions. In some cases, however,
  4232. it will be much more advantageous to place the color codes
  4233. within your od_printf() strings. As a case in point, consider
  4234. the single od_printf() statement in the example, above. To
  4235. accomplish the same result using the od_disp_str() and
  4236. od_set_color() functions, you would have to use the following
  4237. SIX function calls:
  4238. ===============================================================================
  4239. OpenDoors 6.00 Manual End of Page 111
  4240. od_set_color(D_BLUE,D_BLACK);
  4241. od_disp_str("Blue ");
  4242. od_set_color(D_GREEN,D_BLACK);
  4243. od_disp_str("Green ");
  4244. od_set_color(D_RED,D_BLACK);
  4245. od_disp_str("Red \n\r");
  4246. While this method MAY be easier understand, it certainly
  4247. requires many more line of code to accomplish. However, either
  4248. method will work, and the choice is up to you as to which method
  4249. you prefer. Keep in mind, however, that if the color to be set
  4250. is stored in a variable, instead of always being the same color,
  4251. you must use either the od_set_color() or od_set_attrib()
  4252. function to set the display color.
  4253. While the back-quote (`) character is normally used to delimit a
  4254. color sequence in the od_printf() function, you may wish to be
  4255. able to print a back-quote character using the od_printf()
  4256. function. In this case, you may configure OpenDoors to use a
  4257. different character to represent color code sequences. To do
  4258. this, simply use the od_control.od_color_delimiter variable,
  4259. which is described in the OpenDoors control structure section,
  4260. beginning on page 148. For example, if you wished to use the
  4261. tilde (~) character instead of the back-quote character to
  4262. change colors, simply place the following line within your
  4263. program, at some point after having called od_init() or some
  4264. OpenDoors function:
  4265. od_control.od_color_delimiter='~';
  4266. Also, you may disable the color code interpretation within the
  4267. od_printf() function altogether, by setting the
  4268. od_control.od_color_delimiter variable to 0.
  4269. Note that the od_printf() function interprets the color codes
  4270. AFTER parsing the other control sequences, such as "%d" or "%s".
  4271. Thus, if you used the command:
  4272. od_printf("%s",string);
  4273. Any color codes contained in the string "string" would also be
  4274. interpreted. If you did not wish to have any color code
  4275. characters which might be contained in the string "string"
  4276. treated as such, you could again disable od_printf()'s color
  4277. code interpretation, by setting the od_control.od_color_char
  4278. variable to 0.
  4279. Note that the string to be displayed by od_printf() should not
  4280. exceed 511 characters in size, including the size of color
  4281. sequences and expanded % fields.
  4282. ===============================================================================
  4283. OpenDoors 6.00 Manual End of Page 112
  4284. SEE ALSO od_disp_str(), od_disp(), od_putch(), od_repeat(), od_disp_emu()
  4285. EXAMPLE Below is a simple example of a user statistics door program,
  4286. which displays various pieces of information to the user, by
  4287. using the od_printf() function. Notice the use of color code
  4288. sequences in order to display the titles in a different color
  4289. from the information fields. Note that since the information
  4290. available to this door will depend on the BBS system under which
  4291. it is running, not all of the information displayed by this door
  4292. will be available under all BBS systems. For a description of
  4293. what information is available under what BBS systems, see the
  4294. OpenDoors control structure portion of this manual, which begins
  4295. on page 148.
  4296. #include "opendoor.h"
  4297. int main(int argc,char *argv[])
  4298. {
  4299. od_init(); /* Begin OpenDoors program */
  4300. od_printf("`bright white` YOUR STATISTICS\n\r"); /* Display title */
  4301. od_printf("---------------\n\r\n\r");
  4302. /* Display statistics */
  4303. od_printf("`red`NAME : `blue`%s\n\r",od_control.user_logintime);
  4304. od_printf("`red`LOCATION : `blue`%s\n\r",od_control.user_location);
  4305. od_printf("`red`PHONE NUMBER : `blue`%s\n\r",od_control.user_homephone);
  4306. od_printf("`red`LAST CALL : `blue`%s\n\r",od_control.user_lastdate);
  4307. od_printf("`red`NUMBER OF CALLS : `blue`%u\n\r",od_control.user_numcalls);
  4308. od_printf("`red`NUMBER OF PAGES : `blue`%u\n\r",od_control.user_numpages);
  4309. od_printf("`red`REMAINING TIME : `blue`%d\n\r",od_control.user_timelimit);
  4310. od_printf("`red`# OF DOWNLOADS : `blue`%u\n\r",od_control.user_downloads);
  4311. od_printf("`red`# OF UPLOADS : `blue`%u\n\r",od_control.user_uploads);
  4312. od_printf("`red`KBYTES DL TODAY : `blue`%u\n\r",od_control.user_todayk);
  4313. /* Ask user to press [Enter] */
  4314. od_printf("`bright green on green`Press [Enter] to return to BBS...\n\r");
  4315. while(od_get_key(TRUE)!=13); /* Wait for user to press [Enter] */
  4316. od_exit(20,FALSE); /* Return to BBS */
  4317. }
  4318. HELPFUL This section demonstrates use of the od_printf() color
  4319. HINT sequences imbedded directly in the printf() format string, such
  4320. as:
  4321. od_printf("Hello `bright green` there!");
  4322. ===============================================================================
  4323. OpenDoors 6.00 Manual End of Page 113
  4324. However, there are also other ways that you can take advantage
  4325. of this feature. For example, the C programming language
  4326. concatenates string constants that are separated only by white
  4327. space or carriage returns. For instance,
  4328. "Hello " "`bright green`" " there!"
  4329. is equivalent to:
  4330. "Hello `bright green` there!"
  4331. For this reason, you can create macros for common color
  4332. sequences in your program, such as:
  4333. #define HIGHLIGHT "`bright green`"
  4334. You can then use such constants when calling the od_printf()
  4335. function, as follows:
  4336. od_printf("Hello " HIGHLIGHT " there!");
  4337. You may find this method of setting the display color to be
  4338. easier to read, and more easily configurable than including the
  4339. color sequence directly in the format string. Below another use
  4340. of the color sequences is describe, which allows the colors used
  4341. by od_printf() not be "hard-wired".
  4342. Since color control sequences are evaluated by od_printf() after
  4343. it evaluates all format sequences (such as "%d"). For this
  4344. reason, it is possible to change the display color using a
  4345. string variable, instead of using a fixed color in the string.
  4346. For example, if you program had the variable:
  4347. char highlight[40];
  4348. which was set at some point to be equal to:
  4349. "`bright green`"
  4350. you would be able to use od_printf() as follows:
  4351. od_printf("Hello %s there!", highlight);
  4352. The display color would then be changed at the location where
  4353. the "%s" appears in the od_printf() format string. The advantage
  4354. of using this method to change display colors is that unlike
  4355. other methods, the value of the highlight variable can be
  4356. changed. This could be used, for example, to allow the sysop to
  4357. configure the colors they wish your door to use. You would only
  4358. need to change the value of the highlight variable in order to
  4359. change the color set by od_printf().
  4360. ===============================================================================
  4361. OpenDoors 6.00 Manual End of Page 114
  4362. OD_PUTCH()
  4363. -------------------------------------------------------------------------------
  4364. PURPOSE Function to display a single character.
  4365. FORMAT void od_putch(int chToDisplay);
  4366. RETURNS N/A
  4367. DESCRIPTION This function performs a similar function to the other OpenDoors
  4368. display functions. For information on the uses of the various
  4369. OpenDoors display functions, see the description of the
  4370. od_disp_str() function, on page 63. This function is most
  4371. similar to the od_disp() and od_disp_str() functions, except
  4372. that it only displays a single character at a time.
  4373. This function will display the character passed to it at the
  4374. cursor position in the output window, and then advance the
  4375. cursor to the next display position. If OpenDoors is not
  4376. operating in local mode, the character will also be sent to the
  4377. modem, and thus displayed on the user's screen in the same
  4378. manner that it is displayed on the local screen. If ANSI, AVATAR
  4379. or RIP graphics mode is activated the character will be
  4380. displayed in the current color.
  4381. SEE ALSO od_disp_str(), od_disp(), od_printf(), od_repeat(),
  4382. od_disp_emu()
  4383. EXAMPLE Below is an example of the use of the od_putch() function. This
  4384. example is a function which you could use in place of the
  4385. od_get_key() function. This function inputs a single character
  4386. from the keyboard, just as the od_get_key() function does.
  4387. However, if the character entered is a printable character, the
  4388. function will also echo the character to the local screen, using
  4389. the od_putch() function.
  4390. char get_key_with_echo(int wait)
  4391. {
  4392. char pressed=od_get_key(wait); /* Get key from user */
  4393. if(pressed>=32 && pressed<=126) /* If key is printable */
  4394. {
  4395. od_putch(pressed); /* Display the character */
  4396. }
  4397. return(pressed); /* Return key pressed by user */
  4398. }
  4399. ===============================================================================
  4400. OpenDoors 6.00 Manual End of Page 115
  4401. OD_PUTTEXT()
  4402. -------------------------------------------------------------------------------
  4403. PURPOSE Displays a rectangular region of text and color information, as
  4404. previously stored using od_gettext()
  4405. FORMAT BOOL od_puttext(INT nLeft, INT nTop, INT nRight, INT nBottom,
  4406. void *pBlock);
  4407. RETURNS TRUE on success
  4408. FALSE on failure
  4409. DESCRIPTION This function "pastes" a rectangular block of text and color
  4410. information that has been previously retrieved using
  4411. od_gettext(). The block is placed at the screen location
  4412. indicated by the variables nLeft, nTop, nRight and nBottom,
  4413. where nLeft and nRight are column numbers from 1 - 80, and nTop
  4414. and nBottom are row numbers from 1 - 23. The length and width of
  4415. the rectangle specified by nLeft, nTop, nRight and nBottom must
  4416. be the same as the length and width of the rectangle passed to
  4417. od_gettext() when storing the block of text.
  4418. This function attempts to display the pasted block as quickly as
  4419. possible, only transmitting information on portions of the block
  4420. that are different than the original screen contents. When this
  4421. function returns, it leaves the cursor at its original position,
  4422. and the display color at its original setting. This function
  4423. requires ANSI or AVATAR mode.
  4424. The control structure variable od_control.od_full_put may be set
  4425. to TRUE to force od_puttext() to always send all characters in
  4426. the block to be displayed, instead of only displaying the
  4427. portions of the block that differ from the original screen
  4428. contents. If you wish to save and restore the entire screen, you
  4429. can use od_save_screen() and od_restore_screen(), which work in
  4430. all display modes.
  4431. You may also use the od_puttext() to display a rectangular block
  4432. of text that you generate manually, instead of retrieving using
  4433. od_gettext(). To do this, you pass an array which contains the
  4434. text and color information for the rectangular area to be
  4435. painted, in the pBlock parameter. The array passed to
  4436. od_puttext() contains a two-byte sequence of information for
  4437. each character in the rectangle. The first byte contains the
  4438. ASCII code of the character to be displayed. The second byte
  4439. contains the color attribute value of the character, in the same
  4440. format as used by the od_set_attrib() function (described on
  4441. page 128). These two byte sequences are stored in the order in
  4442. which English is written; the array begins with the two byte
  4443. ===============================================================================
  4444. OpenDoors 6.00 Manual End of Page 116
  4445. sequences for all of the characters on the first line, from left
  4446. to right, followed by the characters for the second line, and so
  4447. on. The length of each line must be exactly equal to the width
  4448. of the rectangular region to be painted.
  4449. SEE ALSO od_gettext(), od_save_screen(), od_restore_screen(),
  4450. od_scroll(), od_window_create(), od_window_remove()
  4451. ===============================================================================
  4452. OpenDoors 6.00 Manual End of Page 117
  4453. OD_REPEAT()
  4454. -------------------------------------------------------------------------------
  4455. PURPOSE Repeatedly display the specified character any number of times,
  4456. using special graphics codes for greater speed, if possible.
  4457. FORMAT void od_repeat(char chValue, BYTE btTimes);
  4458. RETURNS N/A
  4459. DESCRIPTION This display function will repeatedly display the character
  4460. chValue, btTimes times. For a complete breakdown of the various
  4461. OpenDoors display functions, see the description of the
  4462. od_disp_str() function, located on page 63.
  4463. The advantage of using this function to display a series of
  4464. identical characters is that this function will use special
  4465. graphics-mode control sequences to display the repeated
  4466. character very efficiently, if the required graphics mode is
  4467. available. For example, in AVATAR mode, this function can
  4468. display an entire line of one character, by sending a control
  4469. sequence to the modem that is only three characters long. If
  4470. graphics mode is not turned on, then the od_disp_str() function
  4471. will simply send the specified character the appropriate number
  4472. of times. As with the other display functions, the output of
  4473. this function is sent to both the local and remote screens.
  4474. SEE ALSO od_putch(), od_disp_str(), od_disp(), od_printf(), od_disp_emu()
  4475. EXAMPLE The example function below demonstrates the use of the
  4476. od_repeat() function in drawing a window (a square box) on the
  4477. screen. This function is essentially a simplified version of the
  4478. od_draw_box() function, which is described on page 65. Unlike
  4479. this function, the od_draw_box() function allows the
  4480. customization of the characters used to draw the box's boarder,
  4481. and if possible uses additional AVATAR graphics codes to display
  4482. the window even faster than this function does. Thus, the
  4483. function below is really provided for demonstration purposes
  4484. only.
  4485. This function accepts four parameters, which indicate the
  4486. location of the upper left and lower right corners of the window
  4487. to be displayed. The function then displays the window with the
  4488. current color attribute settings. Since this function uses the
  4489. od_repeat() function, if AVATAR graphics are available, it can
  4490. display the entire window in a fraction of a second, even if it
  4491. is displaying a window the size of the entire screen at slow
  4492. ===============================================================================
  4493. OpenDoors 6.00 Manual End of Page 118
  4494. baud rates. Note that this window display function requires that
  4495. the user has ANSI, AVATAR or RIP graphics mode enabled.
  4496. void draw_window(char left, char top, char right, char bottom)
  4497. {
  4498. char line_counter; /* Number of current line being drawn */
  4499. char between_size=(right-left)-1; /* X size of window */
  4500. od_set_cursor(top,left); /* move to top corner */
  4501. od_putch(218); /* display corner character */
  4502. od_repeat(196,between_size); /* display top line */
  4503. od_putch(191); /* display corner character */
  4504. /* loop through middle lines of window */
  4505. for(line_counter=top+1;line_counter<bottom;++line_counter)
  4506. {
  4507. od_set_cursor(line_counter,left); /* move to line start */
  4508. od_putch(179); /* display left line char */
  4509. od_repeat(' ',between_size); /* display blank area */
  4510. od_putch(179); /* display right line char */
  4511. }
  4512. od_set_cursor(bottom,left); /* move to bottom corner */
  4513. od_putch(192); /* display corner character */
  4514. od_repeat(196,between_size); /* display bottom line */
  4515. od_putch(217); /* display corner character */
  4516. }
  4517. ===============================================================================
  4518. OpenDoors 6.00 Manual End of Page 119
  4519. OD_RESTORE_SCREEN()
  4520. -------------------------------------------------------------------------------
  4521. PURPOSE Restores the screen contents as previous saved using the
  4522. od_save_screen() function. This function can be used in any
  4523. display mode.
  4524. FORMAT BOOL od_restore_screen(void *pBuffer);
  4525. RETURNS TRUE on success
  4526. FALSE on failure
  4527. DESCRIPTION This function restores the entire contents of the screen, along
  4528. with the current cursor position and display color, which was
  4529. previously stored using the od_save_screen() function. Unlike
  4530. the od_get_text() and od_put_text() functions, the
  4531. od_save_screen() and od_restore_screen() functions will work in
  4532. all display modes (ASCII, ANSI, AVATAR and RIP).
  4533. The pBuffer parameter must point to the buffer previously passed
  4534. to od_save_screen(). Note that the od_save_screen() and
  4535. od_restore_screen() functions save the stored information in
  4536. different formats than the od_getttext() and od_puttext()
  4537. functions. For this reason, you cannot save the screen contents
  4538. with od_gettext() and restore them with od_restore_screen(), or
  4539. visa-versa.
  4540. If this function fails for any reason, a value of FALSE is
  4541. returned, and the od_control.od_error variable is set to
  4542. indicate the reason for the failure. For more information on the
  4543. od_control.od_error variable, see page 185.
  4544. SEE ALSO od_save_screen(), od_gettext(), od_puttext(), od_clr_scr()
  4545. EXAMPLE For an example of how to use the od_restore_screen() function,
  4546. see the example which accompanies the od_save_screen() function,
  4547. on page 121.
  4548. ===============================================================================
  4549. OpenDoors 6.00 Manual End of Page 120
  4550. OD_SAVE_SCREEN()
  4551. -------------------------------------------------------------------------------
  4552. PURPOSE Saves the contents of the screen, to later be restored using
  4553. od_restore_screen(). Can be used in any display mode.
  4554. FORMAT BOOL od_save_screen(void *pBuffer);
  4555. RETURNS TRUE on success
  4556. FALSE on failure
  4557. DESCRIPTION This function saves the entire contents of the screen, along
  4558. with the current cursor position and display color, to be later
  4559. restored using the od_restore_screen() function. Unlike the
  4560. od_get_text() and od_put_text() functions, the od_save_screen()
  4561. and od_restore_screen() functions will work in all display modes
  4562. (ASCII, ANSI, AVATAR and RIP).
  4563. The pBuffer parameter should point to a buffer where the current
  4564. screen information is to be stored. This buffer must be at least
  4565. 4004 bytes in size.
  4566. Note that the od_save_screen() and od_restore_screen() functions
  4567. save the stored screen information in different formats than the
  4568. od_getttext() and od_puttext() functions. For this reason, you
  4569. cannot save the screen contents with od_save_screen() and
  4570. restore them with od_puttext(), or visa-versa.
  4571. Also, note that when used in RIP graphics mode, this function
  4572. only saves and restores textual information, and not bit-mapped
  4573. graphical information.
  4574. If this function fails for any reason, a value of FALSE is
  4575. returned, and the od_control.od_error variable is set to
  4576. indicate the reason for the failure. For more information on the
  4577. od_control.od_error variable, see page 185.
  4578. SEE ALSO od_restore_screen(), od_gettext(), od_puttext(), od_clr_scr()
  4579. EXAMPLE One case where you might wish to save and restore the contents
  4580. of the screen is when sysop chat mode is activated. This can be
  4581. accomplished by using the od_control.od_cbefore_chat and
  4582. od_control.od_cafter_chat variables. The following example
  4583. causes the screen contents to be saved and the entire screen
  4584. cleared, prior to entering sysop chat mode when the sysop
  4585. presses the "chat key". When the sysop ends chat mode, the
  4586. ===============================================================================
  4587. OpenDoors 6.00 Manual End of Page 121
  4588. user's original screen is restored, and the user will be able to
  4589. continue working in the door as though nothing had happened.
  4590. Code to perform screen saving and restoring:
  4591. /* Function prototypes */
  4592. void before_chat_function(void);
  4593. void after_chat_function(void);
  4594. /* Buffer to hold contents of screen prior to chat */
  4595. char before_chat_buffer[4004];
  4596. /* Variable to store whether screen save was successful */
  4597. char before_chat_saved = FALSE;
  4598. /* Function which is called prior to entering chat mode */
  4599. void before_chat_function(void)
  4600. {
  4601. /* Store current screen contents */
  4602. before_chat_saved = od_save_screen(before_chat_buffer);
  4603. /* Present a blank screen for chat mode */
  4604. od_clr_scr();
  4605. }
  4606. /* Function which is called after exiting chat mode */
  4607. void after_chat_function(void)
  4608. {
  4609. /* If screen was successfully saved prior to chat */
  4610. if(before_chat_saved)
  4611. {
  4612. /* Restore original screen contents */
  4613. od_restore_screen(before_chat_buffer);
  4614. }
  4615. }
  4616. Code included in main() function to enable screen saving and
  4617. restoring code:
  4618. od_control.od_cbefore_chat = before_chat_function;
  4619. od_control.od_cafter_chat = after_chat_function;
  4620. ===============================================================================
  4621. OpenDoors 6.00 Manual End of Page 122
  4622. OD_SCROLL()
  4623. -------------------------------------------------------------------------------
  4624. PURPOSE Scrolls any rectangular area of the screen a specified number of
  4625. lines upwards or downwards. Requires ANSI/AVATAR/RIP graphics
  4626. mode to be active.
  4627. FORMAT BOOL od_scroll(INT nLeft, INT nTop, INT nRight, INT nBottom,
  4628. INT nDistance, WORD nFlags);
  4629. RETURNS TRUE on success
  4630. FALSE on FAILURE
  4631. DESCRIPTION This function scrolls a rectangular area of the screen described
  4632. by the parameters nLeft, nTop, nRight and nBottom. The
  4633. parameters nLeft and nRight are column numbers from 1 - 80, and
  4634. the parameters nTop and nBottom are row numbers from 1 - 23.
  4635. The parameter nDistance indicates the direction and number of
  4636. lines to scroll the text in the specified area. Positive values
  4637. denote moving the text upwards, and negative values denote
  4638. moving the text downwards.
  4639. The new lines created by scrolling text will appear in the
  4640. current color. When this function returns, it leaves the cursor
  4641. at its original position, and the display color at its original
  4642. setting. This function requires ANSI or AVATAR modes. If ANSI
  4643. mode is active, this function is equivalent to calling
  4644. od_gettext(), od_puttext(), and then sending addition codes to
  4645. the modem clear the newly created lines. In ANSI mode, scrolling
  4646. can be accomplished more quickly if the area to be scrolled is
  4647. equal in width to the entire screen. This is because the
  4648. clearing of newly created lines is done by sending a simple
  4649. control sequence, instead of a line of space characters. If
  4650. AVATAR mode is active, scrolling of the window is accomplished
  4651. by sending a single 6-byte control sequence.
  4652. The last parameter to od_scroll(), nFlags, should normally be
  4653. set to SCROLL_NORMAL. However, if you set nFlags to
  4654. SCROLL_NO_CLEAR, the newly created lines at the top or bottom of
  4655. the screen are not cleared if it would take longer to do so.
  4656. SEE ALSO od_gettext(), od_puttext(), od_window_create(),
  4657. od_window_remove()
  4658. EXAMPLE For an example of a program which uses the od_scroll() function,
  4659. see the ex_chat.c example program, described on page 38.
  4660. ===============================================================================
  4661. OpenDoors 6.00 Manual End of Page 123
  4662. OD_SEND_FILE()
  4663. -------------------------------------------------------------------------------
  4664. PURPOSE Sends an ASCII/ANSI/AVATAR/RIP file from disk, using terminal
  4665. emulation.
  4666. FORMAT BOOL od_send_file(char *pszFileName);
  4667. RETURNS TRUE if the file was successfully sent
  4668. FALSE if OpenDoors was unable to send the file
  4669. DESCRIPTION: This powerful function will display any ASCII, ANSI, AVATAR or
  4670. RIP file. The od_send_file() function can be used to display
  4671. existing BBS text files, such as a "logoff screen", before your
  4672. door hangs up on the user. You can also make use of the
  4673. od_send_file() function to build many of your door screens as
  4674. external files. This will allow you to easily create these
  4675. screens in an ANSI editor program, such as "TheDraw". It will
  4676. could also optionally allow sysops to customize your door for
  4677. use on their own BBS.
  4678. The od_send_file() function is called with the full path and
  4679. filename of the file you wish to have displayed. Thus, if you
  4680. wished to send the ANSI file MAINMENU.SCR, you would simply
  4681. call:
  4682. od_send_file("MAINMENU.SCR");
  4683. In many cases, instead of having just one file that you want
  4684. displayed in particular, you will have several different files,
  4685. and will want a different one displayed according to the user's
  4686. graphics mode. For example, you might have the four files,
  4687. MAINMENU.ASC, MAINMENU.ANS, MAINMENU.AVT and MAINMENU.RIP; the
  4688. .ASC file containing no special control codes, the .ANS file
  4689. containing ANSI control codes, the .AVT file containing AVATAR
  4690. control codes, and the .RIP file containing RIP graphics control
  4691. codes. In this case, you can have the od_send_file() function
  4692. automatically select the appropriate file according to the
  4693. user's current display mode, by omitting the extension
  4694. altogether. Thus, a call to:
  4695. od_send_file("MAINMENU");
  4696. would cause OpenDoors to automatically send the appropriate
  4697. file, according to the user's graphics mode settings. When the
  4698. od_send_file() function is used in this "automatic mode" (where
  4699. you do not specify a filename extension), it will look for one
  4700. of the four filename extensions listed below.
  4701. ===============================================================================
  4702. OpenDoors 6.00 Manual End of Page 124
  4703. +----------------------------------------------------------+
  4704. | Extension| File type |
  4705. +----------+-----------------------------------------------|
  4706. | .ASC | Does not require any graphics mode to display |
  4707. | .ANS | Requires ANSI graphics mode to display |
  4708. | .AVT | Requires AVATAR graphics mode to display |
  4709. | .RIP | Requires RIP graphics mode to be displayed |
  4710. +----------------------------------------------------------+
  4711. If the user has RIP graphics enabled, od_send_file() will first
  4712. search for the .RIP file. If no file exists with the specified
  4713. filename and a .RIP extension, od_send_file() will then search
  4714. for .AVT, then .ANS, and if not found .ASC. If the user has only
  4715. ANSI graphics enabled, od_send_file() will attempt first to
  4716. display the .ANS file, and if not found will search for .ASC. In
  4717. the case that the user is using plain-ASCII mode, this function
  4718. will attempt only to display the .ASC file.
  4719. When displaying a .RIP file to the remote system, OpenDoors will
  4720. attempt to locate and display a corresponding .AVT/.ANS/.ASC
  4721. file on the local system. If no such file can be found, a window
  4722. will be displayed, indicating the name of the .RIP file that is
  4723. being sent to the remote system. When a .RIP file is being
  4724. displayed, page pausing is disabled.
  4725. When displaying .AVT/.ANS/.ASC files, od_send_file() will send
  4726. any ANSI or AVATAR codes in the file directly to the remote
  4727. terminal, and interpret them to display on the local screen
  4728. (regardless of the actual filename extension). This
  4729. interpretation is accomplished by OpenDoor's built in terminal
  4730. emulator. The terminal emulator fully supports all ANSI and
  4731. AVATAR level 0 and level 0+ control codes. The terminal emulator
  4732. will also translate Remote Access/QuickBBS style control codes,
  4733. if enabled by setting od_control.od_no_ra_codes to FALSE. The
  4734. control codes supported by OpenDoors are listed in the chart on
  4735. the following pages. When these control codes are inserted into
  4736. the file, OpenDoors will replace them with various pieces of
  4737. user or system information.
  4738. ===============================================================================
  4739. OpenDoors 6.00 Manual End of Page 125
  4740. +-----------------------------------------------------+
  4741. | CONTROL | ASCII | |
  4742. | CODE | VALUE | DESCRIPTION |
  4743. +---------+-------+-----------------------------------|
  4744. | ^FA | 06,65 | Displays the user's full name |
  4745. | ^FB | 06,66 | Location the user is calling from |
  4746. | ^FC | 06,67 | Displays the user's password |
  4747. | ^FD | 06,68 | Business/data phone number |
  4748. | ^FE | 06,69 | Home/voice phone number |
  4749. | ^FF | 06,70 | Date of the user's last call |
  4750. | ^FG | 06,71 | Time of day of the last call |
  4751. | ^FH | 06,72 | The user's `A' flags settings |
  4752. | ^FI | 06,73 | The user's `B' flags settings |
  4753. | ^FJ | 06,74 | The user's `C' flags settings |
  4754. | ^FK | 06,75 | The user's `D' flags settings |
  4755. | ^FL | 06,76 | User's remaining netmail credit |
  4756. | ^FM | 06,77 | Number of messages posted by user |
  4757. | ^FN | 06,78 | Last read message number by user |
  4758. | ^FO | 06,79 | Displays security level of user |
  4759. | ^FP | 06,80 | Number of times user has called |
  4760. | ^FQ | 06,81 | Total # of uploads by user |
  4761. | ^FR | 06,82 | Total KBytes uploaded by user |
  4762. | ^FS | 06,83 | Total # of downloads by user |
  4763. | ^FT | 06,84 | Total Kbytes downloaded by user |
  4764. | ^FU | 06,85 | # of minute user has used today |
  4765. | ^FV | 06,86 | User's screen length setting |
  4766. | ^FW | 06,87 | User's first name only |
  4767. | ^FX | 06,88 | User's ANSI setting |
  4768. | ^FY | 06,89 | User's "continue?" prompt setting |
  4769. | ^FZ | 06,90 | Does user have screen clearing on |
  4770. | ^F0 | 06,48 | User's Full-screen editor setting |
  4771. | ^F1 | 06,49 | User's Quiet mode setting |
  4772. | ^F2 | 06,50 | User's hot-keys setting |
  4773. | ^F3 | 06,51 | Displays the user's alias |
  4774. | ^F4 | 06,52 | The date of the User's first call |
  4775. | ^F5 | 06,53 | The user's date of birth |
  4776. | ^F6 | 06,54 | User's subscription expiry date |
  4777. | ^F7 | 06,55 | Number of days until expiry |
  4778. | ^F8 | 06,56 | User's AVATAR setting |
  4779. | ^F9 | 06,57 | The user's upload:download ratio |
  4780. | ^F: | 06,58 | User's Upload K:download K ratio |
  4781. +-----------------------------------------------------+
  4782. ===============================================================================
  4783. OpenDoors 6.00 Manual End of Page 126
  4784. +-----------------------------------------------------+
  4785. | CONTROL | ASCII | |
  4786. | CODE | VALUE | DESCRIPTION |
  4787. +---------+-------+-----------------------------------|
  4788. | ^F; | 06,59 | Full-screen message reader |
  4789. | ^KA | 11,65 | Total # of calls BBS has received |
  4790. | ^KB | 11,66 | Name of the last caller to BBS |
  4791. | ^KC | 11,67 | Total # of active messages on BBS |
  4792. | ^KD | 11,68 | Displays # of the first message |
  4793. | ^KE | 11,69 | Displays # of the last message |
  4794. | ^KF | 11,70 | # of times user has paged sysop |
  4795. | ^KG | 11,71 | Full name of the current weekday |
  4796. | ^KH | 11,72 | Displays total number of users |
  4797. | ^KI | 11,73 | Displays the current time |
  4798. | ^KJ | 11,74 | Displays the current date |
  4799. | ^KK | 11,75 | Minutes the user has been online |
  4800. | ^KL | 11,76 | Seconds the user has been online |
  4801. | ^KM | 11,77 | Minutes the user has used today |
  4802. | ^KN | 11,78 | Seconds the user has used today |
  4803. | ^KO | 11,79 | Minutes remaining for user today |
  4804. | ^KP | 11,80 | Seconds remaining for user today |
  4805. | ^KQ | 11,81 | The user's daily time limit |
  4806. | ^KR | 11,82 | Displays the current baud rate |
  4807. | ^KS | 11,83 | The current weekday in short-form |
  4808. | ^KT | 11,84 | The user's daily download limit |
  4809. | ^KU | 11,85 | # of minutes until the next event |
  4810. | ^KV | 11,86 | Time of the next system event |
  4811. | ^KW | 11,87 | # of node user is currently on |
  4812. | ^KX | 11,88 | Disconnects the user |
  4813. +-----------------------------------------------------+
  4814. SEE ALSO od_disp_emu(), od_list_files(), od_hotkey_menu()
  4815. EXAMPLE For an example of the use of the od_send_file() function in
  4816. displaying a custom door menu, see the EX_VOTE.C example
  4817. program, which is described beginning on page 38.
  4818. ===============================================================================
  4819. OpenDoors 6.00 Manual End of Page 127
  4820. OD_SET_ATTRIB()
  4821. -------------------------------------------------------------------------------
  4822. PURPOSE Function to change the text color in ANSI or AVATAR mode, using
  4823. a single IBM-PC color attribute value.
  4824. FORMAT void od_set_attrib(INT nColor);
  4825. RETURNS N/A
  4826. DESCRIPTION od_set_attrib() is one of two functions which change the color
  4827. of the currently displayed text. This function allows you to set
  4828. the text color using a single IBM-PC style color attribute. On
  4829. the other hand, the od_set_color() function allows you to set
  4830. the display color by specifying a foreground and background text
  4831. color. Generally speaking, which of these two functions you use
  4832. will be only a matter of personal preference. You will, however,
  4833. most likely find it more convenient to use the od_set_color()
  4834. function for changing display color. However the od_set_attrib()
  4835. offers the advantage of allowing you to manipulate the color to
  4836. be displayed as a single value, instead of two separate values.
  4837. This could be convenient, for example, when displaying text in a
  4838. user configured color. Using a single byte to represent the
  4839. color will likely be easier than using two. An alternative
  4840. method of setting the color of displayed text is to include the
  4841. color codes within a string displayed by the od_printf()
  4842. function. The benefits of doing this, along with instructions on
  4843. how to do this, are described in the section on the od_printf()
  4844. function, which begins on page 110.
  4845. This function will only have an effect if the user has ANSI,
  4846. AVATAR or RIP modes enabled. As a result, you can use this
  4847. function within your door program, and have your text
  4848. automatically displayed in multiple colors if graphics mode is
  4849. available, and displayed without colors if graphics mode is not
  4850. available.
  4851. Note that the color to be set is passed to this function as an
  4852. IBM-style screen attribute. Hence, you can set the color of text
  4853. to be displayed by a single hexidecimal value, encoded as
  4854. follows:
  4855. +------------- Background color
  4856. |
  4857. 0x7f
  4858. |
  4859. +------------ Foreground color
  4860. ===============================================================================
  4861. OpenDoors 6.00 Manual End of Page 128
  4862. Where the left digit (most significant nibble) of the
  4863. hexidecimal number represents the background color, and the
  4864. right digit (least significant nibble) represents the foreground
  4865. color. Each of the possible colors, along with their
  4866. corresponding hexidecimal values, are listed in the charts,
  4867. below.
  4868. +-----------------------+ +--------------------------+
  4869. | Foreground colors | | Background | Flashing |
  4870. +-----------------------| +---------------+----------|
  4871. | 0 | Black | | 0 | Black | Off |
  4872. | 1 | Blue | | 1 | Blue | Off |
  4873. | 2 | Green | | 2 | Green | Off |
  4874. | 3 | Cyan | | 3 | Cyan | Off |
  4875. | 4 | Red | | 4 | Red | Off |
  4876. | 5 | Magenta | | 5 | Magenta | Off |
  4877. | 6 | Brown | | 6 | Brown | Off |
  4878. | 7 | White (grey) | | 7 | White | Off |
  4879. | 8 | Bright Black | | 8 | Black | On |
  4880. | 9 | Bright Blue | | 9 | Blue | On |
  4881. | a | Bright Green | | a | Green | On |
  4882. | b | Bright Cyan | | b | Cyan | On |
  4883. | c | Bright Red | | c | Red | On |
  4884. | d | Bright Magenta | | d | Magenta | On |
  4885. | e | Yellow | | e | Brown | On |
  4886. | f | White (bright) | | f | White | On |
  4887. +-----------------------+ +--------------------------+
  4888. SEE ALSO od_set_color(), od_disp_emu(), od_clr_scr(), od_clr_line(),
  4889. od_set_cursor()
  4890. EXAMPLE At times, you may wish to allow the user to select the color of
  4891. text they wish to have displayed, perhaps to configure your door
  4892. for the ideal colors to be displayed on their system. To
  4893. demonstrate the use of the od_set_attrib() function, we show
  4894. another function, which shows the user all 256 possible colors
  4895. that can be displayed, and allows the user to choose which color
  4896. they prefer. The function will then return the color attribute
  4897. value of the user's chosen color.
  4898. unsigned char choose_color(void)
  4899. {
  4900. register unsigned char counter; /* for displaying colors */
  4901. char string[4]; /* string input by user */
  4902. od_set_attrib(0x07); /* display title */
  4903. od_disp_str("Available colors:\n\r\n\r");
  4904. for(counter=0;counter<=255;) /* loop through all colors */
  4905. {
  4906. ===============================================================================
  4907. OpenDoors 6.00 Manual End of Page 129
  4908. od_set_attrib(counter); /* set appropriate color */
  4909. od_printf("%03.3u",counter); /* display color's number */
  4910. if(((++counter)%16)==0) /* after every 16 colors ... */
  4911. {
  4912. od_set_attrib(0x07); /* ... reset display color ... */
  4913. od_disp_str("\n\r"); /* ... and start a new line */
  4914. }
  4915. }
  4916. od_set_attrib(0x07); /* Allow user to choose color */
  4917. od_disp_str("Which color do you prefer : ");
  4918. od_input_str(string,3,'0','9');
  4919. return(atoi(string)); /* Return chosen color */
  4920. }
  4921. ===============================================================================
  4922. OpenDoors 6.00 Manual End of Page 130
  4923. OD_SET_COLOR()
  4924. -------------------------------------------------------------------------------
  4925. PURPOSE Function to change the current display color in ANSI, AVATAR or
  4926. RIP modes, using foreground and background color values.
  4927. FORMAT void od_set_color(INT nForeground, INT nBackground);
  4928. RETURNS N/A
  4929. DESCRIPTION od_set_color() is one of two functions which change the color of
  4930. the currently displayed text. This function allows you to set
  4931. the text color using separate foreground an background text
  4932. colors, whereas od_set_attrib() allows you to set the text color
  4933. using a single IBM-PC style color attribute. Generally speaking,
  4934. which of these two functions you use is only a matter of
  4935. personal preference. An alternative method of setting the color
  4936. of displayed text is to include the color codes within a string
  4937. displayed by the od_printf() function. The benefits of doing
  4938. this, along with instructions on how to do this, are described
  4939. in the section on the od_printf() function, which begins on page
  4940. 110.
  4941. This function will only have an effect if the user has ANSI,
  4942. AVATAR or RIP mode turned on. As a result, you can use this
  4943. function within your door program, and have your text
  4944. automatically displayed in multiple colors if graphics mode is
  4945. available, and displayed without colors if graphics mode is not
  4946. available.
  4947. The od_set_color() function accepts two parameters, the first
  4948. parameter being the foreground color to be used in displaying
  4949. text, and the second parameter being the background color to be
  4950. used in displaying text. For example,
  4951. od_set_color(L_WHITE,D_BLACK);
  4952. would set the current color to Light White on Dark Black. The
  4953. foreground and background text colors can be any one of the
  4954. color values listed on the following page.
  4955. ===============================================================================
  4956. OpenDoors 6.00 Manual End of Page 131
  4957. +-------------------+-----------+
  4958. | Foreground Color | Value |
  4959. +-------------------+-----------+
  4960. | Dark Black | D_BLACK |
  4961. | Dark Blue | D_BLUE |
  4962. | Dark Green | D_GREEN |
  4963. | Dark Cyan | D_CYAN |
  4964. | Dark Red | D_RED |
  4965. | Dark Magenta | D_MAGENTA |
  4966. | Dark Brown | D_BROWN |
  4967. | Grey (Dark White) | D_GREY |
  4968. | Light Black (Grey)| L_BLACK |
  4969. | Light Blue | L_BLUE |
  4970. | Light Green | L_GREEN |
  4971. | Light Cyan | L_CYAN |
  4972. | Light Red | L_RED |
  4973. | Light Magenta | L_MAGENTA |
  4974. | Yellow | L_YELLOW |
  4975. | White | L_WHITE |
  4976. +-------------------+-----------+
  4977. +-------------------+-----------+
  4978. | Background Color | Value |
  4979. +-------------------+-----------+
  4980. | Black | D_BLACK |
  4981. | Blue | D_BLUE |
  4982. | Green | D_GREEN |
  4983. | Cyan | D_CYAN |
  4984. | Red | D_RED |
  4985. | Magenta | D_MAGENTA |
  4986. | Brown | D_BROWN |
  4987. | Grey | D_GREY |
  4988. | Blinking Black | B_BLACK |
  4989. | Blinking Blue | B_BLUE |
  4990. | Blinking Green | B_GREEN |
  4991. | Blinking Cyan | B_CYAN |
  4992. | Blinking Red | B_RED |
  4993. | Blinking Magenta | B_MAGENTA |
  4994. | Blinking Brown | B_BROWN |
  4995. | Blinking Grey | B_WHITE |
  4996. +-------------------+-----------+
  4997. SEE ALSO od_set_attrib(), od_disp_emu(), od_clr_scr(), od_clr_line(),
  4998. od_set_cursor()
  4999. EXAMPLE As an example of using the od_set_color() function to set the
  5000. color of displayed text, we show a pair of two functions. These
  5001. functions will allow a program to set the foreground OR
  5002. ===============================================================================
  5003. OpenDoors 6.00 Manual End of Page 132
  5004. background color of text, without setting the other. In
  5005. contrast, the od_set_color() function sets both the foreground
  5006. and background color at the same time. These function presume
  5007. that they are the only functions used within the door to set the
  5008. color of displayed text, and that the original text color prior
  5009. to calling either of these functions is dark white on black.
  5010. These function must also have access to the two global variables
  5011. "current_foreground" and "current_background", as defined below.
  5012. void set_foreground(char foreground);
  5013. void set_background(char background);
  5014. unsigned char current_foreground=D_BLACK;
  5015. unsigned char current_background=D_GREY;
  5016. void set_foreground(char foreground)
  5017. { /* set new text color */
  5018. od_set_color(foreground, current_background);
  5019. current_foreground=foreground; /* save new foreground */
  5020. }
  5021. void set_background(char background)
  5022. { /* set new text color */
  5023. od_set_color(current_foreground, background);
  5024. current_background=background; /* save new background */
  5025. }
  5026. Using these functions, you would then be able to set just the
  5027. foreground text color by a function call like:
  5028. set_foreground(L_YELLOW);
  5029. Or set just the background text color by a function call like:
  5030. set_background(D_GREY);
  5031. ===============================================================================
  5032. OpenDoors 6.00 Manual End of Page 133
  5033. OD_SET_CURSOR()
  5034. -------------------------------------------------------------------------------
  5035. PURPOSE Function to reposition the text cursor in ANSI, AVATAR or RIP
  5036. mode
  5037. FORMAT void od_set_cursor(INT nRow, INT nColumn);
  5038. RETURNS N/A
  5039. DESCRIPTION This function repositions the cursor to the specified row and
  5040. column on the screen. nRow can have a value of 1 to 23, and
  5041. nColumn can have a value of 1 to 80. ANSI, AVATAR or RIP mode
  5042. must be active.
  5043. SEE ALSO od_disp_emu(), od_clr_scr(), od_clr_line(), od_set_color(),
  5044. od_set_attrib()
  5045. EXAMPLE Below is a simple example that demonstrates the use of the
  5046. od_set_cursor() function. Note that this example detects whether
  5047. or not graphics mode is available, and if it is not, will carry
  5048. out the same task without the use of od_set_cursor().
  5049. od_init(); /* Initialize door operations */
  5050. od_clr_scr(); /* Clear the screen */
  5051. if(od_control.user_ansi || od_control.user_avatar)
  5052. { /* If graphics mode is available */
  5053. od_set_cursor(1,1); /* Display demo */
  5054. od_disp_str("Top, Left Corner");
  5055. od_set_cursor(1,70);
  5056. od_disp_str("Top, Right Corner");
  5057. od_set_cursor(15,1);
  5058. od_disp_str("Fifteenth line\n\r");
  5059. }
  5060. else /* If graphics mode is not available */
  5061. { /* Display demo */
  5062. od_disp_str("Top, Left Corner");
  5063. od_repeat(' ', 54);
  5064. od_disp_str("Top, Right Corner\n\r");
  5065. od_disp_str("\n\n\n\n\n\n\n\n\n\n\n\n\n");
  5066. od_disp_str("Fifteenth line\n\r");
  5067. }
  5068. od_get_key(TRUE); /* Wait for user to press key */
  5069. ===============================================================================
  5070. OpenDoors 6.00 Manual End of Page 134
  5071. OD_SET_DTR()
  5072. -------------------------------------------------------------------------------
  5073. PURPOSE Controls the DTR (Data Terminal Ready) signal to the modem. Used
  5074. primarily to cause the modem to "hang up".
  5075. FORMAT void od_set_dtr(BOOL bHigh);
  5076. RETURNS N/A
  5077. DESCRIPTION In certain circumstances (such as call back verification doors),
  5078. you may wish to "hang up" the modem without exiting your door
  5079. program. This can be accomplished with most modems by
  5080. controlling the DTR (Data Terminal Ready) signal to the modem.
  5081. Passing a FALSE value to od_set_dtr() causes the DTR signal to
  5082. be set low, and passing a TRUE value causes the DTR signal to be
  5083. set high. Normally, OpenDoors maintains the DTR signal in its
  5084. high state. Since most (but not all) modems are configured to
  5085. disconnect from the remote modem when the DTR signal is set low,
  5086. calling od_set_dtr(FALSE) can be used to hangup the modem. When
  5087. hanging up by this method, you should be sure to set the DTR
  5088. signal high again, after the carrier detect signal has
  5089. disappeared. For more information on determining the state of
  5090. the carrier detect signal, see the od_carrier() function, which
  5091. is described on page 51. Note that not all modems will
  5092. disconnect from the remote user in response to your lowering the
  5093. DTR signal. If your software may be used with such modems, you
  5094. may wish to also provide the option of disconnecting the modem
  5095. by sending a "hang up" command sequence to the modem.
  5096. Since OpenDoors normally monitors the carrier detect signal, and
  5097. exits when this signal disappears, you will have to disable
  5098. OpenDoor's carrier detection if you wish your program to
  5099. continue executing after hanging up the modem. OpenDoor's
  5100. automatic carrier detection can be disabled using the
  5101. od_control.od_disable OpenDoors control structure variable, as
  5102. follows:
  5103. od_control.od_disable |= DIS_CARRIERDETECT;
  5104. SEE ALSO od_carrier(), od_exit()
  5105. EXAMPLE For an example of using the od_set_dtr() function to "hang up"
  5106. the modem, see the example that accompanies the od_carrier()
  5107. function, which is described on page 52.
  5108. ===============================================================================
  5109. OpenDoors 6.00 Manual End of Page 135
  5110. OD_SET_PERSONALITY()
  5111. -------------------------------------------------------------------------------
  5112. PURPOSE Sets the current status line / sysop function key personality to
  5113. be used.
  5114. FORMAT BOOL od_set_personality(char *pszName);
  5115. RETURNS TRUE on success
  5116. FALSE on failure
  5117. DESCRIPTION This function changes the current status line / sysop function
  5118. key personality. The pszName parameter should contain the string
  5119. which uniquely identifies the personality to be set. This
  5120. function may only be used by OpenDoors programs which include
  5121. the OpenDoors "Multiple Personality System". To enable use of
  5122. the MPS, include the following line before your first call to
  5123. any OpenDoors function:
  5124. od_control.od_mps=INCLUDE_MPS;
  5125. OpenDoors includes a number of built-in personalities.
  5126. Additional personalities may be added using the
  5127. od_add_personality() function, which is described on page 47.
  5128. The following personalities are included with this version of
  5129. OpenDoors:
  5130. Name Description
  5131. -----------------------------------------------------------
  5132. Standard OpenDoors style, similar to RA 1.11
  5133. PCBoard Similar to PC-Board
  5134. RemoteAccess Similar to RemoteAccess 2.x
  5135. Wildcat Similar to Wildcat!
  5136. Personality names are not case sensitive. For more information
  5137. on the OpenDoors Multiple Personality System, see the section
  5138. which begins on page 233.
  5139. This function returns TRUE on success, or FALSE on failure. In
  5140. the case of a failure, the od_control.od_error variable is set
  5141. to indicate the nature of the failure. For more information on
  5142. the od_control.od_error variables, see page 185.
  5143. SEE ALSO od_add_personality(), od_set_statusline()
  5144. ===============================================================================
  5145. OpenDoors 6.00 Manual End of Page 136
  5146. OD_SET_STATUSLINE()
  5147. -------------------------------------------------------------------------------
  5148. PURPOSE To set the currently displayed status line.
  5149. FORMAT void od_set_statusline(INT nSetting);
  5150. RETURNS N/A
  5151. DESCRIPTION If you have the OpenDoors status line enabled within your door
  5152. program (as is the default), the sysop will be able to control
  5153. the setting of the status line using the F1 - F10 keys on the
  5154. keyboard. These function keys are as follows:
  5155. [F1] - Display basic door and user information
  5156. [F2] - Display phone numbers and important dates
  5157. [F3] - Display security flags and up/download info
  5158. [F4] - Display system information and current time
  5159. [F5] - Display message info and user's settings
  5160. [F6] - Display chat reason and sysop's comment
  5161. [F9] - Display help information for sysop
  5162. [F10] - Turn off the status line
  5163. Using the od_set_statusline() function, you can manually set
  5164. which of these status line settings is currently selected. The
  5165. od_set_statusline() accepts a single parameter, which should be
  5166. one of the values listed below, which indicates which status
  5167. line you would like to have selected:
  5168. +---------------+---------------+------------------------------+
  5169. | | Corresponding | |
  5170. | Value | Function Key | Meaning |
  5171. +---------------+---------------+------------------------------+
  5172. | STATUS_NORMAL | [F1] | Basic door and user info |
  5173. | STATUS_NONE | [F10] | Turn off status line |
  5174. | STATUS_HELP | [F9] | Displays help for the sysop |
  5175. | STATUS_USER1 | [F2] | Phone Numbers and dates |
  5176. | STATUS_USER2 | [F3] | Security flags & up/downloads|
  5177. | STATUS_USER3 | [F5] | Message info & user settings |
  5178. | STATUS_USER4 | [F6] | Chat reason and sysop comment|
  5179. | STATUS_SYSTEM | [F4] | System info & current time |
  5180. +---------------+---------------+------------------------------+
  5181. (Note that these keys may be customized using variables in the
  5182. OpenDoors control structure.)
  5183. Keep in mind that the od_set_statusline() function only
  5184. temporarily changes the current status line setting, and that
  5185. the sysop will still be able to change the status line to any of
  5186. the other settings using the function keys. For instance, if you
  5187. ===============================================================================
  5188. OpenDoors 6.00 Manual End of Page 137
  5189. wished to allow the sysop to normally see all 25 lines of text
  5190. displayed by your door, but at the same time to still allow the
  5191. sysop to turn on the status line at any time, you could place
  5192. the line
  5193. od_set_statusline(STATUS_NONE);
  5194. at the beginning of your program. Similarly, when the user pages
  5195. the sysop, OpenDoors itself calls
  5196. od_set_statusline(STATUS_USER4);
  5197. in order to display the status line which shows the user's
  5198. reason for chat, while still allowing the sysop to switch back
  5199. to any of the other status lines.
  5200. If you wish to permanently turn off the OpenDoor's status line,
  5201. without allowing the sysop to be able to turn it back on using
  5202. the sysop function keys, simply set the
  5203. "od_control.od_status_on" variable to FALSE. This variable is
  5204. described in the OpenDoors control structure section of this
  5205. manual, which begins on page 148.
  5206. ===============================================================================
  5207. OpenDoors 6.00 Manual End of Page 138
  5208. OD_SLEEP()
  5209. -------------------------------------------------------------------------------
  5210. PURPOSE Suspends program execution, yielding control to other tasks in a
  5211. multitasking environment.
  5212. FORMAT void od_sleep(tODMilliSec Milliseconds);
  5213. RETURNS N/A
  5214. DESCRIPTION od_sleep() suspends execution of your program for the specified
  5215. number of milliseconds. Note that under the DOS version of
  5216. OpenDoors, this value is rounded to the nearest 55 milliseconds.
  5217. While the program's execution is suspended, od_sleep() yields
  5218. control of the processor to other tasks in a multitasking
  5219. environment.
  5220. Calling od_sleep() with a sleep time of 0 causes control to be
  5221. yielded to other waiting processes without imposing a minimum
  5222. sleep time. If no other processes are waiting to execute, the
  5223. function returns immediately. OpenDoors automatically calls
  5224. od_sleep(0) itself in most of the situations where there is a
  5225. need to do so. However, there may be circumstances under which
  5226. od_sleep(0) can be used to improve performance. In particular,
  5227. od_sleep(0) can be used to improve the performance of other
  5228. applications that are also running at the same time as yours. By
  5229. calling od_sleep(0), you are essentially telling the operating
  5230. system that your program doesn't currently need all of the
  5231. processing time that has been allocated to it. While appropriate
  5232. use of od_sleep(0) can improve overall system performance,
  5233. overusing od_sleep(0) can dramatically degrade the performance
  5234. of your own program. The only way to determine the optimal use
  5235. of od_sleep(0) is by trial and error.
  5236. The most common situation where you might want to use
  5237. od_sleep(0) is when your program cannot do anything useful until
  5238. you receive input from the user, but for some reason you cannot
  5239. call od_get_key(TRUE). Rather than sitting in a tight loop,
  5240. repeatedly checking where the user has pressed a key yet, it is
  5241. better to call od_sleep(0) to let other tasks run for a while
  5242. before checking again. OpenDoors calls od_sleep(0) itself under
  5243. any of the following circumstances:
  5244. - When transmitting characters, if the outbound serial
  5245. buffer is full, OpenDoors yields while waiting for some
  5246. of the characters in the buffer to be sent.
  5247. - During od_get_key(), if called with the wait parameter
  5248. set to TRUE.
  5249. ===============================================================================
  5250. OpenDoors 6.00 Manual End of Page 139
  5251. - While waiting for input, during the execution of any of
  5252. the following input functions: od_get_answer(),
  5253. od_hotkey_menu() (after menu has been displayed),
  5254. od_popup_menu(), od_edit_str(), od_input_str().
  5255. - While pausing at the end of a screen during
  5256. od_send_file(), od_list_files(), od_hotkey_menu().
  5257. - During chat mode.
  5258. SEE ALSO od_kernel()
  5259. ===============================================================================
  5260. OpenDoors 6.00 Manual End of Page 140
  5261. OD_SPAWN()
  5262. -------------------------------------------------------------------------------
  5263. PURPOSE To facilitate easy execution of child tasks from doors.
  5264. FORMAT BOOL od_spawn(char *pszCommandLine);
  5265. RETURNS TRUE on success,
  5266. FALSE on failure
  5267. DESCRIPTION This function allows you to easily run other programs from
  5268. within your door programs, such as external file transfer
  5269. utilities, compression utilities, and so on.
  5270. This function will attempt to swap OpenDoors and your entire
  5271. door to expanded memory or disk. OpenDoors swapping can be
  5272. controlled by the OpenDoors control structure variables,
  5273. od_swapping_disable, od_swapping_ems and od_swap_path. The
  5274. od_spawn...() functions first attempt to swap OpenDoors to EMS
  5275. memory. If enough EMS 3.2 or later memory is available, it will
  5276. be used. If not, OpenDoors will swap to a disk file in the
  5277. directory specified by the od_control.od_swap_path variable.
  5278. Unlike the other Turbo C(++) / Borland C++ library functions
  5279. such as system() or spawnf(), this function will automatically
  5280. store the door screen prior to executing the sub-program, and
  5281. will restore the screen upon return. This function will also
  5282. store the current drive and directory settings prior to
  5283. executing the program, and restore them after the program has
  5284. returned.
  5285. Normally, the user's time will continue to be decreased during
  5286. the execution of the od_spawn() function. However, you can
  5287. freeze the user's time during the spawn process by using the
  5288. OpenDoors control structure variable od_spawn_freeze_time.
  5289. SEE ALSO od_spawnvpe()
  5290. EXAMPLE Below are a few examples of various uses of the od_spawn()
  5291. function:
  5292. To run the command processor from within your door program, to
  5293. allow the sysop access to the DOS shell, simply use the
  5294. following line of code:
  5295. od_spawn(getenv("COMSPEC"));
  5296. ===============================================================================
  5297. OpenDoors 6.00 Manual End of Page 141
  5298. The following function is an example of using the od_spawn()
  5299. function to call DSZ, allowing the user to download a file. You
  5300. pass the name of the file that you wish to send to the user.
  5301. This function will then ask the user what transfer protocol they
  5302. would like to use, generate the appropriate DSZ command line,
  5303. and then transmit the file to the user. Note that in order to
  5304. use a door which implements this function, the external file
  5305. transfer program "DSZ" must be available in the current search
  5306. path. As an alternative, you may want to allow the sysop to
  5307. specify the location of the DSZ file from within a configuration
  5308. program. If you wish to receive a file (allow the user to
  5309. upload), instead of sending one, simply change the "s" in the
  5310. command line to a "r".
  5311. char download(char *filename)
  5312. {
  5313. char commandline[80];/* string containing DSZ command line */
  5314. char protocol; /* character representing chosen protocol */
  5315. /* display protocol menu */
  5316. od_printf("Select File Transfer Protocol:\n\r");
  5317. od_printf(" [X] XModem\n\r");
  5318. od_printf(" [Y] YModem\n\r");
  5319. od_printf(" [Z] ZModem\n\r");
  5320. od_printf("or press [A] to abort transfer\n\r");
  5321. do /* loop until valid protocol has been chosen */
  5322. {
  5323. protocol=od_get_key(); /* get key */
  5324. /* abort if [A] key is pressed */
  5325. if(protocol=='a' || protocol=='A') return(FALSE);
  5326. } while(protocol!='x' && protocol!='y' && protocol!='z' &&
  5327. protocol!='X' && protocol!='Y' && protocol!='Z');
  5328. od_printf("Begin receiving file now or press [CTRL]-[X] to
  5329. abort\n\r");
  5330. /* generate DSZ command line */
  5331. sprintf(commandline,"dsz port %d s%c %s",
  5332. od_control.port+1,
  5333. protocol,
  5334. filename);
  5335. return(od_spawn(commandline)); /* spawn to DSZ */
  5336. }
  5337. ===============================================================================
  5338. OpenDoors 6.00 Manual End of Page 142
  5339. OD_SPAWNVPE()
  5340. -------------------------------------------------------------------------------
  5341. PURPOSE To facilitate easy execution of child tasks from doors. Allows
  5342. specification of child's environment, returns errorlevel
  5343. returned by child task, and searches path for the executable
  5344. file.
  5345. FORMAT INT16 od_spawnvpe(INT16 nModeFlag, char *pszPath,
  5346. char *papszArg[], char *papszEnv[]);
  5347. RETURNS -1 on failure
  5348. errorlevel returned by child process on success
  5349. DESCRIPTION This function behaves very similarly to the od_spawn() function.
  5350. Thus, to save space in the manual, I will not recapitulate what
  5351. is already said in the description of the od_spawn() function.
  5352. Instead, this description concentrates on the additional
  5353. features available through the od_spawnvpe() function. If you
  5354. are not already familiar with the od_spawn() function, take a
  5355. moment now to review the description of that function.
  5356. The od_spawn() function (the OpenDoors "quick-spawn" function)
  5357. is designed to be quick and easy to use, but does not have all
  5358. of the features available in the od_spawnvpe() function. In
  5359. addition to the features of the od_spawn() function, the
  5360. od_spawnvpe() function also provides the following features:
  5361. - od_spawnvpe() will search the "path" for the file
  5362. to be executed.
  5363. - od_spawnvpe() allows you to pass an altered
  5364. environment to the child process.
  5365. - od_spawnvpe() returns the errorlevel returned by
  5366. the child process.
  5367. The parameters passed to the od_spawnvpe() function are
  5368. identical to those passed to the C spawnvpe() function. The
  5369. first parameter should usually the be P_WAIT flag. The second
  5370. parameter is the name of the child program to execute. If a full
  5371. path to the child program is not specified, and the child
  5372. program does not exist in the current directory, OpenDoors will
  5373. search the directories listed by the PATH environment variable.
  5374. Also, if the .EXE or .COM extension is not provide, OpenDoors
  5375. will look first for a .COM file, and if not found, for a .EXE
  5376. file. The third parameter is an array of arguments to pass to
  5377. the child process, or NULL if no arguments are to be passed. The
  5378. ===============================================================================
  5379. OpenDoors 6.00 Manual End of Page 143
  5380. fourth parameter is the environment to be passed to the child
  5381. process, or NULL if the a copy of the current environment should
  5382. be used.
  5383. SEE ALSO od_spawn()
  5384. EXAMPLE For an example of the use of the od_spawn...() functions, see
  5385. the example accompanying the od_spawn() function. As a specific
  5386. example of the od_spawnvpe function, consider the following code
  5387. which executes the "TEST.EXE" program.
  5388. od_spawnvpe(P_WAIT,"TEST.EXE",NULL,NULL);
  5389. ===============================================================================
  5390. OpenDoors 6.00 Manual End of Page 144
  5391. OD_WINDOW_CREATE()
  5392. -------------------------------------------------------------------------------
  5393. PURPOSE Creates a popup window of the specified size and color, storing
  5394. the contents of the screen "under" the window. The window can
  5395. later be removed from the screen, restoring the original
  5396. contents of the screen "under" the window, using the
  5397. od_window_remove() function. Requires ANSI, AVATAR or RIP mode.
  5398. FORMAT void *od_window_create(INT nLeft, INT nTop, INT nRight, INT
  5399. nBottom,
  5400. char *pszTitle, BYTE btBorderCol, BYTE btTitleCol,
  5401. BYTE btInsideCol, INT nReserved);
  5402. RETURNS Pointer to newly allocated window structure on success
  5403. NULL on failure
  5404. DESCRIPTION This function creates a pop-up window on the remote and local
  5405. screens. The contents of the screen beneath the window are
  5406. stored, to allow the window to later be removed from the screen
  5407. using the od_window_remove() function. The window is drawn using
  5408. the boarder characters defined in the already existing
  5409. od_control.od_box_chars[] array. The boarder is displayed using
  5410. the color attribute specified in btBorderCol. The working area
  5411. of the window is created in the color specified in btInsideCol.
  5412. A title may optionally be displayed on the window by specifying
  5413. a string in pszTitle. This title will be displayed in the color
  5414. specified by btTitleCol. If you do not wish a title to be
  5415. displayed, pass an empty string or NULL pointer in pszTitle. On
  5416. success, od_window_create() will return a pointer to a buffer
  5417. which was allocated to store information on the window and the
  5418. contents of the screen "under" the window. This pointer should
  5419. at some point be passed in a call to od_window_remove().
  5420. This function requires ANSI, AVATAR or RIP graphics mode. If
  5421. AVATAR mode is active, this function will take advantage of
  5422. special AVATAR control sequences to display the window much
  5423. faster than is possible in ANSI mode. In ANSI mode, window
  5424. display will be slightly faster if btBorderCol and btTitleCol
  5425. are equal. Note that the nReserved parameter of this function is
  5426. not currently used. To preserve compatibility with future
  5427. versions of OpenDoors, this parameter should always be set to 0.
  5428. Currently, the size of the buffer allocated to store the window
  5429. information will be (length*width*2) + 4 bytes in size.
  5430. If od_window_create() fails for any reason, a value of NULL is
  5431. returned, and the od_control.od_error variable is set to
  5432. indicate the reason for the failure. For more information on the
  5433. od_control.od_error variable, see page 185.
  5434. ===============================================================================
  5435. OpenDoors 6.00 Manual End of Page 145
  5436. SEE ALSO od_window_remove(), od_draw_box(), od_gettext(), od_puttext(),
  5437. od_save_screen(), od_restore_screen(), od_scroll()
  5438. EXAMPLE For an example of the use of the od_window_create() function,
  5439. see the included ex_chat.c example program.
  5440. ===============================================================================
  5441. OpenDoors 6.00 Manual End of Page 146
  5442. OD_WINDOW_REMOVE()
  5443. -------------------------------------------------------------------------------
  5444. PURPOSE Removes a window previously created using od_window_create(),
  5445. restoring the original screen background.
  5446. FORMAT BOOL od_window_remove(void *pWinInfo);
  5447. RETURNS TRUE on success
  5448. FALSE on failure
  5449. DESCRIPTION The od_window_remove() function removes a window from the screen
  5450. which was previously created by od_window_create(), and
  5451. deallocates the memory which was allocated to store the window
  5452. information. The contents of the screen beneath the window is
  5453. restored to appear as it did prior to the call to
  5454. od_window_create(). pWinInfo must point to the value returned by
  5455. od_window_create().
  5456. Note that overlapping windows must be removed in the reverse
  5457. order from which they were created for proper display results.
  5458. The last window to be created must be the first window to be
  5459. removed.
  5460. If od_window_remove() fails for any reason, a value of FALSE is
  5461. returned, and the od_control.od_error variable is set to
  5462. indicate the reason for the failure. For more information on the
  5463. od_control.od_error variable, see page 185.
  5464. SEE ALSO od_window_create(), od_draw_box(), od_gettext(), od_puttext(),
  5465. od_save_screen(), od_restore_screen(), od_scroll()
  5466. EXAMPLE For an example of the use of the od_window_remove() function,
  5467. see the included ex_chat.c example program.
  5468. ===============================================================================
  5469. OpenDoors 6.00 Manual End of Page 147
  5470. 555555
  5471. 55
  5472. 55
  5473. 55555
  5474. 55
  5475. 55
  5476. 55555
  5477. -------------------------------------------------------------------------------
  5478. CHAPTER 5 - THE OPENDOORS CONTROL STRUCTURE
  5479. INTRODUCTION TO THE CONTROL STRUCTURE
  5480. -------------------------------------------------------------------------------
  5481. The OpenDoors "Control Structure" is used by OpenDoors in order
  5482. to provide you with a wide range of information about the system
  5483. on which you door is running, and the user who is currently
  5484. using the door, along with providing you a means by which to
  5485. customize much of OpenDoor's behavior. Using the OpenDoors
  5486. control structure, you can access or alter information about the
  5487. user who is online, information about the system on which your
  5488. door is running, and information about OpenDoors itself. You can
  5489. also use the control structure to customize all of the text
  5490. displayed by OpenDoors, the function keys to which it responds,
  5491. and many other aspects of OpenDoor's behavior.
  5492. The OpenDoors control structure is quite simply a normal C
  5493. "struct", named od_control, and is defined in the OPENDOOR.H
  5494. file. This "struct" contains many different variables, which
  5495. provide you access to the information provided by the control
  5496. structure. Hence, to access the contents of a control structure
  5497. variable, for example the variable "system_name" which contains
  5498. the name of the BBS the door is running under, you would use:
  5499. od_control.system_name
  5500. The following section of this chapter contains a complete
  5501. reference to all of the variables which make up the OpenDoors
  5502. control structure. This reference includes the name, type and
  5503. complete description of the use of each variable. The reference
  5504. is divided into the following categories of variables, with the
  5505. reference to the variables in each section beginning on the
  5506. listed page.
  5507. Door Information File Statistics..................150
  5508. Modem Settings....................................153
  5509. BBS and Caller Information........................158
  5510. Door Settings.....................................182
  5511. OpenDoors Behavior Customization..................187
  5512. Function Keys Customization.......................212
  5513. ===============================================================================
  5514. OpenDoors 6.00 Manual End of Page 148
  5515. Color Customization...............................237
  5516. Text Customization................................217
  5517. Within each section, variables are listed alphabetically by
  5518. name.
  5519. Also, in order to make use of some of the variables in the
  5520. OpenDoors control structure, it is important to understand the
  5521. concepts of Boolean (TRUE/FALSE), and bit-mapped flag variables.
  5522. If you are not familiar with these two terms, they are described
  5523. in detail in the glossary, located towards the end of this
  5524. manual.
  5525. ===============================================================================
  5526. OpenDoors 6.00 Manual End of Page 149
  5527. CONTROL STRUCTURE - DOOR INFO FILE STATS
  5528. -------------------------------------------------------------------------------
  5529. The following OpenDoors control structure variables provide your
  5530. program with information concerning the door information file
  5531. from which OpenDoors obtained the BBS and caller information
  5532. that is found elsewhere in the control structure. The following
  5533. control structure items are listed in this section:
  5534. info_path Sets the location and, optionally, the
  5535. name of the door information file
  5536. od_info_type Type of door information file that was
  5537. found
  5538. od_node Node number the door is running under
  5539. user_timeofcreation The time at which the door information
  5540. file was created
  5541. -------------------------------------------------------------------------------
  5542. info_path char od_control.info_path[60];
  5543. If used, this variable should be set prior to calling od_init()
  5544. or any other OpenDoors function. This variable allows you to
  5545. control where OpenDoors will look for the door information (drop
  5546. file). By default, OpenDoors searches for the door information
  5547. file in the current directory. If this variable is set to the
  5548. name of some other directory, OpenDoors will first search for
  5549. any door information files in that directory. If you only wish
  5550. OpenDoors to look for a particular type of door information file
  5551. (for instance, you want OpenDoors to only read a DORINFO1.DEF,
  5552. and ignore any DOOR.SYS file), you can specify the full path and
  5553. filename of the file you wish OpenDoors to use.
  5554. It is usually a good idea to design your door to allow the
  5555. system operator to set the location of the door information
  5556. file. This will allow the sysop to place your door in its own
  5557. directory, and will facilitate the use of your door on multi-
  5558. line BBS systems. If you are using the OpenDoors configuration
  5559. file system, then the system operator can set the door
  5560. information file location and/or name using the BBSDir keyword.
  5561. However, you may also wish to allow the location of the door
  5562. information file to be set on the command line. The following
  5563. example illustrates a method of reading and setting the location
  5564. of the door information file from the door's command line:
  5565. #include "opendoor.h"
  5566. ===============================================================================
  5567. OpenDoors 6.00 Manual End of Page 150
  5568. main(int argc, char *argv[])
  5569. {
  5570. if(argc>1) strncpy(od_control.info_path,argv[1],59);
  5571. od_disp_str("This is a sample OpenDoors door.\n\r");
  5572. od_disp_str("Press any key to continue...\n\r");
  5573. od_get_key(TRUE);
  5574. od_exit(20);
  5575. }
  5576. -------------------------------------------------------------------------------
  5577. od_info_type char od_control.od_info_type;
  5578. This variable indicates the type of information file from which
  5579. OpenDoors has obtained the BBS and caller information that is
  5580. found elsewhere in the OpenDoors control structure. This
  5581. variable will have one of the following values, indicating that
  5582. the door information file was of the corresponding type:
  5583. +----------------+----------------------------+
  5584. | od_info_type | Door Information File Type |
  5585. | Value | |
  5586. +----------------+----------------------------+
  5587. | DORINFO1 | DORINFO?.DEF |
  5588. | EXITINFO | EXITINFO.BBS (Normal) |
  5589. | RA1EXITINFO | EXITINFO.BBS (Extended) |
  5590. | RA2EXITINFO | EXITINFO.BBS (RA 2.x) |
  5591. | QBBS275EXITINFO| EXITINFO.BBS (QuickBBS) |
  5592. | CHAINTXT | CHAIN.TXT |
  5593. | SFDOORSDAT | SFDOORS.DAT |
  5594. | CALLINFO | CALLINFO.BBS |
  5595. | DOORSYS_GAP | DOOR.SYS (GAP/PC-Board) |
  5596. | DOORSYS_DRWY | DOOR.SYS (Doorway style) |
  5597. | DOORSYS_WILDCAT| DOOR.SYS (WildCat standard)|
  5598. | CUSTOM | Custom door information |
  5599. | | file, defined in config |
  5600. | | file. |
  5601. | NO_DOOR_FILE | No drop file was found. |
  5602. +----------------+----------------------------+
  5603. The value of this variable is only valid AFTER od_init() or some
  5604. OpenDoors function has been called.
  5605. Note that this variable should be treated as a read-only
  5606. variable, and should not normally be altered by your program.
  5607. Altering this variable may cause OpenDoors to re-write a
  5608. different type of door information file upon exiting, than was
  5609. read upon startup.
  5610. ===============================================================================
  5611. OpenDoors 6.00 Manual End of Page 151
  5612. -------------------------------------------------------------------------------
  5613. od_node char od_control.od_node;
  5614. This variable indicates the node number that the door is running
  5615. under. If this information is supplied by the BBS in the door
  5616. information file, the node number will be automatically by
  5617. OpenDoors. Specifically, the node number can be determined
  5618. automatically from systems that produce an SFDOORS.DAT, PC-
  5619. Board/GAP style DOOR.SYS or Wildcat style DOOR.SYS door
  5620. information file. If this information is not supplied in the
  5621. door information file, but is provided by the sysop in the
  5622. door's configuration file, OpenDoors will use the value found
  5623. there. Alternatively, you can set this variable manually.
  5624. On systems that produce a DORINFO?.DEF file, OpenDoors will use
  5625. this variable to determine which DORINFO?.DEF file to search
  5626. for. For instance, if od_control.od_node is set to 3, OpenDoors
  5627. will first search for a DORINFO3.DEF file. If this file is not
  5628. found, OpenDoors will then default to the DORINFO1.DEF filename.
  5629. -------------------------------------------------------------------------------
  5630. user char od_control.user_timeofcreation[6];
  5631. _timeof
  5632. creation This variable contains the time of day at which the door
  5633. information file was created. This variable is available only
  5634. when the door is running under a system that produces an
  5635. EXITINFO.BBS file. To determine what type of door information
  5636. file your door is running under, see the od_control.od_info_type
  5637. variable, below.
  5638. ===============================================================================
  5639. OpenDoors 6.00 Manual End of Page 152
  5640. CONTROL STRUCTURE - SERIAL PORT SETTINGS
  5641. -------------------------------------------------------------------------------
  5642. The following OpenDoors control structure items store the
  5643. communications settings that OpenDoors uses to communicate with
  5644. the modem. These values are normally set upon the first call to
  5645. an OpenDoors function, during the od_init() procedure. However,
  5646. you may need to manual set this variables if:
  5647. - you wish to allow greater configurability of your door
  5648. - you are reading the door information file yourself
  5649. - you are using the OpenDoors to write a non-door
  5650. program
  5651. Some of these variables are always used by OpenDoors, while
  5652. others are only relevant if OpenDoor's built-in serial
  5653. communications code is being used instead of a FOSSIL driver.
  5654. Those that are only used when no FOSSIL driver is present are
  5655. denoted by an [*] in the list below.
  5656. The control structure variables controlling OpenDoor's serial
  5657. port settings are as follows:
  5658. od_control.baud Serial Port BPS rate
  5659. od_control.od_connect_sppedThe modem connection BPS rate
  5660. od_control.od_com_address Serial Port address [*]
  5661. " " .od_com_fifo_trigger 16550A FIFO trigger size
  5662. " " .od_com_flow_control Type of flow control to use.
  5663. od_control.od_com_irq Serial Port IRQ number [*}
  5664. od_control.od_com_method Is FOSSIL or built-in serial I/O
  5665. being used
  5666. od_control.od_com_no_fifo Disables use of 16550A FIFOs [*]
  5667. od_control.od_com_rx_buf Size of receive buffer [*]
  5668. od_control.od_com_tx_buf Size of transmit buffer [*]
  5669. od_control.od_no_fossil Prevents OpenDoors from using a
  5670. FOSSIL driver, even if one is
  5671. available.
  5672. od_control.od_open_handle Allows a live serial port handle to
  5673. be passed to OpenDoors.
  5674. od_control.port Serial port number, 0 based.
  5675. ===============================================================================
  5676. OpenDoors 6.00 Manual End of Page 153
  5677. -------------------------------------------------------------------------------
  5678. baud unsigned long od_control.baud;
  5679. This variable contains the BPS rate at which the computer is
  5680. communicating with the modem, not to be confused with the BPS
  5681. rate at which the local modem is communicating with the remote
  5682. modem.
  5683. A value of 0 indicates that the program is operating in local
  5684. mode.
  5685. If a FOSSIL driver is being used for serial I/O, this value is
  5686. ignored if it does not correspond to one of the baud rates that
  5687. an application can directly set a FOSSIL driver to. The BPS
  5688. rates recognized by FOSSIL drivers are: 300, 600, 1200, 2400,
  5689. 4800, 9600, 19200, 38400. If any other BPS rate is to be used,
  5690. the FOSSIL driver must be locked at that BPS from the FOSSIL
  5691. driver command-line. When locked, FOSSIL drivers ignore any
  5692. attempt by an application to change the BPS rate of the locked
  5693. port. For this reason, the od_control.baud setting has no effect
  5694. on the FOSSIL driver if it is locked.
  5695. -------------------------------------------------------------------------------
  5696. od_com_ int od_control.od_com_address;
  5697. address
  5698. This variable is only used when OpenDoors is NOT performing
  5699. serial I/O using a FOSSIL driver. (When a FOSSIL driver is being
  5700. used, the serial port address can be set from the FOSSIL driver
  5701. command line).
  5702. This variable may optionally be set to specify the base address
  5703. of the serial port to be used. For ports COM1: through COM4:,
  5704. OpenDoors can normally determine the serial port address
  5705. automatically. However, for other serial ports, the port address
  5706. must be specified using this variable. If you are not specifying
  5707. a serial port address with this variable, do not change it's
  5708. default value of 0.
  5709. -------------------------------------------------------------------------------
  5710. od_com_ char od_control.od_com_fifo_trigger;
  5711. fifo_trigger
  5712. This variable is only used when OpenDoors is NOT performing
  5713. serial I/O using a FOSSIL driver. (When a FOSSIL driver is being
  5714. used, the IRQ line can be set from the FOSSIL driver command
  5715. line).
  5716. ===============================================================================
  5717. OpenDoors 6.00 Manual End of Page 154
  5718. This variable sets the number of bytes that will be placed in
  5719. the 16550A UART FIFO buffers before an interrupt is triggered,
  5720. if the 16550A UART FIFOs are used. Valid values are 1, 4, 8 and
  5721. 14.
  5722. -------------------------------------------------------------------------------
  5723. od_com_ unsigned char od_control.od_com_flow_control;
  5724. flow_control
  5725. This variable sets the type of serial I/O flow control to use.
  5726. By default, this variable is set to COM_DEFAULT_FLOW, which
  5727. specifies the default mode of flow control. Most often, this
  5728. will be RTS/CTS flow control. A value of COM_RTSCTS_FLOW
  5729. explicitly enables RTS/CTS flow control. A value of COM_NO_FLOW
  5730. disables all flow control. If you are going to change the value
  5731. of this variable, it should be set prior to your first call to
  5732. any OpenDoors function.
  5733. -------------------------------------------------------------------------------
  5734. od_com_ unsigned char od_control.od_com_irq;
  5735. irq
  5736. This variable is only used when OpenDoors is NOT performing
  5737. serial I/O using a FOSSIL driver. (When a FOSSIL driver is being
  5738. used, the IRQ line can be set from the FOSSIL driver command
  5739. line).
  5740. This variable may optionally be set to specify the IRQ line to
  5741. be used for the serial port. By default, OpenDoors uses the
  5742. normal IRQ 4 line for ports COM1: and COM3:, and IRQ 3 for ports
  5743. COM2: and COM4:. To override this default, the IRQ line can be
  5744. set using this variable. If you are not specifying an IRQ line
  5745. with this variable, do not change it's default value of 0.
  5746. -------------------------------------------------------------------------------
  5747. od_com_ char od_control.od_com_method;
  5748. method
  5749. This read-only variable reports the method that OpenDoors is
  5750. using for serial I/O. This variable is set during od_init() or
  5751. the first call to an OpenDoors function. This variable can be
  5752. one of the following values:
  5753. COM_FOSSIL - Indicates that a FOSSIL driver is being
  5754. used
  5755. COM_INTERNAL - Indicates that OpenDoor's internal serial I/O
  5756. code is being used.
  5757. COM_WIN32 - Indicates that the Win32 communication system
  5758. ===============================================================================
  5759. OpenDoors 6.00 Manual End of Page 155
  5760. is being used.
  5761. -------------------------------------------------------------------------------
  5762. od_com_ char od_control.od_com_no_fifo;
  5763. no_fifo
  5764. This variable is only used when OpenDoors is NOT performing
  5765. serial I/O using a FOSSIL driver. (When a FOSSIL driver is being
  5766. used, the receive buffer size can be set from the FOSSIL driver
  5767. command line).
  5768. Normally, OpenDoors will use a 16550A FIFO buffer if a 16550A
  5769. UART is installed. You can disable the use of the 16550A FIFO
  5770. buffer by setting this variable to TRUE.
  5771. -------------------------------------------------------------------------------
  5772. od_com_ unsigned int od_control.od_com_rx_buf;
  5773. rx_buf
  5774. This variable is only used when OpenDoors is NOT performing
  5775. serial I/O using a FOSSIL driver. (When a FOSSIL driver is being
  5776. used, the receive buffer size can be set from the FOSSIL driver
  5777. command line).
  5778. This variable allows you to set the size of OpenDoor's serial
  5779. I/O receive buffer. If you do not set this buffer size, a
  5780. default value of 256 characters is used. Normally, this buffer
  5781. size is more than large enough for door programs. However, if
  5782. you find that inbound characters are lost before they can be
  5783. processed by your program, you may wish to increase the size of
  5784. this buffer.
  5785. This variable should only be changed before your first call to
  5786. od_init() or any other OpenDoors function.
  5787. -------------------------------------------------------------------------------
  5788. od_com_ unsigned int od_control.od_com_tx_buf;
  5789. tx_buf
  5790. This variable is only used when OpenDoors is NOT performing
  5791. serial I/O using a FOSSIL driver. (When a FOSSIL driver is being
  5792. used, the receive buffer size can be set from the FOSSIL driver
  5793. command line).
  5794. This variable allows you to set the size of OpenDoor's serial
  5795. I/O transmit buffer. If you do not set this buffer size, a
  5796. default value of 1024 characters is used.
  5797. ===============================================================================
  5798. OpenDoors 6.00 Manual End of Page 156
  5799. This variable should only be changed before your first call to
  5800. od_init() or any other OpenDoors function.
  5801. -------------------------------------------------------------------------------
  5802. od_connect_ DWORD od_control.od_connect_speed;
  5803. speed
  5804. This variable contains the best guess at the current modem
  5805. connection speed. This information is currently only accurate if
  5806. a DOOR.SYS file is being used. In other situations, it will
  5807. always be set to be equal to od_control.baud.
  5808. -------------------------------------------------------------------------------
  5809. od_open_ DWORD od_control.od_open_handle;
  5810. handle
  5811. Under platforms where this is supported (currently only the
  5812. Win32 version of OpenDoors), this variable can be used to pass a
  5813. live serial port handle to OpenDoors, which OpenDoors will use.
  5814. OpenDoors will not close this handle when it exits. If this
  5815. value is set to 0, OpenDoors will open and close the serial port
  5816. itself.
  5817. -------------------------------------------------------------------------------
  5818. port char od_control.port;
  5819. This variable contains the serial port number that the modem is
  5820. connected. This number is 0 based, so that a value of 0
  5821. corresponds to COM1:, a value of 1 corresponds to COM2:, and so
  5822. on. This value will normally be set by the od_init() function,
  5823. when the door information file is read, and should not be
  5824. changed after modem initialization has been carried out by the
  5825. od_init() function.
  5826. ===============================================================================
  5827. OpenDoors 6.00 Manual End of Page 157
  5828. CONTROL STRUCTURE - BBS AND CALLER INFORMATION
  5829. -------------------------------------------------------------------------------
  5830. As we have already described, there are two types of variables
  5831. in the OpenDoors control structure. Some of the variables are
  5832. simply used to allow you to customize OpenDoor's various
  5833. features, such as altering colors, prompts, timeouts, etc. Other
  5834. variables in the OpenDoors control structure serve to provide
  5835. you with information about the user who is online and the BBS
  5836. system your door is running under. This section deals with those
  5837. variables that provide you with information about the BBS and
  5838. the user.
  5839. The information in these variables is read from the door
  5840. information file, a small file created by the BBS specifically
  5841. for the purpose of communicating with door programs. Depending
  5842. on what BBS system your door is running under, the type of door
  5843. information file will vary. Since different door information
  5844. files do not all provide the same pieces of information, some
  5845. variables in this section will only be available when your door
  5846. is running under particular BBS systems. Other variables will
  5847. be available with many or all BBS systems. In the description of
  5848. each variable in this section, we indicate under which door
  5849. information files the particular variable will be . So, if you
  5850. wish to access a variable that is only under certain door
  5851. information files, your program should test whether or not the
  5852. required information is available under the particular door
  5853. information file that was found. In order to determine which
  5854. door information file your door is running under, you should use
  5855. the od_control.od_info_type variable. This variable is described
  5856. in the section which begins on page 150. If you test the value
  5857. of the od_control.od_info_type variable, and find that the
  5858. required information is not available, you may wish to simply
  5859. use some sort of default value for the variable, or
  5860. alternatively, not allow your door to run under certain BBS
  5861. systems. Another possibility, if the required information is not
  5862. available, is imply to obtain this information from the user
  5863. yourself. For example, if you wished to know the length of the
  5864. user's screen, when this information is not available from the
  5865. door information file, you could simply prompt the user for
  5866. their screen length the first time they use your door. This
  5867. information could then be stored in your door's data files for
  5868. future reference.
  5869. As an example of testing what door information file your door is
  5870. running under, consider the case where you wanted to display the
  5871. user's birthday. The example below will display the user's
  5872. birthday if it is known, and otherwise, print the string
  5873. "unknown".
  5874. if(od_control.od_info_type == RA1EXITINFO
  5875. od_control.od_info_type == RA2EXITINFO)
  5876. ===============================================================================
  5877. OpenDoors 6.00 Manual End of Page 158
  5878. {
  5879. od_disp_str(od_control.user_birthday);
  5880. }
  5881. else
  5882. {
  5883. od_disp_str("Unknown");
  5884. }
  5885. The chart below lists the door information file formats that
  5886. OpenDoors recognizes, along with example BBS systems that
  5887. produce these files and a reference letter for each type. Thus,
  5888. an OpenDoors door can run DIRECTLY under ANY BBS SYSTEM that
  5889. produces one of these files formats, and under ANY OTHER BBS
  5890. system when used in conjunction with a door information file
  5891. conversion utility.
  5892. +--------------------------+----------------------------------------+
  5893. | FILE FORMAT | EXAMPLE BBS SYSTEMS |
  5894. +--------------------------+----------------------------------------+
  5895. | CHAIN.TXT | WWIV |
  5896. +--------------------------+----------------------------------------+
  5897. | DORINFO1.DEF | RBBS-PC |
  5898. +--------------------------+----------------------------------------+
  5899. | DORINFO1.DEF | QuickBBS |
  5900. | & | Remote Access (versions 0.01-0.04) |
  5901. | EXITINFO.BBS (Std. Ver.) | |
  5902. +--------------------------+----------------------------------------+
  5903. | DOOR.SYS (DoorWay Style) | Remote Access |
  5904. +--------------------------+----------------------------------------+
  5905. | DOOR.SYS (PCB/GAP Style) | PC-Board |
  5906. | | GAP |
  5907. +--------------------------+----------------------------------------+
  5908. | DOOR.SYS (WildCat Style) | Wildcat 3.00 and above |
  5909. | | Telegard |
  5910. +--------------------------+----------------------------------------+
  5911. | SFDOORS.DAT | Spitfire |
  5912. | | TriBBS |
  5913. +--------------------------+----------------------------------------+
  5914. | CALLINFO.BBS | WildCat 2.xx |
  5915. +--------------------------+----------------------------------------+
  5916. | DORINFO1.DEF | Remote Access (versions 1.00 and later)|
  5917. | & | |
  5918. | EXITINFO.BBS (Ext. Ver.) | |
  5919. +--------------------------+----------------------------------------+
  5920. The chart on the following page lists all of the OpenDoors
  5921. control structure variables in this section, along with a brief
  5922. description of their use. The variables are then described in
  5923. detail, below.
  5924. ===============================================================================
  5925. OpenDoors 6.00 Manual End of Page 159
  5926. +-----------------------+-----------------------------------------------+
  5927. | VARIABLE NAME | VARIABLE CONTENTS |
  5928. +-----------------------+-----------------------------------------------+
  5929. | EMSI INFORMATION | Information on current IEMSI session |
  5930. | event_status | The status of the next system event |
  5931. | event_starttime | The start time of the next system event |
  5932. | event_errorlevel | The errorlevel of the next system event |
  5933. | event_days | The days of the week to execute the event |
  5934. | event_force | Whether the next system event is forced |
  5935. | event_last_run | When the next system event was last run |
  5936. | sysop_name | The name of the BBS's sysop |
  5937. | system_calls | Total number of calls BBS has received |
  5938. | system_last_caller | The name of the last caller to the BBS |
  5939. | system_last_handle | The handle (alias) of the last caller |
  5940. | system_name | The name of the BBS |
  5941. | TIMELOG VARIABLES | The times at which the BBS has been most busy |
  5942. | user_ansi | Whether the user has ANSI graphics mode on |
  5943. | user_attribute | User attribute bit-mapped flags |
  5944. | user_attrib2 | Second set of user attribute bit-mapped flags |
  5945. | user_attrib3 | Third set of user attribute flags |
  5946. | user_avatar | Whether the user has AVATAR graphics mode on |
  5947. | user_birthday | The date the user was born |
  5948. | user_callsign | The user's amateur radio call sign |
  5949. | user_combinedrecord | The user's combined message areas settings |
  5950. | user_comment | Sysop's comment about the user |
  5951. | user_credit | Amount of NetMail credit the user has |
  5952. | user_dataphone | The user's data phone number |
  5953. | user_date_format | Format user wishes to have dates displayed in |
  5954. | user_deducted_time | Total time that has been subtracted from user |
  5955. | user_downk | Total Kilobytes downloaded by the user |
  5956. | user_downlimit | User's daily download limit |
  5957. | user_downloads | Total number of files downloaded by the user |
  5958. | user_echomailentered | Whether or not the user has entered EchoMail |
  5959. | user_error_free | Whether or not connection is error-free |
  5960. | user_file_area | The user's current file area |
  5961. | user_firstcall | Date of the user's first call to the BBS |
  5962. | user_flags | User's sysop-defined flag settings |
  5963. | user_forward_to | Name to forward user's mail to |
  5964. | user_group | User's group number |
  5965. | user_handle | User's alias |
  5966. | user_homephone | User's home telephone number |
  5967. | user_language | User's language setting |
  5968. | user_last_pwdchange | Total calls since last password change |
  5969. | user_lastdate | Date of the user's last call |
  5970. | user_lastread | Highest message number read by user |
  5971. | user_lasttime | Time of the user's last call |
  5972. | user_location | Name of the city where the user lives |
  5973. | user_logindate | Date on which the current call began |
  5974. +-----------------------+-----------------------------------------------+
  5975. ===============================================================================
  5976. OpenDoors 6.00 Manual End of Page 160
  5977. +-----------------------+-----------------------------------------------+
  5978. | VARIABLE NAME | VARIABLE CONTENTS |
  5979. +-----------------------+-----------------------------------------------+
  5980. | user_loginsec | User's security at the beginning of this call |
  5981. | user_logintime | Time at which the current call began |
  5982. | user_logonpassword | User's password at the beginning of this call |
  5983. | user_menustack | Contents of the user's current menu stack |
  5984. | user_menustackpointer | Pointer to the top of the menu stack |
  5985. | user_messages | Total number of messages written by the user |
  5986. | user_msg_area | The user's current message area |
  5987. | user_name | The user's name |
  5988. | user_net_credit | The user's remaining netmail credit |
  5989. | user_netmailentered | Whether or not the user has entered NetMail |
  5990. | user_num | The user's record number in the user file |
  5991. | user_numcalls | Number of calls the user has made to the BBS |
  5992. | user_numpages | Number of times the user has paged the sysop |
  5993. | user_password | The user's current password |
  5994. | user_pending | The value of unsent NetMail written by user |
  5995. | user_reasonforchat | The reason the user wishes to chat with sysop |
  5996. | user_rip_ver | RIP protocol version being used |
  5997. | user_screen_length | The length of the user's screen |
  5998. | user_screenwidth | The width of the user's screen |
  5999. | user_security | The user's security access level |
  6000. | user_sex | The user's gender |
  6001. | user_subdate | The date the user's subscription expires |
  6002. | user_timelimit | The user's daily time limit |
  6003. | user_todayk | Kilobytes downloaded by the user today |
  6004. | user_upk | Total Kilobytes uploaded by the user |
  6005. | user_uploads | Total number of files uploaded by the user |
  6006. | user_wantchat | Whether or not the user wishes to chat |
  6007. | user_xi_record | The user's record in the USERSXI.BBS file |
  6008. +-----------------------+-----------------------------------------------+
  6009. -------------------------------------------------------------------------------
  6010. EMSI char od_control.ra_emsi_session;
  6011. INFORMATION char od_control.ra_emsi_crtdef[41];
  6012. char od_control.ra_emsi_protocols[41];
  6013. char od_control.ra_emsi_capabilities[41];
  6014. char od_control.ra_emsi_requests[41];
  6015. char od_control.ra_emsi_software[41];
  6016. char od_control.ra_hold_attr1;
  6017. char od_control.ra_hold_attr2;
  6018. char od_control.ra_hold_len;
  6019. These variables provide your door with information pertaining to
  6020. an interactive EMSI session that has been established. Note that
  6021. ===============================================================================
  6022. OpenDoors 6.00 Manual End of Page 161
  6023. these variables are only available under systems that produce an
  6024. RA 1.00 and later style extended EXITINFO.BBS door information
  6025. file.
  6026. If an IEMSI session has been established, the Boolean variable
  6027. od_control.ra_emsi_session will be TRUE, and if no session has
  6028. not been established, this variable will be FALSE.
  6029. A full discussion of the IEMSI protocol is beyond the scope of
  6030. this manual. Specifications for the IEMSI protocol are available
  6031. from the OpenDoors support BBS.
  6032. -------------------------------------------------------------------------------
  6033. event_days unsigned char od_control.event_days;
  6034. This variable is a bit-mapped flag of the days of the week on
  6035. which the next system event is run. The bit-map bits are as
  6036. follows:
  6037. +-----+------+-----------+
  6038. | BIT | MASK | MEANING |
  6039. +-----+------+-----------+
  6040. | 0 | 0x01 | Sunday |
  6041. | 1 | 0x02 | Monday |
  6042. | 2 | 0x04 | Tuesday |
  6043. | 3 | 0x08 | Wednesday |
  6044. | 4 | 0x10 | Thursday |
  6045. | 5 | 0x20 | Friday |
  6046. | 6 | 0x40 | Saturday |
  6047. | 7 | 0x80 | All Days |
  6048. +-----+------+-----------+
  6049. For more information on bit-mapped flags, see the glossary item
  6050. entitled "BIT-MAPPED FLAGS".
  6051. This variable is only available under systems that produce an
  6052. EXITINFO.BBS door information file.
  6053. -------------------------------------------------------------------------------
  6054. event_ unsigned char od_control.event_errorlevel;
  6055. errorlevel
  6056. This variable contains the ErrorLevel associated with the next
  6057. system event. This variable is only available under systems that
  6058. produce an EXITINFO.BBS door information file.
  6059. ===============================================================================
  6060. OpenDoors 6.00 Manual End of Page 162
  6061. -------------------------------------------------------------------------------
  6062. event char od_control.event_force;
  6063. _force
  6064. This variable indicates whether the next system event should be
  6065. forced to run at a particular time. If this variable contains a
  6066. value of TRUE, then the user should be forced off-line in order
  6067. to accommodate the event, and if this variable is false, then
  6068. the event can wait until after the user logs off normally. This
  6069. variable is only available under systems that produce an
  6070. EXITINFO.BBS file.
  6071. -------------------------------------------------------------------------------
  6072. event char od_control.event_last_run[9];
  6073. _last_run
  6074. This variable contains a string representing the date on which
  6075. the next system event was last run, and is in the same format as
  6076. the user_lastdate variable. This variable is only available
  6077. under systems that produce an EXITINFO.BBS file.
  6078. -------------------------------------------------------------------------------
  6079. event char od_control.event_starttime[6];
  6080. _starttime
  6081. This variable contains a string representing the time at which
  6082. the next system event is scheduled to start, in the same format
  6083. as the user_lasttime variable. This variable is only available
  6084. under systems that produce an EXITINFO.BBS or Wildcat style
  6085. DOOR.SYS door information file.
  6086. -------------------------------------------------------------------------------
  6087. event unsigned char od_control.event_status;
  6088. _status
  6089. This variable represents the status of the next system event,
  6090. and will be equal to the value
  6091. ES_ENABLED
  6092. if and only if the other event information contained in the
  6093. control structure is valid. This variable is only available
  6094. under systems that produce an EXITINFO.BBS file.
  6095. ===============================================================================
  6096. OpenDoors 6.00 Manual End of Page 163
  6097. -------------------------------------------------------------------------------
  6098. sysop_name char od_control.sysop_name[40];
  6099. The od_control.sysop_name variable contains the name of the
  6100. sysop of the BBS under which your door is running. This variable
  6101. is available under any BBS system that produces a DORINFO?.DEF
  6102. (including RA & QBBS which process both DORINFO1.DEF and
  6103. EXITINFO.BBS files), or Wildcat style DOOR.SYS file.
  6104. -------------------------------------------------------------------------------
  6105. system_calls long od_control.system_calls;
  6106. This variable contains the total number of calls that have been
  6107. placed to the BBS, and is available under any BBS which produces
  6108. an EXITINFO.BBS file.
  6109. -------------------------------------------------------------------------------
  6110. system_last char od_control.system_last_caller[36];
  6111. _caller
  6112. This string contains the name of the previous caller to the BBS,
  6113. on any line, and is available under EXITINFO.BBS.
  6114. -------------------------------------------------------------------------------
  6115. system_last char od_control.system_last_handle[36];
  6116. _handle
  6117. This string contains the handle (alias) of the previous caller
  6118. to the BBS, on any line, and is available under EXITINFO.BBS.
  6119. -------------------------------------------------------------------------------
  6120. system_name char od_control.system_name[40];
  6121. The od_control.system_name variable contains the name of the BBS
  6122. under which your door is running. This variable is available
  6123. under any BBS system that produces a DORINFO?.DEF (including RA
  6124. & QBBS which process both DORINFO1.DEF and EXITINFO.BBS files).
  6125. -------------------------------------------------------------------------------
  6126. TIMELOG char od_control.timelog_start_date[9];
  6127. VARIABLES
  6128. This string contains the date of the beginning of the time
  6129. period for which the time log is recorded. This variable is
  6130. available under any system that produces an EXITINFO.BBS file.
  6131. ===============================================================================
  6132. OpenDoors 6.00 Manual End of Page 164
  6133. int od_control.timelog_busyperhour[24];
  6134. This variable is an array of 24 elements, with each element
  6135. indicating the total number of times the BBS was in use during
  6136. each of the 24 hours of the day. Element 0 corresponds to the
  6137. time period of 0:00-1:00, element 1 corresponds to the time
  6138. period of 1:00-2:00, and so on. In order to determine the
  6139. frequency of system use during any hour as a percentage, simply
  6140. calculate the total of all 24 entries in the array, and divide
  6141. any given entry by the total, in order to come up with an
  6142. average. This variable is available under any system that
  6143. produces an EXITINFO.BBS file.
  6144. int od_control.timelog_busyperday[7];
  6145. This variable is an array of 7 elements, with each element
  6146. indicating the total number of times the BBS was in use during
  6147. each of the 7 days of the week. Here, elements 0 corresponds to
  6148. Sunday, element 1 to Monday, and so on. In order to calculate
  6149. the frequency of system use during any day of the week, use the
  6150. same method as for calculating the frequency of calls during
  6151. each hour, as described above. This is only available under
  6152. systems that produces an EXITINFO.BBS file. Note that at least
  6153. some, if not all, versions of RemoteAccess do not maintain this
  6154. variable correctly, and thus even with the presence of an
  6155. EXITINFO.BBS file, this array may contain all zero entries.
  6156. -------------------------------------------------------------------------------
  6157. user_ansi char od_control.user_ansi;
  6158. This variable contains a Boolean value, indicating whether or
  6159. not the user has ANSI mode turned on. If ANSI graphics mode is
  6160. enabled, this variable will contain a value of TRUE, and if ANSI
  6161. graphics mode is disabled, this variable will contain a value of
  6162. FALSE. Many of the OpenDoors functions test the setting of this
  6163. variable in order to determine whether or not they should send
  6164. ANSI-graphics control characters. Also, if this variable
  6165. contains a TRUE value, OpenDoors will display an "[ANSI]"
  6166. indicator on the status line.
  6167. You may change the value of this variable at any time after the
  6168. first call to od_init() or any other OpenDoors functions.
  6169. Depending upon what BBS system your door is running under,
  6170. changes to this variable may or may not result in changes to the
  6171. user's ANSI setting upon return to the BBS.
  6172. ===============================================================================
  6173. OpenDoors 6.00 Manual End of Page 165
  6174. This variable is available under all door information file
  6175. formats.
  6176. -------------------------------------------------------------------------------
  6177. user_ unsigned char od_control.user_attribute;
  6178. attribute
  6179. This variable is a bitmap of eight flags, each of which
  6180. represent individual pieces of information pertaining to the
  6181. user that is currently online. These flags are as follows:
  6182. +-----+------+-----------------------+
  6183. | BIT | MASK | DESCRIPTION |
  6184. +-----+------+-----------------------+
  6185. | 0 | 0x01 | Is the user deleted |
  6186. | 1 | 0x02 | Is screen clearing on |
  6187. | 2 | 0x04 | Is "more" prompt on |
  6188. | 3 | 0x08 | Is ANSI mode on |
  6189. | 4 | 0x10 | User no-kill setting |
  6190. | 5 | 0x20 | Transfer-priority |
  6191. | 6 | 0x40 | Full screen editor |
  6192. | 7 | 0x80 | Quiet mode |
  6193. +-----+------+-----------------------+
  6194. For more information on using and setting bit-mapped flags,
  6195. please see the entry entitled "BITMAPED FLAGS" in the glossary
  6196. of this manual.
  6197. Note that this variable is only available under systems that
  6198. produce and EXITINFO.BBS format door information file.
  6199. -------------------------------------------------------------------------------
  6200. user_ unsigned char od_control.user_attrib2;
  6201. attrib2
  6202. See the user_attrib variable for more information. This variable
  6203. is like the user_attrib variable, except that it contains
  6204. different information. The bit-mapped flags for the
  6205. od_control.user_attrib2 variable are as follows:
  6206. +-----+------+-----------------------+
  6207. | BIT | MASK | DESCRIPTION |
  6208. +-----+------+-----------------------+
  6209. | 0 | 0x01 | User hot-keys setting |
  6210. | 1 | 0x02 | Is AVATAR graphics on |
  6211. | 2 | 0x04 | Full screen reader |
  6212. | 3 | 0x08 | Hidden from userlist |
  6213. +-----+------+-----------------------+
  6214. ===============================================================================
  6215. OpenDoors 6.00 Manual End of Page 166
  6216. Note that this variable is only available under systems that
  6217. produce an EXITINFO.BBS door information file.
  6218. -------------------------------------------------------------------------------
  6219. user_ unsigned char od_control.user_attrib3;
  6220. attrib3
  6221. This variable contains user attribute flags when a RA 2.50 or
  6222. later EXITINFO.BBS file is used.
  6223. -------------------------------------------------------------------------------
  6224. user_avatar char od_control.user_avatar;
  6225. This variable is a Boolean value indicating whether or not
  6226. AVATAR graphics mode is on. If AVATAR graphics is available,
  6227. then many of the OpenDoors functions will make use of AVATAR
  6228. graphics codes for greater display speed. If AVATAR graphics
  6229. mode is on, a [AVT] indicator will appear on the status line. If
  6230. your door is running under a system which produces an RA 1.00+
  6231. style extended EXITINFO.BBS door information file, the
  6232. user_avatar variable is set automatically. If the extended
  6233. EXITINFO.BBS file is not available, this value will default to
  6234. FALSE. In this case, you may wish to ask the user whether or not
  6235. they wish to use AVATAR graphics, and thus set this variable
  6236. yourself.
  6237. -------------------------------------------------------------------------------
  6238. user char od_control.user_birthday[9];
  6239. _birthday
  6240. This variable is a string, in the same format as the
  6241. od_control.user_lastcall variable, which stores the date of the
  6242. user's birthday, if it is available. This variable is only
  6243. available under systems that produce an RA 1.00 and later style
  6244. extended EXITINFO.BBS or Wildcat style DOOR.SYS file.
  6245. -------------------------------------------------------------------------------
  6246. user char od_control.user_callsign[12];
  6247. _callsign
  6248. This variable is a string which contains the user's amateur
  6249. radio call sign, if any. This variable is only available under
  6250. systems that produce a CHAIN.TXT file.
  6251. ===============================================================================
  6252. OpenDoors 6.00 Manual End of Page 167
  6253. -------------------------------------------------------------------------------
  6254. user_combined unsigned char od_control.user_combinedrecord[25];
  6255. record
  6256. This variable is an array of bit-mapped flags, with each flag
  6257. corresponding to an individual message area. In this case, the
  6258. first bit of od_control.ra_combinedrecord[0] corresponds to the
  6259. first message area, the second bit to the second message area,
  6260. and so on. If any given bit-flag is turned on, then the user has
  6261. corresponding message area enabled for combined access, and if
  6262. the bit is turned off, the user does not have the area enabled
  6263. for combined access. A detailed description of the combined
  6264. message access is beyond the scope of this manual. This variable
  6265. is only available under systems that produce an RA 1.00 or later
  6266. style extended EXITINFO.BBS door information file.
  6267. -------------------------------------------------------------------------------
  6268. user_comment char od_control.user_comment[81];
  6269. This variable is a string which contains the sysop's comment
  6270. about the user that is currently online. This comment may be
  6271. displayed on the OpenDoors status line, if this variable is
  6272. available. This variable is available under systems that produce
  6273. an RA 1.00 and later style extended EXITINFO.BBS or Wildcat
  6274. style DOOR.SYS file.
  6275. -------------------------------------------------------------------------------
  6276. user_credit unsigned int od_control.user_credit;
  6277. This variable contains the total amount of NetMail credit that
  6278. the caller has left. Changes to this variable will be by the BBS
  6279. when your door exits and control is returned to the BBS. This
  6280. variable is only available under systems that produce an
  6281. EXITINFO.BBS door information file.
  6282. -------------------------------------------------------------------------------
  6283. user_ char od_control.user_dataphone[13];
  6284. dataphone
  6285. This string contains the user's data or business phone number,
  6286. if available. This value is only available under system that
  6287. produce EXITINFO.BBS, PC-Board/GAP style DOOR.SYS and WildCat
  6288. DOOR.SYS format door information files.
  6289. ===============================================================================
  6290. OpenDoors 6.00 Manual End of Page 168
  6291. -------------------------------------------------------------------------------
  6292. user int od_control.user_deducted_time;
  6293. _deducted
  6294. _time This variable contains a signed integer value, which indicates
  6295. the total amount of time that has been deducted from the user
  6296. during this call. This variable is only available under systems
  6297. that produce an RA 1.00 and later style extended EXITINFO.BBS
  6298. door information file.
  6299. -------------------------------------------------------------------------------
  6300. user_downk unsigned int od_control.user_downk;
  6301. This variable contains the total kilobytes of files that the
  6302. current user has downloaded from the BBS, and is available under
  6303. systems that produce EXITINFO.BBS, Wildcat style DOOR.SYS or
  6304. SFDOORS.DAT format door information files.
  6305. -------------------------------------------------------------------------------
  6306. user unsigned int od_control.user_downlimit;
  6307. _downlimit
  6308. This variable contains the total number of kilobytes that the
  6309. caller is permitted to download during this call. If your door
  6310. allows files do be downloaded, you will probably want to compare
  6311. the value of this variable to the size of any file to be
  6312. transferred and the total kilobytes already downloaded, as
  6313. stored in the od_control.user_todayk variable. This variable is
  6314. only available under systems that produce an EXITINFO.BBS file.
  6315. -------------------------------------------------------------------------------
  6316. user unsigned int od_control.user_downloads;
  6317. _downloads
  6318. This variable contains the total number of files that the
  6319. current user has downloaded from the BBS, and is available under
  6320. systems that produce EXITINFO.BBS, PC-Board/GAP style DOOR.SYS,
  6321. WildCat style DOOR.SYS or SFDOORS.DAT format door information
  6322. files.
  6323. -------------------------------------------------------------------------------
  6324. user_echo char od_control.user_echomailentered;
  6325. mailentered
  6326. This variable is a Boolean value, indicating whether or not the
  6327. user has entered new EchoMail during this call. If this variable
  6328. has a value of TRUE, then EchoMail has been entered, and if it
  6329. has a value of FALSE, then EchoMail has not been entered. This
  6330. ===============================================================================
  6331. OpenDoors 6.00 Manual End of Page 169
  6332. variable will contain a valid value only after od_init() or some
  6333. OpenDoors function has been called. Any changes made to this
  6334. variable will be reflected within the BBS software when control
  6335. is returned to the BBS. This variable is accessible only under
  6336. systems which produce an EXITINFO.BBS door information file.
  6337. -------------------------------------------------------------------------------
  6338. user_error char od_control.user_error_free;
  6339. _free
  6340. This variable contains a Boolean value indicating whether or not
  6341. the user is connected to the BBS via an error free connection
  6342. (eg. a V.42/MNP or similar modem protocol). This variable is
  6343. only available under systems that produce an SFDOORS.DAT,
  6344. Wildcat style DOOR.SYS or RA 1.00 or later style extended
  6345. EXITINFO.BBS door information file.
  6346. -------------------------------------------------------------------------------
  6347. user_first char od_control.user_firstcall[9];
  6348. call
  6349. This variable is a string which contains the date of the user's
  6350. first call, in the same format as the od_control. user_lastcall
  6351. variable. This variable is only available under systems which
  6352. produce an RA 1.00 and later style extended EXITINFO.BBS door
  6353. information file.
  6354. -------------------------------------------------------------------------------
  6355. user_ unsigned char od_control.user_flags[4];
  6356. flags
  6357. The od_control.user_flags variable is an array of four sysop
  6358. defined bit-mapped flags, which represent some sort of
  6359. information about the user. od_control.user_flags[0] stores
  6360. flags A1 - A8 in bits 0 through 7, respectively. Likewise,
  6361. od_control.user_flags[1] stores flags B1 - B8, and so on. This
  6362. variable is only available under systems that produce
  6363. EXITINFO.BBS format door information files.
  6364. -------------------------------------------------------------------------------
  6365. user_handle char od_control.user_handle[36];
  6366. This variable contains the user's alias or handle name, if any.
  6367. If the user does not have and alias or handle, this variable
  6368. will be blank. This variable is only available under systems
  6369. that produce a CHAIN.TXT, RA 1.00 and later extended
  6370. EXITINFO.BBS or Wildcat style DOOR.SYS door information file.
  6371. ===============================================================================
  6372. OpenDoors 6.00 Manual End of Page 170
  6373. -------------------------------------------------------------------------------
  6374. user_ char od_control.user_homephone[13];
  6375. homephone
  6376. This string contains the user's home or data phone number, if
  6377. available. This value is only available under system that
  6378. produce one of the following door information files:
  6379. EXITINFO.BBS, PC-Board/GAP style DOOR.SYS, WildCat style
  6380. DOOR.SYS or SFDOORS.DAT.
  6381. -------------------------------------------------------------------------------
  6382. user unsigned char od_control.user_last_pwdchange;
  6383. _last
  6384. _pwdchange This variable contains the number of calls that the user has
  6385. made since they last changed their password. This variable is
  6386. only available under EXITINFO.BBS files.
  6387. -------------------------------------------------------------------------------
  6388. user char od_control.user_lastdate[9];
  6389. _lastdate
  6390. This variable is a string containing the date of the user's last
  6391. call to the BBS, and should always be of the format:
  6392. "MM-DD-YY"
  6393. Where MM is two digits representing the number of the month of
  6394. the user's call, with 1 being January, 2 being February, and so
  6395. on. DD should be two digits representing the day of the month of
  6396. the user's last call, beginning with 1, and MM should be the
  6397. last two digits of the year of the user's last call.
  6398. This variable is only available under systems that produce one
  6399. of the following door information files: CHAIN.TXT,
  6400. EXITINFO.BBS, PC-Board/GAP style DOOR.SYS or WildCat style
  6401. DOOR.SYS files.
  6402. -------------------------------------------------------------------------------
  6403. user_ unsigned int od_control.user_lastread;
  6404. lastread
  6405. This variable contains the number of the highest message number
  6406. that the user has read, and is only available under EXITINFO.BBS
  6407. format door information files.
  6408. ===============================================================================
  6409. OpenDoors 6.00 Manual End of Page 171
  6410. -------------------------------------------------------------------------------
  6411. user char od_control.user_lasttime[6];
  6412. _lasttime
  6413. This variable contains a string representing the time of the
  6414. user's last call to the BBS, and should always be of the format:
  6415. "HH:MM"
  6416. Where HH is two digits representing the 24-hour format hour of
  6417. the user's last call, and MM is two digits representing the
  6418. minute of the user's last call. Thus, the following strings
  6419. would be valid entries for this string:
  6420. "00:01" (12:01 am)
  6421. "03:47" (3:47 am)
  6422. "18:20" (6:20 pm)
  6423. This variable is only available under systems that produce an
  6424. EXITINFO.BBS or Wildcat style DOOR.SYS format door information
  6425. file.
  6426. -------------------------------------------------------------------------------
  6427. user char od_control.user_location[26];
  6428. _location
  6429. This string contains the name of the location from which the
  6430. current user is calling from. This will usually be the name of
  6431. the city, region (province, state, etc.) and sometimes country
  6432. where the user lives. The contents of this variable are
  6433. displayed on the OpenDoors status line. The value of this
  6434. variable is valid after od_init() or any other OpenDoors
  6435. function has been called. Also, you may change the value of this
  6436. variable if you wish. However, not that these changes may not
  6437. immediately be reflected in the status line, and may or may not
  6438. cause the setting to be changed after the user returns to the
  6439. BBS. This variable is available under systems that produce one
  6440. of the following door information files: DORINFO?.DEF,
  6441. EXITINFO.BBS, PC-Board/GAP style DOOR.SYS, WildCat style
  6442. DOOR.SYS SFDOORS.DAT and CALLINFO.BBS, but is not available
  6443. under CHAIN.TXT or DoorWay style DOOR.SYS files.
  6444. -------------------------------------------------------------------------------
  6445. user char od_control.caller_logindate[9];
  6446. _logindate
  6447. This variable contains a string representing the date on which
  6448. the current call to the BBS began. This variable is in the same
  6449. format as the od_control.user_lastdate variable, described
  6450. ===============================================================================
  6451. OpenDoors 6.00 Manual End of Page 172
  6452. below. This variable is only available under systems which
  6453. produce an EXITINFO.BBS file.
  6454. -------------------------------------------------------------------------------
  6455. user long od_control.user_loginsec;
  6456. _loginsec
  6457. This variable contains the user's security at login, and can be
  6458. used to detect changes by the sysop or other programs during the
  6459. course of the call, by comparing it's value with the
  6460. od_control.user_security variable. This variable is only
  6461. available under systems which produce an EXITINFO.BBS file.
  6462. -------------------------------------------------------------------------------
  6463. user char od_control.user_logintime[6];
  6464. _logintime
  6465. This variable contains a string representing the time of day at
  6466. which the current call to the BBS began. This variable is in the
  6467. same format as the od_control.user_lasttime variable, which is
  6468. also described below. This variable is available under systems
  6469. which produce an EXITINFO.BBS, a Wildcat style DOOR.SYS, or an
  6470. SFDOORS.DAT file.
  6471. -------------------------------------------------------------------------------
  6472. user char od_control.user_logonpassword[16];
  6473. _logon
  6474. password This variable is a string which contains the user's password
  6475. at the time at which the current call to the BBS began. This
  6476. variable can be used to detect changes by the sysop or other
  6477. programs to the user's password, which have taken place during
  6478. the course of the call. In order to detect such changes, simply
  6479. compare the contents of this string with the contents of the
  6480. od_control.user_password variable. This variable is only
  6481. available under systems which produce an EXITINFO.BBS format
  6482. door information file.
  6483. -------------------------------------------------------------------------------
  6484. user char od_control.user_menustack[50][9];
  6485. _menustack
  6486. This variable is an array of 50 strings, containing the stack of
  6487. BBS menus that have been executed, and is used to record the
  6488. current position of the user within the BBS's menu system. Each
  6489. string contains just the base portion of the filename of the
  6490. menu, without the extension. The od_control.ra_menustackpointer
  6491. variable points to the top of the menu stack. However, a
  6492. ===============================================================================
  6493. OpenDoors 6.00 Manual End of Page 173
  6494. complete discussion of the menu stack is beyond the scope of
  6495. this manual. This variable is only available under systems that
  6496. produce an RA 1.00 and later style extended EXITINFO.BBS door
  6497. information file.
  6498. -------------------------------------------------------------------------------
  6499. user unsigned char od_control.user_menustackpointer;
  6500. _menustack
  6501. pointer This variable points to the top of the current menu stack. For
  6502. more information on the menu stack, please refer to the
  6503. od_control.ra_menustack variable, above. This variable is only
  6504. available under systems that produce an RA 1.00 and later style
  6505. extended EXITINFO.BBS door information file.
  6506. -------------------------------------------------------------------------------
  6507. user unsigned int od_control.user_messages;
  6508. _messages
  6509. This variable contains a value representing the total number of
  6510. messages that have been written by the user, and is available
  6511. under EXITINFO.BBS or Wildcat style DOOR.SYS format door
  6512. information files.
  6513. -------------------------------------------------------------------------------
  6514. user_name char od_control.user_name[36];
  6515. This string contains the name of the user that is currently on-
  6516. line, and is used by OpenDoors to display the current user name
  6517. on the status line, and will most likely be used by your door
  6518. for differentiating among different users. In most cases, you
  6519. should probably not change the value of this variable, as a
  6520. user's name does not usually change, and doing so could results
  6521. in problems when returning to some BBS systems. For an example
  6522. of using this variable, see the EX_VOTE.C example program. This
  6523. variable is available under all BBS systems.
  6524. -------------------------------------------------------------------------------
  6525. user_net_ unsigned int od_control.user_net_credit;
  6526. credit
  6527. This variable contains the amount of NetMail credit that the
  6528. current user has to his or her name. This variable is only
  6529. available under systems that produce an EXITINFO.BBS file.
  6530. ===============================================================================
  6531. OpenDoors 6.00 Manual End of Page 174
  6532. Note that if you wish to change the value of the user's
  6533. remaining NetMail credit, you should use the od_control.
  6534. user_credit variable, instead of this variable.
  6535. -------------------------------------------------------------------------------
  6536. user_net char od_control.user_netmailentered;
  6537. mailentered
  6538. This variable is a Boolean value, indicating whether or not the
  6539. user has entered new NetMail or GroupMail during this call. If
  6540. this variable has a value of TRUE, then NetMail/GroupMail has
  6541. been entered, and if it has a value of FALSE, then
  6542. NetMail/GroupMail has not been entered. This variable will
  6543. contain a valid value only after od_init() or some OpenDoors
  6544. function has been called. Any changes made to this variable will
  6545. be reflected within the BBS software when control is returned to
  6546. the BBS. This variable is accessible only under systems which
  6547. produce an EXITINFO.BBS door information file.
  6548. -------------------------------------------------------------------------------
  6549. user_num unsigned int od_control.user_num;
  6550. This variable contains the number of the user's record in the
  6551. user database file, where 0 is the first record. This can be
  6552. useful for changing user settings that are not re-read by the
  6553. BBS, such as the user's phone number or security level which
  6554. might be altered by a call back verification door. However, the
  6555. value of this variable itself should not be altered.
  6556. This variable is available under systems which produce any of
  6557. the following door information file formats: CHAIN.TXT, PC-
  6558. Board/GAP style DOOR.SYS, Wildcat style DOOR.SYS SFDOORS.DAT and
  6559. EXITINFO.BBS.
  6560. -------------------------------------------------------------------------------
  6561. user_ unsigned int od_control.user_numcalls;
  6562. numcalls
  6563. This variable contains the total number of calls that the
  6564. current user has placed to the BBS, and is available under
  6565. systems that produce EXITINFO.BBS or PC-Board/GAP and Wildcat
  6566. style DOOR.SYS door information files.
  6567. ===============================================================================
  6568. OpenDoors 6.00 Manual End of Page 175
  6569. -------------------------------------------------------------------------------
  6570. user unsigned int od_control.user_numpages;
  6571. _numpages
  6572. The value of this variable contains the total number of times
  6573. that the user has paged the sysop, and can be used to limit the
  6574. number of times that the user is permitted to page the sysop.
  6575. OpenDoors increments this variable every time that the user
  6576. pages the sysop, via the od_page() function. This variable is
  6577. used with all types of door information files. However, this
  6578. variable will only reflect the value within the BBS if an
  6579. EXITINFO.BBS file is produced. Otherwise, the variable will only
  6580. contain the number of times that the user has paged within the
  6581. door, but not the total number of times the user has paged.
  6582. Under EXITINFO.BBS systems, changes to the value of this
  6583. variable will be reflected within the BBS upon return by the
  6584. DOOR.
  6585. -------------------------------------------------------------------------------
  6586. user char od_control.user_password[16];
  6587. _password
  6588. This variable contains the user's password for accessing the
  6589. BBS. OpenDoors does not use this value itself. This variable
  6590. will contain a valid value only after od_init() or some
  6591. OpenDoors function has been called. You may change the value of
  6592. this variable. Note, however, that changes in this variable may
  6593. or may not cause the setting to be changed when control returns
  6594. to the BBS - this will depend upon the particular BBS system
  6595. your door is running under. This variable is only available
  6596. under systems that produce one of the following door information
  6597. files: EXITINFO.BBS, PC-Board/GAP and Wildcat style DOOR.SYS,
  6598. SFDOORS.DAT, and CALLINFO.BBS.
  6599. -------------------------------------------------------------------------------
  6600. user_pending unsigned int od_control.user_pending;
  6601. This variable represents the total value of NetMail that has
  6602. been written by the current user, but not yet exported from the
  6603. message base. This variable is only available under systems that
  6604. produce an EXITINFO.BBS door information file.
  6605. -------------------------------------------------------------------------------
  6606. user_reason char od_control.user_reasonforchat[78];
  6607. forchat
  6608. This variable is a string, containing the reason for which the
  6609. user wishes to chat with the sysop, as they entered at the time
  6610. of paging the sysop. This variable will contain an empty string
  6611. ===============================================================================
  6612. OpenDoors 6.00 Manual End of Page 176
  6613. if the user has not paged the sysop, or if the reason the user
  6614. wishes to chat is unknown. See also the od_control.user_wantchat
  6615. variable. This variable is available under all BBS systems,
  6616. regardless of what style of door information file they produce.
  6617. However, this variable will not be passed between the door and
  6618. BBS, and thus the user's reason for chat within the door will
  6619. not necessarily correspond to their reason for chat outside the
  6620. door.
  6621. -------------------------------------------------------------------------------
  6622. user_rip char user_rip;
  6623. This variable is set to TRUE if the user has RIP (Remote Imaging
  6624. Protocol) graphics enabled, and FALSE if they do not. This
  6625. setting can be determined from the door information (drop) file
  6626. in many cases. In other cases, you can automatically determine
  6627. whether or not the user's system supports RIP graphics using the
  6628. od_autodetect() function (see page 48).
  6629. -------------------------------------------------------------------------------
  6630. user_rip_ver BYTE user_rip_ver;
  6631. This variable contains the version of the RIP protocol that is
  6632. in use. This variable is only available under a RemoteAccess
  6633. 2.50 EXITINFO.BBS file.
  6634. -------------------------------------------------------------------------------
  6635. user unsigned int od_control.user_screen_length;
  6636. _screen
  6637. _length This value of this variable represents the total number of
  6638. lines that can be displayed on the user's screen at once, and is
  6639. usually either 24 or 25. You may wish to make use of this
  6640. variable to allow your door to pause the display of long pieces
  6641. of text after every screen length, in order to allow the user to
  6642. read this information before it passes off of their screen. In
  6643. this case, you would simply maintain a counter of the total
  6644. number of lines displayed, and when this value reaches one less
  6645. than the length of the user screen, display a prompt asking the
  6646. user to whether or not they wish to continue.
  6647. This variable is set to the user's setting within the BBS under
  6648. systems that produce any of the following door information file
  6649. formats: CHAIN.TXT, EXITINFO.BBS, PC-Board/GAP and Wildcat style
  6650. DOOR.SYS and CALLINFO.BBS files.
  6651. ===============================================================================
  6652. OpenDoors 6.00 Manual End of Page 177
  6653. This variable is used by the OpenDoors function,
  6654. od_list_files(). If this variable contains a valid value,
  6655. OpenDoors will pause the listing of files after every screen,
  6656. and give the user the option of continuing, aborting, or
  6657. disabling the "Continue?" prompt for the rest of the file
  6658. listing. Thus, if you are using the od_list_files() under a
  6659. system that does not produce one of the door information files
  6660. listed above, you may wish to obtain the user's screen length
  6661. from the user themselves. If the screen length is not available
  6662. from the particular type of door information file that is found,
  6663. and you do not set this value yourself, this variable will
  6664. default to 23. If you are going to set the value of this
  6665. variable yourself, you should do so after having called
  6666. od_init() or some OpenDoors function.
  6667. -------------------------------------------------------------------------------
  6668. user_ unsigned char od_control.user_screenwidth;
  6669. screenwidth
  6670. This variable contains a value representing the width of the
  6671. user's screen, and will most often be equal to 80. This variable
  6672. is only available under systems that produce a CHAIN.TXT or RA
  6673. 1.00 and later style extended EXITINFO.BBS door information
  6674. file.
  6675. -------------------------------------------------------------------------------
  6676. user unsigned int od_control.user_security;
  6677. _security
  6678. This variable contains a numerical value representing the user's
  6679. security access level on the BBS. You may wish to use this value
  6680. to determine whether or not the current user of your door should
  6681. have access to certain sysop-only functions. In this case, you
  6682. may wish to have a configuration file used by your door, in
  6683. which the sysop may define the minimum security level for sysop
  6684. access. You would then be able to compare this configuration
  6685. setting to the security level stored in this variable, in order
  6686. to determine whether or not sysop function should be available.
  6687. An alternative method, used by the EX_VOTE.C sample door, of
  6688. determining whether or not the current user is the sysop is to
  6689. compare the user's name with the value of the
  6690. od_control.sysop_name variable. This method has the advantage of
  6691. not requiring a configuration program, but the disadvantage that
  6692. the door will not function correctly under all BBS systems, as
  6693. the od_control.sysop_name variable is not available under all
  6694. BBS systems.
  6695. The od_control.user_security variable is available under BBS
  6696. systems that produce any of the following door information file
  6697. ===============================================================================
  6698. OpenDoors 6.00 Manual End of Page 178
  6699. formats: CHAIN.TXT, EXITINFO.BBS, PC-Board/GAP and Wildcat style
  6700. DOOR.SYS, SFDOORS.DAT or CALLINFO.BBS.
  6701. -------------------------------------------------------------------------------
  6702. user_sex char od_control.user_sex;
  6703. This variable contains a single character representing the
  6704. gender of the user that is currently online. This variable will
  6705. contain an upper-case 'F' if the user is female, and an upper-
  6706. case 'M' if the user is male. This variable is available under
  6707. systems that produce a CHAIN.TXT or RA 2.x style EXITINFO.BBS
  6708. file.
  6709. -------------------------------------------------------------------------------
  6710. user_subdate char od_control.user_subdate[9];
  6711. This variable is a string, in the same format as the
  6712. od_control.user_lastdate variable, which stores the date of
  6713. expiry of the user's subscription to the BBS. This variable is
  6714. only available under systems which produce a PC-Board/GAP and
  6715. Wildcat style DOOR.SYS or RA 1.00 and later style extended
  6716. EXITINFO.BBS door information file.
  6717. -------------------------------------------------------------------------------
  6718. user int od_control.user_timelimit;
  6719. _timelimit
  6720. This variable contains the amount of time, in minutes, that the
  6721. user has left in the door. Note that this value may or may not
  6722. be equal to the total amount of time that the user has left on
  6723. the BBS, depending upon whether the BBS or a third-party door
  6724. manager program only allows a limited amount of time in this
  6725. door. This variable contains a valid value after od_init() or
  6726. some OpenDoors function has been called. OpenDoors uses this
  6727. variable to keep track of how much time the user has left in the
  6728. door, and will automatically warn the user when nearly all of
  6729. his or her time has been used up. OpenDoors will also force the
  6730. user out of the door when their time in the door has expired.
  6731. OpenDoors automatically subtracts one minute from this variable
  6732. every minute that OpenDoors is active, unless chat mode has been
  6733. activated (in which case the user's time will freeze), and also
  6734. adjusts the value of this variable when the sysop uses the time
  6735. adjustment function keys. Hence, you will not normally have any
  6736. need to alter the value of this variable yourself. However,
  6737. there may be some cases in which you wish to subtract a penalty
  6738. or add a bonus to the user's time, such as in a "timebank" door
  6739. or a door game that permits the user to "gamble time".
  6740. ===============================================================================
  6741. OpenDoors 6.00 Manual End of Page 179
  6742. Depending on which BBS system your door is running under, the
  6743. value of this variable may or may not effect the user's time
  6744. left upon return to the BBS. The BBS system will either reset
  6745. the user's time to the value re-written to the door information
  6746. file (this variable), or will always subtract the amount of time
  6747. spent in the door from the user's remaining time.
  6748. This variable is available under all door information file
  6749. formats.
  6750. -------------------------------------------------------------------------------
  6751. user unsigned int od_control.user_todayk;
  6752. _todayk
  6753. This variable contains the total kilobytes of files that the
  6754. current user has downloaded from the BBS during the current day,
  6755. and is available under systems that produce EXITINFO.BBS, PC-
  6756. Board/GAP and Wildcat style DOOR.SYS, or SFDOORS.DAT format door
  6757. information files.
  6758. -------------------------------------------------------------------------------
  6759. user_upk unsigned int od_control.user_upk;
  6760. This variable contains the total kilobytes of files that the
  6761. current user has uploaded to the BBS, and is available under
  6762. systems that produce EXITINFO.BBS, Wildcat style DOOR.SYS or
  6763. SFDOORS.DAT files.
  6764. -------------------------------------------------------------------------------
  6765. user_uploads unsigned int od_control.user_uploads;
  6766. This variable contains the total number of files that the
  6767. current user has uploaded to the BBS, and is available under
  6768. systems that produce EXITINFO.BBS, PC-Board/GAP and Wildcat
  6769. style DOOR.SYS, or SFDOORS.DAT format door information files.
  6770. -------------------------------------------------------------------------------
  6771. user char od_control.user_wantchat;
  6772. _wantchat
  6773. This variable is a Boolean value which indicates whether or not
  6774. the user wishes to chat with the sysop (ie, the user has paged
  6775. the sysop, but has yet to receive a chat with the sysop). This
  6776. variable is used under all door information file formats.
  6777. However, changes to this variable are only reflected on the BBS
  6778. ===============================================================================
  6779. OpenDoors 6.00 Manual End of Page 180
  6780. when the door is running under a system that produces an
  6781. EXITINFO.BBS door information file.
  6782. This variable is automatically turned on (ie., set to TRUE),
  6783. when the user begins to page the sysop for chat, within the
  6784. od_page() function, and is automatically turned off (ie., set to
  6785. FALSE), when the sysop breaks in for chat via the chat function
  6786. key. Also, setting this variable to TRUE will turn on the
  6787. flashing want-chat indicator on the OpenDoors status line.
  6788. -------------------------------------------------------------------------------
  6789. user unsigned int od_control.user_xi_record;
  6790. _xi_record
  6791. This variable contains the number of the user's record in the
  6792. USERXI.BBS file, if any. This variable is only available under
  6793. system that produce a Remote Access 1.00 and later style
  6794. extended door information file.
  6795. ===============================================================================
  6796. OpenDoors 6.00 Manual End of Page 181
  6797. CONTROL STRUCTURE - DOOR SETTINGS
  6798. -------------------------------------------------------------------------------
  6799. This section deals with those variables in the OpenDoors control
  6800. structure which reflect the current door settings. These
  6801. variables are as follows:
  6802. od_cur_attrib The current display attribute, or -1 if
  6803. unknown.
  6804. od_okaytopage Controls whether the user is currently
  6805. permitted to page the sysop.
  6806. od_pageendmin End of valid paging hours.
  6807. od_pagestartmin Start of valid paging hours.
  6808. od_silent_mode Turns off local user interface.
  6809. od_user_keyboard_on Controls whether OpenDoors will
  6810. currently accept input from the remote
  6811. user's keyboard.
  6812. od_update_status_now Forces immediate update of the status
  6813. line.
  6814. sysop_next Indicates whether or not the sysop has
  6815. reserved use of the system after the
  6816. current calls.
  6817. -------------------------------------------------------------------------------
  6818. od_cur int od_control.od_cur_attrib;
  6819. _attrib
  6820. This read-only values stores the current display color
  6821. attribute, or the value -1 if the current display color is
  6822. unknown (such as when the door first begins execution).
  6823. -------------------------------------------------------------------------------
  6824. od char od_control.od_okaytopage;
  6825. _okaytopage
  6826. This variable allows you to control whether or not the user is
  6827. currently permitted to page the sysop via the od_page()
  6828. function. A value of PAGE_ENABLE indicates that paging is
  6829. currently permitted, regardless of the sysop page hours setting.
  6830. A value of PAGE_DISABLE indicates that paging is not current
  6831. permitted. A value of PAGE_USE_HOURS indicates that the
  6832. od_page() function should check the values of the
  6833. ===============================================================================
  6834. OpenDoors 6.00 Manual End of Page 182
  6835. od_pagestartmin and od_pageendmin variables in order to
  6836. determine whether or not paging should be permitted.
  6837. The od_okaytopage variable should only be set after you call
  6838. od_init() or some other OpenDoors function. The default value is
  6839. PAGE_USE_HOURS. For more information on the od_page() function
  6840. itself, see page 101.
  6841. -------------------------------------------------------------------------------
  6842. od unsigned int od_control.od_pageendmin;
  6843. _pageendmin
  6844. This variable can be used to set the beginning of valid sysop
  6845. paging hours within the od_page() function. If the
  6846. od_control.od_okaytopage variable (which is described above) is
  6847. set to MAYBE, then OpenDoors will check the value of this
  6848. variable prior to paging the sysop via the od_page() function.
  6849. This variable should contain the time at which the valid sysop
  6850. paging hours end, represented as the a number of minutes since
  6851. midnight. For more information on the od_page() function itself,
  6852. see page 101.
  6853. -------------------------------------------------------------------------------
  6854. od unsigned int od_control.od_pagestartmin;
  6855. _pagestartmin
  6856. This variable can be used to set the beginning of valid sysop
  6857. paging hours within the od_page() function. If the
  6858. od_control.od_okaytopage variable (which is described above) is
  6859. set to MAYBE, then OpenDoors will check the value of this
  6860. variable prior to paging the sysop via the od_page() function.
  6861. This variable should contain the time at which the valid sysop
  6862. paging hours begin, represented as the a number of minutes since
  6863. midnight. For more information on the od_page() function itself,
  6864. see page 101.
  6865. -------------------------------------------------------------------------------
  6866. od_silent BOOL od_control.od_silent_mode;
  6867. _mode
  6868. If this variable is set to TRUE prior to the first call to any
  6869. OpenDoors function, OpenDoors will operate in silent mode, where
  6870. the local display and sysop commands are not used. Silent mode
  6871. is automatically disabled if the program is running in local
  6872. mode.
  6873. ===============================================================================
  6874. OpenDoors 6.00 Manual End of Page 183
  6875. -------------------------------------------------------------------------------
  6876. od_update char od_control.od_update_status_now;
  6877. _status_now
  6878. Setting this variable to TRUE forces OpenDoors to update the
  6879. status line during the next od_kernel() execution. When the
  6880. status line is updated, this variable is reset to its default
  6881. value of FALSE.
  6882. -------------------------------------------------------------------------------
  6883. od_user char od_control.od_user_keyboard_on;
  6884. _keyboard_on
  6885. This variable is a Boolean value, indicating whether OpenDoors
  6886. will currently accept input from a remote user. OpenDoors
  6887. provides a function key (usually [ALT]-[K], unless you have
  6888. changed the default), which will allow the sysop to temporarily
  6889. prevent the user from having any control over the door. When the
  6890. sysop activates this feature, a flashing [Keyboard-Off]
  6891. indicator will appear on the status line, and this variable will
  6892. be set to FALSE. When the sysop presses the [ALT]-[K]
  6893. combination a second time, to toggle the user's keyboard back
  6894. on, the flashing indicator will disappear, and this variable
  6895. will be set back to TRUE.
  6896. -------------------------------------------------------------------------------
  6897. sysop_next char od_control.sysop_next;
  6898. This variable is a Boolean value, indicating whether or not the
  6899. "sysop next" feature has been activated. The "sysop next"
  6900. feature, which reserves the system for the sysop after the call
  6901. has ended, can be toggled on and off within OpenDoors by use of
  6902. a function key (Alt-N by default). Also, when the "sysop next"
  6903. feature has been activated, an indicator will appear on the
  6904. OpenDoors status line. This variable is only available under
  6905. systems that produce an SFDOORS.DAT or RA 1.00 and later style
  6906. extended EXITINFO.BBS door information file. For more
  6907. information on testing the type of door information file
  6908. available, please see page 158.
  6909. ===============================================================================
  6910. OpenDoors 6.00 Manual End of Page 184
  6911. CONTROL STRUCTURE - DIAGNOSTICS
  6912. -------------------------------------------------------------------------------
  6913. To help in diagnosing problems in your OpenDoors programs,
  6914. OpenDoors stores information on the most recent error which
  6915. occurred. When any of the OpenDoors functions return an "error"
  6916. or "failure" state, the reason for this failure is recorded.
  6917. The following OpenDoors control structure variable provides
  6918. diagnostics information:
  6919. od_error Stores a "reason code" for the last
  6920. failed OpenDoors API function call.
  6921. -------------------------------------------------------------------------------
  6922. od_error int od_control.od_error;
  6923. When any of the OpenDoors API functions return an "error" or
  6924. "failure" state (usually denoted by either of the values FALSE
  6925. or NULL), the reason for the failure is recorded in this
  6926. variable. Since successful function calls do not alter the value
  6927. of the od_control.od_error variable, you must be careful not
  6928. only to check the value of the od_control.od_error variable, but
  6929. also to check the OpenDoors function return codes, in order to
  6930. determine which function failed.
  6931. This variable will always store the reason for the most recent
  6932. function call failure, or ERR_NONE if no functions have failed.
  6933. od_error may take on any of the following values:
  6934. ERR_NONE Indicates that no error has occurred
  6935. yet.
  6936. ERR_MEMORY Function was unable to allocate
  6937. required memory. This usually indicates
  6938. that there is not enough available
  6939. memory. This failure may also be due to
  6940. memory corruption caused by your
  6941. program inadvertently overwriting heap
  6942. structures. If your program has been
  6943. compiled in either the small or the
  6944. medium memory model, try recompiling it
  6945. in the compact, large, or huge memory
  6946. models. If your program is already
  6947. compiled in the compact, large, or huge
  6948. memory models, try making more system
  6949. memory available to your program.
  6950. ===============================================================================
  6951. OpenDoors 6.00 Manual End of Page 185
  6952. ERR_NOGRAPHICS This setting indicates that the
  6953. function called requires ANSI, AVATAR
  6954. or RIP graphics mode, but none of these
  6955. modes are active.
  6956. ERR_PARAMETER An invalid parameter was passed to an
  6957. OpenDoors functions. Check the
  6958. function's description in chapter four,
  6959. to determine the required values for
  6960. each function parameter.
  6961. ERR_FILEOPEN OpenDoors was unable to open a file.
  6962. This can be due to the specified
  6963. filename not existing, due to the file
  6964. being locked for exclusive access by
  6965. another process, or due to a hardware
  6966. failure.
  6967. ERR_FILEREAD OpenDoors was able to open the
  6968. specified file, but unable to read the
  6969. required data from the file. This error
  6970. may be due to an invalid file format,
  6971. due to a portion of the file being
  6972. locked by another process, or due to a
  6973. hardware failure.
  6974. ERR_LIMIT An internal function limit has been
  6975. exceeded. Refer to the function's
  6976. description in chapter four for
  6977. information on the function's
  6978. limitations.
  6979. ERR_NOREMOTE Indicates that a function has been
  6980. called which is not valid in local
  6981. mode, such as od_carrier() or
  6982. od_set_dtr().
  6983. ===============================================================================
  6984. OpenDoors 6.00 Manual End of Page 186
  6985. CONTROL STRUCTURE - OPENDOORS CUSTOMIZATION
  6986. -------------------------------------------------------------------------------
  6987. The OpenDoors control structure provides many variables which
  6988. allow you to customize OpenDoor's behavior and appearance. These
  6989. customization variables fit into one of the following
  6990. categories:
  6991. General Behavior Customization Variables
  6992. Sysop Function Keys Customization Variables
  6993. Color Customization Variables
  6994. Language-Specific Prompts Customization Variables
  6995. This section deals with those variables that fit into the first
  6996. category, "General Behavior Customization Variables". The other
  6997. categories are dealt with in the following sections of this
  6998. chapter.
  6999. Below is a brief overview of the variables grouped into this
  7000. section of the OpenDoors control structure. Following the
  7001. overview is a detailed description of each of these variables.
  7002. od_app_icon Program icon for Win32 version.
  7003. od_box_chars Array of characters used by the
  7004. od_draw_box() function.
  7005. od_before_exit Function to call prior to exiting.
  7006. od_cafter_chat Function to call after sysop chat.
  7007. od_cafter_shell Function to call after DOS shell.
  7008. od_cbefore_chat Function to call prior to sysop chat.
  7009. od_cbefore_shell Function to call prior to DOS shell.
  7010. od_cfg_lines Sets the configuration file's custom
  7011. door information file line keywords.
  7012. od_cfg_text Sets the built-in configuration file
  7013. keywords that OpenDoors will recognize.
  7014. od_chat_active Controls whether or not sysop chat mode
  7015. is active.
  7016. od_clear_on_exit Controls whether the screen is cleared
  7017. upon door exit.
  7018. ===============================================================================
  7019. OpenDoors 6.00 Manual End of Page 187
  7020. od_color_delimiter Indicates what character should delimit
  7021. imbedded color codes for the
  7022. od_printf() function.
  7023. od_color_names Strings which OpenDoors recognizes as
  7024. the names of various text colors.
  7025. od_config_file Used to enable or disable the OpenDoors
  7026. configuration file system.
  7027. od_config_filename Sets the filename that will be read by
  7028. the configuration file system.
  7029. od_config_function The callback function that OpenDoors
  7030. will call to allow your program to
  7031. process custom configuration file
  7032. entries.
  7033. od_default_personality Sets the default personality to be used
  7034. with the OpenDoors Multiple Personality
  7035. System, and also sets the personality
  7036. to use when the MPS is not active.
  7037. od_default_rip_win Whether OpenDoors should use the
  7038. default 43-line RIP window for ANSI
  7039. text (TRUE), or a 23-line window
  7040. (FALSE).
  7041. od_disable Disable OpenDoors activities such as
  7042. reading door information file and
  7043. monitoring carrier detect / remaining
  7044. time.
  7045. od_disable_dtr Specifies the string that will be sent
  7046. to the modem to prevent the modem from
  7047. hanging up when DTR is lowered.
  7048. od_emu_simluate_modem Simulates modem display speed for
  7049. emulation functions such as
  7050. od_send_file(), od_disp_emu() and
  7051. od_hotkey_menu().
  7052. od_errorlevel Sets the errorlevel OpenDoors exits
  7053. with under various conditions.
  7054. od_force_local Forces door to operate in local mode,
  7055. ignoring any door information file and
  7056. using default user settings.
  7057. od_help_callback Allows you to provide a help menu item
  7058. under the Win32 version of OpenDoors
  7059. ===============================================================================
  7060. OpenDoors 6.00 Manual End of Page 188
  7061. od_in_buf_size Sets size of OpenDoor's internal
  7062. local/remote inbound buffer.
  7063. od_inactive_warning Number of seconds before hanging up
  7064. that OpenDoors displays the inactivity
  7065. timeout warning.
  7066. od_inactivity Controls user inactivity timeout.
  7067. od_ker_exec Is called whenever od_kernel()
  7068. executes.
  7069. od_last_input Indicates whether the last input came
  7070. from the remote user (==0) or the local
  7071. sysop (==1).
  7072. od_list_pause Controls whether or not the user may
  7073. pause display within the
  7074. od_list_files() and od_send_file()
  7075. functions by using the [P] key.
  7076. od_list_stop Controls whether or not the user may
  7077. terminate display within the
  7078. od_list_files() and od_send_file()
  7079. functions using [S], [CTRL]-[K], etc.
  7080. od_logfile Enables or disables the OpenDoors log
  7081. file system.
  7082. od_logfile_disable Prevents the logfile from being opened,
  7083. even if the logfile is enabled by
  7084. od_logfile.
  7085. od_logfile_messages Array of message strings that OpenDoors
  7086. will use when writing log file entries.
  7087. od_logfile_name Contains the filename and possibly path
  7088. of the logfile.
  7089. od_maxtime Indicates the maximum length of time
  7090. any user is permitted to use the door.
  7091. od_maxtime_deduction Indicates the amount of time that has
  7092. temporarily been taken away from the
  7093. user's remaining time, as a result of
  7094. the maximum door time setting.
  7095. od_mps Enables or disables the OpenDoors
  7096. Multiple Personality System.
  7097. od_no_file_func Called when no door information file
  7098. can be read.
  7099. ===============================================================================
  7100. OpenDoors 6.00 Manual End of Page 189
  7101. od_no_ra_codes Disables translation of RA/QBBS control
  7102. codes.
  7103. od_nocopyright Prevents OpenDoors from displaying it's
  7104. name and version number when a door
  7105. program begins execution.
  7106. od_noexit Prevents OpenDoors from exiting when
  7107. the od_exit() function is called.
  7108. od_page_len Controls length of the sysop page beep.
  7109. od_page_pausing Enables or disables page pausing in
  7110. od_send_file(), od_hotkey_menu() and
  7111. od_list_files() functions.
  7112. od_page_startmin Indicates the time of day at which
  7113. sysop paging is first enabled.
  7114. od_page_statusline Which status line (if any) is activated
  7115. when the user pages the sysop.
  7116. od_page_endmin Indicates the time of day at which
  7117. sysop paging is disabled.
  7118. od_prog_name Stores the name of your program.
  7119. od_prog_version Stores the version number of your
  7120. program.
  7121. od_prog_copyright Place your copyright information here.
  7122. od_reg_key Stores the registration key that you
  7123. receive when purchasing OpenDoors.
  7124. od_reg_name Stores your name or your companies name
  7125. when you have purchased an OpenDoors
  7126. license (registration).
  7127. od_spawn_freeze_time Indicates whether the user's time
  7128. remaining continues to be decreased
  7129. during the execution of the
  7130. od_spawn...() functions (FALSE), or if
  7131. the timer should be "frozen" (TRUE).
  7132. od_swapping_disable Disables swapping during DOS shell and
  7133. od_spawn...() functions.
  7134. od_swapping_noems Prevents swapping form being done to
  7135. EMS expanded memory.
  7136. ===============================================================================
  7137. OpenDoors 6.00 Manual End of Page 190
  7138. od_swapping_path Location where disk swap file should be
  7139. created.
  7140. od_status_on Controls whether the status line sub-
  7141. system is active.
  7142. od_time_msg_func Called instead of displaying time limit
  7143. warning messages.
  7144. -------------------------------------------------------------------------------
  7145. od_app HICON od_control.od_app_icon;
  7146. _icon
  7147. Normally, the Win32 version of OpenDoors displays its own icon
  7148. on the application title bar, on the Windows taskbar, and in the
  7149. help|about dialog box. You can supply your own icon by setting
  7150. this variable to point to the handle of the icon, as returned by
  7151. LoadIcon();
  7152. -------------------------------------------------------------------------------
  7153. od_box char od_control.od_box_chars[8];
  7154. _chars
  7155. This variable allows you to specify which character the
  7156. od_draw_box() function uses in drawing the boarder of a window.
  7157. The elements of this array are as follows:
  7158. od_box_chars[BOX_UPPERLEFT] - Upper left corner of box
  7159. od_box_chars[BOX_TOP] - Top horizontal line
  7160. od_box_chars[BOX_UPPERRIGHT] - Upper right corner of box
  7161. od_box_chars[BOX_LEFT] - Left Vertical line
  7162. od_box_chars[BOX_LOWERLEFT] - Lower left corner of box
  7163. od_box_chars[BOX_LOWERRIGHT] - Lower right corner of box
  7164. od_box_chars[BOX_BOTTOM] - Bottom horizontal line
  7165. od_box_chars[BOX_RIGHT] - Right horizontal line
  7166. -------------------------------------------------------------------------------
  7167. od_before void (*od_control.od_before_exit)();
  7168. _exit
  7169. This variable contains a pointer to a function which OpenDoors
  7170. should call prior to exiting, or NULL if you do not wish to have
  7171. any function called at exit time. For an example of the use of
  7172. this variable, see the description of the EX_VOTE.C example
  7173. program, which begins on page 38.
  7174. ===============================================================================
  7175. OpenDoors 6.00 Manual End of Page 191
  7176. -------------------------------------------------------------------------------
  7177. od_cafter void (*od_control.od_cafter_chat)();
  7178. _chat
  7179. The function pointed to by this variable will be called after
  7180. sysop chat mode has ended. This may be useful for allowing you
  7181. to save the user's screen contents prior to chat, and restoring
  7182. the afterwards. If this variable contains its default value of
  7183. NULL, no function will be called. To alter the string of text
  7184. which is displayed after sysop chat, see the
  7185. od_control.od_after_chat variable, which is described in the
  7186. section on the prompts customization portion of the control
  7187. structure.
  7188. -------------------------------------------------------------------------------
  7189. od_cafter void (*od_control.od_cafter_shell)();
  7190. _shell
  7191. The function pointed to by this variable will be called after
  7192. the sysop has returned from a DOS shell. If this variable
  7193. contains its default value of NULL, no function will be called.
  7194. To alter the string of text which is displayed after a DOS
  7195. shell, see the od_control.od_after_shell variable, which is
  7196. described in the section on the prompts customization portion of
  7197. the control structure.
  7198. -------------------------------------------------------------------------------
  7199. od_cbefore void (*od_control.od_cbefore_chat)();
  7200. _chat
  7201. The function pointed to by this variable will be called prior to
  7202. entering sysop chat mode. This may be useful for allowing you to
  7203. save the user's screen contents prior to chat, and restoring the
  7204. afterwards. If this variable contains its default value of NULL,
  7205. no function will be called. To alter the string of text which is
  7206. displayed prior to sysop chat, see the od_control.od_before_chat
  7207. variable, which is described in the section on the prompts
  7208. customization portion of the control structure. To replace the
  7209. OpenDoors sysop chat facility with your own, simply activate
  7210. your chat mode when this function is called. Your chat mode
  7211. facility should remain active until OpenDoors sets the
  7212. od_control.od_chat_active variable to FALSE. If you wish to
  7213. terminate chat mode prior to this variable being set to FALSE,
  7214. you should set this variable to FALSE yourself if you do not
  7215. wish OpenDoors to activate its own chat mode.
  7216. ===============================================================================
  7217. OpenDoors 6.00 Manual End of Page 192
  7218. -------------------------------------------------------------------------------
  7219. od_cbefore void (*od_control.od_cbefore_shell)();
  7220. _shell
  7221. The function pointed to by this variable will be called prior to
  7222. executing a sysop DOS shell. If this variable contains its
  7223. default value of NULL, no function will be called. To alter the
  7224. string of text which is displayed before a DOS shell, see the
  7225. od_control.od_before_shell variable, which is described in the
  7226. section on the prompts customization portion of the control
  7227. structure.
  7228. -------------------------------------------------------------------------------
  7229. od_cfg_lines char od_control.cfg_lines[25][33];
  7230. This array contains the strings for the keywords that represent
  7231. various lines in the definition of a custom door information
  7232. file. Each keyword must be 32 character or less in length. These
  7233. keywords are not case sensitive. See page 230 for more
  7234. information on defining custom door information (drop) file
  7235. formats. The default values for this array are as follows:
  7236. [0] "Ignore"
  7237. [1] "ComPort"
  7238. [2] "FossilPort"
  7239. [3] "ModemBPS"
  7240. [4] "LocalMode"
  7241. [5] "UserName"
  7242. [6] "UserFirstName"
  7243. [7] "UserLastName"
  7244. [8] "Alias"
  7245. [9] "HoursLeft"
  7246. [10] "MinutesLeft"
  7247. [11] "SecondsLeft"
  7248. [12] "ANSI"
  7249. [13] "AVATAR"
  7250. [14] "PagePausing"
  7251. [15] "ScreenLength"
  7252. [16] "ScreenClearing"
  7253. [17] "Security"
  7254. [18] "City"
  7255. [19] "Node"
  7256. [20] "SysopName"
  7257. [21] "SysopFirstName"
  7258. [22] "SysopLastName"
  7259. [23] "SystemName"
  7260. [24] "RIP"
  7261. If you wish to change any of these variable, you must do so
  7262. before calling any OpenDoors functions.
  7263. ===============================================================================
  7264. OpenDoors 6.00 Manual End of Page 193
  7265. -------------------------------------------------------------------------------
  7266. od_cfg_text char od_control.od_cfg_text[47][33];
  7267. This array of strings contains the built-in configuration file
  7268. keywords that are recognized by OpenDoors. These keywords may be
  7269. up to 32 characters in size, and are not case sensitive. If you
  7270. wish to change any of these settings, you must do so before
  7271. calling any OpenDoors functions. The default values for this
  7272. array are as follows:
  7273. [0] "Node"
  7274. [1] "BBSDir"
  7275. [2] "DoorDir"
  7276. [3] "LogFileName"
  7277. [4] "DisableLogging"
  7278. [5] "SundayPagingHours"
  7279. [6] "MondayPagingHours"
  7280. [7] "TuesdayPagingHours"
  7281. [8] "WednesdayPagingHours"
  7282. [9] "ThursdayPagingHours"
  7283. [10] "FridayPagingHours"
  7284. [11] "SaturdayPagingHours"
  7285. [12] "MaximumDoorTime"
  7286. [13] "SysopName"
  7287. [14] "SystemName"
  7288. [15] "SwappingDisable"
  7289. [16] "SwappingDir"
  7290. [17] "SwappingNoEMS"
  7291. [18] "LockedBPS"
  7292. [19] "SerialPort"
  7293. [20] "CustomFileName"
  7294. [21] "CustomFileLine"
  7295. [22] "InactivityTimeout"
  7296. [23] "PageDuration"
  7297. [24] "ChatUserColor"
  7298. [25] "ChatSysopColor"
  7299. [26] "FileListTitleColor"
  7300. [27] "FileListNameColor"
  7301. [28] "FileListSizeColor"
  7302. [29] "FileListDescriptionColor"
  7303. [30] "FileListOfflineColor"
  7304. [31] "Personality"
  7305. [32] "NoFossil"
  7306. [33] "PortAddress"
  7307. [34] "PortIRQ"
  7308. [35] "ReceiveBuffer"
  7309. [36] "TransmitBuffer"
  7310. [37] "PagePromptColor"
  7311. [38] "LocalMode"
  7312. [39] "PopupMenuTitleColor"
  7313. ===============================================================================
  7314. OpenDoors 6.00 Manual End of Page 194
  7315. [40] "PopupMenuBorderColor"
  7316. [41] "PopupMenuTextColor"
  7317. [42] "PopupMenuKeyColor"
  7318. [43] "PopupMenuHighlightColor"
  7319. [44] "PopupMenuHighKeyColor"
  7320. [45] "NoFIFO"
  7321. [46] "FIFOTriggerSize"
  7322. [47] "DiableDTR"
  7323. [48] "NoDTRDisable"
  7324. -------------------------------------------------------------------------------
  7325. od_chat char od_control.od_chat_active;
  7326. _active
  7327. This variable is set to TRUE when sysop chat mode is active, and
  7328. is set to FALSE when sysop chat mode is not active. This
  7329. variable can be used to determine whether or not chat mode is
  7330. active, and to force chat mode to end. When the sysop presses
  7331. the chat mode key ([ALT]-[C] if the default personality is being
  7332. used) while chat mode is active, this variable is set to FALSE.
  7333. -------------------------------------------------------------------------------
  7334. od_clear char od_control.od_clear_on_exit;
  7335. _on_exit
  7336. This variable contains a Boolean value, which indicates whether
  7337. or not you wish OpenDoors to clear the screen prior to exiting.
  7338. This variable defaults to a value of TRUE, which causes the
  7339. screen to be cleared when a door program exits. However, you may
  7340. wish to set this variable to a value of FALSE, which will cause
  7341. the contents of the screen to remain unchanged when the door
  7342. exits. While setting this variable to FALSE will probably result
  7343. in a messy display if the door is to return control to a batch
  7344. file, if the door returns directly to the BBS, it will result in
  7345. a smoother transition from the door back to the BBS (as the
  7346. sysop is not left with a blank screen). If your door has a
  7347. configuration file or configuration program, you may wish to
  7348. have an option which will allow the individual sysop to
  7349. determine whether or not the screen should be cleared when the
  7350. door exits.
  7351. -------------------------------------------------------------------------------
  7352. od_color char od_control.od_color_delimiter;
  7353. _delimiter
  7354. This variable sets the character that is used to delimit color
  7355. codes in the od_printf() function, and defaults to the back-
  7356. quote (`) character. If you wish to be able to display the back-
  7357. quote (`) character using the od_printf() function, and thus
  7358. ===============================================================================
  7359. OpenDoors 6.00 Manual End of Page 195
  7360. wish to use a different character to delimit color codes in the
  7361. od_printf() function, simply set this variable to the
  7362. alternative character you wish to use. If you wish to disable
  7363. the imbedded color codes feature of the od_printf() function,
  7364. simply set this variable to a value of zero. For more
  7365. information on od_printf() imbedded color codes, see the
  7366. description of the od_printf() function, which begins on page
  7367. 110.
  7368. -------------------------------------------------------------------------------
  7369. od_color char od_control.od_color_names[12][33];
  7370. _names
  7371. This array sets the strings that OpenDoors will recognize as
  7372. color description keywords. These are the keywords that can be
  7373. imbedded in od_printf() format strings, and are also the
  7374. keywords that can be used to change color settings in the
  7375. OpenDoors configuration file. If you wish to change these
  7376. keywords, you will normally do so before calling any OpenDoors
  7377. functions. These keywords should always be supplied in upper-
  7378. case characters. The defaults values for this array are as
  7379. follows:
  7380. [0] "BLACK"
  7381. [1] "BLUE"
  7382. [2] "GREEN"
  7383. [3] "CYAN"
  7384. [4] "RED"
  7385. [5] "MAGENTA"
  7386. [6] "YELLOW"
  7387. [7] "WHITE"
  7388. [8] "BROWN"
  7389. [9] "GREY"
  7390. [10] "BRIGHT"
  7391. [11] "FLASHING"
  7392. -------------------------------------------------------------------------------
  7393. od_config void (*od_control.od_config_file)(void);
  7394. _file
  7395. Set this variable to INCLUDE_CONFIG_FILE to enable the OpenDoors
  7396. configuration file system, or set it to NO_CONFIG_FILE to
  7397. disable the configuration file system. This variable should only
  7398. be set prior to your first call to an OpenDoors function. For
  7399. more information on the OpenDoors configuration file system, see
  7400. page 224.
  7401. ===============================================================================
  7402. OpenDoors 6.00 Manual End of Page 196
  7403. -------------------------------------------------------------------------------
  7404. od_config char *od_control.od_config_filename;
  7405. _filename
  7406. If set, this variable should point to a string containing the
  7407. filename that you wish the OpenDoors configuration file system
  7408. to read. If this variable has its default value of NULL, the
  7409. filename DOOR.CFG will be used by default.
  7410. -------------------------------------------------------------------------------
  7411. od_config void (*od_control.od_config_function)(char *keyword, char
  7412. _function *options);
  7413. If set, this variable should point to the function that
  7414. OpenDoors should call when lines with unrecognized keywords are
  7415. encountered in the configuration file. This allows you to add
  7416. your own configuration file keywords. The first parameter to
  7417. this function will be a pointer to a string containing the
  7418. unrecognized keywords, and the second parameter will be a
  7419. pointer to a string containing any options that were specified
  7420. after the keyword. If no options were specified after the
  7421. keyword, this string will have a length of 0.
  7422. -------------------------------------------------------------------------------
  7423. od_default void (*od_control.od_default_personality)(unsigned char
  7424. _personality operation);
  7425. This variable sets the default personality that OpenDoors will
  7426. use if the multiple personality system is active. If the
  7427. multiple personality system is not active, the personality set
  7428. by this variable will be the only personality available. This
  7429. variable should only be set prior to calling an OpenDoors
  7430. function. This variable can be set to point to your own
  7431. personality function, or it can be set to one of the manifest
  7432. constants that represent one of the built-in personalities:
  7433. PER_OPENDOORS
  7434. PER_PCBOARD
  7435. PER_RA
  7436. PER_WILDCAT
  7437. For more information on the OpenDoors Multiple Personality
  7438. System, see page 230.
  7439. ===============================================================================
  7440. OpenDoors 6.00 Manual End of Page 197
  7441. -------------------------------------------------------------------------------
  7442. od_default char od_control.od_default_rip_win;
  7443. _rip_win
  7444. This variable defaults to FALSE. When set to FALSE, OpenDoors
  7445. resets the RIP text window to a 23-line window that is most
  7446. appropriate for doors that support both RIP-graphics and non-RIP
  7447. mode. When this variable is set to TRUE, OpenDoors will use the
  7448. default sized text output window, 43 lines in size.
  7449. -------------------------------------------------------------------------------
  7450. od_disable unsigned int od_control.od_disable;
  7451. This variable is a bit-mapped flag which can be used to disable
  7452. certain OpenDoors features which are normally active, in order
  7453. to allow for maximum customization of OpenDoors. Each bit of
  7454. this variable represents a different feature that can be
  7455. disabled. To DISABLE a feature, you set the bit that corresponds
  7456. to the particular feature. To ENABLE the feature, the bit is
  7457. reset. Each bit is represented by a keyword, as follows:
  7458. DIS_INFOFILE - Setting the DIS_INFOFILE bit of the
  7459. od_control.od_disable variable allows you to prevent
  7460. OpenDoors from reading or re-writing a door information
  7461. file. If you wish to disable OpenDoors' reading of the door
  7462. information file, you must do so prior to calling
  7463. od_init() or any other OpenDoors door-driver functions. At
  7464. the same time, you must also manually set any required
  7465. variables that are normally set by the information obtained
  7466. from the door information file, such as the comm port
  7467. number, baud rate, user name, and so on. You may wish to
  7468. disable reading of the door information file in a number of
  7469. cases. For example, you may wish to manually read another
  7470. format of door information file not supported by OpenDoors,
  7471. or to obtain the necessary door information from your
  7472. program's command line. Also, if you are using OpenDoors to
  7473. write a non-door communications program, such as a terminal
  7474. program, you want to prevent OpenDoors from attempting to
  7475. read a door information file on startup.
  7476. DIS_CARRIERDETECT - Setting this bit allows you to prevent
  7477. OpenDoors from exiting when it the carrier detect signal
  7478. from the modem disappears. This bit may be set or rest at
  7479. any time. If you use this bit to disable OpenDoors' carrier
  7480. detection, you will probably want to monitor the state of
  7481. the carrier detect signal yourself, using the od_carrier()
  7482. function, which is described on page 51.
  7483. DIS_TIMEOUT - This flag allows you to prevent OpenDoors from
  7484. exiting when the user runs out of time. As with the
  7485. DIS_CARRIERDETECT flag, you may set or reset this bit at
  7486. ===============================================================================
  7487. OpenDoors 6.00 Manual End of Page 198
  7488. any time. You will most often want to use this setting when
  7489. writing a non-door program, which you would not want to
  7490. have exit after a particular amount of time has elapsed. Be
  7491. sure that you do not confuse this flag with the user's
  7492. inactivity timeout. To disable the inactivity timeout, set
  7493. the do_control.od_inactivity variable to 0.
  7494. DIS_LOCAL_OVERRIDE - This setting affects OpenDoors' behavior
  7495. when a locked BPS rate is specified in the configuration
  7496. file, and another BPS rate is specified in the door
  7497. information file. By default, OpenDoors will initialize the
  7498. modem at the BPS rate specified in the configuration file,
  7499. unless the BPS rate specified in the door information file
  7500. is 0. In this case, the 0 BPS rate is used to indicate that
  7501. the door is operating in local mode, and will override the
  7502. BPS rate specified in the configuration file. Setting this
  7503. flag disables the local mode override, causing the modem to
  7504. always be initialized at the locked BPS rate, even when the
  7505. door information file specifies that local mode should be
  7506. used.
  7507. DIS_BPS_SETTING - When used with a FOSSIL driver, OpenDoors
  7508. normally changes the BPS rate to that passed from the BBS
  7509. (if the BBS passes a valid FOSSIL BPS rate). Setting the
  7510. DIS_BPS_SETTING flag disables this BPS rate setting.
  7511. DIS_LOCAL_INPUT - The local keyboard may be disabled by setting
  7512. this bit. This only affects the sysop's input in
  7513. circumstances that input is also accepted from the remote
  7514. user; this setting has no effect on the sysop function
  7515. keys.
  7516. DIS_SYSOP_KEYS - This setting also disables the local keyboard.
  7517. However, unlike the DIS_LOCAL_INPUT, this function disables
  7518. both sysop function keys and door input from the local
  7519. keyboard.
  7520. DIS_DTR_DISABLE - This setting prevents OpenDoors from
  7521. disabiling DTR response from the modem. Even if not
  7522. specified, OpenDoors only disables DTR response in the when
  7523. exiting under the Win32 version if an open serial port
  7524. handle was not provided to OpenDoors at startup.
  7525. DIS_NAME_PROMPT - Prevents OpenDoors from prompting for a user
  7526. name when operating in automatic local mode (by setting
  7527. od_force_local to TRUE or specifying -local on the command
  7528. line).
  7529. Note that in order to disable the OpenDoors status line, the
  7530. od_control.od_status_on variable is used, instead of the
  7531. od_disable variable. You may also disable the user's inactivity
  7532. timeout by setting the od_control.od_inactivity variable to 0.
  7533. ===============================================================================
  7534. OpenDoors 6.00 Manual End of Page 199
  7535. The od_control.od_status_on variable is described later in this
  7536. section.
  7537. -------------------------------------------------------------------------------
  7538. od_disable_ char od_control.od_disable_dtr[40];
  7539. dtr
  7540. Unles the DIS_DTR_DISABLE od_disable flag is set, the Win32
  7541. version of OpenDoors will attempt to disable DTR response by the
  7542. modem when closing the serial port, if the serial port was
  7543. opened by OpenDoors. This is done by sending a series of
  7544. commands to the modem, and possibly waiting for responses to the
  7545. command. The string format specifies each command, followed by
  7546. the required response. The command and response is separated by
  7547. a single space character. If no response is required between two
  7548. commands, then those commands may be separated by two space
  7549. characters. A '|' character is translated into a carriage
  7550. return, and a '~' character is translated into a one second
  7551. pause. The default value of this string is "~+++~ AT&D0 ATO".
  7552. -------------------------------------------------------------------------------
  7553. od_emu_ BOOL od_control.od_emu_simulate_modem;
  7554. simulate_modem
  7555. When this flag is set to its default value of FALSE, the
  7556. OpenDoors terminal emulator displays text at full speed. When
  7557. this flag is set to TRUE, the emulation functions will display
  7558. text at approximately the same speed as it would be displayed
  7559. when sent over the modem, based on the current connect speed. In
  7560. local mode, an average modem speed of 9600bps is assumed. This
  7561. allows animations to be displayed locally at the same speed as
  7562. they would appear on the remote system. This switch affects the
  7563. following functions:
  7564. od_disp_emu()
  7565. od_send_file()
  7566. od_hotkey_menu()
  7567. -------------------------------------------------------------------------------
  7568. od unsigned char od_control.od_errorlevel[8];
  7569. _errorlevel
  7570. Allows you to configure the errorlevel (program exit code) which
  7571. OpenDoors exits with under various circumstances. The elements
  7572. of this array are as follows:
  7573. ===============================================================================
  7574. OpenDoors 6.00 Manual End of Page 200
  7575. [ERRORLEVEL_ENABLE] Enables or disables custom errorlevels
  7576. [ERRORLEVEL_CRITICAL] Critical error errorlevel
  7577. [ERRORLEVEL_NOCARRIER] Carrier lost errorlevel
  7578. [ERRORLEVEL_HANGUP] Sysop manually terminated call
  7579. [ERRORLEVEL_TIMEOUT] User time expired errorlevel
  7580. [ERRORLEVEL_INACTIVITY] Keyboard inactivity timeout errorlevel
  7581. [ERRORLEVEL_DROPTOBBS] Sysop returned user to BBS errorlevel
  7582. [ERRORLEVEL_NORMAL] Door has exited normally
  7583. If you wish to override the default errorlevels used by
  7584. OpenDoors, you should set element [ERRORLEVEL_ENABLE] of this
  7585. array to TRUE, and set the remaining array elements to the
  7586. appropriate errorlevels. Note that the settings in this array
  7587. only affect the errorlevels which OpenDoors uses when it causes
  7588. the door to exit for one of the reasons listed above. This
  7589. setting has no effect on the errorlevel returned when your
  7590. program explicitly exits by calling the od_exit() function, or
  7591. your program returns by calling exit() or returning from the
  7592. main() function.
  7593. -------------------------------------------------------------------------------
  7594. od char od_control.od_force_local;
  7595. _force_local
  7596. This variable defaults to FALSE, which causes OpenDoors to
  7597. behave normally. When this variable is set to TRUE prior to
  7598. calling od_init() or any other OpenDoors functions, OpenDoors
  7599. will operate in local mode. In this case, no door information
  7600. file will be read. Also, the user name will be used if
  7601. od_control.user_name has not been set prior to calling od_init()
  7602. or the first OpenDoors function.
  7603. The default OpenDoors settings when od_control.od_force_local is
  7604. set are as follows:
  7605. - ANSI mode is on
  7606. - Time limit is 60 minutes
  7607. - User's location is the name of the BBS, or "Unknown Location"
  7608. otherwise if BBS name is not known.
  7609. - User name is set to sysop's name ("Sysop" if no sysop name is
  7610. specified in the configuration file).
  7611. You may wish to add a "-local" type parameter to your program's
  7612. command line, which will permit the sysop to easily operate the
  7613. door in local mode, as an interface to the
  7614. od_control.od_force_local setting.
  7615. -------------------------------------------------------------------------------
  7616. od_help void (*od_control.od_help_callback)(void);
  7617. ===============================================================================
  7618. OpenDoors 6.00 Manual End of Page 201
  7619. _callback
  7620. If this variable is set to a non-NULL value, the Win32 version
  7621. of OpenDoors will provide a Contents item on the help menu, and
  7622. call the function pointed to by this variable when the user
  7623. chooses the Contents menu item.
  7624. -------------------------------------------------------------------------------
  7625. od_in_buf unsigned int od_control.od_in_buf_size;
  7626. _size
  7627. Specifies the size, in characters, of the OpenDoor's internal
  7628. local/remote inbound buffer size. Two bytes of storage are
  7629. required for each character in this buffer. This variable should
  7630. only be changed prior to calling od_init() or the first
  7631. OpenDoors function. If not set, this variable defaults to a
  7632. value of 256.
  7633. The buffer corresponding to this variable should not be confused
  7634. with the FOSSIL or internal communications receive buffer (which
  7635. is set by od_control.od_com_rx_buf). Unlike the serial I/O
  7636. receive buffer, which is used only for characters received from
  7637. the remote system, this buffer serves as a queue for input from
  7638. both the remote system and the local keyboard. If you find that
  7639. characters are lost when information is being set to your door
  7640. from the user, you may wish to increase the size of this buffer.
  7641. -------------------------------------------------------------------------------
  7642. od unsigned int od_control.od_inactivity;
  7643. _inactivity
  7644. OpenDoors has a built in user-inactivity timeout facility, which
  7645. will automatically disconnect a user who appears .to be sleeping
  7646. at the keyboard. If the user has not pressed any keys on their
  7647. keyboard for to great a length of time, they will be warned that
  7648. they are about to be disconnected due to inactivity. If they
  7649. still do not respond after another few seconds, OpenDoors will
  7650. automatically disconnect the user and return control to the BBS
  7651. software. The od_control.od_inactivity variable allows you to
  7652. set the maximum length of time, in seconds, after which the user
  7653. will be disconnected for inactivity. This variable defaults to a
  7654. value of 200 seconds. You may disable OpenDoors' inactivity
  7655. timeout altogether, by setting the od_control.od_inactivity
  7656. variable to a value of 0.
  7657. ===============================================================================
  7658. OpenDoors 6.00 Manual End of Page 202
  7659. -------------------------------------------------------------------------------
  7660. od_inactive int od_control.od_inactive_warning.
  7661. _warning
  7662. This variable sets the number of seconds prior to hanging up
  7663. that OpenDoors displays the inactivity timeout warning. This
  7664. variable should only be changed after your first call to an
  7665. OpenDoors API function. If not explicitly set by your program,
  7666. this setting defaults to 10 seconds.
  7667. -------------------------------------------------------------------------------
  7668. od_ker_exec void (*od_control.od_ker_exec)(void);
  7669. When od_control.od_ker_exec is set to point to a function,
  7670. OpenDoors will call this function whenever od_kernel() executes.
  7671. This provides any easy way for you to perform your own
  7672. processing on a regular basis during door execution. The
  7673. od_control.od_ker_exec variable defaults to NULL.
  7674. -------------------------------------------------------------------------------
  7675. od_last char od_control.od_last_input;
  7676. _input
  7677. Indicates whether the last key retrieved using the od_get_key()
  7678. function originated from the remote user, or the local sysop. If
  7679. the input originated from the remote, this variable is set to 0.
  7680. If the input originated from the local keyboard, this variables
  7681. is set to 1.
  7682. -------------------------------------------------------------------------------
  7683. od_list char od_control.od_list_pause;
  7684. _pause
  7685. This variable contains a Boolean value, which allows you to
  7686. control whether or not the user may pause displaying within the
  7687. od_list_files() and od_send_file() function. When this variable
  7688. is set to its default value of TRUE, the user will be able to
  7689. pause the display by pressing the [P] key, and resume display by
  7690. pressing any other key. However, the pause feature may be
  7691. disabled by setting this variable to FALSE.
  7692. -------------------------------------------------------------------------------
  7693. od_list char od_control.od_list_stop;
  7694. _stop
  7695. This variable contains a Boolean value, which allows you to
  7696. control whether or not the user may abort displaying within the
  7697. od_list_files() and od_send_file() function. When this variable
  7698. ===============================================================================
  7699. OpenDoors 6.00 Manual End of Page 203
  7700. is set to its default value of TRUE, the user will be able to
  7701. pause the display by pressing the [S], [CTRL]-[K] or [CTRL]-[C]
  7702. keys. However, the stop feature may be disabled by setting this
  7703. variable to FALSE.
  7704. -------------------------------------------------------------------------------
  7705. od_local void (*od_control.od_local_input)(int);
  7706. _input
  7707. If set, this function is called whenever the sysop presses a
  7708. non-sysop-function key on the local keyboard. The key pressed is
  7709. passed to the function in the single int parameter that it
  7710. accepts.
  7711. -------------------------------------------------------------------------------
  7712. od_logfile void *(od_control.od_logfile)(void);
  7713. To make the OpenDoors log file system available in your program,
  7714. set this variable to INCLUDE_LOGFILE, prior to calling any
  7715. OpenDoors functions. If not set, or if set to NO_LOGFILE, the
  7716. OpenDoors log file system will not automatically be enabled.
  7717. -------------------------------------------------------------------------------
  7718. od_logfile char od_control.od_logfile_disable;
  7719. _disable
  7720. This variable defaults to the value of FALSE, unless the
  7721. "LogfileDisable" option is specified in the configuration file,
  7722. in which case the variable will be set to TRUE. If this variable
  7723. is set to TRUE, OpenDoors will not write to a logfile, even if
  7724. the logfile system is enabled using od_control.od_logfile.
  7725. -------------------------------------------------------------------------------
  7726. od_logfile char *od_control.od_logfile_messages[14];
  7727. _messages
  7728. This array of pointers to strings contains the messages that
  7729. OpenDoors will automatically write to the log file, if the log
  7730. file system is enabled. If you wish to change the settings of
  7731. this array, you should do so before calling any OpenDoors
  7732. functions. The default strings for this array are as follows:
  7733. [0] "Carrier lost, exiting door"
  7734. [1] "System operator terminating call, exiting door"
  7735. [2] "User's time limit expired, exiting door"
  7736. [3] "User keyboard inactivity time limit exceeded, exiting door"
  7737. [4] "System operator returning user to BBS, exiting door"
  7738. ===============================================================================
  7739. OpenDoors 6.00 Manual End of Page 204
  7740. [5] "Exiting door with errorlevel %d,
  7741. [6] "Invoking operating system shell"
  7742. [7] "Returning from operating system shell"
  7743. [8] "User paging system operator"
  7744. [9] "Entering sysop chat mode"
  7745. [10] "Terminating sysop chat mode"
  7746. [11] "%s entering door"
  7747. [12] "Reason for chat: %s"
  7748. [13] "Exiting door"
  7749. -------------------------------------------------------------------------------
  7750. od_logfile char od_control.od_logfile_name[80];
  7751. _name
  7752. This variable specifies the filename, and optionally the full
  7753. path of the logfile where OpenDoors should perform logging. This
  7754. variable only has an effect when set prior to calling any
  7755. OpenDoors functions. If the log file name is specified in the
  7756. configuration file, that name will be stored in this variable.
  7757. If you do not set this variable, and the log file name is not
  7758. specified in the configuration file, the default name "DOOR.LOG"
  7759. will be used. If you wish to set this variable, you should do so
  7760. prior to calling od_init() or any OpenDoors function.
  7761. -------------------------------------------------------------------------------
  7762. od_ unsigned int od_control.od_maxtime;
  7763. maxtime
  7764. This variable specifies the maximum length of time that any user
  7765. is permitted to use the door, and is normally set from a
  7766. configuration file option. If upon entering the door, the user's
  7767. time remaining online is greater than the od_maxtime setting,
  7768. their time remaining is temporarily decreased to the maximum
  7769. value. Then upon exit of the door, the number of subtracted
  7770. minutes is added back onto the user's remaining time. If the
  7771. user's remaining time is less than this value, then the setting
  7772. has no effect. A value of 0 disables the maximum time setting
  7773. altogether.
  7774. -------------------------------------------------------------------------------
  7775. od_maxtime int od_control.od_maxtime_deduction;
  7776. _deduction
  7777. This variable store the amount of time that should be added to
  7778. the user's time upon exit of the door, as a result of the
  7779. maximum time deduction, described above. If the maximum time
  7780. feature is not used, this variable will be given a value of 0.
  7781. ===============================================================================
  7782. OpenDoors 6.00 Manual End of Page 205
  7783. -------------------------------------------------------------------------------
  7784. od_mps void (*od_control.od_mps)(void);
  7785. To make the OpenDoors Multiple Personality system available in
  7786. your program, set this variable to INCLUDE_MPS before calling
  7787. any OpenDoors functions. If this variable is not set, or is set
  7788. to NO_MPS, the Multiple Personality System will be disabled. For
  7789. more information on the OpenDoors Multiple Personality System,
  7790. see page 233.
  7791. -------------------------------------------------------------------------------
  7792. od_no_ void (*od_control.od_no_file_func)();
  7793. file_func
  7794. If od_no_file_func is set to point to a function, that function
  7795. will be called whenever a door information (drop) file cannot be
  7796. located or read. This provides an easy mechanism to add your own
  7797. door information file reader, or to provide a local login prompt
  7798. when no drop file is present. If you wish the door to operate in
  7799. local mode, you should set od_control.od_force_local to TRUE
  7800. prior to returning from your function. If you have successfully
  7801. read your own door information file format, you should set
  7802. od_control.od_info_type to CUSTOM. If neither of these variables
  7803. are set by the od_no_file_function, OpenDoors will report that
  7804. it is unable to find or read a door information file and will
  7805. exit immediately.
  7806. -------------------------------------------------------------------------------
  7807. od_no_ra char od_control.od_no_ra_codes;
  7808. _codes
  7809. This variable defaults to FALSE. When set to TRUE, the
  7810. translation of the RemoteAccess/QuickBBS control codes by the
  7811. functions od_send_file(), od_hotkey_menu() and od_disp_emu() is
  7812. disabled.
  7813. -------------------------------------------------------------------------------
  7814. od_ char od_control.od_nocopyright;
  7815. nocopyright
  7816. This variable is a Boolean value that allows you to prevent
  7817. OpenDoors from displaying its name, version number, copyright
  7818. notice and registration information when the program begins
  7819. execution. Set this variable to TRUE to disable the display of
  7820. copyright and associated information. When this variable is set
  7821. to TRUE, OpenDoors also does not change the initial display
  7822. color on startup. For obvious reasons, this variable does not
  7823. take effect when OpenDoors is operating in unregistered mode.
  7824. ===============================================================================
  7825. OpenDoors 6.00 Manual End of Page 206
  7826. -------------------------------------------------------------------------------
  7827. od_noexit char od_control.od_noexit;
  7828. This variable contains a Boolean value, which allows you to
  7829. prevent OpenDoors from exiting when shutting down. This may be
  7830. useful when you want to have your program to do more processing
  7831. after you have called the od_exit() function, or if you do not
  7832. wish to have your program exit automatically when the user drops
  7833. carrier. Normally, this variable will default to a value of
  7834. FALSE, indicating that OpenDoors will exit normally when the
  7835. od_exit() function is called. However, you may optionally set
  7836. this variable to TRUE after od_init() or some OpenDoors function
  7837. has been called. In this case, when the od_exit() function is
  7838. called, either by your program manually, or automatically by
  7839. OpenDoors in response to the user dropping carrier, etc.,
  7840. OpenDoors will not exit. However, the normal operations of
  7841. closing the serial port and re-writing the door information file
  7842. will be carried out. If you set the od_noexit variable to TRUE,
  7843. you will probably have to provide some mechanism to allow your
  7844. program to detect when OpenDoors shutdowns due to the loss of
  7845. carrier, etc. The best way of doing this is to provide a
  7846. function which is to be called at the beginning of the od_exit()
  7847. function, by setting the od_control.od_before_exit pointer,
  7848. described above.
  7849. -------------------------------------------------------------------------------
  7850. od_page char od_control.od_page_len;
  7851. _len
  7852. This variable allows you to control the length, in seconds, of
  7853. the sysop page beep produced when the user pages the sysop via
  7854. the od_page() function.
  7855. -------------------------------------------------------------------------------
  7856. od_page char od_control.od_page_pausing;
  7857. _pausing
  7858. This variable contains a Boolean value that indicates whether or
  7859. not page pausing is enabled in the od_send_file(),
  7860. od_hotkey_menu() and od_list_files() functions. The default
  7861. value of TRUE indicates that page pausing is enabled. A value of
  7862. FALSE indicates that page pausing is disabled.
  7863. ===============================================================================
  7864. OpenDoors 6.00 Manual End of Page 207
  7865. -------------------------------------------------------------------------------
  7866. od_page int od_control.od_pagestartmin;
  7867. startmin int od_control.od_pageendmin;
  7868. od_page These variables indicate the start and end times for sysop
  7869. endmin paging, expressed as the number of minutes past midnight.
  7870. Sysop paging will be available through the od_page() function
  7871. from the start time, up to but not including the end time.
  7872. -------------------------------------------------------------------------------
  7873. od_page char od_control.od_page_statusline;
  7874. _statusline
  7875. This variable controls which status line, if any, is activated
  7876. when the user pages the system operator (via the od_page()
  7877. function). A value between 0 and 9 causes the corresponding
  7878. status line to be activated. A value of -1 prevents any change
  7879. from being made to the current status line setting. This
  7880. variable will normally be set by personality functions (see page
  7881. 233).
  7882. -------------------------------------------------------------------------------
  7883. od_prog_ char od_control.od_prog_copyright[40];
  7884. copyright
  7885. This variable should contain your program's copyright notice,
  7886. such as "(C) Copyright 1996 by Your Name". This information is
  7887. used in the Help|about dialog box under the Win32 version of
  7888. OpenDoors, and may be used in other places in future versions of
  7889. OpenDoors.
  7890. -------------------------------------------------------------------------------
  7891. od_prog_name char od_control.od_prog_name[40];
  7892. This variable should contain the full name of your program, up
  7893. to 39 characters. If not set, OpenDoors will use the string
  7894. "OpenDoors" in place of this variable. If used, this variable
  7895. should be set prior to calling any OpenDoors functions, and
  7896. should not include your program's version number. This
  7897. information is used to write your program's name in the log file
  7898. and to indicate your program's name on various windows, among
  7899. other places.
  7900. ===============================================================================
  7901. OpenDoors 6.00 Manual End of Page 208
  7902. -------------------------------------------------------------------------------
  7903. od_prog_version char od_control.od_prog_version[40];
  7904. This variable should contain the version information of your
  7905. program. If used, this variable should be set prior to calling
  7906. any OpenDoors functions. This information is used in the
  7907. Help|About dialog box under the Win32 version of OpenDoors,
  7908. among other places.
  7909. -------------------------------------------------------------------------------
  7910. od_reg_key unsigned log od_control.od_reg_key;
  7911. When you purchase an OpenDoors licence (registration), this
  7912. variable should be set to your registration key, prior to
  7913. calling any OpenDoors functions.
  7914. -------------------------------------------------------------------------------
  7915. od_reg_name char od_control.od_reg_name[36];
  7916. When you purchase an OpenDoors licence (registration), this
  7917. variable should be set to your name, or your company's name, as
  7918. is listed in your OpenDoors registration record.
  7919. -------------------------------------------------------------------------------
  7920. od_spawn char od_control.od_spawn_freeze_time;
  7921. _freeze_time
  7922. This variable is a Boolean value which indicates whether or not
  7923. the user's time remaining is frozen during the execution of one
  7924. of the od_spawn...() functions. If this variable is set to TRUE,
  7925. the user's time remaining will not decrease during the time that
  7926. the od_spawn...() function is executing. However, if this
  7927. variable is set to FALSE, the user's time remaining will
  7928. continue to be subtracted during the execution of the
  7929. od_spawn...() function. The default value of this variable is
  7930. FALSE.
  7931. -------------------------------------------------------------------------------
  7932. od_swapping char od_control.od_swapping_disable;
  7933. _disable
  7934. This variable is a Boolean value which specifies whether or not
  7935. OpenDoors will attempt to swap itself and your entire door upon
  7936. ===============================================================================
  7937. OpenDoors 6.00 Manual End of Page 209
  7938. DOS shell or a call to one of the od_spawn...() functions. This
  7939. variable defaults to FALSE. If set to TRUE, OpenDoors will not
  7940. attempt to perform swapping activities.
  7941. -------------------------------------------------------------------------------
  7942. od_swapping char od_control.od_swapping_noems;
  7943. _noems
  7944. This variable is a Boolean value which can be used to prevent
  7945. OpenDoors from swapping to EMS memory. This variable defaults to
  7946. the value FALSE. If set to TRUE, OpenDoors will not attempt to
  7947. use EMS memory for swapping, and will only swap to disk.
  7948. -------------------------------------------------------------------------------
  7949. od_swapping char od_control.od_swapping_path;
  7950. _path
  7951. This variable specifies the drive and directory where OpenDoors
  7952. should create its disk swapping file, if applicable. More than
  7953. one path can be specified, by separating the paths with a semi-
  7954. colon (;) character.
  7955. -------------------------------------------------------------------------------
  7956. od_status char od_control.od_status_on;
  7957. _on
  7958. This variable is a Boolean value which allows your program to
  7959. completely disable the OpenDoors status line. The variable
  7960. defaults to a value of TRUE, which causes the OpenDoors status
  7961. line to be controllable by function keys, displayed and updated
  7962. as it would normally be. However, if this variable is set to
  7963. FALSE, then OpenDoors will not update the status line, nor will
  7964. it allow the status line to be re-displayed as a result of one
  7965. of the status line ([F1] through [F10]) keys being pressed. When
  7966. you change the value of this variable from FALSE to TRUE,
  7967. OpenDoors will automatically redisplay the status line. Note,
  7968. however, that the status line isn't automatically removed when
  7969. the value of this variable is changed from TRUE to FALSE. In
  7970. order to erase the status line after resetting the value of this
  7971. variable, you should reset the output window to the full screen,
  7972. by calling the function window(1,1,25,80). Then manually erase
  7973. the old status line either by clearing the bottom two lines of
  7974. the screen, or by clearing the entire screen.
  7975. It is important that you do not confuse the use of this variable
  7976. with the od_set_statusline() function, which is described on
  7977. page 137. When the status line is enabled, the sysop can change
  7978. which status line, if any, is being displayed, using the
  7979. function keys [F1] through [F10]. The od_set_statusline()
  7980. ===============================================================================
  7981. OpenDoors 6.00 Manual End of Page 210
  7982. function allows your program to make the same changes to the
  7983. status line setting which the sysop can make by pressing one of
  7984. the function keys. The status line can be removed from the
  7985. screen, allowing a full 25 lines of text to be displayed, by
  7986. pressing the [F10] key, or by making the appropriate call to the
  7987. od_set_statusline() function. Note, however, than when this is
  7988. done, the status line is still enabled, and can be turned on by
  7989. pressing any of the other function keys. On the other hand, if
  7990. the status line is turned off using this variable
  7991. (od_control.od_status_on), the status line sub-system will be
  7992. disabled, and pressing function keys will not "bring it back".
  7993. So, if you were writing a program where a status line would be
  7994. undesirable - such as a non-door communications program, you
  7995. would use the od_control.od_status_on variable. On the other
  7996. hand, if you only wanted to temporarily remove the status line -
  7997. say in order that all 25 lines of a door program's output could
  7998. be viewed - while still allowing the status line to be turned on
  7999. with the sysop function keys, you would use the
  8000. od_set_statusline() function. For more information on the
  8001. od_set_statusline() function, see page 137.
  8002. -------------------------------------------------------------------------------
  8003. od_time void (*od_control.od_time_msg_func)(char *string)
  8004. _msg_func
  8005. This variable defaults to a value of NULL. If set to point to a
  8006. function, OpenDoors will call this function INSTEAD OF
  8007. displaying time limit warning messages to the user. The messages
  8008. redirected to this function are:
  8009. - Inactivity timeout warning
  8010. - Inactivity timeout expired
  8011. - Less than 4 minutes left today
  8012. - Daily time limit expired
  8013. ===============================================================================
  8014. OpenDoors 6.00 Manual End of Page 211
  8015. CONTROL STRUCTURE - FUNCTION KEYS
  8016. -------------------------------------------------------------------------------
  8017. Within OpenDoors, as with most BBS software and doors, the sysop
  8018. has access to a number of function keys, which permits the sysop
  8019. to carry out various functions such as entering chat mode,
  8020. hanging up on the user, shelling to DOS, and so on. The
  8021. variables in this section allow you to customize which keys
  8022. carry out the standard sysop functions, allowing you to
  8023. customize your door's interface to mimic any BBS package. By
  8024. default, OpenDoors emulates the function keys used by the Remote
  8025. Access BBS package, but you may choose, for example, to have
  8026. your door use the key combinations used by PC-Board. In
  8027. addition, OpenDoors provides an interface which allows you to
  8028. add your own function keys which will be accepted by the door.
  8029. This could allow you to add additional features, such as giving
  8030. the sysop access to a status screen which displays information
  8031. about your door.
  8032. Many of the variables in this section are unsigned ints, which
  8033. represent a sysop key combination such as [ALT]-[H], [F8], or
  8034. [CTRL]-[P]. These values are in the same format as is returned
  8035. by the Turbo C(++) / Borland C++ bioskey() function. The high-
  8036. order byte represents the scan code of the key, and the low-
  8037. order byte represents the ASCII value, if any, of the key
  8038. combination. Note that a complete tutorial on these key codes is
  8039. beyond the scope of this manual. For more information on these
  8040. key codes, you should see the documentation on the bioskey()
  8041. function, which accompanies your compiler. If you wish to
  8042. determine the key code which corresponds to a particular
  8043. keystroke, there is a simple program, listed below, which you
  8044. can compile and use. This program will simply display the key
  8045. code for any key pressed, until you press the [ESCape] key. So,
  8046. in order to determine the code for [SHIFT]-[F8], you would
  8047. simply run this program, press the [SHIFT]-[F8] key combination
  8048. on your keyboard, and record the value displayed on your screen.
  8049. #include <stdio.h>
  8050. #include <bios.h>
  8051. main()
  8052. {
  8053. int nKey;
  8054. do
  8055. {
  8056. nKey = bioskey(0);
  8057. printf("%d (from: %x, %x)\n",
  8058. nKey, nKey>>8, nKey&0xff);
  8059. } while((nKey & 0xff) != 27);
  8060. }
  8061. ===============================================================================
  8062. OpenDoors 6.00 Manual End of Page 212
  8063. -------------------------------------------------------------------------------
  8064. BUILT IN These variable allow you to customize the sysop function keys
  8065. FUNCTION which control functions such as hanging up on the user, shelling
  8066. KEYS to DOS, and so on. All of these variable will be assigned
  8067. default values, which correspond to the same function keys used
  8068. by the RemoteAccess BBS package. However, you may change the
  8069. values of these variables in order to customize the key
  8070. combinations which carry out these functions in your own door
  8071. program. Remember that if you wish to change the value of any of
  8072. these variables, you must do so after having called od_init() or
  8073. some OpenDoors function. Each of these variables contain a scan-
  8074. code / ASCII-code combination representing a keystroke, as is
  8075. described above. These variables are as follows:
  8076. +---------------------+----------------------------------------+
  8077. | VARIABLE | CORRESPONDING FUNCTION |
  8078. +---------------------+----------------------------------------+
  8079. | od_control. | Enter sysop chat mode |
  8080. | key_chat | (Normally [ALT]-[C] |
  8081. | | |
  8082. | od_control. | Invoke sysop DOS shell |
  8083. | key_dosshell | (Normally [ALT]-[J] |
  8084. | | |
  8085. | od_control. | Return to the BBS without hanging up |
  8086. | key_drop2bbs | (Normally [ALT]-[D]) |
  8087. | | |
  8088. | od_control. | Hangup on the user |
  8089. | key_hangup | (Normally [ALT]-[H]) |
  8090. | | |
  8091. | od_control. | Turn off the user's keyboard |
  8092. | key_keyboardoff | (Normally [ALT]-[K]) |
  8093. | | |
  8094. | od_control. | Decreases the user's remaining time |
  8095. | key_lesstime | (Normally [DOWN-ARROW]) |
  8096. | | |
  8097. | od_control. | Lock the user out of the BBS system |
  8098. | key_lockout | (Normally [ALT]-[L]) |
  8099. | | |
  8100. | od_control. | Increases the user's remaining time |
  8101. | key_moretime | (Normally [UP-ARROW]) |
  8102. | | |
  8103. | od_control. | Array of eight function keys to set the|
  8104. | key_status[8] | current status line. |
  8105. | | (Normally [F1], [F2], [F3], [F4], [F5],|
  8106. | | [F6], [F9], [F10]) |
  8107. | | |
  8108. | od_control. | "Sysop next" toggle key |
  8109. | key_sysopnext | (Normally [ALT]-[N]) |
  8110. +---------------------+----------------------------------------+
  8111. ===============================================================================
  8112. OpenDoors 6.00 Manual End of Page 213
  8113. -------------------------------------------------------------------------------
  8114. CUSTOM In addition to the sysop function keys built into OpenDoors, you
  8115. FUNCTION may wish to add your own function keys to your door. For
  8116. KEYS example, you might wish to have the [ALT]-[Z] combination
  8117. display a window of information about your door, or you may wish
  8118. to add your own user editor to your door, accessible through the
  8119. [ALT]-[E] combination. The four variables:
  8120. unsigned char od_control.od_num_keys;
  8121. unsigned int od_control.od_hot_key[16];
  8122. unsigned int od_control.od_last_hot;
  8123. void (*od_control.od_hot_function[16])(void);
  8124. provide your program with an interface to add your own sysop
  8125. function keys (not accessible by the remote user) to the door
  8126. you have written.
  8127. OpenDoors allows you to define up to sixteen custom sysop
  8128. function keys. The key codes (as described at the beginning of
  8129. this section) are stored in the od_control.od_hot_key[] array,
  8130. and the od_control.od_num_keys variable records the number of
  8131. keys which have been defined. The od_control.od_num_keys
  8132. variable defaults to a value of 0. So, in order to add your own
  8133. function keys, simply place the key codes for these keys in the
  8134. first n elements of the od_control.od_hot_key[] array, and set
  8135. the od_control.od_num_keys variable to the number of keys you
  8136. have defined. OpenDoors will then watch the keyboard for any of
  8137. your predefined sysop function keys being pressed. If one of
  8138. these keys is pressed, OpenDoors will place the key code of the
  8139. pressed key in the od_control.od_last_hot variable. Your program
  8140. will then be able to respond to one of your custom function keys
  8141. being pressed by checking the value of the
  8142. od_control.od_last_hot variable. At any time this variable
  8143. contains a non-zero value. If this is the case, you will then be
  8144. able to determine which of your function keys has been pressed
  8145. by checking the key code contained in this variable. After
  8146. taking the appropriate action for the key pressed, you should be
  8147. sure to reset the value of the od_control.od_last_hot variable
  8148. back to zero, which will indicate to OpenDoors that your program
  8149. has received and responded to the function key which was
  8150. pressed.
  8151. As an alternative to testing the contents of the
  8152. od_control.od_last_hot variable, you can also have your program
  8153. respond to custom sysop function keys by providing a callback
  8154. function in the array: void
  8155. (*od_control.od_hot_function[16])(void);
  8156. The Nth element in this array corresponds to the Nth element in
  8157. the od_control.od_hot_key array. To use this mechanism, simply
  8158. set the appropriate element of this array to point to the
  8159. ===============================================================================
  8160. OpenDoors 6.00 Manual End of Page 214
  8161. function that you wish to have OpenDoors call when the sysop
  8162. presses the corresponding function key. For instance, assume
  8163. that the following function is included in your program's source
  8164. code:
  8165. void addPoints(void)
  8166. {
  8167. /* add ten points to the user's score */
  8168. currentUser->points += 10;
  8169. }
  8170. If you wanted to have this function called when the sysop
  8171. presses the [Page Up] key, you could do the following:
  8172. /* get number of new sysop function key, and increment */
  8173. /* total number of keys */
  8174. int new_key = od_control.od_num_keys++;
  8175. /* Set next sysop hotkey to Page Up */
  8176. od_control.od_hot_key[new_key] = 0x4900;
  8177. /* Set corresponding function to addPoints() */
  8178. od_control.od_hot_function[new_key] = addPoints;
  8179. ===============================================================================
  8180. OpenDoors 6.00 Manual End of Page 215
  8181. CONTROL STRUCTURE - COLOR CUSTOMIZATION
  8182. -------------------------------------------------------------------------------
  8183. These variables allow you to customize the color of text
  8184. displayed by OpenDoors. Each of these variables are assigned
  8185. color attributes, in the format used by od_set_attrib()
  8186. (described on page 128). These variables are as follows:
  8187. +---------------------+----------------------------------------+
  8188. | VARIABLE | WHERE COLOR IS USED |
  8189. +---------------------+----------------------------------------+
  8190. | od_control. | Text typed by the sysop and user in |
  8191. | od_chat_color1 & 2 | chat mode. |
  8192. | | |
  8193. | od_control. | File description fields in FILES.BBS |
  8194. | od_list_comment_col | listings |
  8195. | | |
  8196. | od_control. | Color of page pausing prompt that is |
  8197. | od_continue_col | displayed at the end of each page |
  8198. | | |
  8199. | od_control. | Filename fields in FILES.BBS listings |
  8200. | od_list_name_col | |
  8201. | | |
  8202. | od_control. | "Missing" string in FILES.BBS listings |
  8203. | od_list_offline_col | |
  8204. | | |
  8205. | od_control. | File size fields in FILES.BBS listings |
  8206. | od_list_size_col | |
  8207. | | |
  8208. | od_control. | Title fields in FILES.BBS listings |
  8209. | od_list_title_col | |
  8210. | | |
  8211. | od_control. | Color of the window title as displayed |
  8212. | od_menu_title_col | by od_popup_menu() |
  8213. | | |
  8214. | od_control. | Color of the window border as |
  8215. | od_menu_border_col | displayed by od_popup_menu() |
  8216. | | |
  8217. | od_control. | Color of the normal text displayed |
  8218. | od_menu_text_col | by od_popup_menu() |
  8219. | | |
  8220. | od_control. | Color of the shortcut keys displayed |
  8221. | od_menu_key_col | by od_popup_menu() |
  8222. | | |
  8223. | od_control. | Color of the selection bar as |
  8224. | od_menu_highlight_ | displayed by od_popup_menu() |
  8225. | col | |
  8226. | | |
  8227. | od_control. | Color of the shortcut keys displayed |
  8228. | od_menu_highkey_col | on the selected line by od_popup_menu()|
  8229. +---------------------+----------------------------------------+
  8230. ===============================================================================
  8231. OpenDoors 6.00 Manual End of Page 216
  8232. CONTROL STRUCTURE - TEXT CUSTOMIZATION
  8233. -------------------------------------------------------------------------------
  8234. In addition to the other aspects of OpenDoors which may be
  8235. customized by use of the OpenDoors control structure, all of the
  8236. text displayed by OpenDoors may also be customized. This may be
  8237. done either to create doors with OpenDoors that use languages
  8238. other than English, or to simply give your doors a "personal
  8239. touch". The variables described in this section allow you to
  8240. define what text you want to have displayed by OpenDoors at any
  8241. time. All of these variables are pointers to strings, and are
  8242. set to default values in the od_init() function. Thus, if you
  8243. wish to change the string pointed to by any of these variables,
  8244. you must do so after od_init() or some OpenDoors API function
  8245. has been called. To set any of these variables, you can simply
  8246. set them to point to a string-constant in your program. For
  8247. example, to set the text displayed by OpenDoors prior to a DOS
  8248. shell, you could:
  8249. od_control.od_before_shell=(char *)"\n\rJust a moment...\n\r";
  8250. The chart below lists each of the text customization variables
  8251. (without the "od_control." prefix, for the sake of brevity),
  8252. along with their default strings.
  8253. Note that some of these strings MUST always be the same length
  8254. as their default string. You may not display longer text within
  8255. these strings, and if you wish to display shorter text, you must
  8256. pad the remaining space in the string with spaces, in order to
  8257. preserve its length. Those string which must be of fixed length
  8258. also have their length listed in the chart below. Any strings
  8259. which have an asterisk (*) in their length column may be any
  8260. length.
  8261. Also keep in mind that any string with "printf-style" formatting
  8262. sequences, such as "%s", must retain the same sequences in the
  8263. same order.
  8264. In addition, four of these pointers - od_after_chat,
  8265. od_after_shell, od_before_chat and od_before_shell - can be set
  8266. to a value of NULL. In this case, OpenDoors will not display any
  8267. string where this variable's string is normally displayed.
  8268. +-----------------------+-----+----------------------------------------------+
  8269. | VARIABLE NAME | LEN | DEFAULT VALUE |
  8270. +-----------------------+-----+----------------------------------------------+
  8271. | od_after_chat | * | "\n\rChat mode ended...\n\r\n\r" |
  8272. | | | |
  8273. | od_after_shell | * | "\n\r...Thanks for waiting\n\r\n\r" |
  8274. | | | |
  8275. | od_before_chat | * | "\n\rSysop breaking in for chat...\n\r\n\r" |
  8276. | | | |
  8277. ===============================================================================
  8278. OpenDoors 6.00 Manual End of Page 217
  8279. | od_before_shell | * | "\n\rPlease wait a moment...\n\r" |
  8280. | | | |
  8281. | od_chat_reason | * | " Why would you " |
  8282. | | | "like to chat?\n\r" |
  8283. | | | |
  8284. | od_continue | * | "Continue? [Y/n/=]" |
  8285. | | | |
  8286. | od_continue_no | char| 'N' |
  8287. | | | |
  8288. | od_continue_nonstop | char| '=' |
  8289. | | | |
  8290. | od_continue_yes | char| 'Y' |
  8291. | | | |
  8292. | od_day[0] | 3 | "Sun" |
  8293. | | | |
  8294. | od_day[1] | 3 | "Mon" |
  8295. | | | |
  8296. | od_day[2] | 3 | "Tue" |
  8297. | | | |
  8298. | od_day[3] | 3 | "Wed" |
  8299. | | | |
  8300. | od_day[4] | 3 | "Thu" |
  8301. | | | |
  8302. | od_day[5] | 3 | "Fri" |
  8303. | | | |
  8304. | od_day[6] | 3 | "Sat" |
  8305. | | | |
  8306. | od_hanging_up | * | "Terminating Call" |
  8307. | | | |
  8308. | od_help_text | 80 | " Alt: [C]hat [H]angup [L]ockout [J]Dos " |
  8309. | | | "[K]eyboard-Off [D]rop to BBS " |
  8310. | | | |
  8311. | od_help_text2 | 79 | " OpenDoors 6.00 - (C)Copyright 1992, " |
  8312. | | | "Brian Pirie - Registered Version " |
  8313. | | | |
  8314. | od_inactivity_timeout | * | "User sleeping at keyboard, inactivity " |
  8315. | | | "timeout...\n\r\n\r" |
  8316. | | | |
  8317. | od_inactivity_warning | * | "Warning, only %d minute(s) remaining " |
  8318. | | | "today...\n\r\n\r" |
  8319. | | | |
  8320. | od_month[0] | 3 | "Jan" |
  8321. | | | |
  8322. | od_month[1] | 3 | "Feb" |
  8323. | | | |
  8324. | od_month[2] | 3 | "Mar" |
  8325. | | | |
  8326. | od_month[3] | 3 | "Apr" |
  8327. | | | |
  8328. | od_month[4] | 3 | "May" |
  8329. | | | |
  8330. | od_month[5] | 3 | "Jun" |
  8331. ===============================================================================
  8332. OpenDoors 6.00 Manual End of Page 218
  8333. | | | |
  8334. | od_month[6] | 3 | "Jul" |
  8335. | | | |
  8336. | od_month[7] | 3 | "Aug" |
  8337. | | | |
  8338. | od_month[8] | 3 | "Sep" |
  8339. | | | |
  8340. | od_month[9] | 3 | "Oct" |
  8341. | | | |
  8342. | od_month[10] | 3 | "Nov" |
  8343. | | | |
  8344. | od_month[11] | 3 | "Dec" |
  8345. | | | |
  8346. | od_no_keyboard | 10 | "[Keyboard]" |
  8347. | | | |
  8348. | od_no_sysop | * | "\n\rI'm afraid the sysop is not available " |
  8349. | | | "at this time.\n\r" |
  8350. | | | |
  8351. | od_no_response | * | " No response.\n\r\n\r" |
  8352. | | | |
  8353. | od_no_time | * | "Sorry, you have used up your time for " |
  8354. | | | "today...\n\r\n\r" |
  8355. | | | |
  8356. | od_offline | 10 | "[OFFLINE] " |
  8357. | | | |
  8358. | od_paging | * | "\n\rPaging Sysop for Chat" |
  8359. | | | |
  8360. | od_press_key | * | "Press [Enter] to continue..." |
  8361. | | | |
  8362. | od_sending_rip | * | "\xb4 Sending RIP File \xc3" |
  8363. | | | |
  8364. | od_status_line[0] | 80 | " " |
  8365. | | | " [Node: " |
  8366. | | | |
  8367. | od_status_line[1] | * | "%s of %s at %u BPS" |
  8368. | | | |
  8369. | od_status_line[2] | 79 | "Security: Time: " |
  8370. | | | " [F9]=Help " |
  8371. | | | |
  8372. | od_sysop_next | 5 | "[SN] " |
  8373. | | | |
  8374. | od_time_left | 10 | "%d mins " |
  8375. | | | |
  8376. | od_time_warning | * | "Warning, only %d minute(s) remaining tod" |
  8377. | | | "ay...\n\r\n\r" |
  8378. | | | |
  8379. | od_want_chat | 11 | "[Want-Chat]" |
  8380. +-----------------------+-----+----------------------------------------------+
  8381. ===============================================================================
  8382. OpenDoors 6.00 Manual End of Page 219
  8383. 66
  8384. 66
  8385. 66
  8386. 66666
  8387. 66 66
  8388. 66 66
  8389. 6666
  8390. -------------------------------------------------------------------------------
  8391. CHAPTER 6 - SPECIAL TOPICS
  8392. ADDITIONAL INFORMATION ON THE WIN32 VERSION
  8393. -------------------------------------------------------------------------------
  8394. This section provides additional information on the Win32
  8395. version of OpenDoors that isn't found elsewhere in this manual.
  8396. If you are working with the Win32 version of OpenDoors, you
  8397. should take the time to read this entire section. You should
  8398. also read the sections in chapter 3 that describe how to compile
  8399. and run Win32 programs that use OpenDoors.
  8400. The Win32 version of OpenDoors has been designed to be as
  8401. similar as possible to the DOS version of OpenDoors. This means
  8402. that where possible, you can compile the same source code to
  8403. produce both a DOS and a Windows program. However, if you are
  8404. porting an existing DOS OpenDoors-based program to the Win32
  8405. platform, there are some important things to keep in mind.
  8406. The first thing to note is that under DOS, the program's
  8407. execution begins in the main() function, whereas under Windows,
  8408. it begins in the WinMain() function. To allow the same source
  8409. file to build both DOS and Windows versions you can use
  8410. conditional compilation. OpenDoor.h defines a constant of the
  8411. form ODPLAT_xxx, indicating which version of OpenDoors is being
  8412. used. Currently, this will be either ODPLAT_DOS, or
  8413. ODPLAT_WIN32. However, if a OS/2 or Unix version of OpenDoors
  8414. were created, they would use definitions such as ODPLAT_OS2, or
  8415. ODPLAT_UNIX. Under the Win32 version, you should pass the
  8416. nCmdShow parameter that is passed to WinMain into OpenDoors,
  8417. through od_control.od_cmd_show. If you do not do this, the
  8418. program will always start with the main window maximized,
  8419. regardless of what the user has requested. Also, you will
  8420. probably want to use the new od_parse_cmd_line() function in
  8421. both DOS and Windows programs, to allow standard command-line
  8422. options to be processed. The od_parse_cmd_line() function
  8423. accepts command line information in the same format as it is
  8424. passed to the main or WinMain() function. So, the general
  8425. structure of an OpenDoors program that can be compiled under
  8426. either DOS or Win32 now becomes:
  8427. ===============================================================================
  8428. OpenDoors 6.00 Manual End of Page 220
  8429. /* Add your own #includes here. */
  8430. #include "opendoor.h"
  8431. #ifdef ODPLAT_WIN32
  8432. int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
  8433. LPSTR lpszCmdLine, int nCmdShow)
  8434. #else
  8435. int main(int argc, char *argv[])
  8436. #endif
  8437. {
  8438. /* Add local variables here. */
  8439. #ifdef ODPLAT_WIN32
  8440. od_control.od_cmd_show = nCmdShow;
  8441. od_parse_cmd_line(lpszCmdLine);
  8442. #else
  8443. od_parse_cmd_line(argc, argv);
  8444. #endif
  8445. /* Add the rest of your program after this point. */
  8446. }
  8447. If you are porting existing OpenDoors programs over to the Win32
  8448. version of OpenDoors, another issue that you will have to pay
  8449. careful attention to is the fact that you are now working in the
  8450. 32-bit world. While 32-bit programming under a flat memory model
  8451. has many advantages (no more 64K segments and related
  8452. limitations, for example), you must be aware that the size of
  8453. basic data types that you are used to using may have changed.
  8454. For example, an int is now 32-bits wide instead of 16-bits wide.
  8455. One of the places where this difference becomes very important
  8456. is if you are performing file-I/O by directly dumping a
  8457. structure to or from disk using functions such as fread() and
  8458. fwrite(). In this case, you must declare your structures using
  8459. types that are of the same size between the 16-bit and 32-bit
  8460. worlds, in order for your file formats to be compatible between
  8461. the DOS and Win32 versions of your program. For example, the
  8462. EX_VOTE.C example program declares its structure using fixed-
  8463. sized types that are always available to any program including
  8464. "opendoor.h". These types are the following size, regardless of
  8465. what platform you are compiling under:
  8466. INT8 - 8-bit signed integer.
  8467. INT16 - 16-bit signed integer.
  8468. INT32 - 32-bit signed integer.
  8469. BYTE - 8-bit unsigned integer.
  8470. WORD - 16-bit unsigned integer.
  8471. DWORD - 32-bit unsigned integer.
  8472. ===============================================================================
  8473. OpenDoors 6.00 Manual End of Page 221
  8474. (NOTE: Obviously, the many details of 32-bit programming and
  8475. Windows programming are beyond the scope of this document. For
  8476. more information on the issues discussed here, you will probably
  8477. wish to consult other sources of information on Win32
  8478. programming.)
  8479. As you are probably aware, the Win32 edition of OpenDoors makes
  8480. extensive use of multithreading. The number of threads will
  8481. depend on what mode OpenDoors is operating in. In some
  8482. situations, all of the following threads may exist:
  8483. - The client thread(s), which executes the code that you write
  8484. in your program, along with the OpenDoors API functions.
  8485. - The local screen thread, which is responsible for drawing
  8486. your program's output on the screen, and receiving input from
  8487. the local keyboard.
  8488. - The frame window thread, which handles the OpenDoors menus,
  8489. toolbar, status bar and sysop function keys.
  8490. - The remote input thread, which receives input from the serial
  8491. port and adds it to OpenDoors common local/remote input
  8492. queue.
  8493. - The carrier detection thread, which blocks and only executes
  8494. if the carrier detect signal goes low.
  8495. - The time update thread, which updates the user's time
  8496. remaining online, and monitors user timeouts.
  8497. Since most of these threads only execute when the operating
  8498. system determines that there is actually something for them to
  8499. do, the Win32 version of OpenDoors provides very high
  8500. performance and responsiveness.
  8501. You may also want to make use of multithreading directly within
  8502. your program. If you do this, please note that while you may use
  8503. threads to perform background processing, OpenDoors requires
  8504. that you only call OpenDoors API functions from one thread.
  8505. If you wish to customize the information that is displayed in
  8506. the Help|About dialog box (including your program's name and
  8507. copyright information), provide your own application icon, or
  8508. add online help to the help menu, refer to the sections in the
  8509. manual on the following od_control variables:
  8510. od_control.od_app_icon
  8511. od_control.od_help_callback
  8512. od_control.od_prog_name
  8513. od_control.od_prog_version
  8514. od_control.od_prog_copyright
  8515. The section that describes how to run Windows based door
  8516. programs under DOS-based BBS package indicates that
  8517. COM<n>AutoAssign=0 should be set in the system.ini file. The
  8518. explanation for this is as follows: The default value for this
  8519. ===============================================================================
  8520. OpenDoors 6.00 Manual End of Page 222
  8521. setting in Windows 95 is -1, which prevents any Windows-based
  8522. program from accessing a serial port which has previously been
  8523. used by a non-Windows-based program, until the window that
  8524. program was running in is closed. By setting this value to 0,
  8525. you are allowing the Windows-based door program to immediately
  8526. use the modem, even while the MS-DOS session (VM) is still
  8527. active. A value of <x> greater than 0 will allow Windows-based
  8528. programs to access the serial port, only if the DOS-based
  8529. program has not accessed the serial port for at least <x>
  8530. seconds. For example, the default setting in Windows 3.1 was
  8531. COM1AutoAssign=2, which allowed Windows-based programs to access
  8532. the serial port if no DOS program had used it for at least 2
  8533. seconds.
  8534. The section that describes how to run Windows based door
  8535. programs under DOS-based BBS package also indicates that the
  8536. DTRON utility should be run after the start command returns. The
  8537. reason for this is that when a Windows program exits and closes
  8538. the serial port (by calling the CloseHandle() function), Windows
  8539. 95 lowers the DTR line on the serial port. Most modems are
  8540. configured to respond to this by hanging up on the remote user.
  8541. From talking to other people, it seems that this "feature" (or
  8542. fundamental design flaw, depending on how you want to look at
  8543. it) is unique to Windows 95, and won't effect OpenDoors when
  8544. running under Windows NT. However, the majority of people will
  8545. undoubtedly be using the Win32 version of OpenDoors under
  8546. Windows 95. This is unfortunate, since the Win32 communications
  8547. facilities are otherwise _very_ well designed. There is a rumor
  8548. that Microsoft's next upgrade to Windows 95 will fix this
  8549. problem. However, I must stress that this is only a rumor, and
  8550. that I haven't received any confirmation about this from
  8551. Microsoft.
  8552. OpenDoors currently provides two solutions to this problem.
  8553. First of all, OpenDoors has the ability to use an already open
  8554. serial port handle, if that information is supplied to it.
  8555. Hopefully, all Windows 95-based BBS software will provide the
  8556. option of running a door program with the serial port still
  8557. open, and allow you to pass that serial port handle on the door
  8558. program's command line. OpenDoors allows the serial port handle
  8559. to be passed on the command line, or set directly in the
  8560. od_control structure, as is described later in this manual. On
  8561. BBS systems where this form of hot sharing of the serial port is
  8562. supported, the serial port can remain open at all times, and so
  8563. the CloseHandle() problem is avoided.
  8564. This means that the only situation where the CloseHandle()
  8565. problem still has to be dealt with is when OpenDoors is running
  8566. on a Windows 95 system and OpenDoors has to open the serial port
  8567. itself (and so must close the serial port before exiting). This
  8568. would be the case for most MS-DOS based BBS systems running
  8569. ===============================================================================
  8570. OpenDoors 6.00 Manual End of Page 223
  8571. under Windows 95, unless some intermediate layer is provided. By
  8572. default, in this situation OpenDoors will disable DTR response
  8573. by the modem just before it closes the serial port, by sending
  8574. the AT&D0 command to the modem. The exact sequence of commands
  8575. used by OpenDoors to do this is specified by the
  8576. od_control.od_disable_dtr string. This DTR response disabling
  8577. may be turned off by setting the DIS_DTR_DISABLE
  8578. od_control.od_disable flag. Since many programs (OpenDoors
  8579. included) assume that they can hangup the modem by lowering the
  8580. DTR signal, a small utility will usually be run after the door,
  8581. which first raises the DTR signal again, and then re-enables DTR
  8582. response by the modem. Such a utility is included in this
  8583. package, named DTRON.EXE. I wrote the DTRON utility so that you
  8584. can freely redistributed it with your programs.
  8585. So, to summarize, the DTR disabling by OpenDoors and subsequent
  8586. reenabling by DTRON is only required for the Win32 version of
  8587. OpenDoors running under Windows 95 when the modem is configured
  8588. to hangup if the DTR signal is lowered, and the BBS software
  8589. does not have the ability to pass a live serial port handle to a
  8590. door program. Setting COM<n>AutoAssign in system.ini is only
  8591. required for the Win32 version of OpenDoors when it is being
  8592. called from an MS-DOS session that has previously accessed the
  8593. serial port.
  8594. Note that the Win32 version of OpenDoors requires Windows 95 or
  8595. Windows NT. It will not run under Windows 3.x, even with Win32s.
  8596. This is because OpenDoors makes use of the Windows 95/NT
  8597. multitasking and multithreading services that are not available
  8598. under Win32s.
  8599. ===============================================================================
  8600. OpenDoors 6.00 Manual End of Page 224
  8601. CONFIGURATION FILE SYSTEM
  8602. -------------------------------------------------------------------------------
  8603. One of the most useful OpenDoors features that you can
  8604. optionally choose to include in your programs is the OpenDoors
  8605. configuration file system. All that is required to enable the
  8606. configuration file system is to include the following line
  8607. before your first call to any OpenDoors function:
  8608. od_control.od_config_file = INCLUDE_CONFIG_FILE;
  8609. OpenDoors will now search for and read an OpenDoors
  8610. configuration file. If you do not specify the name of this file,
  8611. the default name of DOOR.CFG will be used. Using this
  8612. configuration file, the sysop can set a wide variety of options,
  8613. such as modem and system configuration information, maximum time
  8614. limits for the door, and even define custom door information
  8615. (drop) file formats. The example DOOR.CFG file included in your
  8616. OpenDoors package shows the format and all options that are
  8617. automatically supported by the configuration file system. This
  8618. configuration file format is designed to be easy to use, and the
  8619. example configuration file contains comments which provide a
  8620. complete description of each option. Feel free to redistribute
  8621. DOOR.CFG or a modified version of this file with your door
  8622. programs. In addition to the many configuration file settings
  8623. already supported, you can add your own settings that are
  8624. specific to your particular program.
  8625. To specify your own filename for the configuration file, use the
  8626. od_config_filename control structure variable. For example, the
  8627. following line:
  8628. od_control.od_config_filename = "MYDOOR.CFG"
  8629. causes OpenDoors to look for the configuration file MYDOOR.CFG
  8630. instead of the default DOOR.CFG.
  8631. OpenDoors fill first search for the configuration file in the
  8632. directory specified in the od_config_filename variable, if a
  8633. specific directory name was supplied. If not found, it will then
  8634. search the current directory. If the configuration file system
  8635. is unable to locate a configuration file, or if any settings are
  8636. omitted from the file, the default values for these settings
  8637. will be used automatically. This means that the configuration
  8638. file is always optional, unless your program has custom settings
  8639. that it requires in order to run.
  8640. The format for the configuration file is as follows. Blank lines
  8641. and any text following the semi-colon (;) character are ignored.
  8642. Configuration options are specified using a keyword, possibly
  8643. followed by one or more options. The keywords are not case
  8644. sensitive, but some of the options are. The order of options in
  8645. ===============================================================================
  8646. OpenDoors 6.00 Manual End of Page 225
  8647. the configuration file is not significant, with the exception of
  8648. the "CustomFileLine" option. For more information on the
  8649. "CustomFileLine" setting, see the section that begins on page
  8650. 230. The built-in configuration options are as follow:
  8651. BBSDir - BBS System directory. Indicates where the door
  8652. information file (drop file) can be found.
  8653. DoorDir - The door's working directory. This is where the door's
  8654. system files are located. OpenDoors will automatically
  8655. perform a chdir into this directory at initialization, and
  8656. will return to the original directory on exit.
  8657. LogFileName - Specifies the filename (path optional) where the
  8658. door should record log information.
  8659. DisableLogging - Prevents door from writing to a log file.
  8660. Node - BBS node number that the door is running on. Only used if
  8661. OpenDoors is unable to determine the node number by some
  8662. other means.
  8663. ???dayPagingHours - Specifies sysop paging hours. Sysop paging
  8664. will be permitted beginning at the start time, up until,
  8665. but not including, the end time. Times should be in the 24-
  8666. hour format. To disable paging on a particular day, set the
  8667. paging start and end times to the same time. ???day can be
  8668. one of Sunday, Monday, Tuesday, Wednesday, Thursday, Friday
  8669. or Saturday.
  8670. PageDuration - Duration of sysop page. Value indicates the
  8671. number of beeps that compose the sysop page alarm.
  8672. MaximumDoorTime - Maximum length of time a user is permitted to
  8673. access the door. If the user's total remaining time on the
  8674. BBS is less than this value, the user will only be
  8675. permitted to access the door for this shorter length of
  8676. time. This option is disabled by commenting out the line.
  8677. InactivityTimeout - Specifies the maximum number of seconds that
  8678. may elapse without the user pressing a key, before the user
  8679. will automatically be disconnected. A value of 0 disables
  8680. inactivity timeouts.
  8681. SysopName - Name of the sysop. OpenDoors can usually determine
  8682. the sysop's name from the door information (drop) file.
  8683. How3ever, some BBS packages do not supply this information.
  8684. In such cases, if the sysop's name is required by the door,
  8685. it may be supplied here.
  8686. ===============================================================================
  8687. OpenDoors 6.00 Manual End of Page 226
  8688. SystemName - Like the sysop's name, this option can usually be
  8689. determined from the door information file. If it is not
  8690. available, the sysop my supply the information here.
  8691. ChatUserColor - Specifies the color of text typed by the user in
  8692. sysop chat mode. The format of the color name is included
  8693. in the description of the od_color_config() function.
  8694. ChatSysopColor - Specifies the color of test typed by the sysop
  8695. in chat mode.
  8696. FileListTitleColor - Files.BBS listing colors.
  8697. FileListNameColor
  8698. FileListSizeColor
  8699. FileListDescriptionColor
  8700. FileListOfflineColor
  8701. SwappingDir - Directory where disk swapping will be done.
  8702. SwappingNoEMS - Disables swapping to EMS memory.
  8703. SwappingDisable - Disables swapping entirely.
  8704. LockedBPS - BPS rate at which door should communicate with the
  8705. modem. Valid rates are 300, 600, 1200, 2400, 4800, 9600,
  8706. 19200 and 38400. A value of 0 forces the door to always
  8707. operate in local mode. This option is not normally needed,
  8708. as the information is usually available from the door
  8709. information file.
  8710. FossilPort - Specifies the FOSSIL driver port number that the
  8711. modem is connected to. FOSSIL port 0 usually corresponds to
  8712. COM1, port 1 to COM2, and so on. This option is not
  8713. normally needed, as the information is usually available
  8714. from the door information file.
  8715. CustomFileName - Specifies the filename used by the custom door
  8716. information file format. Described in more detail below.
  8717. CustomFileLine - Specifies the contents of a particular line in
  8718. the custom door information file format.
  8719. The last two configuration file options, "CustomFileName" and
  8720. "CustomFileLine" allow you or the system operator using your
  8721. program to define your own door information (drop) file formats.
  8722. For more information on this topic, see the section which begins
  8723. on page 230.
  8724. You can also extend OpenDoor's configuration file format to add
  8725. your own options, by supplying a callback function that will be
  8726. called whenever OpenDoors encounters an unrecognized
  8727. ===============================================================================
  8728. OpenDoors 6.00 Manual End of Page 227
  8729. configuration file keyword. The prototype of this function
  8730. should be as follows:
  8731. custom_line_function(char *keyword, char *options)
  8732. To cause OpenDoors to use your function, you would include the
  8733. following line before your first call to any OpenDoors function:
  8734. od_control.od_config_function = custom_line_function;
  8735. (You can use a different function name if you wish.) When
  8736. OpenDoors encounters unrecognized keyword, it will now call your
  8737. function, passing a pointer to an upper case version the keyword
  8738. string in the first parameter, and a pointer to any options that
  8739. follow the keyword in the second parameter. For instance, if the
  8740. following line were encountered in the configuration file:
  8741. RegisteredTo John Smith ; Sysop's name
  8742. The parameters passed to your function would be:
  8743. char *keyword = "REGISTEREDTO"
  8744. char *options = "John Smith"
  8745. Your custom line function should be written in such a way that
  8746. if OpenDoors passes a configuration option to your function that
  8747. your function does not recognize, that option would simply be
  8748. ignored.
  8749. The example program below demonstrates how to use the custom
  8750. line function to add your own configuration file options. This
  8751. program looks for three custom configuration file options,
  8752. "RegistrationKey", "DefaultColor" and "DisplayWinners". If the
  8753. "RegistrationKey" option is present, the numerical value
  8754. following this option is stored in the global variable "key". If
  8755. the "DefaultColor" option is present, the color description
  8756. (such as "Bright Red on Black") is translated to an
  8757. od_set_attr() color code using od_color_config(). This color
  8758. setting is stored in the global variable default_color. Since
  8759. this variable is initialized to 0x07 (the value for dark white
  8760. on black), if this option is omitted, that color is used by
  8761. default. If the "DisplayWinners" option is included in the
  8762. configuration file, the global variable display_winners is set
  8763. to TRUE, regardless of any options that may follow this keyword.
  8764. #include "opendoor.h" /* Include opendooor.h */
  8765. /* Prototype for custom line function */
  8766. void custom_line_function(char *keyword, char *options);
  8767. unsigned long key=0L; /* Variables for our own config option */
  8768. unsigned char default_color=0x07;
  8769. ===============================================================================
  8770. OpenDoors 6.00 Manual End of Page 228
  8771. char display_winners=FALSE;
  8772. main() /* Program's execution begins here */
  8773. { /* Begin door operations, reading config file */
  8774. od_control.od_config_file = INCLUDE_CONFIG_FILE;
  8775. /* Tell OpenDoors to use custom line function */
  8776. od_control.od_config_function = custom_line_function;
  8777. od_init();
  8778. /* Main program's operations go here */
  8779. od_exit(10, FALSE); /* Exit program */
  8780. }
  8781. /* Code for custom line function */
  8782. void custom_line_function(char *keyword, char *options)
  8783. { /* If option is registration key */
  8784. if(stricmp(keyword,"REGISTRATIONKEY")==0)
  8785. {
  8786. key=atol(options); /* Store key in variable */
  8787. } /* If option is text color */
  8788. else if(stricmp(keyword,"DEFAULTCOLOR")==0)
  8789. { /* Get color value using od_color_config() */
  8790. default_color=od_color_config(options);
  8791. } /* Example of option enabled by just the keyword */
  8792. else if(stricmp(keyword,"DISPLAYWINNERS")==0)
  8793. { /* If keyword is present, turn on option */
  8794. display_winners=TRUE;
  8795. }
  8796. }
  8797. ===============================================================================
  8798. OpenDoors 6.00 Manual End of Page 229
  8799. DEFINING CUSTOM DOOR INFORMATION FILE FORMATS
  8800. -------------------------------------------------------------------------------
  8801. As is mentioned in the previous section, the OpenDoors
  8802. configuration file system provides two settings which allow the
  8803. sysop to define a custom door information file format. This
  8804. permits OpenDoors doors to operate directly on any BBS system
  8805. that produces a door information file format not directly
  8806. supported by OpenDoors. A custom door information file format is
  8807. defined using the "CustomFileName" option, followed by one or
  8808. more lines beginning with the "CustomFileLine" option.
  8809. The "CustomFileName" option specifies the filename used to
  8810. distinguish this file format from other file formats. This
  8811. filename should not include a path. To specify the path where
  8812. the door information file is located, the sysop should use the
  8813. BBSDir configuration file setting. If the filename of the custom
  8814. format is the same as that of one of the built-in formats, the
  8815. custom format will override the built-in format.
  8816. The actual format of the custom file is specified using a number
  8817. of lines that begin with the keyword "CustomFileLine". Each of
  8818. these lines will correspond to a single line in the door
  8819. information file, with the option following the "CustomFileLine"
  8820. keyword specifying the information that can be found on that
  8821. line. This can be one of the following keywords:
  8822. Ignore - Causes the next line in the door information file
  8823. to be ignored. Use on lines for which none of the
  8824. options below apply.
  8825. COMPORT - COM? port the modem is connected to (0 indicates
  8826. local mode)
  8827. FOSSILPORT - Fossil port number the modem is connected to
  8828. MODEMBPS - BPS rate at which to communicate with modem (0
  8829. or non-numerical value indicates local mode)
  8830. LOCALMODE - 1, T or Y if door is operating in local mode
  8831. USERNAME - Full name of the user
  8832. USERFIRSTNAME - First name(s) of the user
  8833. USERLASTNAME - Last name of the user
  8834. ALIAS - The user's pseudonym / handle
  8835. HOURSLEFT - Hours user has left online
  8836. ===============================================================================
  8837. OpenDoors 6.00 Manual End of Page 230
  8838. MINUTESLEFT - Minutes user has left online, or time left
  8839. online in format hh:mm
  8840. SECONDSLEFT - Seconds user has left online, or time left
  8841. online in format hh:mm:ss or format mm:ss (If more
  8842. than one of the above time options are used, the user
  8843. time left is taken to be the total of all of these
  8844. values.)
  8845. ANSI - 1, T, Y or G for ANSI graphics mode
  8846. AVATAR - 1, T or Y for AVATAR graphics mode
  8847. PAGEPAUSING - 1, T or Y if user wishes a pause at end of
  8848. screen
  8849. SCREENLENGTH - Number of lines on user's screen
  8850. SCREENCLEARING - 1, T or Y if screen clearing mode is on
  8851. SECURITY - The user's security level / access level
  8852. CITY - City the user is calling from
  8853. NODE - Node number user is connected to
  8854. SYSOPNAME - Full name of the sysop
  8855. SYSOPFIRSTNAME - The sysop's first name(s)
  8856. SYSOPLASTNAME - The sysop's last name
  8857. SYSTEMNAME - Name of the BBS
  8858. As an example of how to define custom door information file
  8859. formats, consider the following imaginary file format, which we
  8860. will name DROPINFO.TXT:
  8861. Brian Pirie <-- User name
  8862. 0 <-- Local mode
  8863. COM1: <-- Serial port to use
  8864. 9600 <-- BPS rate
  8865. 22:30:15 05-08-95 <-- File creation time
  8866. 35 <-- Time remaining (in minutes)
  8867. 1 <-- ANSI mode
  8868. Ottawa, Canada <-- Location
  8869. This format would be defined in an OpenDoors configuration file
  8870. as follows:
  8871. ===============================================================================
  8872. OpenDoors 6.00 Manual End of Page 231
  8873. CustomFileName DROPINFO.TXT
  8874. CustomFileLine USERNAME
  8875. CustomFileLine LOCALMODE
  8876. CustomFileLine COMPORT
  8877. CustomFileLine MODEMBPS
  8878. CustomFileLine IGNORE
  8879. CustomFileLine MINUTESLEFT
  8880. CustomFileLine ANSI
  8881. CustomFileLine CITY
  8882. Notice that the first "CustomFileLine" keyword in the
  8883. configuration file corresponds to the first line in our
  8884. DROPINFO.TXT file, the second "CustomFileLine" to the second
  8885. line, and so on. Also notice that the keyword "IGNORE" is used
  8886. for the line that contains the file creation time, since there
  8887. is no CustomFileLine keyword that allows you to read this
  8888. information.
  8889. ===============================================================================
  8890. OpenDoors 6.00 Manual End of Page 232
  8891. MULTIPLE PERSONALITY SYSTEM
  8892. -------------------------------------------------------------------------------
  8893. The OpenDoors Multiple Personality System allows the DOS
  8894. version of OpenDoors to support multiple sysop function key /
  8895. status line "personalities". Most commonly, you will use this
  8896. feature in conjunction with the "Personality" setting in the
  8897. OpenDoors configuration file, to allow the sysop to choose one
  8898. of the built-in personalities that most closely mimics the BBS
  8899. software they are using. OpenDoors includes the following
  8900. personalities:
  8901. Configuration Keyword Manifest constant
  8902. -----------------------------------------------------------
  8903. Standard PER_OPENDOORS
  8904. PCBoard PER_PCBOARD
  8905. RemoteAccess PER_RA
  8906. Wildcat PER_WILDCAT
  8907. The PCBoard, RemoteAccess and Wildcat personalities mimic the
  8908. status lines and function keys used by the BBS packages with
  8909. those names. The Standard personality, which is the personality
  8910. used by default, is a trimmed down version of the status lines
  8911. provided by OpenDoors 4.10 and earlier.
  8912. In addition to using the personalities supplied with OpenDoors,
  8913. you can create your own personalities. This simply involves
  8914. writing a function which OpenDoors will call to setup the sysop
  8915. function keys and to display the status line.
  8916. Include the following line before your first call to any
  8917. OpenDoors function:
  8918. od_control.od_mps = INCLUDE_MPS;
  8919. to include the multiple personality system in your program. This
  8920. also enables the Personality setting in the configuration file,
  8921. if you are using the configuration file system.
  8922. You can set the default personality to be used by OpenDoors by
  8923. setting od_control.od_default_personality to one of the manifest
  8924. constants listed in the table above. If you have included the
  8925. multiple personality system in your program, this setting will
  8926. determine the personality to use if the "Personality" option is
  8927. not set in the configuration file, and your program does not
  8928. later change the personality using the od_set_personality()
  8929. function. If you do not include the multiple personality system
  8930. in your program, this setting will determine the personality
  8931. that will always be used.
  8932. Creating your own personality involves writing a single
  8933. function.. Whenever OpenDoors needs to perform an operation that
  8934. ===============================================================================
  8935. OpenDoors 6.00 Manual End of Page 233
  8936. involves the personality, it will call this function, passing
  8937. one of the following message values:
  8938. PEROP_INITIALIZE Initialize the personality, installing any
  8939. custom function keys.
  8940. PEROP_DEINITIALIZE Deinitialize the personality, returning any
  8941. changed settings to their original values.
  8942. PEROP_CUSTOMKEY Indicates that a custom function key has
  8943. been pressed.
  8944. PEROP_DISPLAYx Where x is a number from 1 to 10. Indicates
  8945. that the specified status line should be
  8946. drawn from scratch.
  8947. PEROP_UPDATEx Where x is a number from 1 to 10. Indicates
  8948. that the specified status line should be
  8949. updated to reflect any changes.
  8950. If you have enabled the multiple personality system by setting
  8951. od_control.od_mps to INCLUDE_MPS, you can install your
  8952. personality function into OpenDoors by calling
  8953. od_add_personality(). When you call od_add_personality(), you
  8954. supply a string containing the name of the personality, along
  8955. with the top and bottom output line numbers to use. These line
  8956. numbers specify the portion of the screen to use for door
  8957. output, leaving the remainder of the screen available for
  8958. displaying the personality's status line. Once the personality
  8959. has been installed into OpenDoors, it can be selected by the
  8960. sysop using the "Personality" configuration file option, or
  8961. manually activated using the od_set_personality() function. For
  8962. more information on the od_add_personality() function, see page
  8963. 47.
  8964. You can make your personality function the default personality
  8965. by setting od_control.od_default_personality to point to your
  8966. personality function. As is the case with the built-in
  8967. personalities, this setting will be used as the default
  8968. personality if you have enabled the multiple personality system
  8969. by setting od_control.od_mps to INCLUDE_MPS. If you have not
  8970. enabled the multiple personality system in this manner, your
  8971. personality function will become the one and only personality
  8972. used within your program. When creating your own personality,
  8973. you can use the od_control.od_page_statusline variable to set
  8974. which status line (if any) will be activated when the user pages
  8975. the system operator.
  8976. ===============================================================================
  8977. OpenDoors 6.00 Manual End of Page 234
  8978. LOG FILE SYSTEM
  8979. -------------------------------------------------------------------------------
  8980. In order for the system operator to monitor system activity and
  8981. diagnose problems that have occurred while the system was
  8982. unattended, it is common for BBS software and door programs to
  8983. record major events in a log file. This log file typically
  8984. records the date and time of evens such as a user logging on or
  8985. off, transferring files, sending messages, paging the system
  8986. operator, and similar activities. Sometimes the system operator
  8987. will configure all of the pieces of software running on a
  8988. particular node to write to a single log file. In other cases,
  8989. the system operator will prefer to have each program write to
  8990. its own log file. However, software serving one line of a multi-
  8991. node BBS system should never attempt to write to the same log
  8992. file that is used by another node.
  8993. OpenDoors uses the "FrontDoor format" log file standard. This
  8994. was chosen as it is a clearly documented format that is quickly
  8995. becoming the standard for bulletin board software log files. A
  8996. segment from a log file produced by OpenDoors is listed below.
  8997. ---------- Thu 25 Feb 93, Vote 6.00
  8998. > 19:42:23 Brian Pirie entering door
  8999. > 19:50:55 User paging system operator
  9000. > 19:51:02 Entering sysop chat mode
  9001. > 20:05:41 Terminating sysop chat mode
  9002. > 20:18:32 User time expired, exiting door
  9003. To enable the OpenDoors log file system, simply include the
  9004. following line before your first call to any OpenDoors function:
  9005. od_control.od_logfile = INCLUDE_LOGFILE;
  9006. When OpenDoors is initialized, it will open the log file and
  9007. begin logging activities, unless logging has been disabled with
  9008. the od_control.od_logfile_disable variable. The log file name
  9009. will be taken from the od_control.od_logfile_name variable,
  9010. which is usually set by the configuration file. If no logfile
  9011. name has been set, OpenDoors will use the logfile named
  9012. DOOR.LOG. Upon opening the log file, OpenDoors will write an
  9013. entry indicating the time at which the use entered the door.
  9014. The od_control.od_prog_name variable sets the program name that
  9015. is written to the log file immediately after the current date
  9016. information. If this variable is not set, OpenDoors will write
  9017. its own name and version information in this place.
  9018. When the OpenDoors log file system is enabled, OpenDoors will
  9019. automatically produce logfile entries for the following events:
  9020. - User paging sysop, beginning of chat, end of chat
  9021. ===============================================================================
  9022. OpenDoors 6.00 Manual End of Page 235
  9023. - Sysop entering or returning from DOS shell
  9024. - User inactivity timeout or user time expired
  9025. - Sysop dropping user back to BBS
  9026. - Sysop hanging up on user, sysop locking out user
  9027. - User hanging up on BBS
  9028. - Your program calling the od_exit() function
  9029. ===============================================================================
  9030. OpenDoors 6.00 Manual End of Page 236
  9031. MAKING DOORS MULTI-NODE-AWARE
  9032. -------------------------------------------------------------------------------
  9033. While the majority of BBS systems have only a single phone line,
  9034. allowing only one user to access the system at a time, there are
  9035. also many multi-node BBS systems. On such systems, it is quite
  9036. possible that more than one user may be using your door program
  9037. simultaneously. OpenDoors itself is designed for both single-
  9038. node and multi-node operation. However, if you want your program
  9039. to operate correctly on multi-node systems, there are a number
  9040. of concurrency issues that you must keep in mind when writing
  9041. your own code.
  9042. Some door programs are designed to behave on multi-node systems
  9043. just as they would on single-line BBSes. Others add special
  9044. features only possible in multi-node environments. For instance,
  9045. you may want to permit users to interact or chat with one
  9046. another in "real time". Many simple doors may not require any
  9047. special attention to multi-node capabilities. However, if your
  9048. door must access any data files or other resources that are to
  9049. be shared among nodes, it is necessary to carefully coordinate
  9050. access to these resources.
  9051. There are two primary issues that are often of concern when
  9052. creating door programs for multi-node systems. The first issue
  9053. discussed below is how to coordinate concurrent file access
  9054. between multiple node. The second topic we will deal with is the
  9055. installation of door programs on multi-node systems.
  9056. CONCURRENT FILE ACCESS
  9057. -------------------------------------------------------------------------------
  9058. One of the most important issues that arises when writing door
  9059. programs for multi-node systems is how to coordinate
  9060. simultaneous access to a single data file by multiple instances
  9061. of your program. While it is generally safe to have multiple
  9062. nodes reading simultaneously from a single file, having multiple
  9063. nodes updating a file without any coordination can lead to lost
  9064. updates and other problems. Consider, for example, the EX_VOTE.C
  9065. example program that is included in your OpenDoors package. When
  9066. the user votes on a poll, EX_VOTE.C must update the total number
  9067. of votes for the user's answer. Such a program that is only
  9068. intended for single node operation could do this by simply
  9069. reading the current number of votes for the appropriate option,
  9070. adding one to this total, and writing the updated total back to
  9071. the file. However, if this approach where to be used on a multi-
  9072. node system, it is quite possible that two users would vote on
  9073. the same poll after both nodes have read the poll record into
  9074. memory. In this situation, one node would add one to the total
  9075. number of votes for the poll record that it has in memory, and
  9076. ===============================================================================
  9077. OpenDoors 6.00 Manual End of Page 237
  9078. write the updated information to the file. The second node would
  9079. then add one to its total, without reading the updated
  9080. information written by the first node. When the second node then
  9081. writes this information to the file, it overwrites the first
  9082. node's total with its own. The final effect is that the second
  9083. user's vote overwrites the first, and so the first user's vote
  9084. is lost.
  9085. The solution to this problem is to lock a file unit for the
  9086. entire update operation, to prevent other nodes from accessing
  9087. the unit at the same time. This unit could be the entire file,
  9088. or only a single record in the file. EX_VOTE.C locks its entire
  9089. file when performing an update operation, but in other cases it
  9090. may be more appropriate to only lock a single record in the
  9091. file. The important thing to understand is that when one node
  9092. locks a file unit, other nodes much wait until the first node is
  9093. finished the update operation. This means that if one node is
  9094. updating information that other nodes could possibly need access
  9095. to, it should always perform the lock, read, write and unlock
  9096. cycle as quickly as possible.
  9097. Let's look again at the approach taken by EX_VOTE.C. After the
  9098. user has indicated which option he/she wishes to vote on, Vote
  9099. attempts to open the file for exclusive access. By doing this,
  9100. EX_VOTE.C in effect locks the entire file for the duration that
  9101. it has the file open. If another node attempts to open the file
  9102. while one node has it locked, the open operation will fail, and
  9103. the C runtime library will set the errno variable to EACCES.
  9104. This, in effect, tells you that another node is currently
  9105. working on the file, and that you must wait your turn. In this
  9106. case, EX_VOTE.C continues to retry the open operation until the
  9107. other node is finished its update, at which time the open
  9108. operation will succeed. This approach will even work when there
  9109. are many nodes that are attempting to update the file at the
  9110. same time. Whichever node first attempts to open the file will
  9111. gain exclusive access to the file, and any additional nodes are
  9112. forced to wait for access to the file. When one node finishes
  9113. with the file, another node will gain access to the file
  9114. (whichever happens to be the next node to re-attempt the open
  9115. operation). This process continues until all waiting nodes have
  9116. had a chance to perform their update. EX_VOTE.C will repeatedly
  9117. try to open the file for up to 20 seconds, after which time it
  9118. will give up, reporting an error which indicate that it is
  9119. unable to access the file. During this waiting process,
  9120. EX_VOTE.C repeatedly calls od_kernel(), so that sysop function
  9121. keys, carrier detection and other essential door operations can
  9122. continue to be performed.
  9123. After EX_VOTE.C has successfully secured exclusive access to the
  9124. file, it first reads the record that it is going to update. It
  9125. is important that this be done after the file unit is locked, in
  9126. order to ensure that the copy of the record in memory matches
  9127. ===============================================================================
  9128. OpenDoors 6.00 Manual End of Page 238
  9129. what is stored in the file. EX_VOTE.C then updates the record
  9130. based on the question on which the user has voted, writes this
  9131. information back to the file. EX_VOTE.C then immediately closes
  9132. the file, allowing other nodes to also access the file.
  9133. EX_VOTE.C is very carefully designed so that the file update
  9134. operation can never be interrupted (for instance, no OpenDoors
  9135. functions are called, which could detect a time-out and
  9136. terminate the program while a file update operation is in
  9137. progress), or delayed until the user makes a response. As such,
  9138. the file unit is always unlocked (in this case, closed) within a
  9139. fraction of a second after it was locked, or order that other
  9140. nodes will never have to wait long for access to the file.
  9141. Here I have presented a detailed account of how EX_VOTE.C
  9142. handles multi-node file access. While all of the details
  9143. involved in coordinating multiple file access can be
  9144. overwhelming at first, they will begin to come naturally to you,
  9145. as you begin to always think in terms of multi-node scenarios.
  9146. To summarize, the important elements that are typically involved
  9147. in multi-node file access are:
  9148. A. Decide on an appropriate file unit to lock for your
  9149. application. In simple cases, this can be the entire file.
  9150. In other cases, you may wish to lock individual file
  9151. records, using the appropriate runtime library functions.
  9152. B. Always perform update operations in lock, read, update,
  9153. write, unlock cycles on individual file units. If there is a
  9154. chance that other nodes will also need to access the file
  9155. unit, ensure that the update operation cannot be interrupted
  9156. or delayed until a user makes a response.
  9157. After you have designed your program for concurrent file access,
  9158. how can you test it? If you don't have a multi-node BBS system
  9159. that you have access to, you can perform most of your testing
  9160. under a multitasking environment, with multiple copies of your
  9161. program running in different windows.
  9162. ===============================================================================
  9163. OpenDoors 6.00 Manual End of Page 239
  9164. MULTI-NODE CONFIGURATION
  9165. -------------------------------------------------------------------------------
  9166. A second issue that you may want to bear in mind is how door
  9167. programs are typically setup on multi-node systems.
  9168. Unfortunately, this may differ considerable depending upon which
  9169. BBS software is being used. However, some of the issues that you
  9170. may have to consider discussed below:
  9171. A. Your program must be able to locate the correct door
  9172. information file for the appropriate node. Most BBS systems
  9173. make separate door information files available to each node
  9174. by one of the following means:
  9175. - By naming each node's door information file
  9176. uniquely. (e.g. DORINFO1.DEF, DORINFO2.DEF.)
  9177. - By having a separate directory for each node's door
  9178. information file. (e.g. \NODE1\DOOR.SYS,
  9179. \NODE2\DOOR.SYS, etc.)
  9180. In the first case, OpenDoors can automatically select the
  9181. correct door information file, assuming that it knows which
  9182. node it is running on (see item C, below). In the later
  9183. case, you must tell OpenDoors which directory it must look
  9184. in to find the appropriate door information file. You may do
  9185. this by any of the following means:
  9186. - By specifying the location of the file on the
  9187. command line, if od_parse_cmd_line() is used.
  9188. - By providing a configuration file keyword to set
  9189. the door information file location for each node.
  9190. - By providing a different configuration file for
  9191. each node (See item B, below).
  9192. B. If you are using the OpenDoors configuration file system,
  9193. node-specific options should not be used if each node is
  9194. accessing the same configuration file. While it is possible
  9195. to have a different configuration file for each node (the
  9196. filename can be specified on the command line if
  9197. od_parse_cmd_line() is used), in most cases the same
  9198. configuration file will be used for all nodes. In this case,
  9199. the node number, serial port information, and possible door
  9200. information file location operations should not be used. If
  9201. you are basing your configuration file on the example
  9202. DOOR.CFG file that is included in the OpenDoors package, you
  9203. may want to remove these options from the file.
  9204. C. In many cases, your program must also be able to determine
  9205. which node it is running under. If this information is
  9206. ===============================================================================
  9207. OpenDoors 6.00 Manual End of Page 240
  9208. available in the door information file, or is stored in a
  9209. TASK environment variable, OpenDoors will automatically set
  9210. the appropriate node number in od_control.od_node.
  9211. Otherwise, if your program requires this information, it
  9212. should be specified on the program's command line. The
  9213. od_parse_cmd_line() function supports this option. Reasons
  9214. that your program might need to know the current node number
  9215. include:
  9216. - In order for OpenDoors to display this information
  9217. correctly on the status line.
  9218. - In order to determine which configuration file to
  9219. read or which node directory in which to look for
  9220. the door information file.
  9221. - In order for OpenDoors to know which door
  9222. information file to read (e.g. DORINFO1.DEF,
  9223. DORINFO2.DEF. etc.)
  9224. - In order to provide any form of real-time
  9225. interaction between nodes, such as inter-node chat.
  9226. D. If your program is running under MS-DOS, and multi-node file
  9227. access is being coordinated by locking part or all of a
  9228. file, the SHARE.EXE utility must be installed.
  9229. ===============================================================================
  9230. OpenDoors 6.00 Manual End of Page 241
  9231. 7777777
  9232. 77
  9233. 77
  9234. 77
  9235. 77
  9236. 77
  9237. 77
  9238. -------------------------------------------------------------------------------
  9239. CHAPTER 7 - TROUBLESHOOTING AND GETTING ASSISTANCE WITH OPENDOORS
  9240. ABOUT THIS CHAPTER
  9241. -------------------------------------------------------------------------------
  9242. This chapter is perhaps the most important section of this
  9243. entire manual. Here, we provide detailed instructions to help
  9244. you in tracing the source of problems in programs written with
  9245. OpenDoors. Included in this chapter is a step-by-step OpenDoors
  9246. troubleshooting guide and a chart listing common problems and
  9247. their solutions. Also included in this chapter is information on
  9248. the many means available to you for getting more help with
  9249. OpenDoors, including the OpenDoors support BBS, the OpenDoors
  9250. EchoMail conference, and how to get in touch with me. It is
  9251. strongly encouraged that you take the time to read through this
  9252. chapter.
  9253. TROUBLESHOOTING PROBLEMS
  9254. -------------------------------------------------------------------------------
  9255. If you are experiencing difficulty with a program that you are
  9256. writing using OpenDoors, it is suggested that you follow the
  9257. steps listed below in order to quickly solve your problem. Also,
  9258. be sure to check to "solutions to common problems" section of
  9259. this manual. There are many common difficulties which people
  9260. have with OpenDoors, that can easily be fixed using the
  9261. instructions in the "common solutions" section. Also, if you are
  9262. having difficulty solving a problem yourself, do not hesitate to
  9263. get in touch with me, as I am always happy to help with any
  9264. problems. In addition, you may find the other means of OpenDoors
  9265. support (described latter in this chapter), invaluable in
  9266. solving difficulties with OpenDoors.
  9267. Keep in mind that most programs you write will have some "bugs"
  9268. to begin with, and you should expect to spend at least 50% of
  9269. any programming project tracing down and solving errors and
  9270. bugs. While it would be nice if every program written worked
  9271. correctly the first time, it is a fact of life that debugging is
  9272. and always has been an important part of the software life-
  9273. ===============================================================================
  9274. OpenDoors 6.00 Manual End of Page 242
  9275. cycle. In fact, what most often separates the good programs from
  9276. the bad is the amount of time their programmer's spend debugging
  9277. and improving them. Unfortunately, it is difficult, if not
  9278. impossible, to come up with a "magic formula" for debugging
  9279. software. Debugging software is really more of an art than a
  9280. science. However, there are some basic guidelines, which if
  9281. followed, can greatly ease the task of software debugging.
  9282. As with all problem solving, the secret to software debugging
  9283. lies in obtaining as much information about the problem as
  9284. possible. While it is sometimes possible to solve a bug by
  9285. making intuitive changes in your program, or in re-writing a
  9286. piece of code to solve the problem by a different means,
  9287. debugging most often requires more of a "planned attack". This
  9288. planned attack generally involves little more than learning as
  9289. much about what is going wrong as possible. The first step in
  9290. solving a bug usually lies in locating the source of the
  9291. problem. Once you have located the problem, solving it is often
  9292. a relatively simple procedure. In locating the source of your
  9293. bug, the use of a software debugger, such as the one built into
  9294. the Turbo C(++) / Borland C++ integrated development
  9295. environment, can be invaluable.
  9296. When debugging programs written with OpenDoors, you should also
  9297. follow the steps listed below, in order to obtain more
  9298. information related to the problem you are trying to solve:
  9299. 1.) Re-read the section(s) of this manual, your Turbo C(++) /
  9300. Borland C++ manuals and your program's source code, which
  9301. apply to the problem you are experiencing.
  9302. 2.) Check the solutions to common problems section below. The
  9303. most common problems with OpenDoors can be solved using
  9304. this simple chart.
  9305. 3.) Check the value in the od_errno variable, which will often
  9306. provide vital clues as to the source of the problem. Use of
  9307. the od_errno variable is described in the section below.
  9308. 4.) If you are still stuck, please feel more than free to get
  9309. in touch with me! (see the end of this chapter for
  9310. information on reaching me) I am always more than happy to
  9311. help with any OpenDoors or general programming problems!
  9312. ===============================================================================
  9313. OpenDoors 6.00 Manual End of Page 243
  9314. SOLUTIONS TO COMMON PROBLEMS
  9315. -------------------------------------------------------------------------------
  9316. Below, several common difficulties with OpenDoors are listed,
  9317. along with suggested solutions to these problems. If you are
  9318. experiencing any difficulty with a program that you have written
  9319. with OpenDoors, we would suggest that you read this section
  9320. thoroughly. Here, the common problem is listed in the left
  9321. margin, and the solutions listed on the right portion of the
  9322. page.
  9323. -------------------------------------------------------------------------------
  9324. PROGRAM 1.) Check that the compiler is able to locate the OpenDoors
  9325. WON'T header file, "OPENDOOR.H". This can be accomplished either by
  9326. COMPILE placing this header file in the same directory as your other
  9327. header files (such as STDIO.H, etc.), or by placing the header
  9328. file in the current directory.
  9329. 2.) Be sure that you are linking your program with the correct
  9330. library for the memory model you are using. (See the section on
  9331. compiling with OpenDoors). Also be sure that both the source
  9332. code file for your program (such as EX_VOTE.C) and the library
  9333. file are listed in your project file, and that the project file
  9334. is loaded. For more information on compiling programs written
  9335. with OpenDoors, see page 22.
  9336. 3.) If you have tried the above solutions, and your program
  9337. still won't compile, then the problem is most likely an error in
  9338. your source code file. If you are unable to resolve your
  9339. problem, feel free to get in touch with me.
  9340. -------------------------------------------------------------------------------
  9341. SCREEN If you are using the od_clr_scr() function to clear the screen,
  9342. WILL NOT but are not getting any results, this is likely because the user
  9343. CLEAR online has screen clearing turned off. If you wish to force
  9344. screen clearing regardless of the user's screen clearing
  9345. settings (this is probably not a good idea), use the function
  9346. call od_disp_emu("\xc", TRUE);
  9347. -------------------------------------------------------------------------------
  9348. FIXUP This problem was probably caused by a mismatch between your
  9349. OVERFLOW memory model selection in your compiler, and the memory model
  9350. ERROR library you are using. See the section on compiling programs
  9351. with OpenDoors for more information on the correct library you
  9352. should be using for your memory model selection.
  9353. ===============================================================================
  9354. OpenDoors 6.00 Manual End of Page 244
  9355. OPENDOORS SUPPORT
  9356. -------------------------------------------------------------------------------
  9357. The powerful and easy to use door toolkit and this comprehensive
  9358. manual are only two portions of how OpenDoors helps you to write
  9359. BBS door and similar programs. The third element of OpenDoors is
  9360. the extensive OpenDoors support mechanisms. The OpenDoors email
  9361. conference and support BBS each give you a chance to share ideas
  9362. and source code with other OpenDoors programmers. A lot of
  9363. information concerning OpenDoors, along with the newest version
  9364. and online registration, is available through the OpenDoors
  9365. World Wide Web site. In addition to these sources, I am also
  9366. more than happy to answer any of your questions, or hear any
  9367. suggestions for future versions of OpenDoors. The remainder of
  9368. this chapter provides more information on the various sources of
  9369. OpenDoors support. Also keep your eyes open for the "OpenDoors
  9370. Tech Journal", that is produced on a regular basis by the users
  9371. of OpenDoors. Included in this newsletter is information on
  9372. OpenDoors and future versions, questions and answers about
  9373. OpenDoors and BBS door / utility programming in general, sample
  9374. source code, and much more.
  9375. THE OPENDOORS SUPPORT BBS
  9376. -------------------------------------------------------------------------------
  9377. One means of receiving OpenDoors support is via the OpenDoors
  9378. BBS. Below is an outline of some of what is available from the
  9379. OpenDoors BBS:
  9380. - The newest version of this package is always available
  9381. for download.
  9382. - Also available for download is example source code and
  9383. other files which you may find helpful when writing
  9384. programs with OpenDoors.
  9385. - Access to the OpenDoors conference where OpenDoors
  9386. programmers can share ideas, source code, and receive
  9387. help with difficulties or with learning OpenDoors.
  9388. - Get in touch with me with any questions, comments,
  9389. suggestions or bug reports.
  9390. - Other files by yours truly, which may be of use in you
  9391. programming, such as a registration key system, and so
  9392. on.
  9393. All users receive full access upon their first call to the
  9394. OpenDoors BBS. The North American phone number for the support
  9395. BBS is:
  9396. ===============================================================================
  9397. OpenDoors 6.00 Manual End of Page 245
  9398. +1 (613) 599-5554
  9399. The OpenDoors support BBS also has a FidoNet address, 1:243/8.
  9400. If you are interested in a list of files available from the
  9401. support BBS, simply file-request "FILES". To receive the newest
  9402. version of OpenDoors, you can file-request "ODOORS".
  9403. THE OPENDOORS WORD WIDE WEB SITE
  9404. -------------------------------------------------------------------------------
  9405. The OpenDoors World Wide Web site has been setup to provide up-
  9406. to-date information on OpenDoors. This includes news concerning
  9407. OpenDoors, OpenDoors tips and techniques, pointers to other
  9408. sources of OpenDoors support, online registration and access to
  9409. the newest version of OpenDoors.
  9410. The current URL (address) of the OpenDoors Web site is:
  9411. http://omega.scs.carleton.ca/~ug930227/opendoor.html
  9412. However, I plan on moving this to a new location some time this
  9413. year. If you are unable to reach the OpenDoors Web site through
  9414. the above URL, please get in touch with me, and I will be able
  9415. to tell you where it has moved to.
  9416. THE OPENDOORS CONFERENCE
  9417. -------------------------------------------------------------------------------
  9418. The OpenDoors conference is devoted to OpenDoors and BBS / door
  9419. / BBS utility programming in general. The OpenDoors conference
  9420. serves as a place where people working with OpenDoors can share
  9421. ideas, source code examples, and other tricks and techniques.
  9422. Through the OpenDoors conference you can receive help with
  9423. OpenDoors and programming in general. Also available through the
  9424. OpenDoors conference is information on future versions of
  9425. OpenDoors and recent developments of concern to BBS door and
  9426. utility programmers. The OpenDoors conference is also a place
  9427. for suggestions for future versions of OpenDoors, OpenDoors bug
  9428. reports, a place to announce the availability of your programs,
  9429. and much more information of interest to programmers working
  9430. with OpenDoors.
  9431. You can become involved in the OpenDoors Conference by the
  9432. following means:
  9433. - The OpenDoors conference is available as an Internet mailing
  9434. list. to subscribe, send email to [email protected] and put
  9435. ===============================================================================
  9436. OpenDoors 6.00 Manual End of Page 246
  9437. SUBSCRIBE OPENDOOR in the message body. For help on using the
  9438. listserver you can send email to [email protected] and put
  9439. HELP in the message body.
  9440. - The OpenDoors conference is available on the FidoNet North
  9441. America echo backbone, and so is available to a large number
  9442. of BBS systems. FidoNet capable systems may also obtain an
  9443. OpenDoors feed directly from the moderator, Brian Pirie.
  9444. GETTING IN TOUCH WITH ME
  9445. -------------------------------------------------------------------------------
  9446. If you have any questions about OpenDoors, would like help with
  9447. any programs that your are writing, or have any suggestions for
  9448. future versions of OpenDoors, please feel free to get in touch
  9449. with me. You can get in touch with me by any of the following
  9450. means:
  9451. - The best way to contact me is by Internet email. My primary
  9452. email address is:
  9453. [email protected]
  9454. If you have difficulty contacting me through this address, I
  9455. may also be reached through the address:
  9456. [email protected]
  9457. - By writing a message to me in the OpenDoors support
  9458. conference. For more information on the OpenDoors conference,
  9459. see the previous section of this chapter.
  9460. - By calling the OpenDoors support BBS. Information on the
  9461. support BBS is provided earlier on in this chapter.
  9462. - By sending your question or comment by Fax. My fax number is:
  9463. +1 (613) 599-5554
  9464. - By FidoNet NetMail. My address is:
  9465. 1:243/8
  9466. While I would like to be able to reply to all NetMail
  9467. messages by CrashMail, I am afraid I simply can not afford to
  9468. do this. So, if you choose to send NetMail, please indicate
  9469. whether you would like me to reply by routed NetMail (this
  9470. may not work, if routed NetMail is not available in your
  9471. area), or to place the message on hold for you to poll and
  9472. pick up.
  9473. ===============================================================================
  9474. OpenDoors 6.00 Manual End of Page 247
  9475. - By conventional mail. My postal address is:
  9476. Brian Pirie
  9477. 117 Cedarock Drive
  9478. Kanata ON K2M 2H5
  9479. Canada
  9480. I try to respond to all correspondences as soon as possible.
  9481. If you are having some sort of difficulty with OpenDoors, the
  9482. more detailed information you supply (such as source code to the
  9483. program that is causing the problem, how to duplicate the
  9484. problem, and so on), the more quickly I will be able to
  9485. determine the source of your problem. Also, before you write
  9486. about a problem with OpenDoors, you may wish to be sure that you
  9487. have read and followed the instructions in the section on
  9488. troubleshooting, found on page 242. While I do not mind taking
  9489. the time to answer any questions related to OpenDoors, you may
  9490. be able to save yourself the time of writing and waiting for a
  9491. response - simply by following the instructions in the
  9492. troubleshooting section. More often than not, the answer to
  9493. questions I receive is already in this manual.
  9494. ===============================================================================
  9495. OpenDoors 6.00 Manual End of Page 248
  9496. A
  9497. AAA
  9498. AA AA
  9499. AAAAAAA
  9500. AA AA
  9501. AA AA
  9502. AA AA
  9503. -------------------------------------------------------------------------------
  9504. APPENDIX A - CONTENTS OF PACKAGE
  9505. The main OpenDoors package is distributed in the form of a
  9506. single, compressed archive file. Thus, you should have received
  9507. this version of OpenDoors in a file whose name began with
  9508. ODOORS60. The files listed below should be included in your
  9509. OpenDoors package. If any of these files are missing, you will
  9510. probably want to look for the most recent version of OpenDoors
  9511. from another source. Note that the medium and compact memory
  9512. model libraries are now distributed separately from the main
  9513. OpenDoors package.
  9514. MISCALENEOUS FILES
  9515. FILE_ID.DIZ Description of the OpenDoors package
  9516. DORINFO1.DEF Sample door info file for testing programs
  9517. DOOR.CFG Sample OpenDoors configuration file
  9518. EXAMPLE PROGRAMS
  9519. EX_HELLO.C A simple program using OpenDoors
  9520. EX_CHAT.C Split-screen sysop chat program
  9521. EX_MUSIC.C Example of ANSI music in OpenDoors
  9522. EX_SKI.C Simple slalom skiing action game
  9523. EX_VOTE.C Example of an online voting program
  9524. VOTEDOS.EXE Compiled version of EX_VOTE.C - DOS version
  9525. VOTEWIN.EXE EX_VOTE.C compiled - Windows version
  9526. DTRON.EXE Free utility for running Win 95 doors
  9527. THE LIBRARY FILES
  9528. ODOORS.LIB DOS, Small memory model library
  9529. ODOORL.LIB DOS, Large memory model library
  9530. ODOORH.LIB DOS, Huge memory model library
  9531. ODOORW.LIB Win32 import library (Microsoft version)
  9532. ODOORS60.DLL The OpenDoors Win32 DLL
  9533. THE HEADER FILE
  9534. OPENDOOR.H OpenDoors header file
  9535. OPENDOORS DOCUMENATION
  9536. ORDER.TXT Easy-to-print order form
  9537. OPENDOOR.TXT OpenDoors programmer's manual (this file)
  9538. ===============================================================================
  9539. OpenDoors 6.00 Manual End of Page 249
  9540. BBBBBB
  9541. BB BB
  9542. BB BB
  9543. BBBBBB
  9544. BB BB
  9545. BB BB
  9546. BBBBBB
  9547. -------------------------------------------------------------------------------
  9548. APPENDIX B - CHANGES FOR THIS VERSION
  9549. Since version 5.00, a lot of work has gone into OpenDoors. Many
  9550. months were spent cleaning up and restructuring the OpenDoors
  9551. code in a process that has touched nearly every line of the
  9552. OpenDoors code. As well as making the OpenDoors source code
  9553. easier to maintain, this has also involved making OpenDoors more
  9554. easily portable to 32-bit multithreaded platforms.
  9555. After this effort was completed, I began work on a Win32 port of
  9556. OpenDoors. The OpenDoors package now includes both DOS and Win32
  9557. versions of the library, giving you the option of developing for
  9558. one, the other, or both platforms. The Win32 version of
  9559. OpenDoors is highly multithreaded to give you the best possible
  9560. performance. With some exciting new BBS packages that are
  9561. designed specifically for Windows 95/NT in the works, the Win32
  9562. version of OpenDoors gives you a head start on developing
  9563. applications that will integrate smoothly with these new BBS
  9564. packages. Even if your programs will only be used with DOS-based
  9565. BBS packages, the Win32 version of OpenDoors allows you to take
  9566. advantage of the Windows 95 GUI, multithreading capabilities and
  9567. flat 32-bit memory model (no more DOS 64K limitations and
  9568. different memory models to worry about!). It also allows you to
  9569. access services that are only available to Windows based
  9570. programs, such as ODBC for easy database access, and MAPI for
  9571. email, fax and other messaging.
  9572. While this internal restructuring of OpenDoors and the Win32
  9573. port of the package would be enough alone to count as a major
  9574. new version, version 6.00 also includes many exciting new
  9575. features, enhancements and bug fixes:
  9576. - A new option, "silent mode", has been added. When operating
  9577. in silent mode, OpenDoor's local sysop interface is disabled,
  9578. so that no output is displayed on the local screen, and no
  9579. input is accepted from the local keyboard. Silent mode can be
  9580. activated by setting od_control.od_silent_mode = TRUE prior
  9581. to the first call to any OpenDoors function, or by specifying
  9582. -SILENT on the command-line (if od_parse_cmd_line() is used).
  9583. ===============================================================================
  9584. OpenDoors 6.00 Manual End of Page 250
  9585. - OpenDoors now fully supports RTS/CTS flow control, which is
  9586. enabled by default. To disable the use of the RTS/CTS lines
  9587. for flow control, use od_control.od_com_flow_control.
  9588. - In version 5.00, the built-in serial I/O module would be
  9589. unable to initialize the serial port if the "Uses Serial
  9590. Ports" option was turned off in DesqView or other
  9591. multitasking environments. When this option is turned off,
  9592. multitasking environments typically remove the serial port
  9593. information from the BIOS data segment. However, it seems
  9594. that other serial I/O software commonly uses the default
  9595. address for each port if this information is not available
  9596. from the BIOS data area. OpenDoors 6.00 has been changed to
  9597. do the same thing.
  9598. - OpenDoors now provides a standard command-line processing
  9599. function, od_parse_cmd_line(). This function provides a one-
  9600. step method of adding support for many common command-line
  9601. options to your program. This function handles options such
  9602. as serial port information (including non-standard serial
  9603. port configurations), node number information, user
  9604. information, drop file and configuration file locations,
  9605. silent mode (turns off the local interface for efficiency and
  9606. privacy), one step local login without a drop file, and more.
  9607. For details, run the included example program (votedos.exe or
  9608. votewin.exe) with the -help command line option. The
  9609. od_parse_cmd_line() function is particularly helpful in
  9610. several situations:
  9611. - When your program is being used on a multi-node
  9612. system.
  9613. - Allows potential users to try your program in local
  9614. mode by just specifying -local on the command line.
  9615. - Allows door information to be specified on the
  9616. command line, rather than through a drop file, as
  9617. supported by some BBS systems
  9618. - Allows serial port handle to be directly passed to
  9619. the program under Windows-based BBS systems that
  9620. support this.
  9621. - Provides customizable command-line help (in a
  9622. window in the Win32 version of OpenDoors).
  9623. - A new function, od_sleep(), allows you to suspend program
  9624. execution for the specified number of milliseconds, releasing
  9625. time to other processes in a multitasking environment. A call
  9626. of od_sleep(0) will yield control to any other processes
  9627. without forcing program execution to be suspended if no other
  9628. processes are waiting.
  9629. - The sysop page timing mechanism has been reworked. By
  9630. default, od_control.od_okaytopage is set to PAGE_USE_HOURS,
  9631. only allowing the sysop to be paged during the paging hours
  9632. ===============================================================================
  9633. OpenDoors 6.00 Manual End of Page 251
  9634. set by od_pagestartmin and od_pageendmin. Rather than
  9635. allowing the sysop to be paged at any time of the day or
  9636. night, the default now only permits sysop paging from 8:00am
  9637. to 10:00pm. Setting paging start and end time to the same
  9638. value now correctly permits paging 24 hours a day.
  9639. - OpenDoors now provides a multi-line editor function,
  9640. od_multiline_edit(). This editor allows the user to enter or
  9641. edit any information that spans multiple lines, such as email
  9642. messages or text files. The editor can be configured to
  9643. operate in full screen mode, or in any smaller area of the
  9644. screen that you specify. The editor is designed to be both
  9645. easy to use, and highly customizable.
  9646. - One new feature of OpenDoors 5.00 was somehow omitted from
  9647. the manual. Since version 5.00, it has been possible to set
  9648. the name of the drop file to use by including both a path and
  9649. filename in the od_control.info_path variable.
  9650. - All known inaccuracies and missing information from the
  9651. version 5.00 manual have been corrected.
  9652. - The example program, ex_chat.c, has been expanded to
  9653. demonstrate how OpenDoor's standard chat mode can be replaced
  9654. with the split-screen chat mode within your own programs.
  9655. - The multiple ex_vote?.c example files have been combined and
  9656. simplified into a single example program, as it was prior to
  9657. version 5.00.
  9658. - A memory leak in the od_popup_menu() function has been fixed.
  9659. - od_control.od_open_handle can be used to provide OpenDoors
  9660. with an already open serial port handle on platforms that
  9661. support it. Currently, this only applies to the Win32 version
  9662. of OpenDoors. If this variable is not set to a non-zero value
  9663. prior to calling the first OpenDoors function (other than
  9664. od_parse_cmd_line()), then OpenDoors proceeds normally,
  9665. opening the serial port itself, and closing the serial port
  9666. before exiting.
  9667. - A new switch, od_emu_simulate_modem, has been added to
  9668. od_control. When this is set to its default value of FALSE,
  9669. the OpenDoors terminal emulator displays at full speed, as it
  9670. has always done. However, when this flag is set to TRUE, the
  9671. emulation functions will display text at approximately the
  9672. same speed as it would be displayed when sent over the modem,
  9673. based on the current connect speed. This allows animations to
  9674. be displayed locally at the same speed as they would appear
  9675. on the remote system. This switch affects the following
  9676. functions:
  9677. od_disp_emu()
  9678. ===============================================================================
  9679. OpenDoors 6.00 Manual End of Page 252
  9680. od_send_file()
  9681. od_hotkey_menu()
  9682. - OpenDoors now distinguishes between the serial port BPS rate
  9683. (od_control.baud) and the connection BPS (a new variable,
  9684. od_control.od_connect_speed). In situations where a separate
  9685. value is available for the connect speed (e.g., this caller
  9686. has connected at 14400 bps), OpenDoors will now display that
  9687. value on the status line. Currently, a separate connect speed
  9688. is only obtained from the DOOR.SYS drop file format.
  9689. - The latest versions of the QBBS EXITINFO.BBS drop file is now
  9690. supported.
  9691. - A new od_edit_str() flag, EDIT_FLAG_SHOW_SIZE, has been
  9692. added. By default, the fields shown by od_edit_str() are one
  9693. character larger than the number of characters that may be
  9694. entered. This is for esthetic reasons, so that the cursor
  9695. remains within the highlighted field, even after a full
  9696. string has been entered. However, you may prefer that the
  9697. highlighted area reflect the exact number of characters that
  9698. are permitted. This can be accomplished by setting
  9699. EDIT_FLAG_SHOW_SIZE.
  9700. - Tab characters ('\t') are now expanded on the local display.
  9701. - The new RemoteAccess 2.50 EXITINFO.BBS fields are now
  9702. supported. This has included the addition of the following
  9703. new od_control members: user_rip_ver, user_attrib3 and
  9704. system_last_handle.
  9705. - When operating in "forced automatic local" mode (where no
  9706. door information file used), OpenDoors now displays a window
  9707. in which in prompts for the user's name at startup time. This
  9708. new feature can be disabled by specifying the DIS_NAME_PROMPT
  9709. od_control.od_disable flag.
  9710. - The latest version of the SFDOORS.DAT drop file is now
  9711. supported. SFMAIN.DAT, SFSYSOP.DAT, SFFILE.DAT and
  9712. SFMESS.DAT, which are in the same format as SFDOORS.DAT, are
  9713. also now recognized.
  9714. - A new function, od_get_input(), allows you to easily handle
  9715. extended keys in your program, such as arrow keys, insert and
  9716. function keys.
  9717. - The OpenDoors configuration file system will now display an
  9718. error and exit the program if a particular configuration file
  9719. name has been specified, and that configuration file cannot
  9720. be found.
  9721. ===============================================================================
  9722. OpenDoors 6.00 Manual End of Page 253
  9723. CCCC
  9724. CC CC
  9725. CC
  9726. CC
  9727. CC
  9728. CC CC
  9729. CCCC
  9730. -------------------------------------------------------------------------------
  9731. APPENDIX C - FUTURE VERSIONS
  9732. While I cannot make any promises about what features and changes
  9733. will be seen in future versions of OpenDoors, I would like to
  9734. take a moment to tell you a bit about some of the features you
  9735. can expect to see in future versions of OpenDoors
  9736. As you are probably already aware, OpenDoors is a constantly
  9737. evolving package. To help meet the needs of programmers working
  9738. with OpenDoors, nearly every idea and change that is made to the
  9739. package results from the suggestions and comments I receive from
  9740. the people using OpenDoors. For this reason, I will most likely
  9741. continue to produce new versions of OpenDoors for as long as
  9742. there is a demand and ideas for upgrades. There certainly is no
  9743. shortage of either of this right now.
  9744. Some of the features that I am considering for upcoming versions
  9745. of OpenDoors include:
  9746. -Telnet support.
  9747. - HTML support.
  9748. - Direct interfacing with new Windows 95/NT BBS packages.
  9749. - Further features to help writing multi-node door
  9750. programs.
  9751. -Direct interfacing with more BBS systems.
  9752. -Additional RIP graphics support, including possible
  9753. display of RIP images on local screen.
  9754. -Possible support for additional programming languages and
  9755. operating systems.
  9756. - Improvements to existing OpenDoors features, such as more
  9757. configuration file options, multiple log file formats,
  9758. and many smaller changes.
  9759. ===============================================================================
  9760. OpenDoors 6.00 Manual End of Page 254
  9761. DDDDD
  9762. DD DD
  9763. DD DD
  9764. DD DD
  9765. DD DD
  9766. DD DD
  9767. DDDDD
  9768. -------------------------------------------------------------------------------
  9769. APPENDIX D - SPECIAL THANKS
  9770. There are many people who I would like to thank, for their
  9771. suggestions, ideas and assistance in making OpenDoors what it is
  9772. today. Among those I would like to thank are:
  9773. - Everyone who has registered OpenDoors.
  9774. - All those who participate in the OpenDoors conference,
  9775. who provide many suggestions, bug reports and words of
  9776. encouragement.
  9777. - Those who on the OpenDoors beta team. Thank-you for
  9778. putting up with the problems along the way. You have
  9779. certainly helped to make OpenDoors a better package. The
  9780. people who have helped to beta test OpenDoors 6.00 are:
  9781. Robert Bouman
  9782. Doug Crone
  9783. Greg Diener
  9784. Patrick Dixon
  9785. Joel Downer
  9786. Mike Fenton
  9787. Les Howie
  9788. Vince Jacobs
  9789. Scott Jibben
  9790. Dean Mills
  9791. Jimmy Rose
  9792. Jim Woodward
  9793. Timothy Ward
  9794. Mark Williams
  9795. - Last but not least, I would like to thank my wife, Pearl,
  9796. for her support during the long hours that it has taken
  9797. to put OpenDoors together.
  9798. ===============================================================================
  9799. OpenDoors 6.00 Manual End of Page 255
  9800. GGGG
  9801. GG GG
  9802. GG
  9803. GG GGGG
  9804. GG GG
  9805. GG GG
  9806. GGGG
  9807. -------------------------------------------------------------------------------
  9808. GLOSSARY
  9809. ANSI ANSI is an acronym for "American National Standards Institute".
  9810. One of the standards approved by ANSI is a terminal display
  9811. protocol which allows (in this case), BBS software to perform
  9812. certain display functions such as changing the color of
  9813. displayed text, or moving the location of the cursor on the
  9814. screen. The majority, though not all, BBS users use terminal
  9815. software with ANSI capabilities. Any users that do not have
  9816. graphics display capabilities, will be using ASCII mode,
  9817. instead. The ANSI terminal protocol is sometimes referred to as
  9818. "ANSI graphics". It is graphic in the sense that it provides
  9819. more visual control than an ASCII TTY terminal does, but does
  9820. not imply any support for bit-mapped nor vector graphics.
  9821. Compare ASCII and AVATAR.
  9822. API API is an acronym for "Application Program(er) Interface". An
  9823. API is a set of well documented functions, variables and data
  9824. types that you can use to access certain services from your
  9825. program. When you write any C program that uses standard C
  9826. library functions such as fopen() or strcpy(), you are using a
  9827. sort of API. When you use OpenDoors functions such as
  9828. od_printf() or od_get_key(), you are using functions that are
  9829. part of the OpenDoors API. Operating systems provide their own
  9830. APIs that allow programs to gain access to operating system
  9831. features such as screen display, file I/O and communications.
  9832. The API provided by Microsoft Windows 95 and Windows NT is
  9833. called the Win32 API.
  9834. ASCII ASCII (pronounced "ass-key") is an acronym for "American
  9835. Standard Code for Information Interchange", and is a definition
  9836. of a set of 128 letters, number and symbols, which can be
  9837. displayed by computer systems. Also, when used within the domain
  9838. of BBS software, ASCII mode is often used to refer to the lack
  9839. of any more advanced display capabilities, such as ANSI or
  9840. AVATAR. When ASCII mode is used, characters can only be
  9841. displayed in standard Teletype (TTY) fashion, one after another.
  9842. Also, color and cursor positioning functions are not available
  9843. in ASCII mode. Compare ANSI and AVATAR.
  9844. ===============================================================================
  9845. OpenDoors 6.00 Manual End of Page 256
  9846. AVATAR AVATAR is an acronym for "Advanced Video Attribute Terminal
  9847. Assembler and Recreator". AVATAR is a graphics display protocol,
  9848. similar to ANSI. Like ANSI-graphics, AVATAR graphics allow
  9849. functions such as cursor positioning, and color changing.
  9850. However, AVATAR also offers many capabilities not available from
  9851. ANSI, and performs the same functions as ANSI much more quickly.
  9852. AVATAR graphics is less common than both ANSI or ASCII, but is
  9853. becoming more popular as time goes by. Compare ASCII and ANSI.
  9854. BAUD "baud" or "baud rate" are generally used as a synonym for "BPS".
  9855. BPS BPS is an acronym for "Bits Per Second", and refers to the rate
  9856. at which data is being sent over a communications medium. There
  9857. are two important BPS rates which are relevant to OpenDoors. The
  9858. serial port BPS rate (also called the DCE rate) is the speed at
  9859. which the computer is communicating with the local modem. The
  9860. connect speed, on the other hand, is the speed at which the
  9861. local modem is communicating with the remote modem. The serial
  9862. port speed must be at least as fast as the connection speed.
  9863. Often the serial port speed will be locked at a fixed speed that
  9864. is higher than the fastest possible connection speed of the
  9865. modem. For example, the serial port might be locked at a speed
  9866. of 38400 BPS, while the modem could be connected at 28,800,
  9867. 14,400 or slower speeds. OpenDoors usually needs to know the
  9868. serial port BPS rate in order to function correctly (as stored
  9869. in od_control.baud). Under certain situations, OpenDoors will
  9870. also be able to report the connection speed to you (as stored in
  9871. od_control.od_connect_speed), although OpenDoors does never
  9872. requires this information to operate.
  9873. BIT-MAPPED As with Boolean values, described below, bit mapped flags
  9874. FLAGS are used to indicate whether or not various conditions exist.
  9875. (For example, whether or not a certain setting is enabled, or
  9876. whether or not a particular event has occurred.) However, unlike
  9877. Boolean variables, a single bit-mapped flag represents more than
  9878. one of these TRUE/FALSE values. In fact, each bit (BInary
  9879. Digit), which makes of the variable can be used to represent a
  9880. separate TRUE/FALSE state. (ie, each bit maps to a particular
  9881. piece of information, and hence the term "Bit Map").
  9882. For an example of using bit-mapped flags, let us take a case of
  9883. a single "unsigned char" which contains three independent
  9884. TRUE/FALSE values. We will call this variable user_info, and it
  9885. will indicate whether or not a user has ANSI graphics, whether
  9886. or not the user has screen clearing turned on, and whether or
  9887. not the user has end-of-page "more" prompts enabled. Internally,
  9888. the bits of the user_info variable will be as follows:
  9889. ===============================================================================
  9890. OpenDoors 6.00 Manual End of Page 257
  9891. Bit: 7 6 5 4 3 2 1 0
  9892. | | |
  9893. | | +--- ANSI Graphics
  9894. | +----- Screen Clearing
  9895. +------- More prompts
  9896. In this case, we will have three constants which we define in
  9897. order to simplify access to these bit-mapped flags, as follows:
  9898. #define ANSI_GRAPHICS 0x01
  9899. #define SCREEN_CLEARING 0x02
  9900. #define MORE_PROMPTS 0x04
  9901. Note that normally within OpenDoors, these constants will be
  9902. defined for you, and you will have no need to know what their
  9903. values are, nor in which bit which piece of information is
  9904. stored.
  9905. Using bit-mapped flags, you are able to set or clear any of the
  9906. individual flags, and check whether any of the flags are set,
  9907. using these simple methods: (Not that a set flag is the
  9908. equivalent of a Boolean value of "True", and a cleared flag is
  9909. the equivalent of a Boolean value of "False".)
  9910. Set Flag: variable |= FLAG_CONSTANT;
  9911. Clear Flag: variable &=~ FLAG_CONSTANT;
  9912. Test Flag: variable & FLAG_CONSTANT
  9913. Where "variable" is the name of the bit-mapped flag variable,
  9914. and "FLAG_CONSTANT" is the pre-defined constant for the
  9915. individual setting. To return to our example, you could turn on
  9916. the user's ANSI graphics setting by using the line:
  9917. user_info |= ANSI_GRAPHICS;
  9918. and to turn off screen clearing you would:
  9919. user_info &=~ ANSI_GRAPHICS;
  9920. To perform an action (such as waiting for the user to press
  9921. [Return]/[Enter]) only if "More" prompts are enabled, you would:
  9922. if(user_info & MORE_PROMPTS)
  9923. {
  9924. ... /* Whatever you want */
  9925. }
  9926. ===============================================================================
  9927. OpenDoors 6.00 Manual End of Page 258
  9928. BOOLEAN Many of the variables used within OpenDoors contain a
  9929. VALUES "Boolean Value". A Boolean value is a two-state variable, who's
  9930. states are referred to as "True" and "False'. If the variable
  9931. contains a value of "True", it indicates that a certain
  9932. condition is so, and if it contains a value of "False", it
  9933. indicates that the condition is not so. For example, a Boolean
  9934. variable "wait" might be used to indicate whether or not
  9935. OpenDoors should wait for the user to press a key, or continue
  9936. without waiting. In this case, a value of "True" would indicate
  9937. that OpenDoors should wait, and a value of "False" would
  9938. indicate that it should not wait.
  9939. Note that in the C programming language, there is no actual
  9940. Boolean variable type - usually a char or an int are used to
  9941. store Boolean values.
  9942. The constants TRUE and FALSE, as defined in the OPENDOOR.H file,
  9943. are used to represent the two states of a Boolean value. Thus,
  9944. to set a Boolean variable "wait" to the value of "True", you
  9945. would use this line:
  9946. wait=TRUE;
  9947. and to set the variable "wait" to "False", you would:
  9948. wait=FALSE;
  9949. However, you SHOULD NOT test whether a Boolean variable is
  9950. "True" or "False" by using the C compare (==) operator, as the
  9951. value "True" will not always be the same numerical value.
  9952. (Actually, the TRUE constant represents just one of many
  9953. possible numerical values for "True"). Instead, to perform an
  9954. action of the "wait" Boolean variable is "True", you would:
  9955. if(wait)
  9956. {
  9957. ... /* Whatever you want */
  9958. }
  9959. and to perform an action if the "wait" Boolean variable is
  9960. "False', you would:
  9961. if(!wait)
  9962. {
  9963. ... /* Whatever you want */
  9964. }
  9965. For interest sake, Boolean values are named after the 19th
  9966. century English mathematician, who studied formal logic, and
  9967. created Boolean algebra - an algebra which deals with TRUE and
  9968. FALSE values.
  9969. ===============================================================================
  9970. OpenDoors 6.00 Manual End of Page 259
  9971. BPS BPS is an acronym for "Bits Per Second". For our purposes here,
  9972. the terms BPS and BAUD refer to the same thing.
  9973. CARRIER The term "Carrier" or "Carrier Detect" refers to a signal which
  9974. DETECT most modems send to the computer, which indicates whether or not
  9975. the modem is currently connected to (communicating with) another
  9976. modem. The door driver module of OpenDoors, as with most other
  9977. BBS software, uses the status of this carrier detect signal in
  9978. order to know whether the user is still connected to the BBS
  9979. computer. Thus, if the user hangs up, or if something goes wrong
  9980. and the connection is lost, OpenDoors is able to detect this
  9981. state, and exit to the BBS. The BBS will then also detect that
  9982. the carrier signal has been "lost", and will reset itself, and
  9983. then again be ready to accept calls.
  9984. CHAT MODE The term "chat mode" refers to a means by which the sysop can
  9985. communicate with a user of the BBS / door. During sysop chat,
  9986. anything typed by the sysop will appear on the user's screen,
  9987. and likewise, anything typed by the user will appear on the
  9988. sysop's screen. Sysop chatting is available on both single and
  9989. multi-line systems. Sysop chatting is initiated by the sysop,
  9990. either at any time a user is online, or specifically in response
  9991. to a sysop page.
  9992. COMPILE "Compiling" refers to the process of converting the source code
  9993. that you write for your program, into an executable file (such
  9994. as a .EXE file) that an end user can use. The process of
  9995. building an executable file is generally divided into two
  9996. stages. In the first stage, called compiling, source files are
  9997. converted to object files, often named .OBJ. In the second
  9998. stage, called linking, one or more object files are combined,
  9999. along with any library files, to produce the final executable
  10000. file.
  10001. DLL DLL is an acronym for "Dynamic Link Library". A dynamic link
  10002. library is similar to a static library, in that it contains one
  10003. or more functions that an application program can use. Unlike a
  10004. static library, the code from a dynamic link library is not
  10005. added to the program's executable file at link time. Instead,
  10006. the dynamic link library exists as a separate file which must be
  10007. loaded when the program is run. The Win32 version of OpenDoors
  10008. resides in a DLL.
  10009. See also "Library".
  10010. ===============================================================================
  10011. OpenDoors 6.00 Manual End of Page 260
  10012. DOOR A "door" is a program that runs as part of a BBS system, but
  10013. which is separate from the central BBS software (RemoteAccess,
  10014. Maximus, QuickBBS, PC-Board, etc.) itself. A door provides
  10015. additional features not built into the BBS software, such as on-
  10016. line games, on-line shopping services, voting booths, match
  10017. making systems, access to special files or messages, and much
  10018. much more. Since the user also communicates with the door
  10019. online, as they do with the BBS, it may not necessarily be
  10020. obvious to the user that the door is even a separate entity from
  10021. the central BBS software itself.
  10022. DOOR Also referred to as a "drop file", "exit file", or "chain
  10023. INFORMATION file". The door information file is a file passed from the
  10024. FILE central BBS software to a door program, providing it with
  10025. information about the user who is online, the BBS the door is
  10026. running under, and the current modem connection. The door
  10027. information file may also be used to pass changed information
  10028. back to the BBS, such as the amount of time that the user has
  10029. used in the door. OpenDoors takes care of all of the work
  10030. involved in reading and writing the door information file for
  10031. you, as described in the "Basics of Door Programming" section,
  10032. in chapter 4. Examples of door information files supported by
  10033. OpenDoors include: DOOR.SYS, EXITINFO.BBS, DORINFO?.DAT,
  10034. SFDOORS.DAT, CALLINFO.BBS and CHAIN.TXT.
  10035. DTR DTR is an acronym for "Data Terminal Ready". This is a signal
  10036. that the computer sends to the modem, indicating that the
  10037. computer is ready to send or receive information. Most modems
  10038. are configured to hangup if the DTR signal is lowered. This is a
  10039. convenient means of hanging up the modem, but cases problems
  10040. under Windows 95, where the DTR signal is always lowered when a
  10041. program closes the serial port.
  10042. ECHO See "Local Echo".
  10043. FOSSIL The FOSSIL driver, or simply FOSSIL, is a TSR program or
  10044. DRIVER device driver which OpenDoors can optionally make use of in
  10045. order to communicate with the modem. The FOSSIL driver is loaded
  10046. prior to starting up the BBS or your door, usually from the
  10047. AUTOEXEC.BAT or CONFIG.SYS files. The two most commonly used
  10048. FOSSIL drivers are X00 and BNU. (FOSSIL is an acronym for
  10049. "Fido/Opus/SEAdog Standard Interface Layer", although it has now
  10050. become the standard for nearly all BBS software.) FOSSIL drivers
  10051. are also available for other specialized serial port hardware,
  10052. such as the popular "DigiBoard" multi-port serial card.
  10053. IMPORT LIBRARY See "Library".
  10054. ===============================================================================
  10055. OpenDoors 6.00 Manual End of Page 261
  10056. LIBRARY A "library" or "library file" is a collection of precompiled
  10057. functions and variables that can be used by other programs. All
  10058. of the features, capabilities and functions of OpenDoors that
  10059. you can make use of are contained within the OpenDoors library
  10060. files. (Likewise, the C runtime library, consisting of the
  10061. familiar functions such as fopen(), printf() and atoi(), is also
  10062. contained within a library file.) For more information on the
  10063. different OpenDoors library files, see the section that begins
  10064. on page 22.
  10065. There are several different kinds of library files. A static
  10066. library file is actually a collection of individual object
  10067. files. When you compile a program that makes use of a static
  10068. library file, only those portions of the library file that your
  10069. program actually uses are linked into your program's executable
  10070. (.EXE) file. Static library files can be identified by a .LIB
  10071. extension. The DOS version of OpenDoors resides in a static
  10072. library.
  10073. A dynamic link library, on the other hand, is not combined with
  10074. the program's executable file. Instead dynamic link libraries
  10075. exist in separate .DLL files that must also be present when the
  10076. program is executed. The Win32 version of OpenDoors resides in a
  10077. dynamic link library.
  10078. An import library is a small file that describes a dynamic link
  10079. library. The most common way for a program to call functions in
  10080. a dynamic link library requires that an import library be used a
  10081. program link time.
  10082. See also "DLL".
  10083. LINK "Linking" generally refers to the process of combining several
  10084. object files into a final executable file, during which
  10085. references to symbol names (such as od_printf()) are resolved to
  10086. the address of the corresponding object. See also "Compiling".
  10087. LOCAL MODE The term "local mode" refers to a mode in which a BBS system or
  10088. door program may operate. In local mode, the BBS/door behave as
  10089. they would if a user were connected via modem to the BBS, except
  10090. that all display and input is done simply on the BBS software,
  10091. but not through the modem. Local mode allows the sysop or
  10092. another person with direct access to the BBS computer to use the
  10093. BBS/door software, either for their own user, or for testing
  10094. that the software is running correctly. When programming door
  10095. software, local mode can be very useful in testing and debugging
  10096. the door, without requiring the door to be connected to a remote
  10097. system. All doors written with OpenDoors automatically support
  10098. local mode operation. Compare "Remote".
  10099. ===============================================================================
  10100. OpenDoors 6.00 Manual End of Page 262
  10101. LOCAL ECHO The term "Local Echo" refers to a door displaying the same
  10102. characters which are sent to the modem on the local screen
  10103. ("Output Window"). This allows the sysop to view the same
  10104. information that is sent to the user's system, in the same
  10105. manner that it will appear on the user's screen.
  10106. LOCKED (eg. "Locked Baud Rate", "Locked BPS Rate", "Locked Commport
  10107. Speed", etc.) Usually, the communication port to which a modem
  10108. is connected is set to transfer data at the same BPS rate as the
  10109. rate at which the modem is communicating. However, many high
  10110. speed modems allow very high speed data transfer by using built-
  10111. in data compression methods. In this case, the actual rate of
  10112. data transfer can easily exceed the true BPS rate of the
  10113. connection. As a result, the BPS rate of the port is kept a
  10114. single speed, faster than any of the true modem connections, in
  10115. order to increase modem speed performance. This is referred to
  10116. as locking the commport BPS rate. OpenDoors has full support for
  10117. the use of locked BPS rates.
  10118. LOG FILE A log file is a normal text file in which BBS software records
  10119. all major activities that have taken place. As such, the log
  10120. file permits the sysop, to review what activities have taken
  10121. place on the BBS during the time which they have been away from
  10122. the computer. A log file can be helpful in identifying system
  10123. errors or crashes that have occurred, in alerting the sysop in
  10124. the case that any users have been causing problems on the BBS,
  10125. or in simply letting the sysop know who has called recently, and
  10126. what when they did when they called.
  10127. MEMORY MODEL C and C++ programs can be compiled under a variety of different
  10128. memory models. Each memory model describes how data and program
  10129. code are addressed in memory. When writing MS-DOS programs, you
  10130. generally have the choice of six different memory models (named
  10131. tiny, small, compact, medium, large and huge), each of which
  10132. provides a different combination of the maximum sizes of data
  10133. and code that your program may have. When writing Win32
  10134. programs, there is a single, flat 32-bit memory model that all
  10135. programs use. This memory model allows a program to address (in
  10136. theory) up to 4 gigabytes of data and code.
  10137. MODEM A device connected to a computer which permits it to communicate
  10138. with other computers, usually over standard telephone lines.
  10139. ===============================================================================
  10140. OpenDoors 6.00 Manual End of Page 263
  10141. OBJECT FILE An object file contains the compiled version of a source code
  10142. file of a program. The source code file may be a .C file, .CPP
  10143. file, .ASM file, .PAS file, .BAS file, or any number of other
  10144. extensions associated with other programming languages. When any
  10145. of these language's source code files are compiled, a .OBJ file
  10146. is created containing information such as the executable code,
  10147. and names of symbols (variables and functions) that are to be
  10148. shared with other .OBJ files. In order to produce a .EXE file
  10149. that may be executed, a process known as linking must be
  10150. performed. During the link process, one or more object files
  10151. composing your program are combined, along with the necessary
  10152. code from any library files being used, in order to produce the
  10153. final .EXE file.
  10154. ONLINE In the case of BBS software and BBS door programs, the term
  10155. online refers to the state of a user using the BBS. Usually, the
  10156. user will be connected to the BBS from a remote location, using
  10157. a modem. However, it is also possible that the user will be
  10158. using the actual BBS computer, with the software operating in
  10159. "local mode".
  10160. OUTPUT WINDOW The local screen of the BBS on which BBS software is running is
  10161. usually divided into two sections. At the bottom of the screen,
  10162. there is often a one or two line status line, which displays
  10163. information to the sysop about the BBS and the user who is
  10164. currently online. The rest of the screen is usually an "output
  10165. window", in which the information which is being displayed to
  10166. the user, is also displayed on the local screen. In some cases,
  10167. there will be no status line, in which case the entire screen
  10168. will be the output window. Usually, the upper 23 lines of the
  10169. screen in an OpenDoors door will be the output window, with the
  10170. bottom two lines being the status line. However, it is possible
  10171. to disable the OpenDoors status line, in which case the entire
  10172. screen will be the output window. See also "Status Line"
  10173. PAGE See "SYSOP PAGE"
  10174. PARAMETER In the C programming language, many tasks are accomplished by
  10175. calling functions. When a function is called, one or more pieces
  10176. of information may be passed to a function, in the form of
  10177. parameters. For example, a function used to set the foreground
  10178. and background color of displayed text might accept two
  10179. parameters, one for each of the two color settings. In this
  10180. example, a function such as od_set_color(), would be called as
  10181. follows:
  10182. od_set_color(D_GREEN,D_RED);
  10183. ===============================================================================
  10184. OpenDoors 6.00 Manual End of Page 264
  10185. In this case, D_GREEN, the foreground color, is the first
  10186. parameter, and D_RED, the background color, is the second
  10187. parameter.
  10188. In C, parameters are enclosed in parentheses, ( and ), which are
  10189. located after the name of the function to be called. Each
  10190. parameter is then separated by a comma character. If a function
  10191. does not accept any parameters, the parentheses will have
  10192. nothing between them. (ie. od_clr_scr() ).
  10193. REGISTRATION This is a demonstration version of OpenDoors, which may only be
  10194. used under limited circumstances, for a limited period of time.
  10195. If you wish to continue using OpenDoors after this "evaluation
  10196. period", you must "register" it. For more information on
  10197. registering OpenDoors, please see chapter 2 of this manual.
  10198. REMOTE When used in reference to BBS software or door programs, the
  10199. term remote is used to refer to a user or computer that is
  10200. communicating with the BBS, for a distant location, by use of a
  10201. modem. Compare "Local Mode"
  10202. RIP "RIP", "RIPScrip" or "Remote Imaging Protocol" is a popular
  10203. graphical terminal standard that is used with BBS systems.
  10204. Unlike other terminal emulation standards, such as the ANSI and
  10205. AVATAR modes supported by OpenDoors, RIP operates in bit mapped
  10206. graphics mode, allowing features such as lines, circles and
  10207. icons to be drawn on the remote screen. OpenDoors provides
  10208. support for RIP graphics, although OpenDoors operates in text
  10209. mode itself.
  10210. STATUS LINE Usually, the bottom two lines of the screen, as displayed by an
  10211. OpenDoors door, is devoted to a status line (although this
  10212. status line may be turned off). This status line will display
  10213. information about the user who is online, along with information
  10214. about the current state of the BBS system, and a reference to
  10215. the sysop function keys. See also "Local Window".
  10216. SYSOP The term sysop is a short-form for "SYStem OPerator", and refers
  10217. to the individual who is responsible for running and maintaining
  10218. the BBS system. The sysop is usually the only person who has
  10219. direct access to the local keyboard and computer on which the
  10220. BBS, BBS utilities and BBS doors are running.
  10221. SYSOP CHAT See "CHAT MODE".
  10222. ===============================================================================
  10223. OpenDoors 6.00 Manual End of Page 265
  10224. SOURCE CODE The term "source code" refers to the original file or files that
  10225. where used to produce a library or executable program. The
  10226. source code files contain the language statements or commands
  10227. that are directly written by the programmer. These source code
  10228. files are then compiled to produce an executable file that may
  10229. be "run".
  10230. SYSOP PAGE Sysop paging refers to the process whereby a user of the BBS
  10231. system may call or page for the sysop's attention, when they
  10232. wish to "chat" with the sysop, and can be thought of as being
  10233. similar to the ringing of a telephone. When a user pages the
  10234. sysop, the BBS system will produce some sort of sound, which the
  10235. sysop may elect to respond to if they are within hearing range
  10236. of the computer. The most common reasons for a user to page a
  10237. sysop include the case that they are having difficulty with some
  10238. aspect of the BBS, that they have a question, or if they are
  10239. simply interested in having a friendly conversation with the
  10240. sysop. Obviously, since the sysop may not wish to be disturbed
  10241. by users paging at certain times (such as when they are in bed),
  10242. most BBS software provides controls to allow you to control
  10243. paging. These features might include the ability to set hours
  10244. for each day of the week during which paging will be permitted,
  10245. and the ability to temporarily override the ability of some or
  10246. all callers to page the sysop.
  10247. USER When applied to computers in general, the term user simply
  10248. refers to any person using the computer hardware and software.
  10249. However, when applied particularly to BBSes, the term user
  10250. refers specifically to a person who calls the BBS, to carry out
  10251. activities such as communicating via messages or chatting,
  10252. uploading and downloading files, or using doors. Often, the term
  10253. user is used in contrast with the term sysop. In this case,
  10254. users are all of the people who call and user the BBS, other
  10255. than the sysop themselves.
  10256. WIN32 Win32 is the name of the API that programs written to run under
  10257. Microsoft Windows 95 and Microsoft Windows NT use to access
  10258. operating system services. Win32 programs use a flat, 32-bit
  10259. memory model and have access to advanced operating system
  10260. services such as multithreading. Win32 programs cannot run under
  10261. DOS nor OS/2. While some Win32 programs can run under Windows
  10262. 3.x using the Win32s system, OpenDoors cannot since it requires
  10263. multithreading services that are not provided by Win32s.
  10264. ===============================================================================
  10265. OpenDoors 6.00 Manual End of Page 266
  10266. IIIIII
  10267. II
  10268. II
  10269. II
  10270. II
  10271. II
  10272. IIIIII
  10273. -------------------------------------------------------------------------------
  10274. INDEX
  10275. A D
  10276. About This Manual ..................21 Debugging 21, 241
  10277. Access Level ......................178 Demo Version........................9
  10278. Alias .............................170 Display Functions..............42, 63
  10279. ANSI Graphics Displaying Text....30, 41, 42, 60, 62
  10280. Archive Contents ..................248 Door Driver Functions..............40
  10281. ASCII Chart ........................86 Door Driver Module..............6, 40
  10282. ASCII Mode ........................255 Door Functions.....................45
  10283. AVATAR Graphics ....118, 134, 167, 256 Door Information File30, 33, 150, 158
  10284. Door Settings.....................182
  10285. B DORINFOx.DEF File..................33
  10286. DOS Shell.........................192
  10287. Baud Rate .........................154 Download Limit....................169
  10288. BBS Information ...................158
  10289. BBS Name ..........................164 E
  10290. BBS Systems ........................30
  10291. Before Exit Function ..............191 Error Free Connection.............170
  10292. Box Characters ...............185, 191 Example Program - Changing Only
  10293. BPS Rate ..........................154 Foreground/Background Colour ....132
  10294. Built-In Function Keys ............212 Example Program - Choosing Text
  10295. Colour ..........................129
  10296. C Example Program - Clearing A Line..56
  10297. Example Program - Dialog Box.......66
  10298. Caller Information ................158 Example Program - Door And Utility In
  10299. Carrier Detect .................51, 97 One Program ......................92
  10300. Chat ..........................38, 104 Example Program - Drawing A Window118
  10301. Chat Mode ....................104, 259 Example Program - Exiting A Door...79
  10302. Colour Attribute Codes ............128 Example Program - First Door.......29
  10303. Colour Constants ..................132 Example Program - Hanging Up In CBV
  10304. Colour Customization215, 229, 232, 236 Door .............................51
  10305. Colour Functions ...................42 Example Program - Hotkeyed Menu....91
  10306. Colours .................110, 128, 131 Example Program - Input Key.......115
  10307. Common Problems ...................243 Example Program - Setting Door Info
  10308. Compiler Errors ...................243 File Location ...................150
  10309. Compiling With OpenDoors ...........22 Example Program - Shelling To DOS.141
  10310. Custom Function Keys ..............213 Example Program - Terminal Emu.....62
  10311. Example Program - Testing Available
  10312. Door Information ................158
  10313. ===============================================================================
  10314. OpenDoors 6.00 Manual End of Page 267
  10315. Example Program - Testing Screen M
  10316. Clearing Capabilities 57
  10317. Example Program - Transferring A File Memory Models..................23, 24
  10318. Using DSZ........................142 Memory Swapping...................209
  10319. Example Program - User Statistics Modem Port........................157
  10320. Door.............................113 Modem Settings....................153
  10321. Example Program - Vote .............33
  10322. Example Program - Waiting For CR ...54 N
  10323. Exiting A Door Program .............79
  10324. New Version.......................249
  10325. F Node Number.......................152
  10326. Features ............................6 O
  10327. Feedback Form ......................19
  10328. File Display Functions .............44 Object File.......................263
  10329. FILES.BBS File .....................98 od_autodetect() Function...........48
  10330. Fossil Driver .....................260 od_carrier() Function..............51
  10331. FOSSIL port .......................157 od_chat() Function.................50
  10332. Function Keys .................97, 211 od_clear_keybuffer() Function......53
  10333. Future Versions ...................253 od_clr_line() Function.............55
  10334. od_clr_scr() Function.........57, 243
  10335. G od_colour_config() Function........59
  10336. od_control Structure..........31, 148
  10337. Getting In Touch With Us ..........246 od_disable Variable...............198
  10338. Graphics Mode ...........165, 167, 255 od_disp() Function.................60
  10339. od_disp_emu() Function.............62
  10340. H od_disp_str() Function.............63
  10341. od_draw_box() Function.............65
  10342. History ...........................249 od_edit_str() Function.............68
  10343. Hotkeys ............................90 od_exit() Function...31, 79, 191, 195
  10344. od_get_answer() Function...........81
  10345. I od_get_input() Function............82
  10346. od_get_key() Function......30, 53, 85
  10347. IBM Colour Attribute Codes ........128 od_gettext() Function..............89
  10348. IEMSI Session Information .........161 od_hotkey_menu() Function..........90
  10349. Inactivity Timeout ......199, 200, 202 od_init() Function.............31, 92
  10350. Input Functions ............44, 81, 85 od_input_str() Function........53, 95
  10351. od_kernal() Function...............31
  10352. K od_kernel() Function...............97
  10353. od_list_files() Function...........98
  10354. Keyboard Buffer ...........53, 97, 115 od_log_write() Function...........100
  10355. Keys ...............................97 od_multiline_edit() Function......101
  10356. od_page() Function...........104, 207
  10357. L od_parse_cmd_line() Function......105
  10358. od_popup_menu() Function..........107
  10359. Language Customization ............216 od_printf() Function.....29, 110, 195
  10360. Learning OpenDoors .................29 od_putch() Function...............115
  10361. Library ...........................261 od_puttext() Function.............116
  10362. LIBrary Files ......................24 od_repeat() Function..............118
  10363. Line Number .......................152 od_restore_screen() Function......120
  10364. Linking ............................23 od_save_screen() Function.........121
  10365. Local Mode ...............33, 200, 261 od_scroll() Function..............123
  10366. Locked ............................262 od_send_file() Function...........124
  10367. od_set_attrib() Function..........128
  10368. ===============================================================================
  10369. OpenDoors 6.00 Manual End of Page 268
  10370. od_set_color() Function ...........131 Solutions To Problems.............243
  10371. od_set_cursor() Function ..........134 Source Code................10, 17, 20
  10372. od_set_dtr() Function .............135 Special Thanks....................254
  10373. od_set_personality() Function .....136 Status Line...104, 137, 209, 210, 264
  10374. od_set_statusline() Function ......137 Stop Key..........................203
  10375. od_sleep() Function ...............139 Support...........................244
  10376. od_spawn Function .................208 Support BBS.............244, 245, 246
  10377. od_spawn() Function ...............141 Swapping..........................209
  10378. od_spawnvpe() Function ............143 Sysop Chat...............38, 104, 192
  10379. od_window_create() Function .......145 Sysop Function Keys...............211
  10380. od_window_remove() Function ..147, 148 Sysop Keys.........................97
  10381. OPENDOOR.H File ............22, 29, 34 Sysop Name........................164
  10382. OpenDoors BBS ................244, 245 Sysop Next Setting................184
  10383. OpenDoors Customization ...........187 Sysop Page........................207
  10384. OPENDOORS Echo ....................245 Sysop Paging.................104, 265
  10385. OpenDoors History .................249 System Event......................162
  10386. Our Address .......................246 System Name.......................164
  10387. Output Functions ...................42
  10388. Output Window .................34, 263 T
  10389. P Terminal Emulator........62, 124, 125
  10390. Terminal Emulator Control Codes...126
  10391. Paging Hours .................182, 183 Text Customization................216
  10392. Paging The Sysop ..................104 Thank-yous........................254
  10393. Pause Key .........................203 Time Left.........................179
  10394. Phone Number ......................171 Timeout............................97
  10395. Printing ..30, 41, 60-63, 90, 110, 115 Troubleshooting....................21
  10396. Printing Manual ....................22
  10397. Problems ...........................21 U
  10398. Product Support ...................244
  10399. Project Files ......................23 User Handle (Alias)...............170
  10400. User Information..................158
  10401. R User Keyboard Off Key..............53
  10402. User Keyboard Setting.............184
  10403. Registration ..9, 10, 12, 18, 246, 264 User Name.........................174
  10404. Registration Form ..............15, 18 User Password.....................176
  10405. RIP ...............................264 User Timeout.......................97
  10406. RIPScrip ..........................264
  10407. V
  10408. S
  10409. Version History...................249
  10410. Screen Functions ...................42
  10411. Screen Length .....................177 W
  10412. Screen Width ......................178
  10413. Security Level ....................178 Want-Chat Setting.................180
  10414. Setting Colours .........110, 128, 131
  10415. ===============================================================================
  10416. OpenDoors 6.00 Manual End of Page 269