ckcdeb.h 141 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677
  1. /* C K C D E B . H */
  2. /*
  3. Sat Sep 19 15:22:06 2020
  4. NOTE TO CONTRIBUTORS: This file, and all the other C-Kermit files, must be
  5. compatible with C preprocessors that support only #ifdef, #else, #endif,
  6. #define, and #undef. Please do not use #if, logical operators, or other
  7. later-model preprocessor features in any of the portable C-Kermit modules.
  8. You can, of course, use these constructions in platform-specific modules
  9. when you know they are supported.
  10. */
  11. /*
  12. This file is included by all C-Kermit modules, including the modules
  13. that aren't specific to Kermit (like the command parser and the ck?tio and
  14. ck?fio modules). It should be included BEFORE any other C-Kermit header
  15. files. It specifies format codes for debug(), tlog(), and similar
  16. functions, and includes any necessary definitions to be used by all C-Kermit
  17. modules, and also includes some feature selection compile-time switches, and
  18. also system- or compiler-dependent definitions, plus #includes and prototypes
  19. required by all C-Kermit modules.
  20. */
  21. /*
  22. Author: Frank da Cruz <fdc@columbia.edu>,
  23. Columbia University Academic Information Systems, New York City.
  24. Copyright (C) 1985, 2020,
  25. Trustees of Columbia University in the City of New York.
  26. All rights reserved. See the C-Kermit COPYING.TXT file or the
  27. copyright text in the ckcmai.c module for disclaimer and permissions.
  28. */
  29. /*
  30. Etymology: The name of this file means "C-Kermit Common-C-Language Debugging
  31. Header", because originally it contained only the formats (F000-F111) for
  32. the debug() and tlog() functions. Since then it has grown to include all
  33. material required by all other C-Kermit modules, including the non-Kermit
  34. specific ones. In other words, this is the one header file that is
  35. guaranteed to be included by all C-Kermit source modules.
  36. */
  37. #ifndef CKCDEB_H /* Don't include me more than once. */
  38. #define CKCDEB_H
  39. #ifdef OS2
  40. #include "ckoker.h"
  41. #else /* OS2 */
  42. /* Unsigned numbers */
  43. #ifndef USHORT
  44. #define USHORT unsigned short
  45. #endif /* USHORT */
  46. #ifndef UINT
  47. #define UINT unsigned int
  48. #endif /* UINT */
  49. #ifndef ULONG
  50. #define ULONG unsigned long
  51. #endif /* ULONG */
  52. #endif /* OS2 */
  53. #ifdef MACOSX10 /* Mac OS X 1.0 */
  54. #ifndef MACOSX /* implies Mac OS X */
  55. #define MACOSX
  56. #endif /* MACOSX */
  57. #endif /* MACOSX10 */
  58. #ifdef MACOSX /* Mac OS X */
  59. #ifndef BSD44 /* implies 4.4 BSD */
  60. #define BSD44
  61. #endif /* BSD44 */
  62. #endif /* MACOSX */
  63. #ifdef SCO_OSR505 /* SCO 3.2v5.0.5 */
  64. #ifndef SCO_OSR504 /* implies SCO 3.2v5.0.4 */
  65. #define SCO_OSR504
  66. #endif /* SCO_OSR504 */
  67. #endif /* SCO_OSR505 */
  68. #ifdef SCO_OSR504 /* SCO 3.2v5.0.4 */
  69. #ifndef CK_SCOV5 /* implies SCO 3.2v5.0 */
  70. #define CK_SCOV5
  71. #endif /* CK_SCOV5 */
  72. #include <sys/types.h> /* To sidestep header-file mess */
  73. #endif /* SCO_OSR504 */
  74. #ifdef CK_SCOV5
  75. #ifndef ANYSCO
  76. #define ANYSCO
  77. #endif /* ANYSCO */
  78. #endif /* CK_SCOV5 */
  79. #ifdef UNIXWARE
  80. #ifndef ANYSCO
  81. #define ANYSCO
  82. #endif /* ANYSCO */
  83. #endif /* UNIXWARE */
  84. #ifndef MINIX /* Minix versions */
  85. #ifdef MINIX315
  86. #define MINIX
  87. #else
  88. #ifdef MINIX3
  89. #define MINIX
  90. #else
  91. #ifdef MINIX2
  92. #define MINIX
  93. #endif /* MINIX2 */
  94. #endif /* MINIX3 */
  95. #endif /* MINIX315 */
  96. #endif /* MINIX */
  97. #ifdef CK_SCO32V4 /* SCO 3.2v4 */
  98. #ifndef ANYSCO
  99. #define ANYSCO
  100. #endif /* ANYSCO */
  101. #ifndef XENIX
  102. #define XENIX
  103. #endif /* XENIX */
  104. #ifndef SVR3
  105. #define SVR3
  106. #endif /* SVR3 */
  107. #ifndef DIRENT
  108. #define DIRENT
  109. #endif /* DIRENT */
  110. #ifndef RENAME
  111. #define RENAME
  112. #endif /* RENAME */
  113. #ifndef SVR3JC
  114. #define SVR3JC
  115. #endif /* SVR3JC */
  116. #ifndef CK_RTSCTS
  117. #define CK_RTSCTS
  118. #endif /* CK_RTSCTS */
  119. #ifndef PID_T
  120. #define PID_T pid_t
  121. #endif /* PID_T */
  122. #ifndef PWID_T
  123. #define PWID_T int
  124. #endif /* PWID_T */
  125. #endif /* CK_SCO32V4 */
  126. #ifdef NOICP /* If no command parser */
  127. #ifndef NOSPL /* Then no script language either */
  128. #define NOSPL
  129. #endif /* NOSPL */
  130. #ifndef NOCSETS /* Or characer sets */
  131. #define NOCSETS
  132. #endif /* NOCSETS */
  133. #ifndef NOFTP /* Or FTP client */
  134. #define NOFTP
  135. #endif /* NOFTP */
  136. #endif /* NOICP */
  137. /* Built-in makefile entries */
  138. #ifdef SOLARIS11 /* Solaris 11 implies 10 */
  139. #ifndef SOLARIS10
  140. #define SOLARIS10
  141. #endif /* SOLARIS10 */
  142. #endif /* SOLARIS11 */
  143. #ifdef SOLARIS10 /* Solaris 10 implies 9 */
  144. #ifndef SOLARIS9
  145. #define SOLARIS9
  146. #endif /* SOLARIS9 */
  147. #endif /* SOLARIS10 */
  148. #ifdef SOLARIS9 /* Solaris 9 implies 8 */
  149. #ifndef SOLARIS8
  150. #define SOLARIS8
  151. #endif /* SOLARIS8 */
  152. #endif /* SOLARIS9 */
  153. #ifdef SOLARIS8 /* Solaris 8 implies 7 */
  154. #ifndef SOLARIS7
  155. #define SOLARIS7
  156. #endif /* SOLARIS7 */
  157. #endif /* SOLARIS8 */
  158. #ifdef SOLARIS7 /* Solaris 7 implies 2.6 */
  159. #ifndef SOLARIS26
  160. #define SOLARIS26
  161. #endif /* SOLARIS26 */
  162. #endif /* SOLARIS7 */
  163. #ifdef SOLARIS26 /* Solaris 2.6 implies 2.5 */
  164. #ifndef SOLARIS25
  165. #define SOLARIS25
  166. #endif /* SOLARIS25 */
  167. #endif /* SOLARIS26 */
  168. #ifdef SOLARIS25 /* Solaris 2.5 implies Solaris */
  169. #ifndef SOLARIS
  170. #define SOLARIS
  171. #endif /* SOLARIS */
  172. #ifndef POSIX /* And POSIX */
  173. #define POSIX
  174. #endif /* POSIX */
  175. #ifndef CK_WREFRESH /* And this (curses) */
  176. #define CK_WREFRESH
  177. #endif /* CK_WREFRESH */
  178. #endif /* SOLARIS25 */
  179. #ifdef SOLARIS24 /* Solaris 2.4 implies Solaris */
  180. #ifndef SOLARIS
  181. #define SOLARIS
  182. #endif /* SOLARIS */
  183. #endif /* SOLARIS24 */
  184. #ifdef SOLARIS /* Solaris gets "POSIX" RTS/CTS API */
  185. #ifdef POSIX
  186. #ifndef POSIX_CRTSCTS
  187. #define POSIX_CRTSCTS
  188. #endif /* POSIX_CRTSCTS */
  189. #endif /* POSIX */
  190. #ifndef SVR4
  191. #define SVR4
  192. #endif /* SVR4 */
  193. #ifndef STERMIOX
  194. #define STERMIOX
  195. #endif /* STERMIOX */
  196. #ifndef SELECT
  197. #define SELECT
  198. #endif /* SELECT */
  199. #ifndef FNFLOAT
  200. #define FNFLOAT
  201. #endif /* FNFLOAT */
  202. #ifndef DIRENT
  203. #define DIRENT
  204. #endif /* DIRENT */
  205. #ifndef BIGBUFOK
  206. #define BIGBUFOK
  207. #endif /* BIGBUFOK */
  208. #ifndef CK_NEWTERM
  209. #define CK_NEWTERM
  210. #endif /* CK_NEWTERM */
  211. #endif /* SOLARIS */
  212. #ifdef SUN4S5 /* Sun-4 System V environment */
  213. #ifndef SVR3 /* implies System V R3 or later */
  214. #define SVR3
  215. #endif /* SVR3 */
  216. #endif /* SUN4S5 */
  217. #ifdef SUNOS41 /* SUNOS41 implies SUNOS4 */
  218. #ifndef SUNOS4
  219. #define SUNOS4
  220. #endif /* SUNOS4 */
  221. #endif /* SUNOS41 */
  222. #ifdef SUN4S5 /* Sun-4 System V environment */
  223. #ifndef SVR3 /* implies System V R3 or later */
  224. #define SVR3
  225. #endif /* SVR3 */
  226. #endif /* SUN4S5 */
  227. #ifdef SUNOS41 /* SUNOS41 implies SUNOS4 */
  228. #ifndef SUNOS4
  229. #define SUNOS4
  230. #endif /* SUNOS4 */
  231. #endif /* SUNOS41 */
  232. #ifdef SUNOS4 /* Built-in SUNOS4 makefile entry */
  233. #ifndef UNIX
  234. #define UNIX
  235. #endif /* UNIX */
  236. #ifndef BSD4
  237. #define BSD4
  238. #endif /* BSD4 */
  239. #ifndef NOSETBUF
  240. #define NOSETBUF
  241. #endif /* NOSETBUF */
  242. #ifndef DIRENT
  243. #define DIRENT
  244. #endif /* DIRENT */
  245. #ifndef NONET
  246. #ifndef TCPSOCKET
  247. #define TCPSOCKET
  248. #endif /* TCPSOCKET */
  249. #endif /* NONET */
  250. #ifndef SAVEDUID
  251. #define SAVEDUID
  252. #endif /* SAVEDUID */
  253. #ifndef DYNAMIC
  254. #define DYNAMIC
  255. #endif /* DYNAMIC */
  256. #endif /* SUNOS4 */
  257. #ifdef SOLARIS /* Built in makefile entry */
  258. #ifndef NOSETBUF /* for Solaris 2.x */
  259. #define NOSETBUF
  260. #endif /* NOSETBUF */
  261. #ifndef NOCURSES
  262. #ifndef CK_CURSES
  263. #define CK_CURSES
  264. #endif /* CK_CURSES */
  265. #endif /* NOCURSES */
  266. #ifndef CK_NEWTERM
  267. #define CK_NEWTERM
  268. #endif /* CK_NEWTERM */
  269. #ifndef DIRENT
  270. #define DIRENT
  271. #endif /* DIRENT */
  272. #ifndef NONET
  273. #ifndef TCPSOCKET
  274. #define TCPSOCKET
  275. #endif /* TCPSOCKET */
  276. #endif /* NONET */
  277. #ifndef UNIX
  278. #define UNIX
  279. #endif /* UNIX */
  280. #ifndef SVR4
  281. #define SVR4
  282. #endif /* SVR4 */
  283. #ifndef HADDRLIST
  284. #define HADDRLIST
  285. #endif /* HADDRLIST */
  286. #ifndef STERMIOX
  287. #define STERMIOX
  288. #endif /* STERMIOX */
  289. #ifndef SELECT
  290. #define SELECT
  291. #endif /* SELECT */
  292. #ifndef DYNAMIC
  293. #define DYNAMIC
  294. #endif /* DYNAMIC */
  295. #ifndef NOUUCP
  296. #ifndef HDBUUCP
  297. #define HDBUUCP
  298. #endif /* HDBUUCP */
  299. #endif /* NOUUCP */
  300. #endif /* SOLARIS */
  301. /* Features that can be eliminated from a no-file-transfer version */
  302. #ifdef NOXFER
  303. #ifndef NOFTP
  304. #define NOFTP
  305. #endif /* NOFTP */
  306. #ifndef OS2
  307. #ifndef NOCURSES /* Fullscreen file-transfer display */
  308. #define NOCURSES
  309. #endif /* NOCURSES */
  310. #endif /* OS2 */
  311. #ifndef NOCKXYZ /* XYZMODEM support */
  312. #define NOCKXYZ
  313. #endif /* NOCKXYZ */
  314. #ifndef NOCKSPEED /* Ctrl-char unprefixing */
  315. #define NOCKSPEED
  316. #endif /* NOCKSPEED */
  317. #ifndef NOSERVER /* Server mode */
  318. #define NOSERVER
  319. #endif /* NOSERVER */
  320. #ifndef NOCKTIMERS /* Dynamic packet timers */
  321. #define NOCKTIMERS
  322. #endif /* NOCKTIMERS */
  323. #ifndef NOPATTERNS /* File-type patterns */
  324. #define NOPATTERNS
  325. #endif /* NOPATTERNS */
  326. #ifndef NOSTREAMING /* Streaming */
  327. #define NOSTREAMING
  328. #endif /* NOSTREAMING */
  329. #ifndef NOIKSD /* Internet Kermit Service */
  330. #define NOIKSD
  331. #endif /* NOIKSD */
  332. #ifndef NOPIPESEND /* Sending from pipes */
  333. #define NOPIPESEND
  334. #endif /* NOPIPESEND */
  335. #ifndef NOAUTODL /* Autodownload */
  336. #define NOAUTODL
  337. #endif /* NOAUTODL */
  338. #ifndef NOMSEND /* MSEND */
  339. #define NOMSEND
  340. #endif /* NOMSEND */
  341. #ifndef NOTLOG /* Transaction logging */
  342. #define NOTLOG
  343. #endif /* NOTLOG */
  344. #ifndef NOCKXXCHAR /* Packet character doubling */
  345. #define NOCKXXCHAR
  346. #endif /* NOCKXXCHAR */
  347. #endif /* NOXFER */
  348. #ifdef NOICP /* No Interactive Command Parser */
  349. #ifndef NODIAL /* Implies No DIAL command */
  350. #define NODIAL
  351. #endif /* NODIAL */
  352. #ifndef NOCKXYZ /* and no external protocols */
  353. #define NOCKXYZ
  354. #endif /* NOCKXYZ */
  355. #endif /* NOICP */
  356. #ifndef NOIKSD
  357. #ifdef IKSDONLY
  358. #ifndef IKSD
  359. #define IKSD
  360. #endif /* IKSD */
  361. #ifndef NOLOCAL
  362. #define NOLOCAL
  363. #endif /* NOLOCAL */
  364. #ifndef NOPUSH
  365. #define NOPUSH
  366. #endif /* NOPUSH */
  367. #ifndef TNCODE
  368. #define TNCODE
  369. #endif /* TNCODE */
  370. #ifndef TCPSOCKET
  371. #define TCPSOCKET
  372. #endif /* TCPSOCKET */
  373. #ifndef NETCONN
  374. #define NETCONN
  375. #endif /* NETCONN */
  376. #ifdef SUNX25
  377. #undef SUNX25
  378. #endif /* SUNX25 */
  379. #ifdef IBMX25
  380. #undef IBMX25
  381. #endif /* IBMX25 */
  382. #ifdef STRATUSX25
  383. #undef STRATUSX25
  384. #endif /* STRATUSX25 */
  385. #ifdef CK_NETBIOS
  386. #undef CK_NETBIOS
  387. #endif /* CK_NETBIOS */
  388. #ifdef SUPERLAT
  389. #undef SUPERLAT
  390. #endif /* SUPERLAT */
  391. #ifdef NPIPE
  392. #undef NPIPE
  393. #endif /* NPIPE */
  394. #ifdef NETFILE
  395. #undef NETFILE
  396. #endif /* NETFILE */
  397. #ifdef NETCMD
  398. #undef NETCMD
  399. #endif /* NETCMD */
  400. #ifdef NETPTY
  401. #undef NETPTY
  402. #endif /* NETPTY */
  403. #ifdef RLOGCODE
  404. #undef RLOGCODE
  405. #endif /* RLOGCODE */
  406. #ifdef NETDLL
  407. #undef NETDLL
  408. #endif /* NETDLL */
  409. #ifndef NOSSH
  410. #undef NOSSH
  411. #endif /* NOSSH */
  412. #ifndef NOFORWARDX
  413. #define NOFORWARDX
  414. #endif /* NOFORWARDX */
  415. #ifndef NOBROWSER
  416. #define NOBROWSER
  417. #endif /* NOBROWSER */
  418. #ifndef NOHTTP
  419. #define NOHTTP
  420. #endif /* NOHTTP */
  421. #ifndef NOFTP
  422. #define NOFTP
  423. #endif /* NOFTP */
  424. #ifndef NO_COMPORT
  425. #define NO_COMPORT
  426. #endif /* NO_COMPORT */
  427. #endif /* IKSDONLY */
  428. #endif /* NOIKSD */
  429. /* Features that can be eliminated from a remote-only version */
  430. #ifdef NOLOCAL
  431. #ifndef NOFTP
  432. #define NOFTP
  433. #endif /* NOFTP */
  434. #ifndef NOHTTP
  435. #define NOHTTP
  436. #endif /* NOHTTP */
  437. #ifndef NOSSH
  438. #define NOSSH
  439. #endif /* NOSSH */
  440. #ifndef NOTERM
  441. #define NOTERM
  442. #endif /* NOTERM */
  443. #ifndef NOCURSES /* Fullscreen file-transfer display */
  444. #define NOCURSES
  445. #endif /* NOCURSES */
  446. #ifndef NODIAL
  447. #define NODIAL
  448. #endif /* NODIAL */
  449. #ifndef NOSCRIPT
  450. #define NOSCRIPT
  451. #endif /* NOSCRIPT */
  452. #ifndef NOSETKEY
  453. #define NOSETKEY
  454. #endif /* NOSETKEY */
  455. #ifndef NOKVERBS
  456. #define NOKVERBS
  457. #endif /* NOKVERBS */
  458. #ifndef NOXMIT
  459. #define NOXMIT
  460. #endif /* NOXMIT */
  461. #ifdef CK_CURSES
  462. #undef CK_CURSES
  463. #endif /* CK_CURSES */
  464. #ifndef IKSDONLY
  465. #ifndef NOAPC
  466. #define NOAPC
  467. #endif /* NOAPC */
  468. #ifndef NONET
  469. #define NONET
  470. #endif /* NONET */
  471. #endif /* IKSDONLY */
  472. #endif /* NOLOCAL */
  473. #ifdef NONET
  474. #ifdef NETCONN
  475. #undef NETCONN
  476. #endif /* NETCONN */
  477. #ifdef TCPSOCKET
  478. #undef TCPSOCKET
  479. #endif /* TCPSOCKET */
  480. #ifndef NOTCPOPTS
  481. #define NOTCPOPTS
  482. #endif /* NOTCPOPTS */
  483. #ifdef SUNX25
  484. #undef SUNX25
  485. #endif /* SUNX25 */
  486. #ifdef IBMX25
  487. #undef IBMX25
  488. #endif /* IBMX25 */
  489. #ifdef STRATUSX25
  490. #undef STRATUSX25
  491. #endif /* STRATUSX25 */
  492. #ifdef CK_NETBIOS
  493. #undef CK_NETBIOS
  494. #endif /* CK_NETBIOS */
  495. #ifdef SUPERLAT
  496. #undef SUPERLAT
  497. #endif /* SUPERLAT */
  498. #ifdef NPIPE
  499. #undef NPIPE
  500. #endif /* NPIPE */
  501. #ifdef NETFILE
  502. #undef NETFILE
  503. #endif /* NETFILE */
  504. #ifdef NETCMD
  505. #undef NETCMD
  506. #endif /* NETCMD */
  507. #ifdef NETPTY
  508. #undef NETPTY
  509. #endif /* NETPTY */
  510. #ifdef RLOGCODE
  511. #undef RLOGCODE
  512. #endif /* RLOGCODE */
  513. #ifdef NETDLL
  514. #undef NETDLL
  515. #endif /* NETDLL */
  516. #ifndef NOSSH
  517. #define NOSSH
  518. #endif /* NOSSH */
  519. #ifndef NOFTP
  520. #define NOFTP
  521. #endif /* NOFTP */
  522. #ifndef NOHTTP
  523. #define NOHTTP
  524. #endif /* NOHTTP */
  525. #ifndef NOBROWSER
  526. #define NOBROWSER
  527. #endif /* NOBROWSER */
  528. #ifndef NOFORWARDX
  529. #define NOFORWARDX
  530. #endif /* NOFORWARDX */
  531. #endif /* NONET */
  532. #ifdef IKSDONLY
  533. #ifdef SUNX25
  534. #undef SUNX25
  535. #endif /* SUNX25 */
  536. #ifdef IBMX25
  537. #undef IBMX25
  538. #endif /* IBMX25 */
  539. #ifdef STRATUSX25
  540. #undef STRATUSX25
  541. #endif /* STRATUSX25 */
  542. #ifdef CK_NETBIOS
  543. #undef CK_NETBIOS
  544. #endif /* CK_NETBIOS */
  545. #ifdef SUPERLAT
  546. #undef SUPERLAT
  547. #endif /* SUPERLAT */
  548. #ifdef NPIPE
  549. #undef NPIPE
  550. #endif /* NPIPE */
  551. #ifdef NETFILE
  552. #undef NETFILE
  553. #endif /* NETFILE */
  554. #ifdef NETCMD
  555. #undef NETCMD
  556. #endif /* NETCMD */
  557. #ifdef NETPTY
  558. #undef NETPTY
  559. #endif /* NETPTY */
  560. #ifdef RLOGCODE
  561. #undef RLOGCODE
  562. #endif /* RLOGCODE */
  563. #ifdef NETDLL
  564. #undef NETDLL
  565. #endif /* NETDLL */
  566. #ifndef NOSSH
  567. #define NOSSH
  568. #endif /* NOSSH */
  569. #ifndef NOHTTP
  570. #define NOHTTP
  571. #endif /* NOHTTP */
  572. #ifndef NOBROWSER
  573. #define NOBROWSER
  574. #endif /* NOBROWSER */
  575. #endif /* IKSDONLY */
  576. /*
  577. Note that none of the above precludes TNCODE, which can be defined in
  578. the absence of TCPSOCKET, etc, to enable server-side Telnet negotation.
  579. */
  580. #ifndef TNCODE /* This is for the benefit of */
  581. #ifdef TCPSOCKET /* modules that might need TNCODE */
  582. #define TNCODE /* not all of ckcnet.h... */
  583. #endif /* TCPSOCKET */
  584. #endif /* TNCODE */
  585. #ifndef NETCONN
  586. #ifdef TCPSOCKET
  587. #define NETCONN
  588. #endif /* TCPSOCKET */
  589. #endif /* NETCONN */
  590. #ifndef DEFPAR /* Default parity */
  591. #define DEFPAR 0 /* Must be here because it is used */
  592. #endif /* DEFPAR */ /* by all classes of modules */
  593. #ifdef NT
  594. #ifndef OS2ORWIN32
  595. #define OS2ORWIN32
  596. #endif /* OS2ORWIN32 */
  597. #ifndef OS2
  598. #define WIN32ONLY
  599. #endif /* OS2 */
  600. #endif /* NT */
  601. #ifdef OS2 /* For OS/2 debugging */
  602. #ifndef OS2ORWIN32
  603. #define OS2ORWIN32
  604. #endif /* OS2ORWIN32 */
  605. #ifdef NT
  606. #define NOCRYPT
  607. #include <windows.h>
  608. #define NTSIG
  609. #else /* NT */
  610. #define OS2ONLY
  611. #include <os2def.h>
  612. #endif /* NT */
  613. #ifndef OS2ORUNIX
  614. #define OS2ORUNIX
  615. #endif /* OS2ORUNIX */
  616. #ifndef OS2ORVMS
  617. #define OS2ORVMS
  618. #endif /* OS2ORVMS */
  619. #endif /* OS2 */
  620. #include <stdio.h> /* Begin by including this. */
  621. #include <ctype.h> /* and this. */
  622. #ifdef VMS
  623. #include <types.h> /* Ensure off_t. */
  624. #include "ckvrms.h" /* Get NAMDEF NAMX_C_MAXRSS. */
  625. #endif /* def VMS */
  626. /* System-type compilation switches */
  627. #ifdef FT21 /* Fortune For:Pro 2.1 implies 1.8 */
  628. #ifndef FT18
  629. #define FT18
  630. #endif /* FT18 */
  631. #endif /* FT21 */
  632. #ifdef __bsdi__
  633. #ifndef BSDI
  634. #define BSDI
  635. #endif /* BSDI */
  636. #endif /* __bsdi__ */
  637. #ifdef AIXPS2 /* AIXPS2 implies AIX370 */
  638. #ifndef AIX370
  639. #define AIX370
  640. #endif /* AIX370 */
  641. #endif /* AIXPS2 */
  642. #ifdef AIX370 /* AIX PS/2 or 370 implies BSD4 */
  643. #ifndef BSD4
  644. #define BSD4
  645. #endif /* BSD4 */
  646. #endif /* AIX370 */
  647. #ifdef AIXESA /* AIX/ESA implies BSD4.4 */
  648. #ifndef BSD44
  649. #define BSD44
  650. #endif /* BSD44 */
  651. #endif /* AIXESA */
  652. #ifdef AIX53 /* AIX53 implies AIX52 */
  653. #ifndef AIX52
  654. #define AIX52
  655. #endif /* AIX52 */
  656. #endif /* AIX53 */
  657. #ifdef AIX52 /* AIX52 implies AIX51 */
  658. #ifndef AIX51
  659. #define AIX51
  660. #endif /* AIX51 */
  661. #endif /* AIX52 */
  662. #ifdef AIX51 /* AIX51 implies AIX50 */
  663. #ifndef AIX50
  664. #define AIX50
  665. #endif /* AIX50 */
  666. #endif /* AIX51 */
  667. #ifdef AIX50 /* AIX50 implies AIX45 */
  668. #ifndef AIX45
  669. #define AIX45
  670. #endif /* AIX45 */
  671. #endif /* AIX50 */
  672. #ifdef AIX45 /* AIX45 implies AIX44 */
  673. #ifndef AIX44
  674. #define AIX44
  675. #endif /* AIX44 */
  676. #endif /* AIX45 */
  677. #ifdef AIX44 /* AIX44 implies AIX43 */
  678. #ifndef AIX43
  679. #define AIX43
  680. #endif /* AIX43 */
  681. #endif /* AIX44 */
  682. #ifdef AIX43 /* AIX43 implies AIX42 */
  683. #ifndef AIX42
  684. #define AIX42
  685. #endif /* AIX42 */
  686. #endif /* AIX43 */
  687. #ifdef AIX42 /* AIX42 implies AIX41 */
  688. #ifndef AIX41
  689. #define AIX41
  690. #endif /* AIX41 */
  691. #endif /* AIX42 */
  692. #ifdef SV68R3V6 /* System V/68 R32V6 implies SVR3 */
  693. #ifndef SVR3
  694. #define SVR3
  695. #endif /* SVR3 */
  696. #endif /* SV68R3V6 */
  697. #ifdef SV88R32 /* System V/88 R32 implies SVR3 */
  698. #ifndef SVR3
  699. #define SVR3
  700. #endif /* SVR3 */
  701. #endif /* SV88R32 */
  702. #ifdef DGUX540 /* DG UX 5.40 implies Sys V R 4 */
  703. #ifndef SVR4
  704. #define SVR4
  705. #endif /* SVR4 */
  706. #endif /* DGUX540 */
  707. #ifndef DGUX
  708. #ifdef DGUX540 /* DG/UX 5.40 implies DGUX */
  709. #define DGUX
  710. #else
  711. #ifdef DGUX430 /* So does DG/UX 4.30 */
  712. #define DGUX
  713. #endif /* DGUX430 */
  714. #endif /* DGUX540 */
  715. #endif /* DGUX */
  716. #ifdef IRIX65 /* IRIX 6.5 implies IRIX 6.4 */
  717. #ifndef IRIX64
  718. #define IRIX64
  719. #endif /* IRIX64 */
  720. #endif /* IRIX65 */
  721. #ifdef IRIX64 /* IRIX 6.4 implies IRIX 6.2 */
  722. #ifndef BSD44ORPOSIX
  723. #define BSD44ORPOSIX /* for ckutio's benefit */
  724. #endif /* BSD44ORPOSIX */
  725. #ifndef IRIX62
  726. #define IRIX62
  727. #endif /* IRIX62 */
  728. #endif /* IRIX64 */
  729. #ifdef IRIX62 /* IRIX 6.2 implies IRIX 6.0 */
  730. #ifndef IRIX60
  731. #define IRIX60
  732. #endif /* IRIX60 */
  733. #endif /* IRIX62 */
  734. #ifdef IRIX60 /* IRIX 6.0 implies IRIX 5.1 */
  735. #ifndef IRIX51
  736. #define IRIX51
  737. #endif /* IRIX51 */
  738. #ifndef IRIX52 /* And IRIX 5.2 (for hwfc) */
  739. #define IRIX52
  740. #endif /* IRIX52 */
  741. #endif /* IRIX60 */
  742. #ifndef IRIX /* IRIX 4.0 or greater implies IRIX */
  743. #ifdef IRIX64
  744. #define IRIX
  745. #else
  746. #ifdef IRIX62
  747. #define IRIX
  748. #else
  749. #ifdef IRIX60
  750. #define IRIX
  751. #else
  752. #ifdef IRIX51
  753. #define IRIX
  754. #else
  755. #ifdef IRIX40
  756. #define IRIX
  757. #endif /* IRIX40 */
  758. #endif /* IRIX51 */
  759. #endif /* IRIX60 */
  760. #endif /* IRIX62 */
  761. #endif /* IRIX64 */
  762. #endif /* IRIX */
  763. #ifdef MIPS /* MIPS System V environment */
  764. #ifndef SVR3 /* implies System V R3 or later */
  765. #define SVR3
  766. #endif /* SVR3 */
  767. #endif /* MIPS */
  768. #ifdef HPUX9 /* HP-UX 9.x */
  769. #ifndef SVR3
  770. #define SVR3
  771. #endif /* SVR3 */
  772. #ifndef HPUX
  773. #define HPUX
  774. #endif /* HPUX */
  775. #ifndef HPUX9PLUS
  776. #define HPUX9PLUS
  777. #endif /* HPUX9PLUS */
  778. #endif /* HPUX9 */
  779. #ifdef HPUX10 /* HP-UX 10.x */
  780. #ifndef HPUX1010 /* If anything higher is defined */
  781. #ifdef HPUX1020 /* define HPUX1010 too. */
  782. #define HPUX1010
  783. #endif /* HPUX1020 */
  784. #ifdef HPUX1030
  785. #define HPUX1010
  786. #endif /* HPUX1030 */
  787. #endif /* HPUX1010 */
  788. #ifdef HPUX1100 /* HP-UX 11.00 implies 10.10 */
  789. #ifndef HPUX1010
  790. #define HPUX1010
  791. #endif /* HPUX1010 */
  792. #endif /* HPUX1100 */
  793. #ifndef SVR4
  794. #define SVR4
  795. #endif /* SVR4 */
  796. #ifndef HPUX
  797. #define HPUX
  798. #endif /* HPUX */
  799. #ifndef HPUX9PLUS
  800. #define HPUX9PLUS
  801. #endif /* HPUX9PLUS */
  802. #endif /* HPUX10 */
  803. #ifdef QNX /* QNX Software Systems Inc */
  804. #ifndef POSIX /* QNX 4.0 or later is POSIX */
  805. #define POSIX
  806. #endif /* POSIX */
  807. #ifndef __386__ /* Comes in 16-bit and 32-bit */
  808. #define __16BIT__
  809. #define CK_QNX16
  810. #else
  811. #define __32BIT__
  812. #define CK_QNX32
  813. #endif /* __386__ */
  814. #endif /* QNX */
  815. /*
  816. 4.4BSD is a mixture of System V R4, POSIX, and 4.3BSD.
  817. */
  818. #ifdef BSD44 /* 4.4 BSD */
  819. #ifndef SVR4 /* BSD44 implies SVR4 */
  820. #define SVR4
  821. #endif /* SVR4 */
  822. #ifndef NOSETBUF /* NOSETBUF is safe */
  823. #define NOSETBUF
  824. #endif /* NOSETBUF */
  825. #ifndef DIRENT /* Uses <dirent.h> */
  826. #define DIRENT
  827. #endif /* DIRENT */
  828. #endif /* BSD44 */
  829. #ifdef OPENBSD /* OpenBSD might or might not */
  830. #ifndef __OpenBSD__ /* have this defined... */
  831. #define __OpenBSD__
  832. #endif /* __OpenBSD__ */
  833. #endif /* OPENBSD */
  834. #ifdef SVR3 /* SVR3 implies ATTSV */
  835. #ifndef ATTSV
  836. #define ATTSV
  837. #endif /* ATTSV */
  838. #endif /* SVR3 */
  839. #ifdef SVR4 /* SVR4 implies ATTSV */
  840. #ifndef ATTSV
  841. #define ATTSV
  842. #endif /* ATTSV */
  843. #ifndef SVR3 /* ...as well as SVR3 */
  844. #define SVR3
  845. #endif /* SVR3 */
  846. #endif /* SVR4 */
  847. #ifdef OXOS
  848. #ifndef ATTSV
  849. #define ATTSV /* OXOS implies ATTSV */
  850. #endif /* ! ATTSV */
  851. #define SW_ACC_ID /* access() wants privs on */
  852. #define kill priv_kill /* kill() wants privs on */
  853. #ifndef NOSETBUF
  854. #define NOSETBUF /* NOSETBUF is safe */
  855. #endif /* ! NOSETBUF */
  856. #endif /* OXOS */
  857. #ifdef UTSV /* UTSV implies ATTSV */
  858. #ifndef ATTSV
  859. #define ATTSV
  860. #endif /* ATTSV */
  861. #endif /* UTSV */
  862. #ifdef XENIX /* XENIX implies ATTSV */
  863. #ifndef ATTSV
  864. #define ATTSV
  865. #endif /* ATTSV */
  866. #endif /* XENIX */
  867. #ifdef AUX /* AUX implies ATTSV */
  868. #ifndef ATTSV
  869. #define ATTSV
  870. #endif /* ATTSV */
  871. #endif /* AUX */
  872. #ifdef ATT7300 /* ATT7300 implies ATTSV */
  873. #ifndef ATTSV
  874. #define ATTSV
  875. #endif /* ATTSV */
  876. #endif /* ATT7300 */
  877. #ifdef ATT6300 /* ATT6300 implies ATTSV */
  878. #ifndef ATTSV
  879. #define ATTSV
  880. #endif /* ATTSV */
  881. #endif /* ATT6300 */
  882. #ifdef HPUX /* HPUX implies ATTSV */
  883. #ifndef ATTSV
  884. #define ATTSV
  885. #endif /* ATTSV */
  886. #endif /* HPUX */
  887. #ifdef ISIII /* ISIII implies ATTSV */
  888. #ifndef ATTSV
  889. #define ATTSV
  890. #endif /* ATTSV */
  891. #endif /* ISIII */
  892. #ifdef NEXT33 /* NEXT33 implies NEXT */
  893. #ifndef NEXT
  894. #define NEXT
  895. #endif /* NEXT */
  896. #endif /* NEXT33 */
  897. #ifdef NEXT /* NEXT implies BSD4 */
  898. #ifndef BSD4
  899. #define BSD4
  900. #endif /* BSD4 */
  901. #endif /* NEXT */
  902. #ifdef BSD41 /* BSD41 implies BSD4 */
  903. #ifndef BSD4
  904. #define BSD4
  905. #endif /* BSD4 */
  906. #endif /* BSD41 */
  907. #ifdef BSD43 /* BSD43 implies BSD4 */
  908. #ifndef BSD4
  909. #define BSD4
  910. #endif /* BSD4 */
  911. #endif /* BSD43 */
  912. #ifdef BSD4 /* BSD4 implies ANYBSD */
  913. #ifndef ANYBSD
  914. #define ANYBSD
  915. #endif /* ANYBSD */
  916. #endif /* BSD4 */
  917. #ifdef BSD29 /* BSD29 implies ANYBSD */
  918. #ifndef ANYBSD
  919. #define ANYBSD
  920. #endif /* ANYBSD */
  921. #endif /* BSD29 */
  922. #ifdef ATTSV /* ATTSV implies UNIX */
  923. #ifndef UNIX
  924. #define UNIX
  925. #endif /* UNIX */
  926. #endif /* ATTSV */
  927. #ifdef ANYBSD /* ANYBSD implies UNIX */
  928. #ifndef UNIX
  929. #define UNIX
  930. #endif /* UNIX */
  931. #endif /* ANYBSD */
  932. #ifdef POSIX /* POSIX implies UNIX */
  933. #ifndef UNIX
  934. #define UNIX
  935. #endif /* UNIX */
  936. #ifndef DIRENT /* and DIRENT, i.e. <dirent.h> */
  937. #ifndef SDIRENT
  938. #define DIRENT
  939. #endif /* SDIRENT */
  940. #endif /* DIRENT */
  941. #ifndef NOFILEH /* POSIX doesn't use <sys/file.h> */
  942. #define NOFILEH
  943. #endif /* NOFILEH */
  944. #endif /* POSIX */
  945. #ifdef V7
  946. #ifndef UNIX
  947. #define UNIX
  948. #endif /* UNIX */
  949. #endif /* V7 */
  950. #ifdef COHERENT
  951. #ifndef UNIX
  952. #define UNIX
  953. #endif /* UNIX */
  954. #ifdef COMMENT
  955. #ifndef NOCURSES
  956. #define NOCURSES
  957. #endif /* NOCURSES */
  958. #endif /* COMMENT */
  959. #endif /* COHERENT */
  960. #ifdef MINIX
  961. #ifndef UNIX
  962. #define UNIX
  963. #endif /* UNIX */
  964. #endif /* MINIX */
  965. /*
  966. The symbol SVORPOSIX is defined for both AT&T and POSIX compilations
  967. to make it easier to select items that System V and POSIX have in common,
  968. but which BSD, V7, etc, do not have.
  969. */
  970. #ifdef ATTSV
  971. #ifndef SVORPOSIX
  972. #define SVORPOSIX
  973. #endif /* SVORPOSIX */
  974. #endif /* ATTSV */
  975. #ifdef POSIX
  976. #ifndef SVORPOSIX
  977. #define SVORPOSIX
  978. #endif /* SVORPOSIX */
  979. #endif /* POSIX */
  980. /*
  981. The symbol SVR4ORPOSIX is defined for both AT&T System V R4 and POSIX
  982. compilations to make it easier to select items that System V R4 and POSIX
  983. have in common, but which BSD, V7, and System V R3 and earlier, etc, do
  984. not have.
  985. */
  986. #ifdef POSIX
  987. #ifndef SVR4ORPOSIX
  988. #define SVR4ORPOSIX
  989. #endif /* SVR4ORPOSIX */
  990. #endif /* POSIX */
  991. #ifdef SVR4
  992. #ifndef SVR4ORPOSIX
  993. #define SVR4ORPOSIX
  994. #endif /* SVR4ORPOSIX */
  995. #endif /* SVR4 */
  996. /*
  997. The symbol BSD44ORPOSIX is defined for both 4.4BSD and POSIX compilations
  998. to make it easier to select items that 4.4BSD and POSIX have in common,
  999. but which System V, BSD, V7, etc, do not have.
  1000. */
  1001. #ifdef BSD44
  1002. #ifndef BSD44ORPOSIX
  1003. #define BSD44ORPOSIX
  1004. #endif /* BSD44ORPOSIX */
  1005. #endif /* BSD44 */
  1006. #ifdef POSIX
  1007. #ifndef BSD44ORPOSIX
  1008. #define BSD44ORPOSIX
  1009. #endif /* BSD44ORPOSIX */
  1010. #endif /* POSIX */
  1011. #ifdef UNIX /* For items common to OS/2 and UNIX */
  1012. #ifndef OS2ORUNIX
  1013. #define OS2ORUNIX
  1014. #endif /* OS2ORUNIX */
  1015. #endif /* UNIX */
  1016. #ifdef UNIX /* For items common to VMS and UNIX */
  1017. #define VMSORUNIX
  1018. #else
  1019. #ifdef VMS
  1020. #define VMSORUNIX
  1021. #ifndef OS2ORVMS
  1022. #define OS2ORVMS
  1023. #endif /* OS2ORVMS */
  1024. #endif /* VMS */
  1025. #endif /* UNIX */
  1026. #ifndef UNIXOROSK /* UNIX or OS-9 (or OS-9000) */
  1027. #ifdef UNIX
  1028. #define UNIXOROSK
  1029. #else
  1030. #ifdef OSK
  1031. #define UNIXOROSK
  1032. #endif /* OSK */
  1033. #endif /* UNIX */
  1034. #endif /* UNIXOROSK */
  1035. #ifndef OSKORUNIX
  1036. #ifdef UNIXOROSK
  1037. #define OSKORUNIX
  1038. #endif /* UNIXOROSK */
  1039. #endif /* OSKORUNIX */
  1040. #ifdef OS2
  1041. #define CK_ANSIC /* OS/2 supports ANSIC and more extensions */
  1042. #endif /* OS2 */
  1043. #ifdef OSF50 /* Newer OSF/1 versions imply older ones */
  1044. #ifndef OSF40
  1045. #define OSF40
  1046. #endif /* OSF40 */
  1047. #endif /* OSF50 */
  1048. #ifdef OSF40
  1049. #ifndef OSF32
  1050. #define OSF32
  1051. #endif /* OSF32 */
  1052. #endif /* OSF40 */
  1053. #ifdef OSF32
  1054. #ifndef OSF30
  1055. #define OSF30
  1056. #endif /* OSF30 */
  1057. #endif /* OSF32 */
  1058. #ifdef OSF30
  1059. #ifndef OSF20
  1060. #define OSF20
  1061. #endif /* OSF20 */
  1062. #endif /* OSF30 */
  1063. #ifdef OSF20
  1064. #ifndef OSF10
  1065. #define OSF10
  1066. #endif /* OSF10 */
  1067. #endif /* OSF20 */
  1068. #ifdef __DECC /* For DEC Alpha VMS or OSF/1 */
  1069. #ifndef CK_ANSIC
  1070. #define CK_ANSIC /* Even with /stand=vaxc, need ansi */
  1071. #endif /* CKANSIC */
  1072. #ifndef SIG_V
  1073. #define SIG_V /* and signal type is VOID */
  1074. #endif /* SIG_V */
  1075. #ifndef CK_ANSILIBS
  1076. #define CK_ANSILIBS /* (Martin Zinser, Feb 1995) */
  1077. #endif /* CK_ANSILIBS */
  1078. #ifndef _POSIX_C_SOURCE
  1079. #define _POSIX_C_SOURCE 1
  1080. #endif /* _POSIX_C_SOURCE */
  1081. #endif /* __DECC */
  1082. #ifdef VMS
  1083. #ifdef __ia64 /* VMS on Itanium */
  1084. #ifndef VMSI64
  1085. #define VMSI64
  1086. #endif /* VMSI64 */
  1087. #endif /* __ia64 */
  1088. #ifndef VMS64BIT /* 64-bit VMS on Itanium or Alpha */
  1089. #ifdef __ia64
  1090. #define VMS64BIT
  1091. #else
  1092. #ifdef __ALPHA
  1093. #define VMS64BIT
  1094. #endif /* __ia64 */
  1095. #endif /* __ALPHA */
  1096. #endif /* VMS64BIT */
  1097. #endif /* VMS */
  1098. #ifdef apollo /* May be ANSI-C, check further */
  1099. #ifdef __STDCPP__
  1100. #define CK_ANSIC /* Yes, this is real ANSI-C */
  1101. #define SIG_V
  1102. #else
  1103. #define NOANSI /* Nope, not ANSI */
  1104. #undef __STDC__ /* Even though it say it is! */
  1105. #define SIG_I
  1106. #endif /* __STDCPP__ */
  1107. #endif /* apollo */
  1108. #ifdef POSIX /* -DPOSIX on cc command line */
  1109. #ifndef _POSIX_SOURCE /* Implies _POSIX_SOURCE */
  1110. #define _POSIX_SOURCE
  1111. #endif /* _POSIX_SOURCE */
  1112. #endif /* POSIX */
  1113. /*
  1114. ANSI C? That is, do we have function prototypes, new-style
  1115. function declarations, and parameter type checking and coercion?
  1116. */
  1117. #ifdef MAC /* MPW C is ANSI */
  1118. #ifndef NOANSI
  1119. #ifndef CK_ANSIC
  1120. #define CK_ANSIC
  1121. #endif /* CK_ANSIC */
  1122. #endif /* NOANSI */
  1123. #endif /* MAC */
  1124. #ifdef STRATUS /* Stratus VOS */
  1125. #ifndef CK_ANSIC
  1126. #define CK_ANSIC
  1127. #endif /* CK_ANSIC */
  1128. #ifndef NOSTAT
  1129. #define NOSTAT
  1130. #endif /* NOSTAT */
  1131. #endif /* STRATUS */
  1132. #ifndef NOANSI
  1133. #ifdef __STDC__ /* __STDC__ means ANSI C */
  1134. #ifndef CK_ANSIC
  1135. #define CK_ANSIC
  1136. #endif /* CK_ANSIC */
  1137. #endif /* __STDC__ */
  1138. #endif /* NOANSI */
  1139. /*
  1140. _PROTOTYP() is used for forward declarations of functions so we can have
  1141. parameter and return value type checking if the compiler offers it.
  1142. __STDC__ should be defined by the compiler only if function prototypes are
  1143. allowed. Otherwise, we get old-style forward declarations. Our own private
  1144. CK_ANSIC symbol tells whether we use ANSI C prototypes. To force use of
  1145. ANSI prototypes, include -DCK_ANSIC on the cc command line. To disable the
  1146. use of ANSI prototypes, include -DNOANSI.
  1147. */
  1148. #ifdef CK_ANSIC
  1149. #define _PROTOTYP( func, parms ) func parms
  1150. #else /* Not ANSI C */
  1151. #define _PROTOTYP( func, parms ) func()
  1152. #endif /* CK_ANSIC */
  1153. #ifndef OS2
  1154. #ifdef NOLOGIN /* NOLOGIN implies NOIKSD */
  1155. #ifndef NOIKSD
  1156. #define NOIKSD
  1157. #endif /* NOIKSD */
  1158. #endif /* NOLOGIN */
  1159. #endif /* OS2 */
  1160. #ifdef NOIKSD /* Internet Kermit Service Daemon */
  1161. #ifndef OS2
  1162. #ifndef NOPRINTFSUBST
  1163. #define NOPRINTFSUBST
  1164. #endif /* NOPRINTFSUBST */
  1165. #endif /* OS2 */
  1166. #ifndef NOLOGIN
  1167. #define NOLOGIN
  1168. #endif /* NOLOGIN */
  1169. #ifndef NOSYSLOG
  1170. #define NOSYSLOG
  1171. #endif /* NOSYSLOG */
  1172. #ifndef NOWTMP
  1173. #define NOWTMP
  1174. #endif /* NOWTMP */
  1175. #else
  1176. #ifndef IKSD
  1177. #ifdef OS2ORUNIX /* Platforms where IKSD is supported */
  1178. #define IKSD
  1179. #endif /* OS2ORUNIX */
  1180. #endif /* IKSD */
  1181. #endif /* NOIKSD */
  1182. #ifdef IKSD /* IKSD options... */
  1183. #ifndef IKSDCONF /* IKSD configuration file */
  1184. #ifdef UNIX
  1185. #define IKSDCONF "/etc/iksd.conf"
  1186. #else
  1187. #ifdef OS2
  1188. #define IKSDCONF "iksd.ksc"
  1189. #endif /* OS2 */
  1190. #endif /* UNIX */
  1191. #endif /* IKSDCONF */
  1192. #ifndef NOIKSDB
  1193. #ifndef IKSDB /* IKSD database */
  1194. #ifdef UNIX
  1195. #define IKSDB
  1196. #define IK_LCKTRIES 16 /* How many times to try to get lock */
  1197. #define IK_LCKSLEEP 1 /* How long to sleep between tries */
  1198. #define IK_LOCKFILE "iksd.lck" /* Database lockfilename */
  1199. #define IK_DBASEDIR "/var/log/" /* Database directory */
  1200. #define IK_DBASEFIL "iksd.db" /* Database filename */
  1201. #else /* UNIX */
  1202. #ifdef OS2
  1203. #define IKSDB
  1204. #ifndef NOFTRUNCATE /* ftruncate() not available */
  1205. #define NOFTRUNCATE
  1206. #endif /* NOFTRUNCATE */
  1207. #define IK_LCKTRIES 16 /* How many times to try to get lock */
  1208. #define IK_LCKSLEEP 1 /* How long to sleep between tries */
  1209. #define IK_LOCKFILE "iksd.lck" /* DB lockfilename (in systemroot) */
  1210. #define IK_DBASEFIL "iksd.db" /* Database filename */
  1211. #endif /* OS2 */
  1212. #endif /* UNIX */
  1213. #endif /* IKSDB */
  1214. #endif /* NOIKSDB */
  1215. #endif /* IKSD */
  1216. /*
  1217. Substitutes for printf() and friends used in IKS to compensate for
  1218. lack of a terminal driver, mainly to supply CR after LF.
  1219. */
  1220. #ifndef NOPRINTFSUBST
  1221. #ifdef MAC
  1222. /*
  1223. * The MAC doesn't use standard stdio routines.
  1224. */
  1225. #undef getchar
  1226. #define getchar() mac_getchar()
  1227. #undef putchar
  1228. #define putchar(c) mac_putchar(c)
  1229. #define printf mac_printf
  1230. #define perror mac_perror
  1231. #define puts mac_puts
  1232. extern int mac_putchar (int c);
  1233. extern int mac_puts (const char *string);
  1234. extern int mac_printf(const char *, ...);
  1235. extern int mac_getchar (void);
  1236. #endif /* MAC */
  1237. #ifdef OS2
  1238. #define printf Vscrnprintf
  1239. #define fprintf Vscrnfprintf
  1240. extern int Vscrnprintf(const char *, ...);
  1241. extern int Vscrnprintw(const char *, ...);
  1242. extern int Vscrnfprintf(FILE *, const char *, ...);
  1243. #ifdef putchar
  1244. #undef putchar
  1245. #endif /* putchar */
  1246. #define putchar(x) Vscrnprintf("%c",x)
  1247. #define perror(x) Vscrnperror(x)
  1248. #endif /* OS2 */
  1249. #ifndef CKWART_C
  1250. #ifdef UNIX
  1251. #ifndef pdp11
  1252. #ifndef CKXPRINTF
  1253. #define CKXPRINTF
  1254. #endif /* CKXPRINTF */
  1255. #endif /* pdp11 */
  1256. #endif /* UNIX */
  1257. #endif /* CKWART_C */
  1258. #endif /* NOPRINTFSUBST */
  1259. #ifdef CKXPRINTF
  1260. #define printf ckxprintf
  1261. #define fprintf ckxfprintf
  1262. #ifdef CK_ANSIC
  1263. _PROTOTYP(int ckxprintf,(const char *, ...));
  1264. #ifdef NEXT
  1265. _PROTOTYP(void ckxperror,(const char *));
  1266. #else
  1267. #ifdef CK_SCOV5
  1268. _PROTOTYP(void ckxperror,(const char *));
  1269. #else
  1270. _PROTOTYP(int ckxperror,(const char *));
  1271. #endif /* CK_SCOV5 */
  1272. #endif /* NEXT */
  1273. _PROTOTYP(int ckxfprintf,(FILE *, const char *, ...));
  1274. #endif /* CK_ANSIC */
  1275. #ifdef putchar
  1276. #undef putchar
  1277. #endif /* putchar */
  1278. #define putchar(x) ckxprintf("%c",x)
  1279. #ifdef putc
  1280. #undef putc
  1281. #endif /* putc */
  1282. #define putc(a,b) ckxfprintf(b,"%c",a)
  1283. #define perror(x) ckxperror(x)
  1284. #endif /* CKXPRINTF */
  1285. /*
  1286. Altos-specific items: 486, 586, 986 models...
  1287. */
  1288. #ifdef A986
  1289. #define M_VOID
  1290. #define void int
  1291. #define CHAR char
  1292. #define SIG_I
  1293. #endif /* A986 */
  1294. /* Signal handling */
  1295. #ifdef QNX
  1296. #ifndef CK_POSIX_SIG
  1297. #define CK_POSIX_SIG
  1298. #endif /* CK_POSIX_SIG */
  1299. #endif /* QNX */
  1300. /*
  1301. void type, normally available only in ANSI compilers.
  1302. The HP-UX exception (for its "bundled" non-ANSI C compiler)
  1303. is known to be valid back to HP-UX 6.5.
  1304. Adjustments might be needed for earlier HP-UX versions.
  1305. */
  1306. #ifndef VOID /* Used throughout all C-Kermit */
  1307. #ifdef CK_ANSIC /* modules... */
  1308. #define VOID void
  1309. #else
  1310. #ifdef HPUX
  1311. #define VOID void
  1312. #else
  1313. #define VOID int
  1314. #endif /* HPUX */
  1315. #endif /* CK_ANSIC */
  1316. #endif /* VOID */
  1317. /*
  1318. Exactly the same as VOID but for use in contexts where the VOID symbol
  1319. conflicts some header-file definition. This is needed for the section
  1320. of ckuusx.c that provides C-Kermit's curses interface, roughly the
  1321. second half of ckuusx.c.
  1322. */
  1323. #ifndef CKVOID
  1324. #ifdef CK_ANSIC
  1325. #define CKVOID void
  1326. #else
  1327. #ifdef HPUX
  1328. #define CKVOID void
  1329. #else
  1330. #define CKVOID int
  1331. #endif /* HPUX */
  1332. #endif /* CK_ANSIC */
  1333. #endif /* CKVOID */
  1334. /* Const type */
  1335. #ifndef CONST
  1336. #ifdef OSK
  1337. #ifdef _UCC
  1338. #define CONST const
  1339. #else
  1340. #define CONST
  1341. #endif /* _UCC */
  1342. #else /* !OSK */
  1343. #ifdef CK_SCO32V4
  1344. #define CONST
  1345. #else
  1346. #ifdef CK_ANSIC
  1347. #define CONST const
  1348. #else
  1349. #define CONST
  1350. #endif /* CK_ANSIC */
  1351. #endif /* CK_SCO32V4 */
  1352. #endif /* OSK */
  1353. #endif /* CONST */
  1354. /* Signal type */
  1355. #ifndef SIG_V /* signal() type, if not def'd yet */
  1356. #ifndef SIG_I
  1357. #ifdef OS2
  1358. #define SIG_V
  1359. #else
  1360. #ifdef POSIX
  1361. #define SIG_V
  1362. #else
  1363. #ifdef SVR3 /* System V R3 and later */
  1364. #define SIG_V
  1365. #else
  1366. #ifdef SUNOS4 /* SUNOS V 4.0 and later */
  1367. #ifndef sun386
  1368. #define SIG_V
  1369. #else
  1370. #define SIG_I
  1371. #endif /* sun386 */
  1372. #else
  1373. #ifdef NEXT /* NeXT */
  1374. #define SIG_V
  1375. #else
  1376. #ifdef AIX370
  1377. #include <signal.h>
  1378. #define SIG_V
  1379. #define SIGTYP __SIGVOID /* AIX370 */
  1380. #else
  1381. #ifdef STRATUS /* Stratus VOS */
  1382. #define SIG_V
  1383. #else
  1384. #ifdef MAC
  1385. #define SIGTYP long
  1386. #define SIG_I
  1387. #ifndef MPW33
  1388. #define SIG_IGN 0
  1389. #endif /* MPW33 */
  1390. #define SIGALRM 1
  1391. #ifndef MPW33
  1392. #define SIGINT 2
  1393. #endif /* MPW33 */
  1394. #else /* Everything else */
  1395. #define SIG_I
  1396. #endif /* MAC */
  1397. #endif /* STRATUS */
  1398. #endif /* AIX370 */
  1399. #endif /* NEXT */
  1400. #endif /* SUNOS4 */
  1401. #endif /* SVR3 */
  1402. #endif /* POSIX */
  1403. #endif /* OS2 */
  1404. #endif /* SIG_I */
  1405. #endif /* SIG_V */
  1406. #ifdef SIG_I
  1407. #define SIGRETURN return(0)
  1408. #ifndef SIGTYP
  1409. #define SIGTYP int
  1410. #endif /* SIGTYP */
  1411. #endif /* SIG_I */
  1412. #ifdef SIG_V
  1413. #define SIGRETURN return
  1414. #ifndef SIGTYP
  1415. #define SIGTYP void
  1416. #endif /* SIGTYP */
  1417. #endif /* SIG_V */
  1418. #ifdef NT
  1419. #ifndef SIGTYP
  1420. #define SIGTYP void
  1421. #endif /* SIGTYP */
  1422. #endif /* NT */
  1423. #ifndef SIGTYP
  1424. #define SIGTYP int
  1425. #endif /* SIGTYP */
  1426. #ifndef SIGRETURN
  1427. #define SIGRETURN return(0)
  1428. #endif /* SIGRETURN */
  1429. #ifdef CKNTSIG
  1430. /* This does not work, so don't use it. */
  1431. #define signal ckntsignal
  1432. SIGTYP (*ckntsignal(int type, SIGTYP (*)(int)))(int);
  1433. #endif /* CKNTSIG */
  1434. /* We want all characters to be unsigned if the compiler supports it */
  1435. #ifdef KUI
  1436. #ifdef CHAR
  1437. #undef CHAR
  1438. #endif /* CHAR */
  1439. #define CHAR unsigned char
  1440. #else
  1441. #ifdef PROVX1
  1442. typedef char CHAR;
  1443. /* typedef long LONG; */
  1444. typedef int void;
  1445. #else
  1446. #ifdef MINIX
  1447. typedef unsigned char CHAR;
  1448. #else
  1449. #ifdef V7
  1450. typedef char CHAR;
  1451. #else
  1452. #ifdef C70
  1453. typedef char CHAR;
  1454. /* typedef long LONG; */
  1455. #else
  1456. #ifdef BSD29
  1457. typedef char CHAR;
  1458. /* typedef long LONG; */
  1459. #else
  1460. #ifdef datageneral
  1461. #define CHAR unsigned char /* 3.22 compiler */
  1462. #else
  1463. #ifdef HPUX
  1464. #define CHAR unsigned char
  1465. #else
  1466. #ifdef OS2
  1467. #ifdef NT
  1468. #define CHAR unsigned char
  1469. #else /* NT */
  1470. #ifdef CHAR
  1471. #undef CHAR
  1472. #endif /* CHAR */
  1473. typedef unsigned char CHAR;
  1474. #endif /* NT */
  1475. #else /* OS2 */
  1476. #ifdef VMS
  1477. typedef unsigned char CHAR;
  1478. #else
  1479. #ifdef CHAR
  1480. #undef CHAR
  1481. #endif /* CHAR */
  1482. typedef unsigned char CHAR;
  1483. #endif /* VMS */
  1484. #endif /* OS2 */
  1485. #endif /* HPUX */
  1486. #endif /* datageneral */
  1487. #endif /* BSD29 */
  1488. #endif /* C70 */
  1489. #endif /* V7 */
  1490. #endif /* MINIX */
  1491. #endif /* PROVX1 */
  1492. #endif /* KUI */
  1493. union ck_short { /* Mainly for Unicode */
  1494. USHORT x_short;
  1495. CHAR x_char[2];
  1496. };
  1497. #ifdef MAC /* Macintosh file routines */
  1498. #ifndef CKWART_C /* But not in "wart"... */
  1499. #ifdef feof
  1500. #undef feof
  1501. #endif /* feof */
  1502. #define feof mac_feof
  1503. #define rewind mac_rewind
  1504. #define fgets mac_fgets
  1505. #define fopen mac_fopen
  1506. #define fclose mac_fclose
  1507. int mac_feof();
  1508. void mac_rewind();
  1509. char *mac_fgets();
  1510. FILE *mac_fopen();
  1511. int mac_fclose();
  1512. #endif /* CKCPRO_W */
  1513. #endif /* MAC */
  1514. /*
  1515. Systems whose mainline modules have access to the communication-line
  1516. file descriptor, ttyfd.
  1517. */
  1518. #ifndef CK_TTYFD
  1519. #ifdef UNIX
  1520. #define CK_TTYFD
  1521. #else
  1522. #ifdef OS2
  1523. #define CK_TTYFD
  1524. #else
  1525. #ifdef VMS
  1526. #define CK_TTYFD
  1527. #endif /* VMS */
  1528. #endif /* OS2 */
  1529. #endif /* UNIX */
  1530. #endif /* CK_TTYFD */
  1531. /* Systems where we can get our own process ID */
  1532. #ifndef CK_PID
  1533. #ifdef UNIX
  1534. #define CK_PID
  1535. #endif /* UNIX */
  1536. #ifdef OS2
  1537. #define CK_PID
  1538. #endif /* OS2 */
  1539. #ifdef VMS
  1540. #define CK_PID
  1541. #endif /* VMS */
  1542. #endif /* CK_PID */
  1543. /* Systems that support the Microsoft Telephony API (TAPI) */
  1544. #ifndef NODIAL
  1545. #ifndef CK_TAPI
  1546. #ifdef NT
  1547. #define CK_TAPI
  1548. #endif /* NT */
  1549. #endif /* CK_TAPI */
  1550. #endif /* NODIAL */
  1551. #ifndef NONZXPAND
  1552. #ifndef NZXPAND
  1553. #ifdef OS2ORUNIX
  1554. #define NZXPAND
  1555. #else
  1556. #ifdef VMS
  1557. #define NZXPAND
  1558. #else
  1559. #ifdef datageneral
  1560. #define NZXPAND
  1561. #else
  1562. #ifdef OSK
  1563. #define NZXPAND
  1564. #endif /* OSK */
  1565. #endif /* datageneral */
  1566. #endif /* VMS */
  1567. #endif /* OS2ORUNIX */
  1568. #endif /* NZXPAND */
  1569. #else
  1570. #ifdef NZXPAND
  1571. #undef NZXPAND
  1572. #endif /* NZXPAND */
  1573. #endif /* NONZXPAND */
  1574. /* nzxpand() option flags */
  1575. #define ZX_FILONLY 1 /* Match only regular files */
  1576. #define ZX_DIRONLY 2 /* Match only directories */
  1577. #define ZX_RECURSE 4 /* Descend through directory tree */
  1578. #define ZX_MATCHDOT 8 /* Match "dot files" */
  1579. #define ZX_NOBACKUP 16 /* Don't match "backup files" */
  1580. #define ZX_NOLINKS 32 /* Don't follow symlinks */
  1581. #ifndef NZXPAND
  1582. #define nzxpand(a,b) zxpand(a)
  1583. #endif /* NZXPAND */
  1584. #ifndef NOZXREWIND
  1585. #ifndef ZXREWIND /* Platforms that have zxrewind() */
  1586. #ifdef OS2ORUNIX
  1587. #define ZXREWIND
  1588. #else
  1589. #ifdef VMS
  1590. #define ZXREWIND
  1591. #else
  1592. #ifdef datageneral
  1593. #define ZXREWIND
  1594. #else
  1595. #ifdef OSK
  1596. #define ZXREWIND
  1597. #else
  1598. #ifdef STRATUS
  1599. #define ZXREWIND
  1600. #endif /* STRATUS */
  1601. #endif /* OSK */
  1602. #endif /* datageneral */
  1603. #endif /* VMS */
  1604. #endif /* OS2ORUNIX */
  1605. #endif /* ZXREWIND */
  1606. #else
  1607. #ifdef ZXREWIND
  1608. #undef ZXREWIND
  1609. #endif /* ZXREWIND */
  1610. #endif /* NOZXREWIND */
  1611. /* Temporary-directory-for-RECEIVE feature ... */
  1612. /* This says whether we have the isdir() function defined. */
  1613. #ifdef UNIX /* UNIX has it */
  1614. #ifndef CK_TMPDIR
  1615. #ifndef pdp11
  1616. #define CK_TMPDIR
  1617. #define TMPDIRLEN 256
  1618. #endif /* pdp11 */
  1619. #endif /* CK_TMPDIR */
  1620. #endif /* UNIX */
  1621. #ifdef VMS /* VMS too */
  1622. #ifndef CK_TMPDIR
  1623. #define CK_TMPDIR
  1624. #define TMPDIRLEN 256
  1625. #endif /* CK_TMPDIR */
  1626. #endif /* VMS */
  1627. #ifdef OS2 /* OS two too */
  1628. #ifndef CK_TMPDIR
  1629. #define CK_TMPDIR
  1630. #define TMPDIRLEN 129
  1631. #endif /* CK_TMPDIR */
  1632. #endif /* OS2 */
  1633. #ifdef STRATUS /* Stratus VOS too. */
  1634. #ifndef CK_TMPDIR
  1635. #define CK_TMPDIR
  1636. #define TMPDIRLEN 256
  1637. #endif /* CK_TMPDIR */
  1638. #endif /* STRATUS */
  1639. #ifdef OSK /* OS-9 too */
  1640. #ifndef CK_TMPDIR
  1641. #define CK_TMPDIR
  1642. #define TMPDIRLEN 256
  1643. #endif /* CK_TMPDIR */
  1644. #endif /* OSK */
  1645. #ifdef datageneral /* AOS/VS too */
  1646. #ifndef CK_TMPDIR
  1647. #define CK_TMPDIR
  1648. #define TMPDIRLEN 256
  1649. #endif /* CK_TMPDIR */
  1650. #endif /* datageneral */
  1651. #ifdef CK_TMPDIR /* Needs command parser */
  1652. #ifdef NOICP
  1653. #undef CK_TMPDIR
  1654. #endif /* NOICP */
  1655. #endif /* CK_TMPDIR */
  1656. /* Whether to include <time.h> or <sys/time.h> */
  1657. #ifndef NOTIMEH /* <time.h> */
  1658. #ifndef TIMEH
  1659. #define TIMEH
  1660. #endif /* TIMEH */
  1661. #endif /* NOTIMEH */
  1662. #ifndef NOSYSTIMEH /* <sys/time.h> */
  1663. #ifndef SYSTIMEH
  1664. #ifdef UNIX /* UNIX */
  1665. #ifdef SVORPOSIX /* System V or POSIX... */
  1666. #ifdef M_UNIX
  1667. #define SYSTIMEH
  1668. #else
  1669. #ifdef SCO_32V4
  1670. #define SYSTIMEH
  1671. #else
  1672. #ifdef OXOS
  1673. #define SYSTIMEH
  1674. #else
  1675. #ifdef BSD44
  1676. #define SYSTIMEH
  1677. #else
  1678. #ifdef __linux__
  1679. #define SYSTIMEH
  1680. #else
  1681. #ifdef AIXRS
  1682. #ifndef AIX41
  1683. #define SYSTIMEH
  1684. #endif /* AIX41 */
  1685. #else
  1686. #ifdef IRIX60
  1687. #define SYSTIMEH
  1688. #else
  1689. #ifdef I386IX
  1690. #define SYSTIMEH
  1691. #else
  1692. #ifdef SV68R3V6
  1693. #define SYSTIMEH
  1694. #endif /* SV68R3V6 */
  1695. #endif /* I386IX */
  1696. #endif /* IRIX60 */
  1697. #endif /* AIXRS */
  1698. #endif /* __linux__ */
  1699. #endif /* BSD44 */
  1700. #endif /* OXOS */
  1701. #endif /* SCO_32V4 */
  1702. #endif /* M_UNIX */
  1703. #else /* Not SVORPOSIX */
  1704. #ifndef BELLV10 /* All but these... */
  1705. #ifndef PROVX1
  1706. #ifndef V7
  1707. #ifndef BSD41
  1708. #ifndef COHERENT
  1709. #define SYSTIMEH
  1710. #endif /* COHERENT */
  1711. #endif /* BSD41 */
  1712. #endif /* V7 */
  1713. #endif /* PROVX1 */
  1714. #endif /* BELLV10 */
  1715. #endif /* SVORPOSIX */
  1716. #endif /* UNIX */
  1717. #endif /* SYSTIMEH */
  1718. #endif /* NOSYSTIMEH */
  1719. #ifndef NOSYSTIMEBH /* <sys/timeb.h> */
  1720. #ifndef SYSTIMEBH
  1721. #ifdef OSF
  1722. #define SYSTIMEBH
  1723. #else
  1724. #ifdef COHERENT
  1725. #define SYSTIMEBH
  1726. #else
  1727. #ifdef BSD41
  1728. #define SYSTIMEBH
  1729. #else
  1730. #ifdef BSD29
  1731. #define SYSTIMEBH
  1732. #else
  1733. #ifdef TOWER1
  1734. #define SYSTIMEBH
  1735. #else
  1736. #ifdef FT21
  1737. #define SYSTIMEBH
  1738. #else
  1739. #ifdef BELLV10
  1740. #define SYSTIMEBH
  1741. #endif /* BELLV10 */
  1742. #endif /* FT21 */
  1743. #endif /* TOWER1 */
  1744. #endif /* BSD29 */
  1745. #endif /* BSD41 */
  1746. #endif /* COHERENT */
  1747. #endif /* OSF */
  1748. #endif /* SYSTIMEBH */
  1749. #endif /* NOSYSTIMEBH */
  1750. /*
  1751. Debug and transaction logging is included automatically unless you define
  1752. NODEBUG or NOTLOG. Do this if you want to save the space and overhead.
  1753. (Note, in version 4F these definitions changed from "{}" to the null string
  1754. to avoid problems with semicolons after braces, as in: "if (x) tlog(this);
  1755. else tlog(that);"
  1756. */
  1757. #ifndef NODEBUG
  1758. #ifndef DEBUG
  1759. #define DEBUG
  1760. #endif /* DEBUG */
  1761. #else
  1762. #ifdef DEBUG
  1763. #undef DEBUG
  1764. #endif /* DEBUG */
  1765. #endif /* NODEBUG */
  1766. #ifdef NOTLOG
  1767. #ifdef TLOG
  1768. #undef TLOG
  1769. #endif /* TLOG */
  1770. #else /* NOTLOG */
  1771. #ifndef TLOG
  1772. #define TLOG
  1773. #endif /* TLOG */
  1774. #endif /* NOTLOG */
  1775. /* debug() macro style selection. */
  1776. #ifdef VMS
  1777. #ifndef IFDEBUG
  1778. #define IFDEBUG
  1779. #endif /* IFDEBUG */
  1780. #endif /* VMS */
  1781. #ifdef MAC
  1782. #ifndef IFDEBUG
  1783. #define IFDEBUG
  1784. #endif /* IFDEBUG */
  1785. #endif /* MAC */
  1786. #ifdef OS2
  1787. #ifndef IFDEBUG
  1788. #define IFDEBUG
  1789. #endif /* IFDEBUG */
  1790. #endif /* OS2 */
  1791. #ifdef OXOS /* tst is faster than jsr */
  1792. #ifndef IFDEBUG
  1793. #define IFDEBUG
  1794. #endif /* IFDEBUG */
  1795. #endif /* OXOS */
  1796. #ifndef CKCMAI
  1797. extern int deblog;
  1798. extern int debok;
  1799. extern int debxlen;
  1800. extern int matchdot;
  1801. extern int tt_bell;
  1802. #endif /* CKCMAI */
  1803. #ifdef OS2
  1804. _PROTOTYP( void bleep, (short) );
  1805. #else /* OS2 */
  1806. #define bleep(x) if(tt_bell)putchar('\07')
  1807. #endif /* OS2 */
  1808. #ifndef BEOSORBEBOX
  1809. #ifdef BEBOX /* This was used only for DR7 */
  1810. #define BEOSORBEBOX
  1811. #else
  1812. #ifdef BEOS /* This is used for BeOS 4.x */
  1813. #define BEOSORBEBOX
  1814. #endif /* BEOS */
  1815. #endif /* BEBOX */
  1816. #endif /* BEOSORBEBOX */
  1817. #ifdef NOICP
  1818. #ifdef TLOG
  1819. #undef TLOG
  1820. #endif /* TLOG */
  1821. #endif /* NOICP */
  1822. /* Formats for debug() and tlog() */
  1823. #define F000 0
  1824. #define F001 1
  1825. #define F010 2
  1826. #define F011 3
  1827. #define F100 4
  1828. #define F101 5
  1829. #define F110 6
  1830. #define F111 7
  1831. #ifdef __linux__
  1832. #ifndef LINUX
  1833. #define LINUX
  1834. #endif /* LINUX */
  1835. #ifdef __ANDROID__
  1836. #ifndef ANDROID
  1837. #define ANDROID
  1838. #endif /* ANDROID */
  1839. #endif /* __ANDROID__ */
  1840. #endif /* __linux__ */
  1841. /* Platforms where small size is needed */
  1842. #ifdef pdp11
  1843. #define CK_SMALL
  1844. #endif /* pdp11 */
  1845. /* Can we use realpath()? */
  1846. #ifndef NOREALPATH
  1847. #ifdef pdp11
  1848. #define NOREALPATH
  1849. #endif /* pdp11 */
  1850. #endif /* NOREALPATH */
  1851. #ifndef NOREALPATH
  1852. #ifdef UNIX
  1853. #ifdef HPUX5
  1854. #define NOREALPATH
  1855. #else
  1856. #ifdef HPUX6
  1857. #define NOREALPATH
  1858. #else
  1859. #ifdef HPUX7
  1860. #define NOREALPATH
  1861. #else
  1862. #ifdef HPUX8
  1863. #define NOREALPATH
  1864. #else
  1865. #ifdef SV68R3V6
  1866. #define NOREALPATH
  1867. #else
  1868. #ifdef XENIX
  1869. #define NOREALPATH
  1870. #else
  1871. #ifdef CK_SCO32V4
  1872. #define NOREALPATH
  1873. #else
  1874. #ifdef CK_SCOV5
  1875. #define NOREALPATH
  1876. #else
  1877. #ifdef OSF32
  1878. #define NOREALPATH
  1879. #else
  1880. #ifdef OSF30
  1881. #define NOREALPATH
  1882. #else
  1883. #ifdef ultrix
  1884. #define NOREALPATH
  1885. #else
  1886. #ifdef COHERENT
  1887. #define NOREALPATH
  1888. #endif /* COHERENT */
  1889. #endif /* ultrix */
  1890. #endif /* OSF30 */
  1891. #endif /* OSF32 */
  1892. #endif /* CK_SCOV5 */
  1893. #endif /* CK_SCO32V4 */
  1894. #endif /* XENIX */
  1895. #endif /* SV68R3V6 */
  1896. #endif /* HPUX8 */
  1897. #endif /* HPUX7 */
  1898. #endif /* HPUX6 */
  1899. #endif /* HPUX5 */
  1900. #endif /* NOREALPATH */
  1901. #ifndef NOREALPATH
  1902. #ifndef CKREALPATH
  1903. #define CKREALPATH
  1904. #endif /* NOREALPATH */
  1905. #endif /* CKREALPATH */
  1906. #endif /* UNIX */
  1907. #ifdef CKREALPATH
  1908. #ifdef OS2ORUNIX
  1909. #ifndef CKROOT
  1910. #define CKROOT
  1911. #endif /* CKROOT */
  1912. #endif /* OS2ORUNIX */
  1913. #endif /* CKREALPATH */
  1914. /* CKSYMLINK should be set only if we can use readlink() */
  1915. #ifdef UNIX
  1916. #ifndef NOSYMLINK
  1917. #ifndef CKSYMLINK
  1918. #define CKSYMLINK
  1919. #endif /* NOSYMLINK */
  1920. #endif /* CKSYMLINK */
  1921. #endif /* UNIX */
  1922. /* Platforms where we can use lstat() instead of stat() (for symlinks) */
  1923. /* This should be set only if both lstat() and readlink() are available */
  1924. #ifndef NOLSTAT
  1925. #ifndef NOSYMLINK
  1926. #ifndef USE_LSTAT
  1927. #ifdef UNIX
  1928. #ifdef CKSYMLINK
  1929. #ifdef SVR4 /* SVR4 has lstat() */
  1930. #define USE_LSTAT
  1931. #else
  1932. #ifdef BSD42 /* 4.2BSD and 4.3BSD have it */
  1933. #define USE_LSTAT /* This should include old HPUXs */
  1934. #else
  1935. #ifdef BSD44 /* 4.4BSD has it */
  1936. #define USE_LSTAT
  1937. #else
  1938. #ifdef LINUX /* LINUX has it */
  1939. #define USE_LSTAT
  1940. #else
  1941. #ifdef SUNOS4 /* SunOS has it */
  1942. #define USE_LSTAT
  1943. #endif /* SUNOS4 */
  1944. #endif /* LINUX */
  1945. #endif /* BSD44 */
  1946. #endif /* BSD42 */
  1947. #endif /* SVR4 */
  1948. #endif /* CKSYMLINK */
  1949. #endif /* UNIX */
  1950. #endif /* USE_LSTAT */
  1951. #endif /* NOSYMLINK */
  1952. #endif /* NOLSTAT */
  1953. #ifdef NOLSTAT
  1954. #ifdef USE_LSTAT
  1955. #undef USE_LSTAT
  1956. #endif /* USE_LSTAT */
  1957. #endif /* NOLSTAT */
  1958. #ifndef NOTTYLOCK /* UNIX systems that have ttylock() */
  1959. #ifndef USETTYLOCK
  1960. #ifdef AIXRS /* AIX 3.1 and later */
  1961. #define USETTYLOCK
  1962. #else
  1963. #ifdef USE_UU_LOCK /* FreeBSD or other with uu_lock() */
  1964. #define USETTYLOCK
  1965. #else
  1966. /*
  1967. Prior to 8.0.299 Alpha.08 this was HAVE_BAUDBOY which was added for
  1968. Red Hat 7.2 in May 2003 but which is no longer supported in Debian and
  1969. OpenSuse (at least).
  1970. */
  1971. #ifdef HAVE_LOCKDEV
  1972. #define USETTYLOCK
  1973. #endif /* HAVE_LOCKDEV */
  1974. #endif /* USE_UU_LOCK */
  1975. #endif /* AIXRS */
  1976. #endif /* USETTYLOCK */
  1977. #endif /* NOTTYLOCK */
  1978. /* This could become more inclusive.. Solaris 10, HP-UX 11, AIX 5.3... */
  1979. #ifndef HAVE_SNPRINTF /* Safe to use snprintf() */
  1980. #ifdef HAVE_OPENPTY
  1981. #define HAVE_SNPRINTF
  1982. #endif /* HAVE_OPENPTY */
  1983. #endif /* HAVE_SNPRINTF */
  1984. /* Kermit feature selection */
  1985. #ifndef NOSPL
  1986. #ifndef NOCHANNELIO /* Channel-based file i/o package */
  1987. #ifndef CKCHANNELIO
  1988. #ifdef UNIX
  1989. #define CKCHANNELIO
  1990. #else
  1991. #ifdef OS2
  1992. #define CKCHANNELIO
  1993. #else
  1994. #ifdef VMS
  1995. #define CKCHANNELIO
  1996. #else
  1997. #ifdef STRATUS
  1998. #define CKCHANNELIO
  1999. #endif /* STRATUS */
  2000. #endif /* VMS */
  2001. #endif /* OS2 */
  2002. #endif /* UNIX */
  2003. #endif /* CKCHANNELIO */
  2004. #endif /* NOCHANNELIO */
  2005. #endif /* NOSPL */
  2006. #ifndef NOCKEXEC /* EXEC command */
  2007. #ifndef NOPUSH
  2008. #ifndef CKEXEC
  2009. #ifdef UNIX /* UNIX can do it */
  2010. #define CKEXEC
  2011. #endif /* UNIX */
  2012. #endif /* CKEXEC */
  2013. #endif /* NOPUSH */
  2014. #endif /* NOCKEXEC */
  2015. #ifndef NOFAST /* Fast Kermit protocol by default */
  2016. #ifndef CK_FAST
  2017. #ifdef UNIX
  2018. #define CK_FAST
  2019. #else
  2020. #ifdef VMS
  2021. #define CK_FAST
  2022. #else
  2023. #ifdef OS2
  2024. #define CK_FAST
  2025. #endif /* OS2 */
  2026. #endif /* VMS */
  2027. #endif /* UNIX */
  2028. #endif /* CK_FAST */
  2029. #endif /* NOFAST */
  2030. #ifdef UNIX /* Transparent print */
  2031. #ifndef NOXPRINT
  2032. #ifndef XPRINT
  2033. #define XPRINT
  2034. #endif /* XPRINT */
  2035. #endif /* NOXPRINT */
  2036. #endif /* UNIX */
  2037. #ifndef NOHWPARITY /* Hardware parity */
  2038. #ifndef HWPARITY
  2039. #ifdef SVORPOSIX /* System V or POSIX can have it */
  2040. #define HWPARITY
  2041. #else
  2042. #ifdef SUNOS41 /* SunOS 4.1 can have it */
  2043. #define HWPARITY
  2044. #else
  2045. #ifdef OS2 /* K95 can have it */
  2046. #define HWPARITY
  2047. #endif /* OS2 */
  2048. #endif /* SUNOS41 */
  2049. #endif /* SVORPOSIX */
  2050. #endif /* HWPARITY */
  2051. #endif /* NOHWPARITY */
  2052. #ifndef NOSTOPBITS /* Stop-bit selection */
  2053. #ifndef STOPBITS
  2054. #ifdef OS2ORUNIX
  2055. /* In Unix really this should only be if CSTOPB is defined. */
  2056. /* But we don't know that yet. */
  2057. #define STOPBITS
  2058. #else
  2059. #ifdef TN_COMPORT
  2060. #define STOPBITS
  2061. #endif /* TN_COMPORT */
  2062. #endif /* OS2ORUNIX */
  2063. #endif /* STOPBITS */
  2064. #endif /* NOSTOPBITS */
  2065. #ifdef UNIX
  2066. #ifndef NETCMD /* Can SET NETWORK TYPE COMMAND */
  2067. #define NETCMD
  2068. #endif /* NETCMD */
  2069. #endif /* UNIX */
  2070. /* Pty support, nonportable, available on a case-by-case basis */
  2071. #ifndef NOPTY
  2072. #ifdef NEXT /* NeXTSTEP (tested on 3.1)*/
  2073. #define NETPTY
  2074. #else
  2075. #ifdef CK_SCOV5 /* SCO OSR5 (tested on 5.0.5)*/
  2076. #define NETPTY
  2077. #else
  2078. #ifdef QNX /* QNX (tested on 4.25) */
  2079. #define NETPTY
  2080. #else
  2081. #ifdef SINIX /* Sinix (tested on 5.42) */
  2082. #define NETPTY
  2083. #else
  2084. #ifdef DGUX540 /* DG/UX 5.4++ (tested on 5.4R4.11) */
  2085. #define NETPTY
  2086. #else
  2087. #ifdef OSF32 /* Digital Unix 3.2 */
  2088. #define NETPTY
  2089. #else
  2090. #ifdef OSF40 /* Digital Unix 4.0 / Tru64 */
  2091. #define NETPTY
  2092. #else
  2093. #ifdef IRIX60 /* IRIX 6.0 (not earlier) */
  2094. #define NETPTY
  2095. #else
  2096. #ifdef HPUX10 /* HPUX 10.00 or later */
  2097. #define NETPTY
  2098. #ifndef HAVE_PTYTRAP
  2099. #define HAVE_PTYTRAP
  2100. #endif /* HAVE_PTYTRAP */
  2101. #else
  2102. #ifdef HPUX9 /* HPUX 9.00 (not earlier) */
  2103. #define NETPTY
  2104. #ifndef HAVE_PTYTRAP
  2105. #define HAVE_PTYTRAP
  2106. #endif /* HAVE_PTYTRAP */
  2107. #else
  2108. #ifdef BSD44 /* BSD44, {Net,Free,Open}BSD */
  2109. #define NETPTY
  2110. #else
  2111. #ifdef BSDI /* BSDI/OS (tested in 4) */
  2112. #define NETPTY
  2113. #else
  2114. #ifdef SOLARIS /* Solaris (tested in 2.5) */
  2115. #define NETPTY
  2116. #else
  2117. #ifdef UW7 /* Unixware 7 */
  2118. #define NETPTY
  2119. #else
  2120. #ifdef SUNOS41 /* SunOS (tested in 4.1.3) */
  2121. #define NETPTY
  2122. #else
  2123. #ifdef AIX41 /* AIX 4.1 and later */
  2124. #define NETPTY
  2125. #else
  2126. #ifdef LINUX /* Linux */
  2127. #define NETPTY
  2128. #endif /* LINUX */
  2129. #endif /* AIX41 */
  2130. #endif /* SUNOS41 */
  2131. #endif /* UW7 */
  2132. #endif /* SOLARIS */
  2133. #endif /* BSDI */
  2134. #endif /* BSD44 */
  2135. #endif /* HPUX9 */
  2136. #endif /* HPUX10 */
  2137. #endif /* IRIX60 */
  2138. #endif /* OSF40 */
  2139. #endif /* OSF32 */
  2140. #endif /* DGUX540 */
  2141. #endif /* SINIX */
  2142. #endif /* QNX */
  2143. #endif /* CK_SCOV5 */
  2144. #endif /* NEXT */
  2145. #else /* NOPTY */
  2146. #ifdef NETPTY
  2147. #undef NETPTY
  2148. #endif /* NETPTY */
  2149. #endif /* NOPTY */
  2150. #ifdef NETPTY /* NETCMD required for NETPTY */
  2151. #ifndef NETCMD
  2152. #define NETCMD
  2153. #endif /* NETCMD */
  2154. #ifndef NO_OPENPTY /* Can use openpty() */
  2155. #ifndef HAVE_OPENPTY
  2156. #ifdef __linux__
  2157. #define HAVE_OPENPTY
  2158. #else
  2159. #ifdef __FreeBSD__
  2160. #define HAVE_OPENPTY
  2161. #else
  2162. #ifdef __OpenBSD__
  2163. #define HAVE_OPENPTY
  2164. #else
  2165. #ifdef __NetBSD__
  2166. #define HAVE_OPENPTY
  2167. #include <util.h>
  2168. #else
  2169. #ifdef MACOSX10
  2170. #define HAVE_OPENPTY
  2171. #endif /* MACOSX10 */
  2172. #endif /* __NetBSD__ */
  2173. #endif /* __OpenBSD__ */
  2174. #endif /* __FreeBSD__ */
  2175. #endif /* __linux__ */
  2176. #endif /* HAVE_OPENPTY */
  2177. #endif /* NO_OPENPTY */
  2178. /*
  2179. This needs to be expanded and checked.
  2180. The makefile assumes the library (at least for all linuxes)
  2181. is always libutil but I've only verified it for a few.
  2182. If a build fails because
  2183. */
  2184. #ifdef HAVE_OPENPTY
  2185. #ifdef __linux__
  2186. #include <pty.h>
  2187. #else
  2188. #ifdef __NetBSD__
  2189. #include <util.h>
  2190. #else
  2191. #ifdef __OpenBSD__
  2192. #include <util.h>
  2193. #else
  2194. #ifdef __FreeBSD__
  2195. #include <libutil.h>
  2196. #else
  2197. #ifdef MACOSX
  2198. #include <util.h>
  2199. #else
  2200. #ifdef QNX
  2201. #include <unix.h>
  2202. #endif /* QNX */
  2203. #endif /* MACOSX */
  2204. #endif /* __FreeBSD__ */
  2205. #endif /* __OpenBSD__ */
  2206. #endif /* __NetBSD__ */
  2207. #endif /* __linux__ */
  2208. #endif /* HAVE_OPENPTY */
  2209. #endif /* NETPTY */
  2210. #ifndef CK_UTSNAME /* Can we call uname()? */
  2211. #ifdef VMS
  2212. #define CK_UTSNAME
  2213. #else
  2214. #ifdef OS2
  2215. #define CK_UTSNAME
  2216. #else
  2217. #ifdef POSIX /* It's in POSIX.1 */
  2218. #define CK_UTSNAME
  2219. #else
  2220. #ifdef SUNOS41 /* It's in SunOS 4.1 */
  2221. #define CK_UTSNAME
  2222. #else
  2223. #ifdef AIXRS /* It's in AIX */
  2224. #define CK_UTSNAME
  2225. #else
  2226. #ifdef SVR4 /* It's in SVR4 (but not SVR3) */
  2227. #define CK_UTSNAME
  2228. #else
  2229. #ifdef HPUX /* It's in HP-UX 5.00 and later */
  2230. #define CK_UTSNAME
  2231. #else
  2232. #ifdef OSF /* It's in OSF/1 / Digital UNIX */
  2233. #define CK_UTSNAME
  2234. #else
  2235. #ifdef CK_SCOV5
  2236. #define CK_UTSNAME
  2237. #endif /* CK_SCOV5 */
  2238. #endif /* OSF */
  2239. #endif /* HPUX */
  2240. #endif /* SVR4 */
  2241. #endif /* AIXRS */
  2242. #endif /* SUNOS41 */
  2243. #endif /* POSIX */
  2244. #endif /* OS2 */
  2245. #endif /* VMS */
  2246. #endif /* CK_UTSNAME */
  2247. /* This section for anything that might use floating-point */
  2248. /* If the following causes trouble use -DFLOAT=float on the command line */
  2249. #ifdef NOSPL
  2250. #ifdef FNFLOAT
  2251. #undef FNFLOAT
  2252. #endif /* FNFLOAT */
  2253. #ifdef CKFLOAT
  2254. #undef CKFLOAT
  2255. #endif /* CKFLOAT */
  2256. #endif /* NOSPL */
  2257. #ifndef NOFLOAT
  2258. #ifndef CKFLOAT
  2259. #ifdef __alpha
  2260. /* Don't use double on 64-bit platforms -- bad things happen */
  2261. #define CKFLOAT float
  2262. #define CKFLOAT_S "float"
  2263. #else
  2264. #define CKFLOAT double
  2265. #define CKFLOAT_S "double"
  2266. #endif /* __alpha */
  2267. #endif /* CKFLOAT */
  2268. #ifndef NOGFTIMER /* Floating-point timers */
  2269. #ifndef GFTIMER
  2270. #ifdef UNIX /* For UNIX */
  2271. #define GFTIMER
  2272. #endif /* UNIX */
  2273. #ifdef VMS /* VMS */
  2274. #ifndef OLD_VMS /* 5.0 and later */
  2275. #define GFTIMER
  2276. #endif /* OLD_VMS */
  2277. #endif /* VMS */
  2278. #ifdef OS2 /* And K95 */
  2279. #define GFTIMER
  2280. #endif /* OS2 */
  2281. #ifdef STRATUS /* And Stratus VOS */
  2282. #define GFTIMER
  2283. #endif /* STRATUS */
  2284. #endif /* GFTIMER */
  2285. #endif /* NOGFTIMER */
  2286. #ifndef NOSPL
  2287. #ifndef FNFLOAT /* Floating-point math functions */
  2288. #ifdef VMS /* defined by default in VMS */
  2289. #define FNFLOAT
  2290. #else
  2291. #ifdef OS2 /* and K95 */
  2292. #define FNFLOAT
  2293. #endif /* OS2 */
  2294. #endif /* VMS */
  2295. #endif /* FNFLOAT */
  2296. #endif /* NOSPL */
  2297. #else /* NOFLOAT is defined */
  2298. #ifdef CKFLOAT
  2299. #undef CKFLOAT
  2300. #endif /* CKFLOAT */
  2301. #ifdef GFTIMER
  2302. #undef GFTIMER
  2303. #endif /* GFTIMER */
  2304. #ifdef FNFLOAT
  2305. #undef FNFLOAT
  2306. #endif /* FNFLOAT */
  2307. #endif /* NOFLOAT */
  2308. #ifdef GFTIMER /* Fraction of second to use when */
  2309. #ifndef GFMINTIME /* elapsed time is <= 0 */
  2310. #define GFMINTIME 0.005
  2311. #endif /* GFMINTIME */
  2312. #endif /* GFTIMER */
  2313. #ifndef CKCMAI
  2314. extern long ztmsec, ztusec; /* Fraction of sec of current time */
  2315. #endif /* CKCMAI */
  2316. #ifndef NOUNPREFIXZERO /* Allow unprefixing of NUL (0) */
  2317. #ifndef UNPREFIXZERO /* in file-transfer packets */
  2318. #define UNPREFIXZERO
  2319. #endif /* UNPREFIXZERO */
  2320. #endif /* NOUNPREFIXZERO */
  2321. #ifdef CK_SMALL
  2322. #define NOCAL /* Calibrate */
  2323. #endif /* CK_SMALL */
  2324. #ifndef NOPATTERNS /* Filetype matching patterns */
  2325. #ifndef PATTERNS
  2326. #ifndef VMS
  2327. #ifndef CK_SMALL
  2328. #define PATTERNS
  2329. #endif /* CK_SMALL */
  2330. #endif /* VMS */
  2331. #endif /* PATTERNS */
  2332. #endif /* NOPATTERNS */
  2333. #ifndef NOCAL
  2334. #ifndef CALIBRATE
  2335. #define CALIBRATE
  2336. #endif /* CALIBRATE */
  2337. #else
  2338. #ifdef CALIBRATE
  2339. #undef CALIBRATE
  2340. #endif /* CALIBRATE */
  2341. #endif /* NOCAL */
  2342. #ifndef NORECURSE /* Recursive directory traversal */
  2343. #ifndef RECURSIVE
  2344. #ifdef VMS
  2345. #define RECURSIVE
  2346. #else
  2347. #ifdef OS2ORUNIX
  2348. #ifndef CK_SMALL
  2349. #define RECURSIVE
  2350. #endif /* CK_SMALL */
  2351. #else
  2352. #ifdef STRATUS
  2353. #define RECURSIVE
  2354. #else
  2355. #ifdef OSK
  2356. #define RECURSIVE
  2357. #endif /* OSK */
  2358. #endif /* STRATUS */
  2359. #endif /* OS2ORUNIX */
  2360. #endif /* VMS */
  2361. #endif /* RECURSIVE */
  2362. #endif /* NORECURSE */
  2363. #ifndef CK_SMALL /* Enable file-transfer tuning code */
  2364. #ifndef CKTUNING /* in which more code is added */
  2365. #ifndef NOTUNING /* to avoid function calls, etc */
  2366. #define CKTUNING
  2367. #endif /* NOTUNING */
  2368. #endif /* CKTUNING */
  2369. #endif /* CK_SMALL */
  2370. #ifndef NOURL /* Parse URLs in SET HOST, etc */
  2371. #define CK_URL
  2372. #define NO_FTP_AUTH /* No auth "ftp" / "anonymous" */
  2373. #endif /* NOURL */
  2374. #ifndef NOTRIGGER
  2375. #ifndef CK_TRIGGER /* Trigger string to exit CONNECT */
  2376. #ifdef OS2ORUNIX /* OK for UNIX and K95 */
  2377. #define CK_TRIGGER
  2378. #else
  2379. #ifdef VMS /* and VMS */
  2380. #define CK_TRIGGER
  2381. #else
  2382. #ifdef datageneral /* and AOS/VS */
  2383. #define CK_TRIGGER
  2384. #endif /* datageneral */
  2385. #endif /* OS2ORUNIX */
  2386. #endif /* VMS */
  2387. #endif /* CK_TRIGGER */
  2388. #endif /* NOTRIGGER */
  2389. #ifdef CK_TRIGGER
  2390. #define TRIGGERS 8 /* How many triggers allowed */
  2391. #endif /* CK_TRIGGER */
  2392. #ifndef XLIMITS /* CONNECT limits */
  2393. #ifdef OS2
  2394. #define XLIMITS
  2395. #endif /* OS2 */
  2396. #endif /* XLIMITS */
  2397. #ifdef NOFRILLS
  2398. #ifndef NOBROWSER
  2399. #define NOBROWSER
  2400. #endif /* NOBROWSER */
  2401. #ifndef NOFTP
  2402. #define NOFTP
  2403. #endif /* NOFTP */
  2404. #endif /* NOFRILLS */
  2405. #ifndef NOHTTP /* HTTP features need... */
  2406. #ifdef NOICP /* an interactive command parser */
  2407. #define NOHTTP
  2408. #endif /* NOICP */
  2409. #ifndef VMS
  2410. #ifndef OS2ORUNIX /* K95 or UNIX (because of */
  2411. #define NOHTTP /* time functions, time_t, etc) */
  2412. #endif /* OS2ORUNIX */
  2413. #endif /* VMS */
  2414. #endif /* NOHTTP */
  2415. #ifndef NONET
  2416. #ifdef TCPSOCKET
  2417. /* The HTTP code is not very portable, so it must be asked for with -DCKHTTP */
  2418. #ifndef NOHTTP
  2419. #ifndef CKHTTP
  2420. #ifdef SUNOS4 /* We can use it in SunOS */
  2421. #define CKHTTP
  2422. #endif /* SUNOS4 */
  2423. #ifdef SOLARIS /* And in Solaris */
  2424. #define CKHTTP
  2425. #endif /* SOLARIS */
  2426. #ifdef LINUX /* And Linux */
  2427. #define CKHTTP
  2428. #endif /* LINUX */
  2429. #ifdef HPUX10 /* And HP-UX 10 and above */
  2430. #define CKHTTP
  2431. #endif /* HPUX10 */
  2432. #ifdef OS2 /* And in K-95 */
  2433. #define CKHTTP
  2434. #endif /* OS2 */
  2435. #ifdef AIX41 /* In AIX 4.1 and higher */
  2436. #define CKHTTP
  2437. #endif /* AIX41 */
  2438. #ifdef UNIXWARE /* In Unixware 2.1 and higher */
  2439. #define CKHTTP /* and probably also in 1.x and 2.0 */
  2440. #endif /* UNIXWARE */
  2441. #ifdef CK_SCOV5
  2442. #define CKHTTP
  2443. #endif /* CK_SCOV5 */
  2444. #ifdef OSF /* And in OSF Digital UNIX/True 64 */
  2445. #define CKHTTP
  2446. #endif /* OSF */
  2447. #ifdef ultrix /* And in Ultrix Mips */
  2448. #ifdef mips
  2449. #define CKHTTP
  2450. #endif /* mips */
  2451. #endif /* ultrix */
  2452. #ifdef __NetBSD__ /* NetBSD */
  2453. #define CKHTTP
  2454. #endif /* __NetBSD__ */
  2455. #ifdef __FreeBSD__
  2456. #define CKHTTP
  2457. #endif /* __FreeBSD__ */
  2458. #ifdef __OpenBSD__
  2459. #define CKHTTP
  2460. #endif /* __OpenBSD__ */
  2461. /* Add more here... */
  2462. #endif /* CKHTTP */
  2463. #ifndef CKHTTP /* If CKHTTP not defined yet */
  2464. #define NOHTTP /* then define NOHTTP */
  2465. #endif /* CKHTTP */
  2466. #endif /* NOHTTP */
  2467. #ifdef NETCONN /* Special "network" types... */
  2468. #ifndef NOLOCAL
  2469. #ifdef OS2
  2470. #ifndef NETFILE
  2471. #define NETFILE
  2472. #endif /* NETFILE */
  2473. #ifndef NOPUSH
  2474. #ifndef NETCMD
  2475. #define NETCMD
  2476. #endif /* NETCMD */
  2477. #endif /* NOPUSH */
  2478. #ifdef NT
  2479. #ifndef NETDLL
  2480. #define NETDLL
  2481. #endif /* NETDLL */
  2482. #endif /* NT */
  2483. #endif /* OS2 */
  2484. #endif /* NOLOCAL */
  2485. #endif /* NETCONN */
  2486. #ifndef NOFTP
  2487. #ifndef SYSFTP
  2488. #ifndef NEWFTP
  2489. #ifdef OS2ORUNIX
  2490. #define NEWFTP
  2491. #endif /* OS2ORUNIX */
  2492. #endif /* NEWFTP */
  2493. #endif /* SYSFTP */
  2494. #endif /* NOFTP */
  2495. #ifndef NOFTP
  2496. #ifdef NEWFTP
  2497. #ifdef SYSFTP
  2498. #undef SYSFTP
  2499. #endif /* SYSFTP */
  2500. #else /* NEWFTP */
  2501. #ifndef SYSFTP
  2502. #define SYSFTP
  2503. #endif /* SYSFTP */
  2504. #endif /* NEWFTP */
  2505. #else /* NOFTP */
  2506. #ifdef NEWFTP
  2507. #undef NEWFTP
  2508. #endif /* NEWFTP */
  2509. #ifdef SYSFTP
  2510. #undef SYSFTP
  2511. #endif /* SYSFTP */
  2512. #endif /* NOFTP */
  2513. #ifndef NOBROWSER
  2514. #ifdef UNIX
  2515. #ifndef BROWSER
  2516. #ifndef NOPUSH
  2517. #define BROWSER
  2518. #endif /* NOPUSH */
  2519. #endif /* BROWSER */
  2520. #endif /* UNIX */
  2521. #ifdef OS2
  2522. #ifndef BROWSER
  2523. #ifndef NOPUSH
  2524. #define BROWSER
  2525. #endif /* NOPUSH */
  2526. #endif /* BROWSER */
  2527. #endif /* OS2 */
  2528. #else
  2529. #ifdef BROWSER
  2530. #undef BROWSER
  2531. #endif /* BROWSER */
  2532. #endif /* NOBROWSER */
  2533. #else /* TCPSOCKET */
  2534. #ifndef NOHTTP /* HTTP requires TCPSOCKET */
  2535. #define NOHTTP
  2536. #endif /* NOHTTP */
  2537. #endif /* TCPSOCKET */
  2538. #endif /* NONET */
  2539. #ifdef TCPSOCKET
  2540. #ifndef NOCKGETFQHOST
  2541. #ifdef __ia64__
  2542. #define NOCKGETFQHOST
  2543. #else /* __ia64__ */
  2544. #ifdef SV68
  2545. #define NOCKGETFQHOST
  2546. #else
  2547. #ifdef HPUXPRE65
  2548. #define NOCKGETFQHOST
  2549. #endif /* HPUXPRE65 */
  2550. #endif /* SV68 */
  2551. #endif /* __ia64 */
  2552. #endif /* NOCKGETFQHOST */
  2553. /*
  2554. Regarding System V/68 (SV68) (from Gerry Belanger, Oct 2002):
  2555. 1) The gethostbyname() appears to return the actual host IP
  2556. address in the hostent struct, instead of the expected pointer
  2557. to the address. Hence the bogus address in the bcopy/memcopy.
  2558. This is despite the header agreeing with our expectations.
  2559. 2) the expected argument swap between bcopy and memcopy
  2560. did not happen. What grief this might cause, I know not.
  2561. */
  2562. #endif /* TCPSOCKET */
  2563. #ifdef TCPSOCKET
  2564. #ifdef OS2ONLY
  2565. #ifndef NOSOCKS
  2566. #define NOSOCKS
  2567. #endif /* NOSOCKS */
  2568. #endif /* OS2ONLY */
  2569. #ifdef NOSOCKS
  2570. #ifdef CK_SOCKS
  2571. #undef CK_SOCKS
  2572. #endif /* CK_SOCKS */
  2573. #ifdef CK_SOCKS5
  2574. #undef CK_SOCKS5
  2575. #endif /* CK_SOCKS5 */
  2576. #else /* NOSOCKS */
  2577. #ifdef NT
  2578. #ifndef CK_SOCKS
  2579. #define CK_SOCKS
  2580. #endif /* CK_SOCKS */
  2581. #endif /* NT */
  2582. #ifdef CK_SOCKS5 /* CK_SOCKS5 implies CK_SOCKS */
  2583. #ifndef CK_SOCKS
  2584. #define CK_SOCKS
  2585. #endif /* CK_SOCKS */
  2586. #endif /* CK_SOCKS5 */
  2587. #endif /* NOSOCKS */
  2588. #endif /* TCPSOCKET */
  2589. #ifdef TNCODE
  2590. #ifndef CK_AUTHENTICATION
  2591. #ifdef OS2
  2592. #ifdef _M_PPC
  2593. #define NO_KERBEROS
  2594. #define NO_SRP
  2595. #else /* _M_PPC */
  2596. #ifndef NO_SSL
  2597. #define CK_SSL
  2598. /* #define SSLDLL */ /* OpenSSL included at link time now - [jt] 2013/11/21 */
  2599. #endif /* NO_SSL */
  2600. #endif /* _M_PPC */
  2601. #ifndef NO_KERBEROS
  2602. #define CK_KERBEROS
  2603. #define KRB4
  2604. #define KRB5
  2605. #define KRB524
  2606. #define KRB524_CONV
  2607. #ifdef NT
  2608. #ifndef _M_PPC
  2609. #ifndef _M_ALPHA
  2610. #ifndef NO_SSL_KRB5
  2611. #define SSL_KRB5
  2612. #endif /* NO_SSL_KRB5 */
  2613. #endif /* _M_ALPHA */
  2614. #endif /* _M_PPC */
  2615. #endif /* NT */
  2616. #endif /* NO_KERBEROS */
  2617. #ifndef NO_SRP
  2618. #define CK_SRP
  2619. #endif /* NO_SRP */
  2620. #define CK_AUTHENTICATION
  2621. #endif /* OS2 */
  2622. #endif /* CK_AUTHENTICATION */
  2623. #ifdef CK_AUTHENTICATION /* Encryption must have Auth */
  2624. #ifndef CK_ENCRYPTION
  2625. #ifndef NO_ENCRYPTION
  2626. #ifdef OS2
  2627. #define CK_ENCRYPTION
  2628. #define CK_DES
  2629. #define CK_CAST
  2630. #endif /* OS2 */
  2631. #endif /* NO_ENCRYPTION */
  2632. #endif /* CK_ENCRYPTION */
  2633. #endif /* CK_AUTHENTICATION */
  2634. #ifdef NO_AUTHENTICATION /* Allow authentication to be */
  2635. #ifdef CK_AUTHENTICATION /* disabled in NT and OS/2 */
  2636. #undef CK_AUTHENTICATION
  2637. #endif /* CK_AUTHENTICATION */
  2638. #ifdef CK_KERBEROS
  2639. #undef CK_KERBEROS
  2640. #endif /* CK_KERBEROS */
  2641. #ifdef CK_SRP
  2642. #undef CK_SRP
  2643. #endif /* CK_SRP */
  2644. #ifdef CK_ENCRYPTION
  2645. #undef CK_ENCRYPTION
  2646. #endif /* CK_ENCRYPTION */
  2647. #endif /* NO_AUTHENTICATION */
  2648. #ifdef NO_ENCRYPTION /* Allow encryption to be */
  2649. #ifdef CK_ENCRYPTION /* disabled in NT and OS/2 */
  2650. #undef CK_ENCRYPTION
  2651. #endif /* CK_ENCRYPTION */
  2652. #endif /* NO_ENCRYPTION */
  2653. #ifdef CK_KERBEROS /* Disable funcs not yet supported with Heimdal */
  2654. #ifdef KRB5
  2655. #ifndef HEIMDAL
  2656. #define KRB5_U2U
  2657. #endif /* HEIMDAL */
  2658. #endif /* KRB5 */
  2659. #endif /* CK_KERBEROS */
  2660. /*
  2661. SSH section. NOSSH disables any form of SSH support.
  2662. If NOSSH is not defined (or implied by NONET, NOLOCAL, etc)
  2663. then SSHBUILTIN is defined for K95 and SSHCMD is defined for UNIX.
  2664. Then, if either SSHBUILTIN or SSHCMD is defined, ANYSSH is also defined.
  2665. */
  2666. #ifndef NOSSH
  2667. #ifndef NO_SSL
  2668. #ifdef OS2ONLY
  2669. #define NOSSH
  2670. #endif /* OS2ONLY */
  2671. #ifdef NT
  2672. #ifndef CK_SSL
  2673. #define NOSSH
  2674. #endif /* CK_SSL */
  2675. #endif /* NT */
  2676. #else /* NO_SSL */
  2677. #define NOSSH
  2678. #endif /* NO_SSL */
  2679. #endif /* NOSSH */
  2680. #ifdef NOSSH /* NOSSH */
  2681. #ifdef SSHBUILTIN /* undefines any SSH selctors */
  2682. #undef SSHBUILTIN
  2683. #endif /* SSHBUILTIN */
  2684. #ifdef SFTP_BUILTIN
  2685. #undef SFTP_BUILTIN
  2686. #endif /* SFTP_BUILTIN */
  2687. #ifdef SSHCMD
  2688. #undef SSHCMD
  2689. #endif /* SSHCMD */
  2690. #ifdef ANYSSH
  2691. #undef ANYSSH
  2692. #endif /* ANYSSH */
  2693. #else /* Not NOSSH */
  2694. #ifndef NOLOCAL
  2695. #ifdef OS2
  2696. #ifndef SSHBUILTIN
  2697. #define SSHBUILTIN
  2698. #endif /* SSHBUILTIN */
  2699. #else /* Not OS2 */
  2700. #ifdef UNIX
  2701. #ifndef SSHCMD
  2702. #ifdef NETPTY
  2703. #ifndef NOPUSH
  2704. #define SSHCMD
  2705. #endif /* NOPUSH */
  2706. #endif /* NETPTY */
  2707. #endif /* SSHCMD */
  2708. #endif /* UNIX */
  2709. #endif /* OS2 */
  2710. #ifndef ANYSSH
  2711. #ifdef SSHBUILTIN
  2712. #define ANYSSH
  2713. #ifdef SSHCMD
  2714. #undef SSHCMD
  2715. #endif /* SSHCMD */
  2716. #else /* SSHBUILTIN */
  2717. #ifdef SSHCMD
  2718. #define ANYSSH
  2719. #endif /* SSHCMD */
  2720. #endif /* SSHBUILTIN */
  2721. #endif /* ANYSSH */
  2722. #endif /* NOLOCAL */
  2723. #endif /* NOSSH */
  2724. /* This is in case #ifdef SSH is used anywhere in the K95 modules */
  2725. #ifdef OS2
  2726. #ifdef SSHBUILTIN
  2727. #ifndef SSH
  2728. #define SSH
  2729. #endif /* SSH */
  2730. #endif /* SSHBUILTIN */
  2731. #endif /* OS2 */
  2732. #ifdef CK_AUTHENTICATION
  2733. #define CK_SECURITY
  2734. #else
  2735. #ifdef CK_SSL
  2736. #define CK_AUTHENTICATION
  2737. #define CK_SECURITY
  2738. #endif /* CK_SSL */
  2739. #endif /* CK_AUTHENTICATION */
  2740. /* Environment stuff */
  2741. #ifndef OS2ORUNIX
  2742. #ifndef NOPUTENV
  2743. #define NOPUTENV
  2744. #endif /* NOPUTENV */
  2745. #endif /* OS2ORUNIX */
  2746. #ifndef CK_ENVIRONMENT
  2747. #ifdef OS2
  2748. #define CK_ENVIRONMENT
  2749. #else
  2750. #ifdef UNIX
  2751. #define CK_ENVIRONMENT
  2752. #else
  2753. #ifdef STRATUS
  2754. #define CK_ENVIRONMENT
  2755. #else
  2756. #ifdef VMS
  2757. #define CK_ENVIRONMENT
  2758. #endif /* VMS */
  2759. #endif /* STRATUS */
  2760. #endif /* UNIX */
  2761. #endif /* OS2 */
  2762. #endif /* CK_ENVIRONMENT */
  2763. #ifndef NOSNDLOC /* RFC 779 SEND LOCATION */
  2764. #ifndef CK_SNDLOC
  2765. #define CK_SNDLOC
  2766. #endif /* CK_SNDLOC */
  2767. #endif /* NOSNDLOC */
  2768. #ifndef NOXDISPLOC /* RFC 1096 XDISPLOC */
  2769. #ifndef CK_XDISPLOC
  2770. #define CK_XDISPLOC
  2771. #endif /* CK_XDISPLOC */
  2772. #endif /* NOXDISPLOC */
  2773. #ifndef NOFORWARDX
  2774. #ifndef NOPUTENV
  2775. #ifndef NOSELECT
  2776. #ifndef CK_FORWARD_X
  2777. #ifdef CK_AUTHENTICATION
  2778. #ifndef OS2ONLY
  2779. #define CK_FORWARD_X
  2780. #endif /* OS2ONLY */
  2781. #endif /* CK_AUTHENTICATION */
  2782. #endif /* CK_FORWARD_X */
  2783. #endif /* NOSELECT */
  2784. #endif /* NOPUTENV */
  2785. #endif /* NOFORWARDX */
  2786. #ifndef NO_COMPORT
  2787. #ifdef TCPSOCKET
  2788. #ifndef TN_COMPORT
  2789. #define TN_COMPORT
  2790. #endif /* TN_COMPORT */
  2791. #endif /* TCPSOCKET */
  2792. #endif /* NO_COMPORT */
  2793. #endif /* TNCODE */
  2794. #ifndef NOXFER
  2795. #ifndef NOCTRLZ /* Allow SET FILE EOF CTRL-Z */
  2796. #ifndef CK_CTRLZ
  2797. #ifdef OS2ORUNIX
  2798. #define CK_CTRLZ
  2799. #endif /* OS2ORUNIX */
  2800. #endif /* CK_CTRLZ */
  2801. #endif /* NOCTRLZ */
  2802. #endif /* NOXFER */
  2803. #ifndef NOPERMS /* File permissions in A packets */
  2804. #ifndef CK_PERMS
  2805. #ifdef UNIX
  2806. #define CK_PERMS
  2807. #else
  2808. #ifdef VMS
  2809. #define CK_PERMS
  2810. #endif /* VMS */
  2811. #endif /* UNIX */
  2812. #endif /* CK_PERMS */
  2813. #endif /* NOPERMS */
  2814. #ifdef CK_PERMS
  2815. #define CK_PERMLEN 24 /* Max length of sys-dependent perms */
  2816. #endif /* CK_PERMS */
  2817. #ifdef UNIX /* NOSETBUF for everybody */
  2818. #ifndef NOSETBUF
  2819. #ifndef USE_SETBUF /* This is the escape clause */
  2820. #define NOSETBUF
  2821. #endif /* USE_SETBUF */
  2822. #endif /* NOSETBUF */
  2823. #endif /* UNIX */
  2824. #ifndef USE_STRERROR /* Whether to use strerror() */
  2825. #ifdef pdp11
  2826. #define USE_STRERROR
  2827. #endif /* pdp11 */
  2828. #endif /* USE_STRERROR */
  2829. #ifdef VMS /* Features for all VMS builds */
  2830. #ifndef NOJC
  2831. #define NOJC
  2832. #endif /* NOJC */
  2833. #ifndef NOSETBUF
  2834. #define NOSETBUF
  2835. #endif /* NOSETBUF */
  2836. #ifndef DYNAMIC
  2837. #define DYNAMIC
  2838. #endif /* DYNAMIC */
  2839. #ifndef NOCURSES
  2840. #ifndef CK_CURSES
  2841. #define CK_CURSES
  2842. #endif /* CK_CURSES */
  2843. #endif /* NOCURSES */
  2844. #endif /* VMS */
  2845. #ifndef NOCKTIMERS /* Dynamic timeouts */
  2846. #ifndef CK_TIMERS
  2847. #define CK_TIMERS
  2848. #endif /* CK_TIMERS */
  2849. #endif /* NOCKTIMERS */
  2850. #define CK_SPEED /* Control-prefix removal */
  2851. #ifdef NOCKSPEED
  2852. #undef CK_SPEED
  2853. #endif /* NOCKSPEED */
  2854. #ifndef NOCKXXCHAR
  2855. #ifndef CKXXCHAR
  2856. #ifdef UNIX
  2857. #define CKXXCHAR
  2858. #else
  2859. #ifdef OS2
  2860. #define CKXXCHAR
  2861. #endif /* OS2 */
  2862. #endif /* UNIX */
  2863. #endif /* CKXXCHAR */
  2864. #endif /* NOCKXXCHAR */
  2865. #ifdef MAC /* For Macintosh, no escape */
  2866. #define NOPUSH /* to operating system */
  2867. #endif /* MAC */
  2868. /* Systems where we can call zmkdir() to create directories. */
  2869. #ifndef CK_MKDIR
  2870. #ifndef NOMKDIR
  2871. #ifdef UNIX
  2872. #ifndef pdp11
  2873. #define CK_MKDIR
  2874. #endif /* pdp11 */
  2875. #endif /* UNIX */
  2876. #ifdef OS2
  2877. #define CK_MKDIR
  2878. #endif /* OS2 */
  2879. #ifdef VMS
  2880. #define CK_MKDIR
  2881. #endif /* VMS */
  2882. #ifdef STRATUS
  2883. #define CK_MKDIR
  2884. #endif /* STRATUS */
  2885. #ifdef OSK
  2886. #define CK_MKDIR
  2887. #endif /* OSK */
  2888. #ifdef datageneral
  2889. #define CK_MKDIR
  2890. #endif /* datageneral */
  2891. #endif /* CK_MKDIR */
  2892. #endif /* NOMKDIR */
  2893. #ifdef NOMKDIR /* Allow for command-line override */
  2894. #ifdef CK_MKDIR
  2895. #undef CK_MKDIR
  2896. #endif /* CK_MKDIR */
  2897. #endif /* NOMKDIR */
  2898. /* Systems for which we can enable the REDIRECT command automatically */
  2899. /* As of 6.0.193, it should work for all UNIX... */
  2900. #ifndef NOREDIRECT
  2901. #ifndef CK_REDIR
  2902. #ifdef UNIX
  2903. #define CK_REDIR
  2904. #endif /* UNIX */
  2905. #ifdef OS2 /* As well as OS/2 and friends... */
  2906. #define CK_REDIR
  2907. #endif /* OS2 */
  2908. #endif /* CK_REDIR */
  2909. #endif /* NOREDIRECT */
  2910. #ifdef NOPUSH /* But... REDIRECT command is not */
  2911. #ifdef CK_REDIR /* allowed if NOPUSH is defined. */
  2912. #undef CK_REDIR
  2913. #endif /* CK_REDIR */
  2914. #ifdef NETCMD /* Nor is SET NET COMMAND */
  2915. #undef NETCMD
  2916. #endif /* NETCMD */
  2917. #ifdef NETPTY
  2918. #undef NETPTY
  2919. #endif /* NETPTY */
  2920. #endif /* NOPUSH */
  2921. #ifndef PEXITSTAT /* \v(pexitstat) variable defined */
  2922. #ifdef OS2ORUNIX
  2923. #define PEXITSTAT
  2924. #else
  2925. #ifdef VMS
  2926. #define PEXITSTAT
  2927. #endif /* VMS */
  2928. #endif /* OS2ORUNIX */
  2929. #endif /* PEXITSTAT */
  2930. /* The following allows automatic enabling of REDIRECT to be overridden... */
  2931. #ifdef NOREDIRECT
  2932. #ifdef NETCMD
  2933. #undef NETCMD
  2934. #endif /* NETCMD */
  2935. #ifdef NETPTY
  2936. #undef NETPTY
  2937. #endif /* NETPTY */
  2938. #ifdef CK_REDIR
  2939. #undef CK_REDIR
  2940. #endif /* CK_REDIR */
  2941. #endif /* NOREDIRECT */
  2942. #ifdef NONETCMD
  2943. #ifdef NETCMD
  2944. #undef NETCMD
  2945. #endif /* NETCMD */
  2946. #ifdef NETPTY
  2947. #undef NETPTY
  2948. #endif /* NETPTY */
  2949. #endif /* NONETCMD */
  2950. #ifdef CK_REDIR
  2951. _PROTOTYP( int ttruncmd, (char *) );
  2952. #endif /* CK_REDIR */
  2953. /* Use built-in DIRECTORY command */
  2954. #ifndef NOMYDIR
  2955. #ifndef DOMYDIR
  2956. #ifdef UNIXOROSK
  2957. #define DOMYDIR
  2958. #else
  2959. #ifdef OS2
  2960. #define DOMYDIR
  2961. #else
  2962. #ifdef VMS
  2963. #define DOMYDIR
  2964. #endif /* VMS */
  2965. #endif /* OS2 */
  2966. #endif /* UNIXOROSK */
  2967. #endif /* DOMYDIR */
  2968. #endif /* NOMYDIR */
  2969. /* Sending from and receiving to commands/pipes */
  2970. #ifndef PIPESEND
  2971. #ifdef UNIX
  2972. #define PIPESEND
  2973. #endif /* UNIX */
  2974. #ifdef OS2
  2975. #define PIPESEND
  2976. #endif /* OS2 */
  2977. #endif /* PIPESEND */
  2978. #ifdef PIPESEND
  2979. #ifdef NOPIPESEND
  2980. #undef PIPESEND
  2981. #endif /* NOPIPESEND */
  2982. #ifdef NOPUSH
  2983. #undef PIPESEND
  2984. #endif /* NOPUSH */
  2985. #endif /* PIPESEND */
  2986. #ifdef NOPUSH
  2987. #ifdef BROWSER
  2988. #undef BROWSER
  2989. #endif /* BROWSER */
  2990. #endif /* NOPUSH */
  2991. /* Versions where we support the RESEND command */
  2992. #ifndef NOXFER
  2993. #ifndef NORESEND
  2994. #ifndef CK_RESEND
  2995. #ifdef UNIX
  2996. #ifndef pdp11
  2997. #define CK_RESEND
  2998. #endif /* pdp11 */
  2999. #endif /* UNIX */
  3000. #ifdef VMS
  3001. #define CK_RESEND
  3002. #endif /* VMS */
  3003. #ifdef OS2
  3004. #define CK_RESEND
  3005. #endif /* OS2 */
  3006. #ifdef AMIGA
  3007. #define CK_RESEND
  3008. #endif /* AMIGA */
  3009. #ifdef datageneral
  3010. #define CK_RESEND
  3011. #endif /* datageneral */
  3012. #ifdef STRATUS
  3013. #define CK_RESEND
  3014. #endif /* STRATUS */
  3015. #ifdef OSK
  3016. #define CK_RESEND
  3017. #endif /* OSK */
  3018. #endif /* CK_RESEND */
  3019. #endif /* NORESEND */
  3020. #endif /* NOXFER */
  3021. /* Systems implementing "Doomsday Kermit" protocol ... */
  3022. #ifndef DOOMSDAY
  3023. #ifdef UNIX
  3024. #define DOOMSDAY
  3025. #else
  3026. #ifdef VMS
  3027. #define DOOMSDAY
  3028. #else
  3029. #ifdef OS2
  3030. #define DOOMSDAY
  3031. #else
  3032. #ifdef STRATUS
  3033. #define DOOMSDAY
  3034. #endif /* STRATUS */
  3035. #endif /* OS2 */
  3036. #endif /* VMS */
  3037. #endif /* UNIX */
  3038. #endif /* DOOMSDAY */
  3039. /* Systems where we want the Thermometer to be used for fullscreen */
  3040. #ifdef OS2
  3041. #ifndef CK_PCT_BAR
  3042. #define CK_PCT_BAR
  3043. #endif /* CK_PCT_BAR */
  3044. #endif /* OS2 */
  3045. /* Systems where we have a REXX command */
  3046. #ifdef OS2
  3047. #ifdef __32BIT__
  3048. #ifndef NOREXX
  3049. #define CK_REXX
  3050. #endif /* NOREXX */
  3051. #endif /* __32BIT__ */
  3052. #endif /* OS2 */
  3053. /* Platforms that have a ZCHKPID function */
  3054. #ifdef OS2ORUNIX
  3055. #define ZCHKPID
  3056. #endif /* OS2ORUNIX */
  3057. #ifndef ZCHKPID
  3058. /* If we can't check pids then we have treat all pids as active & valid. */
  3059. #define zchkpid(x) 1
  3060. #endif /* ZCHKPID */
  3061. /* Systems that have a ZRENAME function */
  3062. #define ZRENAME /* They all do */
  3063. /* Systems that have a ZCOPY function */
  3064. #ifndef ZCOPY
  3065. #ifdef VMS
  3066. #define ZCOPY
  3067. #else
  3068. #ifdef OS2
  3069. #define ZCOPY
  3070. #else
  3071. #ifdef UNIX
  3072. #define ZCOPY
  3073. #else
  3074. #ifdef STRATUS
  3075. #define ZCOPY
  3076. #endif /* STRATUS */
  3077. #endif /* UNIX */
  3078. #endif /* OS2 */
  3079. #endif /* VMS */
  3080. #endif /* ZCOPY */
  3081. /* Systems that have ttgwsiz() (they all should but they don't) */
  3082. #ifndef NOTTGWSIZ
  3083. #ifndef CK_TTGWSIZ
  3084. #ifdef UNIX
  3085. #define CK_TTGWSIZ
  3086. #else
  3087. #ifdef VMS
  3088. #define CK_TTGWSIZ
  3089. #else
  3090. #ifdef OS2
  3091. #define CK_TTGWSIZ
  3092. #else
  3093. #ifdef OSK
  3094. #define CK_TTGWSIZ
  3095. #endif /* OSK */
  3096. #endif /* OS2 */
  3097. #endif /* VMS */
  3098. #endif /* UNIX */
  3099. #endif /* CK_TTGWSIZ */
  3100. #endif /* NOTTGWSIZ */
  3101. #ifdef NOTTGWSIZ
  3102. #ifdef CK_TTGWSIZ
  3103. #undef CK_TTGWSIZ
  3104. #endif /* CK_TTGWSIZ */
  3105. #endif /* NOTTGWSIZ */
  3106. #ifdef OS2
  3107. /* OS/2 C-Kermit features not available in 16-bit version... */
  3108. #ifdef OS2ONLY
  3109. #ifndef __32BIT__
  3110. #ifndef NOLOCAL
  3111. #ifdef PCFONTS /* PC Font support */
  3112. #undef PCFONTS
  3113. #endif /* PCFONTS */
  3114. #ifdef NPIPE /* Named Pipes communication */
  3115. #undef NPIPE
  3116. #endif /* NPIPE */
  3117. #ifdef CK_NETBIOS /* NETBIOS communication */
  3118. #undef CK_NETBIOS
  3119. #endif /* CK_NETBIOS */
  3120. #ifdef OS2MOUSE /* Mouse */
  3121. #undef OS2MOUSE
  3122. #endif /* OS2MOUSE */
  3123. #ifdef OS2PM /* Presentation Manager */
  3124. #undef OS2PM
  3125. #endif /* OS2PM */
  3126. #endif /* NOLOCAL */
  3127. #ifdef CK_REXX /* Rexx */
  3128. #undef CK_REXX
  3129. #endif /* CK_REXX */
  3130. #endif /* __32BIT__ */
  3131. #endif /* OS2ONLY */
  3132. /* OS/2 C-Kermit features not available in Windows NT version... */
  3133. #ifdef NT
  3134. #ifdef PCFONTS /* PC Font support */
  3135. #undef PCFONTS
  3136. #endif /* PCFONTS */
  3137. #ifdef OS2PM /* Presentation Manager */
  3138. #undef OS2PM
  3139. #endif /* OS2PM */
  3140. #ifdef CK_REXX /* Rexx */
  3141. #undef CK_REXX
  3142. #endif /* CK_REXX */
  3143. #endif /* NT */
  3144. #endif /* OS2 */
  3145. /*
  3146. Systems that have select().
  3147. This is used for both msleep() and for read-buffer checking in in_chk().
  3148. */
  3149. #define CK_SLEEPINT 250 /* milliseconds - set this to something that
  3150. divides evenly into 1000 */
  3151. #ifndef SELECT
  3152. #ifndef NOSELECT
  3153. #ifdef __linux__
  3154. #define SELECT
  3155. #else
  3156. #ifdef SUNOS4
  3157. #define SELECT
  3158. #else
  3159. #ifdef NEXT
  3160. #define SELECT
  3161. #else
  3162. #ifdef RTAIX
  3163. #define SELECT
  3164. #else
  3165. #ifdef HPUX
  3166. /*
  3167. Not really. I think it's only in HP-UX 7.0 and later, except it's also
  3168. in earlier versions that have TCP/IP installed. Override this default
  3169. in particular HP-UX makefile entries by adding -DNOSELECT, as in (e.g.)
  3170. the HP-UX 6.5 ones.
  3171. */
  3172. #define SELECT
  3173. #else
  3174. #ifdef AIXRS
  3175. #define SELECT
  3176. #else
  3177. #ifdef BSD44
  3178. #define SELECT
  3179. #else
  3180. #ifdef BSD4
  3181. #define SELECT
  3182. #else
  3183. #ifdef OXOS
  3184. #define SELECT
  3185. #else
  3186. #ifdef OS2
  3187. #define SELECT
  3188. #else
  3189. #ifdef BEBOX
  3190. #define SELECT
  3191. #endif /* BEBOX */
  3192. #endif /* OS2 */
  3193. #endif /* OXOS */
  3194. #endif /* BSD4 */
  3195. #endif /* BSD44 */
  3196. #endif /* AIXRS */
  3197. #endif /* HPUX */
  3198. #endif /* RTAIX */
  3199. #endif /* NEXT */
  3200. #endif /* __linux__ */
  3201. #endif /* SUNOS4 */
  3202. #endif /* NOSELECT */
  3203. #endif /* SELECT */
  3204. /*
  3205. The following section moved here from ckcnet.h in 6.1 because select()
  3206. is now used for non-networking purposes.
  3207. */
  3208. /* On HP-9000/500 HP-UX 5.21 this stuff is not defined in any header file */
  3209. #ifdef hp9000s500
  3210. #ifndef NEEDSELECTDEFS
  3211. #define NEEDSELECTDEFS
  3212. #endif /* NEEDSELECTDEFS */
  3213. #endif /* hp9000s500 */
  3214. #ifdef NEEDSELECTDEFS
  3215. typedef long fd_mask;
  3216. #ifndef NBBY
  3217. #define NBBY 8
  3218. #endif /* NBBY */
  3219. #ifndef FD_SETSIZE
  3220. #define FD_SETSIZE 32
  3221. #endif /* FD_SETSIZE */
  3222. #ifndef NFDBITS
  3223. #define NFDBITS (sizeof(fd_mask) * NBBY)
  3224. #endif /* NFDBITS */
  3225. #ifndef howmany
  3226. #define howmany(x,y) (((x)+((y)-1))/(y))
  3227. #endif /* howmany */
  3228. typedef struct fd_set {
  3229. fd_mask fds_bits[howmany(FD_SETSIZE, NFDBITS)];
  3230. } fd_set;
  3231. #ifndef FD_SET
  3232. #define FD_SET(n,p) ((p)->fds_bits[(n)/NFDBITS] |= (1 << ((n) % NFDBITS)))
  3233. #endif /* FD_SET */
  3234. #ifndef FD_CLR
  3235. #define FD_CLR(n,p) ((p)->fds_bits[(n)/NFDBITS] &= ~(1 << ((n) % NFDBITS)))
  3236. #endif /* FD_CLR */
  3237. #ifndef FD_ISSET
  3238. #define FD_ISSET(n,p) ((p)->fds_bits[(n)/NFDBITS] & (1 << ((n) % NFDBITS)))
  3239. #endif /* FD_ISSET */
  3240. #ifndef FD_COPY
  3241. #define FD_COPY(f,t) (bcopy(f,t,sizeof(*(f)))
  3242. #endif /* FD_COPY */
  3243. #ifndef FD_ZERO
  3244. #define FD_ZERO(p) bzero((char *)(p),sizeof(*(p)))
  3245. #endif /* FD_ZERO */
  3246. #endif /* NEEDSELECTDEFS */
  3247. /*
  3248. CK_NEED_SIG is defined if the system cannot check the console to
  3249. to see if characters are waiting. This is used during local-mode file
  3250. transfer to interrupt the transfer, refresh the screen display, etc.
  3251. If CK_NEED_SIG is defined, then file-transfer interruption characters
  3252. have to be preceded a special character, e.g. the SIGQUIT character.
  3253. CK_NEED_SIG should be defined if the conchk() function is not operational.
  3254. */
  3255. #ifdef NOPOLL /* For overriding CK_POLL definition */
  3256. #ifdef CK_POLL
  3257. #undef CK_POLL
  3258. #endif /* CK_POLL */
  3259. #endif /* NOPOLL */
  3260. #ifndef CK_POLL /* If we don't have poll() */
  3261. #ifndef RDCHK /* And we don't have rdchk() */
  3262. #ifndef SELECT /* And we don't have select() */
  3263. #ifdef ATTSV
  3264. #ifndef aegis
  3265. #ifndef datageneral
  3266. #ifndef OXOS
  3267. #define CK_NEED_SIG
  3268. #endif /* OXOS */
  3269. #endif /* datageneral */
  3270. #endif /* aegis */
  3271. #endif /* ATTSV */
  3272. #ifdef POSIX
  3273. #ifndef CK_NEED_SIG
  3274. #define CK_NEED_SIG
  3275. #endif /* CK_NEED_SIG */
  3276. #endif /* POSIX */
  3277. #endif /* SELECT */
  3278. #endif /* RDCHK */
  3279. #endif /* CK_POLL */
  3280. #ifdef HPUX /* HP-UX has select() */
  3281. #ifdef CK_NEED_SIG
  3282. #undef CK_NEED_SIG
  3283. #endif /* CK_NEED_SIG */
  3284. #endif /* HPUX */
  3285. #ifdef AIXRS /* AIX has select() */
  3286. #ifdef CK_NEED_SIG
  3287. #undef CK_NEED_SIG
  3288. #endif /* CK_NEED_SIG */
  3289. #endif /* AIXRS */
  3290. #ifdef BSD44 /* 4.4BSD has FIONREAD */
  3291. #ifdef CK_NEED_SIG
  3292. #undef CK_NEED_SIG
  3293. #endif /* CK_NEED_SIG */
  3294. #endif /* BSD44 */
  3295. #ifdef QNX /* QNX has FIONREAD and select() */
  3296. #ifdef CK_NEED_SIG
  3297. #undef CK_NEED_SIG
  3298. #endif /* CK_NEED_SIG */
  3299. #endif /* QNX */
  3300. #ifdef COHERENT
  3301. #ifndef NOTIMEZONE
  3302. #define NOTIMEZONE
  3303. #endif /* NOTIMEZONE */
  3304. #endif /* COHERENT */
  3305. #ifdef UNIX
  3306. #ifndef HAVE_TZ /* Can we use struct timezone? */
  3307. #ifndef NOTIMEZONE
  3308. #ifdef PTX
  3309. #define NOTIMEZONE
  3310. #else
  3311. #ifndef SELECT
  3312. #ifdef COHERENT
  3313. #define NOTIMEZONE
  3314. #else
  3315. #ifdef BELLV10
  3316. #define NOTIMEZONE
  3317. #endif /* BELLV10 */
  3318. #endif /* COHERENT */
  3319. #endif /* SELECT */
  3320. #endif /* PTX */
  3321. #endif /* NOTIMEZONE */
  3322. #endif /* HAVE_TZ */
  3323. #ifndef NOTIMEVAL /* Can we use struct timeval? */
  3324. #ifndef HAVE_TV
  3325. #define HAVE_TV
  3326. #endif /* HAVE_TV */
  3327. #endif /* NOTIMEVAL */
  3328. #ifndef NOTIMEZONE
  3329. #ifndef HAVE_TZ
  3330. #define HAVE_TZ
  3331. #endif /* HAVE_TZ */
  3332. #endif /* NOTIMEZONE */
  3333. #endif /* UNIX */
  3334. #ifdef SCO32
  3335. #ifdef HAVE_TV
  3336. #undef HAVE_TV
  3337. #endif /* HAVE_TV */
  3338. #ifdef HAVE_TZ
  3339. #undef HAVE_TZ
  3340. #endif /* HAVE_TZ */
  3341. #ifndef NOTIMEVAL
  3342. #define NOTIMEVAL
  3343. #endif /* NOTIMEVAL */
  3344. #ifndef NOTIMEZONE
  3345. #define NOTIMEZONE
  3346. #endif /* NOTIMEZONE */
  3347. #endif /* SCO32 */
  3348. #ifdef ATT7300
  3349. #ifdef HAVE_TV
  3350. #undef HAVE_TV
  3351. #endif /* HAVE_TV */
  3352. #ifdef HAVE_TZ
  3353. #undef HAVE_TZ
  3354. #endif /* HAVE_TZ */
  3355. #ifndef NOTIMEVAL
  3356. #define NOTIMEVAL
  3357. #endif /* NOTIMEVAL */
  3358. #ifndef NOTIMEZONE
  3359. #define NOTIMEZONE
  3360. #endif /* NOTIMEZONE */
  3361. #endif /* ATT7300 */
  3362. /*
  3363. Automatic parity detection.
  3364. This actually implies a lot more now: length-driven packet reading,
  3365. "Doomsday Kermit" IBM Mainframe file transfer through 3270 data streams, etc.
  3366. */
  3367. #ifdef UNIX /* For Unix */
  3368. #ifndef NOPARSEN
  3369. #define PARSENSE
  3370. #endif /* NOPARSEN */
  3371. #endif /* UNIX */
  3372. #ifdef VMS /* ... and VMS */
  3373. #ifndef NOPARSEN
  3374. #define PARSENSE
  3375. #endif /* NOPARSEN */
  3376. #ifdef __GNUC__
  3377. #define VMSGCC
  3378. #endif /* __GNUC__ */
  3379. #endif /* VMS */
  3380. #ifdef MAC /* and Macintosh */
  3381. #ifndef NOPARSEN
  3382. #define PARSENSE
  3383. #endif /* NOPARSEN */
  3384. #endif /* MAC */
  3385. #ifdef STRATUS /* and Stratus VOS */
  3386. #ifndef NOPARSEN
  3387. #define PARSENSE
  3388. #endif /* NOPARSEN */
  3389. #endif /* STRATUS */
  3390. #ifdef OS2 /* and OS/2, finally */
  3391. #ifndef NOPARSEN
  3392. #define PARSENSE
  3393. #endif /* NOPARSEN */
  3394. #endif /* OS2 */
  3395. #ifndef NODYNAMIC /* DYNAMIC is default for UNIX */
  3396. #ifndef DYNAMIC /* as of C-Kermit 7.0 */
  3397. #ifdef UNIX
  3398. #define DYNAMIC
  3399. #endif /* UNIX */
  3400. #endif /* DYNAMIC */
  3401. #endif /* NODYNAMIC */
  3402. #ifdef DYNAMIC /* If DYNAMIC is defined */
  3403. #define DCMDBUF /* then also define this. */
  3404. #endif /* DYNAMIC */
  3405. #ifndef CK_LBRK /* Can send Long BREAK */
  3406. #ifdef UNIX /* (everybody but OS-9) */
  3407. #define CK_LBRK
  3408. #endif /* UNIX */
  3409. #ifdef VMS
  3410. #define CK_LBRK
  3411. #endif /* VMS */
  3412. #ifdef datageneral
  3413. #define CK_LBRK
  3414. #endif /* datageneral */
  3415. #ifdef GEMDOS
  3416. #define CK_LBRK
  3417. #endif /* GEMDOS */
  3418. #ifdef OS2
  3419. #define CK_LBRK
  3420. #endif /* OS2 */
  3421. #ifdef AMIGA
  3422. #define CK_LBRK
  3423. #endif /* AMIGA */
  3424. #ifdef STRATUS
  3425. #define CK_LBRK
  3426. #endif /* STRATUS */
  3427. #endif /* CK_LBRK */
  3428. /* Carrier treatment */
  3429. /* These are defined here because they are shared by the system dependent */
  3430. /* and the system independent modules. */
  3431. #define CAR_OFF 0 /* Off: ignore carrier always. */
  3432. #define CAR_ON 1 /* On: heed carrier always, except during DIAL. */
  3433. #define CAR_AUT 2 /* Auto: heed carrier, but only if line is declared */
  3434. /* to be a modem line, and only during CONNECT. */
  3435. /* And more generically (for use with any ON/OFF/AUTO feature) */
  3436. #define CK_OFF 0
  3437. #define CK_ON 1
  3438. #define CK_AUTO 2
  3439. #ifndef NOLOCAL
  3440. /*
  3441. Serial interface speeds available.
  3442. As of C-Kermit 6.1 there is a new method to get the supported
  3443. speeds, which obviates the need for all the craziness below. At runtime,
  3444. just call the new ttspdlist() routine to get a list of supported speeds.
  3445. Then the user interface module can build a keyword table or menu from it.
  3446. */
  3447. #ifndef TTSPDLIST
  3448. #ifdef UNIX /* For now, only for UNIX */
  3449. #ifndef OLINUXHISPEED /* But not systems with hacks for */
  3450. #ifndef MINIX /* high speeds, like 110 = 115200 */
  3451. #define TTSPDLIST
  3452. #endif /* MINIX */
  3453. #endif /* OLINUXHISPEED */
  3454. #else
  3455. #ifdef VMS
  3456. #define TTSPDLIST /* VMS gets it too */
  3457. #endif /* VMS */
  3458. #endif /* UNIX */
  3459. #endif /* TTSPDLIST */
  3460. #ifndef NODIAL /* Hangup by modem command */
  3461. #ifndef NOMDMHUP
  3462. #ifndef MDMHUP
  3463. #define MDMHUP
  3464. #endif /* MDMHUP */
  3465. #endif /* NOMDMHUP */
  3466. #endif /* NODIAL */
  3467. #ifdef NOSPL
  3468. #ifndef NOLOGDIAL /* Connection log needs mjd(), etc. */
  3469. #define NOLOGDIAL
  3470. #endif /* NOLOGDIAL */
  3471. #endif /* NOSPL */
  3472. #ifdef pdp11
  3473. #define NOLOGDIAL
  3474. #endif /* pdp11 */
  3475. #ifndef NOLOGDIAL /* Connection log */
  3476. #ifndef CXLOGFILE
  3477. #define CXLOGFILE "CX.LOG" /* Default connection log file name */
  3478. #endif /* CXLOGFILE */
  3479. #ifndef CKLOGDIAL
  3480. #ifndef CK_SMALL
  3481. #define CKLOGDIAL
  3482. #define CXLOGBUFL 1024 /* Connection log record buffer size */
  3483. #endif /* CK_SMALL */
  3484. #endif /* NOLOGDIAL */
  3485. #endif /* CKLOGDIAL */
  3486. #endif /* NOLOCAL */
  3487. #ifdef NOTTSPDLIST /* Except if NOTTSPDLIST is defined */
  3488. #ifdef TTSPDLIST
  3489. #undef TTSPDLIST
  3490. #endif /* TTSPDLIST */
  3491. #endif /* NOTTSPDLIST */
  3492. #ifdef TTSPDLIST
  3493. _PROTOTYP( long * ttspdlist, (void) );
  3494. #else /* TTSPDLIST not defined */
  3495. /*
  3496. We must use a long and convoluted series of #ifdefs that have to be kept in
  3497. sync with the code in the ck?tio.c module.
  3498. We assume that everybody supports: 0, 110, 300, 600, 1200, 2400, 4800, and
  3499. 9600 bps. Symbols for other speeds are defined here. You can also add
  3500. definitions on the CC command lines. These definitions affect the SET SPEED
  3501. keyword table, and are not necessarily usable in the system-dependent
  3502. speed-setting code in the ck?tio.c modules, which depends on system-specific
  3503. symbols like (in UNIX) B19200. In other words, just defining it doesn't
  3504. mean it'll work -- you also have to supply the supporting code in ttsspd()
  3505. and ttgspd() in ck?tio.c.
  3506. The symbols have the form BPS_xxxx, where xxxx is the speed in bits per
  3507. second, or (for bps values larger than 9999) thousands of bps followed by K.
  3508. The total symbol length should be 8 characters or less. Some values are
  3509. enabled automatically below. You can disable a particular value by defining
  3510. NOB_xxxx on the CC command line.
  3511. */
  3512. #ifndef NOB_50
  3513. #define BPS_50 /* 50 bps */
  3514. #endif
  3515. #ifndef NOB_75
  3516. #define BPS_75 /* 75 bps */
  3517. #endif
  3518. #ifndef NOB7512
  3519. #ifdef ANYBSD
  3520. #define BPS_7512 /* 75/1200 Split Speed */
  3521. #endif /* ANYBSD */
  3522. #endif /* NOB7512 */
  3523. #ifndef NOB134
  3524. #ifdef SOLARIS25
  3525. #define BPS_134
  3526. #else
  3527. #undef BPS_134 /* 134.5 bps (IBM 2741) */
  3528. #endif /* BPS_134 */
  3529. #endif /* NOB134 */
  3530. #ifndef NOB_150
  3531. #define BPS_150 /* 150 bps */
  3532. #endif
  3533. #ifndef NOB_200
  3534. #define BPS_200 /* 200 bps */
  3535. #endif
  3536. #ifndef NOB_1800
  3537. #ifdef MAC
  3538. #define BPS_1800 /* 1800 bps */
  3539. #else
  3540. #ifdef SOLARIS25
  3541. #define BPS_1800
  3542. #endif
  3543. #endif
  3544. #endif
  3545. #ifndef NOB_3600
  3546. #ifndef SOLARIS25
  3547. #define BPS_3600 /* 3600 bps */
  3548. #endif
  3549. #endif
  3550. #ifndef NOB_7200
  3551. #ifndef SOLARIS25
  3552. #define BPS_7200 /* 7200 bps */
  3553. #endif /* SOLARIS25 */
  3554. #endif
  3555. #ifndef NOB_14K
  3556. #ifdef BSD44
  3557. #define BPS_14K /* 14400 bps */
  3558. #else
  3559. #ifdef OS2
  3560. #define BPS_14K
  3561. #else
  3562. #ifdef NEXT
  3563. #define BPS_14K
  3564. #else
  3565. #ifdef MAC
  3566. #define BPS_14K
  3567. #else
  3568. #ifdef AMIGA
  3569. #define BPS_14K
  3570. #endif /* AMIGA */
  3571. #endif /* MAC */
  3572. #endif /* NEXT */
  3573. #endif /* OS2 */
  3574. #endif /* BSD44 */
  3575. #endif /* NOB_14K */
  3576. #ifndef NOB_19K
  3577. #define BPS_19K /* 19200 bps */
  3578. #endif
  3579. #ifndef NOB_28K
  3580. #ifdef BSD44
  3581. #define BPS_28K
  3582. #else
  3583. #ifdef OS2
  3584. #define BPS_28K
  3585. #else
  3586. #ifdef NEXT
  3587. #define BPS_28K /* 28800 bps */
  3588. #else
  3589. #ifdef MAC
  3590. #define BPS_28K /* 28800 bps */
  3591. #endif /* MAC */
  3592. #endif /* NEXT */
  3593. #endif /* OS2 */
  3594. #endif /* BSD44 */
  3595. #endif /* NOB_28K */
  3596. #ifndef NOB_38K
  3597. #define BPS_38K /* 38400 bps */
  3598. #endif
  3599. #ifndef NOB_57K
  3600. #ifdef Plan9
  3601. #define BPS_57K
  3602. #else
  3603. #ifdef SOLARIS25
  3604. #define BPS_57K
  3605. #else
  3606. #ifdef VMS
  3607. #define BPS_57K /* 57600 bps */
  3608. #else
  3609. #ifdef OS2
  3610. #define BPS_57K
  3611. #else
  3612. #ifdef __linux__
  3613. #define BPS_57K
  3614. #else
  3615. #ifdef HPUX
  3616. #define BPS_57K
  3617. #else
  3618. #ifdef NEXT
  3619. #define BPS_57K
  3620. #else
  3621. #ifdef __386BSD__
  3622. #define BPS_57K
  3623. #else
  3624. #ifdef __FreeBSD__
  3625. #define BPS_57K
  3626. #else
  3627. #ifdef __NetBSD__
  3628. #define BPS_57K
  3629. #else
  3630. #ifdef MAC
  3631. #define BPS_57K
  3632. #else
  3633. #ifdef QNX
  3634. #define BPS_57K
  3635. #else
  3636. #ifdef BEOSORBEBOX
  3637. #define BPS_57K
  3638. #else
  3639. #ifdef IRIX62
  3640. #define BPS_57K
  3641. #else
  3642. #ifdef SCO_OSR504
  3643. #define BPS_57K
  3644. #else
  3645. #ifdef BSDI2
  3646. #define BPS_57K
  3647. #endif /* BSDI2 */
  3648. #endif /* SCO_OSR504 */
  3649. #endif /* IRIX62 */
  3650. #endif /* BEOSORBEBOX */
  3651. #endif /* QNX */
  3652. #endif /* MAC */
  3653. #endif /* __NetBSD__ */
  3654. #endif /* __FreeBSD__ */
  3655. #endif /* __386BSD__ */
  3656. #endif /* NEXT */
  3657. #endif /* HPUX */
  3658. #endif /* __linux__ */
  3659. #endif /* OS2 */
  3660. #endif /* VMS */
  3661. #endif /* SOLARIS25 */
  3662. #endif /* Plan9 */
  3663. #endif /* NOB_57K */
  3664. #ifndef NOB_76K
  3665. #ifdef BSDI2
  3666. #define BPS_76K
  3667. #endif /* BSDI2 */
  3668. #ifdef Plan9
  3669. #define BPS_76K
  3670. #endif /* Plan9 */
  3671. #ifdef SOLARIS25
  3672. #define BPS_76K
  3673. #endif /* SOLARIS25 */
  3674. #ifdef VMS
  3675. #define BPS_76K /* 76800 bps */
  3676. #endif /* VMS */
  3677. #ifdef OS2
  3678. #ifdef __32BIT__
  3679. #define BPS_76K
  3680. #endif /* __32BIT__ */
  3681. #endif /* OS2 */
  3682. #ifdef QNX
  3683. #define BPS_76K
  3684. #endif /* QNX */
  3685. #ifdef IRIX62
  3686. #define BPS_76K
  3687. #endif /* IRIX62 */
  3688. #ifdef SCO_OSR504
  3689. #define BPS_76K
  3690. #endif /* SCO_OSR504 */
  3691. #endif /* NOB_76K */
  3692. #ifndef NOB_115K
  3693. #ifdef BSDI2
  3694. #define BPS_115K
  3695. #endif /* BSDI2 */
  3696. #ifdef Plan9
  3697. #define BPS_115K
  3698. #endif /* Plan9 */
  3699. #ifdef SOLARIS25
  3700. #define BPS_115K
  3701. #endif /* SOLARIS25 */
  3702. #ifdef VMS
  3703. #define BPS_115K /* 115200 bps */
  3704. #else
  3705. #ifdef QNX
  3706. #define BPS_115K
  3707. #else
  3708. #ifdef HPUX
  3709. #define BPS_115K
  3710. #else
  3711. #ifdef __linux__
  3712. #define BPS_115K
  3713. #else
  3714. #ifdef __386BSD__
  3715. #define BPS_115K
  3716. #else
  3717. #ifdef __FreeBSD__
  3718. #define BPS_115K
  3719. #else
  3720. #ifdef __NetBSD__
  3721. #define BPS_115K
  3722. #else
  3723. #ifdef OS2
  3724. #ifdef __32BIT__
  3725. #define BPS_115K
  3726. #endif /* __32BIT__ */
  3727. #else
  3728. #ifdef BEOSORBEBOX
  3729. #define BPS_115K
  3730. #else
  3731. #ifdef IRIX62
  3732. #define BPS_115K
  3733. #else
  3734. #ifdef SCO_OSR504
  3735. #define BPS_115K
  3736. #endif /* SCO_OSR504 */
  3737. #endif /* IRIX62 */
  3738. #endif /* BEOSORBEBOX */
  3739. #endif /* OS2 */
  3740. #endif /* __NetBSD__ */
  3741. #endif /* __FreeBSD__ */
  3742. #endif /* __386BSD__ */
  3743. #endif /* __linux__ */
  3744. #endif /* HPUX */
  3745. #endif /* QNX */
  3746. #endif /* VMS */
  3747. #endif /* NOB_115K */
  3748. #ifndef NOB_230K /* 230400 bps */
  3749. #ifdef BSDI2
  3750. #define BPS_230K
  3751. #else
  3752. #ifdef SCO_OSR504
  3753. #define BPS_230K
  3754. #else
  3755. #ifdef __linux__
  3756. #define BPS_230K
  3757. #else
  3758. #ifdef SOLARIS25
  3759. #define BPS_230K
  3760. #else
  3761. #ifdef OS2
  3762. #ifdef __32BIT__
  3763. #define BPS_230K
  3764. #endif /* __32BIT__ */
  3765. #else
  3766. #undef BPS_230K
  3767. #endif /* OS2 */
  3768. #endif /* SOLARIS25 */
  3769. #endif /* __linux__ */
  3770. #endif /* SCO_OSR504 */
  3771. #endif /* BSDI2 */
  3772. #endif /* NOB_230K */
  3773. #ifndef NOB_460K /* 460800 bps */
  3774. #ifdef SCO_OSR504
  3775. #define BPS_460K
  3776. #else
  3777. #ifdef __linux__
  3778. #define BPS_460K
  3779. #else
  3780. #ifdef OS2
  3781. #ifdef __32BIT__
  3782. #define BPS_460K
  3783. #endif /* __32BIT__ */
  3784. #else
  3785. #undef BPS_460K
  3786. #endif /* __linux__ */
  3787. #endif /* SCO_OSR504 */
  3788. #endif /* OS2 */
  3789. #endif /* NOB_460K */
  3790. #ifndef NOB_921K /* 921600 bps */
  3791. #ifdef SCO_OSR504
  3792. #define BPS_921K
  3793. #endif /* SCO_OSR504 */
  3794. #endif /* NOB_921K */
  3795. #ifdef BPS_921K /* Maximum speed defined */
  3796. #define MAX_SPD 921600L
  3797. #else
  3798. #ifdef BPS_460K
  3799. #define MAX_SPD 460800L
  3800. #else
  3801. #ifdef BPS_230K
  3802. #define MAX_SPD 230400L
  3803. #else
  3804. #ifdef BPS_115K
  3805. #define MAX_SPD 115200L
  3806. #else
  3807. #ifdef BPS_76K
  3808. #define MAX_SPD 76800L
  3809. #else
  3810. #ifdef BPS_57K
  3811. #define MAX_SPD 57600L
  3812. #else
  3813. #ifdef BPS_38K
  3814. #define MAX_SPD 38400L
  3815. #else
  3816. #ifdef BPS_28K
  3817. #define MAX_SPD 28800L
  3818. #else
  3819. #ifdef BPS_19K
  3820. #define MAX_SPD 19200L
  3821. #else
  3822. #ifdef BPS_14K
  3823. #define MAX_SPD 14400L
  3824. #else
  3825. #define MAX_SPD 9600L
  3826. #endif
  3827. #endif
  3828. #endif
  3829. #endif
  3830. #endif
  3831. #endif
  3832. #endif
  3833. #endif
  3834. #endif
  3835. #endif
  3836. #endif /* TTSPDLIST */
  3837. #ifndef CONGSPD /* Systems that can call congspd() */
  3838. #ifdef UNIX
  3839. #define CONGSPD
  3840. #endif /* UNIX */
  3841. #ifdef VMS
  3842. #define CONGSPD
  3843. #endif /* VMS */
  3844. #ifdef STRATUS
  3845. #define CONGSPD
  3846. #endif /* STRATUS */
  3847. #endif /* CONGSPD */
  3848. /* Types of flow control available */
  3849. #define CK_XONXOFF /* Everybody can do this, right? */
  3850. #ifdef AMIGA /* Commodore Amiga */
  3851. #define CK_RTSCTS /* has RTS/CTS */
  3852. #endif /* AMIGA */
  3853. #ifdef SUN4S5 /* SunOS in System V environment */
  3854. #define CK_RTSCTS
  3855. #else /* SunOS 4.0/4.1 in BSD environment */
  3856. #ifdef SUNOS4 /* SunOS 4.0+later supports RTS/CTS */
  3857. #ifdef SUNOS41 /* Easy in 4.1 and later */
  3858. #define CK_RTSCTS
  3859. #else /* Harder in 4.0 */
  3860. #ifndef __GNUC__ /* (see tthflow() in ckutio.c) */
  3861. #ifndef GNUC
  3862. #define CK_RTSCTS /* Only if not using GNU gcc */
  3863. #endif /* __GNUC__ */
  3864. #endif /* GNUC */
  3865. #endif /* SUNOS41 */
  3866. #endif /* SUNOS4 */
  3867. #endif /* SUN4S5 */
  3868. #ifdef BSD44 /* And in 4.4 BSD, including BSDI */
  3869. #define CK_RTSCTS
  3870. #endif /* BSD44 */
  3871. #ifdef TERMIOX /* Sys V R4 <termiox.h> */
  3872. #ifndef CK_RTSCTS
  3873. #define CK_RTSCTS
  3874. #endif /* CK_RTSCTS */
  3875. #ifndef CK_DTRCD
  3876. #define CK_DTRCD
  3877. #endif /* CK_DTRCD */
  3878. #else
  3879. #ifdef STERMIOX /* Sys V R4 <sys/termiox.h> */
  3880. #ifndef CK_RTSCTS
  3881. #define CK_RTSCTS
  3882. #endif /* CK_RTSCTS */
  3883. #ifndef CK_DTRCD
  3884. #define CK_DTRCD
  3885. #endif /* CK_DTRCD */
  3886. #endif /* STERMIOX */
  3887. #endif /* TERMIOX */
  3888. #ifdef OXOS /* Olivetti X/OS R2 struct termios */
  3889. #define CK_RTSCTS /* Ditto. */
  3890. #define CK_DTRCD
  3891. #endif /* OXOS */
  3892. #ifdef AIXRS /* RS/6000 with AIX 3.x */
  3893. #define CK_RTSCTS /* Has its own peculiar method... */
  3894. #endif /* AIXRS */
  3895. #ifdef __linux__ /* Linux */
  3896. #define CK_RTSCTS
  3897. #endif /* __linux__ */
  3898. /*
  3899. Hardware flow control is not defined in POSIX.1. Nevertheless, a certain
  3900. style API for hardware flow control, using tcsetattr() and the CRTSCTS
  3901. bit(s), seems to be gaining currency on POSIX-based UNIX systems. The
  3902. following code defines the symbol POSIX_CRTSCTS for such systems.
  3903. */
  3904. #ifdef CK_RTSCTS
  3905. #ifdef __bsdi__ /* BSDI, a.k.a. BSD/386 */
  3906. #define POSIX_CRTSCTS
  3907. #endif /* __bsdi__ */
  3908. #ifdef __linux__ /* Linux */
  3909. #define POSIX_CRTSCTS
  3910. #endif /* __linux__ */
  3911. #ifdef __NetBSD__ /* NetBSD */
  3912. #define POSIX_CRTSCTS
  3913. #endif /* __NetBSD__ */
  3914. #ifdef __OpenBSD__
  3915. #define POSIX_CRTSCTS
  3916. #endif /* __OpenBSD__ */
  3917. #ifdef BEOSORBEBOX /* BeBOX */
  3918. #define POSIX_CRTSCTS
  3919. /* BEBOX defines CRTSFL as (CTSFLOW & RTSFLOW) */
  3920. #define CRTSCTS CRTSFL
  3921. #endif /* BEOSORBEBOX */
  3922. #ifdef IRIX52 /* IRIX 5.2 and later */
  3923. #define POSIX_CRTSCTS
  3924. #define CRTSCTS CNEW_RTSCTS /* See <sys/termios.h> */
  3925. #endif /* IRIX52 */
  3926. #endif /* CK_RTSCTS */
  3927. /* Implementations that have implemented the ttsetflow() function. */
  3928. #ifndef CK_TTSETFLOW
  3929. #ifdef UNIX
  3930. #define CK_TTSETFLOW
  3931. #endif /* UNIX */
  3932. #ifdef OS2
  3933. #define CK_TTSETFLOW
  3934. #endif /* OS2 */
  3935. #endif /* CK_TTSETFLOW */
  3936. #ifdef CK_TTSETFLOW
  3937. _PROTOTYP( int ttsetflow, (int) );
  3938. #endif /* CK_TTSETFLOW */
  3939. /*
  3940. Systems where we can expand tilde at the beginning of file or directory names
  3941. */
  3942. #ifdef POSIX
  3943. #ifndef DTILDE
  3944. #define DTILDE
  3945. #endif /* DTILDE */
  3946. #endif /* POSIX */
  3947. #ifdef BSD4
  3948. #ifndef DTILDE
  3949. #define DTILDE
  3950. #endif /* DTILDE */
  3951. #endif /* BSD4 */
  3952. #ifdef ATTSV
  3953. #ifndef DTILDE
  3954. #define DTILDE
  3955. #endif /* DTILDE */
  3956. #endif /* ATTSV */
  3957. #ifdef OSK
  3958. #ifndef DTILDE
  3959. #define DTILDE
  3960. #endif /* DTILDE */
  3961. #endif /* OSK */
  3962. #ifdef HPUX /* I don't know why this is */
  3963. #ifndef DTILDE /* necessary, since -DHPUX */
  3964. #define DTILDE /* automatically defines ATTSV */
  3965. #endif /* DTILDE */ /* (see above) ... */
  3966. #endif /* HPUX */
  3967. /*
  3968. This is mainly for the benefit of ckufio.c (UNIX and OS/2 file support).
  3969. Systems that have an atomic rename() function, so we don't have to use
  3970. link() and unlink().
  3971. */
  3972. #ifdef POSIX
  3973. #ifndef RENAME
  3974. #define RENAME
  3975. #endif /* RENAME */
  3976. #endif /* POSIX */
  3977. #ifdef OS2
  3978. #ifndef RENAME
  3979. #define RENAME
  3980. #endif /* RENAME */
  3981. #endif /* OS2 */
  3982. #ifdef SUNOS41
  3983. #ifndef RENAME
  3984. #define RENAME
  3985. #endif /* RENAME */
  3986. #endif /* SUNOS41 */
  3987. #ifdef SVR4
  3988. #ifndef RENAME
  3989. #define RENAME
  3990. #endif /* RENAME */
  3991. #endif /* SVR4 */
  3992. #ifdef AIXRS
  3993. #ifndef RENAME
  3994. #define RENAME
  3995. #endif /* RENAME */
  3996. #endif /* AIXRS */
  3997. #ifdef BSD44
  3998. #ifndef RENAME
  3999. #define RENAME
  4000. #endif /* RENAME */
  4001. #endif /* BSD44 */
  4002. #ifdef NORENAME /* Allow for compile-time override */
  4003. #ifdef RENAME
  4004. #undef RENAME
  4005. #endif /* RENAME */
  4006. #endif /* NORENAME */
  4007. #ifdef STRATUS /* Stratus VOS */
  4008. #ifndef RENAME
  4009. #define RENAME
  4010. #endif /* RENAME */
  4011. #endif /* STRATUS */
  4012. /* Line delimiter for text files */
  4013. /*
  4014. If the system uses a single character for text file line delimitation,
  4015. define NLCHAR to the value of that character. For text files, that
  4016. character will be converted to CRLF upon output, and CRLF will be converted
  4017. to that character on input during text-mode (default) packet operations.
  4018. */
  4019. #ifdef MAC /* Macintosh */
  4020. #define NLCHAR 015
  4021. #else
  4022. #ifdef OSK /* OS-9/68K */
  4023. #define NLCHAR 015
  4024. #else /* All Unix-like systems */
  4025. #define NLCHAR 012
  4026. #endif /* OSK */
  4027. #endif /* MAC */
  4028. /*
  4029. At this point, if there's a system that uses ordinary CRLF line
  4030. delimitation AND the C compiler actually returns both the CR and
  4031. the LF when doing input from a file, then #undef NLCHAR.
  4032. */
  4033. #ifdef OS2 /* OS/2 */
  4034. #undef NLCHAR
  4035. #endif /* OS2 */
  4036. #ifdef GEMDOS /* Atari ST */
  4037. #undef NLCHAR
  4038. #endif /* GEMDOS */
  4039. /*
  4040. VMS file formats are so complicated we need to do all the conversion
  4041. work in the CKVFIO module, so we tell the rest of C-Kermit not to fiddle
  4042. with the bytes.
  4043. */
  4044. #ifdef vms
  4045. #undef NLCHAR
  4046. #endif /* vms */
  4047. /* The device name of a job's controlling terminal */
  4048. /* Special for VMS, same for all Unixes (?), not used by Macintosh */
  4049. #ifdef BEOS
  4050. #define CTTNAM dftty
  4051. #else
  4052. #ifdef vms
  4053. #define CTTNAM "SYS$INPUT:" /* (4 Jan 2002) Was TT: */
  4054. #else
  4055. #ifdef datageneral
  4056. #define CTTNAM "@output"
  4057. #else
  4058. #ifdef OSK
  4059. extern char myttystr[];
  4060. #define CTTNAM myttystr
  4061. #else
  4062. #ifdef OS2
  4063. #define CTTNAM "con"
  4064. #else
  4065. #ifdef UNIX
  4066. #define CTTNAM "/dev/tty"
  4067. #else
  4068. #ifdef GEMDOS
  4069. #define CTTNAM "aux:"
  4070. #else
  4071. #ifdef STRATUS
  4072. extern char myttystr[];
  4073. #define CTTNAM myttystr
  4074. #else /* Anyone else... */
  4075. #define CTTNAM "stdout" /* This is a kludge used by Mac */
  4076. #endif /* STRATUS */
  4077. #endif /* GEMDOS */
  4078. #endif /* UNIX */
  4079. #endif /* OS2 */
  4080. #endif /* OSK */
  4081. #endif /* datageneral */
  4082. #endif /* vms */
  4083. #endif /* BEOS */
  4084. #ifndef HAVECTTNAM
  4085. #ifdef UNIX
  4086. #define HAVECTTNAM
  4087. #else
  4088. #ifdef VMS
  4089. #define HAVECTTNAM
  4090. #endif /* VMS */
  4091. #endif /* UNIX */
  4092. #endif /* HAVECTTNAM */
  4093. #ifndef ZFCDAT /* zfcdat() function available? */
  4094. #ifdef UNIX
  4095. #define ZFCDAT
  4096. #else
  4097. #ifdef STRATUS
  4098. #define ZFCDAT
  4099. #else
  4100. #ifdef GEMDOS
  4101. #define ZFCDAT
  4102. #else
  4103. #ifdef AMIGA
  4104. #define ZFCDAT
  4105. #else
  4106. #ifdef OS2
  4107. #define ZFCDAT
  4108. #else
  4109. #ifdef datageneral
  4110. #define ZFCDAT
  4111. #else
  4112. #ifdef VMS
  4113. #define ZFCDAT
  4114. #endif /* VMS */
  4115. #endif /* datageneral */
  4116. #endif /* OS2 */
  4117. #endif /* AMIGA */
  4118. #endif /* GEMDOS */
  4119. #endif /* STRATUS */
  4120. #endif /* UNIX */
  4121. #endif /* ZFCDAT */
  4122. #ifdef SUNS4S5
  4123. #define tolower _tolower
  4124. #define toupper _toupper
  4125. #endif /* SUNS4S5 */
  4126. /* Error number */
  4127. #ifdef _CRAY
  4128. #ifdef _CRAYCOM /* Cray Computer Corp. */
  4129. extern int errno;
  4130. #else /* _CRAYCOM */
  4131. #include <errno.h> /* Cray Research UNICOS defines */
  4132. /* errno as a function. */
  4133. #endif /* _CRAYCOM */ /* OK for UNICOS 6.1 and 7.0. */
  4134. #else /* _CRAY */
  4135. #ifdef STRATUS /* Stratus VOS */
  4136. #include <errno.h>
  4137. #else /* not STRATUS */
  4138. #ifndef VMS
  4139. #ifndef OS2
  4140. #ifdef __GLIBC__
  4141. /*
  4142. "glibc uses threads, kermit uses glibc; errno access is in Thread Local
  4143. Storage (TLS) from glibc-3.2.2. ...a thread specific errno is being run in
  4144. thread local storage relative to the %gs segment register, so some means to
  4145. revector gets/puts needs to be done." - Jeff Johnson, Red Hat, Feb 2003.
  4146. */
  4147. #include <errno.h>
  4148. #else
  4149. /*
  4150. The following declaration would cause problems for VMS and OS/2, in which
  4151. errno is an "extern volatile int noshare"... NOTE: by now (2007) the
  4152. following is an anachronism and should be the execption rather than the
  4153. rule.
  4154. */
  4155. extern int errno;
  4156. #endif /* __GLIBC__ */
  4157. #endif /* OS2 */
  4158. #endif /* VMS */
  4159. #endif /* STRATUS */
  4160. #endif /* _CRAY */
  4161. #ifdef UNIX /* Catch-all so we can have */
  4162. #ifndef ESRCH /* access to error mnemonics */
  4163. #include <errno.h> /* in all modules - 2007/08/25 */
  4164. #endif /* ESRCH */
  4165. #endif /* UNIX */
  4166. #ifdef pdp11 /* Try to make some space on PDP-11 */
  4167. #ifndef NODIAL
  4168. #define NODIAL
  4169. #endif /* NODIAL */
  4170. #ifndef NOCURSES
  4171. #define NOCURSES
  4172. #endif /* NOCURSES */
  4173. #ifndef NOBIGBUF
  4174. #define NOBIGBUF
  4175. #endif /* NOBIGBUF */
  4176. #endif /* pdp11 */
  4177. #ifndef NOBIGBUF
  4178. #ifndef BIGBUFOK /* Platforms with lots of memory */
  4179. #ifdef QNX /* QNX */
  4180. #ifndef QNX16 /* But not 16-bit versions */
  4181. #define BIGBUFOK
  4182. #endif /* QNX16 */
  4183. #endif /* QNX */
  4184. #ifdef BSD44
  4185. #define BIGBUFOK
  4186. #endif /* BSD44 */
  4187. #ifdef STRATUS /* Stratus VOS */
  4188. #define BIGBUFOK
  4189. #endif /* STRATUS */
  4190. #ifdef sparc /* SPARC processors */
  4191. #define BIGBUFOK
  4192. #endif /* sparc */
  4193. #ifdef mips /* MIPS processors */
  4194. #define BIGBUFOK
  4195. #endif /* mips */
  4196. #ifdef HPUX9 /* HP-UX 9.x */
  4197. #define BIGBUFOK
  4198. #endif /* HPUX9 */
  4199. #ifdef HPUX10 /* HP-UX 10.0 PA-RISC */
  4200. #define BIGBUFOK
  4201. #endif /* HPUX10 */
  4202. #ifdef NEXT /* NeXTSTEP */
  4203. #ifdef mc68000 /* on NEXT platforms... */
  4204. #define BIGBUFOK
  4205. #endif /* mc68000 */
  4206. #endif /* NEXT */
  4207. #ifdef LINUX /* Linux from 1998 on should be OK */
  4208. #ifndef BIGBUFOK
  4209. #define BIGBUFOK
  4210. #endif /* BIGBUFOK */
  4211. #endif /* LINUX */
  4212. #ifdef OS2 /* 32-bit OS/2 2.x and above */
  4213. #ifdef __32BIT__
  4214. #define BIGBUFOK
  4215. #endif /* __32BIT__ */
  4216. #ifdef NT
  4217. #define BIGBUFOK
  4218. #endif /* NT */
  4219. #endif /* OS2 */
  4220. #ifdef Plan9 /* Plan 9 is OK */
  4221. #define BIGBUFOK
  4222. #endif /* Plan9 */
  4223. #ifdef VMS /* Any VMS is OK */
  4224. #ifndef BIGBUFOK
  4225. #define BIGBUFOK
  4226. #endif /* BIGBUFOK */
  4227. #endif /* VMS */
  4228. #ifdef __alpha /* DEC 64-bit Alpha, e.g. OSF/1 */
  4229. #ifndef BIGBUFOK /* Might already be defined for VMS */
  4230. #define BIGBUFOK
  4231. #endif /* BIGBUFOK */
  4232. #endif /* __alpha */
  4233. #ifdef sgi /* SGI with IRIX 4.0 or later */
  4234. #ifndef BIGBUFOK
  4235. #define BIGBUFOK
  4236. #endif /* BIGBUFOK */
  4237. #endif /* sgi */
  4238. #ifdef AIXRS /* AIX on RISC */
  4239. #define BIGBUFOK
  4240. #endif /* AIXRS */
  4241. #ifdef CK_SCOV5 /* SCO OSR5 */
  4242. #ifndef BIGBUFOK
  4243. #define BIGBUFOK
  4244. #endif /* BIGBUFOK */
  4245. #endif /* CK_SCOV5 */
  4246. #ifdef SOLARIS /* Solaris x86 */
  4247. #ifndef BIGBUFOK
  4248. #define BIGBUFOK
  4249. #endif /* BIGBUFOK */
  4250. #endif /* SOLARIS */
  4251. #endif /* BIGBUFOK */
  4252. #endif /* NOBIGBUF */
  4253. #ifdef CK_SMALL
  4254. #ifdef BIGBUFOK
  4255. #undef BIGBUFOK
  4256. #endif /* BIGBUFOK */
  4257. #endif /* CK_SMALL */
  4258. /* If "memory is no problem" then this improves performance */
  4259. #ifdef DEBUG
  4260. #ifdef BIGBUFOK
  4261. #ifndef IFDEBUG
  4262. #define IFDEBUG
  4263. #endif /* IFDEBUG */
  4264. #endif /* BIGBUFOK */
  4265. #endif /* DEBUG */
  4266. /* File System Defaults */
  4267. #ifndef UIDBUFLEN /* Length of User ID */
  4268. #ifdef OS2
  4269. #define UIDBUFLEN 256
  4270. #else /* OS2 */
  4271. #ifdef BIGBUFOK
  4272. #define UIDBUFLEN 256
  4273. #else
  4274. #define UIDBUFLEN 64
  4275. #endif /* BIGBUFOK */
  4276. #endif /* OS2 */
  4277. #endif /* UIDBUFLEN */
  4278. #ifdef UNIX
  4279. #ifdef PROVX1
  4280. #define MAXWLD 50
  4281. #else
  4282. #ifdef pdp11
  4283. #define MAXWLD 50
  4284. #else
  4285. #ifdef BIGBUFOK
  4286. #define MAXWLD 102400
  4287. #else
  4288. #define MAXWLD 1024
  4289. #endif /* BIGBUFOK */
  4290. #endif /* pdp11 */
  4291. #endif /* PROVX1 */
  4292. #else
  4293. #ifdef VMS
  4294. #define MAXWLD 102400 /* Maximum wildcard filenames */
  4295. #else
  4296. #ifdef datageneral
  4297. #define MAXWLD 500
  4298. #else
  4299. #ifdef STRATUS
  4300. #define MAXWLD 5000
  4301. #endif /* STRATUS */
  4302. #endif /* datageneral */
  4303. #endif /* VMS */
  4304. #endif /* UNIX */
  4305. #ifdef VMS
  4306. #define DBLKSIZ 512
  4307. #define DLRECL 512
  4308. #else
  4309. #define DBLKSIZ 0
  4310. #define DLRECL 0
  4311. #endif /* VMS */
  4312. /* Communication device / network host name length */
  4313. #ifdef BIGBUFOK
  4314. #define TTNAMLEN 512
  4315. #else
  4316. #ifdef MAC
  4317. #define TTNAMLEN 256
  4318. #else
  4319. #ifndef CK_SMALL
  4320. #define TTNAMLEN 128
  4321. #else
  4322. #define TTNAMLEN 80
  4323. #endif /* CK_SMALL */
  4324. #endif /* MAC */
  4325. #endif /* BIGBUFOK */
  4326. /* Program return codes for DECUS C and UNIX (VMS uses UNIX codes) */
  4327. #ifdef decus
  4328. #define GOOD_EXIT IO_NORMAL
  4329. #define BAD_EXIT IO_ERROR
  4330. #else
  4331. #define GOOD_EXIT 0
  4332. #define BAD_EXIT 1
  4333. #endif /* decus */
  4334. /* Special hack for Fortune, which doesn't have <sys/file.h>... */
  4335. #ifdef FT18
  4336. #define FREAD 0x01
  4337. #define FWRITE 0x10
  4338. #endif /* FT18 */
  4339. /* Special hack for OS-9/68k */
  4340. #ifdef OSK
  4341. #ifndef _UCC
  4342. #define SIGALRM 30 /* May always cancel I/O */
  4343. #endif /* _UCC */
  4344. #define SIGARB 1234 /* Arbitrary for I/O */
  4345. SIGTYP (*signal())();
  4346. #endif /* OSK */
  4347. #ifdef MINIX
  4348. #ifdef putchar
  4349. #undef putchar
  4350. #endif /* putchar */
  4351. #define putchar(c) (putc(c,stdout)!=EOF)&&fflush(stdout)
  4352. #endif /* MINIX */
  4353. #ifdef datageneral /* Data General AOS/VS */
  4354. #ifdef putchar
  4355. #undef putchar
  4356. #endif /* putchar */
  4357. #define putchar(c) conoc(c)
  4358. #endif /* datageneral */
  4359. /* Escape/quote character used by the command parser */
  4360. #define CMDQ '\\'
  4361. /* Symbols for RS-232 modem signals */
  4362. #define KM_FG 1 /* Frame ground */
  4363. #define KM_TXD 2 /* Transmit */
  4364. #define KM_RXD 3 /* Receive */
  4365. #define KM_RTS 4 /* Request to Send */
  4366. #define KM_CTS 5 /* Clear to Send */
  4367. #define KM_DSR 6 /* Data Set Ready */
  4368. #define KM_SG 7 /* Signal ground */
  4369. #define KM_DCD 8 /* Carrier Detect */
  4370. #define KM_DTR 20 /* Data Terminal Ready */
  4371. #define KM_RI 22 /* Ring Indication */
  4372. /* Bit mask values for modem signals */
  4373. #define BM_CTS 0001 /* Clear to send (From DCE) */
  4374. #define BM_DSR 0002 /* Dataset ready (From DCE) */
  4375. #define BM_DCD 0004 /* Carrier (From DCE) */
  4376. #define BM_RNG 0010 /* Ring Indicator (From DCE) */
  4377. #define BM_DTR 0020 /* Data Terminal Ready (From DTE) */
  4378. #define BM_RTS 0040 /* Request to Send (From DTE) */
  4379. /* Codes for full duplex flow control */
  4380. #define FLO_NONE 0 /* None */
  4381. #define FLO_XONX 1 /* Xon/Xoff (soft) */
  4382. #define FLO_RTSC 2 /* RTS/CTS (hard) */
  4383. #define FLO_DTRC 3 /* DTR/CD (hard) */
  4384. #define FLO_ETXA 4 /* ETX/ACK (soft) */
  4385. #define FLO_STRG 5 /* String-based (soft) */
  4386. #define FLO_DIAL 6 /* DIALing kludge */
  4387. #define FLO_DIAX 7 /* Cancel dialing kludge */
  4388. #define FLO_DTRT 8 /* DTR/CTS (hard) */
  4389. #define FLO_KEEP 9 /* Keep, i.e. don't touch or change */
  4390. #define FLO_AUTO 10 /* Figure out automatically */
  4391. /* Types of connections */
  4392. #define CXT_REMOTE 0 /* Remote mode - no connection */
  4393. #define CXT_DIRECT 1 /* Direct serial connection */
  4394. #define CXT_MODEM 2 /* Modem dialout */
  4395. #define CXT_TCPIP 3 /* TCP/IP - Telnet, Rlogin, etc */
  4396. #define CXT_X25 4 /* X.25 peer-to-peer */
  4397. #define CXT_DECNET 5 /* DECnet (CTERM, etc) */
  4398. #define CXT_LAT 6 /* LAT */
  4399. #define CXT_NETBIOS 7 /* NETBIOS */
  4400. #define CXT_NPIPE 8 /* Named Pipe */
  4401. #define CXT_PIPE 9 /* Pipe, Command, PTY, DLL, etc */
  4402. #define CXT_SSH 10 /* SSH */
  4403. #define CXT_MAX 10 /* Highest connection type */
  4404. /* Autodownload Detection Options */
  4405. #define ADL_PACK 0 /* Auto-Download detect packet */
  4406. #define ADL_STR 1 /* Auto-Download detect string */
  4407. /* And finally... */
  4408. #ifdef COMMENT /* Make sure this is NOT defined! */
  4409. #undef COMMENT
  4410. #endif /* COMMENT */
  4411. /* zstr zattr filinfo were here (moved to top for DECC 5 Jun 2000) */
  4412. #ifndef ZFNQFP /* Versions that have zfnqfp() */
  4413. #ifdef UNIX
  4414. #define ZFNQFP
  4415. #else
  4416. #ifdef VMS
  4417. #define ZFNQFP
  4418. #else
  4419. #ifdef OS2
  4420. #define ZFNQFP
  4421. #else
  4422. #ifdef datageneral
  4423. #define ZFNQFP
  4424. #else
  4425. #ifdef STRATUS
  4426. #define ZFNQFP
  4427. #endif /* STRATUS */
  4428. #endif /* datageneral */
  4429. #endif /* OS2 */
  4430. #endif /* VMS */
  4431. #endif /* UNIX */
  4432. struct zfnfp {
  4433. int len; /* Length of full pathname */
  4434. char * fpath; /* Pointer to full pathname */
  4435. char * fname; /* Pointer to name part */
  4436. };
  4437. #endif /* ZFNQFP */
  4438. /* Systems that support FILE TYPE LABELED */
  4439. #ifdef VMS
  4440. #define CK_LABELED
  4441. #else
  4442. #ifdef OS2
  4443. #ifdef __32BIT__
  4444. #ifndef NT
  4445. #define CK_LABELED
  4446. #endif /* NT */
  4447. #endif /* __32BIT__ */
  4448. #endif /* OS2 */
  4449. #endif /* VMS */
  4450. /* LABELED FILE options bitmask */
  4451. #ifdef VMS /* For VMS */
  4452. #define LBL_NAM 1 /* Ignore incoming name if set */
  4453. #define LBL_PTH 2 /* Use complete path if set */
  4454. #define LBL_ACL 4 /* Preserve ACLs if set */
  4455. #define LBL_BCK 8 /* Preserve backup date if set */
  4456. #define LBL_OWN 16 /* Preserve ownership if set */
  4457. #else
  4458. #ifdef OS2 /* Ditto for OS/2 */
  4459. #define LBL_NOR 0x0000 /* Normal file */
  4460. #define LBL_ARC 0x0020 /* Archive */
  4461. #define LBL_DIR 0x0010 /* Directory */
  4462. #define LBL_HID 0x0002 /* Hidden file */
  4463. #define LBL_RO 0x0001 /* Read only file */
  4464. #define LBL_SYS 0x0004 /* System file */
  4465. #define LBL_EXT 0x0040 /* Extended */
  4466. #endif /* OS2 */
  4467. #endif /* VMS */
  4468. /*
  4469. Data types. First the header file for data types so we can pick up the
  4470. types used for pids, uids, and gids. Override this section by putting
  4471. -DCKTYP_H=xxx on the command line to specify the header file where your
  4472. system defines these types.
  4473. */
  4474. #ifndef STRATUS
  4475. #ifdef __ALPHA
  4476. #ifdef MULTINET
  4477. #define CK_TGV_AXP
  4478. #endif /* MULTINET */
  4479. #endif /* __ALPHA */
  4480. #ifdef CK_TGV_AXP /* Alpha, VMS, MultiNet */
  4481. /*
  4482. Starting in DECC 5.0, <stdlib.h> no longer includes <types.h>.
  4483. But before that an elaborate workaround is required, which results in
  4484. including <types.h> sometimes but not others, evidently depending on whether
  4485. <types.h> protects itself against multiple inclusion, which in turn probably
  4486. differentiates between DECC <types.h> and TGV <types.h>. Unfortunately I
  4487. don't remember the details. (fdc, 25 Oct 96)
  4488. */
  4489. #ifdef COMMENT
  4490. /*
  4491. Previously the test here was for DEC version prior to 4.0, but since the
  4492. test involved an "#if" statement, it was not portable and broke some non-VMS
  4493. builds. In any case, condition was never satisfied, so the result of
  4494. commenting this section out is the same as the previous "#if" condition.
  4495. */
  4496. #ifndef __TYPES_LOADED
  4497. #define __TYPES_LOADED /* Work around bug in .h files */
  4498. #endif /* __TYPES_LOADED */
  4499. #endif /* COMMENT */
  4500. #include <sys/types.h>
  4501. #ifdef IF_DOT_H
  4502. #ifndef MULTINET
  4503. #include <if.h> /* Needed to put up u_int typedef */
  4504. #endif /* MULTINET */
  4505. #else /* IF_DOT_H */
  4506. #ifdef NEEDUINT
  4507. typedef unsigned int u_int;
  4508. #endif /* NEEDUINT */
  4509. #endif /* IF_DOT_H */
  4510. #else /* !CK_TGV_AXP */
  4511. #ifdef OSK /* OS-9 */
  4512. #include <types.h>
  4513. #else /* General case, not OS-9 */
  4514. #ifndef CKTYP_H
  4515. #ifndef VMS
  4516. #ifndef MAC
  4517. #ifndef AMIGA
  4518. #define CKTYP_H <sys/types.h>
  4519. #endif /* AMIGA */
  4520. #endif /* MAC */
  4521. #endif /* VMS */
  4522. #endif /* CKTYP_H */
  4523. #ifdef GEMDOS
  4524. #undef CKTYP_H
  4525. #include <types.h>
  4526. #endif /* GEMDOS */
  4527. #ifdef OS2
  4528. #undef CKTYP_H
  4529. #include <sys/types.h>
  4530. #endif /* OS2 */
  4531. #ifdef CKTYP_H /* Include it. */
  4532. #ifdef COHERENT /* Except for COHERENT */
  4533. #include <unistd.h>
  4534. #include <sys/types.h>
  4535. #else
  4536. #ifdef datageneral /* AOS/VS */
  4537. #include <sys/types.h>
  4538. #else /* All others */
  4539. #ifdef __bsdi__ /* BSDI */
  4540. #ifdef POSIX
  4541. #undef _POSIX_SOURCE
  4542. #endif /* POSIX */
  4543. #endif /* __bsdi__ */
  4544. #include CKTYP_H
  4545. #ifdef __bsdi__
  4546. #ifdef POSIX
  4547. #define _POSIX_SOURCE
  4548. #endif /* POSIX */
  4549. #endif /* __bsdi__ */
  4550. #endif /* datageneral */
  4551. #endif /* COHERENT */
  4552. #endif /* CKTYP_H */
  4553. #endif /* OSK */
  4554. #endif /* CK_TGV_AXP */
  4555. #endif /* STRATUS */ /* End of types.h section */
  4556. /*
  4557. File lengths and offsets. This section is expected to grow as we
  4558. support long files on 32-bit platforms. We want this data type to be
  4559. signed because so many functions return either a file size or a negative
  4560. value to indicate an error.
  4561. */
  4562. #ifndef CK_OFF_T
  4563. #ifdef OS2
  4564. #ifdef NT
  4565. #define CK_OFF_T __int64
  4566. #else
  4567. #define CK_OFF_T long
  4568. #endif /* NT */
  4569. #endif /* OS2 */
  4570. #endif /* CK_OFF_T */
  4571. /* FreeBSD and OpenBSD set off_t to the appropriate size unconditionally */
  4572. #ifndef CK_OFF_T
  4573. #ifdef __FreeBSD__
  4574. #define CK_OFF_T off_t
  4575. #else
  4576. #ifdef __OpenBSD__
  4577. #define CK_OFF_T off_t
  4578. #endif /* __OpenBSD__ */
  4579. #endif /* __FreeBSD__ */
  4580. #endif /* CK_OFF_T */
  4581. /* 32-bit platforms that support long files thru "transitional interface" */
  4582. /* These include Linux, Solaris, NetBSD... */
  4583. #ifdef AIXRS
  4584. #ifdef _LARGE_FILES
  4585. #ifndef CK_OFF_T
  4586. #define CK_OFF_T off_t
  4587. #endif /* CK_OFF_T */
  4588. #endif /* _LARGE_FILES */
  4589. #endif /* AIXRS */
  4590. #ifdef _LARGEFILE_SOURCE
  4591. #ifndef CK_OFF_T
  4592. #define CK_OFF_T off_t
  4593. #endif /* CK_OFF_T */
  4594. #ifdef IRIX
  4595. #define CKFSEEK(a,b,c) fseek64(a,b,c)
  4596. #define CKFTELL(a) ftell64(a)
  4597. #else /* IRIX */
  4598. #define CKFSEEK(a,b,c) fseeko(a,b,c)
  4599. #define CKFTELL(a) ftello(a)
  4600. #endif /* IRIX */
  4601. #else /* Not _LARGEFILE_SOURCE */
  4602. #define CKFSEEK(a,b,c) fseek(a,b,c)
  4603. #define CKFTELL(a) ftell(a)
  4604. /* See below the next section for the catch-all case */
  4605. #endif /* _LARGEFILE_SOURCE */
  4606. /* 32-bit or 64-bit platforms */
  4607. /* CK_64BIT is a compile-time symbol indicating a true 64-bit build */
  4608. /* meaning that longs and pointers are 64 bits */
  4609. #ifndef VMS /* VMS Alpha and IA64 are 32-bit! */
  4610. #ifndef CK_64BIT
  4611. #ifdef _LP64 /* Solaris */
  4612. #define CK_64BIT
  4613. #else
  4614. #ifdef __LP64__ /* MacOS X 10.4 (or _LP64,__ppc64__) */
  4615. #define CK_64BIT
  4616. #else
  4617. #ifdef __arch64__ /* gcc alpha, sparc */
  4618. #define CK_64BIT
  4619. #else
  4620. #ifdef __alpha /* Alpha decc (or __ALPHA) */
  4621. #define CK_64BIT
  4622. #else
  4623. #ifdef __amd64 /* AMD x86_64 */
  4624. #define CK_64BIT
  4625. #else
  4626. #ifdef __x86_64 /* AMD/Intel x86_64 */
  4627. #define CK_64BIT
  4628. #else
  4629. #ifdef __ia64 /* Intel IA64 */
  4630. #ifndef HPUX
  4631. #define CK_64BIT
  4632. #endif /* HPUX */
  4633. #endif /* __ia64 */
  4634. #endif /* __x86_64 */
  4635. #endif /* __amd64 */
  4636. #endif /* __alpha */
  4637. #endif /* __arch64__ */
  4638. #endif /* __LP64__ */
  4639. #endif /* _LP64 */
  4640. #endif /* CK_64BIT */
  4641. #endif /* VMS */
  4642. #ifndef CK_OFF_T
  4643. #ifdef CK_64BIT
  4644. #define CK_OFF_T off_t /* This has to be signed */
  4645. #else /* CK_64BIT */
  4646. #define CK_OFF_T long /* Signed */
  4647. #endif /* CK_64BIT */
  4648. #endif /* CK_OFF_T */
  4649. #ifndef TLOG
  4650. #define tlog(a,b,c,d)
  4651. #else
  4652. #ifndef CKCMAI
  4653. /* Debugging included. Declare debug log flag in main program only. */
  4654. extern int tralog, tlogfmt;
  4655. #endif /* CKCMAI */
  4656. _PROTOTYP(VOID dotlog,(int, char *, char *, CK_OFF_T));
  4657. #define tlog(a,b,c,d) if (tralog && tlogfmt) dotlog(a,b,c,(CK_OFF_T)d)
  4658. _PROTOTYP(VOID doxlog,(int, char *, CK_OFF_T, int, int, char *));
  4659. #endif /* TLOG */
  4660. #ifndef DEBUG
  4661. /* Compile all the debug() statements away. Saves a lot of space and time. */
  4662. #define debug(a,b,c,d)
  4663. #define ckhexdump(a,b,c)
  4664. /* Now define the debug() macro. */
  4665. #else /* DEBUG */
  4666. _PROTOTYP(int dodebug,(int,char *,char *,CK_OFF_T));
  4667. _PROTOTYP(int dohexdump,(CHAR *,CHAR *,int));
  4668. #ifdef IFDEBUG
  4669. /* Use this form to avoid function calls: */
  4670. #ifdef COMMENT
  4671. #define debug(a,b,c,d) if (deblog) dodebug(a,b,(char *)(c),(CK_OFF_T)(d))
  4672. #define ckhexdump(a,b,c) if (deblog) dohexdump((CHAR *)(a),(CHAR *)(b),c)
  4673. #else
  4674. #ifdef CK_ANSIC
  4675. #define debug(a,b,c,d) \
  4676. ((void)(deblog?dodebug(a,b,(char *)(c),(CK_OFF_T)(d)):0))
  4677. #define ckhexdump(a,b,c) \
  4678. ((void)(deblog?dohexdump((CHAR *)(a),(CHAR *)(b),c):0))
  4679. #else
  4680. #define debug(a,b,c,d) (deblog?dodebug(a,b,(char *)(c),(CK_OFF_T)(d)):0)
  4681. #define ckhexdump(a,b,c) (deblog?dohexdump((CHAR *)(a),(CHAR *)(b),c):0)
  4682. #endif /* CK_ANSIC */
  4683. #endif /* COMMENT */
  4684. #else /* IFDEBUG */
  4685. /* Use this form to save space: */
  4686. #define debug(a,b,c,d) dodebug(a,b,(char *)(c),(CK_OFF_T)(d))
  4687. #define ckhexdump(a,b,c) dohexdump((CHAR *)(a),(CHAR *)(b),c)
  4688. #endif /* IFDEBUG */
  4689. #endif /* DEBUG */
  4690. /* Structure definitions for Kermit file attributes */
  4691. /* All strings come as pointer and length combinations */
  4692. /* Empty string (or for numeric variables, -1) = unused attribute. */
  4693. struct zstr { /* string format */
  4694. int len; /* length */
  4695. char *val; /* value */
  4696. };
  4697. struct zattr { /* Kermit File Attribute structure */
  4698. CK_OFF_T lengthk; /* (!) file length in K */
  4699. struct zstr type; /* (") file type (text or binary) */
  4700. struct zstr date; /* (#) file creation date yyyymmdd[ hh:mm[:ss]] */
  4701. struct zstr creator; /* ($) file creator id */
  4702. struct zstr account; /* (%) file account */
  4703. struct zstr area; /* (&) area (e.g. directory) for file */
  4704. struct zstr password; /* (') password for area */
  4705. long blksize; /* (() file blocksize */
  4706. struct zstr xaccess; /* ()) file access: new, supersede, append, warn */
  4707. struct zstr encoding; /* (*) encoding (transfer syntax) */
  4708. struct zstr disp; /* (+) disposition (mail, message, print, etc) */
  4709. struct zstr lprotect; /* (,) protection (local syntax) */
  4710. struct zstr gprotect; /* (-) protection (generic syntax) */
  4711. struct zstr systemid; /* (.) ID for system of origin */
  4712. struct zstr recfm; /* (/) record format */
  4713. struct zstr sysparam; /* (0) system-dependent parameter string */
  4714. CK_OFF_T length; /* (1) exact length on system of origin */
  4715. struct zstr charset; /* (2) transfer syntax character set */
  4716. #ifdef OS2
  4717. struct zstr longname; /* OS/2 longname if applicable */
  4718. #endif /* OS2 */
  4719. struct zstr reply; /* This goes last, used for attribute reply */
  4720. };
  4721. /* Kermit file information structure */
  4722. struct filinfo {
  4723. int bs; /* Blocksize */
  4724. int cs; /* Character set */
  4725. long rl; /* Record length */
  4726. int org; /* Organization */
  4727. int fmt; /* Record format */
  4728. int cc; /* Carriage control */
  4729. int typ; /* Type (text/binary) */
  4730. int dsp; /* Disposition */
  4731. char *os_specific; /* OS-specific attributes */
  4732. #ifdef OS2
  4733. unsigned long int lblopts; /* LABELED FILE options bitmask */
  4734. #else
  4735. int lblopts;
  4736. #endif /* OS2 */
  4737. };
  4738. /*
  4739. Data type for pids. If your system uses a different type, put something
  4740. like -DPID_T=pid_t on command line, or override here.
  4741. */
  4742. #ifndef PID_T
  4743. #define PID_T int
  4744. #endif /* PID_T */
  4745. /*
  4746. Data types for uids and gids. Same deal as for pids.
  4747. Wouldn't be nice if there was a preprocessor test to find out if a
  4748. typedef existed?
  4749. */
  4750. #ifdef VMS
  4751. /* Not used in VMS so who cares */
  4752. #define UID_T int
  4753. #define GID_T int
  4754. #endif /* VMS */
  4755. #ifdef POSIX
  4756. /* Or would it be better (or worse?) to use _POSIX_SOURCE here? */
  4757. #ifndef UID_T
  4758. #define UID_T uid_t
  4759. #endif /* UID_T */
  4760. #ifndef GID_T
  4761. #define GID_T gid_t
  4762. #endif /* GID_T */
  4763. #else /* Not POSIX */
  4764. #ifdef SVR4
  4765. /* SVR4 and later have uid_t and gid_t. */
  4766. /* SVR3 and earlier use int, or unsigned short, or.... */
  4767. #ifndef UID_T
  4768. #define UID_T uid_t
  4769. #endif /* UID_T */
  4770. #ifndef GID_T
  4771. #define GID_T gid_t
  4772. #endif /* GID_T */
  4773. #else /* Not SVR4 */
  4774. #ifdef BSD43
  4775. #ifndef UID_T
  4776. #define UID_T uid_t
  4777. #endif /* UID_T */
  4778. #ifndef GID_T
  4779. #define GID_T gid_t
  4780. #endif /* GID_T */
  4781. #else /* Not BSD43 */
  4782. /* Default these to int for older UNIX versions */
  4783. #ifndef UID_T
  4784. #define UID_T int
  4785. #endif /* UID_T */
  4786. #ifndef GID_T
  4787. #define GID_T int
  4788. #endif /* GID_T */
  4789. #endif /* BSD43 */
  4790. #endif /* SVR4 */
  4791. #endif /* POSIX */
  4792. /*
  4793. getpwuid() arg type, which is not necessarily the same as UID_T,
  4794. e.g. in SCO UNIX SVR3, it's int.
  4795. */
  4796. #ifndef PWID_T
  4797. #define PWID_T UID_T
  4798. #endif /* PWID_T */
  4799. #ifdef CK_REDIR
  4800. #ifdef NEXT
  4801. #define MACHWAIT
  4802. #else
  4803. #ifdef MACH
  4804. #define MACHWAIT
  4805. #endif /* MACH */
  4806. #endif /* NEXT */
  4807. #ifdef MACHWAIT /* WAIT_T argument for wait() */
  4808. #include <sys/wait.h>
  4809. #define CK_WAIT_H
  4810. typedef union wait WAIT_T;
  4811. #else
  4812. #ifdef POSIX
  4813. #ifdef OSF
  4814. /* OSF wait.h defines BSD wait if _BSD is defined so hide _BSD from wait.h */
  4815. #ifdef _BSD
  4816. #define CK_OSF_BSD
  4817. #undef _BSD
  4818. #endif /* _BSD */
  4819. #endif /* OSF */
  4820. #include <sys/wait.h>
  4821. #define CK_WAIT_H
  4822. #ifndef WAIT_T
  4823. typedef int WAIT_T;
  4824. #endif /* WAIT_T */
  4825. #ifdef CK_OSF_BSD /* OSF/1: Restore _BSD definition */
  4826. #define _BSD
  4827. #undef CK_OSF_BSD
  4828. #endif /* CK_OSF_BSD */
  4829. #else /* !POSIX */
  4830. typedef int WAIT_T;
  4831. #endif /* POSIX */
  4832. #endif /* MACHWAIT */
  4833. #else
  4834. typedef int WAIT_T;
  4835. #endif /* CK_REDIR */
  4836. /* Assorted other blah_t's handled here... */
  4837. #ifndef SIZE_T
  4838. #define SIZE_T size_t
  4839. #endif /* SIZE_T */
  4840. /* Forward declarations of system-dependent functions callable from all */
  4841. /* C-Kermit modules. */
  4842. /* File-related functions from system-dependent file i/o module */
  4843. #ifndef CKVFIO_C
  4844. /* For some reason, this does not agree with DEC C */
  4845. _PROTOTYP( int zkself, (void) );
  4846. #endif /* CKVFIO_C */
  4847. _PROTOTYP( int zopeni, (int, char *) );
  4848. _PROTOTYP( int zopeno, (int, char *, struct zattr *, struct filinfo *) );
  4849. _PROTOTYP( int zclose, (int) );
  4850. #ifndef MAC
  4851. _PROTOTYP( int zchin, (int, int *) );
  4852. #endif /* MAC */
  4853. _PROTOTYP( int zxin, (int, char *, int) );
  4854. _PROTOTYP( int zsinl, (int, char *, int) );
  4855. _PROTOTYP( int zinfill, (void) );
  4856. _PROTOTYP( int zsout, (int, char*) );
  4857. _PROTOTYP( int zsoutl, (int, char*) );
  4858. _PROTOTYP( int zsoutx, (int, char*, int) );
  4859. _PROTOTYP( int zchout, (int, char) );
  4860. _PROTOTYP( int zoutdump, (void) );
  4861. _PROTOTYP( int zsyscmd, (char *) );
  4862. _PROTOTYP( int zshcmd, (char *) );
  4863. #ifdef UNIX
  4864. _PROTOTYP( int zsetfil, (int, int) );
  4865. _PROTOTYP( int zchkpid, (unsigned long) );
  4866. #endif /* UNIX */
  4867. #ifdef CKEXEC
  4868. _PROTOTYP( VOID z_exec, (char *, char **, int) );
  4869. #endif /* CKEXEC */
  4870. _PROTOTYP( int chkfn, (int) );
  4871. _PROTOTYP( CK_OFF_T zchki, (char *) );
  4872. #ifdef VMSORUNIX
  4873. _PROTOTYP( CK_OFF_T zgetfs, (char *) );
  4874. #else
  4875. #ifdef OS2
  4876. _PROTOTYP( CK_OFF_T zgetfs, (char *) );
  4877. #else
  4878. #define zgetfs(a) zchki(a)
  4879. #endif /* OS2 */
  4880. #endif /* VMSORUNIX */
  4881. _PROTOTYP( int iswild, (char *) );
  4882. _PROTOTYP( int isdir, (char *) );
  4883. _PROTOTYP( int zchko, (char *) );
  4884. _PROTOTYP( int zdelet, (char *) );
  4885. _PROTOTYP( VOID zrtol, (char *,char *) );
  4886. _PROTOTYP( VOID zltor, (char *,char *) );
  4887. _PROTOTYP( VOID zstrip, (char *,char **) );
  4888. #ifdef VMS
  4889. _PROTOTYP( char * zrelname, (char *, char *) );
  4890. #endif /* VMS */
  4891. _PROTOTYP( int zchdir, (char *) );
  4892. _PROTOTYP( char * zhome, (void) );
  4893. _PROTOTYP( char * zgtdir, (void) );
  4894. _PROTOTYP( int zxcmd, (int, char *) );
  4895. #ifndef MAC
  4896. _PROTOTYP( int zclosf, (int) );
  4897. #endif /* MAC */
  4898. #ifdef NZXPAND
  4899. #ifdef OS2
  4900. /* [jt] 2013/11/21 - CHAR/char conflict between K95 and others */
  4901. _PROTOTYP( int nzxpand, (CHAR *, int) );
  4902. #else
  4903. _PROTOTYP( int nzxpand, (char *, int) );
  4904. #endif /* OS2 */
  4905. #else /* NZXPAND */
  4906. _PROTOTYP( int zxpand, (char *) );
  4907. #endif /* NZXPAND */
  4908. _PROTOTYP( int znext, (char *) );
  4909. #ifdef ZXREWIND
  4910. _PROTOTYP( int zxrewind, (void) );
  4911. #endif /* ZXREWIND */
  4912. _PROTOTYP( int zchkspa, (char *, CK_OFF_T) );
  4913. _PROTOTYP( VOID znewn, (char *, char **) );
  4914. _PROTOTYP( int zrename, (char *, char *) );
  4915. _PROTOTYP( int zcopy, (char *, char *) );
  4916. _PROTOTYP( int zsattr, (struct zattr *) );
  4917. _PROTOTYP( int zfree, (char *) );
  4918. _PROTOTYP( char * zfcdat, (char *) );
  4919. _PROTOTYP( int zstime, (char *, struct zattr *, int) );
  4920. #ifdef CK_PERMS
  4921. _PROTOTYP( char * zgperm, (char *) );
  4922. _PROTOTYP( char * ziperm, (char *) );
  4923. #endif /* CK_PERMS */
  4924. _PROTOTYP( int zmail, (char *, char *) );
  4925. _PROTOTYP( int zprint, (char *, char *) );
  4926. _PROTOTYP( char * tilde_expand, (char *) );
  4927. _PROTOTYP( int zmkdir, (char *) ) ;
  4928. _PROTOTYP( int zfseek, (CK_OFF_T) ) ;
  4929. #ifdef ZFNQFP
  4930. _PROTOTYP( struct zfnfp * zfnqfp, (char *, int, char * ) ) ;
  4931. #else
  4932. #define zfnqfp(a,b,c) ckstrncpy(c,a,b)
  4933. #endif /* ZFNQFP */
  4934. _PROTOTYP( int zvuser, (char *) ) ;
  4935. _PROTOTYP( int zvpass, (char *) ) ;
  4936. _PROTOTYP( VOID zvlogout, (void) ) ;
  4937. #ifdef OS2
  4938. _PROTOTYP( int os2setlongname, ( char * fn, char * ln ) ) ;
  4939. _PROTOTYP( int os2getlongname, ( char * fn, char ** ln ) ) ;
  4940. _PROTOTYP( int os2rexx, ( char *, char *, int ) ) ;
  4941. _PROTOTYP( int os2rexxfile, ( char *, char *, char *, int) ) ;
  4942. _PROTOTYP( int os2geteas, (char *) ) ;
  4943. _PROTOTYP( int os2seteas, (char *) ) ;
  4944. _PROTOTYP( char * get_os2_vers, (void) ) ;
  4945. _PROTOTYP( int do_label_send, (char *) ) ;
  4946. _PROTOTYP( int do_label_recv, (void) ) ;
  4947. #ifdef OS2MOUSE
  4948. _PROTOTYP( unsigned long os2_mouseon, (void) );
  4949. _PROTOTYP( unsigned long os2_mousehide, (void) );
  4950. _PROTOTYP( unsigned long os2_mouseshow, (void) );
  4951. _PROTOTYP( unsigned long os2_mouseoff, (void) );
  4952. _PROTOTYP( void os2_mouseevt, (void *) );
  4953. _PROTOTYP( int mousebuttoncount, (void));
  4954. #endif /* OS2MOUSE */
  4955. #endif /* OS2 */
  4956. /* Functions from system-dependent terminal i/o module */
  4957. _PROTOTYP( int ttopen, (char *, int *, int, int) ); /* tty functions */
  4958. #ifndef MAC
  4959. _PROTOTYP( int ttclos, (int) );
  4960. #endif /* MAC */
  4961. _PROTOTYP( int tthang, (void) );
  4962. _PROTOTYP( int ttres, (void) );
  4963. _PROTOTYP( int ttpkt, (long, int, int) );
  4964. #ifndef MAC
  4965. _PROTOTYP( int ttvt, (long, int) );
  4966. #endif /* MAC */
  4967. _PROTOTYP( int ttsspd, (int) );
  4968. _PROTOTYP( long ttgspd, (void) );
  4969. _PROTOTYP( int ttflui, (void) );
  4970. _PROTOTYP( int ttfluo, (void) );
  4971. _PROTOTYP( int ttpushback, (CHAR *, int) );
  4972. _PROTOTYP( int ttpeek, (void) );
  4973. _PROTOTYP( int ttgwsiz, (void) );
  4974. _PROTOTYP( int ttchk, (void) );
  4975. _PROTOTYP( int ttxin, (int, CHAR *) );
  4976. _PROTOTYP( int ttxout, (CHAR *, int) );
  4977. _PROTOTYP( int ttol, (CHAR *, int) );
  4978. _PROTOTYP( int ttoc, (char) );
  4979. _PROTOTYP( int ttinc, (int) );
  4980. _PROTOTYP( int ttscarr, (int) );
  4981. _PROTOTYP( int ttgmdm, (void) );
  4982. _PROTOTYP( int ttsndb, (void) );
  4983. _PROTOTYP( int ttsndlb, (void) );
  4984. #ifdef UNIX
  4985. _PROTOTYP( char * ttglckdir, (void) );
  4986. #endif /* UNIX */
  4987. #ifdef PARSENSE
  4988. #ifdef UNIX
  4989. _PROTOTYP( int ttinl, (CHAR *, int, int, CHAR, CHAR, int) );
  4990. #else
  4991. #ifdef VMS
  4992. _PROTOTYP( int ttinl, (CHAR *, int, int, CHAR, CHAR, int) );
  4993. #else
  4994. #ifdef STRATUS
  4995. _PROTOTYP( int ttinl, (CHAR *, int, int, CHAR, CHAR, int) );
  4996. #else
  4997. #ifdef OS2
  4998. _PROTOTYP( int ttinl, (CHAR *, int, int, CHAR, CHAR, int) );
  4999. #else
  5000. #ifdef OSK
  5001. _PROTOTYP( int ttinl, (CHAR *, int, int, CHAR, CHAR, int) );
  5002. #else
  5003. _PROTOTYP( int ttinl, (CHAR *, int, int, CHAR, CHAR) );
  5004. #endif /* OSK */
  5005. #endif /* OS2 */
  5006. #endif /* STRATUS */
  5007. #endif /* VMS */
  5008. #endif /* UNIX */
  5009. #else /* ! PARSENSE */
  5010. _PROTOTYP( int ttinl, (CHAR *, int, int, CHAR) );
  5011. #endif /* PARSENSE */
  5012. /* XYZMODEM support */
  5013. /*
  5014. CK_XYZ enables the various commands and data structures.
  5015. XYZ_INTERNAL means these protocols are built-in; if not defined,
  5016. then they are external. XYZ_DLL is used to indicate a separate
  5017. loadable library containing the XYZmodem protocol code.
  5018. */
  5019. #ifdef pdp11 /* No room for this in PDP-11 */
  5020. #define NOCKXYZ
  5021. #endif /* pdp11 */
  5022. #ifndef NOCKXYZ /* Alternative protocols */
  5023. #ifndef CK_XYZ
  5024. #ifdef UNIX
  5025. #define CK_XYZ
  5026. #else
  5027. #ifdef OS2
  5028. #define CK_XYZ
  5029. #ifndef NOXYZDLL
  5030. #define XYZ_INTERNAL /* Internal and DLL */
  5031. #define XYZ_DLL
  5032. #endif /* NOXYZDLL */
  5033. #endif /* OS2 */
  5034. #endif /* UNIX */
  5035. #endif /* CK_XYZ */
  5036. #endif /* NOCKXYZ */
  5037. #ifdef XYZ_INTERNAL /* This ensures that XYZ_INTERNAL */
  5038. #ifndef CK_XYZ /* is defined only if CK_XYZ is too */
  5039. #undef XYZ_INTERNAL
  5040. #endif /* CK_XYZ */
  5041. #endif /* XYZ_INTERNAL */
  5042. #ifdef XYZ_DLL /* This ensures XYZ_DLL is defined */
  5043. #ifndef XYZ_INTERNAL /* only if XYZ_INTERNAL is too */
  5044. #undef XYZ_DLL
  5045. #endif /* XYZ_INTERNAL */
  5046. #endif /* XYZ_DLL */
  5047. /* Console functions */
  5048. _PROTOTYP( int congm, (void) );
  5049. #ifdef COMMENT
  5050. _PROTOTYP( VOID conint, (SIGTYP (*)(int, int), SIGTYP (*)(int, int)) );
  5051. #else
  5052. _PROTOTYP( VOID conint, (SIGTYP (*)(int), SIGTYP (*)(int)) );
  5053. #endif /* COMMENT */
  5054. _PROTOTYP( VOID connoi, (void) );
  5055. _PROTOTYP( int concb, (char) );
  5056. #ifdef CONGSPD
  5057. _PROTOTYP( long congspd, (void) );
  5058. #endif /* CONGSPD */
  5059. _PROTOTYP( int conbin, (char) );
  5060. _PROTOTYP( int conres, (void) );
  5061. _PROTOTYP( int conoc, (char) );
  5062. _PROTOTYP( int conxo, (int, char *) );
  5063. _PROTOTYP( int conol, (char *) );
  5064. _PROTOTYP( int conola, (char *[]) );
  5065. _PROTOTYP( int conoll, (char *) );
  5066. _PROTOTYP( int conchk, (void) );
  5067. _PROTOTYP( int coninc, (int) );
  5068. _PROTOTYP( char * conkbg, (void) );
  5069. _PROTOTYP( int psuspend, (int) );
  5070. _PROTOTYP( int priv_ini, (void) );
  5071. _PROTOTYP( int priv_on, (void) );
  5072. _PROTOTYP( int priv_off, (void) );
  5073. _PROTOTYP( int priv_can, (void) );
  5074. _PROTOTYP( int priv_chk, (void) );
  5075. _PROTOTYP( int priv_opn, (char *, int) );
  5076. _PROTOTYP( int sysinit, (void) ); /* Misc Kermit functions */
  5077. _PROTOTYP( int syscleanup, (void) );
  5078. _PROTOTYP( int msleep, (int) );
  5079. _PROTOTYP( VOID rtimer, (void) );
  5080. _PROTOTYP( int gtimer, (void) );
  5081. #ifdef GFTIMER
  5082. _PROTOTYP( VOID rftimer, (void) );
  5083. _PROTOTYP( CKFLOAT gftimer, (void) );
  5084. #endif /* GFTIMER */
  5085. _PROTOTYP( VOID ttimoff, (void) );
  5086. _PROTOTYP( VOID ztime, (char **) );
  5087. _PROTOTYP( int parchk, (CHAR *, CHAR, int) );
  5088. _PROTOTYP( VOID doexit, (int, int) );
  5089. _PROTOTYP( int askmore, (void) );
  5090. _PROTOTYP( VOID fatal, (char *) );
  5091. _PROTOTYP( VOID fatal2, (char *, char *) );
  5092. #ifdef VMS
  5093. _PROTOTYP( int ck_cancio, (void) );
  5094. #endif /* VMS */
  5095. /* Key mapping support */
  5096. #ifdef NOICP
  5097. #ifndef NOSETKEY
  5098. #define NOSETKEY
  5099. #endif /* NOSETKEY */
  5100. #endif /* NOICP */
  5101. #ifdef MAC
  5102. #ifndef NOSETKEY
  5103. #define NOSETKEY
  5104. #endif /* NOSETKEY */
  5105. #endif /* MAC */
  5106. _PROTOTYP( int congks, (int) );
  5107. #ifdef OS2
  5108. /* OS2 requires these definitions even if SET KEY is not being supported */
  5109. #define KMSIZE 8916
  5110. typedef ULONG KEY;
  5111. typedef CHAR *MACRO;
  5112. extern int wideresult;
  5113. #else /* Not OS2 */
  5114. #ifndef NOSETKEY
  5115. /*
  5116. Catch-all for systems where we don't know how to read keyboard scan
  5117. codes > 255.
  5118. */
  5119. #define KMSIZE 256
  5120. /* Note: CHAR (i.e. unsigned char) is very important here. */
  5121. typedef CHAR KEY;
  5122. typedef CHAR * MACRO;
  5123. #define congks coninc
  5124. #endif /* NOSETKEY */
  5125. #endif /* OS2 */
  5126. #ifndef OS2
  5127. #ifndef NOKVERBS /* No \Kverbs unless... */
  5128. #define NOKVERBS
  5129. #endif /* NOKVERBS */
  5130. #endif /* OS2 */
  5131. #ifndef NOKVERBS
  5132. #ifdef OS2
  5133. /*
  5134. Note: this value chosen to be bigger than PC BIOS key modifier bits,
  5135. but still fit in 16 bits without affecting sign.
  5136. As of K95 1.1.5, this no longer fits in 16 bits, good thing we are 32 bit.
  5137. */
  5138. #define F_MACRO 0x2000 /* Bit indicating a macro indice */
  5139. #define IS_MACRO(x) (x & F_MACRO)
  5140. #define F_KVERB 0x4000 /* Bit indicating a keyboard verb */
  5141. #define IS_KVERB(x) (x & F_KVERB) /* Test this bit */
  5142. #endif /* OS2 */
  5143. #endif /* NOKVERBS */
  5144. #define F_ESC 0x8000 /* Bit indicating ESC char combination */
  5145. #define IS_ESC(x) (x & F_ESC)
  5146. #define F_CSI 0x10000 /* Bit indicating CSI char combination */
  5147. #define IS_CSI(x) (x & F_CSI)
  5148. #ifdef NOSPL /* This might be overkill.. */
  5149. #ifndef NOKVERBS /* Not all \Kverbs require */
  5150. #define NOKVERBS /* the script programming language. */
  5151. #endif /* NOKVERBS */
  5152. #ifndef NOTAKEARGS
  5153. #define NOTAKEARGS
  5154. #endif /* NOTAKEARGS */
  5155. #endif /* NOSPL */
  5156. /*
  5157. Function prototypes for system and library functions.
  5158. */
  5159. #ifdef _POSIX_SOURCE
  5160. #ifndef VMS
  5161. #ifndef MAC
  5162. #define CK_ANSILIBS
  5163. #endif /* MAC */
  5164. #endif /* VMS */
  5165. #endif /* _POSIX_SOURCE */
  5166. #ifdef NEXT
  5167. #define CK_ANSILIBS
  5168. #endif /* NEXT */
  5169. #ifdef SVR4
  5170. #define CK_ANSILIBS
  5171. #endif /* SVR4 */
  5172. #ifdef STRATUS /* Stratus VOS uses ANSI libraries */
  5173. #define CK_ANSILIBS
  5174. #endif /* STRATUS */
  5175. #ifdef OS2
  5176. #define CK_ANSILIBS
  5177. #ifndef NOCURSES
  5178. #define MYCURSES
  5179. #endif /* NOCURSES */
  5180. #define CK_RTSCTS
  5181. #ifdef __IBMC__
  5182. #define S_IFMT 0xF000
  5183. #define timezone _timezone
  5184. #endif /* __IBMC__ */
  5185. #include <fcntl.h>
  5186. #include <io.h>
  5187. #ifdef __EMX__
  5188. #ifndef __32BIT__
  5189. #define __32BIT__
  5190. #endif /* __32BIT__ */
  5191. #include <sys/timeb.h>
  5192. #else /* __EMX__ */
  5193. #include <direct.h>
  5194. #undef SIGALRM
  5195. #ifndef SIGUSR1
  5196. #define SIGUSR1 7
  5197. #endif /* SIGUSR1 */
  5198. #define SIGALRM SIGUSR1
  5199. _PROTOTYP( unsigned alarm, (unsigned) );
  5200. _PROTOTYP( unsigned sleep, (unsigned) );
  5201. #endif /* __EMX__ */
  5202. _PROTOTYP( unsigned long zdskspace, (int) );
  5203. _PROTOTYP( int zchdsk, (int) );
  5204. _PROTOTYP( int conincraw, (int) );
  5205. _PROTOTYP( int ttiscom, (int f) );
  5206. _PROTOTYP( int IsFileNameValid, (char *) );
  5207. _PROTOTYP( void ChangeNameForFAT, (char *) );
  5208. _PROTOTYP( char *GetLoadPath, (void) );
  5209. #endif /* OS2 */
  5210. /* Fullscreen file transfer display items... */
  5211. #ifndef NOCURSES
  5212. #ifdef CK_NCURSES /* CK_NCURSES implies CK_CURSES */
  5213. #ifndef CK_CURSES
  5214. #define CK_CURSES
  5215. #endif /* CK_CURSES */
  5216. #endif /* CK_NCURSES */
  5217. #ifdef MYCURSES /* MYCURSES implies CK_CURSES */
  5218. #ifndef CK_CURSES
  5219. #define CK_CURSES
  5220. #endif /* CK_CURSES */
  5221. #endif /* MYCURSES */
  5222. #endif /* NOCURSES */
  5223. #ifdef NOCURSES
  5224. #ifdef CK_CURSES
  5225. #undef CK_CURSES
  5226. #endif /* CK_CURSES */
  5227. #ifndef NODISPLAY
  5228. #define NODISPLAY
  5229. #endif /* NODISPLAY */
  5230. #endif /* NOCURSES */
  5231. #ifdef CK_CURSES
  5232. /*
  5233. The CK_WREFRESH symbol is defined if the curses library provides
  5234. clearok() and wrefresh() functions, which are used in repainting
  5235. the screen.
  5236. */
  5237. #ifdef NOWREFRESH /* Override CK_WREFRESH */
  5238. #ifdef CK_WREFRESH /* If this is defined, */
  5239. #undef CK_WREFRESH /* undefine it. */
  5240. #endif /* CK_WREFRESH */
  5241. #else /* !NOWREFRESH */ /* No override... */
  5242. #ifndef CK_WREFRESH /* If CK_WREFRESH not defined */
  5243. /*
  5244. Automatically define it for systems known to have it ...
  5245. */
  5246. #ifdef VMS /* DEC (Open)VMS has it */
  5247. #define CK_WREFRESH
  5248. #else
  5249. #ifdef ultrix /* DEC ULTRIX has it */
  5250. #else
  5251. #ifdef SVR3 /* System V has it */
  5252. #define CK_WREFRESH
  5253. #else
  5254. #ifdef BSD44 /* 4.4 BSD has it */
  5255. #define CK_WREFRESH
  5256. #else
  5257. #ifdef NEXT /* Define it for NeXTSTEP */
  5258. #define CK_WREFRESH
  5259. #else
  5260. #ifdef SUNOS4 /* SunOS 4.x... */
  5261. #define CK_WREFRESH
  5262. #else
  5263. #ifdef SOLARIS25 /* Solaris 2.5 and later */
  5264. #define CK_WREFRESH
  5265. #else
  5266. #ifdef AIXRS /* RS/6000 AIX ... */
  5267. #define CK_WREFRESH
  5268. #else
  5269. #ifdef RTAIX /* RT PC AIX ... */
  5270. #define CK_WREFRESH
  5271. #else
  5272. #ifdef OSF /* DEC OSF/1 ... */
  5273. #define CK_WREFRESH
  5274. /* Add more here, or just define CK_WREFRESH on the CC command line... */
  5275. #endif /* OSF */
  5276. #endif /* RTAIX */
  5277. #endif /* AIXRS */
  5278. #endif /* SOLARIS25 */
  5279. #endif /* SUNOS4 */
  5280. #endif /* NEXT */
  5281. #endif /* BSD44 */
  5282. #endif /* SVR3 */
  5283. #endif /* ultrix */
  5284. #endif /* VMS */
  5285. #else /* CK_WREFRESH is defined */
  5286. /* This is within an ifdef CK_CURSES block. The following is not needed */
  5287. #ifndef CK_CURSES /* CK_WREFRESH implies CK_CURSES */
  5288. #define CK_CURSES
  5289. #endif /* CK_CURSES */
  5290. #endif /* CK_WREFRESH */
  5291. #endif /* NOWREFRESH */
  5292. #ifndef TRMBUFL
  5293. #ifdef BIGBUFOK
  5294. #define TRMBUFL 16384
  5295. #else
  5296. #ifdef DYNAMIC
  5297. #define TRMBUFL 8192
  5298. #else
  5299. #define TRMBUFL 1024
  5300. #endif /* BIGBUFOK */
  5301. #endif /* DYNAMIC */
  5302. #endif /* TRMBUFL */
  5303. #endif /* CK_CURSES */
  5304. /*
  5305. Whether to use ckmatch() in all its glory for C-Shell-like patterns.
  5306. If CKREGEX is NOT defined, all but * and ? matching are removed from
  5307. ckmatch(). NOTE: Defining CKREGEX does not necessarily mean that ckmatch()
  5308. regexes are used for filename matching. That depends on whether zxpand()
  5309. in ck?fio.c calls ckmatch(). NOTE 2: REGEX is a misnomer -- these are not
  5310. regular expressions in the computer-science sense (in which, e.g. "a*b"
  5311. matches 0 or more 'a' characters followed by 'b') but patterns (in which
  5312. "a*b" matches 'a' followed by 0 or more non-b characters, followed by b).
  5313. */
  5314. #ifndef NOCKREGEX
  5315. #ifndef CKREGEX
  5316. #define CKREGEX
  5317. #endif /* CKREGEX */
  5318. #endif /* NOCKREGEX */
  5319. /* Learned-script feature */
  5320. #ifndef NOLEARN
  5321. #ifdef NOSPL
  5322. #define NOLEARN
  5323. #else
  5324. #ifdef NOLOCAL
  5325. #define NOLEARN
  5326. #endif /* NOLOCAL */
  5327. #endif /* NOSPL */
  5328. #endif /* NOLEARN */
  5329. #ifdef NOLEARN
  5330. #ifdef CKLEARN
  5331. #undef CKLEARN
  5332. #endif /* CKLEARN */
  5333. #else /* !NOLEARN */
  5334. #ifndef CKLEARN
  5335. #ifdef OS2ORUNIX
  5336. /* In UNIX this can work only with ckucns.c builds */
  5337. #define CKLEARN
  5338. #else
  5339. #ifdef VMS
  5340. #define CKLEARN
  5341. #endif /* VMS */
  5342. #endif /* OS2ORUNIX */
  5343. #endif /* CKLEARN */
  5344. #endif /* NOLEARN */
  5345. #ifdef CKLEARN
  5346. #ifndef LEARNBUFSIZ
  5347. #define LEARNBUFSIZ 128
  5348. #endif /* LEARNBUFSIZ */
  5349. #endif /* CKLEARN */
  5350. #ifndef IKSDONLY
  5351. #ifndef CKTIDLE /* Pseudo-keepalive in CONNECT */
  5352. #ifdef OS2 /* In K95 */
  5353. #define CKTIDLE
  5354. #else
  5355. #ifdef UNIX /* In UNIX but only ckucns versions */
  5356. #ifndef NOLEARN
  5357. #ifndef NOSELECT
  5358. #define CKTIDLE
  5359. #endif /* NOSELECT */
  5360. #endif /* NOLEARN */
  5361. #endif /* UNIX */
  5362. #endif /* OS2 */
  5363. #endif /* CKTIDLE */
  5364. #endif /* IKSDONLY */
  5365. #ifdef CK_ANSILIBS
  5366. /*
  5367. String library functions.
  5368. For ANSI C, get prototypes from <string.h>.
  5369. Otherwise, skip the prototypes.
  5370. */
  5371. #include <string.h>
  5372. /*
  5373. Prototypes for other commonly used library functions, such as
  5374. malloc, free, getenv, atol, atoi, and exit. Otherwise, no prototypes.
  5375. */
  5376. #include <stdlib.h>
  5377. #ifdef DIAB /* DIAB DS90 */
  5378. /* #include <commonC.h> */
  5379. #include <sys/wait.h>
  5380. #define CK_WAIT_H
  5381. #ifdef COMMENT
  5382. extern void exit(int status);
  5383. extern void _exit(int status);
  5384. extern int uname(struct utsname *name);
  5385. #endif /* COMMENT */
  5386. extern int chmod(char *path, int mode);
  5387. extern int ioctl(int fildes, int request, ...);
  5388. extern int rdchk(int ttyfd);
  5389. extern int nap(int m);
  5390. #ifdef COMMENT
  5391. extern int getppid(void);
  5392. #endif /* COMMENT */
  5393. extern int _filbuf(FILE *stream);
  5394. extern int _flsbuf(char c,FILE *stream);
  5395. #endif /* DIAB */
  5396. /*
  5397. Prototypes for UNIX functions like access, alarm, chdir, sleep, fork,
  5398. and pause. Otherwise, no prototypes.
  5399. */
  5400. #ifdef VMS
  5401. #include <signal.h> /* SMS: sleep() for old (V4.0-000) DEC C. */
  5402. #include <unixio.h>
  5403. #include <unixlib.h> /* SMS: getpid() for old (V4.0-000) DEC C. */
  5404. #endif /* VMS */
  5405. #ifdef NEXT
  5406. #ifndef NEXT33
  5407. #include <libc.h>
  5408. #endif /* NEXT33 */
  5409. #else /* NoT NeXT */
  5410. #ifndef AMIGA
  5411. #ifndef OS2
  5412. #ifdef STRATUS
  5413. #include <c_utilities.h>
  5414. #else /* !STRATUS */
  5415. #ifndef OSKXXC
  5416. #include <unistd.h>
  5417. #endif /* OSKXXC */
  5418. #ifdef HAVE_CRYPT_H
  5419. #include <crypt.h>
  5420. #endif /* HAVE_CRYPT_H */
  5421. #endif /* STRATUS */
  5422. #endif /* OS2 */
  5423. #endif /* AMIGA */
  5424. #endif /* NEXT */
  5425. #else /* Not ANSI libs... */
  5426. #ifdef MAC
  5427. #include <String.h>
  5428. #include <StdLib.h>
  5429. #endif /* MAC */
  5430. #ifdef HPUX
  5431. #ifndef HPUXPRE65
  5432. #include <unistd.h>
  5433. #endif /* HPUXPRE65 */
  5434. #endif /* HPUX */
  5435. #ifdef SUNOS41
  5436. #include <unistd.h>
  5437. #include <stdlib.h>
  5438. #else
  5439. #ifndef MAC
  5440. /*
  5441. It is essential that these are declared correctly!
  5442. Which is not always easy. Take malloc() for instance ...
  5443. */
  5444. #ifdef PYRAMID
  5445. #ifdef SVR4
  5446. #ifdef __STDC__
  5447. #define SIZE_T_MALLOC
  5448. #endif /* __STDC__ */
  5449. #endif /* SVR4 */
  5450. #endif /* PYRAMID */
  5451. /*
  5452. Maybe some other environments need the same treatment for malloc.
  5453. If so, define SIZE_T_MALLOC for them here or in compiler CFLAGS.
  5454. */
  5455. #ifdef SIZE_T_MALLOC
  5456. _PROTOTYP( void * malloc, (size_t) );
  5457. #else
  5458. _PROTOTYP( char * malloc, (unsigned int) );
  5459. #endif /* SIZE_T_MALLOC */
  5460. _PROTOTYP( char * getenv, (char *) );
  5461. _PROTOTYP( long atol, (char *) );
  5462. #endif /* !MAC */
  5463. #endif /* SUNOS41 */
  5464. #endif /* CK_ANSILIBS */
  5465. /*
  5466. <sys/param.h> generally picks up NULL, MAXPATHLEN, and MAXNAMLEN
  5467. and seems to present on all Unixes going back at least to SCO Xenix
  5468. with the exception(s) noted.
  5469. */
  5470. #ifndef NO_PARAM_H /* 2001-11-03 */
  5471. #ifndef UNIX /* Non-Unixes don't have it */
  5472. #define NO_PARAM_H
  5473. #else
  5474. #ifdef TRS16 /* Tandy Xenix doesn't have it */
  5475. #define NO_PARAM_H
  5476. #endif /* TRS16 */
  5477. #endif /* UNIX */
  5478. #endif /* NO_PARAM_H */
  5479. #ifndef NO_PARAM_H
  5480. #ifndef INCL_PARAM_H
  5481. #define INCL_PARAM_H
  5482. #endif /* INCL_PARAM_H */
  5483. #include <sys/param.h>
  5484. #endif /* NO_PARAM_H */
  5485. #ifndef NULL /* In case NULL is still not defined */
  5486. #define NULL 0L
  5487. /* or #define NULL 0 */
  5488. /* or #define NULL ((char *) 0) */
  5489. /* or #define NULL ((void *) 0) */
  5490. #endif /* NULL */
  5491. /* Macro to differentiate "" from NULL (to avoid comparisons with literals) */
  5492. #ifndef isemptystring
  5493. #define isemptystring(s) ((s?(*s?0:1):0))
  5494. #endif /* isemptystring */
  5495. /* Maximum length for a fully qualified filename, not counting \0 at end. */
  5496. /*
  5497. This is a rough cut, and errs on the side of being too big. We don't
  5498. want to pull in hundreds of header files looking for many and varied
  5499. symbols, for fear of introducing unnecessary conflicts.
  5500. */
  5501. #ifndef CKMAXPATH
  5502. #ifdef VMS /* VMS may have bad (small, ODS2) */
  5503. #define CKMAXPATH NAMX_C_MAXRSS /* PATH_MAX, so use NAMX_C_MAXRSS. */
  5504. #else /* def VMS */
  5505. #ifdef MAXPATHLEN /* (it probably isn't) */
  5506. #define CKMAXPATH MAXPATHLEN
  5507. #else
  5508. #ifdef PATH_MAX /* POSIX */
  5509. #define CKMAXPATH PATH_MAX
  5510. #else /* def PATH_MAX */
  5511. #ifdef MAC
  5512. #define CKMAXPATH 63
  5513. #else /* def MAC */
  5514. #ifdef pdp11
  5515. #define CKMAXPATH 255
  5516. #else /* def pdp11 */
  5517. #ifdef UNIX /* Even though some are way less... */
  5518. #define CKMAXPATH 1024
  5519. #else /* def UNIX */
  5520. #ifdef STRATUS
  5521. #define CKMAXPATH 256 /* == $MXPL from PARU.H */
  5522. #else /* def STRATUS */
  5523. #ifdef datageneral
  5524. #define CKMAXPATH 256 /* == $MXPL from PARU.H */
  5525. #else /* def datageneral */
  5526. #define CKMAXPATH 255
  5527. #endif /* def STRATUS [else] */
  5528. #endif /* def datageneral [else] */
  5529. #endif /* def UNIX [else] */
  5530. #endif /* def pdp11 [else] */
  5531. #endif /* def MAC [else] */
  5532. #endif /* def PATH_MAX [else] */
  5533. #endif /* def MAXPATHLEN [else] */
  5534. #endif /* def VMS [else] */
  5535. #endif /* ndef CKMAXPATH */
  5536. /* Maximum length for the name of a tty device */
  5537. #ifndef DEVNAMLEN
  5538. #define DEVNAMLEN CKMAXPATH
  5539. #endif /* DEVNAMLEN */
  5540. /* Directory (path segment) separator */
  5541. /* Not fully general - Tricky for VMS, Amiga, ... */
  5542. #ifndef DIRSEP
  5543. #ifdef UNIX
  5544. #define DIRSEP '/'
  5545. #define STRDIRSEP "/"
  5546. #define ISDIRSEP(c) ((c)=='/')
  5547. #else
  5548. #ifdef OS2
  5549. #define DIRSEP '/'
  5550. #define STRDIRSEP "/"
  5551. #define ISDIRSEP(c) ((c)=='/'||(c)=='\\')
  5552. #else
  5553. #ifdef datageneral
  5554. #define DIRSEP ':'
  5555. #define STRDIRSEP ":"
  5556. #define ISDIRSEP(c) (((c)==':')||((c)=='^')||((c)=='='))
  5557. #else
  5558. #ifdef STRATUS
  5559. #define DIRSEP '>'
  5560. #define ISDIRSEP(c) ((c)=='>')
  5561. #else
  5562. #ifdef VMS
  5563. #define DIRSEP ']' /* (not really) */
  5564. #define ISDIRSEP(c) ((c)==']'||(c)==':')
  5565. #else
  5566. #ifdef MAC
  5567. #define DIRSEP ':'
  5568. #define ISDIRSEP(c) ((c)==':')
  5569. #else
  5570. #ifdef AMIGA
  5571. #define STRDIRSEP "/"
  5572. #define ISDIRSEP(c) ((c)=='/'||(c)==':')
  5573. #else
  5574. #ifdef GEMDOS
  5575. #define DIRSEP '\\'
  5576. #define STRDIRSEP "\\"
  5577. #define ISDIRSEP(c) ((c)=='\\'||(c)==':')
  5578. #else
  5579. #define DIRSEP '/'
  5580. #define STRDIRSEP "/"
  5581. #define ISDIRSEP(c) ((c)=='/')
  5582. #endif /* GEMDOS */
  5583. #endif /* AMIGA */
  5584. #endif /* MAC */
  5585. #endif /* VMS */
  5586. #endif /* STRATUS */
  5587. #endif /* datageneral */
  5588. #endif /* OS2 */
  5589. #endif /* UNIX */
  5590. #endif /* DIRSEP */
  5591. /* FILE package parameters */
  5592. #ifdef pdp11
  5593. #define NOCHANNELIO
  5594. #else
  5595. #ifndef CKMAXOPEN
  5596. #ifdef QNX
  5597. #define CKMAXOPEN 390
  5598. #else
  5599. #ifdef VMS
  5600. #define CKMAXOPEN 64
  5601. #else
  5602. #ifdef OPEN_MAX
  5603. #define CKMAXOPEN OPEN_MAX
  5604. #else
  5605. #ifdef FOPEN_MAX
  5606. #define CKMAXOPEN FOPEN_MAX
  5607. #else
  5608. #define CKMAXOPEN 64
  5609. #endif /* FOPEN_MAX */
  5610. #endif /* OPEN_MAX */
  5611. #endif /* VMS */
  5612. #endif /* QNX */
  5613. #endif /* CKMAXOPEN */
  5614. /* Maximum channels for FOPEN = CKMAXOPEN minus logs, stdio, etc */
  5615. #ifndef Z_MINCHAN
  5616. #define Z_MINCHAN 16
  5617. #endif /* Z_MINCHAN */
  5618. #ifndef Z_MAXCHAN
  5619. #define Z_MAXCHAN (CKMAXOPEN-ZNFILS-5)
  5620. #endif /* Z_MAXCHAN */
  5621. #endif /* pdp11 */
  5622. /* New-format nzltor() and nzrtol() functions that handle pathnames */
  5623. #ifndef NZLTOR
  5624. #ifdef UNIX
  5625. #define NZLTOR
  5626. #else
  5627. #ifdef VMS
  5628. #define NZLTOR
  5629. #else
  5630. #ifdef OS2
  5631. #define NZLTOR
  5632. #else
  5633. #ifdef STRATUS
  5634. #define NZLTOR
  5635. #endif /* STRATUS */
  5636. #endif /* OS2 */
  5637. #endif /* VMS */
  5638. #endif /* UNIX */
  5639. #endif /* NZLTOR */
  5640. #ifdef NZLTOR
  5641. _PROTOTYP( VOID nzltor, (char *, char *, int, int, int) );
  5642. _PROTOTYP( VOID nzrtol, (char *, char *, int, int, int) );
  5643. #endif /* NZLTOR */
  5644. /* Implementations with a zrmdir() function */
  5645. #ifndef ZRMDIR
  5646. #ifdef OS2
  5647. #define ZRMDIR
  5648. #else /* OS2 */
  5649. #ifdef UNIX
  5650. #define ZRMDIR
  5651. #else
  5652. #ifdef VMS
  5653. #define ZRMDIR
  5654. #else /* VMS */
  5655. #ifdef STRATUS
  5656. #define ZRMDIR
  5657. #endif /* STRATUS */
  5658. #endif /* VMS */
  5659. #endif /* UNIX */
  5660. #endif /* OS2 */
  5661. #endif /* ZRMDIR */
  5662. #ifdef ZRMDIR
  5663. _PROTOTYP( int zrmdir, (char *) );
  5664. #endif /* ZRMDIR */
  5665. #ifndef FILECASE
  5666. #ifdef UNIXOROSK
  5667. #define FILECASE 1
  5668. #else
  5669. #define FILECASE 0
  5670. #endif /* UNIXOROSK */
  5671. #ifndef CKCMAI
  5672. extern int filecase;
  5673. #endif /* CKCMAI */
  5674. #endif /* FILECASE */
  5675. /* Funny names for library functions department... */
  5676. #ifdef ZILOG
  5677. #define setjmp setret
  5678. #define longjmp longret
  5679. #define jmp_buf ret_buf
  5680. #define getcwd curdir
  5681. #endif /* ZILOG */
  5682. #ifdef STRATUS
  5683. /* The C-runtime conflicts with things we do in Stratus VOS ckltio.c ... */
  5684. #define printf vosprtf
  5685. _PROTOTYP( int vosprtf, (char *fmt, ...) );
  5686. #define perror(txt) printf("%s\n", txt)
  5687. /* char_varying is a string type from PL/I that VOS uses extensively */
  5688. #define CV char_varying
  5689. #endif /* STRATUS */
  5690. #ifdef NT
  5691. extern int OSVer;
  5692. #define isWin95() (OSVer==VER_PLATFORM_WIN32_WINDOWS)
  5693. #else
  5694. #define isWin95() (0)
  5695. #endif /* NT */
  5696. #ifndef BPRINT
  5697. #ifdef OS2
  5698. #define BPRINT
  5699. #endif /* OS2 */
  5700. #endif /* BPRINT */
  5701. #ifndef SESLIMIT
  5702. #ifdef OS2
  5703. #define SESLIMIT
  5704. #endif /* OS2 */
  5705. #endif /* SESLIMIT */
  5706. #ifndef NOTERM
  5707. #ifndef PCTERM
  5708. #ifdef NT
  5709. #define PCTERM
  5710. #endif /* NT */
  5711. #endif /* PCTERM */
  5712. #endif /* NOTERM */
  5713. #ifdef BEOSORBEBOX
  5714. #define query ckquery
  5715. #endif /* BEOSORBEBOX */
  5716. #ifndef PTYORPIPE /* NETCMD and/or NETPTY defined */
  5717. #ifdef NETCMD
  5718. #define PTYORPIPE
  5719. #else
  5720. #ifdef NETPTY
  5721. #define PTYORPIPE
  5722. #endif /* NETPTY */
  5723. #endif /* NETCMD */
  5724. #endif /* PTYORPIPE */
  5725. /* mktemp() and mkstemp() */
  5726. #ifndef NOMKTEMP
  5727. #ifndef MKTEMP
  5728. #ifdef OS2ORUNIX
  5729. #define MKTEMP
  5730. #endif /* OS2ORUNIX */
  5731. #endif /* MKTEMP */
  5732. #ifdef MKTEMP
  5733. #ifndef NOMKSTEMP
  5734. #ifndef MKSTEMP
  5735. #ifdef BSD44
  5736. #define MKSTEMP
  5737. #else
  5738. #ifdef __linux__
  5739. #define MKSTEMP
  5740. #endif /* __linux__ */
  5741. #endif /* BSD44 */
  5742. #endif /* MKSTEMP */
  5743. #endif /* NOMKSTEMP */
  5744. #endif /* MKTEMP */
  5745. #endif /* NOMKTEMP */
  5746. /* Platforms that have memcpy() -- only after all headers included */
  5747. #ifndef USE_MEMCPY
  5748. #ifdef VMS
  5749. #define USE_MEMCPY
  5750. #else
  5751. #ifdef NEXT
  5752. #define USE_MEMCPY
  5753. #else
  5754. #ifdef OS2
  5755. #define USE_MEMCPY
  5756. #else
  5757. #ifdef __linux__
  5758. #define USE_MEMCPY
  5759. #else
  5760. #ifdef SOLARIS
  5761. #define USE_MEMCPY
  5762. #else
  5763. #ifdef SUNOS4
  5764. #define USE_MEMCPY
  5765. #else
  5766. #ifdef AIXRS
  5767. #define USE_MEMCPY
  5768. #else
  5769. #ifdef HPUX
  5770. #define USE_MEMCPY
  5771. #else
  5772. #ifdef POSIX
  5773. #define USE_MEMCPY
  5774. #else
  5775. #ifdef SVR4
  5776. #define USE_MEMCPY
  5777. #else
  5778. #ifdef OSF
  5779. #define USE_MEMCPY
  5780. #else
  5781. #ifdef datageneral
  5782. #define USE_MEMCPY
  5783. #else
  5784. #ifdef STRATUS
  5785. #define USE_MEMCPY
  5786. #endif /* STRATUS */
  5787. #endif /* datageneral */
  5788. #endif /* OSF */
  5789. #endif /* SVR4 */
  5790. #endif /* POSIX */
  5791. #endif /* HPUX */
  5792. #endif /* AIXRS */
  5793. #endif /* SUNOS4 */
  5794. #endif /* SOLARIS */
  5795. #endif /* __linux__ */
  5796. #endif /* OS2 */
  5797. #endif /* NEXT */
  5798. #endif /* VMS */
  5799. #endif /* USE_MEMCPY */
  5800. #ifndef USE_MEMCPY
  5801. #define memcpy(a,b,c) ckmemcpy((a),(b),(c))
  5802. #else
  5803. #ifdef CK_SCO32V4
  5804. /* Because the prototype isn't picked up in the normal header files */
  5805. _PROTOTYP( void *memcpy, (void *, const void *, size_t));
  5806. #endif /* CK_SCO32V4 */
  5807. #endif /* USE_MEMCPY */
  5808. /* User authentication for IKS -- So far K95 and UNIX only */
  5809. #ifdef NOICP
  5810. #ifndef NOLOGIN
  5811. #define NOLOGIN
  5812. #endif /* NOLOGIN */
  5813. #endif /* NOICP */
  5814. #ifndef NOLOGIN
  5815. #ifdef OS2ORUNIX
  5816. #ifndef CK_LOGIN
  5817. #define CK_LOGIN
  5818. #ifndef NOSHADOW
  5819. #ifdef CK_SCOV5
  5820. #define CK_SHADOW
  5821. #endif /* CK_SCOV5 */
  5822. #endif /* NOSHADOW */
  5823. #endif /* CK_LOGIN */
  5824. #ifdef NT
  5825. #define NTCREATETOKEN
  5826. #endif /* NT */
  5827. #endif /* OS2ORUNIX */
  5828. #else /* NOLOGIN */
  5829. #ifdef CK_LOGIN
  5830. #undef CK_LOGIN
  5831. #endif /* CK_LOGIN */
  5832. #endif /* NOLOGIN */
  5833. #ifdef OS2
  5834. #define CKSPINNER
  5835. #endif /* OS2 */
  5836. #ifdef CK_LOGIN /* Telnet protocol required */
  5837. #ifndef TNCODE /* for login to IKSD. */
  5838. #define TNCODE
  5839. #endif /* TNCODE */
  5840. #endif /* CK_LOGIN */
  5841. #ifdef CK_AUTHENTICATION
  5842. #ifdef NOSENDUID
  5843. #undef NOSENDUID
  5844. #endif /* NOSENDUID */
  5845. #endif /* CK_AUTHENTICATION */
  5846. #ifdef TNCODE /* Should TELNET send user ID? */
  5847. #ifndef NOSENDUID
  5848. #ifndef CKSENDUID
  5849. #define CKSENDUID
  5850. #endif /* CKSENDUID */
  5851. #endif /* NOSENDUID */
  5852. #endif /* TNCODE */
  5853. /* UNIX platforms that don't have getusershell() */
  5854. #ifdef UNIX
  5855. #ifndef NOGETUSERSHELL
  5856. #ifdef IRIX
  5857. #define NOGETUSERSHELL
  5858. #else
  5859. #ifdef PTX
  5860. #define NOGETUSERSHELL
  5861. #else
  5862. #ifdef AIXRS
  5863. #define NOGETUSERSHELL
  5864. #else
  5865. #ifdef SINIX
  5866. #define NOGETUSERSHELL
  5867. #else
  5868. #ifdef UNIXWARE
  5869. #define NOGETUSERSHELL
  5870. #else
  5871. #ifdef COHERENT
  5872. #define NOGETUSERSHELL
  5873. #endif /* COHERENT */
  5874. #endif /* UNIXWARE */
  5875. #endif /* SINIX */
  5876. #endif /* AIXRS */
  5877. #endif /* PTX */
  5878. #endif /* IRIX */
  5879. #endif /* NOGETUSERSHELL */
  5880. #endif /* UNIX */
  5881. #ifdef CK_LOGIN
  5882. #ifdef NT
  5883. #ifndef NOSYSLOG
  5884. #ifndef CKSYSLOG
  5885. #define CKSYSLOG
  5886. #endif /* CKSYSLOG */
  5887. #endif /* NOSYSLOG */
  5888. #endif /* NT */
  5889. #ifdef UNIX
  5890. #ifndef NOSYSLOG
  5891. #ifndef CKSYSLOG
  5892. #define CKSYSLOG
  5893. #endif /* CKSYSLOG */
  5894. #endif /* NOSYSLOG */
  5895. #ifndef NOWTMP
  5896. #ifndef CKWTMP
  5897. #define CKWTMP
  5898. #endif /* CKWTMP */
  5899. #endif /* NOWTMP */
  5900. #ifndef NOGETUSERSHELL
  5901. #ifndef GETUSERSHELL
  5902. #define GETUSERSHELL
  5903. #endif /* GETUSERSHELL */
  5904. #endif /* NOGETUSERSHELL */
  5905. #endif /* UNIX */
  5906. _PROTOTYP( int ckxlogin, (CHAR *, CHAR *, CHAR *, int));
  5907. _PROTOTYP( int ckxlogout, (VOID));
  5908. #endif /* CK_LOGIN */
  5909. #ifndef NOZLOCALTIME /* zlocaltime() available. */
  5910. #ifdef OS2ORUNIX
  5911. #define ZLOCALTIME
  5912. _PROTOTYP( char * zlocaltime, (char *) );
  5913. #endif /* OS2ORUNIX */
  5914. #endif /* NOZLOCALTIME */
  5915. #ifdef CKSYSLOG /* Syslogging levels */
  5916. #define SYSLG_NO 0 /* No logging */
  5917. #define SYSLG_LI 1 /* Login/out */
  5918. #define SYSLG_DI 2 /* Dialing out */
  5919. #define SYSLG_AC 3 /* Making any kind of connection */
  5920. #define SYSLG_PR 4 /* Protocol Operations */
  5921. #define SYSLG_FC 5 /* File creation */
  5922. #define SYSLG_FA 6 /* File reading */
  5923. #define SYSLG_CM 7 /* Top-level commands */
  5924. #define SYSLG_CX 8 /* All commands */
  5925. #define SYSLG_DB 9 /* Debug */
  5926. #define SYSLGMAX 9 /* Highest level */
  5927. #define SYSLG_DF SYSLG_FA /* Default level */
  5928. /* Logging function */
  5929. _PROTOTYP(VOID cksyslog,(int, int, char *, char *, char *));
  5930. #endif /* CKSYSLOG */
  5931. #ifndef CKCMAI
  5932. extern int ckxlogging, ckxsyslog, ikdbopen;
  5933. #endif /* CKCMAI */
  5934. #ifndef CK_KEYTAB
  5935. #define CK_KEYTAB
  5936. /* Keyword Table Template */
  5937. /* Note: formerly defined in ckucmd.h but now more widely used */
  5938. struct keytab { /* Keyword table */
  5939. char *kwd; /* Pointer to keyword string */
  5940. int kwval; /* Associated value */
  5941. int flgs; /* Flags (as defined above) */
  5942. };
  5943. #endif /* CK_KEYTAB */
  5944. #ifdef UNIX
  5945. _PROTOTYP( int isalink, (char *));
  5946. #endif /* UNIX */
  5947. #ifdef NETPTY
  5948. _PROTOTYP( int do_pty, (int *, char *, int));
  5949. _PROTOTYP( VOID end_pty, (void));
  5950. #endif /* NETPTY */
  5951. #ifdef CKROOT
  5952. _PROTOTYP( int zsetroot, (char *) );
  5953. _PROTOTYP( char * zgetroot, (void) );
  5954. _PROTOTYP( int zinroot, (char *) );
  5955. #endif /* CKROOT */
  5956. /* Local Echo Buffer prototypes */
  5957. _PROTOTYP( VOID le_init, (void) );
  5958. _PROTOTYP( VOID le_clean, (void));
  5959. _PROTOTYP( int le_inbuf, (void));
  5960. _PROTOTYP( int le_putstr, (CHAR *));
  5961. _PROTOTYP( int le_puts, (CHAR *, int));
  5962. _PROTOTYP( int le_putchar, (CHAR));
  5963. _PROTOTYP( int le_getchar, (CHAR *));
  5964. /* #ifndef NOHTTP */
  5965. #ifndef NOCMDATE2TM
  5966. #ifndef CMDATE2TM
  5967. #ifdef OS2ORUNIX
  5968. #define CMDATE2TM
  5969. #endif /* OS2ORUNIX */
  5970. #ifdef VMS
  5971. #define CMDATE2TM
  5972. #endif /* VMS */
  5973. #endif /* CMDATE2TM */
  5974. #endif /* NOCMDATE2TM */
  5975. #ifndef NOLOCALE
  5976. #ifdef BSD44ORPOSIX
  5977. #ifndef NO_NL_LANGINFO
  5978. #ifndef HAVE_LOCALE
  5979. #define HAVE_LOCALE
  5980. #include <locale.h>
  5981. #endif /* HAVE_LOCALE */
  5982. #endif /* NO_NL_LANGINFO */
  5983. #endif /* BSD44ORPOSIX */
  5984. #endif /* NOLOCALE */
  5985. #ifdef CMDATE2TM
  5986. _PROTOTYP( struct tm * cmdate2tm, (char *,int));
  5987. #endif /* CMDATE2TM */
  5988. /* #endif */ /* NOHTTP */
  5989. #ifndef NOSETTIME /* This would be set in CFLAGS */
  5990. #ifdef SVR4ORPOSIX /* Defined in IEEE 1003.1-1996 */
  5991. #ifndef UTIMEH /* and in SVID for SVR4 */
  5992. #define UTIMEH
  5993. #endif /* UTIMEH */
  5994. #else /* SVR4ORPOSIX */
  5995. #ifdef OSF /* Verified by Lucas Hart */
  5996. #ifndef UTIMEH
  5997. #define UTIMEH
  5998. #endif /* UTIMEH */
  5999. #else /* OSF */
  6000. #ifdef SUNOS41 /* Verified by Lucas Hart */
  6001. #ifndef UTIMEH
  6002. #define UTIMEH
  6003. #endif /* UTIMEH */
  6004. #else /* SUNOS41 */
  6005. #ifdef OS2
  6006. #ifndef SYSUTIMEH
  6007. #define SYSUTIMEH
  6008. #endif /* SYSUTIMEH */
  6009. #else /* OS2 */
  6010. #ifdef VMS
  6011. #ifndef UTIMEH
  6012. #define UTIMEH
  6013. #endif /* UTIMEH */
  6014. #endif /* VMS */
  6015. #endif /* OS2 */
  6016. #endif /* SUNOS41 */
  6017. #endif /* OSF */
  6018. #endif /* SVR4ORPOSIX */
  6019. #endif /* NOSETTIME */
  6020. #ifdef NEWFTP
  6021. _PROTOTYP( int ftpisconnected, (void));
  6022. _PROTOTYP( int ftpisloggedin, (void));
  6023. _PROTOTYP( int ftpissecure, (void));
  6024. #endif /* NEWFTP */
  6025. _PROTOTYP( int readpass, (char *, char *, int));
  6026. _PROTOTYP( int readtext, (char *, char *, int));
  6027. #ifdef OS2
  6028. _PROTOTYP(int ck_auth_loaddll, (VOID));
  6029. _PROTOTYP(int ck_auth_unloaddll, (VOID));
  6030. #endif /* OS2 */
  6031. #ifdef NT
  6032. _PROTOTYP(DWORD ckGetLongPathname,(LPCSTR lpFileName,
  6033. LPSTR lpBuffer, DWORD cchBuffer));
  6034. #endif /* NT */
  6035. #include "ckclib.h"
  6036. /* End of ckcdeb.h */
  6037. #endif /* CKCDEB_H */