ccgo_darwin_arm64.go 1.0 MB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568155691557015571155721557315574155751557615577155781557915580155811558215583155841558515586155871558815589155901559115592155931559415595155961559715598155991560015601156021560315604156051560615607156081560915610156111561215613156141561515616156171561815619156201562115622156231562415625156261562715628156291563015631156321563315634156351563615637156381563915640156411564215643156441564515646156471564815649156501565115652156531565415655156561565715658156591566015661156621566315664156651566615667156681566915670156711567215673156741567515676156771567815679156801568115682156831568415685156861568715688156891569015691156921569315694156951569615697156981569915700157011570215703157041570515706157071570815709157101571115712157131571415715157161571715718157191572015721157221572315724157251572615727157281572915730157311573215733157341573515736157371573815739157401574115742157431574415745157461574715748157491575015751157521575315754157551575615757157581575915760157611576215763157641576515766157671576815769157701577115772157731577415775157761577715778157791578015781157821578315784157851578615787157881578915790157911579215793157941579515796157971579815799158001580115802158031580415805158061580715808158091581015811158121581315814158151581615817158181581915820158211582215823158241582515826158271582815829158301583115832158331583415835158361583715838158391584015841158421584315844158451584615847158481584915850158511585215853158541585515856158571585815859158601586115862158631586415865158661586715868158691587015871158721587315874158751587615877158781587915880158811588215883158841588515886158871588815889158901589115892158931589415895158961589715898158991590015901159021590315904159051590615907159081590915910159111591215913159141591515916159171591815919159201592115922159231592415925159261592715928159291593015931159321593315934159351593615937159381593915940159411594215943159441594515946159471594815949159501595115952159531595415955159561595715958159591596015961159621596315964159651596615967159681596915970159711597215973159741597515976159771597815979159801598115982159831598415985159861598715988159891599015991159921599315994159951599615997159981599916000160011600216003160041600516006160071600816009160101601116012160131601416015160161601716018160191602016021160221602316024160251602616027160281602916030160311603216033160341603516036160371603816039160401604116042160431604416045160461604716048160491605016051160521605316054160551605616057160581605916060160611606216063160641606516066160671606816069160701607116072160731607416075160761607716078160791608016081160821608316084160851608616087160881608916090160911609216093160941609516096160971609816099161001610116102161031610416105161061610716108161091611016111161121611316114161151611616117161181611916120161211612216123161241612516126161271612816129161301613116132161331613416135161361613716138161391614016141161421614316144161451614616147161481614916150161511615216153161541615516156161571615816159161601616116162161631616416165161661616716168161691617016171161721617316174161751617616177161781617916180161811618216183161841618516186161871618816189161901619116192161931619416195161961619716198161991620016201162021620316204162051620616207162081620916210162111621216213162141621516216162171621816219162201622116222162231622416225162261622716228162291623016231162321623316234162351623616237162381623916240162411624216243162441624516246162471624816249162501625116252162531625416255162561625716258162591626016261162621626316264162651626616267162681626916270162711627216273162741627516276162771627816279162801628116282162831628416285162861628716288162891629016291162921629316294162951629616297162981629916300163011630216303163041630516306163071630816309163101631116312163131631416315163161631716318163191632016321163221632316324163251632616327163281632916330163311633216333163341633516336163371633816339163401634116342163431634416345163461634716348163491635016351163521635316354163551635616357163581635916360163611636216363163641636516366163671636816369163701637116372163731637416375163761637716378163791638016381163821638316384163851638616387163881638916390163911639216393163941639516396163971639816399164001640116402164031640416405164061640716408164091641016411164121641316414164151641616417164181641916420164211642216423164241642516426164271642816429164301643116432164331643416435164361643716438164391644016441164421644316444164451644616447164481644916450164511645216453164541645516456164571645816459164601646116462164631646416465164661646716468164691647016471164721647316474164751647616477164781647916480164811648216483164841648516486164871648816489164901649116492164931649416495164961649716498164991650016501165021650316504165051650616507165081650916510165111651216513165141651516516165171651816519165201652116522165231652416525165261652716528165291653016531165321653316534165351653616537165381653916540165411654216543165441654516546165471654816549165501655116552165531655416555165561655716558165591656016561165621656316564165651656616567165681656916570165711657216573165741657516576165771657816579165801658116582165831658416585165861658716588165891659016591165921659316594165951659616597165981659916600166011660216603166041660516606166071660816609166101661116612166131661416615166161661716618166191662016621166221662316624166251662616627166281662916630166311663216633166341663516636166371663816639166401664116642166431664416645166461664716648166491665016651166521665316654166551665616657166581665916660166611666216663166641666516666166671666816669166701667116672166731667416675166761667716678166791668016681166821668316684166851668616687166881668916690166911669216693166941669516696166971669816699167001670116702167031670416705167061670716708167091671016711167121671316714167151671616717167181671916720167211672216723167241672516726167271672816729167301673116732167331673416735167361673716738167391674016741167421674316744167451674616747167481674916750167511675216753167541675516756167571675816759167601676116762167631676416765167661676716768167691677016771167721677316774167751677616777167781677916780167811678216783167841678516786167871678816789167901679116792167931679416795167961679716798167991680016801168021680316804168051680616807168081680916810168111681216813168141681516816168171681816819168201682116822168231682416825168261682716828168291683016831168321683316834168351683616837168381683916840168411684216843168441684516846168471684816849168501685116852168531685416855168561685716858168591686016861168621686316864168651686616867168681686916870168711687216873168741687516876168771687816879168801688116882168831688416885168861688716888168891689016891168921689316894168951689616897168981689916900169011690216903169041690516906169071690816909169101691116912169131691416915169161691716918169191692016921169221692316924169251692616927169281692916930169311693216933169341693516936169371693816939169401694116942169431694416945169461694716948169491695016951169521695316954169551695616957169581695916960169611696216963169641696516966169671696816969169701697116972169731697416975169761697716978169791698016981169821698316984169851698616987169881698916990169911699216993169941699516996169971699816999170001700117002170031700417005170061700717008170091701017011170121701317014170151701617017170181701917020170211702217023170241702517026170271702817029170301703117032170331703417035170361703717038170391704017041170421704317044170451704617047170481704917050170511705217053170541705517056170571705817059170601706117062170631706417065170661706717068170691707017071170721707317074170751707617077170781707917080170811708217083170841708517086170871708817089170901709117092170931709417095170961709717098170991710017101171021710317104171051710617107171081710917110171111711217113171141711517116171171711817119171201712117122171231712417125171261712717128171291713017131171321713317134171351713617137171381713917140171411714217143171441714517146171471714817149171501715117152171531715417155171561715717158171591716017161171621716317164171651716617167171681716917170171711717217173171741717517176171771717817179171801718117182171831718417185171861718717188171891719017191171921719317194171951719617197171981719917200172011720217203172041720517206172071720817209172101721117212172131721417215172161721717218172191722017221172221722317224172251722617227172281722917230172311723217233172341723517236172371723817239172401724117242172431724417245172461724717248172491725017251172521725317254172551725617257172581725917260172611726217263172641726517266172671726817269172701727117272172731727417275172761727717278172791728017281172821728317284172851728617287172881728917290172911729217293172941729517296172971729817299173001730117302173031730417305173061730717308173091731017311173121731317314173151731617317173181731917320173211732217323173241732517326173271732817329173301733117332173331733417335173361733717338173391734017341173421734317344173451734617347173481734917350173511735217353173541735517356173571735817359173601736117362173631736417365173661736717368173691737017371173721737317374173751737617377173781737917380173811738217383173841738517386173871738817389173901739117392173931739417395173961739717398173991740017401174021740317404174051740617407174081740917410174111741217413174141741517416174171741817419174201742117422174231742417425174261742717428174291743017431174321743317434174351743617437174381743917440174411744217443174441744517446174471744817449174501745117452174531745417455174561745717458174591746017461174621746317464174651746617467174681746917470174711747217473174741747517476174771747817479174801748117482174831748417485174861748717488174891749017491174921749317494174951749617497174981749917500175011750217503175041750517506175071750817509175101751117512175131751417515175161751717518175191752017521175221752317524175251752617527175281752917530175311753217533175341753517536175371753817539175401754117542175431754417545175461754717548175491755017551175521755317554175551755617557175581755917560175611756217563175641756517566175671756817569175701757117572175731757417575175761757717578175791758017581175821758317584175851758617587175881758917590175911759217593175941759517596175971759817599176001760117602176031760417605176061760717608176091761017611176121761317614176151761617617176181761917620176211762217623176241762517626176271762817629176301763117632176331763417635176361763717638176391764017641176421764317644176451764617647176481764917650176511765217653176541765517656176571765817659176601766117662176631766417665176661766717668176691767017671176721767317674176751767617677176781767917680176811768217683176841768517686176871768817689176901769117692176931769417695176961769717698176991770017701177021770317704177051770617707177081770917710177111771217713177141771517716177171771817719177201772117722177231772417725177261772717728177291773017731177321773317734177351773617737177381773917740177411774217743177441774517746177471774817749177501775117752177531775417755177561775717758177591776017761177621776317764177651776617767177681776917770177711777217773177741777517776177771777817779177801778117782177831778417785177861778717788177891779017791177921779317794177951779617797177981779917800178011780217803178041780517806178071780817809178101781117812178131781417815178161781717818178191782017821178221782317824178251782617827178281782917830178311783217833178341783517836178371783817839178401784117842178431784417845178461784717848178491785017851178521785317854178551785617857178581785917860178611786217863178641786517866178671786817869178701787117872178731787417875178761787717878178791788017881178821788317884178851788617887178881788917890178911789217893178941789517896178971789817899179001790117902179031790417905179061790717908179091791017911179121791317914179151791617917179181791917920179211792217923179241792517926179271792817929179301793117932179331793417935179361793717938179391794017941179421794317944179451794617947179481794917950179511795217953179541795517956179571795817959179601796117962179631796417965179661796717968179691797017971179721797317974179751797617977179781797917980179811798217983179841798517986179871798817989179901799117992179931799417995179961799717998179991800018001180021800318004180051800618007180081800918010180111801218013180141801518016180171801818019180201802118022180231802418025180261802718028180291803018031180321803318034180351803618037180381803918040180411804218043180441804518046180471804818049180501805118052180531805418055180561805718058180591806018061180621806318064180651806618067180681806918070180711807218073180741807518076180771807818079180801808118082180831808418085180861808718088180891809018091180921809318094180951809618097180981809918100181011810218103181041810518106181071810818109181101811118112181131811418115181161811718118181191812018121181221812318124181251812618127181281812918130181311813218133181341813518136181371813818139181401814118142181431814418145181461814718148181491815018151181521815318154181551815618157181581815918160181611816218163181641816518166181671816818169181701817118172181731817418175181761817718178181791818018181181821818318184181851818618187181881818918190181911819218193181941819518196181971819818199182001820118202182031820418205182061820718208182091821018211182121821318214182151821618217182181821918220182211822218223182241822518226182271822818229182301823118232182331823418235182361823718238182391824018241182421824318244182451824618247182481824918250182511825218253182541825518256182571825818259182601826118262182631826418265182661826718268182691827018271182721827318274182751827618277182781827918280182811828218283182841828518286182871828818289182901829118292182931829418295182961829718298182991830018301183021830318304183051830618307183081830918310183111831218313183141831518316183171831818319183201832118322183231832418325183261832718328183291833018331183321833318334183351833618337183381833918340183411834218343183441834518346183471834818349183501835118352183531835418355183561835718358183591836018361183621836318364183651836618367183681836918370183711837218373183741837518376183771837818379183801838118382183831838418385183861838718388183891839018391183921839318394183951839618397183981839918400184011840218403184041840518406184071840818409184101841118412184131841418415184161841718418184191842018421184221842318424184251842618427184281842918430184311843218433184341843518436184371843818439184401844118442184431844418445184461844718448184491845018451184521845318454184551845618457184581845918460184611846218463184641846518466184671846818469184701847118472184731847418475184761847718478184791848018481184821848318484184851848618487184881848918490184911849218493184941849518496184971849818499185001850118502185031850418505185061850718508185091851018511185121851318514185151851618517185181851918520185211852218523185241852518526185271852818529185301853118532185331853418535185361853718538185391854018541185421854318544185451854618547185481854918550185511855218553185541855518556185571855818559185601856118562185631856418565185661856718568185691857018571185721857318574185751857618577185781857918580185811858218583185841858518586185871858818589185901859118592185931859418595185961859718598185991860018601186021860318604186051860618607186081860918610186111861218613186141861518616186171861818619186201862118622186231862418625186261862718628186291863018631186321863318634186351863618637186381863918640186411864218643186441864518646186471864818649186501865118652186531865418655186561865718658186591866018661186621866318664186651866618667186681866918670186711867218673186741867518676186771867818679186801868118682186831868418685186861868718688186891869018691186921869318694186951869618697186981869918700187011870218703187041870518706187071870818709187101871118712187131871418715187161871718718187191872018721187221872318724187251872618727187281872918730187311873218733187341873518736187371873818739187401874118742187431874418745187461874718748187491875018751187521875318754187551875618757187581875918760187611876218763187641876518766187671876818769187701877118772187731877418775187761877718778187791878018781187821878318784187851878618787187881878918790187911879218793187941879518796187971879818799188001880118802188031880418805188061880718808188091881018811188121881318814188151881618817188181881918820188211882218823188241882518826188271882818829188301883118832188331883418835188361883718838188391884018841188421884318844188451884618847188481884918850188511885218853188541885518856188571885818859188601886118862188631886418865188661886718868188691887018871188721887318874188751887618877188781887918880188811888218883188841888518886188871888818889188901889118892188931889418895188961889718898188991890018901189021890318904189051890618907189081890918910189111891218913189141891518916189171891818919189201892118922189231892418925189261892718928189291893018931189321893318934189351893618937189381893918940189411894218943189441894518946189471894818949189501895118952189531895418955189561895718958189591896018961189621896318964189651896618967189681896918970189711897218973189741897518976189771897818979189801898118982189831898418985189861898718988189891899018991189921899318994189951899618997189981899919000190011900219003190041900519006190071900819009190101901119012190131901419015190161901719018190191902019021190221902319024190251902619027190281902919030190311903219033190341903519036190371903819039190401904119042190431904419045190461904719048190491905019051190521905319054190551905619057190581905919060190611906219063190641906519066190671906819069190701907119072190731907419075190761907719078190791908019081190821908319084190851908619087190881908919090190911909219093190941909519096190971909819099191001910119102191031910419105191061910719108191091911019111191121911319114191151911619117191181911919120191211912219123191241912519126191271912819129191301913119132191331913419135191361913719138191391914019141191421914319144191451914619147191481914919150191511915219153191541915519156191571915819159191601916119162191631916419165191661916719168191691917019171191721917319174191751917619177191781917919180191811918219183191841918519186191871918819189191901919119192191931919419195191961919719198191991920019201192021920319204192051920619207192081920919210192111921219213192141921519216192171921819219192201922119222192231922419225192261922719228192291923019231192321923319234192351923619237192381923919240192411924219243192441924519246192471924819249192501925119252192531925419255192561925719258192591926019261192621926319264192651926619267192681926919270192711927219273192741927519276192771927819279192801928119282192831928419285192861928719288192891929019291192921929319294192951929619297192981929919300193011930219303193041930519306193071930819309193101931119312193131931419315193161931719318193191932019321193221932319324193251932619327193281932919330193311933219333193341933519336193371933819339193401934119342193431934419345193461934719348193491935019351193521935319354193551935619357193581935919360193611936219363193641936519366193671936819369193701937119372193731937419375193761937719378193791938019381193821938319384193851938619387193881938919390193911939219393193941939519396193971939819399194001940119402194031940419405194061940719408194091941019411194121941319414194151941619417194181941919420194211942219423194241942519426194271942819429194301943119432194331943419435194361943719438194391944019441194421944319444194451944619447194481944919450194511945219453194541945519456194571945819459194601946119462194631946419465194661946719468194691947019471194721947319474194751947619477194781947919480194811948219483194841948519486194871948819489194901949119492194931949419495194961949719498194991950019501195021950319504195051950619507195081950919510195111951219513195141951519516195171951819519195201952119522195231952419525195261952719528195291953019531195321953319534195351953619537195381953919540195411954219543195441954519546195471954819549195501955119552195531955419555195561955719558195591956019561195621956319564195651956619567195681956919570195711957219573195741957519576195771957819579195801958119582195831958419585195861958719588195891959019591195921959319594195951959619597195981959919600196011960219603196041960519606196071960819609196101961119612196131961419615196161961719618196191962019621196221962319624196251962619627196281962919630196311963219633196341963519636196371963819639196401964119642196431964419645196461964719648196491965019651196521965319654196551965619657196581965919660196611966219663196641966519666196671966819669196701967119672196731967419675196761967719678196791968019681196821968319684196851968619687196881968919690196911969219693196941969519696196971969819699197001970119702197031970419705197061970719708197091971019711197121971319714197151971619717197181971919720197211972219723197241972519726197271972819729197301973119732197331973419735197361973719738197391974019741197421974319744197451974619747197481974919750197511975219753197541975519756197571975819759197601976119762197631976419765197661976719768197691977019771197721977319774197751977619777197781977919780197811978219783197841978519786197871978819789197901979119792197931979419795197961979719798197991980019801198021980319804198051980619807198081980919810198111981219813198141981519816198171981819819198201982119822198231982419825198261982719828198291983019831198321983319834198351983619837198381983919840198411984219843198441984519846198471984819849198501985119852198531985419855198561985719858198591986019861198621986319864198651986619867198681986919870198711987219873198741987519876198771987819879198801988119882198831988419885198861988719888198891989019891198921989319894198951989619897198981989919900199011990219903199041990519906199071990819909199101991119912199131991419915199161991719918199191992019921199221992319924199251992619927199281992919930199311993219933199341993519936199371993819939199401994119942199431994419945199461994719948199491995019951199521995319954199551995619957199581995919960199611996219963199641996519966199671996819969199701997119972199731997419975199761997719978199791998019981199821998319984199851998619987199881998919990199911999219993199941999519996199971999819999200002000120002200032000420005200062000720008200092001020011200122001320014200152001620017200182001920020200212002220023200242002520026200272002820029200302003120032200332003420035200362003720038200392004020041200422004320044200452004620047200482004920050200512005220053200542005520056200572005820059200602006120062200632006420065200662006720068200692007020071200722007320074200752007620077200782007920080200812008220083200842008520086200872008820089200902009120092200932009420095200962009720098200992010020101201022010320104201052010620107201082010920110201112011220113201142011520116201172011820119201202012120122201232012420125201262012720128201292013020131201322013320134201352013620137201382013920140201412014220143201442014520146201472014820149201502015120152201532015420155201562015720158201592016020161201622016320164201652016620167201682016920170201712017220173201742017520176201772017820179201802018120182201832018420185201862018720188201892019020191201922019320194201952019620197201982019920200202012020220203202042020520206202072020820209202102021120212202132021420215202162021720218202192022020221202222022320224202252022620227202282022920230202312023220233202342023520236202372023820239202402024120242202432024420245202462024720248202492025020251202522025320254202552025620257202582025920260202612026220263202642026520266202672026820269202702027120272202732027420275202762027720278202792028020281202822028320284202852028620287202882028920290202912029220293202942029520296202972029820299203002030120302203032030420305203062030720308203092031020311203122031320314203152031620317203182031920320203212032220323203242032520326203272032820329203302033120332203332033420335203362033720338203392034020341203422034320344203452034620347203482034920350203512035220353203542035520356203572035820359203602036120362203632036420365203662036720368203692037020371203722037320374203752037620377203782037920380203812038220383203842038520386203872038820389203902039120392203932039420395203962039720398203992040020401204022040320404204052040620407204082040920410204112041220413204142041520416204172041820419204202042120422204232042420425204262042720428204292043020431204322043320434204352043620437204382043920440204412044220443204442044520446204472044820449204502045120452204532045420455204562045720458204592046020461204622046320464204652046620467204682046920470204712047220473204742047520476204772047820479204802048120482204832048420485204862048720488204892049020491204922049320494204952049620497204982049920500205012050220503205042050520506205072050820509205102051120512205132051420515205162051720518205192052020521205222052320524205252052620527205282052920530205312053220533205342053520536205372053820539205402054120542205432054420545205462054720548205492055020551205522055320554205552055620557205582055920560205612056220563205642056520566205672056820569205702057120572205732057420575205762057720578205792058020581205822058320584205852058620587205882058920590205912059220593205942059520596205972059820599206002060120602206032060420605206062060720608206092061020611206122061320614206152061620617206182061920620206212062220623206242062520626206272062820629206302063120632206332063420635206362063720638206392064020641206422064320644206452064620647206482064920650206512065220653206542065520656206572065820659206602066120662206632066420665206662066720668206692067020671206722067320674206752067620677206782067920680206812068220683206842068520686206872068820689206902069120692206932069420695206962069720698206992070020701207022070320704207052070620707207082070920710207112071220713207142071520716207172071820719207202072120722207232072420725207262072720728207292073020731207322073320734207352073620737207382073920740207412074220743207442074520746207472074820749207502075120752207532075420755207562075720758207592076020761207622076320764207652076620767207682076920770207712077220773207742077520776207772077820779207802078120782207832078420785207862078720788207892079020791207922079320794207952079620797207982079920800208012080220803208042080520806208072080820809208102081120812208132081420815208162081720818208192082020821208222082320824208252082620827208282082920830208312083220833208342083520836208372083820839208402084120842208432084420845208462084720848208492085020851208522085320854208552085620857208582085920860208612086220863208642086520866208672086820869208702087120872208732087420875208762087720878208792088020881208822088320884208852088620887208882088920890208912089220893208942089520896208972089820899209002090120902209032090420905209062090720908209092091020911209122091320914209152091620917209182091920920209212092220923209242092520926209272092820929209302093120932209332093420935209362093720938209392094020941209422094320944209452094620947209482094920950209512095220953209542095520956209572095820959209602096120962209632096420965209662096720968209692097020971209722097320974209752097620977209782097920980209812098220983209842098520986209872098820989209902099120992209932099420995209962099720998209992100021001210022100321004210052100621007210082100921010210112101221013210142101521016210172101821019210202102121022210232102421025210262102721028210292103021031210322103321034210352103621037210382103921040210412104221043210442104521046210472104821049210502105121052210532105421055210562105721058210592106021061210622106321064210652106621067210682106921070210712107221073210742107521076210772107821079210802108121082210832108421085210862108721088210892109021091210922109321094210952109621097210982109921100211012110221103211042110521106211072110821109211102111121112211132111421115211162111721118211192112021121211222112321124211252112621127211282112921130211312113221133211342113521136211372113821139211402114121142211432114421145211462114721148211492115021151211522115321154211552115621157211582115921160211612116221163211642116521166211672116821169211702117121172211732117421175211762117721178211792118021181211822118321184211852118621187211882118921190211912119221193211942119521196211972119821199212002120121202212032120421205212062120721208212092121021211212122121321214212152121621217212182121921220212212122221223212242122521226212272122821229212302123121232212332123421235212362123721238212392124021241212422124321244212452124621247212482124921250212512125221253212542125521256212572125821259212602126121262212632126421265212662126721268212692127021271212722127321274212752127621277212782127921280212812128221283212842128521286212872128821289212902129121292212932129421295212962129721298212992130021301213022130321304213052130621307213082130921310213112131221313213142131521316213172131821319213202132121322213232132421325213262132721328213292133021331213322133321334213352133621337213382133921340213412134221343213442134521346213472134821349213502135121352213532135421355213562135721358213592136021361213622136321364213652136621367213682136921370213712137221373213742137521376213772137821379213802138121382213832138421385213862138721388213892139021391213922139321394213952139621397213982139921400214012140221403214042140521406214072140821409214102141121412214132141421415214162141721418214192142021421214222142321424214252142621427214282142921430214312143221433214342143521436214372143821439214402144121442214432144421445214462144721448214492145021451214522145321454214552145621457214582145921460214612146221463214642146521466214672146821469214702147121472214732147421475214762147721478214792148021481214822148321484214852148621487214882148921490214912149221493214942149521496214972149821499215002150121502215032150421505215062150721508215092151021511215122151321514215152151621517215182151921520215212152221523215242152521526215272152821529215302153121532215332153421535215362153721538215392154021541215422154321544215452154621547215482154921550215512155221553215542155521556215572155821559215602156121562215632156421565215662156721568215692157021571215722157321574215752157621577215782157921580215812158221583215842158521586215872158821589215902159121592215932159421595215962159721598215992160021601216022160321604216052160621607216082160921610216112161221613216142161521616216172161821619216202162121622216232162421625216262162721628216292163021631216322163321634216352163621637216382163921640216412164221643216442164521646216472164821649216502165121652216532165421655216562165721658216592166021661216622166321664216652166621667216682166921670216712167221673216742167521676216772167821679216802168121682216832168421685216862168721688216892169021691216922169321694216952169621697216982169921700217012170221703217042170521706217072170821709217102171121712217132171421715217162171721718217192172021721217222172321724217252172621727217282172921730217312173221733217342173521736217372173821739217402174121742217432174421745217462174721748217492175021751217522175321754217552175621757217582175921760217612176221763217642176521766217672176821769217702177121772217732177421775217762177721778217792178021781217822178321784217852178621787217882178921790217912179221793217942179521796217972179821799218002180121802218032180421805218062180721808218092181021811218122181321814218152181621817218182181921820218212182221823218242182521826218272182821829218302183121832218332183421835218362183721838218392184021841218422184321844218452184621847218482184921850218512185221853218542185521856218572185821859218602186121862218632186421865218662186721868218692187021871218722187321874218752187621877218782187921880218812188221883218842188521886218872188821889218902189121892218932189421895218962189721898218992190021901219022190321904219052190621907219082190921910219112191221913219142191521916219172191821919219202192121922219232192421925219262192721928219292193021931219322193321934219352193621937219382193921940219412194221943219442194521946219472194821949219502195121952219532195421955219562195721958219592196021961219622196321964219652196621967219682196921970219712197221973219742197521976219772197821979219802198121982219832198421985219862198721988219892199021991219922199321994219952199621997219982199922000220012200222003220042200522006220072200822009220102201122012220132201422015220162201722018220192202022021220222202322024220252202622027220282202922030220312203222033220342203522036220372203822039220402204122042220432204422045220462204722048220492205022051220522205322054220552205622057220582205922060220612206222063220642206522066220672206822069220702207122072220732207422075220762207722078220792208022081220822208322084220852208622087220882208922090220912209222093220942209522096220972209822099221002210122102221032210422105221062210722108221092211022111221122211322114221152211622117221182211922120221212212222123221242212522126221272212822129221302213122132221332213422135221362213722138221392214022141221422214322144221452214622147221482214922150221512215222153221542215522156221572215822159221602216122162221632216422165221662216722168221692217022171221722217322174221752217622177221782217922180221812218222183221842218522186221872218822189221902219122192221932219422195221962219722198221992220022201222022220322204222052220622207222082220922210222112221222213222142221522216222172221822219222202222122222222232222422225222262222722228222292223022231222322223322234222352223622237222382223922240222412224222243222442224522246222472224822249222502225122252222532225422255222562225722258222592226022261222622226322264222652226622267222682226922270222712227222273222742227522276222772227822279222802228122282222832228422285222862228722288222892229022291222922229322294222952229622297222982229922300223012230222303223042230522306223072230822309223102231122312223132231422315223162231722318223192232022321223222232322324223252232622327223282232922330223312233222333223342233522336223372233822339223402234122342223432234422345223462234722348223492235022351223522235322354223552235622357223582235922360223612236222363223642236522366223672236822369223702237122372223732237422375223762237722378223792238022381223822238322384223852238622387223882238922390223912239222393223942239522396223972239822399224002240122402224032240422405224062240722408224092241022411224122241322414224152241622417224182241922420224212242222423224242242522426224272242822429224302243122432224332243422435224362243722438224392244022441224422244322444224452244622447224482244922450224512245222453224542245522456224572245822459224602246122462224632246422465224662246722468224692247022471224722247322474224752247622477224782247922480224812248222483224842248522486224872248822489224902249122492224932249422495224962249722498224992250022501225022250322504225052250622507225082250922510225112251222513225142251522516225172251822519225202252122522225232252422525225262252722528225292253022531225322253322534225352253622537225382253922540225412254222543225442254522546225472254822549225502255122552225532255422555225562255722558225592256022561225622256322564225652256622567225682256922570225712257222573225742257522576225772257822579225802258122582225832258422585225862258722588225892259022591225922259322594225952259622597225982259922600226012260222603226042260522606226072260822609226102261122612226132261422615226162261722618226192262022621226222262322624226252262622627226282262922630226312263222633226342263522636226372263822639226402264122642226432264422645226462264722648226492265022651226522265322654226552265622657226582265922660226612266222663226642266522666226672266822669226702267122672226732267422675226762267722678226792268022681226822268322684226852268622687226882268922690226912269222693226942269522696226972269822699227002270122702227032270422705227062270722708227092271022711227122271322714227152271622717227182271922720227212272222723227242272522726227272272822729227302273122732227332273422735227362273722738227392274022741227422274322744227452274622747227482274922750227512275222753227542275522756227572275822759227602276122762227632276422765227662276722768227692277022771227722277322774227752277622777227782277922780227812278222783227842278522786227872278822789227902279122792227932279422795227962279722798227992280022801228022280322804228052280622807228082280922810228112281222813228142281522816228172281822819228202282122822228232282422825228262282722828228292283022831228322283322834228352283622837228382283922840228412284222843228442284522846228472284822849228502285122852228532285422855228562285722858228592286022861228622286322864228652286622867228682286922870228712287222873228742287522876228772287822879228802288122882228832288422885228862288722888228892289022891228922289322894228952289622897228982289922900229012290222903229042290522906229072290822909229102291122912229132291422915229162291722918229192292022921229222292322924229252292622927229282292922930229312293222933229342293522936229372293822939229402294122942229432294422945229462294722948229492295022951229522295322954229552295622957229582295922960229612296222963229642296522966229672296822969229702297122972229732297422975229762297722978229792298022981229822298322984229852298622987229882298922990229912299222993229942299522996229972299822999230002300123002230032300423005230062300723008230092301023011230122301323014230152301623017230182301923020230212302223023230242302523026230272302823029230302303123032230332303423035230362303723038230392304023041230422304323044230452304623047230482304923050230512305223053230542305523056230572305823059230602306123062230632306423065230662306723068230692307023071230722307323074230752307623077230782307923080230812308223083230842308523086230872308823089230902309123092230932309423095230962309723098230992310023101231022310323104231052310623107231082310923110231112311223113231142311523116231172311823119231202312123122231232312423125231262312723128231292313023131231322313323134231352313623137231382313923140231412314223143231442314523146231472314823149231502315123152231532315423155231562315723158231592316023161231622316323164231652316623167231682316923170231712317223173231742317523176231772317823179231802318123182231832318423185231862318723188231892319023191231922319323194231952319623197231982319923200232012320223203232042320523206232072320823209232102321123212232132321423215232162321723218232192322023221232222322323224232252322623227232282322923230232312323223233232342323523236232372323823239232402324123242232432324423245232462324723248232492325023251232522325323254232552325623257232582325923260232612326223263232642326523266232672326823269232702327123272232732327423275232762327723278232792328023281232822328323284232852328623287232882328923290232912329223293232942329523296232972329823299233002330123302233032330423305233062330723308233092331023311233122331323314233152331623317233182331923320233212332223323233242332523326233272332823329233302333123332233332333423335233362333723338233392334023341233422334323344233452334623347233482334923350233512335223353233542335523356233572335823359233602336123362233632336423365233662336723368233692337023371233722337323374233752337623377233782337923380233812338223383233842338523386233872338823389233902339123392233932339423395233962339723398233992340023401234022340323404234052340623407234082340923410234112341223413234142341523416234172341823419234202342123422234232342423425234262342723428234292343023431234322343323434234352343623437234382343923440234412344223443234442344523446234472344823449234502345123452234532345423455234562345723458234592346023461234622346323464234652346623467234682346923470234712347223473234742347523476234772347823479234802348123482234832348423485234862348723488234892349023491234922349323494234952349623497234982349923500235012350223503235042350523506235072350823509235102351123512235132351423515235162351723518235192352023521235222352323524235252352623527235282352923530235312353223533235342353523536235372353823539235402354123542235432354423545235462354723548235492355023551235522355323554235552355623557235582355923560235612356223563235642356523566235672356823569235702357123572235732357423575235762357723578235792358023581235822358323584235852358623587235882358923590235912359223593235942359523596235972359823599236002360123602236032360423605236062360723608236092361023611236122361323614236152361623617236182361923620236212362223623236242362523626236272362823629236302363123632236332363423635236362363723638236392364023641236422364323644236452364623647236482364923650236512365223653236542365523656236572365823659236602366123662236632366423665236662366723668236692367023671236722367323674236752367623677236782367923680236812368223683236842368523686236872368823689236902369123692236932369423695236962369723698236992370023701237022370323704237052370623707237082370923710237112371223713237142371523716237172371823719237202372123722237232372423725237262372723728237292373023731237322373323734237352373623737237382373923740237412374223743237442374523746237472374823749237502375123752237532375423755237562375723758237592376023761237622376323764237652376623767237682376923770237712377223773237742377523776237772377823779237802378123782237832378423785237862378723788237892379023791237922379323794237952379623797237982379923800238012380223803238042380523806238072380823809238102381123812238132381423815238162381723818238192382023821238222382323824238252382623827238282382923830238312383223833238342383523836238372383823839238402384123842238432384423845238462384723848238492385023851238522385323854238552385623857238582385923860238612386223863238642386523866238672386823869238702387123872238732387423875238762387723878238792388023881238822388323884238852388623887238882388923890238912389223893238942389523896238972389823899239002390123902239032390423905239062390723908239092391023911239122391323914239152391623917239182391923920239212392223923239242392523926239272392823929239302393123932239332393423935239362393723938239392394023941239422394323944239452394623947239482394923950239512395223953239542395523956239572395823959239602396123962239632396423965239662396723968239692397023971239722397323974239752397623977239782397923980239812398223983239842398523986239872398823989239902399123992239932399423995239962399723998239992400024001240022400324004240052400624007240082400924010240112401224013240142401524016240172401824019240202402124022240232402424025240262402724028240292403024031240322403324034240352403624037240382403924040240412404224043240442404524046240472404824049240502405124052240532405424055240562405724058240592406024061240622406324064240652406624067240682406924070240712407224073240742407524076240772407824079240802408124082240832408424085240862408724088240892409024091240922409324094240952409624097240982409924100241012410224103241042410524106241072410824109241102411124112241132411424115241162411724118241192412024121241222412324124241252412624127241282412924130241312413224133241342413524136241372413824139241402414124142241432414424145241462414724148241492415024151241522415324154241552415624157241582415924160241612416224163241642416524166241672416824169241702417124172241732417424175241762417724178241792418024181241822418324184241852418624187241882418924190241912419224193241942419524196241972419824199242002420124202242032420424205242062420724208242092421024211242122421324214242152421624217242182421924220242212422224223242242422524226242272422824229242302423124232242332423424235242362423724238242392424024241242422424324244242452424624247242482424924250242512425224253242542425524256242572425824259242602426124262242632426424265242662426724268242692427024271242722427324274242752427624277242782427924280242812428224283242842428524286242872428824289242902429124292242932429424295242962429724298242992430024301243022430324304243052430624307243082430924310243112431224313243142431524316243172431824319243202432124322243232432424325243262432724328243292433024331243322433324334243352433624337243382433924340243412434224343243442434524346243472434824349243502435124352243532435424355243562435724358243592436024361243622436324364243652436624367243682436924370243712437224373243742437524376243772437824379243802438124382243832438424385243862438724388243892439024391243922439324394243952439624397243982439924400244012440224403244042440524406244072440824409244102441124412244132441424415244162441724418244192442024421244222442324424244252442624427244282442924430244312443224433244342443524436244372443824439244402444124442244432444424445244462444724448244492445024451244522445324454244552445624457244582445924460244612446224463244642446524466244672446824469244702447124472244732447424475244762447724478244792448024481244822448324484244852448624487244882448924490244912449224493244942449524496244972449824499245002450124502245032450424505245062450724508245092451024511245122451324514245152451624517245182451924520245212452224523245242452524526245272452824529245302453124532245332453424535245362453724538245392454024541245422454324544245452454624547245482454924550245512455224553245542455524556245572455824559245602456124562245632456424565245662456724568245692457024571245722457324574245752457624577245782457924580245812458224583245842458524586245872458824589245902459124592245932459424595245962459724598245992460024601246022460324604246052460624607246082460924610246112461224613246142461524616246172461824619246202462124622246232462424625246262462724628246292463024631246322463324634246352463624637246382463924640246412464224643246442464524646246472464824649246502465124652246532465424655246562465724658246592466024661246622466324664246652466624667246682466924670246712467224673246742467524676246772467824679246802468124682246832468424685246862468724688246892469024691246922469324694246952469624697246982469924700247012470224703247042470524706247072470824709247102471124712247132471424715247162471724718247192472024721247222472324724247252472624727247282472924730247312473224733247342473524736247372473824739247402474124742247432474424745247462474724748247492475024751247522475324754247552475624757247582475924760247612476224763247642476524766247672476824769247702477124772247732477424775247762477724778247792478024781247822478324784247852478624787247882478924790247912479224793247942479524796247972479824799248002480124802248032480424805248062480724808248092481024811248122481324814248152481624817248182481924820248212482224823248242482524826248272482824829248302483124832248332483424835248362483724838248392484024841248422484324844248452484624847248482484924850248512485224853248542485524856248572485824859248602486124862248632486424865248662486724868248692487024871248722487324874248752487624877248782487924880248812488224883248842488524886248872488824889248902489124892248932489424895248962489724898248992490024901249022490324904249052490624907249082490924910249112491224913249142491524916249172491824919249202492124922249232492424925249262492724928249292493024931249322493324934249352493624937249382493924940249412494224943249442494524946249472494824949249502495124952249532495424955249562495724958249592496024961249622496324964249652496624967249682496924970249712497224973249742497524976249772497824979249802498124982249832498424985249862498724988249892499024991249922499324994249952499624997249982499925000250012500225003250042500525006250072500825009250102501125012250132501425015250162501725018250192502025021250222502325024250252502625027250282502925030250312503225033250342503525036250372503825039250402504125042250432504425045250462504725048250492505025051250522505325054250552505625057250582505925060250612506225063250642506525066250672506825069250702507125072250732507425075250762507725078250792508025081250822508325084250852508625087250882508925090250912509225093250942509525096250972509825099251002510125102251032510425105251062510725108251092511025111251122511325114251152511625117251182511925120251212512225123251242512525126251272512825129251302513125132251332513425135251362513725138251392514025141251422514325144251452514625147251482514925150251512515225153251542515525156251572515825159251602516125162251632516425165251662516725168251692517025171251722517325174251752517625177251782517925180251812518225183251842518525186251872518825189251902519125192251932519425195251962519725198251992520025201252022520325204252052520625207252082520925210252112521225213252142521525216252172521825219252202522125222252232522425225252262522725228252292523025231252322523325234252352523625237252382523925240252412524225243252442524525246252472524825249252502525125252252532525425255252562525725258252592526025261252622526325264252652526625267252682526925270252712527225273252742527525276252772527825279252802528125282252832528425285252862528725288252892529025291252922529325294252952529625297252982529925300253012530225303253042530525306253072530825309253102531125312253132531425315253162531725318253192532025321253222532325324253252532625327253282532925330253312533225333253342533525336253372533825339253402534125342253432534425345253462534725348253492535025351253522535325354253552535625357253582535925360253612536225363253642536525366253672536825369253702537125372253732537425375253762537725378253792538025381253822538325384253852538625387253882538925390253912539225393253942539525396253972539825399254002540125402254032540425405254062540725408254092541025411254122541325414254152541625417254182541925420254212542225423254242542525426254272542825429254302543125432254332543425435254362543725438254392544025441254422544325444254452544625447254482544925450254512545225453254542545525456254572545825459254602546125462254632546425465254662546725468254692547025471254722547325474254752547625477254782547925480254812548225483254842548525486254872548825489254902549125492254932549425495254962549725498254992550025501255022550325504255052550625507255082550925510255112551225513255142551525516255172551825519255202552125522255232552425525255262552725528255292553025531255322553325534255352553625537255382553925540255412554225543255442554525546255472554825549255502555125552255532555425555255562555725558255592556025561255622556325564255652556625567255682556925570255712557225573255742557525576255772557825579255802558125582255832558425585255862558725588255892559025591255922559325594255952559625597255982559925600256012560225603256042560525606256072560825609256102561125612256132561425615256162561725618256192562025621256222562325624256252562625627256282562925630256312563225633256342563525636256372563825639256402564125642256432564425645256462564725648256492565025651256522565325654256552565625657256582565925660256612566225663256642566525666256672566825669256702567125672256732567425675256762567725678256792568025681256822568325684256852568625687256882568925690256912569225693256942569525696256972569825699257002570125702257032570425705257062570725708257092571025711257122571325714257152571625717257182571925720257212572225723257242572525726257272572825729257302573125732257332573425735257362573725738257392574025741257422574325744257452574625747257482574925750257512575225753257542575525756257572575825759257602576125762257632576425765257662576725768257692577025771257722577325774257752577625777257782577925780257812578225783257842578525786257872578825789257902579125792257932579425795257962579725798257992580025801258022580325804258052580625807258082580925810258112581225813258142581525816258172581825819258202582125822258232582425825258262582725828258292583025831258322583325834258352583625837258382583925840258412584225843258442584525846258472584825849258502585125852258532585425855258562585725858258592586025861258622586325864258652586625867258682586925870258712587225873258742587525876258772587825879258802588125882258832588425885258862588725888258892589025891258922589325894258952589625897258982589925900259012590225903259042590525906259072590825909259102591125912259132591425915259162591725918259192592025921259222592325924259252592625927259282592925930259312593225933259342593525936259372593825939259402594125942259432594425945259462594725948259492595025951259522595325954259552595625957259582595925960259612596225963259642596525966259672596825969259702597125972259732597425975259762597725978259792598025981259822598325984259852598625987259882598925990259912599225993259942599525996259972599825999260002600126002260032600426005260062600726008260092601026011260122601326014260152601626017260182601926020260212602226023260242602526026260272602826029260302603126032260332603426035260362603726038260392604026041260422604326044260452604626047260482604926050260512605226053260542605526056260572605826059260602606126062260632606426065260662606726068260692607026071260722607326074260752607626077260782607926080260812608226083260842608526086260872608826089260902609126092260932609426095260962609726098260992610026101261022610326104261052610626107261082610926110261112611226113261142611526116261172611826119261202612126122261232612426125261262612726128261292613026131261322613326134261352613626137261382613926140261412614226143261442614526146261472614826149261502615126152261532615426155261562615726158261592616026161261622616326164261652616626167261682616926170261712617226173261742617526176261772617826179261802618126182261832618426185261862618726188261892619026191261922619326194261952619626197261982619926200262012620226203262042620526206262072620826209262102621126212262132621426215262162621726218262192622026221262222622326224262252622626227262282622926230262312623226233262342623526236262372623826239262402624126242262432624426245262462624726248262492625026251262522625326254262552625626257262582625926260262612626226263262642626526266262672626826269262702627126272262732627426275262762627726278262792628026281262822628326284262852628626287262882628926290262912629226293262942629526296262972629826299263002630126302263032630426305263062630726308263092631026311263122631326314263152631626317263182631926320263212632226323263242632526326263272632826329263302633126332263332633426335263362633726338263392634026341263422634326344263452634626347263482634926350263512635226353263542635526356263572635826359263602636126362263632636426365263662636726368263692637026371263722637326374263752637626377263782637926380263812638226383263842638526386263872638826389263902639126392263932639426395263962639726398263992640026401264022640326404264052640626407264082640926410264112641226413264142641526416264172641826419264202642126422264232642426425264262642726428264292643026431264322643326434264352643626437264382643926440264412644226443264442644526446264472644826449264502645126452264532645426455264562645726458264592646026461264622646326464264652646626467264682646926470264712647226473264742647526476264772647826479264802648126482264832648426485264862648726488264892649026491264922649326494264952649626497264982649926500265012650226503265042650526506265072650826509265102651126512265132651426515265162651726518265192652026521265222652326524265252652626527265282652926530265312653226533265342653526536265372653826539265402654126542265432654426545265462654726548265492655026551265522655326554265552655626557265582655926560265612656226563265642656526566265672656826569265702657126572265732657426575265762657726578265792658026581265822658326584265852658626587265882658926590265912659226593265942659526596265972659826599266002660126602266032660426605266062660726608266092661026611266122661326614266152661626617266182661926620266212662226623266242662526626266272662826629266302663126632266332663426635266362663726638266392664026641266422664326644266452664626647266482664926650266512665226653266542665526656266572665826659266602666126662266632666426665266662666726668266692667026671266722667326674266752667626677266782667926680266812668226683266842668526686266872668826689266902669126692266932669426695266962669726698266992670026701267022670326704267052670626707267082670926710267112671226713267142671526716267172671826719267202672126722267232672426725267262672726728267292673026731267322673326734267352673626737267382673926740267412674226743267442674526746267472674826749267502675126752267532675426755267562675726758267592676026761267622676326764267652676626767267682676926770267712677226773267742677526776267772677826779267802678126782267832678426785267862678726788267892679026791267922679326794267952679626797267982679926800268012680226803268042680526806268072680826809268102681126812268132681426815268162681726818268192682026821268222682326824268252682626827268282682926830268312683226833268342683526836268372683826839268402684126842268432684426845268462684726848268492685026851268522685326854268552685626857268582685926860268612686226863268642686526866268672686826869268702687126872268732687426875268762687726878268792688026881268822688326884268852688626887268882688926890268912689226893268942689526896268972689826899269002690126902269032690426905269062690726908269092691026911269122691326914269152691626917269182691926920269212692226923269242692526926269272692826929269302693126932269332693426935269362693726938269392694026941269422694326944269452694626947269482694926950269512695226953269542695526956269572695826959269602696126962269632696426965269662696726968269692697026971269722697326974269752697626977269782697926980269812698226983269842698526986269872698826989269902699126992269932699426995269962699726998269992700027001270022700327004270052700627007270082700927010270112701227013270142701527016270172701827019270202702127022270232702427025270262702727028270292703027031270322703327034270352703627037270382703927040270412704227043270442704527046270472704827049270502705127052270532705427055270562705727058270592706027061270622706327064270652706627067270682706927070270712707227073270742707527076270772707827079270802708127082270832708427085270862708727088270892709027091270922709327094270952709627097270982709927100271012710227103271042710527106271072710827109271102711127112271132711427115271162711727118271192712027121271222712327124271252712627127271282712927130271312713227133271342713527136271372713827139271402714127142271432714427145271462714727148271492715027151271522715327154271552715627157271582715927160271612716227163271642716527166271672716827169271702717127172271732717427175271762717727178271792718027181271822718327184271852718627187271882718927190271912719227193271942719527196271972719827199272002720127202272032720427205272062720727208272092721027211272122721327214272152721627217272182721927220272212722227223272242722527226272272722827229272302723127232272332723427235272362723727238272392724027241272422724327244272452724627247272482724927250272512725227253272542725527256272572725827259272602726127262272632726427265272662726727268272692727027271272722727327274272752727627277272782727927280272812728227283272842728527286272872728827289272902729127292272932729427295272962729727298272992730027301273022730327304273052730627307273082730927310273112731227313273142731527316273172731827319273202732127322273232732427325273262732727328273292733027331273322733327334273352733627337273382733927340273412734227343273442734527346273472734827349273502735127352273532735427355273562735727358273592736027361273622736327364273652736627367273682736927370273712737227373273742737527376273772737827379273802738127382273832738427385273862738727388273892739027391273922739327394273952739627397273982739927400274012740227403274042740527406274072740827409274102741127412274132741427415274162741727418274192742027421274222742327424274252742627427274282742927430274312743227433274342743527436274372743827439274402744127442274432744427445274462744727448274492745027451274522745327454274552745627457274582745927460274612746227463274642746527466274672746827469274702747127472274732747427475274762747727478274792748027481274822748327484274852748627487274882748927490274912749227493274942749527496274972749827499275002750127502275032750427505275062750727508275092751027511275122751327514275152751627517275182751927520275212752227523275242752527526275272752827529275302753127532275332753427535275362753727538275392754027541275422754327544275452754627547275482754927550275512755227553275542755527556275572755827559275602756127562275632756427565275662756727568275692757027571275722757327574275752757627577275782757927580275812758227583275842758527586275872758827589275902759127592275932759427595275962759727598275992760027601276022760327604276052760627607276082760927610276112761227613276142761527616276172761827619276202762127622276232762427625276262762727628276292763027631276322763327634276352763627637276382763927640276412764227643276442764527646276472764827649276502765127652276532765427655276562765727658276592766027661276622766327664276652766627667276682766927670276712767227673276742767527676276772767827679276802768127682276832768427685276862768727688276892769027691276922769327694276952769627697276982769927700277012770227703277042770527706277072770827709277102771127712277132771427715277162771727718277192772027721277222772327724277252772627727277282772927730277312773227733277342773527736277372773827739277402774127742277432774427745277462774727748277492775027751277522775327754277552775627757277582775927760277612776227763277642776527766277672776827769277702777127772277732777427775277762777727778277792778027781277822778327784277852778627787277882778927790277912779227793277942779527796277972779827799278002780127802278032780427805278062780727808278092781027811278122781327814278152781627817278182781927820278212782227823278242782527826278272782827829278302783127832278332783427835278362783727838278392784027841278422784327844278452784627847278482784927850278512785227853278542785527856278572785827859278602786127862278632786427865278662786727868278692787027871278722787327874278752787627877278782787927880278812788227883278842788527886278872788827889278902789127892278932789427895278962789727898278992790027901279022790327904279052790627907279082790927910279112791227913279142791527916279172791827919279202792127922279232792427925279262792727928279292793027931279322793327934279352793627937279382793927940279412794227943279442794527946279472794827949279502795127952279532795427955279562795727958279592796027961279622796327964279652796627967279682796927970279712797227973279742797527976279772797827979279802798127982279832798427985279862798727988279892799027991279922799327994279952799627997279982799928000280012800228003280042800528006280072800828009280102801128012280132801428015280162801728018280192802028021280222802328024280252802628027280282802928030280312803228033280342803528036280372803828039280402804128042280432804428045280462804728048280492805028051280522805328054280552805628057280582805928060280612806228063280642806528066280672806828069280702807128072280732807428075280762807728078280792808028081280822808328084280852808628087280882808928090280912809228093280942809528096280972809828099281002810128102281032810428105281062810728108281092811028111281122811328114281152811628117281182811928120281212812228123281242812528126281272812828129281302813128132281332813428135281362813728138281392814028141281422814328144281452814628147281482814928150281512815228153281542815528156281572815828159281602816128162281632816428165281662816728168281692817028171281722817328174281752817628177281782817928180281812818228183281842818528186281872818828189281902819128192281932819428195281962819728198281992820028201282022820328204282052820628207282082820928210282112821228213282142821528216282172821828219282202822128222282232822428225282262822728228282292823028231282322823328234282352823628237282382823928240282412824228243282442824528246282472824828249282502825128252282532825428255282562825728258282592826028261282622826328264282652826628267282682826928270282712827228273282742827528276282772827828279282802828128282282832828428285282862828728288282892829028291282922829328294282952829628297282982829928300283012830228303283042830528306283072830828309283102831128312283132831428315283162831728318283192832028321283222832328324283252832628327283282832928330283312833228333283342833528336283372833828339283402834128342283432834428345283462834728348283492835028351283522835328354283552835628357283582835928360283612836228363283642836528366283672836828369283702837128372283732837428375283762837728378283792838028381283822838328384283852838628387283882838928390283912839228393283942839528396283972839828399284002840128402284032840428405284062840728408284092841028411284122841328414284152841628417284182841928420284212842228423284242842528426284272842828429284302843128432284332843428435284362843728438284392844028441284422844328444284452844628447284482844928450284512845228453284542845528456284572845828459284602846128462284632846428465284662846728468284692847028471284722847328474284752847628477284782847928480284812848228483284842848528486284872848828489284902849128492284932849428495284962849728498284992850028501285022850328504285052850628507285082850928510285112851228513285142851528516285172851828519285202852128522285232852428525285262852728528285292853028531285322853328534285352853628537285382853928540285412854228543285442854528546285472854828549285502855128552285532855428555285562855728558285592856028561285622856328564285652856628567285682856928570285712857228573285742857528576285772857828579285802858128582285832858428585285862858728588285892859028591285922859328594285952859628597285982859928600286012860228603286042860528606286072860828609286102861128612286132861428615286162861728618286192862028621286222862328624286252862628627286282862928630286312863228633286342863528636286372863828639286402864128642286432864428645286462864728648286492865028651286522865328654286552865628657286582865928660286612866228663286642866528666286672866828669286702867128672286732867428675286762867728678286792868028681286822868328684286852868628687286882868928690286912869228693286942869528696286972869828699287002870128702287032870428705287062870728708287092871028711287122871328714287152871628717287182871928720287212872228723287242872528726287272872828729287302873128732287332873428735287362873728738287392874028741287422874328744287452874628747287482874928750287512875228753287542875528756287572875828759287602876128762287632876428765287662876728768287692877028771287722877328774287752877628777287782877928780287812878228783287842878528786287872878828789287902879128792287932879428795287962879728798287992880028801288022880328804288052880628807288082880928810288112881228813288142881528816288172881828819288202882128822288232882428825288262882728828288292883028831288322883328834288352883628837288382883928840288412884228843288442884528846288472884828849288502885128852288532885428855288562885728858288592886028861288622886328864288652886628867288682886928870288712887228873288742887528876288772887828879288802888128882288832888428885288862888728888288892889028891288922889328894288952889628897288982889928900289012890228903289042890528906289072890828909289102891128912289132891428915289162891728918289192892028921289222892328924289252892628927289282892928930289312893228933289342893528936289372893828939289402894128942289432894428945289462894728948289492895028951289522895328954289552895628957289582895928960289612896228963289642896528966289672896828969289702897128972289732897428975289762897728978289792898028981289822898328984289852898628987289882898928990289912899228993289942899528996289972899828999290002900129002290032900429005290062900729008290092901029011290122901329014290152901629017290182901929020290212902229023290242902529026290272902829029290302903129032290332903429035290362903729038290392904029041290422904329044290452904629047290482904929050290512905229053290542905529056290572905829059290602906129062290632906429065290662906729068290692907029071290722907329074290752907629077290782907929080290812908229083290842908529086290872908829089290902909129092290932909429095290962909729098290992910029101291022910329104291052910629107291082910929110291112911229113291142911529116291172911829119291202912129122291232912429125291262912729128291292913029131291322913329134291352913629137291382913929140291412914229143291442914529146291472914829149291502915129152291532915429155291562915729158291592916029161291622916329164291652916629167291682916929170291712917229173291742917529176291772917829179291802918129182291832918429185291862918729188291892919029191291922919329194291952919629197291982919929200292012920229203292042920529206292072920829209292102921129212292132921429215292162921729218292192922029221292222922329224292252922629227292282922929230292312923229233292342923529236292372923829239292402924129242292432924429245292462924729248292492925029251292522925329254292552925629257292582925929260292612926229263292642926529266292672926829269292702927129272292732927429275292762927729278292792928029281292822928329284292852928629287292882928929290292912929229293292942929529296292972929829299293002930129302293032930429305293062930729308293092931029311293122931329314293152931629317293182931929320293212932229323293242932529326293272932829329293302933129332293332933429335293362933729338293392934029341293422934329344293452934629347293482934929350293512935229353293542935529356293572935829359293602936129362293632936429365293662936729368293692937029371293722937329374293752937629377293782937929380293812938229383293842938529386293872938829389293902939129392293932939429395293962939729398293992940029401294022940329404294052940629407294082940929410294112941229413294142941529416294172941829419294202942129422294232942429425294262942729428294292943029431294322943329434294352943629437294382943929440294412944229443294442944529446294472944829449294502945129452294532945429455294562945729458294592946029461294622946329464294652946629467294682946929470294712947229473294742947529476294772947829479294802948129482294832948429485294862948729488294892949029491294922949329494294952949629497294982949929500295012950229503295042950529506295072950829509295102951129512295132951429515295162951729518295192952029521295222952329524295252952629527295282952929530295312953229533295342953529536295372953829539295402954129542295432954429545295462954729548295492955029551295522955329554295552955629557295582955929560295612956229563295642956529566295672956829569295702957129572295732957429575295762957729578295792958029581295822958329584295852958629587295882958929590295912959229593295942959529596295972959829599296002960129602296032960429605296062960729608296092961029611296122961329614296152961629617296182961929620296212962229623296242962529626296272962829629296302963129632296332963429635296362963729638296392964029641296422964329644296452964629647296482964929650296512965229653296542965529656296572965829659296602966129662296632966429665296662966729668296692967029671296722967329674296752967629677296782967929680296812968229683296842968529686296872968829689296902969129692296932969429695296962969729698296992970029701297022970329704297052970629707297082970929710297112971229713297142971529716297172971829719297202972129722297232972429725297262972729728297292973029731297322973329734297352973629737297382973929740297412974229743297442974529746297472974829749297502975129752297532975429755297562975729758297592976029761297622976329764297652976629767297682976929770297712977229773297742977529776297772977829779297802978129782297832978429785297862978729788297892979029791297922979329794297952979629797297982979929800298012980229803298042980529806298072980829809298102981129812298132981429815298162981729818298192982029821298222982329824298252982629827298282982929830298312983229833298342983529836298372983829839298402984129842298432984429845298462984729848298492985029851298522985329854298552985629857298582985929860298612986229863298642986529866298672986829869298702987129872298732987429875298762987729878298792988029881298822988329884298852988629887298882988929890298912989229893298942989529896298972989829899299002990129902299032990429905299062990729908299092991029911299122991329914299152991629917299182991929920299212992229923299242992529926299272992829929299302993129932299332993429935299362993729938299392994029941299422994329944299452994629947299482994929950299512995229953299542995529956299572995829959299602996129962299632996429965299662996729968299692997029971299722997329974299752997629977299782997929980299812998229983299842998529986299872998829989299902999129992299932999429995299962999729998299993000030001300023000330004300053000630007300083000930010300113001230013300143001530016300173001830019300203002130022300233002430025300263002730028300293003030031300323003330034300353003630037300383003930040300413004230043300443004530046300473004830049300503005130052300533005430055300563005730058300593006030061300623006330064300653006630067300683006930070300713007230073300743007530076300773007830079300803008130082300833008430085300863008730088300893009030091300923009330094300953009630097300983009930100301013010230103301043010530106301073010830109301103011130112301133011430115301163011730118301193012030121301223012330124301253012630127301283012930130301313013230133301343013530136301373013830139301403014130142301433014430145301463014730148301493015030151301523015330154301553015630157301583015930160301613016230163301643016530166301673016830169301703017130172301733017430175301763017730178301793018030181301823018330184301853018630187301883018930190301913019230193301943019530196301973019830199302003020130202302033020430205302063020730208302093021030211302123021330214302153021630217302183021930220302213022230223302243022530226302273022830229302303023130232302333023430235302363023730238302393024030241302423024330244302453024630247302483024930250302513025230253302543025530256302573025830259302603026130262302633026430265302663026730268302693027030271302723027330274302753027630277302783027930280302813028230283302843028530286302873028830289302903029130292302933029430295302963029730298302993030030301303023030330304303053030630307303083030930310303113031230313303143031530316303173031830319303203032130322303233032430325303263032730328303293033030331303323033330334303353033630337303383033930340303413034230343303443034530346303473034830349303503035130352303533035430355303563035730358303593036030361303623036330364303653036630367303683036930370303713037230373303743037530376303773037830379303803038130382303833038430385303863038730388303893039030391303923039330394303953039630397303983039930400304013040230403304043040530406304073040830409304103041130412304133041430415304163041730418304193042030421304223042330424304253042630427304283042930430304313043230433304343043530436304373043830439304403044130442304433044430445304463044730448304493045030451304523045330454304553045630457304583045930460304613046230463304643046530466304673046830469304703047130472304733047430475304763047730478304793048030481304823048330484304853048630487304883048930490304913049230493304943049530496304973049830499305003050130502305033050430505305063050730508305093051030511305123051330514305153051630517305183051930520305213052230523305243052530526305273052830529305303053130532305333053430535305363053730538305393054030541305423054330544305453054630547305483054930550305513055230553305543055530556305573055830559305603056130562305633056430565305663056730568305693057030571305723057330574305753057630577305783057930580305813058230583305843058530586305873058830589305903059130592305933059430595305963059730598305993060030601306023060330604306053060630607306083060930610306113061230613306143061530616306173061830619306203062130622306233062430625306263062730628306293063030631306323063330634306353063630637306383063930640306413064230643306443064530646306473064830649306503065130652306533065430655306563065730658306593066030661306623066330664306653066630667306683066930670306713067230673306743067530676306773067830679306803068130682306833068430685306863068730688306893069030691306923069330694306953069630697306983069930700307013070230703307043070530706307073070830709307103071130712307133071430715307163071730718307193072030721307223072330724307253072630727307283072930730307313073230733307343073530736307373073830739307403074130742307433074430745307463074730748307493075030751307523075330754307553075630757307583075930760307613076230763307643076530766307673076830769307703077130772307733077430775307763077730778307793078030781307823078330784307853078630787307883078930790307913079230793307943079530796307973079830799308003080130802308033080430805308063080730808308093081030811308123081330814308153081630817308183081930820308213082230823308243082530826308273082830829308303083130832308333083430835308363083730838308393084030841308423084330844308453084630847308483084930850308513085230853308543085530856308573085830859308603086130862308633086430865308663086730868308693087030871308723087330874308753087630877308783087930880308813088230883308843088530886308873088830889308903089130892
  1. // Code generated for darwin/arm64 by 'generator --prefix-enumerator=_ --prefix-external=x_ --prefix-field=F --prefix-macro=m_ --prefix-static-internal=_ --prefix-static-none=_ --prefix-tagged-enum=_ --prefix-tagged-struct=T --prefix-tagged-union=T --prefix-typename=T --prefix-undefined=_ -I /Users/jnml/src/modernc.org/builder/.exclude/modernc.org/libbsd/include/darwin/arm64 -extended-errors -ignore-unsupported-alignment -ignore-link-errors -lbsd -o libexpat.go --package-name libexpat lib/.libs/libexpat.a', DO NOT EDIT.
  2. //go:build darwin && arm64
  3. package libexpat
  4. import (
  5. "reflect"
  6. "unsafe"
  7. "modernc.org/libc"
  8. )
  9. var _ reflect.Type
  10. var _ unsafe.Pointer
  11. const m_ACCESSX_MAX_DESCRIPTORS = 100
  12. const m_ASCII_0 = 48
  13. const m_ASCII_1 = 49
  14. const m_ASCII_2 = 50
  15. const m_ASCII_3 = 51
  16. const m_ASCII_4 = 0x34
  17. const m_ASCII_5 = 0x35
  18. const m_ASCII_6 = 0x36
  19. const m_ASCII_7 = 0x37
  20. const m_ASCII_8 = 56
  21. const m_ASCII_9 = 57
  22. const m_ASCII_A = 65
  23. const m_ASCII_AMP = 0x26
  24. const m_ASCII_APOS = 0x27
  25. const m_ASCII_B = 0x42
  26. const m_ASCII_C = 67
  27. const m_ASCII_COLON = 58
  28. const m_ASCII_COMMA = 44
  29. const m_ASCII_D = 68
  30. const m_ASCII_E = 69
  31. const m_ASCII_EQUALS = 61
  32. const m_ASCII_EXCL = 33
  33. const m_ASCII_F = 70
  34. const m_ASCII_FF = 12
  35. const m_ASCII_G = 0x47
  36. const m_ASCII_GT = 0x3E
  37. const m_ASCII_H = 0x48
  38. const m_ASCII_HASH = 35
  39. const m_ASCII_I = 73
  40. const m_ASCII_J = 0x4A
  41. const m_ASCII_K = 75
  42. const m_ASCII_L = 76
  43. const m_ASCII_LPAREN = 40
  44. const m_ASCII_LSQB = 0x5B
  45. const m_ASCII_LT = 0x3C
  46. const m_ASCII_M = 77
  47. const m_ASCII_MINUS = 0x2D
  48. const m_ASCII_N = 78
  49. const m_ASCII_O = 79
  50. const m_ASCII_P = 0x50
  51. const m_ASCII_PERIOD = 46
  52. const m_ASCII_PIPE = 124
  53. const m_ASCII_Q = 0x51
  54. const m_ASCII_QUOT = 0x22
  55. const m_ASCII_R = 82
  56. const m_ASCII_RPAREN = 41
  57. const m_ASCII_RSQB = 0x5D
  58. const m_ASCII_S = 83
  59. const m_ASCII_SEMI = 0x3B
  60. const m_ASCII_SLASH = 47
  61. const m_ASCII_SPACE = 0x20
  62. const m_ASCII_T = 84
  63. const m_ASCII_TAB = 0x09
  64. const m_ASCII_U = 0x55
  65. const m_ASCII_UNDERSCORE = 0x5F
  66. const m_ASCII_V = 0x56
  67. const m_ASCII_W = 0x57
  68. const m_ASCII_X = 88
  69. const m_ASCII_Y = 89
  70. const m_ASCII_Z = 0x5A
  71. const m_ASCII_a = 97
  72. const m_ASCII_b = 0x62
  73. const m_ASCII_c = 99
  74. const m_ASCII_d = 0x64
  75. const m_ASCII_e = 101
  76. const m_ASCII_f = 0x66
  77. const m_ASCII_g = 103
  78. const m_ASCII_h = 104
  79. const m_ASCII_i = 0x69
  80. const m_ASCII_j = 0x6A
  81. const m_ASCII_k = 0x6B
  82. const m_ASCII_l = 108
  83. const m_ASCII_m = 109
  84. const m_ASCII_n = 110
  85. const m_ASCII_o = 111
  86. const m_ASCII_p = 112
  87. const m_ASCII_q = 0x71
  88. const m_ASCII_r = 114
  89. const m_ASCII_s = 115
  90. const m_ASCII_t = 116
  91. const m_ASCII_u = 0x75
  92. const m_ASCII_v = 0x76
  93. const m_ASCII_w = 119
  94. const m_ASCII_x = 120
  95. const m_ASCII_y = 0x79
  96. const m_ASCII_z = 0x7A
  97. const m_ATTRIBUTION_NAME_MAX = 255
  98. const m_AT_EACCESS = 0x0010
  99. const m_AT_FDONLY = 0x0400
  100. const m_AT_REALDEV = 0x0200
  101. const m_AT_REMOVEDIR = 0x0080
  102. const m_AT_SYMLINK_FOLLOW = 0x0040
  103. const m_AT_SYMLINK_NOFOLLOW = 0x0020
  104. const m_AT_SYMLINK_NOFOLLOW_ANY = 0x0800
  105. const m_BADSIG = "SIG_ERR"
  106. const m_BC_BASE_MAX = 99
  107. const m_BC_DIM_MAX = 2048
  108. const m_BC_SCALE_MAX = 99
  109. const m_BC_STRING_MAX = 1000
  110. const m_BIG_ENDIAN = "__DARWIN_BIG_ENDIAN"
  111. const m_BUFSIZ = 1024
  112. const m_BUS_ADRALN = 1
  113. const m_BUS_ADRERR = 2
  114. const m_BUS_NOOP = 0
  115. const m_BUS_OBJERR = 3
  116. const m_BYTEORDER = 1234
  117. const m_BYTE_ORDER = "__DARWIN_BYTE_ORDER"
  118. const m_CHARCLASS_NAME_MAX = 14
  119. const m_CHILD_MAX = 266
  120. const m_CLD_CONTINUED = 6
  121. const m_CLD_DUMPED = 3
  122. const m_CLD_EXITED = 1
  123. const m_CLD_KILLED = 2
  124. const m_CLD_NOOP = 0
  125. const m_CLD_STOPPED = 5
  126. const m_CLD_TRAPPED = 4
  127. const m_CLOCK_MONOTONIC = "_CLOCK_MONOTONIC"
  128. const m_CLOCK_MONOTONIC_RAW = "_CLOCK_MONOTONIC_RAW"
  129. const m_CLOCK_MONOTONIC_RAW_APPROX = "_CLOCK_MONOTONIC_RAW_APPROX"
  130. const m_CLOCK_PROCESS_CPUTIME_ID = "_CLOCK_PROCESS_CPUTIME_ID"
  131. const m_CLOCK_REALTIME = "_CLOCK_REALTIME"
  132. const m_CLOCK_THREAD_CPUTIME_ID = "_CLOCK_THREAD_CPUTIME_ID"
  133. const m_CLOCK_UPTIME_RAW = "_CLOCK_UPTIME_RAW"
  134. const m_CLOCK_UPTIME_RAW_APPROX = "_CLOCK_UPTIME_RAW_APPROX"
  135. const m_COLL_WEIGHTS_MAX = 2
  136. const m_CPF_IGNORE_MODE = 0x0002
  137. const m_CPF_OVERWRITE = 0x0001
  138. const m_CPUMON_MAKE_FATAL = 0x1000
  139. const m_DOMAIN = 1
  140. const m_DST_AUST = 2
  141. const m_DST_CAN = 6
  142. const m_DST_EET = 5
  143. const m_DST_MET = 4
  144. const m_DST_NONE = 0
  145. const m_DST_USA = 1
  146. const m_DST_WET = 3
  147. const m_E2BIG = 7
  148. const m_EACCES = 13
  149. const m_EADDRINUSE = 48
  150. const m_EADDRNOTAVAIL = 49
  151. const m_EAFNOSUPPORT = 47
  152. const m_EAGAIN = 35
  153. const m_EALREADY = 37
  154. const m_EAUTH = 80
  155. const m_EBADARCH = 86
  156. const m_EBADEXEC = 85
  157. const m_EBADF = 9
  158. const m_EBADMACHO = 88
  159. const m_EBADMSG = 94
  160. const m_EBADRPC = 72
  161. const m_EBUSY = 16
  162. const m_ECANCELED = 89
  163. const m_ECHILD = 10
  164. const m_ECONNABORTED = 53
  165. const m_ECONNREFUSED = 61
  166. const m_ECONNRESET = 54
  167. const m_EDEADLK = 11
  168. const m_EDESTADDRREQ = 39
  169. const m_EDEVERR = 83
  170. const m_EDOM = 33
  171. const m_EDQUOT = 69
  172. const m_EEXIST = 17
  173. const m_EFAULT = 14
  174. const m_EFBIG = 27
  175. const m_EFTYPE = 79
  176. const m_EHOSTDOWN = 64
  177. const m_EHOSTUNREACH = 65
  178. const m_EIDRM = 90
  179. const m_EILSEQ = 92
  180. const m_EINPROGRESS = 36
  181. const m_EINTR = 4
  182. const m_EINVAL = 22
  183. const m_EIO = 5
  184. const m_EISCONN = 56
  185. const m_EISDIR = 21
  186. const m_ELAST = 106
  187. const m_ELOOP = 62
  188. const m_EMFILE = 24
  189. const m_EMLINK = 31
  190. const m_EMSGSIZE = 40
  191. const m_EMULTIHOP = 95
  192. const m_ENAMETOOLONG = 63
  193. const m_ENEEDAUTH = 81
  194. const m_ENETDOWN = 50
  195. const m_ENETRESET = 52
  196. const m_ENETUNREACH = 51
  197. const m_ENFILE = 23
  198. const m_ENOATTR = 93
  199. const m_ENOBUFS = 55
  200. const m_ENODATA = 96
  201. const m_ENODEV = 19
  202. const m_ENOENT = 2
  203. const m_ENOEXEC = 8
  204. const m_ENOLCK = 77
  205. const m_ENOLINK = 97
  206. const m_ENOMEM = 12
  207. const m_ENOMSG = 91
  208. const m_ENOPOLICY = 103
  209. const m_ENOPROTOOPT = 42
  210. const m_ENOSPC = 28
  211. const m_ENOSR = 98
  212. const m_ENOSTR = 99
  213. const m_ENOSYS = 78
  214. const m_ENOTBLK = 15
  215. const m_ENOTCONN = 57
  216. const m_ENOTDIR = 20
  217. const m_ENOTEMPTY = 66
  218. const m_ENOTRECOVERABLE = 104
  219. const m_ENOTSOCK = 38
  220. const m_ENOTSUP = 45
  221. const m_ENOTTY = 25
  222. const m_ENXIO = 6
  223. const m_EOPNOTSUPP = 102
  224. const m_EOVERFLOW = 84
  225. const m_EOWNERDEAD = 105
  226. const m_EPERM = 1
  227. const m_EPFNOSUPPORT = 46
  228. const m_EPIPE = 32
  229. const m_EPROCLIM = 67
  230. const m_EPROCUNAVAIL = 76
  231. const m_EPROGMISMATCH = 75
  232. const m_EPROGUNAVAIL = 74
  233. const m_EPROTO = 100
  234. const m_EPROTONOSUPPORT = 43
  235. const m_EPROTOTYPE = 41
  236. const m_EPWROFF = 82
  237. const m_EQFULL = 106
  238. const m_EQUIV_CLASS_MAX = 2
  239. const m_ERANGE = 34
  240. const m_EREMOTE = 71
  241. const m_EROFS = 30
  242. const m_ERPCMISMATCH = 73
  243. const m_ESHLIBVERS = 87
  244. const m_ESHUTDOWN = 58
  245. const m_ESOCKTNOSUPPORT = 44
  246. const m_ESPIPE = 29
  247. const m_ESRCH = 3
  248. const m_ESTALE = 70
  249. const m_ETIME = 101
  250. const m_ETIMEDOUT = 60
  251. const m_ETOOMANYREFS = 59
  252. const m_ETXTBSY = 26
  253. const m_EUSERS = 68
  254. const m_EWOULDBLOCK = "EAGAIN"
  255. const m_EXDEV = 18
  256. const m_EXIT_FAILURE = 1
  257. const m_EXIT_SUCCESS = 0
  258. const m_EXPAND_SPARE = 24
  259. const m_EXPAT_BILLION_LAUGHS_ATTACK_PROTECTION_ACTIVATION_THRESHOLD_DEFAULT = 8388608
  260. const m_EXPAT_BILLION_LAUGHS_ATTACK_PROTECTION_MAXIMUM_AMPLIFICATION_DEFAULT = 100
  261. const m_EXPAT_CONFIG_H = 1
  262. const m_EXPR_NEST_MAX = 32
  263. const m_Expat_External_INCLUDED = 1
  264. const m_Expat_INCLUDED = 1
  265. const m_FAPPEND = "O_APPEND"
  266. const m_FASYNC = "O_ASYNC"
  267. const m_FCNTL_FS_SPECIFIC_BASE = 0x00010000
  268. const m_FD_CLOEXEC = 1
  269. const m_FD_SETSIZE = "__DARWIN_FD_SETSIZE"
  270. const m_FFDSYNC = "O_DSYNC"
  271. const m_FFSYNC = "O_FSYNC"
  272. const m_FILENAME_MAX = 1024
  273. const m_FILESEC_GUID = "FILESEC_UUID"
  274. const m_FNDELAY = "O_NONBLOCK"
  275. const m_FNONBLOCK = "O_NONBLOCK"
  276. const m_FOOTPRINT_INTERVAL_RESET = 0x1
  277. const m_FOPEN_MAX = 20
  278. const m_FPE_FLTDIV = 1
  279. const m_FPE_FLTINV = 5
  280. const m_FPE_FLTOVF = 2
  281. const m_FPE_FLTRES = 4
  282. const m_FPE_FLTSUB = 6
  283. const m_FPE_FLTUND = 3
  284. const m_FPE_INTDIV = 7
  285. const m_FPE_INTOVF = 8
  286. const m_FPE_NOOP = 0
  287. const m_FP_FAST_FMA = 1
  288. const m_FP_FAST_FMAF = 1
  289. const m_FP_FAST_FMAL = 1
  290. const m_FP_INFINITE = 2
  291. const m_FP_NAN = 1
  292. const m_FP_NORMAL = 4
  293. const m_FP_QNAN = "FP_NAN"
  294. const m_FP_SNAN = "FP_NAN"
  295. const m_FP_SUBNORMAL = 5
  296. const m_FP_SUPERNORMAL = 6
  297. const m_FP_ZERO = 3
  298. const m_FREAD = 0x00000001
  299. const m_FWRITE = 0x00000002
  300. const m_F_ADDFILESIGS = 61
  301. const m_F_ADDFILESIGS_FOR_DYLD_SIM = 83
  302. const m_F_ADDFILESIGS_INFO = 103
  303. const m_F_ADDFILESIGS_RETURN = 97
  304. const m_F_ADDFILESUPPL = 104
  305. const m_F_ADDSIGS = 59
  306. const m_F_ADDSIGS_MAIN_BINARY = 113
  307. const m_F_ALLOCATEALL = 0x00000004
  308. const m_F_ALLOCATECONTIG = 0x00000002
  309. const m_F_ALLOCATEPERSIST = 0x00000008
  310. const m_F_ATTRIBUTION_TAG = 111
  311. const m_F_BARRIERFSYNC = 85
  312. const m_F_CHECK_LV = 98
  313. const m_F_CHKCLEAN = 41
  314. const m_F_CREATE_TAG = 0x00000001
  315. const m_F_DELETE_TAG = 0x00000002
  316. const m_F_DUPFD = 0
  317. const m_F_DUPFD_CLOEXEC = 67
  318. const m_F_FINDSIGS = 78
  319. const m_F_FLUSH_DATA = 40
  320. const m_F_FREEZE_FS = 53
  321. const m_F_FULLFSYNC = 51
  322. const m_F_GETCODEDIR = 72
  323. const m_F_GETFD = 1
  324. const m_F_GETFL = 3
  325. const m_F_GETLEASE = 107
  326. const m_F_GETLK = 7
  327. const m_F_GETLKPID = 66
  328. const m_F_GETNOSIGPIPE = 74
  329. const m_F_GETOWN = 5
  330. const m_F_GETPATH = 50
  331. const m_F_GETPATH_MTMINFO = 71
  332. const m_F_GETPATH_NOFIRMLINK = 102
  333. const m_F_GETPROTECTIONCLASS = 63
  334. const m_F_GETPROTECTIONLEVEL = 77
  335. const m_F_GETSIGSINFO = 105
  336. const m_F_GLOBAL_NOCACHE = 55
  337. const m_F_LOCK = 1
  338. const m_F_LOG2PHYS = 49
  339. const m_F_LOG2PHYS_EXT = 65
  340. const m_F_NOCACHE = 48
  341. const m_F_NODIRECT = 62
  342. const m_F_OFD_GETLK = 92
  343. const m_F_OFD_SETLK = 90
  344. const m_F_OFD_SETLKW = 91
  345. const m_F_OFD_SETLKWTIMEOUT = 93
  346. const m_F_OK = 0
  347. const m_F_PATHPKG_CHECK = 52
  348. const m_F_PEOFPOSMODE = 3
  349. const m_F_PREALLOCATE = 42
  350. const m_F_PUNCHHOLE = 99
  351. const m_F_QUERY_TAG = 0x00000004
  352. const m_F_RDADVISE = 44
  353. const m_F_RDAHEAD = 45
  354. const m_F_RDLCK = 1
  355. const m_F_SETBACKINGSTORE = 70
  356. const m_F_SETFD = 2
  357. const m_F_SETFL = 4
  358. const m_F_SETLEASE = 106
  359. const m_F_SETLK = 8
  360. const m_F_SETLKW = 9
  361. const m_F_SETLKWTIMEOUT = 10
  362. const m_F_SETNOSIGPIPE = 73
  363. const m_F_SETOWN = 6
  364. const m_F_SETPROTECTIONCLASS = 64
  365. const m_F_SETSIZE = 43
  366. const m_F_SINGLE_WRITER = 76
  367. const m_F_SPECULATIVE_READ = 101
  368. const m_F_TEST = 3
  369. const m_F_THAW_FS = 54
  370. const m_F_TLOCK = 2
  371. const m_F_TRANSCODEKEY = 75
  372. const m_F_TRANSFEREXTENTS = 110
  373. const m_F_TRIM_ACTIVE_FILE = 100
  374. const m_F_ULOCK = 0
  375. const m_F_UNLCK = 2
  376. const m_F_VOLPOSMODE = 4
  377. const m_F_WRLCK = 3
  378. const m_GETSIGSINFO_PLATFORM_BINARY = 1
  379. const m_GID_MAX = 2147483647
  380. const m_HAVE_ARC4RANDOM_BUF = 1
  381. const m_HAVE_CONFIG_H = 1
  382. const m_HAVE_DLFCN_H = 1
  383. const m_HAVE_FCNTL_H = 1
  384. const m_HAVE_GETPAGESIZE = 1
  385. const m_HAVE_INTTYPES_H = 1
  386. const m_HAVE_MMAP = 1
  387. const m_HAVE_STDINT_H = 1
  388. const m_HAVE_STDIO_H = 1
  389. const m_HAVE_STDLIB_H = 1
  390. const m_HAVE_STRINGS_H = 1
  391. const m_HAVE_STRING_H = 1
  392. const m_HAVE_SYS_PARAM_H = 1
  393. const m_HAVE_SYS_STAT_H = 1
  394. const m_HAVE_SYS_TYPES_H = 1
  395. const m_HAVE_UNISTD_H = 1
  396. const m_HUGE = "MAXFLOAT"
  397. const m_ILL_BADSTK = 8
  398. const m_ILL_COPROC = 7
  399. const m_ILL_ILLADR = 5
  400. const m_ILL_ILLOPC = 1
  401. const m_ILL_ILLOPN = 4
  402. const m_ILL_ILLTRP = 2
  403. const m_ILL_NOOP = 0
  404. const m_ILL_PRVOPC = 3
  405. const m_ILL_PRVREG = 6
  406. const m_INFINITY = "HUGE_VALF"
  407. const m_INIT_ATTS_SIZE = 16
  408. const m_INIT_ATTS_VERSION = 4294967295
  409. const m_INIT_BLOCK_SIZE = 1024
  410. const m_INIT_BUFFER_SIZE = 1024
  411. const m_INIT_DATA_BUF_SIZE = 1024
  412. const m_INIT_POWER = 6
  413. const m_INIT_SCAFFOLD_ELEMENTS = 32
  414. const m_INIT_TAG_BUF_SIZE = 32
  415. const m_INTMAX_MAX = "__INTMAX_MAX__"
  416. const m_INTPTR_MAX = "__INTPTR_MAX__"
  417. const m_INT_FAST16_MAX = "__INT_LEAST16_MAX"
  418. const m_INT_FAST16_MIN = "__INT_LEAST16_MIN"
  419. const m_INT_FAST32_MAX = "__INT_LEAST32_MAX"
  420. const m_INT_FAST32_MIN = "__INT_LEAST32_MIN"
  421. const m_INT_FAST64_MAX = "__INT_LEAST64_MAX"
  422. const m_INT_FAST64_MIN = "__INT_LEAST64_MIN"
  423. const m_INT_FAST8_MAX = "__INT_LEAST8_MAX"
  424. const m_INT_FAST8_MIN = "__INT_LEAST8_MIN"
  425. const m_INT_LEAST16_MAX = "__INT_LEAST16_MAX"
  426. const m_INT_LEAST16_MIN = "__INT_LEAST16_MIN"
  427. const m_INT_LEAST32_MAX = "__INT_LEAST32_MAX"
  428. const m_INT_LEAST32_MIN = "__INT_LEAST32_MIN"
  429. const m_INT_LEAST64_MAX = "__INT_LEAST64_MAX"
  430. const m_INT_LEAST64_MIN = "__INT_LEAST64_MIN"
  431. const m_INT_LEAST8_MAX = "__INT_LEAST8_MAX"
  432. const m_INT_LEAST8_MIN = "__INT_LEAST8_MIN"
  433. const m_IOPOL_APPLICATION = "IOPOL_STANDARD"
  434. const m_IOPOL_ATIME_UPDATES_DEFAULT = 0
  435. const m_IOPOL_ATIME_UPDATES_OFF = 1
  436. const m_IOPOL_DEFAULT = 0
  437. const m_IOPOL_IMPORTANT = 1
  438. const m_IOPOL_MATERIALIZE_DATALESS_FILES_DEFAULT = 0
  439. const m_IOPOL_MATERIALIZE_DATALESS_FILES_OFF = 1
  440. const m_IOPOL_MATERIALIZE_DATALESS_FILES_ON = 2
  441. const m_IOPOL_NORMAL = "IOPOL_IMPORTANT"
  442. const m_IOPOL_PASSIVE = 2
  443. const m_IOPOL_SCOPE_DARWIN_BG = 2
  444. const m_IOPOL_SCOPE_PROCESS = 0
  445. const m_IOPOL_SCOPE_THREAD = 1
  446. const m_IOPOL_STANDARD = 5
  447. const m_IOPOL_THROTTLE = 3
  448. const m_IOPOL_TYPE_DISK = 0
  449. const m_IOPOL_TYPE_VFS_ALLOW_LOW_SPACE_WRITES = 9
  450. const m_IOPOL_TYPE_VFS_ATIME_UPDATES = 2
  451. const m_IOPOL_TYPE_VFS_DISALLOW_RW_FOR_O_EVTONLY = 10
  452. const m_IOPOL_TYPE_VFS_IGNORE_CONTENT_PROTECTION = 6
  453. const m_IOPOL_TYPE_VFS_IGNORE_PERMISSIONS = 7
  454. const m_IOPOL_TYPE_VFS_MATERIALIZE_DATALESS_FILES = 3
  455. const m_IOPOL_TYPE_VFS_SKIP_MTIME_UPDATE = 8
  456. const m_IOPOL_TYPE_VFS_STATFS_NO_DATA_VOLUME = 4
  457. const m_IOPOL_TYPE_VFS_TRIGGER_RESOLVE = 5
  458. const m_IOPOL_UTILITY = 4
  459. const m_IOPOL_VFS_ALLOW_LOW_SPACE_WRITES_OFF = 0
  460. const m_IOPOL_VFS_ALLOW_LOW_SPACE_WRITES_ON = 1
  461. const m_IOPOL_VFS_CONTENT_PROTECTION_DEFAULT = 0
  462. const m_IOPOL_VFS_CONTENT_PROTECTION_IGNORE = 1
  463. const m_IOPOL_VFS_DISALLOW_RW_FOR_O_EVTONLY_DEFAULT = 0
  464. const m_IOPOL_VFS_DISALLOW_RW_FOR_O_EVTONLY_ON = 1
  465. const m_IOPOL_VFS_IGNORE_PERMISSIONS_OFF = 0
  466. const m_IOPOL_VFS_IGNORE_PERMISSIONS_ON = 1
  467. const m_IOPOL_VFS_NOCACHE_WRITE_FS_BLKSIZE_DEFAULT = 0
  468. const m_IOPOL_VFS_NOCACHE_WRITE_FS_BLKSIZE_ON = 1
  469. const m_IOPOL_VFS_SKIP_MTIME_UPDATE_IGNORE = 2
  470. const m_IOPOL_VFS_SKIP_MTIME_UPDATE_OFF = 0
  471. const m_IOPOL_VFS_SKIP_MTIME_UPDATE_ON = 1
  472. const m_IOPOL_VFS_STATFS_FORCE_NO_DATA_VOLUME = 1
  473. const m_IOPOL_VFS_STATFS_NO_DATA_VOLUME_DEFAULT = 0
  474. const m_IOPOL_VFS_TRIGGER_RESOLVE_DEFAULT = 0
  475. const m_IOPOL_VFS_TRIGGER_RESOLVE_OFF = 1
  476. const m_ITIMER_PROF = 2
  477. const m_ITIMER_REAL = 0
  478. const m_ITIMER_VIRTUAL = 1
  479. const m_LINE_MAX = 2048
  480. const m_LINK_MAX = 32767
  481. const m_LITTLE_ENDIAN = "__DARWIN_LITTLE_ENDIAN"
  482. const m_LOCK_EX = 0x02
  483. const m_LOCK_NB = 0x04
  484. const m_LOCK_SH = 0x01
  485. const m_LOCK_UN = 0x08
  486. const m_LT_OBJDIR = ".libs/"
  487. const m_L_INCR = "SEEK_CUR"
  488. const m_L_SET = "SEEK_SET"
  489. const m_L_XTND = "SEEK_END"
  490. const m_L_ctermid = 1024
  491. const m_L_tmpnam = 1024
  492. const m_MAC_OS_VERSION_11_0 = "__MAC_11_0"
  493. const m_MAC_OS_VERSION_11_1 = "__MAC_11_1"
  494. const m_MAC_OS_VERSION_11_3 = "__MAC_11_3"
  495. const m_MAC_OS_VERSION_11_4 = "__MAC_11_4"
  496. const m_MAC_OS_VERSION_11_5 = "__MAC_11_5"
  497. const m_MAC_OS_VERSION_11_6 = "__MAC_11_6"
  498. const m_MAC_OS_VERSION_12_0 = "__MAC_12_0"
  499. const m_MAC_OS_VERSION_12_1 = "__MAC_12_1"
  500. const m_MAC_OS_VERSION_12_2 = "__MAC_12_2"
  501. const m_MAC_OS_VERSION_12_3 = "__MAC_12_3"
  502. const m_MAC_OS_VERSION_12_4 = "__MAC_12_4"
  503. const m_MAC_OS_VERSION_12_5 = "__MAC_12_5"
  504. const m_MAC_OS_VERSION_12_6 = "__MAC_12_6"
  505. const m_MAC_OS_VERSION_12_7 = "__MAC_12_7"
  506. const m_MAC_OS_VERSION_13_0 = "__MAC_13_0"
  507. const m_MAC_OS_VERSION_13_1 = "__MAC_13_1"
  508. const m_MAC_OS_VERSION_13_2 = "__MAC_13_2"
  509. const m_MAC_OS_VERSION_13_3 = "__MAC_13_3"
  510. const m_MAC_OS_VERSION_13_4 = "__MAC_13_4"
  511. const m_MAC_OS_VERSION_13_5 = "__MAC_13_5"
  512. const m_MAC_OS_VERSION_13_6 = "__MAC_13_6"
  513. const m_MAC_OS_VERSION_13_7 = "__MAC_13_7"
  514. const m_MAC_OS_VERSION_14_0 = "__MAC_14_0"
  515. const m_MAC_OS_VERSION_14_1 = "__MAC_14_1"
  516. const m_MAC_OS_VERSION_14_2 = "__MAC_14_2"
  517. const m_MAC_OS_VERSION_14_3 = "__MAC_14_3"
  518. const m_MAC_OS_VERSION_14_4 = "__MAC_14_4"
  519. const m_MAC_OS_VERSION_14_5 = "__MAC_14_5"
  520. const m_MAC_OS_VERSION_14_6 = "__MAC_14_6"
  521. const m_MAC_OS_VERSION_14_7 = "__MAC_14_7"
  522. const m_MAC_OS_VERSION_15_0 = "__MAC_15_0"
  523. const m_MAC_OS_VERSION_15_1 = "__MAC_15_1"
  524. const m_MAC_OS_VERSION_15_2 = "__MAC_15_2"
  525. const m_MAC_OS_VERSION_15_3 = "__MAC_15_3"
  526. const m_MAC_OS_VERSION_15_4 = "__MAC_15_4"
  527. const m_MAC_OS_X_VERSION_10_0 = "__MAC_10_0"
  528. const m_MAC_OS_X_VERSION_10_1 = "__MAC_10_1"
  529. const m_MAC_OS_X_VERSION_10_10 = "__MAC_10_10"
  530. const m_MAC_OS_X_VERSION_10_10_2 = "__MAC_10_10_2"
  531. const m_MAC_OS_X_VERSION_10_10_3 = "__MAC_10_10_3"
  532. const m_MAC_OS_X_VERSION_10_11 = "__MAC_10_11"
  533. const m_MAC_OS_X_VERSION_10_11_2 = "__MAC_10_11_2"
  534. const m_MAC_OS_X_VERSION_10_11_3 = "__MAC_10_11_3"
  535. const m_MAC_OS_X_VERSION_10_11_4 = "__MAC_10_11_4"
  536. const m_MAC_OS_X_VERSION_10_12 = "__MAC_10_12"
  537. const m_MAC_OS_X_VERSION_10_12_1 = "__MAC_10_12_1"
  538. const m_MAC_OS_X_VERSION_10_12_2 = "__MAC_10_12_2"
  539. const m_MAC_OS_X_VERSION_10_12_4 = "__MAC_10_12_4"
  540. const m_MAC_OS_X_VERSION_10_13 = "__MAC_10_13"
  541. const m_MAC_OS_X_VERSION_10_13_1 = "__MAC_10_13_1"
  542. const m_MAC_OS_X_VERSION_10_13_2 = "__MAC_10_13_2"
  543. const m_MAC_OS_X_VERSION_10_13_4 = "__MAC_10_13_4"
  544. const m_MAC_OS_X_VERSION_10_14 = "__MAC_10_14"
  545. const m_MAC_OS_X_VERSION_10_14_1 = "__MAC_10_14_1"
  546. const m_MAC_OS_X_VERSION_10_14_4 = "__MAC_10_14_4"
  547. const m_MAC_OS_X_VERSION_10_14_5 = "__MAC_10_14_5"
  548. const m_MAC_OS_X_VERSION_10_14_6 = "__MAC_10_14_6"
  549. const m_MAC_OS_X_VERSION_10_15 = "__MAC_10_15"
  550. const m_MAC_OS_X_VERSION_10_15_1 = "__MAC_10_15_1"
  551. const m_MAC_OS_X_VERSION_10_15_4 = "__MAC_10_15_4"
  552. const m_MAC_OS_X_VERSION_10_16 = "__MAC_10_16"
  553. const m_MAC_OS_X_VERSION_10_2 = "__MAC_10_2"
  554. const m_MAC_OS_X_VERSION_10_3 = "__MAC_10_3"
  555. const m_MAC_OS_X_VERSION_10_4 = "__MAC_10_4"
  556. const m_MAC_OS_X_VERSION_10_5 = "__MAC_10_5"
  557. const m_MAC_OS_X_VERSION_10_6 = "__MAC_10_6"
  558. const m_MAC_OS_X_VERSION_10_7 = "__MAC_10_7"
  559. const m_MAC_OS_X_VERSION_10_8 = "__MAC_10_8"
  560. const m_MAC_OS_X_VERSION_10_9 = "__MAC_10_9"
  561. const m_MATH_ERREXCEPT = 2
  562. const m_MATH_ERRNO = 1
  563. const m_MAXFLOAT = "0x1.fffffep+127f"
  564. const m_MAX_CANON = 1024
  565. const m_MAX_INPUT = 1024
  566. const m_MB_CUR_MAX = "__mb_cur_max"
  567. const m_MB_LEN_MAX = 1
  568. const m_MINSIGSTKSZ = 32768
  569. const m_M_1_PI = 0.318309886183790671537767526745028724
  570. const m_M_2_PI = 0.636619772367581343075535053490057448
  571. const m_M_2_SQRTPI = 1.12837916709551257389615890312154517
  572. const m_M_E = 2.71828182845904523536028747135266250
  573. const m_M_LN10 = 2.30258509299404568401799145468436421
  574. const m_M_LN2 = 0.693147180559945309417232121458176568
  575. const m_M_LOG10E = 0.434294481903251827651128918916605082
  576. const m_M_LOG2E = 1.44269504088896340735992468100189214
  577. const m_M_PI = 3.14159265358979323846264338327950288
  578. const m_M_PI_2 = 1.57079632679489661923132169163975144
  579. const m_M_PI_4 = 0.785398163397448309615660845819875721
  580. const m_M_SQRT1_2 = 0.707106781186547524400844362104849039
  581. const m_M_SQRT2 = 1.41421356237309504880168872420969808
  582. const m_NAME_MAX = 255
  583. const m_NBBY = "__DARWIN_NBBY"
  584. const m_NDEBUG = 1
  585. const m_NFDBITS = "__DARWIN_NFDBITS"
  586. const m_NGROUPS_MAX = 16
  587. const m_NSIG = "__DARWIN_NSIG"
  588. const m_NZERO = 20
  589. const m_OPEN_MAX = 10240
  590. const m_OVERFLOW = 3
  591. const m_O_ACCMODE = 0x0003
  592. const m_O_ALERT = 0x20000000
  593. const m_O_APPEND = 0x00000008
  594. const m_O_ASYNC = 0x00000040
  595. const m_O_CLOEXEC = 0x01000000
  596. const m_O_CREAT = 0x00000200
  597. const m_O_DIRECTORY = 0x00100000
  598. const m_O_DP_AUTHENTICATE = 0x0004
  599. const m_O_DP_GETRAWENCRYPTED = 0x0001
  600. const m_O_DP_GETRAWUNENCRYPTED = 0x0002
  601. const m_O_DSYNC = 0x400000
  602. const m_O_EVTONLY = 0x00008000
  603. const m_O_EXCL = 0x00000800
  604. const m_O_EXEC = 0x40000000
  605. const m_O_EXLOCK = 0x00000020
  606. const m_O_FSYNC = "O_SYNC"
  607. const m_O_NDELAY = "O_NONBLOCK"
  608. const m_O_NOCTTY = 0x00020000
  609. const m_O_NOFOLLOW = 0x00000100
  610. const m_O_NOFOLLOW_ANY = 0x20000000
  611. const m_O_NONBLOCK = 0x00000004
  612. const m_O_POPUP = 0x80000000
  613. const m_O_RDONLY = 0x0000
  614. const m_O_RDWR = 0x0002
  615. const m_O_RESOLVE_BENEATH = 0x00001000
  616. const m_O_SHLOCK = 0x00000010
  617. const m_O_SYMLINK = 0x00200000
  618. const m_O_SYNC = 0x0080
  619. const m_O_TRUNC = 0x00000400
  620. const m_O_WRONLY = 0x0001
  621. const m_PACKAGE = "expat"
  622. const m_PACKAGE_BUGREPORT = "expat-bugs@libexpat.org"
  623. const m_PACKAGE_NAME = "expat"
  624. const m_PACKAGE_STRING = "expat 2.5.0"
  625. const m_PACKAGE_TARNAME = "expat"
  626. const m_PACKAGE_URL = ""
  627. const m_PACKAGE_VERSION = "2.5.0"
  628. const m_PATH_MAX = 1024
  629. const m_PDP_ENDIAN = "__DARWIN_PDP_ENDIAN"
  630. const m_PIPE_BUF = 512
  631. const m_PLOSS = 6
  632. const m_POLL_ERR = 4
  633. const m_POLL_HUP = 6
  634. const m_POLL_IN = 1
  635. const m_POLL_MSG = 3
  636. const m_POLL_OUT = 2
  637. const m_POLL_PRI = 5
  638. const m_PRIO_DARWIN_BG = 0x1000
  639. const m_PRIO_DARWIN_NONUI = 0x1001
  640. const m_PRIO_DARWIN_PROCESS = 4
  641. const m_PRIO_DARWIN_THREAD = 3
  642. const m_PRIO_MAX = 20
  643. const m_PRIO_PGRP = 1
  644. const m_PRIO_PROCESS = 0
  645. const m_PRIO_USER = 2
  646. const m_PTRDIFF_MAX = "__PTRDIFF_MAX__"
  647. const m_P_tmpdir = "/var/tmp/"
  648. const m_RAND_MAX = 0x7fffffff
  649. const m_RENAME_EXCL = 0x00000004
  650. const m_RENAME_NOFOLLOW_ANY = 0x00000010
  651. const m_RENAME_RESERVED1 = 0x00000008
  652. const m_RENAME_SECLUDE = 0x00000001
  653. const m_RENAME_SWAP = 0x00000002
  654. const m_RE_DUP_MAX = 255
  655. const m_RLIMIT_AS = 5
  656. const m_RLIMIT_CORE = 4
  657. const m_RLIMIT_CPU = 0
  658. const m_RLIMIT_CPU_USAGE_MONITOR = 0x2
  659. const m_RLIMIT_DATA = 2
  660. const m_RLIMIT_FOOTPRINT_INTERVAL = 0x4
  661. const m_RLIMIT_FSIZE = 1
  662. const m_RLIMIT_MEMLOCK = 6
  663. const m_RLIMIT_NOFILE = 8
  664. const m_RLIMIT_NPROC = 7
  665. const m_RLIMIT_RSS = "RLIMIT_AS"
  666. const m_RLIMIT_STACK = 3
  667. const m_RLIMIT_THREAD_CPULIMITS = 0x3
  668. const m_RLIMIT_WAKEUPS_MONITOR = 0x1
  669. const m_RLIM_NLIMITS = 9
  670. const m_RLIM_SAVED_CUR = "RLIM_INFINITY"
  671. const m_RLIM_SAVED_MAX = "RLIM_INFINITY"
  672. const m_RUSAGE_INFO_CURRENT = "RUSAGE_INFO_V6"
  673. const m_RUSAGE_INFO_V0 = 0
  674. const m_RUSAGE_INFO_V1 = 1
  675. const m_RUSAGE_INFO_V2 = 2
  676. const m_RUSAGE_INFO_V3 = 3
  677. const m_RUSAGE_INFO_V4 = 4
  678. const m_RUSAGE_INFO_V5 = 5
  679. const m_RUSAGE_INFO_V6 = 6
  680. const m_RUSAGE_SELF = 0
  681. const m_RU_PROC_RUNS_RESLIDE = 0x00000001
  682. const m_SA_64REGSET = 0x0200
  683. const m_SA_NOCLDSTOP = 0x0008
  684. const m_SA_NOCLDWAIT = 0x0020
  685. const m_SA_NODEFER = 0x0010
  686. const m_SA_ONSTACK = 0x0001
  687. const m_SA_RESETHAND = 0x0004
  688. const m_SA_RESTART = 0x0002
  689. const m_SA_SIGINFO = 0x0040
  690. const m_SA_USERTRAMP = 0x0100
  691. const m_SEEK_CUR = 1
  692. const m_SEEK_DATA = 4
  693. const m_SEEK_END = 2
  694. const m_SEEK_HOLE = 3
  695. const m_SEEK_SET = 0
  696. const m_SEGV_ACCERR = 2
  697. const m_SEGV_MAPERR = 1
  698. const m_SEGV_NOOP = 0
  699. const m_SIGABRT = 6
  700. const m_SIGALRM = 14
  701. const m_SIGBUS = 10
  702. const m_SIGCHLD = 20
  703. const m_SIGCONT = 19
  704. const m_SIGEMT = 7
  705. const m_SIGEV_NONE = 0
  706. const m_SIGEV_SIGNAL = 1
  707. const m_SIGEV_THREAD = 3
  708. const m_SIGFPE = 8
  709. const m_SIGHUP = 1
  710. const m_SIGILL = 4
  711. const m_SIGINFO = 29
  712. const m_SIGINT = 2
  713. const m_SIGIO = 23
  714. const m_SIGIOT = "SIGABRT"
  715. const m_SIGKILL = 9
  716. const m_SIGPIPE = 13
  717. const m_SIGPROF = 27
  718. const m_SIGQUIT = 3
  719. const m_SIGSEGV = 11
  720. const m_SIGSTKSZ = 131072
  721. const m_SIGSTOP = 17
  722. const m_SIGSYS = 12
  723. const m_SIGTERM = 15
  724. const m_SIGTRAP = 5
  725. const m_SIGTSTP = 18
  726. const m_SIGTTIN = 21
  727. const m_SIGTTOU = 22
  728. const m_SIGURG = 16
  729. const m_SIGUSR1 = 30
  730. const m_SIGUSR2 = 31
  731. const m_SIGVTALRM = 26
  732. const m_SIGWINCH = 28
  733. const m_SIGXCPU = 24
  734. const m_SIGXFSZ = 25
  735. const m_SIG_BLOCK = 1
  736. const m_SIG_SETMASK = 3
  737. const m_SIG_UNBLOCK = 2
  738. const m_SING = 2
  739. const m_SIP_KEYLEN = 16
  740. const m_SIZE_MAX = "__SIZE_MAX__"
  741. const m_SI_ASYNCIO = 0x10004
  742. const m_SI_MESGQ = 0x10005
  743. const m_SI_QUEUE = 0x10002
  744. const m_SI_TIMER = 0x10003
  745. const m_SI_USER = 0x10001
  746. const m_SS_DISABLE = 0x0004
  747. const m_SS_ONSTACK = 0x0001
  748. const m_STDC_HEADERS = 1
  749. const m_STDERR_FILENO = 2
  750. const m_STDIN_FILENO = 0
  751. const m_STDOUT_FILENO = 1
  752. const m_SV_INTERRUPT = "SA_RESTART"
  753. const m_SV_NOCLDSTOP = "SA_NOCLDSTOP"
  754. const m_SV_NODEFER = "SA_NODEFER"
  755. const m_SV_ONSTACK = "SA_ONSTACK"
  756. const m_SV_RESETHAND = "SA_RESETHAND"
  757. const m_SV_SIGINFO = "SA_SIGINFO"
  758. const m_SYNC_VOLUME_FULLSYNC = 0x01
  759. const m_SYNC_VOLUME_WAIT = 0x02
  760. const m_S_IEXEC = "S_IXUSR"
  761. const m_S_IFBLK = 0060000
  762. const m_S_IFCHR = 0020000
  763. const m_S_IFDIR = 0040000
  764. const m_S_IFIFO = 0010000
  765. const m_S_IFLNK = 0120000
  766. const m_S_IFMT = 0170000
  767. const m_S_IFREG = 0100000
  768. const m_S_IFSOCK = 0140000
  769. const m_S_IFWHT = 0160000
  770. const m_S_IREAD = "S_IRUSR"
  771. const m_S_IRGRP = 0000040
  772. const m_S_IROTH = 0000004
  773. const m_S_IRUSR = 0000400
  774. const m_S_IRWXG = 0000070
  775. const m_S_IRWXO = 0000007
  776. const m_S_IRWXU = 0000700
  777. const m_S_ISGID = 0002000
  778. const m_S_ISTXT = "S_ISVTX"
  779. const m_S_ISUID = 0004000
  780. const m_S_ISVTX = 0001000
  781. const m_S_IWGRP = 0000020
  782. const m_S_IWOTH = 0000002
  783. const m_S_IWRITE = "S_IWUSR"
  784. const m_S_IWUSR = 0000200
  785. const m_S_IXGRP = 0000010
  786. const m_S_IXOTH = 0000001
  787. const m_S_IXUSR = 0000100
  788. const m_TARGET_IPHONE_SIMULATOR = 0
  789. const m_TARGET_OS_ARROW = 1
  790. const m_TARGET_OS_BRIDGE = 0
  791. const m_TARGET_OS_DRIVERKIT = 0
  792. const m_TARGET_OS_EMBEDDED = 0
  793. const m_TARGET_OS_IOS = 0
  794. const m_TARGET_OS_IOSMAC = 0
  795. const m_TARGET_OS_IPHONE = 0
  796. const m_TARGET_OS_LINUX = 0
  797. const m_TARGET_OS_MAC = 1
  798. const m_TARGET_OS_MACCATALYST = 0
  799. const m_TARGET_OS_NANO = 0
  800. const m_TARGET_OS_OSX = 1
  801. const m_TARGET_OS_SIMULATOR = 0
  802. const m_TARGET_OS_TV = 0
  803. const m_TARGET_OS_UIKITFORMAC = 0
  804. const m_TARGET_OS_UNIX = 0
  805. const m_TARGET_OS_VISION = 0
  806. const m_TARGET_OS_WATCH = 0
  807. const m_TARGET_OS_WIN32 = 0
  808. const m_TARGET_OS_WINDOWS = 0
  809. const m_TARGET_OS_XR = 0
  810. const m_TIME_UTC = 1
  811. const m_TLOSS = 5
  812. const m_TMP_MAX = 308915776
  813. const m_TRAP_BRKPT = 1
  814. const m_TRAP_TRACE = 2
  815. const m_UID_MAX = 2147483647
  816. const m_UINTMAX_MAX = "__UINTMAX_MAX__"
  817. const m_UINTPTR_MAX = "__UINTPTR_MAX__"
  818. const m_UINT_FAST16_MAX = "__UINT_LEAST16_MAX"
  819. const m_UINT_FAST32_MAX = "__UINT_LEAST32_MAX"
  820. const m_UINT_FAST64_MAX = "__UINT_LEAST64_MAX"
  821. const m_UINT_FAST8_MAX = "__UINT_LEAST8_MAX"
  822. const m_UINT_LEAST16_MAX = "__UINT_LEAST16_MAX"
  823. const m_UINT_LEAST32_MAX = "__UINT_LEAST32_MAX"
  824. const m_UINT_LEAST64_MAX = "__UINT_LEAST64_MAX"
  825. const m_UINT_LEAST8_MAX = "__UINT_LEAST8_MAX"
  826. const m_UNDERFLOW = 4
  827. const m_USER_FSIGNATURES_CDHASH_LEN = 20
  828. const m_VERSION = "2.5.0"
  829. const m_WAIT_MYPGRP = 0
  830. const m_WAKEMON_DISABLE = 0x02
  831. const m_WAKEMON_ENABLE = 0x01
  832. const m_WAKEMON_GET_PARAMS = 0x04
  833. const m_WAKEMON_MAKE_FATAL = 0x10
  834. const m_WAKEMON_SET_DEFAULTS = 0x08
  835. const m_WCHAR_MAX = "__WCHAR_MAX__"
  836. const m_WCONTINUED = 0x00000010
  837. const m_WCOREFLAG = 0200
  838. const m_WEXITED = 0x00000004
  839. const m_WNOHANG = 0x00000001
  840. const m_WNOWAIT = 0x00000020
  841. const m_WSTOPPED = 0x00000008
  842. const m_WUNTRACED = 0x00000002
  843. const m_XML_ATTRIBUTE_VALUE_LITERAL = 0
  844. const m_XML_BUILDING_EXPAT = 1
  845. const m_XML_CDATA_SECTION_STATE = 2
  846. const m_XML_CONTENT_STATE = 1
  847. const m_XML_CONTEXT_BYTES = 1024
  848. const m_XML_DEV_URANDOM = 1
  849. const m_XML_DTD = 1
  850. const m_XML_ENABLE_VISIBILITY = 0
  851. const m_XML_ENCODE_MAX = "XML_UTF8_ENCODE_MAX"
  852. const m_XML_ENTITY_VALUE_LITERAL = 1
  853. const m_XML_GetErrorByteIndex = "XML_GetCurrentByteIndex"
  854. const m_XML_GetErrorColumnNumber = "XML_GetCurrentColumnNumber"
  855. const m_XML_GetErrorLineNumber = "XML_GetCurrentLineNumber"
  856. const m_XML_IGNORE_SECTION_STATE = 3
  857. const m_XML_MAJOR_VERSION = 2
  858. const m_XML_MICRO_VERSION = 0
  859. const m_XML_MINOR_VERSION = 5
  860. const m_XML_NS = 1
  861. const m_XML_N_LITERAL_TYPES = 2
  862. const m_XML_N_STATES = 4
  863. const m_XML_PROLOG_STATE = 0
  864. const m_XML_TOK_ATTRIBUTE_VALUE_S = 39
  865. const m_XML_TOK_BOM = 14
  866. const m_XML_TOK_CDATA_SECT_CLOSE = 40
  867. const m_XML_TOK_CDATA_SECT_OPEN = 8
  868. const m_XML_TOK_CHAR_REF = 10
  869. const m_XML_TOK_CLOSE_BRACKET = 26
  870. const m_XML_TOK_CLOSE_PAREN = 24
  871. const m_XML_TOK_CLOSE_PAREN_ASTERISK = 36
  872. const m_XML_TOK_CLOSE_PAREN_PLUS = 37
  873. const m_XML_TOK_CLOSE_PAREN_QUESTION = 35
  874. const m_XML_TOK_COMMA = 38
  875. const m_XML_TOK_COMMENT = 13
  876. const m_XML_TOK_COND_SECT_CLOSE = 34
  877. const m_XML_TOK_COND_SECT_OPEN = 33
  878. const m_XML_TOK_DATA_CHARS = 6
  879. const m_XML_TOK_DATA_NEWLINE = 7
  880. const m_XML_TOK_DECL_CLOSE = 17
  881. const m_XML_TOK_DECL_OPEN = 16
  882. const m_XML_TOK_EMPTY_ELEMENT_NO_ATTS = 4
  883. const m_XML_TOK_EMPTY_ELEMENT_WITH_ATTS = 3
  884. const m_XML_TOK_END_TAG = 5
  885. const m_XML_TOK_ENTITY_REF = 9
  886. const m_XML_TOK_IGNORE_SECT = 42
  887. const m_XML_TOK_INSTANCE_START = 29
  888. const m_XML_TOK_INVALID = 0
  889. const m_XML_TOK_LITERAL = 27
  890. const m_XML_TOK_NAME = 18
  891. const m_XML_TOK_NAME_ASTERISK = 31
  892. const m_XML_TOK_NAME_PLUS = 32
  893. const m_XML_TOK_NAME_QUESTION = 30
  894. const m_XML_TOK_NMTOKEN = 19
  895. const m_XML_TOK_OPEN_BRACKET = 25
  896. const m_XML_TOK_OPEN_PAREN = 23
  897. const m_XML_TOK_OR = 21
  898. const m_XML_TOK_PARAM_ENTITY_REF = 28
  899. const m_XML_TOK_PERCENT = 22
  900. const m_XML_TOK_PI = 11
  901. const m_XML_TOK_POUND_NAME = 20
  902. const m_XML_TOK_PREFIXED_NAME = 41
  903. const m_XML_TOK_PROLOG_S = 15
  904. const m_XML_TOK_START_TAG_NO_ATTS = 2
  905. const m_XML_TOK_START_TAG_WITH_ATTS = 1
  906. const m_XML_TOK_XML_DECL = 12
  907. const m_XML_UTF16_ENCODE_MAX = 2
  908. const m_XML_UTF8_ENCODE_MAX = 4
  909. const m_X_TLOSS = 1.41484755040568800000e+16
  910. const m_XmlConvert = "XmlUtf8Convert"
  911. const m_XmlEncode = "XmlUtf8Encode"
  912. const m_XmlGetInternalEncoding = "XmlGetUtf8InternalEncoding"
  913. const m_XmlGetInternalEncodingNS = "XmlGetUtf8InternalEncodingNS"
  914. const m_XmlRole_INCLUDED = 1
  915. const m_XmlTok_INCLUDED = 1
  916. const m__ARM_SIGNAL_ = 1
  917. const m__CS_DARWIN_USER_CACHE_DIR = 65538
  918. const m__CS_DARWIN_USER_DIR = 65536
  919. const m__CS_DARWIN_USER_TEMP_DIR = 65537
  920. const m__CS_PATH = 1
  921. const m__CS_POSIX_V6_ILP32_OFF32_CFLAGS = 2
  922. const m__CS_POSIX_V6_ILP32_OFF32_LDFLAGS = 3
  923. const m__CS_POSIX_V6_ILP32_OFF32_LIBS = 4
  924. const m__CS_POSIX_V6_ILP32_OFFBIG_CFLAGS = 5
  925. const m__CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS = 6
  926. const m__CS_POSIX_V6_ILP32_OFFBIG_LIBS = 7
  927. const m__CS_POSIX_V6_LP64_OFF64_CFLAGS = 8
  928. const m__CS_POSIX_V6_LP64_OFF64_LDFLAGS = 9
  929. const m__CS_POSIX_V6_LP64_OFF64_LIBS = 10
  930. const m__CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS = 11
  931. const m__CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS = 12
  932. const m__CS_POSIX_V6_LPBIG_OFFBIG_LIBS = 13
  933. const m__CS_POSIX_V6_WIDTH_RESTRICTED_ENVS = 14
  934. const m__CS_XBS5_ILP32_OFF32_CFLAGS = 20
  935. const m__CS_XBS5_ILP32_OFF32_LDFLAGS = 21
  936. const m__CS_XBS5_ILP32_OFF32_LIBS = 22
  937. const m__CS_XBS5_ILP32_OFF32_LINTFLAGS = 23
  938. const m__CS_XBS5_ILP32_OFFBIG_CFLAGS = 24
  939. const m__CS_XBS5_ILP32_OFFBIG_LDFLAGS = 25
  940. const m__CS_XBS5_ILP32_OFFBIG_LIBS = 26
  941. const m__CS_XBS5_ILP32_OFFBIG_LINTFLAGS = 27
  942. const m__CS_XBS5_LP64_OFF64_CFLAGS = 28
  943. const m__CS_XBS5_LP64_OFF64_LDFLAGS = 29
  944. const m__CS_XBS5_LP64_OFF64_LIBS = 30
  945. const m__CS_XBS5_LP64_OFF64_LINTFLAGS = 31
  946. const m__CS_XBS5_LPBIG_OFFBIG_CFLAGS = 32
  947. const m__CS_XBS5_LPBIG_OFFBIG_LDFLAGS = 33
  948. const m__CS_XBS5_LPBIG_OFFBIG_LIBS = 34
  949. const m__CS_XBS5_LPBIG_OFFBIG_LINTFLAGS = 35
  950. const m__DARWIN_FEATURE_64_BIT_INODE = 1
  951. const m__DARWIN_FEATURE_ONLY_64_BIT_INODE = 1
  952. const m__DARWIN_FEATURE_ONLY_UNIX_CONFORMANCE = 1
  953. const m__DARWIN_FEATURE_ONLY_VERS_1050 = 1
  954. const m__DARWIN_FEATURE_UNIX_CONFORMANCE = 3
  955. const m__FORTIFY_SOURCE = 2
  956. const m__GNU_SOURCE = 1
  957. const m__IOFBF = 0
  958. const m__IOLBF = 1
  959. const m__IONBF = 2
  960. const m__LIBC_COUNT__MB_LEN_MAX = "_LIBC_UNSAFE_INDEXABLE"
  961. const m__LIBC_COUNT__PATH_MAX = "_LIBC_UNSAFE_INDEXABLE"
  962. const m__LP64 = 1
  963. const m__PC_2_SYMLINKS = 15
  964. const m__PC_ALLOC_SIZE_MIN = 16
  965. const m__PC_ASYNC_IO = 17
  966. const m__PC_AUTH_OPAQUE_NP = 14
  967. const m__PC_CASE_PRESERVING = 12
  968. const m__PC_CASE_SENSITIVE = 11
  969. const m__PC_CHOWN_RESTRICTED = 7
  970. const m__PC_EXTENDED_SECURITY_NP = 13
  971. const m__PC_FILESIZEBITS = 18
  972. const m__PC_LINK_MAX = 1
  973. const m__PC_MAX_CANON = 2
  974. const m__PC_MAX_INPUT = 3
  975. const m__PC_MIN_HOLE_SIZE = 27
  976. const m__PC_NAME_CHARS_MAX = 10
  977. const m__PC_NAME_MAX = 4
  978. const m__PC_NO_TRUNC = 8
  979. const m__PC_PATH_MAX = 5
  980. const m__PC_PIPE_BUF = 6
  981. const m__PC_PRIO_IO = 19
  982. const m__PC_REC_INCR_XFER_SIZE = 20
  983. const m__PC_REC_MAX_XFER_SIZE = 21
  984. const m__PC_REC_MIN_XFER_SIZE = 22
  985. const m__PC_REC_XFER_ALIGN = 23
  986. const m__PC_SYMLINK_MAX = 24
  987. const m__PC_SYNC_IO = 25
  988. const m__PC_VDISABLE = 9
  989. const m__PC_XATTR_SIZE_BITS = 26
  990. const m__POSIX2_CHAR_TERM = 200112
  991. const m__POSIX2_C_BIND = 200112
  992. const m__POSIX2_C_DEV = 200112
  993. const m__POSIX2_FORT_RUN = 200112
  994. const m__POSIX2_LOCALEDEF = 200112
  995. const m__POSIX2_SW_DEV = 200112
  996. const m__POSIX2_UPE = 200112
  997. const m__POSIX2_VERSION = 200112
  998. const m__POSIX_CHOWN_RESTRICTED = 200112
  999. const m__POSIX_FSYNC = 200112
  1000. const m__POSIX_IPV6 = 200112
  1001. const m__POSIX_JOB_CONTROL = 200112
  1002. const m__POSIX_MAPPED_FILES = 200112
  1003. const m__POSIX_MEMORY_PROTECTION = 200112
  1004. const m__POSIX_NO_TRUNC = 200112
  1005. const m__POSIX_READER_WRITER_LOCKS = 200112
  1006. const m__POSIX_REGEXP = 200112
  1007. const m__POSIX_SAVED_IDS = 200112
  1008. const m__POSIX_SHELL = 200112
  1009. const m__POSIX_SPAWN = 200112
  1010. const m__POSIX_THREADS = 200112
  1011. const m__POSIX_THREAD_ATTR_STACKADDR = 200112
  1012. const m__POSIX_THREAD_ATTR_STACKSIZE = 200112
  1013. const m__POSIX_THREAD_KEYS_MAX = 128
  1014. const m__POSIX_THREAD_PROCESS_SHARED = 200112
  1015. const m__POSIX_THREAD_SAFE_FUNCTIONS = 200112
  1016. const m__POSIX_V6_ILP32_OFF32 = "__ILP32_OFF32"
  1017. const m__POSIX_V6_ILP32_OFFBIG = "__ILP32_OFFBIG"
  1018. const m__POSIX_V6_LP64_OFF64 = "__LP64_OFF64"
  1019. const m__POSIX_V6_LPBIG_OFFBIG = "__LPBIG_OFFBIG"
  1020. const m__POSIX_V7_ILP32_OFF32 = "__ILP32_OFF32"
  1021. const m__POSIX_V7_ILP32_OFFBIG = "__ILP32_OFFBIG"
  1022. const m__POSIX_V7_LP64_OFF64 = "__LP64_OFF64"
  1023. const m__POSIX_V7_LPBIG_OFFBIG = "__LPBIG_OFFBIG"
  1024. const m__POSIX_VERSION = 200112
  1025. const m__QUAD_HIGHWORD = 1
  1026. const m__QUAD_LOWWORD = 0
  1027. const m__RLIMIT_POSIX_FLAG = 0x1000
  1028. const m__SC_2_CHAR_TERM = 20
  1029. const m__SC_2_C_BIND = 18
  1030. const m__SC_2_C_DEV = 19
  1031. const m__SC_2_FORT_DEV = 21
  1032. const m__SC_2_FORT_RUN = 22
  1033. const m__SC_2_LOCALEDEF = 23
  1034. const m__SC_2_PBS = 59
  1035. const m__SC_2_PBS_ACCOUNTING = 60
  1036. const m__SC_2_PBS_CHECKPOINT = 61
  1037. const m__SC_2_PBS_LOCATE = 62
  1038. const m__SC_2_PBS_MESSAGE = 63
  1039. const m__SC_2_PBS_TRACK = 64
  1040. const m__SC_2_SW_DEV = 24
  1041. const m__SC_2_UPE = 25
  1042. const m__SC_2_VERSION = 17
  1043. const m__SC_ADVISORY_INFO = 65
  1044. const m__SC_AIO_LISTIO_MAX = 42
  1045. const m__SC_AIO_MAX = 43
  1046. const m__SC_AIO_PRIO_DELTA_MAX = 44
  1047. const m__SC_ARG_MAX = 1
  1048. const m__SC_ASYNCHRONOUS_IO = 28
  1049. const m__SC_ATEXIT_MAX = 107
  1050. const m__SC_BARRIERS = 66
  1051. const m__SC_BC_BASE_MAX = 9
  1052. const m__SC_BC_DIM_MAX = 10
  1053. const m__SC_BC_SCALE_MAX = 11
  1054. const m__SC_BC_STRING_MAX = 12
  1055. const m__SC_CHILD_MAX = 2
  1056. const m__SC_CLK_TCK = 3
  1057. const m__SC_CLOCK_SELECTION = 67
  1058. const m__SC_COLL_WEIGHTS_MAX = 13
  1059. const m__SC_CPUTIME = 68
  1060. const m__SC_DELAYTIMER_MAX = 45
  1061. const m__SC_EXPR_NEST_MAX = 14
  1062. const m__SC_FILE_LOCKING = 69
  1063. const m__SC_FSYNC = 38
  1064. const m__SC_GETGR_R_SIZE_MAX = 70
  1065. const m__SC_GETPW_R_SIZE_MAX = 71
  1066. const m__SC_HOST_NAME_MAX = 72
  1067. const m__SC_IOV_MAX = 56
  1068. const m__SC_IPV6 = 118
  1069. const m__SC_JOB_CONTROL = 6
  1070. const m__SC_LINE_MAX = 15
  1071. const m__SC_LOGIN_NAME_MAX = 73
  1072. const m__SC_MAPPED_FILES = 47
  1073. const m__SC_MEMLOCK = 30
  1074. const m__SC_MEMLOCK_RANGE = 31
  1075. const m__SC_MEMORY_PROTECTION = 32
  1076. const m__SC_MESSAGE_PASSING = 33
  1077. const m__SC_MONOTONIC_CLOCK = 74
  1078. const m__SC_MQ_OPEN_MAX = 46
  1079. const m__SC_MQ_PRIO_MAX = 75
  1080. const m__SC_NGROUPS_MAX = 4
  1081. const m__SC_NPROCESSORS_CONF = 57
  1082. const m__SC_NPROCESSORS_ONLN = 58
  1083. const m__SC_OPEN_MAX = 5
  1084. const m__SC_PAGESIZE = 29
  1085. const m__SC_PAGE_SIZE = "_SC_PAGESIZE"
  1086. const m__SC_PASS_MAX = 131
  1087. const m__SC_PHYS_PAGES = 200
  1088. const m__SC_PRIORITIZED_IO = 34
  1089. const m__SC_PRIORITY_SCHEDULING = 35
  1090. const m__SC_RAW_SOCKETS = 119
  1091. const m__SC_READER_WRITER_LOCKS = 76
  1092. const m__SC_REALTIME_SIGNALS = 36
  1093. const m__SC_REGEXP = 77
  1094. const m__SC_RE_DUP_MAX = 16
  1095. const m__SC_RTSIG_MAX = 48
  1096. const m__SC_SAVED_IDS = 7
  1097. const m__SC_SEMAPHORES = 37
  1098. const m__SC_SEM_NSEMS_MAX = 49
  1099. const m__SC_SEM_VALUE_MAX = 50
  1100. const m__SC_SHARED_MEMORY_OBJECTS = 39
  1101. const m__SC_SHELL = 78
  1102. const m__SC_SIGQUEUE_MAX = 51
  1103. const m__SC_SPAWN = 79
  1104. const m__SC_SPIN_LOCKS = 80
  1105. const m__SC_SPORADIC_SERVER = 81
  1106. const m__SC_SS_REPL_MAX = 126
  1107. const m__SC_STREAM_MAX = 26
  1108. const m__SC_SYMLOOP_MAX = 120
  1109. const m__SC_SYNCHRONIZED_IO = 40
  1110. const m__SC_THREADS = 96
  1111. const m__SC_THREAD_ATTR_STACKADDR = 82
  1112. const m__SC_THREAD_ATTR_STACKSIZE = 83
  1113. const m__SC_THREAD_CPUTIME = 84
  1114. const m__SC_THREAD_DESTRUCTOR_ITERATIONS = 85
  1115. const m__SC_THREAD_KEYS_MAX = 86
  1116. const m__SC_THREAD_PRIORITY_SCHEDULING = 89
  1117. const m__SC_THREAD_PRIO_INHERIT = 87
  1118. const m__SC_THREAD_PRIO_PROTECT = 88
  1119. const m__SC_THREAD_PROCESS_SHARED = 90
  1120. const m__SC_THREAD_SAFE_FUNCTIONS = 91
  1121. const m__SC_THREAD_SPORADIC_SERVER = 92
  1122. const m__SC_THREAD_STACK_MIN = 93
  1123. const m__SC_THREAD_THREADS_MAX = 94
  1124. const m__SC_TIMEOUTS = 95
  1125. const m__SC_TIMERS = 41
  1126. const m__SC_TIMER_MAX = 52
  1127. const m__SC_TRACE = 97
  1128. const m__SC_TRACE_EVENT_FILTER = 98
  1129. const m__SC_TRACE_EVENT_NAME_MAX = 127
  1130. const m__SC_TRACE_INHERIT = 99
  1131. const m__SC_TRACE_LOG = 100
  1132. const m__SC_TRACE_NAME_MAX = 128
  1133. const m__SC_TRACE_SYS_MAX = 129
  1134. const m__SC_TRACE_USER_EVENT_MAX = 130
  1135. const m__SC_TTY_NAME_MAX = 101
  1136. const m__SC_TYPED_MEMORY_OBJECTS = 102
  1137. const m__SC_TZNAME_MAX = 27
  1138. const m__SC_V6_ILP32_OFF32 = 103
  1139. const m__SC_V6_ILP32_OFFBIG = 104
  1140. const m__SC_V6_LP64_OFF64 = 105
  1141. const m__SC_V6_LPBIG_OFFBIG = 106
  1142. const m__SC_VERSION = 8
  1143. const m__SC_XBS5_ILP32_OFF32 = 122
  1144. const m__SC_XBS5_ILP32_OFFBIG = 123
  1145. const m__SC_XBS5_LP64_OFF64 = 124
  1146. const m__SC_XBS5_LPBIG_OFFBIG = 125
  1147. const m__SC_XOPEN_CRYPT = 108
  1148. const m__SC_XOPEN_ENH_I18N = 109
  1149. const m__SC_XOPEN_LEGACY = 110
  1150. const m__SC_XOPEN_REALTIME = 111
  1151. const m__SC_XOPEN_REALTIME_THREADS = 112
  1152. const m__SC_XOPEN_SHM = 113
  1153. const m__SC_XOPEN_STREAMS = 114
  1154. const m__SC_XOPEN_UNIX = 115
  1155. const m__SC_XOPEN_VERSION = 116
  1156. const m__SC_XOPEN_XCU_VERSION = 121
  1157. const m__STRUCT_MCONTEXT = "_STRUCT_MCONTEXT64"
  1158. const m__V6_ILP32_OFF32 = "__ILP32_OFF32"
  1159. const m__V6_ILP32_OFFBIG = "__ILP32_OFFBIG"
  1160. const m__V6_LP64_OFF64 = "__LP64_OFF64"
  1161. const m__V6_LPBIG_OFFBIG = "__LPBIG_OFFBIG"
  1162. const m__WSTOPPED = 0177
  1163. const m__XBS5_ILP32_OFF32 = "__ILP32_OFF32"
  1164. const m__XBS5_ILP32_OFFBIG = "__ILP32_OFFBIG"
  1165. const m__XBS5_LP64_OFF64 = "__LP64_OFF64"
  1166. const m__XBS5_LPBIG_OFFBIG = "__LPBIG_OFFBIG"
  1167. const m__XOPEN_CRYPT = 1
  1168. const m__XOPEN_ENH_I18N = 1
  1169. const m__XOPEN_SHM = 1
  1170. const m__XOPEN_UNIX = 1
  1171. const m__XOPEN_VERSION = 600
  1172. const m__XOPEN_XCU_VERSION = 4
  1173. const m___AARCH64EL__ = 1
  1174. const m___AARCH64_CMODEL_SMALL__ = 1
  1175. const m___AARCH64_SIMD__ = 1
  1176. const m___API_TO_BE_DEPRECATED = 100000
  1177. const m___API_TO_BE_DEPRECATED_DRIVERKIT = 100000
  1178. const m___API_TO_BE_DEPRECATED_IOS = 100000
  1179. const m___API_TO_BE_DEPRECATED_IOSAPPLICATIONEXTENSION = 100000
  1180. const m___API_TO_BE_DEPRECATED_KERNELKIT = 100000
  1181. const m___API_TO_BE_DEPRECATED_MACCATALYST = 100000
  1182. const m___API_TO_BE_DEPRECATED_MACCATALYSTAPPLICATIONEXTENSION = 100000
  1183. const m___API_TO_BE_DEPRECATED_MACOS = 100000
  1184. const m___API_TO_BE_DEPRECATED_MACOSAPPLICATIONEXTENSION = 100000
  1185. const m___API_TO_BE_DEPRECATED_TVOS = 100000
  1186. const m___API_TO_BE_DEPRECATED_TVOSAPPLICATIONEXTENSION = 100000
  1187. const m___API_TO_BE_DEPRECATED_VISIONOS = 100000
  1188. const m___API_TO_BE_DEPRECATED_VISIONOSAPPLICATIONEXTENSION = 100000
  1189. const m___API_TO_BE_DEPRECATED_WATCHOS = 100000
  1190. const m___API_TO_BE_DEPRECATED_WATCHOSAPPLICATIONEXTENSION = 100000
  1191. const m___APPLE_CC__ = 6000
  1192. const m___APPLE__ = 1
  1193. const m___ARM64_ARCH_8__ = 1
  1194. const m___ARM_64BIT_STATE = 1
  1195. const m___ARM_ACLE = 200
  1196. const m___ARM_ALIGN_MAX_STACK_PWR = 4
  1197. const m___ARM_ARCH = 8
  1198. const m___ARM_ARCH_8_3__ = 1
  1199. const m___ARM_ARCH_8_4__ = 1
  1200. const m___ARM_ARCH_8_5__ = 1
  1201. const m___ARM_ARCH_ISA_A64 = 1
  1202. const m___ARM_ARCH_PROFILE = 'A'
  1203. const m___ARM_FEATURE_AES = 1
  1204. const m___ARM_FEATURE_ATOMICS = 1
  1205. const m___ARM_FEATURE_BTI = 1
  1206. const m___ARM_FEATURE_CLZ = 1
  1207. const m___ARM_FEATURE_COMPLEX = 1
  1208. const m___ARM_FEATURE_CRC32 = 1
  1209. const m___ARM_FEATURE_CRYPTO = 1
  1210. const m___ARM_FEATURE_DIRECTED_ROUNDING = 1
  1211. const m___ARM_FEATURE_DIV = 1
  1212. const m___ARM_FEATURE_DOTPROD = 1
  1213. const m___ARM_FEATURE_FMA = 1
  1214. const m___ARM_FEATURE_FP16_FML = 1
  1215. const m___ARM_FEATURE_FP16_SCALAR_ARITHMETIC = 1
  1216. const m___ARM_FEATURE_FP16_VECTOR_ARITHMETIC = 1
  1217. const m___ARM_FEATURE_FRINT = 1
  1218. const m___ARM_FEATURE_IDIV = 1
  1219. const m___ARM_FEATURE_JCVT = 1
  1220. const m___ARM_FEATURE_LDREX = 0xF
  1221. const m___ARM_FEATURE_NUMERIC_MAXMIN = 1
  1222. const m___ARM_FEATURE_PAUTH = 1
  1223. const m___ARM_FEATURE_QRDMX = 1
  1224. const m___ARM_FEATURE_RCPC = 1
  1225. const m___ARM_FEATURE_SHA2 = 1
  1226. const m___ARM_FEATURE_SHA3 = 1
  1227. const m___ARM_FEATURE_SHA512 = 1
  1228. const m___ARM_FEATURE_UNALIGNED = 1
  1229. const m___ARM_FP = 0xE
  1230. const m___ARM_FP16_ARGS = 1
  1231. const m___ARM_FP16_FORMAT_IEEE = 1
  1232. const m___ARM_NEON = 1
  1233. const m___ARM_NEON_FP = 0xE
  1234. const m___ARM_NEON__ = 1
  1235. const m___ARM_PCS_AAPCS64 = 1
  1236. const m___ARM_SIZEOF_MINIMAL_ENUM = 4
  1237. const m___ARM_SIZEOF_WCHAR_T = 4
  1238. const m___ARM_STATE_ZA = 1
  1239. const m___ARM_STATE_ZT0 = 1
  1240. const m___ATOMIC_ACQUIRE = 2
  1241. const m___ATOMIC_ACQ_REL = 4
  1242. const m___ATOMIC_CONSUME = 1
  1243. const m___ATOMIC_RELAXED = 0
  1244. const m___ATOMIC_RELEASE = 3
  1245. const m___ATOMIC_SEQ_CST = 5
  1246. const m___AVAILABILITY_FILE = "AvailabilityVersions.h"
  1247. const m___AVAILABILITY_VERSIONS_VERSION_HASH = 93585900
  1248. const m___AVAILABILITY_VERSIONS_VERSION_STRING = "Local"
  1249. const m___BIGGEST_ALIGNMENT__ = 8
  1250. const m___BITINT_MAXWIDTH__ = 128
  1251. const m___BLOCKS__ = 1
  1252. const m___BOOL_WIDTH__ = 8
  1253. const m___BRIDGEOS_2_0 = 20000
  1254. const m___BRIDGEOS_3_0 = 30000
  1255. const m___BRIDGEOS_3_1 = 30100
  1256. const m___BRIDGEOS_3_4 = 30400
  1257. const m___BRIDGEOS_4_0 = 40000
  1258. const m___BRIDGEOS_4_1 = 40100
  1259. const m___BRIDGEOS_5_0 = 50000
  1260. const m___BRIDGEOS_5_1 = 50100
  1261. const m___BRIDGEOS_5_3 = 50300
  1262. const m___BRIDGEOS_6_0 = 60000
  1263. const m___BRIDGEOS_6_2 = 60200
  1264. const m___BRIDGEOS_6_4 = 60400
  1265. const m___BRIDGEOS_6_5 = 60500
  1266. const m___BRIDGEOS_6_6 = 60600
  1267. const m___BRIDGEOS_7_0 = 70000
  1268. const m___BRIDGEOS_7_1 = 70100
  1269. const m___BRIDGEOS_7_2 = 70200
  1270. const m___BRIDGEOS_7_3 = 70300
  1271. const m___BRIDGEOS_7_4 = 70400
  1272. const m___BRIDGEOS_7_6 = 70600
  1273. const m___BRIDGEOS_8_0 = 80000
  1274. const m___BRIDGEOS_8_1 = 80100
  1275. const m___BRIDGEOS_8_2 = 80200
  1276. const m___BRIDGEOS_8_3 = 80300
  1277. const m___BRIDGEOS_8_4 = 80400
  1278. const m___BRIDGEOS_8_5 = 80500
  1279. const m___BRIDGEOS_8_6 = 80600
  1280. const m___BRIDGEOS_9_0 = 90000
  1281. const m___BRIDGEOS_9_1 = 90100
  1282. const m___BRIDGEOS_9_2 = 90200
  1283. const m___BRIDGEOS_9_3 = 90300
  1284. const m___BRIDGEOS_9_4 = 90400
  1285. const m___BYTE_ORDER__ = "__ORDER_LITTLE_ENDIAN__"
  1286. const m___CCGO__ = 1
  1287. const m___CHAR_BIT__ = 8
  1288. const m___CLANG_ATOMIC_BOOL_LOCK_FREE = 2
  1289. const m___CLANG_ATOMIC_CHAR16_T_LOCK_FREE = 2
  1290. const m___CLANG_ATOMIC_CHAR32_T_LOCK_FREE = 2
  1291. const m___CLANG_ATOMIC_CHAR_LOCK_FREE = 2
  1292. const m___CLANG_ATOMIC_INT_LOCK_FREE = 2
  1293. const m___CLANG_ATOMIC_LLONG_LOCK_FREE = 2
  1294. const m___CLANG_ATOMIC_LONG_LOCK_FREE = 2
  1295. const m___CLANG_ATOMIC_POINTER_LOCK_FREE = 2
  1296. const m___CLANG_ATOMIC_SHORT_LOCK_FREE = 2
  1297. const m___CLANG_ATOMIC_WCHAR_T_LOCK_FREE = 2
  1298. const m___CONSTANT_CFSTRINGS__ = 1
  1299. const m___DARWIN_64_BIT_INO_T = 1
  1300. const m___DARWIN_BIG_ENDIAN = 4321
  1301. const m___DARWIN_BYTE_ORDER = "__DARWIN_LITTLE_ENDIAN"
  1302. const m___DARWIN_C_ANSI = 010000
  1303. const m___DARWIN_C_FULL = 900000
  1304. const m___DARWIN_C_LEVEL = "__DARWIN_C_FULL"
  1305. const m___DARWIN_FD_SETSIZE = 1024
  1306. const m___DARWIN_LITTLE_ENDIAN = 1234
  1307. const m___DARWIN_NBBY = 8
  1308. const m___DARWIN_NON_CANCELABLE = 0
  1309. const m___DARWIN_NO_LONG_LONG = 0
  1310. const m___DARWIN_NSIG = 32
  1311. const m___DARWIN_ONLY_64_BIT_INO_T = 1
  1312. const m___DARWIN_ONLY_UNIX_CONFORMANCE = 1
  1313. const m___DARWIN_ONLY_VERS_1050 = 1
  1314. const m___DARWIN_OPAQUE_ARM_THREAD_STATE64 = 0
  1315. const m___DARWIN_PDP_ENDIAN = 3412
  1316. const m___DARWIN_SUF_EXTSN = "$DARWIN_EXTSN"
  1317. const m___DARWIN_UNIX03 = 1
  1318. const m___DARWIN_VERS_1050 = 1
  1319. const m___DARWIN_WCHAR_MAX = "__WCHAR_MAX__"
  1320. const m___DBL_DECIMAL_DIG__ = 17
  1321. const m___DBL_DENORM_MIN__ = 4.9406564584124654e-324
  1322. const m___DBL_DIG__ = 15
  1323. const m___DBL_EPSILON__ = 2.2204460492503131e-16
  1324. const m___DBL_HAS_DENORM__ = 1
  1325. const m___DBL_HAS_INFINITY__ = 1
  1326. const m___DBL_HAS_QUIET_NAN__ = 1
  1327. const m___DBL_MANT_DIG__ = 53
  1328. const m___DBL_MAX_10_EXP__ = 308
  1329. const m___DBL_MAX_EXP__ = 1024
  1330. const m___DBL_MAX__ = 1.7976931348623157e+308
  1331. const m___DBL_MIN__ = 2.2250738585072014e-308
  1332. const m___DBL_NORM_MAX__ = 1.7976931348623157e+308
  1333. const m___DECIMAL_DIG__ = "__LDBL_DECIMAL_DIG__"
  1334. const m___DRIVERKIT_19_0 = 190000
  1335. const m___DRIVERKIT_20_0 = 200000
  1336. const m___DRIVERKIT_21_0 = 210000
  1337. const m___DRIVERKIT_22_0 = 220000
  1338. const m___DRIVERKIT_22_4 = 220400
  1339. const m___DRIVERKIT_22_5 = 220500
  1340. const m___DRIVERKIT_22_6 = 220600
  1341. const m___DRIVERKIT_23_0 = 230000
  1342. const m___DRIVERKIT_23_1 = 230100
  1343. const m___DRIVERKIT_23_2 = 230200
  1344. const m___DRIVERKIT_23_3 = 230300
  1345. const m___DRIVERKIT_23_4 = 230400
  1346. const m___DRIVERKIT_23_5 = 230500
  1347. const m___DRIVERKIT_23_6 = 230600
  1348. const m___DRIVERKIT_24_0 = 240000
  1349. const m___DRIVERKIT_24_1 = 240100
  1350. const m___DRIVERKIT_24_2 = 240200
  1351. const m___DRIVERKIT_24_3 = 240300
  1352. const m___DRIVERKIT_24_4 = 240400
  1353. const m___DYNAMIC__ = 1
  1354. const m___ENABLE_LEGACY_MAC_AVAILABILITY = 1
  1355. const m___ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ = 150000
  1356. const m___ENVIRONMENT_OS_VERSION_MIN_REQUIRED__ = 150000
  1357. const m___FINITE_MATH_ONLY__ = 0
  1358. const m___FLT16_DECIMAL_DIG__ = 5
  1359. const m___FLT16_DENORM_MIN__ = 5.9604644775390625e-8
  1360. const m___FLT16_DIG__ = 3
  1361. const m___FLT16_EPSILON__ = 9.765625e-4
  1362. const m___FLT16_HAS_DENORM__ = 1
  1363. const m___FLT16_HAS_INFINITY__ = 1
  1364. const m___FLT16_HAS_QUIET_NAN__ = 1
  1365. const m___FLT16_MANT_DIG__ = 11
  1366. const m___FLT16_MAX_10_EXP__ = 4
  1367. const m___FLT16_MAX_EXP__ = 16
  1368. const m___FLT16_MAX__ = 6.5504e+4
  1369. const m___FLT16_MIN__ = 6.103515625e-5
  1370. const m___FLT16_NORM_MAX__ = 6.5504e+4
  1371. const m___FLT_DECIMAL_DIG__ = 9
  1372. const m___FLT_DENORM_MIN__ = 1.40129846e-45
  1373. const m___FLT_DIG__ = 6
  1374. const m___FLT_EPSILON__ = 1.19209290e-7
  1375. const m___FLT_HAS_DENORM__ = 1
  1376. const m___FLT_HAS_INFINITY__ = 1
  1377. const m___FLT_HAS_QUIET_NAN__ = 1
  1378. const m___FLT_MANT_DIG__ = 24
  1379. const m___FLT_MAX_10_EXP__ = 38
  1380. const m___FLT_MAX_EXP__ = 128
  1381. const m___FLT_MAX__ = 3.40282347e+38
  1382. const m___FLT_MIN__ = 1.17549435e-38
  1383. const m___FLT_NORM_MAX__ = 3.40282347e+38
  1384. const m___FLT_RADIX__ = 2
  1385. const m___FPCLASS_NEGINF = 0x0004
  1386. const m___FPCLASS_NEGNORMAL = 0x0008
  1387. const m___FPCLASS_NEGSUBNORMAL = 0x0010
  1388. const m___FPCLASS_NEGZERO = 0x0020
  1389. const m___FPCLASS_POSINF = 0x0200
  1390. const m___FPCLASS_POSNORMAL = 0x0100
  1391. const m___FPCLASS_POSSUBNORMAL = 0x0080
  1392. const m___FPCLASS_POSZERO = 0x0040
  1393. const m___FPCLASS_QNAN = 0x0002
  1394. const m___FPCLASS_SNAN = 0x0001
  1395. const m___FP_FAST_FMA = 1
  1396. const m___FP_FAST_FMAF = 1
  1397. const m___FUNCTION__ = "__func__"
  1398. const m___GCC_ASM_FLAG_OUTPUTS__ = 1
  1399. const m___GCC_ATOMIC_BOOL_LOCK_FREE = 2
  1400. const m___GCC_ATOMIC_CHAR16_T_LOCK_FREE = 2
  1401. const m___GCC_ATOMIC_CHAR32_T_LOCK_FREE = 2
  1402. const m___GCC_ATOMIC_CHAR_LOCK_FREE = 2
  1403. const m___GCC_ATOMIC_INT_LOCK_FREE = 2
  1404. const m___GCC_ATOMIC_LLONG_LOCK_FREE = 2
  1405. const m___GCC_ATOMIC_LONG_LOCK_FREE = 2
  1406. const m___GCC_ATOMIC_POINTER_LOCK_FREE = 2
  1407. const m___GCC_ATOMIC_SHORT_LOCK_FREE = 2
  1408. const m___GCC_ATOMIC_TEST_AND_SET_TRUEVAL = 1
  1409. const m___GCC_ATOMIC_WCHAR_T_LOCK_FREE = 2
  1410. const m___GCC_CONSTRUCTIVE_SIZE = 64
  1411. const m___GCC_DESTRUCTIVE_SIZE = 64
  1412. const m___GCC_HAVE_DWARF2_CFI_ASM = 1
  1413. const m___GCC_HAVE_SYNC_COMPARE_AND_SWAP_1 = 1
  1414. const m___GCC_HAVE_SYNC_COMPARE_AND_SWAP_16 = 1
  1415. const m___GCC_HAVE_SYNC_COMPARE_AND_SWAP_2 = 1
  1416. const m___GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 = 1
  1417. const m___GCC_HAVE_SYNC_COMPARE_AND_SWAP_8 = 1
  1418. const m___GNUC_MINOR__ = 2
  1419. const m___GNUC_PATCHLEVEL__ = 1
  1420. const m___GNUC_STDC_INLINE__ = 1
  1421. const m___GNUC__ = 4
  1422. const m___GXX_ABI_VERSION = 1002
  1423. const m___HAVE_FUNCTION_MULTI_VERSIONING = 1
  1424. const m___INT16_FMTd__ = "hd"
  1425. const m___INT16_FMTi__ = "hi"
  1426. const m___INT16_MAX__ = 32767
  1427. const m___INT16_TYPE__ = "short"
  1428. const m___INT32_FMTd__ = "d"
  1429. const m___INT32_FMTi__ = "i"
  1430. const m___INT32_MAX__ = 2147483647
  1431. const m___INT32_TYPE__ = "int"
  1432. const m___INT64_C_SUFFIX__ = "LL"
  1433. const m___INT64_FMTd__ = "lld"
  1434. const m___INT64_FMTi__ = "lli"
  1435. const m___INT64_MAX__ = 9223372036854775807
  1436. const m___INT8_FMTd__ = "hhd"
  1437. const m___INT8_FMTi__ = "hhi"
  1438. const m___INT8_MAX__ = 127
  1439. const m___INTMAX_C_SUFFIX__ = "L"
  1440. const m___INTMAX_FMTd__ = "ld"
  1441. const m___INTMAX_FMTi__ = "li"
  1442. const m___INTMAX_MAX__ = 9223372036854775807
  1443. const m___INTMAX_WIDTH__ = 64
  1444. const m___INTPTR_FMTd__ = "ld"
  1445. const m___INTPTR_FMTi__ = "li"
  1446. const m___INTPTR_MAX__ = 9223372036854775807
  1447. const m___INTPTR_WIDTH__ = 64
  1448. const m___INT_FAST16_FMTd__ = "hd"
  1449. const m___INT_FAST16_FMTi__ = "hi"
  1450. const m___INT_FAST16_MAX__ = 32767
  1451. const m___INT_FAST16_TYPE__ = "short"
  1452. const m___INT_FAST16_WIDTH__ = 16
  1453. const m___INT_FAST32_FMTd__ = "d"
  1454. const m___INT_FAST32_FMTi__ = "i"
  1455. const m___INT_FAST32_MAX__ = 2147483647
  1456. const m___INT_FAST32_TYPE__ = "int"
  1457. const m___INT_FAST32_WIDTH__ = 32
  1458. const m___INT_FAST64_FMTd__ = "lld"
  1459. const m___INT_FAST64_FMTi__ = "lli"
  1460. const m___INT_FAST64_MAX__ = 9223372036854775807
  1461. const m___INT_FAST64_WIDTH__ = 64
  1462. const m___INT_FAST8_FMTd__ = "hhd"
  1463. const m___INT_FAST8_FMTi__ = "hhi"
  1464. const m___INT_FAST8_MAX__ = 127
  1465. const m___INT_FAST8_WIDTH__ = 8
  1466. const m___INT_LEAST16_FMTd__ = "hd"
  1467. const m___INT_LEAST16_FMTi__ = "hi"
  1468. const m___INT_LEAST16_MAX__ = 32767
  1469. const m___INT_LEAST16_TYPE__ = "short"
  1470. const m___INT_LEAST16_WIDTH__ = 16
  1471. const m___INT_LEAST32_FMTd__ = "d"
  1472. const m___INT_LEAST32_FMTi__ = "i"
  1473. const m___INT_LEAST32_MAX__ = 2147483647
  1474. const m___INT_LEAST32_TYPE__ = "int"
  1475. const m___INT_LEAST32_WIDTH__ = 32
  1476. const m___INT_LEAST64_FMTd__ = "lld"
  1477. const m___INT_LEAST64_FMTi__ = "lli"
  1478. const m___INT_LEAST64_MAX = "INT64_MAX"
  1479. const m___INT_LEAST64_MAX__ = 9223372036854775807
  1480. const m___INT_LEAST64_MIN = "INT64_MIN"
  1481. const m___INT_LEAST64_WIDTH__ = 64
  1482. const m___INT_LEAST8_FMTd__ = "hhd"
  1483. const m___INT_LEAST8_FMTi__ = "hhi"
  1484. const m___INT_LEAST8_MAX__ = 127
  1485. const m___INT_LEAST8_WIDTH__ = 8
  1486. const m___INT_MAX__ = 2147483647
  1487. const m___INT_WIDTH__ = 32
  1488. const m___IPHONE_10_0 = 100000
  1489. const m___IPHONE_10_1 = 100100
  1490. const m___IPHONE_10_2 = 100200
  1491. const m___IPHONE_10_3 = 100300
  1492. const m___IPHONE_11_0 = 110000
  1493. const m___IPHONE_11_1 = 110100
  1494. const m___IPHONE_11_2 = 110200
  1495. const m___IPHONE_11_3 = 110300
  1496. const m___IPHONE_11_4 = 110400
  1497. const m___IPHONE_12_0 = 120000
  1498. const m___IPHONE_12_1 = 120100
  1499. const m___IPHONE_12_2 = 120200
  1500. const m___IPHONE_12_3 = 120300
  1501. const m___IPHONE_12_4 = 120400
  1502. const m___IPHONE_13_0 = 130000
  1503. const m___IPHONE_13_1 = 130100
  1504. const m___IPHONE_13_2 = 130200
  1505. const m___IPHONE_13_3 = 130300
  1506. const m___IPHONE_13_4 = 130400
  1507. const m___IPHONE_13_5 = 130500
  1508. const m___IPHONE_13_6 = 130600
  1509. const m___IPHONE_13_7 = 130700
  1510. const m___IPHONE_14_0 = 140000
  1511. const m___IPHONE_14_1 = 140100
  1512. const m___IPHONE_14_2 = 140200
  1513. const m___IPHONE_14_3 = 140300
  1514. const m___IPHONE_14_4 = 140400
  1515. const m___IPHONE_14_5 = 140500
  1516. const m___IPHONE_14_6 = 140600
  1517. const m___IPHONE_14_7 = 140700
  1518. const m___IPHONE_14_8 = 140800
  1519. const m___IPHONE_15_0 = 150000
  1520. const m___IPHONE_15_1 = 150100
  1521. const m___IPHONE_15_2 = 150200
  1522. const m___IPHONE_15_3 = 150300
  1523. const m___IPHONE_15_4 = 150400
  1524. const m___IPHONE_15_5 = 150500
  1525. const m___IPHONE_15_6 = 150600
  1526. const m___IPHONE_15_7 = 150700
  1527. const m___IPHONE_15_8 = 150800
  1528. const m___IPHONE_16_0 = 160000
  1529. const m___IPHONE_16_1 = 160100
  1530. const m___IPHONE_16_2 = 160200
  1531. const m___IPHONE_16_3 = 160300
  1532. const m___IPHONE_16_4 = 160400
  1533. const m___IPHONE_16_5 = 160500
  1534. const m___IPHONE_16_6 = 160600
  1535. const m___IPHONE_16_7 = 160700
  1536. const m___IPHONE_17_0 = 170000
  1537. const m___IPHONE_17_1 = 170100
  1538. const m___IPHONE_17_2 = 170200
  1539. const m___IPHONE_17_3 = 170300
  1540. const m___IPHONE_17_4 = 170400
  1541. const m___IPHONE_17_5 = 170500
  1542. const m___IPHONE_17_6 = 170600
  1543. const m___IPHONE_17_7 = 170700
  1544. const m___IPHONE_18_0 = 180000
  1545. const m___IPHONE_18_1 = 180100
  1546. const m___IPHONE_18_2 = 180200
  1547. const m___IPHONE_18_3 = 180300
  1548. const m___IPHONE_18_4 = 180400
  1549. const m___IPHONE_2_0 = 20000
  1550. const m___IPHONE_2_1 = 20100
  1551. const m___IPHONE_2_2 = 20200
  1552. const m___IPHONE_3_0 = 30000
  1553. const m___IPHONE_3_1 = 30100
  1554. const m___IPHONE_3_2 = 30200
  1555. const m___IPHONE_4_0 = 40000
  1556. const m___IPHONE_4_1 = 40100
  1557. const m___IPHONE_4_2 = 40200
  1558. const m___IPHONE_4_3 = 40300
  1559. const m___IPHONE_5_0 = 50000
  1560. const m___IPHONE_5_1 = 50100
  1561. const m___IPHONE_6_0 = 60000
  1562. const m___IPHONE_6_1 = 60100
  1563. const m___IPHONE_7_0 = 70000
  1564. const m___IPHONE_7_1 = 70100
  1565. const m___IPHONE_8_0 = 80000
  1566. const m___IPHONE_8_1 = 80100
  1567. const m___IPHONE_8_2 = 80200
  1568. const m___IPHONE_8_3 = 80300
  1569. const m___IPHONE_8_4 = 80400
  1570. const m___IPHONE_9_0 = 90000
  1571. const m___IPHONE_9_1 = 90100
  1572. const m___IPHONE_9_2 = 90200
  1573. const m___IPHONE_9_3 = 90300
  1574. const m___LDBL_DECIMAL_DIG__ = 17
  1575. const m___LDBL_DENORM_MIN__ = 4.9406564584124654e-324
  1576. const m___LDBL_DIG__ = 15
  1577. const m___LDBL_EPSILON__ = 2.2204460492503131e-16
  1578. const m___LDBL_HAS_DENORM__ = 1
  1579. const m___LDBL_HAS_INFINITY__ = 1
  1580. const m___LDBL_HAS_QUIET_NAN__ = 1
  1581. const m___LDBL_MANT_DIG__ = 53
  1582. const m___LDBL_MAX_10_EXP__ = 308
  1583. const m___LDBL_MAX_EXP__ = 1024
  1584. const m___LDBL_MAX__ = 1.7976931348623157e+308
  1585. const m___LDBL_MIN__ = 2.2250738585072014e-308
  1586. const m___LDBL_NORM_MAX__ = 1.7976931348623157e+308
  1587. const m___LITTLE_ENDIAN__ = 1
  1588. const m___LLONG_WIDTH__ = 64
  1589. const m___LONG_LONG_MAX__ = 9223372036854775807
  1590. const m___LONG_MAX__ = 9223372036854775807
  1591. const m___LONG_WIDTH__ = 64
  1592. const m___LP64_OFF64 = 1
  1593. const m___LP64__ = 1
  1594. const m___LPBIG_OFFBIG = 1
  1595. const m___MACH__ = 1
  1596. const m___MAC_10_0 = 1000
  1597. const m___MAC_10_1 = 1010
  1598. const m___MAC_10_10 = 101000
  1599. const m___MAC_10_10_2 = 101002
  1600. const m___MAC_10_10_3 = 101003
  1601. const m___MAC_10_11 = 101100
  1602. const m___MAC_10_11_2 = 101102
  1603. const m___MAC_10_11_3 = 101103
  1604. const m___MAC_10_11_4 = 101104
  1605. const m___MAC_10_12 = 101200
  1606. const m___MAC_10_12_1 = 101201
  1607. const m___MAC_10_12_2 = 101202
  1608. const m___MAC_10_12_4 = 101204
  1609. const m___MAC_10_13 = 101300
  1610. const m___MAC_10_13_1 = 101301
  1611. const m___MAC_10_13_2 = 101302
  1612. const m___MAC_10_13_4 = 101304
  1613. const m___MAC_10_14 = 101400
  1614. const m___MAC_10_14_1 = 101401
  1615. const m___MAC_10_14_4 = 101404
  1616. const m___MAC_10_14_5 = 101405
  1617. const m___MAC_10_14_6 = 101406
  1618. const m___MAC_10_15 = 101500
  1619. const m___MAC_10_15_1 = 101501
  1620. const m___MAC_10_15_4 = 101504
  1621. const m___MAC_10_16 = 101600
  1622. const m___MAC_10_2 = 1020
  1623. const m___MAC_10_3 = 1030
  1624. const m___MAC_10_4 = 1040
  1625. const m___MAC_10_5 = 1050
  1626. const m___MAC_10_6 = 1060
  1627. const m___MAC_10_7 = 1070
  1628. const m___MAC_10_8 = 1080
  1629. const m___MAC_10_9 = 1090
  1630. const m___MAC_11_0 = 110000
  1631. const m___MAC_11_1 = 110100
  1632. const m___MAC_11_3 = 110300
  1633. const m___MAC_11_4 = 110400
  1634. const m___MAC_11_5 = 110500
  1635. const m___MAC_11_6 = 110600
  1636. const m___MAC_12_0 = 120000
  1637. const m___MAC_12_1 = 120100
  1638. const m___MAC_12_2 = 120200
  1639. const m___MAC_12_3 = 120300
  1640. const m___MAC_12_4 = 120400
  1641. const m___MAC_12_5 = 120500
  1642. const m___MAC_12_6 = 120600
  1643. const m___MAC_12_7 = 120700
  1644. const m___MAC_13_0 = 130000
  1645. const m___MAC_13_1 = 130100
  1646. const m___MAC_13_2 = 130200
  1647. const m___MAC_13_3 = 130300
  1648. const m___MAC_13_4 = 130400
  1649. const m___MAC_13_5 = 130500
  1650. const m___MAC_13_6 = 130600
  1651. const m___MAC_13_7 = 130700
  1652. const m___MAC_14_0 = 140000
  1653. const m___MAC_14_1 = 140100
  1654. const m___MAC_14_2 = 140200
  1655. const m___MAC_14_3 = 140300
  1656. const m___MAC_14_4 = 140400
  1657. const m___MAC_14_5 = 140500
  1658. const m___MAC_14_6 = 140600
  1659. const m___MAC_14_7 = 140700
  1660. const m___MAC_15_0 = 150000
  1661. const m___MAC_15_1 = 150100
  1662. const m___MAC_15_2 = 150200
  1663. const m___MAC_15_3 = 150300
  1664. const m___MAC_15_4 = 150400
  1665. const m___MAC_OS_X_VERSION_MAX_ALLOWED = "__MAC_15_4"
  1666. const m___MAC_OS_X_VERSION_MIN_REQUIRED = "__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__"
  1667. const m___MEMORY_SCOPE_DEVICE = 1
  1668. const m___MEMORY_SCOPE_SINGLE = 4
  1669. const m___MEMORY_SCOPE_SYSTEM = 0
  1670. const m___MEMORY_SCOPE_WRKGRP = 2
  1671. const m___MEMORY_SCOPE_WVFRNT = 3
  1672. const m___NO_INLINE__ = 1
  1673. const m___NO_MATH_ERRNO__ = 1
  1674. const m___OBJC_BOOL_IS_BOOL = 1
  1675. const m___OPENCL_MEMORY_SCOPE_ALL_SVM_DEVICES = 3
  1676. const m___OPENCL_MEMORY_SCOPE_DEVICE = 2
  1677. const m___OPENCL_MEMORY_SCOPE_SUB_GROUP = 4
  1678. const m___OPENCL_MEMORY_SCOPE_WORK_GROUP = 1
  1679. const m___OPENCL_MEMORY_SCOPE_WORK_ITEM = 0
  1680. const m___ORDER_BIG_ENDIAN__ = 4321
  1681. const m___ORDER_LITTLE_ENDIAN__ = 1234
  1682. const m___ORDER_PDP_ENDIAN__ = 3412
  1683. const m___PIC__ = 2
  1684. const m___POINTER_WIDTH__ = 64
  1685. const m___PRAGMA_REDEFINE_EXTNAME = 1
  1686. const m___PRETTY_FUNCTION__ = "__func__"
  1687. const m___PTHREAD_ATTR_SIZE__ = 56
  1688. const m___PTHREAD_CONDATTR_SIZE__ = 8
  1689. const m___PTHREAD_COND_SIZE__ = 40
  1690. const m___PTHREAD_MUTEXATTR_SIZE__ = 8
  1691. const m___PTHREAD_MUTEX_SIZE__ = 56
  1692. const m___PTHREAD_ONCE_SIZE__ = 8
  1693. const m___PTHREAD_RWLOCKATTR_SIZE__ = 16
  1694. const m___PTHREAD_RWLOCK_SIZE__ = 192
  1695. const m___PTHREAD_SIZE__ = 8176
  1696. const m___PTRDIFF_FMTd__ = "ld"
  1697. const m___PTRDIFF_FMTi__ = "li"
  1698. const m___PTRDIFF_MAX__ = 9223372036854775807
  1699. const m___PTRDIFF_WIDTH__ = 64
  1700. const m___SALC = 0x4000
  1701. const m___SAPP = 0x0100
  1702. const m___SCHAR_MAX__ = 127
  1703. const m___SEOF = 0x0020
  1704. const m___SERR = 0x0040
  1705. const m___SHRT_MAX__ = 32767
  1706. const m___SHRT_WIDTH__ = 16
  1707. const m___SIGN = 0x8000
  1708. const m___SIG_ATOMIC_MAX__ = 2147483647
  1709. const m___SIG_ATOMIC_WIDTH__ = 32
  1710. const m___SIZEOF_DOUBLE__ = 8
  1711. const m___SIZEOF_FLOAT__ = 4
  1712. const m___SIZEOF_INT128__ = 16
  1713. const m___SIZEOF_INT__ = 4
  1714. const m___SIZEOF_LONG_DOUBLE__ = 8
  1715. const m___SIZEOF_LONG_LONG__ = 8
  1716. const m___SIZEOF_LONG__ = 8
  1717. const m___SIZEOF_POINTER__ = 8
  1718. const m___SIZEOF_PTRDIFF_T__ = 8
  1719. const m___SIZEOF_SHORT__ = 2
  1720. const m___SIZEOF_SIZE_T__ = 8
  1721. const m___SIZEOF_WCHAR_T__ = 4
  1722. const m___SIZEOF_WINT_T__ = 4
  1723. const m___SIZE_FMTX__ = "lX"
  1724. const m___SIZE_FMTo__ = "lo"
  1725. const m___SIZE_FMTu__ = "lu"
  1726. const m___SIZE_FMTx__ = "lx"
  1727. const m___SIZE_MAX__ = 18446744073709551615
  1728. const m___SIZE_WIDTH__ = 64
  1729. const m___SLBF = 0x0001
  1730. const m___SMBF = 0x0080
  1731. const m___SMOD = 0x2000
  1732. const m___SNBF = 0x0002
  1733. const m___SNPT = 0x0800
  1734. const m___SOFF = 0x1000
  1735. const m___SOPT = 0x0400
  1736. const m___SRD = 0x0004
  1737. const m___SRW = 0x0010
  1738. const m___SSP__ = 1
  1739. const m___SSTR = 0x0200
  1740. const m___STDC_EMBED_EMPTY__ = 2
  1741. const m___STDC_EMBED_FOUND__ = 1
  1742. const m___STDC_EMBED_NOT_FOUND__ = 0
  1743. const m___STDC_HOSTED__ = 1
  1744. const m___STDC_NO_THREADS__ = 1
  1745. const m___STDC_UTF_16__ = 1
  1746. const m___STDC_UTF_32__ = 1
  1747. const m___STDC_VERSION__ = 201710
  1748. const m___STDC_WANT_LIB_EXT1__ = 1
  1749. const m___STDC__ = 1
  1750. const m___SWR = 0x0008
  1751. const m___TVOS_10_0 = 100000
  1752. const m___TVOS_10_0_1 = 100001
  1753. const m___TVOS_10_1 = 100100
  1754. const m___TVOS_10_2 = 100200
  1755. const m___TVOS_11_0 = 110000
  1756. const m___TVOS_11_1 = 110100
  1757. const m___TVOS_11_2 = 110200
  1758. const m___TVOS_11_3 = 110300
  1759. const m___TVOS_11_4 = 110400
  1760. const m___TVOS_12_0 = 120000
  1761. const m___TVOS_12_1 = 120100
  1762. const m___TVOS_12_2 = 120200
  1763. const m___TVOS_12_3 = 120300
  1764. const m___TVOS_12_4 = 120400
  1765. const m___TVOS_13_0 = 130000
  1766. const m___TVOS_13_2 = 130200
  1767. const m___TVOS_13_3 = 130300
  1768. const m___TVOS_13_4 = 130400
  1769. const m___TVOS_14_0 = 140000
  1770. const m___TVOS_14_1 = 140100
  1771. const m___TVOS_14_2 = 140200
  1772. const m___TVOS_14_3 = 140300
  1773. const m___TVOS_14_5 = 140500
  1774. const m___TVOS_14_6 = 140600
  1775. const m___TVOS_14_7 = 140700
  1776. const m___TVOS_15_0 = 150000
  1777. const m___TVOS_15_1 = 150100
  1778. const m___TVOS_15_2 = 150200
  1779. const m___TVOS_15_3 = 150300
  1780. const m___TVOS_15_4 = 150400
  1781. const m___TVOS_15_5 = 150500
  1782. const m___TVOS_15_6 = 150600
  1783. const m___TVOS_16_0 = 160000
  1784. const m___TVOS_16_1 = 160100
  1785. const m___TVOS_16_2 = 160200
  1786. const m___TVOS_16_3 = 160300
  1787. const m___TVOS_16_4 = 160400
  1788. const m___TVOS_16_5 = 160500
  1789. const m___TVOS_16_6 = 160600
  1790. const m___TVOS_17_0 = 170000
  1791. const m___TVOS_17_1 = 170100
  1792. const m___TVOS_17_2 = 170200
  1793. const m___TVOS_17_3 = 170300
  1794. const m___TVOS_17_4 = 170400
  1795. const m___TVOS_17_5 = 170500
  1796. const m___TVOS_17_6 = 170600
  1797. const m___TVOS_18_0 = 180000
  1798. const m___TVOS_18_1 = 180100
  1799. const m___TVOS_18_2 = 180200
  1800. const m___TVOS_18_3 = 180300
  1801. const m___TVOS_18_4 = 180400
  1802. const m___TVOS_9_0 = 90000
  1803. const m___TVOS_9_1 = 90100
  1804. const m___TVOS_9_2 = 90200
  1805. const m___UINT16_FMTX__ = "hX"
  1806. const m___UINT16_FMTo__ = "ho"
  1807. const m___UINT16_FMTu__ = "hu"
  1808. const m___UINT16_FMTx__ = "hx"
  1809. const m___UINT16_MAX__ = 65535
  1810. const m___UINT32_C_SUFFIX__ = "U"
  1811. const m___UINT32_FMTX__ = "X"
  1812. const m___UINT32_FMTo__ = "o"
  1813. const m___UINT32_FMTu__ = "u"
  1814. const m___UINT32_FMTx__ = "x"
  1815. const m___UINT32_MAX__ = 4294967295
  1816. const m___UINT64_C_SUFFIX__ = "ULL"
  1817. const m___UINT64_FMTX__ = "llX"
  1818. const m___UINT64_FMTo__ = "llo"
  1819. const m___UINT64_FMTu__ = "llu"
  1820. const m___UINT64_FMTx__ = "llx"
  1821. const m___UINT64_MAX__ = "18446744073709551615U"
  1822. const m___UINT8_FMTX__ = "hhX"
  1823. const m___UINT8_FMTo__ = "hho"
  1824. const m___UINT8_FMTu__ = "hhu"
  1825. const m___UINT8_FMTx__ = "hhx"
  1826. const m___UINT8_MAX__ = 255
  1827. const m___UINTMAX_C_SUFFIX__ = "UL"
  1828. const m___UINTMAX_FMTX__ = "lX"
  1829. const m___UINTMAX_FMTo__ = "lo"
  1830. const m___UINTMAX_FMTu__ = "lu"
  1831. const m___UINTMAX_FMTx__ = "lx"
  1832. const m___UINTMAX_MAX__ = 18446744073709551615
  1833. const m___UINTMAX_WIDTH__ = 64
  1834. const m___UINTPTR_FMTX__ = "lX"
  1835. const m___UINTPTR_FMTo__ = "lo"
  1836. const m___UINTPTR_FMTu__ = "lu"
  1837. const m___UINTPTR_FMTx__ = "lx"
  1838. const m___UINTPTR_MAX__ = 18446744073709551615
  1839. const m___UINTPTR_WIDTH__ = 64
  1840. const m___UINT_FAST16_FMTX__ = "hX"
  1841. const m___UINT_FAST16_FMTo__ = "ho"
  1842. const m___UINT_FAST16_FMTu__ = "hu"
  1843. const m___UINT_FAST16_FMTx__ = "hx"
  1844. const m___UINT_FAST16_MAX__ = 65535
  1845. const m___UINT_FAST32_FMTX__ = "X"
  1846. const m___UINT_FAST32_FMTo__ = "o"
  1847. const m___UINT_FAST32_FMTu__ = "u"
  1848. const m___UINT_FAST32_FMTx__ = "x"
  1849. const m___UINT_FAST32_MAX__ = 4294967295
  1850. const m___UINT_FAST64_FMTX__ = "llX"
  1851. const m___UINT_FAST64_FMTo__ = "llo"
  1852. const m___UINT_FAST64_FMTu__ = "llu"
  1853. const m___UINT_FAST64_FMTx__ = "llx"
  1854. const m___UINT_FAST64_MAX__ = "18446744073709551615U"
  1855. const m___UINT_FAST8_FMTX__ = "hhX"
  1856. const m___UINT_FAST8_FMTo__ = "hho"
  1857. const m___UINT_FAST8_FMTu__ = "hhu"
  1858. const m___UINT_FAST8_FMTx__ = "hhx"
  1859. const m___UINT_FAST8_MAX__ = 255
  1860. const m___UINT_LEAST16_FMTX__ = "hX"
  1861. const m___UINT_LEAST16_FMTo__ = "ho"
  1862. const m___UINT_LEAST16_FMTu__ = "hu"
  1863. const m___UINT_LEAST16_FMTx__ = "hx"
  1864. const m___UINT_LEAST16_MAX__ = 65535
  1865. const m___UINT_LEAST32_FMTX__ = "X"
  1866. const m___UINT_LEAST32_FMTo__ = "o"
  1867. const m___UINT_LEAST32_FMTu__ = "u"
  1868. const m___UINT_LEAST32_FMTx__ = "x"
  1869. const m___UINT_LEAST32_MAX__ = 4294967295
  1870. const m___UINT_LEAST64_FMTX__ = "llX"
  1871. const m___UINT_LEAST64_FMTo__ = "llo"
  1872. const m___UINT_LEAST64_FMTu__ = "llu"
  1873. const m___UINT_LEAST64_FMTx__ = "llx"
  1874. const m___UINT_LEAST64_MAX = "UINT64_MAX"
  1875. const m___UINT_LEAST64_MAX__ = "18446744073709551615U"
  1876. const m___UINT_LEAST8_FMTX__ = "hhX"
  1877. const m___UINT_LEAST8_FMTo__ = "hho"
  1878. const m___UINT_LEAST8_FMTu__ = "hhu"
  1879. const m___UINT_LEAST8_FMTx__ = "hhx"
  1880. const m___UINT_LEAST8_MAX__ = 255
  1881. const m___USER_LABEL_PREFIX__ = "_"
  1882. const m___VERSION__ = "Apple LLVM 17.0.0 (clang-1700.0.13.3)"
  1883. const m___VISIONOS_1_0 = 10000
  1884. const m___VISIONOS_1_1 = 10100
  1885. const m___VISIONOS_1_2 = 10200
  1886. const m___VISIONOS_1_3 = 10300
  1887. const m___VISIONOS_2_0 = 20000
  1888. const m___VISIONOS_2_1 = 20100
  1889. const m___VISIONOS_2_2 = 20200
  1890. const m___VISIONOS_2_3 = 20300
  1891. const m___VISIONOS_2_4 = 20400
  1892. const m___WATCHOS_10_0 = 100000
  1893. const m___WATCHOS_10_1 = 100100
  1894. const m___WATCHOS_10_2 = 100200
  1895. const m___WATCHOS_10_3 = 100300
  1896. const m___WATCHOS_10_4 = 100400
  1897. const m___WATCHOS_10_5 = 100500
  1898. const m___WATCHOS_10_6 = 100600
  1899. const m___WATCHOS_10_7 = 100700
  1900. const m___WATCHOS_11_0 = 110000
  1901. const m___WATCHOS_11_1 = 110100
  1902. const m___WATCHOS_11_2 = 110200
  1903. const m___WATCHOS_11_3 = 110300
  1904. const m___WATCHOS_11_4 = 110400
  1905. const m___WATCHOS_1_0 = 10000
  1906. const m___WATCHOS_2_0 = 20000
  1907. const m___WATCHOS_2_1 = 20100
  1908. const m___WATCHOS_2_2 = 20200
  1909. const m___WATCHOS_3_0 = 30000
  1910. const m___WATCHOS_3_1 = 30100
  1911. const m___WATCHOS_3_1_1 = 30101
  1912. const m___WATCHOS_3_2 = 30200
  1913. const m___WATCHOS_4_0 = 40000
  1914. const m___WATCHOS_4_1 = 40100
  1915. const m___WATCHOS_4_2 = 40200
  1916. const m___WATCHOS_4_3 = 40300
  1917. const m___WATCHOS_5_0 = 50000
  1918. const m___WATCHOS_5_1 = 50100
  1919. const m___WATCHOS_5_2 = 50200
  1920. const m___WATCHOS_5_3 = 50300
  1921. const m___WATCHOS_6_0 = 60000
  1922. const m___WATCHOS_6_1 = 60100
  1923. const m___WATCHOS_6_2 = 60200
  1924. const m___WATCHOS_7_0 = 70000
  1925. const m___WATCHOS_7_1 = 70100
  1926. const m___WATCHOS_7_2 = 70200
  1927. const m___WATCHOS_7_3 = 70300
  1928. const m___WATCHOS_7_4 = 70400
  1929. const m___WATCHOS_7_5 = 70500
  1930. const m___WATCHOS_7_6 = 70600
  1931. const m___WATCHOS_8_0 = 80000
  1932. const m___WATCHOS_8_1 = 80100
  1933. const m___WATCHOS_8_3 = 80300
  1934. const m___WATCHOS_8_4 = 80400
  1935. const m___WATCHOS_8_5 = 80500
  1936. const m___WATCHOS_8_6 = 80600
  1937. const m___WATCHOS_8_7 = 80700
  1938. const m___WATCHOS_8_8 = 80800
  1939. const m___WATCHOS_9_0 = 90000
  1940. const m___WATCHOS_9_1 = 90100
  1941. const m___WATCHOS_9_2 = 90200
  1942. const m___WATCHOS_9_3 = 90300
  1943. const m___WATCHOS_9_4 = 90400
  1944. const m___WATCHOS_9_5 = 90500
  1945. const m___WATCHOS_9_6 = 90600
  1946. const m___WCHAR_MAX__ = 2147483647
  1947. const m___WCHAR_TYPE__ = "int"
  1948. const m___WCHAR_WIDTH__ = 32
  1949. const m___WINT_MAX__ = 2147483647
  1950. const m___WINT_TYPE__ = "int"
  1951. const m___WINT_WIDTH__ = 32
  1952. const m___aarch64__ = 1
  1953. const m___apple_build_version__ = 17000013
  1954. const m___arm64 = 1
  1955. const m___arm64__ = 1
  1956. const m___clang__ = 1
  1957. const m___clang_literal_encoding__ = "UTF-8"
  1958. const m___clang_major__ = 17
  1959. const m___clang_minor__ = 0
  1960. const m___clang_patchlevel__ = 0
  1961. const m___clang_version__ = "17.0.0 (clang-1700.0.13.3)"
  1962. const m___clang_wide_literal_encoding__ = "UTF-32"
  1963. const m___const = "const"
  1964. const m___has_bounds_safety_attributes = 0
  1965. const m___has_ptrcheck = 0
  1966. const m___has_safe_buffers = 0
  1967. const m___header_inline = "inline"
  1968. const m___llvm__ = 1
  1969. const m___nonnull = "_Nonnull"
  1970. const m___null_unspecified = "_Null_unspecified"
  1971. const m___nullable = "_Nullable"
  1972. const m___pic__ = 2
  1973. const m___restrict = "restrict"
  1974. const m___restrict_arr = "restrict"
  1975. const m___signed = "signed"
  1976. const m___volatile = "volatile"
  1977. const m_inline = "__inline"
  1978. const m_ru_first = "ru_ixrss"
  1979. const m_ru_last = "ru_nivcsw"
  1980. const m_static_assert = "_Static_assert"
  1981. const m_stderr = "__stderrp"
  1982. const m_stdin = "__stdinp"
  1983. const m_stdout = "__stdoutp"
  1984. const m_sv_onstack = "sv_flags"
  1985. type t__builtin_va_list = uintptr
  1986. type t__predefined_size_t = uint64
  1987. type t__predefined_wchar_t = int32
  1988. type t__predefined_ptrdiff_t = int64
  1989. type Tptrdiff_t = int64
  1990. type Tsize_t = uint64
  1991. type Twchar_t = int32
  1992. type Tmax_align_t = float64
  1993. type t__int8_t = int8
  1994. type t__uint8_t = uint8
  1995. type t__int16_t = int16
  1996. type t__uint16_t = uint16
  1997. type t__int32_t = int32
  1998. type t__uint32_t = uint32
  1999. type t__int64_t = int64
  2000. type t__uint64_t = uint64
  2001. type t__darwin_intptr_t = int64
  2002. type t__darwin_natural_t = uint32
  2003. type t__darwin_ct_rune_t = int32
  2004. type t__mbstate_t = struct {
  2005. F_mbstateL [0]int64
  2006. F__mbstate8 [128]int8
  2007. }
  2008. type t__darwin_mbstate_t = struct {
  2009. F_mbstateL [0]int64
  2010. F__mbstate8 [128]int8
  2011. }
  2012. type t__darwin_ptrdiff_t = int64
  2013. type t__darwin_size_t = uint64
  2014. type t__darwin_va_list = uintptr
  2015. type t__darwin_wchar_t = int32
  2016. type t__darwin_rune_t = int32
  2017. type t__darwin_wint_t = int32
  2018. type t__darwin_clock_t = uint64
  2019. type t__darwin_socklen_t = uint32
  2020. type t__darwin_ssize_t = int64
  2021. type t__darwin_time_t = int64
  2022. type t__darwin_blkcnt_t = int64
  2023. type t__darwin_blksize_t = int32
  2024. type t__darwin_dev_t = int32
  2025. type t__darwin_fsblkcnt_t = uint32
  2026. type t__darwin_fsfilcnt_t = uint32
  2027. type t__darwin_gid_t = uint32
  2028. type t__darwin_id_t = uint32
  2029. type t__darwin_ino64_t = uint64
  2030. type t__darwin_ino_t = uint64
  2031. type t__darwin_mach_port_name_t = uint32
  2032. type t__darwin_mach_port_t = uint32
  2033. type t__darwin_mode_t = uint16
  2034. type t__darwin_off_t = int64
  2035. type t__darwin_pid_t = int32
  2036. type t__darwin_sigset_t = uint32
  2037. type t__darwin_suseconds_t = int32
  2038. type t__darwin_uid_t = uint32
  2039. type t__darwin_useconds_t = uint32
  2040. type t__darwin_uuid_t = [16]uint8
  2041. type t__darwin_uuid_string_t = [37]int8
  2042. type t__darwin_pthread_handler_rec = struct {
  2043. F__routine uintptr
  2044. F__arg uintptr
  2045. F__next uintptr
  2046. }
  2047. type T_opaque_pthread_attr_t = struct {
  2048. F__sig int64
  2049. F__opaque [56]int8
  2050. }
  2051. type T_opaque_pthread_cond_t = struct {
  2052. F__sig int64
  2053. F__opaque [40]int8
  2054. }
  2055. type T_opaque_pthread_condattr_t = struct {
  2056. F__sig int64
  2057. F__opaque [8]int8
  2058. }
  2059. type T_opaque_pthread_mutex_t = struct {
  2060. F__sig int64
  2061. F__opaque [56]int8
  2062. }
  2063. type T_opaque_pthread_mutexattr_t = struct {
  2064. F__sig int64
  2065. F__opaque [8]int8
  2066. }
  2067. type T_opaque_pthread_once_t = struct {
  2068. F__sig int64
  2069. F__opaque [8]int8
  2070. }
  2071. type T_opaque_pthread_rwlock_t = struct {
  2072. F__sig int64
  2073. F__opaque [192]int8
  2074. }
  2075. type T_opaque_pthread_rwlockattr_t = struct {
  2076. F__sig int64
  2077. F__opaque [16]int8
  2078. }
  2079. type T_opaque_pthread_t = struct {
  2080. F__sig int64
  2081. F__cleanup_stack uintptr
  2082. F__opaque [8176]int8
  2083. }
  2084. type t__darwin_pthread_attr_t = struct {
  2085. F__sig int64
  2086. F__opaque [56]int8
  2087. }
  2088. type t__darwin_pthread_cond_t = struct {
  2089. F__sig int64
  2090. F__opaque [40]int8
  2091. }
  2092. type t__darwin_pthread_condattr_t = struct {
  2093. F__sig int64
  2094. F__opaque [8]int8
  2095. }
  2096. type t__darwin_pthread_key_t = uint64
  2097. type t__darwin_pthread_mutex_t = struct {
  2098. F__sig int64
  2099. F__opaque [56]int8
  2100. }
  2101. type t__darwin_pthread_mutexattr_t = struct {
  2102. F__sig int64
  2103. F__opaque [8]int8
  2104. }
  2105. type t__darwin_pthread_once_t = struct {
  2106. F__sig int64
  2107. F__opaque [8]int8
  2108. }
  2109. type t__darwin_pthread_rwlock_t = struct {
  2110. F__sig int64
  2111. F__opaque [192]int8
  2112. }
  2113. type t__darwin_pthread_rwlockattr_t = struct {
  2114. F__sig int64
  2115. F__opaque [16]int8
  2116. }
  2117. type t__darwin_pthread_t = uintptr
  2118. type t__darwin_nl_item = int32
  2119. type t__darwin_wctrans_t = int32
  2120. type t__darwin_wctype_t = uint32
  2121. type Tint8_t = int8
  2122. type Tint16_t = int16
  2123. type Tint32_t = int32
  2124. type Tint64_t = int64
  2125. type Tu_int8_t = uint8
  2126. type Tu_int16_t = uint16
  2127. type Tu_int32_t = uint32
  2128. type Tu_int64_t = uint64
  2129. type Tregister_t = int64
  2130. type Tintptr_t = int64
  2131. type Tuintptr_t = uint64
  2132. type Tuser_addr_t = uint64
  2133. type Tuser_size_t = uint64
  2134. type Tuser_ssize_t = int64
  2135. type Tuser_long_t = int64
  2136. type Tuser_ulong_t = uint64
  2137. type Tuser_time_t = int64
  2138. type Tuser_off_t = int64
  2139. type Tsyscall_arg_t = uint64
  2140. type Trsize_t = uint64
  2141. type Terrno_t = int32
  2142. type Tssize_t = int64
  2143. type Tva_list = uintptr
  2144. type Tfpos_t = int64
  2145. type t__sbuf = struct {
  2146. F_base uintptr
  2147. F_size int32
  2148. }
  2149. type TFILE = struct {
  2150. F_p uintptr
  2151. F_r int32
  2152. F_w int32
  2153. F_flags int16
  2154. F_file int16
  2155. F_bf t__sbuf
  2156. F_lbfsize int32
  2157. F_cookie uintptr
  2158. F_close uintptr
  2159. F_read uintptr
  2160. F_seek uintptr
  2161. F_write uintptr
  2162. F_ub t__sbuf
  2163. F_extra uintptr
  2164. F_ur int32
  2165. F_ubuf [3]uint8
  2166. F_nbuf [1]uint8
  2167. F_lb t__sbuf
  2168. F_blksize int32
  2169. F_offset Tfpos_t
  2170. }
  2171. type t__sFILE = TFILE
  2172. type Toff_t = int64
  2173. type Tidtype_t = int32
  2174. const _P_ALL = 0
  2175. const _P_PID = 1
  2176. const _P_PGID = 2
  2177. type Tpid_t = int32
  2178. type Tid_t = uint32
  2179. type Tsig_atomic_t = int32
  2180. type t__darwin_arm_exception_state = struct {
  2181. F__exception t__uint32_t
  2182. F__fsr t__uint32_t
  2183. F__far t__uint32_t
  2184. }
  2185. type t__darwin_arm_exception_state64 = struct {
  2186. F__far t__uint64_t
  2187. F__esr t__uint32_t
  2188. F__exception t__uint32_t
  2189. }
  2190. type t__darwin_arm_exception_state64_v2 = struct {
  2191. F__far t__uint64_t
  2192. F__esr t__uint64_t
  2193. }
  2194. type t__darwin_arm_thread_state = struct {
  2195. F__r [13]t__uint32_t
  2196. F__sp t__uint32_t
  2197. F__lr t__uint32_t
  2198. F__pc t__uint32_t
  2199. F__cpsr t__uint32_t
  2200. }
  2201. type t__darwin_arm_thread_state64 = struct {
  2202. F__x [29]t__uint64_t
  2203. F__fp t__uint64_t
  2204. F__lr t__uint64_t
  2205. F__sp t__uint64_t
  2206. F__pc t__uint64_t
  2207. F__cpsr t__uint32_t
  2208. F__pad t__uint32_t
  2209. }
  2210. type t__darwin_arm_vfp_state = struct {
  2211. F__r [64]t__uint32_t
  2212. F__fpscr t__uint32_t
  2213. }
  2214. type t__darwin_arm_neon_state64 = struct {
  2215. F__ccgo_align [0]uint64
  2216. F__v [32][2]uint64
  2217. F__fpsr t__uint32_t
  2218. F__fpcr t__uint32_t
  2219. F__ccgo_pad3 [8]byte
  2220. }
  2221. type t__darwin_arm_neon_state = struct {
  2222. F__ccgo_align [0]uint64
  2223. F__v [16][2]uint64
  2224. F__fpsr t__uint32_t
  2225. F__fpcr t__uint32_t
  2226. F__ccgo_pad3 [8]byte
  2227. }
  2228. type t__arm_pagein_state = struct {
  2229. F__pagein_error int32
  2230. }
  2231. type t__darwin_arm_sme_state = struct {
  2232. F__svcr t__uint64_t
  2233. F__tpidr2_el0 t__uint64_t
  2234. F__svl_b t__uint16_t
  2235. }
  2236. type t__darwin_arm_sve_z_state = struct {
  2237. F__ccgo_align [0]uint32
  2238. F__z [16][256]int8
  2239. }
  2240. type t__darwin_arm_sve_p_state = struct {
  2241. F__ccgo_align [0]uint32
  2242. F__p [16][32]int8
  2243. }
  2244. type t__darwin_arm_sme_za_state = struct {
  2245. F__ccgo_align [0]uint32
  2246. F__za [4096]int8
  2247. }
  2248. type t__darwin_arm_sme2_state = struct {
  2249. F__ccgo_align [0]uint32
  2250. F__zt0 [64]int8
  2251. }
  2252. type t__arm_legacy_debug_state = struct {
  2253. F__bvr [16]t__uint32_t
  2254. F__bcr [16]t__uint32_t
  2255. F__wvr [16]t__uint32_t
  2256. F__wcr [16]t__uint32_t
  2257. }
  2258. type t__darwin_arm_debug_state32 = struct {
  2259. F__bvr [16]t__uint32_t
  2260. F__bcr [16]t__uint32_t
  2261. F__wvr [16]t__uint32_t
  2262. F__wcr [16]t__uint32_t
  2263. F__mdscr_el1 t__uint64_t
  2264. }
  2265. type t__darwin_arm_debug_state64 = struct {
  2266. F__bvr [16]t__uint64_t
  2267. F__bcr [16]t__uint64_t
  2268. F__wvr [16]t__uint64_t
  2269. F__wcr [16]t__uint64_t
  2270. F__mdscr_el1 t__uint64_t
  2271. }
  2272. type t__darwin_arm_cpmu_state64 = struct {
  2273. F__ctrs [16]t__uint64_t
  2274. }
  2275. type t__darwin_mcontext32 = struct {
  2276. F__es t__darwin_arm_exception_state
  2277. F__ss t__darwin_arm_thread_state
  2278. F__fs t__darwin_arm_vfp_state
  2279. }
  2280. type t__darwin_mcontext64 = struct {
  2281. F__ccgo_align [0]uint64
  2282. F__es t__darwin_arm_exception_state64
  2283. F__ss t__darwin_arm_thread_state64
  2284. F__ns t__darwin_arm_neon_state64
  2285. }
  2286. type Tmcontext_t = uintptr
  2287. type Tpthread_attr_t = struct {
  2288. F__sig int64
  2289. F__opaque [56]int8
  2290. }
  2291. type t__darwin_sigaltstack = struct {
  2292. Fss_sp uintptr
  2293. Fss_size t__darwin_size_t
  2294. Fss_flags int32
  2295. }
  2296. type Tstack_t = struct {
  2297. Fss_sp uintptr
  2298. Fss_size t__darwin_size_t
  2299. Fss_flags int32
  2300. }
  2301. type t__darwin_ucontext = struct {
  2302. Fuc_onstack int32
  2303. Fuc_sigmask t__darwin_sigset_t
  2304. Fuc_stack t__darwin_sigaltstack
  2305. Fuc_link uintptr
  2306. Fuc_mcsize t__darwin_size_t
  2307. Fuc_mcontext uintptr
  2308. }
  2309. type Tucontext_t = struct {
  2310. Fuc_onstack int32
  2311. Fuc_sigmask t__darwin_sigset_t
  2312. Fuc_stack t__darwin_sigaltstack
  2313. Fuc_link uintptr
  2314. Fuc_mcsize t__darwin_size_t
  2315. Fuc_mcontext uintptr
  2316. }
  2317. type Tsigset_t = uint32
  2318. type Tuid_t = uint32
  2319. type Tsigval = struct {
  2320. Fsival_ptr [0]uintptr
  2321. Fsival_int int32
  2322. F__ccgo_pad2 [4]byte
  2323. }
  2324. type Tsigevent = struct {
  2325. Fsigev_notify int32
  2326. Fsigev_signo int32
  2327. Fsigev_value Tsigval
  2328. Fsigev_notify_function uintptr
  2329. Fsigev_notify_attributes uintptr
  2330. }
  2331. type Tsiginfo_t = struct {
  2332. Fsi_signo int32
  2333. Fsi_errno int32
  2334. Fsi_code int32
  2335. Fsi_pid Tpid_t
  2336. Fsi_uid Tuid_t
  2337. Fsi_status int32
  2338. Fsi_addr uintptr
  2339. Fsi_value Tsigval
  2340. Fsi_band int64
  2341. F__pad [7]uint64
  2342. }
  2343. type t__siginfo = Tsiginfo_t
  2344. type t__sigaction_u = struct {
  2345. F__sa_sigaction [0]uintptr
  2346. F__sa_handler uintptr
  2347. }
  2348. type t__sigaction = struct {
  2349. F__sigaction_u t__sigaction_u
  2350. Fsa_tramp uintptr
  2351. Fsa_mask Tsigset_t
  2352. Fsa_flags int32
  2353. }
  2354. type Tsigaction = struct {
  2355. F__sigaction_u t__sigaction_u
  2356. Fsa_mask Tsigset_t
  2357. Fsa_flags int32
  2358. }
  2359. type Tsig_t = uintptr
  2360. type Tsigvec = struct {
  2361. Fsv_handler uintptr
  2362. Fsv_mask int32
  2363. Fsv_flags int32
  2364. }
  2365. type Tsigstack = struct {
  2366. Fss_sp uintptr
  2367. Fss_onstack int32
  2368. }
  2369. type Tuint64_t = uint64
  2370. type Tint_least64_t = int64
  2371. type Tuint_least64_t = uint64
  2372. type Tint_fast64_t = int64
  2373. type Tuint_fast64_t = uint64
  2374. type Tuint32_t = uint32
  2375. type Tint_least32_t = int32
  2376. type Tuint_least32_t = uint32
  2377. type Tint_fast32_t = int32
  2378. type Tuint_fast32_t = uint32
  2379. type Tuint16_t = uint16
  2380. type Tint_least16_t = int16
  2381. type Tuint_least16_t = uint16
  2382. type Tint_fast16_t = int16
  2383. type Tuint_fast16_t = uint16
  2384. type Tuint8_t = uint8
  2385. type Tint_least8_t = int8
  2386. type Tuint_least8_t = uint8
  2387. type Tint_fast8_t = int8
  2388. type Tuint_fast8_t = uint8
  2389. type Tintmax_t = int64
  2390. type Tuintmax_t = uint64
  2391. type Ttimeval = struct {
  2392. Ftv_sec t__darwin_time_t
  2393. Ftv_usec t__darwin_suseconds_t
  2394. }
  2395. type Trlim_t = uint64
  2396. type Trusage = struct {
  2397. Fru_utime Ttimeval
  2398. Fru_stime Ttimeval
  2399. Fru_maxrss int64
  2400. Fru_ixrss int64
  2401. Fru_idrss int64
  2402. Fru_isrss int64
  2403. Fru_minflt int64
  2404. Fru_majflt int64
  2405. Fru_nswap int64
  2406. Fru_inblock int64
  2407. Fru_oublock int64
  2408. Fru_msgsnd int64
  2409. Fru_msgrcv int64
  2410. Fru_nsignals int64
  2411. Fru_nvcsw int64
  2412. Fru_nivcsw int64
  2413. }
  2414. type Trusage_info_t = uintptr
  2415. type Trusage_info_v0 = struct {
  2416. Fri_uuid [16]Tuint8_t
  2417. Fri_user_time Tuint64_t
  2418. Fri_system_time Tuint64_t
  2419. Fri_pkg_idle_wkups Tuint64_t
  2420. Fri_interrupt_wkups Tuint64_t
  2421. Fri_pageins Tuint64_t
  2422. Fri_wired_size Tuint64_t
  2423. Fri_resident_size Tuint64_t
  2424. Fri_phys_footprint Tuint64_t
  2425. Fri_proc_start_abstime Tuint64_t
  2426. Fri_proc_exit_abstime Tuint64_t
  2427. }
  2428. type Trusage_info_v1 = struct {
  2429. Fri_uuid [16]Tuint8_t
  2430. Fri_user_time Tuint64_t
  2431. Fri_system_time Tuint64_t
  2432. Fri_pkg_idle_wkups Tuint64_t
  2433. Fri_interrupt_wkups Tuint64_t
  2434. Fri_pageins Tuint64_t
  2435. Fri_wired_size Tuint64_t
  2436. Fri_resident_size Tuint64_t
  2437. Fri_phys_footprint Tuint64_t
  2438. Fri_proc_start_abstime Tuint64_t
  2439. Fri_proc_exit_abstime Tuint64_t
  2440. Fri_child_user_time Tuint64_t
  2441. Fri_child_system_time Tuint64_t
  2442. Fri_child_pkg_idle_wkups Tuint64_t
  2443. Fri_child_interrupt_wkups Tuint64_t
  2444. Fri_child_pageins Tuint64_t
  2445. Fri_child_elapsed_abstime Tuint64_t
  2446. }
  2447. type Trusage_info_v2 = struct {
  2448. Fri_uuid [16]Tuint8_t
  2449. Fri_user_time Tuint64_t
  2450. Fri_system_time Tuint64_t
  2451. Fri_pkg_idle_wkups Tuint64_t
  2452. Fri_interrupt_wkups Tuint64_t
  2453. Fri_pageins Tuint64_t
  2454. Fri_wired_size Tuint64_t
  2455. Fri_resident_size Tuint64_t
  2456. Fri_phys_footprint Tuint64_t
  2457. Fri_proc_start_abstime Tuint64_t
  2458. Fri_proc_exit_abstime Tuint64_t
  2459. Fri_child_user_time Tuint64_t
  2460. Fri_child_system_time Tuint64_t
  2461. Fri_child_pkg_idle_wkups Tuint64_t
  2462. Fri_child_interrupt_wkups Tuint64_t
  2463. Fri_child_pageins Tuint64_t
  2464. Fri_child_elapsed_abstime Tuint64_t
  2465. Fri_diskio_bytesread Tuint64_t
  2466. Fri_diskio_byteswritten Tuint64_t
  2467. }
  2468. type Trusage_info_v3 = struct {
  2469. Fri_uuid [16]Tuint8_t
  2470. Fri_user_time Tuint64_t
  2471. Fri_system_time Tuint64_t
  2472. Fri_pkg_idle_wkups Tuint64_t
  2473. Fri_interrupt_wkups Tuint64_t
  2474. Fri_pageins Tuint64_t
  2475. Fri_wired_size Tuint64_t
  2476. Fri_resident_size Tuint64_t
  2477. Fri_phys_footprint Tuint64_t
  2478. Fri_proc_start_abstime Tuint64_t
  2479. Fri_proc_exit_abstime Tuint64_t
  2480. Fri_child_user_time Tuint64_t
  2481. Fri_child_system_time Tuint64_t
  2482. Fri_child_pkg_idle_wkups Tuint64_t
  2483. Fri_child_interrupt_wkups Tuint64_t
  2484. Fri_child_pageins Tuint64_t
  2485. Fri_child_elapsed_abstime Tuint64_t
  2486. Fri_diskio_bytesread Tuint64_t
  2487. Fri_diskio_byteswritten Tuint64_t
  2488. Fri_cpu_time_qos_default Tuint64_t
  2489. Fri_cpu_time_qos_maintenance Tuint64_t
  2490. Fri_cpu_time_qos_background Tuint64_t
  2491. Fri_cpu_time_qos_utility Tuint64_t
  2492. Fri_cpu_time_qos_legacy Tuint64_t
  2493. Fri_cpu_time_qos_user_initiated Tuint64_t
  2494. Fri_cpu_time_qos_user_interactive Tuint64_t
  2495. Fri_billed_system_time Tuint64_t
  2496. Fri_serviced_system_time Tuint64_t
  2497. }
  2498. type Trusage_info_v4 = struct {
  2499. Fri_uuid [16]Tuint8_t
  2500. Fri_user_time Tuint64_t
  2501. Fri_system_time Tuint64_t
  2502. Fri_pkg_idle_wkups Tuint64_t
  2503. Fri_interrupt_wkups Tuint64_t
  2504. Fri_pageins Tuint64_t
  2505. Fri_wired_size Tuint64_t
  2506. Fri_resident_size Tuint64_t
  2507. Fri_phys_footprint Tuint64_t
  2508. Fri_proc_start_abstime Tuint64_t
  2509. Fri_proc_exit_abstime Tuint64_t
  2510. Fri_child_user_time Tuint64_t
  2511. Fri_child_system_time Tuint64_t
  2512. Fri_child_pkg_idle_wkups Tuint64_t
  2513. Fri_child_interrupt_wkups Tuint64_t
  2514. Fri_child_pageins Tuint64_t
  2515. Fri_child_elapsed_abstime Tuint64_t
  2516. Fri_diskio_bytesread Tuint64_t
  2517. Fri_diskio_byteswritten Tuint64_t
  2518. Fri_cpu_time_qos_default Tuint64_t
  2519. Fri_cpu_time_qos_maintenance Tuint64_t
  2520. Fri_cpu_time_qos_background Tuint64_t
  2521. Fri_cpu_time_qos_utility Tuint64_t
  2522. Fri_cpu_time_qos_legacy Tuint64_t
  2523. Fri_cpu_time_qos_user_initiated Tuint64_t
  2524. Fri_cpu_time_qos_user_interactive Tuint64_t
  2525. Fri_billed_system_time Tuint64_t
  2526. Fri_serviced_system_time Tuint64_t
  2527. Fri_logical_writes Tuint64_t
  2528. Fri_lifetime_max_phys_footprint Tuint64_t
  2529. Fri_instructions Tuint64_t
  2530. Fri_cycles Tuint64_t
  2531. Fri_billed_energy Tuint64_t
  2532. Fri_serviced_energy Tuint64_t
  2533. Fri_interval_max_phys_footprint Tuint64_t
  2534. Fri_runnable_time Tuint64_t
  2535. }
  2536. type Trusage_info_v5 = struct {
  2537. Fri_uuid [16]Tuint8_t
  2538. Fri_user_time Tuint64_t
  2539. Fri_system_time Tuint64_t
  2540. Fri_pkg_idle_wkups Tuint64_t
  2541. Fri_interrupt_wkups Tuint64_t
  2542. Fri_pageins Tuint64_t
  2543. Fri_wired_size Tuint64_t
  2544. Fri_resident_size Tuint64_t
  2545. Fri_phys_footprint Tuint64_t
  2546. Fri_proc_start_abstime Tuint64_t
  2547. Fri_proc_exit_abstime Tuint64_t
  2548. Fri_child_user_time Tuint64_t
  2549. Fri_child_system_time Tuint64_t
  2550. Fri_child_pkg_idle_wkups Tuint64_t
  2551. Fri_child_interrupt_wkups Tuint64_t
  2552. Fri_child_pageins Tuint64_t
  2553. Fri_child_elapsed_abstime Tuint64_t
  2554. Fri_diskio_bytesread Tuint64_t
  2555. Fri_diskio_byteswritten Tuint64_t
  2556. Fri_cpu_time_qos_default Tuint64_t
  2557. Fri_cpu_time_qos_maintenance Tuint64_t
  2558. Fri_cpu_time_qos_background Tuint64_t
  2559. Fri_cpu_time_qos_utility Tuint64_t
  2560. Fri_cpu_time_qos_legacy Tuint64_t
  2561. Fri_cpu_time_qos_user_initiated Tuint64_t
  2562. Fri_cpu_time_qos_user_interactive Tuint64_t
  2563. Fri_billed_system_time Tuint64_t
  2564. Fri_serviced_system_time Tuint64_t
  2565. Fri_logical_writes Tuint64_t
  2566. Fri_lifetime_max_phys_footprint Tuint64_t
  2567. Fri_instructions Tuint64_t
  2568. Fri_cycles Tuint64_t
  2569. Fri_billed_energy Tuint64_t
  2570. Fri_serviced_energy Tuint64_t
  2571. Fri_interval_max_phys_footprint Tuint64_t
  2572. Fri_runnable_time Tuint64_t
  2573. Fri_flags Tuint64_t
  2574. }
  2575. type Trusage_info_v6 = struct {
  2576. Fri_uuid [16]Tuint8_t
  2577. Fri_user_time Tuint64_t
  2578. Fri_system_time Tuint64_t
  2579. Fri_pkg_idle_wkups Tuint64_t
  2580. Fri_interrupt_wkups Tuint64_t
  2581. Fri_pageins Tuint64_t
  2582. Fri_wired_size Tuint64_t
  2583. Fri_resident_size Tuint64_t
  2584. Fri_phys_footprint Tuint64_t
  2585. Fri_proc_start_abstime Tuint64_t
  2586. Fri_proc_exit_abstime Tuint64_t
  2587. Fri_child_user_time Tuint64_t
  2588. Fri_child_system_time Tuint64_t
  2589. Fri_child_pkg_idle_wkups Tuint64_t
  2590. Fri_child_interrupt_wkups Tuint64_t
  2591. Fri_child_pageins Tuint64_t
  2592. Fri_child_elapsed_abstime Tuint64_t
  2593. Fri_diskio_bytesread Tuint64_t
  2594. Fri_diskio_byteswritten Tuint64_t
  2595. Fri_cpu_time_qos_default Tuint64_t
  2596. Fri_cpu_time_qos_maintenance Tuint64_t
  2597. Fri_cpu_time_qos_background Tuint64_t
  2598. Fri_cpu_time_qos_utility Tuint64_t
  2599. Fri_cpu_time_qos_legacy Tuint64_t
  2600. Fri_cpu_time_qos_user_initiated Tuint64_t
  2601. Fri_cpu_time_qos_user_interactive Tuint64_t
  2602. Fri_billed_system_time Tuint64_t
  2603. Fri_serviced_system_time Tuint64_t
  2604. Fri_logical_writes Tuint64_t
  2605. Fri_lifetime_max_phys_footprint Tuint64_t
  2606. Fri_instructions Tuint64_t
  2607. Fri_cycles Tuint64_t
  2608. Fri_billed_energy Tuint64_t
  2609. Fri_serviced_energy Tuint64_t
  2610. Fri_interval_max_phys_footprint Tuint64_t
  2611. Fri_runnable_time Tuint64_t
  2612. Fri_flags Tuint64_t
  2613. Fri_user_ptime Tuint64_t
  2614. Fri_system_ptime Tuint64_t
  2615. Fri_pinstructions Tuint64_t
  2616. Fri_pcycles Tuint64_t
  2617. Fri_energy_nj Tuint64_t
  2618. Fri_penergy_nj Tuint64_t
  2619. Fri_secure_time_in_system Tuint64_t
  2620. Fri_secure_ptime_in_system Tuint64_t
  2621. Fri_neural_footprint Tuint64_t
  2622. Fri_lifetime_max_neural_footprint Tuint64_t
  2623. Fri_interval_max_neural_footprint Tuint64_t
  2624. Fri_reserved [9]Tuint64_t
  2625. }
  2626. type Trusage_info_current = struct {
  2627. Fri_uuid [16]Tuint8_t
  2628. Fri_user_time Tuint64_t
  2629. Fri_system_time Tuint64_t
  2630. Fri_pkg_idle_wkups Tuint64_t
  2631. Fri_interrupt_wkups Tuint64_t
  2632. Fri_pageins Tuint64_t
  2633. Fri_wired_size Tuint64_t
  2634. Fri_resident_size Tuint64_t
  2635. Fri_phys_footprint Tuint64_t
  2636. Fri_proc_start_abstime Tuint64_t
  2637. Fri_proc_exit_abstime Tuint64_t
  2638. Fri_child_user_time Tuint64_t
  2639. Fri_child_system_time Tuint64_t
  2640. Fri_child_pkg_idle_wkups Tuint64_t
  2641. Fri_child_interrupt_wkups Tuint64_t
  2642. Fri_child_pageins Tuint64_t
  2643. Fri_child_elapsed_abstime Tuint64_t
  2644. Fri_diskio_bytesread Tuint64_t
  2645. Fri_diskio_byteswritten Tuint64_t
  2646. Fri_cpu_time_qos_default Tuint64_t
  2647. Fri_cpu_time_qos_maintenance Tuint64_t
  2648. Fri_cpu_time_qos_background Tuint64_t
  2649. Fri_cpu_time_qos_utility Tuint64_t
  2650. Fri_cpu_time_qos_legacy Tuint64_t
  2651. Fri_cpu_time_qos_user_initiated Tuint64_t
  2652. Fri_cpu_time_qos_user_interactive Tuint64_t
  2653. Fri_billed_system_time Tuint64_t
  2654. Fri_serviced_system_time Tuint64_t
  2655. Fri_logical_writes Tuint64_t
  2656. Fri_lifetime_max_phys_footprint Tuint64_t
  2657. Fri_instructions Tuint64_t
  2658. Fri_cycles Tuint64_t
  2659. Fri_billed_energy Tuint64_t
  2660. Fri_serviced_energy Tuint64_t
  2661. Fri_interval_max_phys_footprint Tuint64_t
  2662. Fri_runnable_time Tuint64_t
  2663. Fri_flags Tuint64_t
  2664. Fri_user_ptime Tuint64_t
  2665. Fri_system_ptime Tuint64_t
  2666. Fri_pinstructions Tuint64_t
  2667. Fri_pcycles Tuint64_t
  2668. Fri_energy_nj Tuint64_t
  2669. Fri_penergy_nj Tuint64_t
  2670. Fri_secure_time_in_system Tuint64_t
  2671. Fri_secure_ptime_in_system Tuint64_t
  2672. Fri_neural_footprint Tuint64_t
  2673. Fri_lifetime_max_neural_footprint Tuint64_t
  2674. Fri_interval_max_neural_footprint Tuint64_t
  2675. Fri_reserved [9]Tuint64_t
  2676. }
  2677. type Trlimit = struct {
  2678. Frlim_cur Trlim_t
  2679. Frlim_max Trlim_t
  2680. }
  2681. type Tproc_rlimit_control_wakeupmon = struct {
  2682. Fwm_flags Tuint32_t
  2683. Fwm_rate Tint32_t
  2684. }
  2685. type Twait = struct {
  2686. Fw_T [0]struct {
  2687. F__ccgo0 uint32
  2688. }
  2689. Fw_S [0]struct {
  2690. F__ccgo0 uint32
  2691. }
  2692. Fw_status int32
  2693. }
  2694. type Tct_rune_t = int32
  2695. type Trune_t = int32
  2696. type Tdiv_t = struct {
  2697. Fquot int32
  2698. Frem int32
  2699. }
  2700. type Tldiv_t = struct {
  2701. Fquot int64
  2702. Frem int64
  2703. }
  2704. type Tlldiv_t = struct {
  2705. Fquot int64
  2706. Frem int64
  2707. }
  2708. type Tmalloc_type_id_t = uint64
  2709. type Tdev_t = int32
  2710. type Tmode_t = uint16
  2711. type Tfloat_t = float32
  2712. type Tdouble_t = float64
  2713. type t__float2 = struct {
  2714. F__sinval float32
  2715. F__cosval float32
  2716. }
  2717. type t__double2 = struct {
  2718. F__sinval float64
  2719. F__cosval float64
  2720. }
  2721. type Texception = struct {
  2722. Ftype1 int32
  2723. Fname uintptr
  2724. Farg1 float64
  2725. Farg2 float64
  2726. Fretval float64
  2727. }
  2728. type Tfd_set = struct {
  2729. Ffds_bits [32]t__int32_t
  2730. }
  2731. type Ttimespec = struct {
  2732. Ftv_sec t__darwin_time_t
  2733. Ftv_nsec int64
  2734. }
  2735. type Ttimeval64 = struct {
  2736. Ftv_sec t__int64_t
  2737. Ftv_usec t__int64_t
  2738. }
  2739. type Ttime_t = int64
  2740. type Tsuseconds_t = int32
  2741. type Titimerval = struct {
  2742. Fit_interval Ttimeval
  2743. Fit_value Ttimeval
  2744. }
  2745. type Ttimezone = struct {
  2746. Ftz_minuteswest int32
  2747. Ftz_dsttime int32
  2748. }
  2749. type Tclockinfo = struct {
  2750. Fhz int32
  2751. Ftick int32
  2752. Ftickadj int32
  2753. Fstathz int32
  2754. Fprofhz int32
  2755. }
  2756. type Tclock_t = uint64
  2757. type Ttm = struct {
  2758. Ftm_sec int32
  2759. Ftm_min int32
  2760. Ftm_hour int32
  2761. Ftm_mday int32
  2762. Ftm_mon int32
  2763. Ftm_year int32
  2764. Ftm_wday int32
  2765. Ftm_yday int32
  2766. Ftm_isdst int32
  2767. Ftm_gmtoff int64
  2768. Ftm_zone uintptr
  2769. } //TODO "timezone" // _time.h:106:13:
  2770. type Tclockid_t = int32
  2771. const __CLOCK_REALTIME = 0
  2772. const __CLOCK_MONOTONIC = 6
  2773. const __CLOCK_MONOTONIC_RAW = 4
  2774. const __CLOCK_MONOTONIC_RAW_APPROX = 5
  2775. const __CLOCK_UPTIME_RAW = 8
  2776. const __CLOCK_UPTIME_RAW_APPROX = 9
  2777. const __CLOCK_PROCESS_CPUTIME_ID = 12
  2778. const __CLOCK_THREAD_CPUTIME_ID = 16
  2779. type Tu_char = uint8
  2780. type Tu_short = uint16
  2781. type Tu_int = uint32
  2782. type Tu_long = uint64
  2783. type Tushort = uint16
  2784. type Tuint = uint32
  2785. type Tu_quad_t = uint64
  2786. type Tquad_t = int64
  2787. type Tqaddr_t = uintptr
  2788. type Tcaddr_t = uintptr
  2789. type Tdaddr_t = int32
  2790. type Tfixpt_t = uint32
  2791. type Tblkcnt_t = int64
  2792. type Tblksize_t = int32
  2793. type Tgid_t = uint32
  2794. type Tin_addr_t = uint32
  2795. type Tin_port_t = uint16
  2796. type Tino_t = uint64
  2797. type Tino64_t = uint64
  2798. type Tkey_t = int32
  2799. type Tnlink_t = uint16
  2800. type Tsegsz_t = int32
  2801. type Tswblk_t = int32
  2802. type Tuseconds_t = uint32
  2803. type Tfd_mask = int32
  2804. type Tpthread_cond_t = struct {
  2805. F__sig int64
  2806. F__opaque [40]int8
  2807. }
  2808. type Tpthread_condattr_t = struct {
  2809. F__sig int64
  2810. F__opaque [8]int8
  2811. }
  2812. type Tpthread_mutex_t = struct {
  2813. F__sig int64
  2814. F__opaque [56]int8
  2815. }
  2816. type Tpthread_mutexattr_t = struct {
  2817. F__sig int64
  2818. F__opaque [8]int8
  2819. }
  2820. type Tpthread_once_t = struct {
  2821. F__sig int64
  2822. F__opaque [8]int8
  2823. }
  2824. type Tpthread_rwlock_t = struct {
  2825. F__sig int64
  2826. F__opaque [192]int8
  2827. }
  2828. type Tpthread_rwlockattr_t = struct {
  2829. F__sig int64
  2830. F__opaque [16]int8
  2831. }
  2832. type Tpthread_t = uintptr
  2833. type Tpthread_key_t = uint64
  2834. type Tfsblkcnt_t = uint32
  2835. type Tfsfilcnt_t = uint32
  2836. type Taccessx_descriptor = struct {
  2837. Fad_name_offset uint32
  2838. Fad_flags int32
  2839. Fad_pad [2]int32
  2840. }
  2841. type Tuuid_t = [16]uint8
  2842. type Tflock = struct {
  2843. Fl_start Toff_t
  2844. Fl_len Toff_t
  2845. Fl_pid Tpid_t
  2846. Fl_type int16
  2847. Fl_whence int16
  2848. }
  2849. type Tflocktimeout = struct {
  2850. Ffl Tflock
  2851. Ftimeout Ttimespec
  2852. }
  2853. type Tradvisory = struct {
  2854. Fra_offset Toff_t
  2855. Fra_count int32
  2856. }
  2857. type Tfsignatures_t = struct {
  2858. Ffs_file_start Toff_t
  2859. Ffs_blob_start uintptr
  2860. Ffs_blob_size Tsize_t
  2861. Ffs_fsignatures_size Tsize_t
  2862. Ffs_cdhash [20]int8
  2863. Ffs_hash_type int32
  2864. }
  2865. type Tfsignatures = Tfsignatures_t
  2866. type Tfsupplement_t = struct {
  2867. Ffs_file_start Toff_t
  2868. Ffs_blob_start Toff_t
  2869. Ffs_blob_size Tsize_t
  2870. Ffs_orig_fd int32
  2871. }
  2872. type Tfsupplement = Tfsupplement_t
  2873. type Tfchecklv_t = struct {
  2874. Flv_file_start Toff_t
  2875. Flv_error_message_size Tsize_t
  2876. Flv_error_message uintptr
  2877. }
  2878. type Tfchecklv = Tfchecklv_t
  2879. type Tfgetsigsinfo_t = struct {
  2880. Ffg_file_start Toff_t
  2881. Ffg_info_request int32
  2882. Ffg_sig_is_platform int32
  2883. }
  2884. type Tfgetsigsinfo = Tfgetsigsinfo_t
  2885. type Tfstore_t = struct {
  2886. Ffst_flags uint32
  2887. Ffst_posmode int32
  2888. Ffst_offset Toff_t
  2889. Ffst_length Toff_t
  2890. Ffst_bytesalloc Toff_t
  2891. }
  2892. type Tfstore = Tfstore_t
  2893. type Tfpunchhole_t = struct {
  2894. Ffp_flags uint32
  2895. Freserved uint32
  2896. Ffp_offset Toff_t
  2897. Ffp_length Toff_t
  2898. }
  2899. type Tfpunchhole = Tfpunchhole_t
  2900. type Tftrimactivefile_t = struct {
  2901. Ffta_offset Toff_t
  2902. Ffta_length Toff_t
  2903. }
  2904. type Tftrimactivefile = Tftrimactivefile_t
  2905. type Tfspecread_t = struct {
  2906. Ffsr_flags uint32
  2907. Freserved uint32
  2908. Ffsr_offset Toff_t
  2909. Ffsr_length Toff_t
  2910. }
  2911. type Tfspecread = Tfspecread_t
  2912. type Tfattributiontag_t = struct {
  2913. Fft_flags uint32
  2914. Fft_hash uint64
  2915. Fft_attribution_name [255]int8
  2916. }
  2917. type Tfattributiontag = Tfattributiontag_t
  2918. type Tlog2phys = struct {
  2919. Fl2p_flags uint32
  2920. Fl2p_contigbytes Toff_t
  2921. Fl2p_devoffset Toff_t
  2922. }
  2923. type Tfilesec_t = uintptr
  2924. type Tfilesec_property_t = int32
  2925. const _FILESEC_OWNER = 1
  2926. const _FILESEC_GROUP = 2
  2927. const _FILESEC_UUID = 3
  2928. const _FILESEC_MODE = 4
  2929. const _FILESEC_ACL = 5
  2930. const _FILESEC_GRPUUID = 6
  2931. const _FILESEC_ACL_RAW = 100
  2932. const _FILESEC_ACL_ALLOCSIZE = 101
  2933. type TXML_Char = int8
  2934. type TXML_LChar = int8
  2935. type TXML_Index = int64
  2936. type TXML_Size = uint64
  2937. type TXML_ParserStruct = struct {
  2938. Fm_userData uintptr
  2939. Fm_handlerArg uintptr
  2940. Fm_buffer uintptr
  2941. Fm_mem TXML_Memory_Handling_Suite
  2942. Fm_bufferPtr uintptr
  2943. Fm_bufferEnd uintptr
  2944. Fm_bufferLim uintptr
  2945. Fm_parseEndByteIndex TXML_Index
  2946. Fm_parseEndPtr uintptr
  2947. Fm_dataBuf uintptr
  2948. Fm_dataBufEnd uintptr
  2949. Fm_startElementHandler TXML_StartElementHandler
  2950. Fm_endElementHandler TXML_EndElementHandler
  2951. Fm_characterDataHandler TXML_CharacterDataHandler
  2952. Fm_processingInstructionHandler TXML_ProcessingInstructionHandler
  2953. Fm_commentHandler TXML_CommentHandler
  2954. Fm_startCdataSectionHandler TXML_StartCdataSectionHandler
  2955. Fm_endCdataSectionHandler TXML_EndCdataSectionHandler
  2956. Fm_defaultHandler TXML_DefaultHandler
  2957. Fm_startDoctypeDeclHandler TXML_StartDoctypeDeclHandler
  2958. Fm_endDoctypeDeclHandler TXML_EndDoctypeDeclHandler
  2959. Fm_unparsedEntityDeclHandler TXML_UnparsedEntityDeclHandler
  2960. Fm_notationDeclHandler TXML_NotationDeclHandler
  2961. Fm_startNamespaceDeclHandler TXML_StartNamespaceDeclHandler
  2962. Fm_endNamespaceDeclHandler TXML_EndNamespaceDeclHandler
  2963. Fm_notStandaloneHandler TXML_NotStandaloneHandler
  2964. Fm_externalEntityRefHandler TXML_ExternalEntityRefHandler
  2965. Fm_externalEntityRefHandlerArg TXML_Parser
  2966. Fm_skippedEntityHandler TXML_SkippedEntityHandler
  2967. Fm_unknownEncodingHandler TXML_UnknownEncodingHandler
  2968. Fm_elementDeclHandler TXML_ElementDeclHandler
  2969. Fm_attlistDeclHandler TXML_AttlistDeclHandler
  2970. Fm_entityDeclHandler TXML_EntityDeclHandler
  2971. Fm_xmlDeclHandler TXML_XmlDeclHandler
  2972. Fm_encoding uintptr
  2973. Fm_initEncoding TINIT_ENCODING
  2974. Fm_internalEncoding uintptr
  2975. Fm_protocolEncodingName uintptr
  2976. Fm_ns TXML_Bool
  2977. Fm_ns_triplets TXML_Bool
  2978. Fm_unknownEncodingMem uintptr
  2979. Fm_unknownEncodingData uintptr
  2980. Fm_unknownEncodingHandlerData uintptr
  2981. Fm_unknownEncodingRelease uintptr
  2982. Fm_prologState TPROLOG_STATE
  2983. Fm_processor uintptr
  2984. Fm_errorCode _XML_Error
  2985. Fm_eventPtr uintptr
  2986. Fm_eventEndPtr uintptr
  2987. Fm_positionPtr uintptr
  2988. Fm_openInternalEntities uintptr
  2989. Fm_freeInternalEntities uintptr
  2990. Fm_defaultExpandInternalEntities TXML_Bool
  2991. Fm_tagLevel int32
  2992. Fm_declEntity uintptr
  2993. Fm_doctypeName uintptr
  2994. Fm_doctypeSysid uintptr
  2995. Fm_doctypePubid uintptr
  2996. Fm_declAttributeType uintptr
  2997. Fm_declNotationName uintptr
  2998. Fm_declNotationPublicId uintptr
  2999. Fm_declElementType uintptr
  3000. Fm_declAttributeId uintptr
  3001. Fm_declAttributeIsCdata TXML_Bool
  3002. Fm_declAttributeIsId TXML_Bool
  3003. Fm_dtd uintptr
  3004. Fm_curBase uintptr
  3005. Fm_tagStack uintptr
  3006. Fm_freeTagList uintptr
  3007. Fm_inheritedBindings uintptr
  3008. Fm_freeBindingList uintptr
  3009. Fm_attsSize int32
  3010. Fm_nSpecifiedAtts int32
  3011. Fm_idAttIndex int32
  3012. Fm_atts uintptr
  3013. Fm_nsAtts uintptr
  3014. Fm_nsAttsVersion uint64
  3015. Fm_nsAttsPower uint8
  3016. Fm_position TPOSITION
  3017. Fm_tempPool TSTRING_POOL
  3018. Fm_temp2Pool TSTRING_POOL
  3019. Fm_groupConnector uintptr
  3020. Fm_groupSize uint32
  3021. Fm_namespaceSeparator TXML_Char
  3022. Fm_parentParser TXML_Parser
  3023. Fm_parsingStatus TXML_ParsingStatus
  3024. Fm_isParamEntity TXML_Bool
  3025. Fm_useForeignDTD TXML_Bool
  3026. Fm_paramEntityParsing _XML_ParamEntityParsing
  3027. Fm_hash_secret_salt uint64
  3028. Fm_accounting TACCOUNTING
  3029. Fm_entity_stats TENTITY_STATS
  3030. }
  3031. type _XML_Error = int32
  3032. const _XML_ERROR_NONE = 0
  3033. const _XML_ERROR_NO_MEMORY = 1
  3034. const _XML_ERROR_SYNTAX = 2
  3035. const _XML_ERROR_NO_ELEMENTS = 3
  3036. const _XML_ERROR_INVALID_TOKEN = 4
  3037. const _XML_ERROR_UNCLOSED_TOKEN = 5
  3038. const _XML_ERROR_PARTIAL_CHAR = 6
  3039. const _XML_ERROR_TAG_MISMATCH = 7
  3040. const _XML_ERROR_DUPLICATE_ATTRIBUTE = 8
  3041. const _XML_ERROR_JUNK_AFTER_DOC_ELEMENT = 9
  3042. const _XML_ERROR_PARAM_ENTITY_REF = 10
  3043. const _XML_ERROR_UNDEFINED_ENTITY = 11
  3044. const _XML_ERROR_RECURSIVE_ENTITY_REF = 12
  3045. const _XML_ERROR_ASYNC_ENTITY = 13
  3046. const _XML_ERROR_BAD_CHAR_REF = 14
  3047. const _XML_ERROR_BINARY_ENTITY_REF = 15
  3048. const _XML_ERROR_ATTRIBUTE_EXTERNAL_ENTITY_REF = 16
  3049. const _XML_ERROR_MISPLACED_XML_PI = 17
  3050. const _XML_ERROR_UNKNOWN_ENCODING = 18
  3051. const _XML_ERROR_INCORRECT_ENCODING = 19
  3052. const _XML_ERROR_UNCLOSED_CDATA_SECTION = 20
  3053. const _XML_ERROR_EXTERNAL_ENTITY_HANDLING = 21
  3054. const _XML_ERROR_NOT_STANDALONE = 22
  3055. const _XML_ERROR_UNEXPECTED_STATE = 23
  3056. const _XML_ERROR_ENTITY_DECLARED_IN_PE = 24
  3057. const _XML_ERROR_FEATURE_REQUIRES_XML_DTD = 25
  3058. const _XML_ERROR_CANT_CHANGE_FEATURE_ONCE_PARSING = 26
  3059. const _XML_ERROR_UNBOUND_PREFIX = 27
  3060. const _XML_ERROR_UNDECLARING_PREFIX = 28
  3061. const _XML_ERROR_INCOMPLETE_PE = 29
  3062. const _XML_ERROR_XML_DECL = 30
  3063. const _XML_ERROR_TEXT_DECL = 31
  3064. const _XML_ERROR_PUBLICID = 32
  3065. const _XML_ERROR_SUSPENDED = 33
  3066. const _XML_ERROR_NOT_SUSPENDED = 34
  3067. const _XML_ERROR_ABORTED = 35
  3068. const _XML_ERROR_FINISHED = 36
  3069. const _XML_ERROR_SUSPEND_PE = 37
  3070. const _XML_ERROR_RESERVED_PREFIX_XML = 38
  3071. const _XML_ERROR_RESERVED_PREFIX_XMLNS = 39
  3072. const _XML_ERROR_RESERVED_NAMESPACE_URI = 40
  3073. const _XML_ERROR_INVALID_ARGUMENT = 41
  3074. const _XML_ERROR_NO_BUFFER = 42
  3075. const _XML_ERROR_AMPLIFICATION_LIMIT_BREACH = 43
  3076. type _XML_ParamEntityParsing = int32
  3077. const _XML_PARAM_ENTITY_PARSING_NEVER = 0
  3078. const _XML_PARAM_ENTITY_PARSING_UNLESS_STANDALONE = 1
  3079. const _XML_PARAM_ENTITY_PARSING_ALWAYS = 2
  3080. type TXML_Parser = uintptr
  3081. type TXML_Bool = uint8
  3082. type _XML_Status = int32
  3083. const _XML_STATUS_ERROR = 0
  3084. const _XML_STATUS_OK = 1
  3085. const _XML_STATUS_SUSPENDED = 2
  3086. type _XML_Content_Type = int32
  3087. const _XML_CTYPE_EMPTY = 1
  3088. const _XML_CTYPE_ANY = 2
  3089. const _XML_CTYPE_MIXED = 3
  3090. const _XML_CTYPE_NAME = 4
  3091. const _XML_CTYPE_CHOICE = 5
  3092. const _XML_CTYPE_SEQ = 6
  3093. type _XML_Content_Quant = int32
  3094. const _XML_CQUANT_NONE = 0
  3095. const _XML_CQUANT_OPT = 1
  3096. const _XML_CQUANT_REP = 2
  3097. const _XML_CQUANT_PLUS = 3
  3098. type TXML_Content = struct {
  3099. Ftype1 _XML_Content_Type
  3100. Fquant _XML_Content_Quant
  3101. Fname uintptr
  3102. Fnumchildren uint32
  3103. Fchildren uintptr
  3104. }
  3105. type TXML_cp = TXML_Content
  3106. type TXML_ElementDeclHandler = uintptr
  3107. type TXML_AttlistDeclHandler = uintptr
  3108. type TXML_XmlDeclHandler = uintptr
  3109. type TXML_Memory_Handling_Suite = struct {
  3110. Fmalloc_fcn uintptr
  3111. Frealloc_fcn uintptr
  3112. Ffree_fcn uintptr
  3113. }
  3114. type TXML_StartElementHandler = uintptr
  3115. type TXML_EndElementHandler = uintptr
  3116. type TXML_CharacterDataHandler = uintptr
  3117. type TXML_ProcessingInstructionHandler = uintptr
  3118. type TXML_CommentHandler = uintptr
  3119. type TXML_StartCdataSectionHandler = uintptr
  3120. type TXML_EndCdataSectionHandler = uintptr
  3121. type TXML_DefaultHandler = uintptr
  3122. type TXML_StartDoctypeDeclHandler = uintptr
  3123. type TXML_EndDoctypeDeclHandler = uintptr
  3124. type TXML_EntityDeclHandler = uintptr
  3125. type TXML_UnparsedEntityDeclHandler = uintptr
  3126. type TXML_NotationDeclHandler = uintptr
  3127. type TXML_StartNamespaceDeclHandler = uintptr
  3128. type TXML_EndNamespaceDeclHandler = uintptr
  3129. type TXML_NotStandaloneHandler = uintptr
  3130. type TXML_ExternalEntityRefHandler = uintptr
  3131. type TXML_SkippedEntityHandler = uintptr
  3132. type TXML_Encoding = struct {
  3133. Fmap1 [256]int32
  3134. Fdata uintptr
  3135. Fconvert uintptr
  3136. Frelease uintptr
  3137. }
  3138. type TXML_UnknownEncodingHandler = uintptr
  3139. type _XML_Parsing = int32
  3140. const _XML_INITIALIZED = 0
  3141. const _XML_PARSING = 1
  3142. const _XML_FINISHED = 2
  3143. const _XML_SUSPENDED = 3
  3144. type TXML_ParsingStatus = struct {
  3145. Fparsing _XML_Parsing
  3146. FfinalBuffer TXML_Bool
  3147. }
  3148. type TXML_Expat_Version = struct {
  3149. Fmajor int32
  3150. Fminor int32
  3151. Fmicro int32
  3152. }
  3153. type _XML_FeatureEnum = int32
  3154. const _XML_FEATURE_END = 0
  3155. const _XML_FEATURE_UNICODE = 1
  3156. const _XML_FEATURE_UNICODE_WCHAR_T = 2
  3157. const _XML_FEATURE_DTD = 3
  3158. const _XML_FEATURE_CONTEXT_BYTES = 4
  3159. const _XML_FEATURE_MIN_SIZE = 5
  3160. const _XML_FEATURE_SIZEOF_XML_CHAR = 6
  3161. const _XML_FEATURE_SIZEOF_XML_LCHAR = 7
  3162. const _XML_FEATURE_NS = 8
  3163. const _XML_FEATURE_LARGE_SIZE = 9
  3164. const _XML_FEATURE_ATTR_INFO = 10
  3165. const _XML_FEATURE_BILLION_LAUGHS_ATTACK_PROTECTION_MAXIMUM_AMPLIFICATION_DEFAULT = 11
  3166. const _XML_FEATURE_BILLION_LAUGHS_ATTACK_PROTECTION_ACTIVATION_THRESHOLD_DEFAULT = 12
  3167. type TXML_Feature = struct {
  3168. Ffeature _XML_FeatureEnum
  3169. Fname uintptr
  3170. Fvalue int64
  3171. }
  3172. type Tsiphash = struct {
  3173. Fv0 Tuint64_t
  3174. Fv1 Tuint64_t
  3175. Fv2 Tuint64_t
  3176. Fv3 Tuint64_t
  3177. Fbuf [8]uint8
  3178. Fp uintptr
  3179. Fc Tuint64_t
  3180. }
  3181. type Tsipkey = struct {
  3182. Fk [2]Tuint64_t
  3183. }
  3184. func _sip_tokey(tls *libc.TLS, key uintptr, src uintptr) (r uintptr) {
  3185. *(*Tuint64_t)(unsafe.Pointer(key)) = uint64(*(*uint8)(unsafe.Pointer(src)))<<libc.Int32FromInt32(0) | uint64(*(*uint8)(unsafe.Pointer(src + 1)))<<libc.Int32FromInt32(8) | uint64(*(*uint8)(unsafe.Pointer(src + 2)))<<libc.Int32FromInt32(16) | uint64(*(*uint8)(unsafe.Pointer(src + 3)))<<libc.Int32FromInt32(24) | uint64(*(*uint8)(unsafe.Pointer(src + 4)))<<libc.Int32FromInt32(32) | uint64(*(*uint8)(unsafe.Pointer(src + 5)))<<libc.Int32FromInt32(40) | uint64(*(*uint8)(unsafe.Pointer(src + 6)))<<libc.Int32FromInt32(48) | uint64(*(*uint8)(unsafe.Pointer(src + 7)))<<libc.Int32FromInt32(56)
  3186. *(*Tuint64_t)(unsafe.Pointer(key + 1*8)) = uint64(*(*uint8)(unsafe.Pointer(src + libc.UintptrFromInt32(8))))<<libc.Int32FromInt32(0) | uint64(*(*uint8)(unsafe.Pointer(src + libc.UintptrFromInt32(8) + 1)))<<libc.Int32FromInt32(8) | uint64(*(*uint8)(unsafe.Pointer(src + libc.UintptrFromInt32(8) + 2)))<<libc.Int32FromInt32(16) | uint64(*(*uint8)(unsafe.Pointer(src + libc.UintptrFromInt32(8) + 3)))<<libc.Int32FromInt32(24) | uint64(*(*uint8)(unsafe.Pointer(src + libc.UintptrFromInt32(8) + 4)))<<libc.Int32FromInt32(32) | uint64(*(*uint8)(unsafe.Pointer(src + libc.UintptrFromInt32(8) + 5)))<<libc.Int32FromInt32(40) | uint64(*(*uint8)(unsafe.Pointer(src + libc.UintptrFromInt32(8) + 6)))<<libc.Int32FromInt32(48) | uint64(*(*uint8)(unsafe.Pointer(src + libc.UintptrFromInt32(8) + 7)))<<libc.Int32FromInt32(56)
  3187. return key
  3188. }
  3189. func _sip_round(tls *libc.TLS, H uintptr, rounds int32) {
  3190. var i int32
  3191. _ = i
  3192. i = 0
  3193. for {
  3194. if !(i < rounds) {
  3195. break
  3196. }
  3197. *(*Tuint64_t)(unsafe.Pointer(H)) += (*Tsiphash)(unsafe.Pointer(H)).Fv1
  3198. (*Tsiphash)(unsafe.Pointer(H)).Fv1 = (*Tsiphash)(unsafe.Pointer(H)).Fv1<<libc.Int32FromInt32(13) | (*Tsiphash)(unsafe.Pointer(H)).Fv1>>(libc.Int32FromInt32(64)-libc.Int32FromInt32(13))
  3199. *(*Tuint64_t)(unsafe.Pointer(H + 8)) ^= (*Tsiphash)(unsafe.Pointer(H)).Fv0
  3200. (*Tsiphash)(unsafe.Pointer(H)).Fv0 = (*Tsiphash)(unsafe.Pointer(H)).Fv0<<libc.Int32FromInt32(32) | (*Tsiphash)(unsafe.Pointer(H)).Fv0>>(libc.Int32FromInt32(64)-libc.Int32FromInt32(32))
  3201. *(*Tuint64_t)(unsafe.Pointer(H + 16)) += (*Tsiphash)(unsafe.Pointer(H)).Fv3
  3202. (*Tsiphash)(unsafe.Pointer(H)).Fv3 = (*Tsiphash)(unsafe.Pointer(H)).Fv3<<libc.Int32FromInt32(16) | (*Tsiphash)(unsafe.Pointer(H)).Fv3>>(libc.Int32FromInt32(64)-libc.Int32FromInt32(16))
  3203. *(*Tuint64_t)(unsafe.Pointer(H + 24)) ^= (*Tsiphash)(unsafe.Pointer(H)).Fv2
  3204. *(*Tuint64_t)(unsafe.Pointer(H)) += (*Tsiphash)(unsafe.Pointer(H)).Fv3
  3205. (*Tsiphash)(unsafe.Pointer(H)).Fv3 = (*Tsiphash)(unsafe.Pointer(H)).Fv3<<libc.Int32FromInt32(21) | (*Tsiphash)(unsafe.Pointer(H)).Fv3>>(libc.Int32FromInt32(64)-libc.Int32FromInt32(21))
  3206. *(*Tuint64_t)(unsafe.Pointer(H + 24)) ^= (*Tsiphash)(unsafe.Pointer(H)).Fv0
  3207. *(*Tuint64_t)(unsafe.Pointer(H + 16)) += (*Tsiphash)(unsafe.Pointer(H)).Fv1
  3208. (*Tsiphash)(unsafe.Pointer(H)).Fv1 = (*Tsiphash)(unsafe.Pointer(H)).Fv1<<libc.Int32FromInt32(17) | (*Tsiphash)(unsafe.Pointer(H)).Fv1>>(libc.Int32FromInt32(64)-libc.Int32FromInt32(17))
  3209. *(*Tuint64_t)(unsafe.Pointer(H + 8)) ^= (*Tsiphash)(unsafe.Pointer(H)).Fv2
  3210. (*Tsiphash)(unsafe.Pointer(H)).Fv2 = (*Tsiphash)(unsafe.Pointer(H)).Fv2<<libc.Int32FromInt32(32) | (*Tsiphash)(unsafe.Pointer(H)).Fv2>>(libc.Int32FromInt32(64)-libc.Int32FromInt32(32))
  3211. goto _1
  3212. _1:
  3213. ;
  3214. i++
  3215. }
  3216. }
  3217. func _sip24_init(tls *libc.TLS, H uintptr, key uintptr) (r uintptr) {
  3218. (*Tsiphash)(unsafe.Pointer(H)).Fv0 = libc.Uint64FromUint32(0x736f6d65)<<libc.Int32FromInt32(32) | uint64(libc.Uint32FromUint32(0x70736575)) ^ *(*Tuint64_t)(unsafe.Pointer(key))
  3219. (*Tsiphash)(unsafe.Pointer(H)).Fv1 = libc.Uint64FromUint32(0x646f7261)<<libc.Int32FromInt32(32) | uint64(libc.Uint32FromUint32(0x6e646f6d)) ^ *(*Tuint64_t)(unsafe.Pointer(key + 1*8))
  3220. (*Tsiphash)(unsafe.Pointer(H)).Fv2 = libc.Uint64FromUint32(0x6c796765)<<libc.Int32FromInt32(32) | uint64(libc.Uint32FromUint32(0x6e657261)) ^ *(*Tuint64_t)(unsafe.Pointer(key))
  3221. (*Tsiphash)(unsafe.Pointer(H)).Fv3 = libc.Uint64FromUint32(0x74656462)<<libc.Int32FromInt32(32) | uint64(libc.Uint32FromUint32(0x79746573)) ^ *(*Tuint64_t)(unsafe.Pointer(key + 1*8))
  3222. (*Tsiphash)(unsafe.Pointer(H)).Fp = H + 32
  3223. (*Tsiphash)(unsafe.Pointer(H)).Fc = uint64(0)
  3224. return H
  3225. }
  3226. func _sip24_update(tls *libc.TLS, H uintptr, src uintptr, len1 Tsize_t) (r uintptr) {
  3227. var m Tuint64_t
  3228. var p, pe, v1, v2, v3 uintptr
  3229. _, _, _, _, _, _ = m, p, pe, v1, v2, v3
  3230. p = src
  3231. pe = p + uintptr(len1)
  3232. for cond := true; cond; cond = p < pe {
  3233. for p < pe && (*Tsiphash)(unsafe.Pointer(H)).Fp < H+32+uintptr(libc.Uint64FromInt64(8)/libc.Uint64FromInt64(1)) {
  3234. v2 = H + 40
  3235. v1 = *(*uintptr)(unsafe.Pointer(v2))
  3236. *(*uintptr)(unsafe.Pointer(v2))++
  3237. v3 = p
  3238. p++
  3239. *(*uint8)(unsafe.Pointer(v1)) = *(*uint8)(unsafe.Pointer(v3))
  3240. }
  3241. if (*Tsiphash)(unsafe.Pointer(H)).Fp < H+32+uintptr(libc.Uint64FromInt64(8)/libc.Uint64FromInt64(1)) {
  3242. break
  3243. }
  3244. m = uint64(*(*uint8)(unsafe.Pointer(H + 32)))<<libc.Int32FromInt32(0) | uint64(*(*uint8)(unsafe.Pointer(H + 32 + 1)))<<libc.Int32FromInt32(8) | uint64(*(*uint8)(unsafe.Pointer(H + 32 + 2)))<<libc.Int32FromInt32(16) | uint64(*(*uint8)(unsafe.Pointer(H + 32 + 3)))<<libc.Int32FromInt32(24) | uint64(*(*uint8)(unsafe.Pointer(H + 32 + 4)))<<libc.Int32FromInt32(32) | uint64(*(*uint8)(unsafe.Pointer(H + 32 + 5)))<<libc.Int32FromInt32(40) | uint64(*(*uint8)(unsafe.Pointer(H + 32 + 6)))<<libc.Int32FromInt32(48) | uint64(*(*uint8)(unsafe.Pointer(H + 32 + 7)))<<libc.Int32FromInt32(56)
  3245. *(*Tuint64_t)(unsafe.Pointer(H + 24)) ^= m
  3246. _sip_round(tls, H, int32(2))
  3247. *(*Tuint64_t)(unsafe.Pointer(H)) ^= m
  3248. (*Tsiphash)(unsafe.Pointer(H)).Fp = H + 32
  3249. *(*Tuint64_t)(unsafe.Pointer(H + 48)) += uint64(8)
  3250. }
  3251. return H
  3252. }
  3253. func _sip24_final(tls *libc.TLS, H uintptr) (r Tuint64_t) {
  3254. var b Tuint64_t
  3255. var left int8
  3256. _, _ = b, left
  3257. left = int8(int64((*Tsiphash)(unsafe.Pointer(H)).Fp) - t__predefined_ptrdiff_t(H+32))
  3258. b = ((*Tsiphash)(unsafe.Pointer(H)).Fc + libc.Uint64FromInt8(left)) << int32(56)
  3259. switch int32(left) {
  3260. case int32(7):
  3261. b |= uint64(*(*uint8)(unsafe.Pointer(H + 32 + 6))) << int32(48)
  3262. fallthrough
  3263. case int32(6):
  3264. b |= uint64(*(*uint8)(unsafe.Pointer(H + 32 + 5))) << int32(40)
  3265. fallthrough
  3266. case int32(5):
  3267. b |= uint64(*(*uint8)(unsafe.Pointer(H + 32 + 4))) << int32(32)
  3268. fallthrough
  3269. case int32(4):
  3270. b |= uint64(*(*uint8)(unsafe.Pointer(H + 32 + 3))) << int32(24)
  3271. fallthrough
  3272. case int32(3):
  3273. b |= uint64(*(*uint8)(unsafe.Pointer(H + 32 + 2))) << int32(16)
  3274. fallthrough
  3275. case int32(2):
  3276. b |= uint64(*(*uint8)(unsafe.Pointer(H + 32 + 1))) << int32(8)
  3277. fallthrough
  3278. case int32(1):
  3279. b |= uint64(*(*uint8)(unsafe.Pointer(H + 32))) << 0
  3280. fallthrough
  3281. case 0:
  3282. break
  3283. }
  3284. *(*Tuint64_t)(unsafe.Pointer(H + 24)) ^= b
  3285. _sip_round(tls, H, int32(2))
  3286. *(*Tuint64_t)(unsafe.Pointer(H)) ^= b
  3287. *(*Tuint64_t)(unsafe.Pointer(H + 16)) ^= uint64(0xff)
  3288. _sip_round(tls, H, int32(4))
  3289. return (*Tsiphash)(unsafe.Pointer(H)).Fv0 ^ (*Tsiphash)(unsafe.Pointer(H)).Fv1 ^ (*Tsiphash)(unsafe.Pointer(H)).Fv2 ^ (*Tsiphash)(unsafe.Pointer(H)).Fv3
  3290. }
  3291. func _siphash24(tls *libc.TLS, src uintptr, len1 Tsize_t, key uintptr) (r Tuint64_t) {
  3292. bp := tls.Alloc(64)
  3293. defer tls.Free(64)
  3294. var _ /* state at bp+0 */ Tsiphash
  3295. *(*Tsiphash)(unsafe.Pointer(bp)) = Tsiphash{}
  3296. return _sip24_final(tls, _sip24_update(tls, _sip24_init(tls, bp, key), src, len1))
  3297. }
  3298. func _sip24_valid(tls *libc.TLS) (r int32) {
  3299. bp := tls.Alloc(80)
  3300. defer tls.Free(80)
  3301. var i Tsize_t
  3302. var _ /* in at bp+0 */ [64]uint8
  3303. var _ /* k at bp+64 */ Tsipkey
  3304. _ = i
  3305. _sip_tokey(tls, bp+64, __ccgo_ts)
  3306. i = uint64(0)
  3307. for {
  3308. if !(i < uint64(64)) {
  3309. break
  3310. }
  3311. (*(*[64]uint8)(unsafe.Pointer(bp)))[i] = uint8(i)
  3312. if _siphash24(tls, bp, i, bp+64) != uint64(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_vectors)) + uintptr(i)*8)))<<libc.Int32FromInt32(0)|uint64(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_vectors)) + uintptr(i)*8 + 1)))<<libc.Int32FromInt32(8)|uint64(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_vectors)) + uintptr(i)*8 + 2)))<<libc.Int32FromInt32(16)|uint64(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_vectors)) + uintptr(i)*8 + 3)))<<libc.Int32FromInt32(24)|uint64(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_vectors)) + uintptr(i)*8 + 4)))<<libc.Int32FromInt32(32)|uint64(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_vectors)) + uintptr(i)*8 + 5)))<<libc.Int32FromInt32(40)|uint64(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_vectors)) + uintptr(i)*8 + 6)))<<libc.Int32FromInt32(48)|uint64(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_vectors)) + uintptr(i)*8 + 7)))<<libc.Int32FromInt32(56) {
  3313. return 0
  3314. }
  3315. goto _1
  3316. _1:
  3317. ;
  3318. i++
  3319. }
  3320. return int32(1)
  3321. }
  3322. var _vectors = [64][8]uint8{
  3323. 0: {
  3324. 0: uint8(0x31),
  3325. 1: uint8(0x0e),
  3326. 2: uint8(0x0e),
  3327. 3: uint8(0xdd),
  3328. 4: uint8(0x47),
  3329. 5: uint8(0xdb),
  3330. 6: uint8(0x6f),
  3331. 7: uint8(0x72),
  3332. },
  3333. 1: {
  3334. 0: uint8(0xfd),
  3335. 1: uint8(0x67),
  3336. 2: uint8(0xdc),
  3337. 3: uint8(0x93),
  3338. 4: uint8(0xc5),
  3339. 5: uint8(0x39),
  3340. 6: uint8(0xf8),
  3341. 7: uint8(0x74),
  3342. },
  3343. 2: {
  3344. 0: uint8(0x5a),
  3345. 1: uint8(0x4f),
  3346. 2: uint8(0xa9),
  3347. 3: uint8(0xd9),
  3348. 4: uint8(0x09),
  3349. 5: uint8(0x80),
  3350. 6: uint8(0x6c),
  3351. 7: uint8(0x0d),
  3352. },
  3353. 3: {
  3354. 0: uint8(0x2d),
  3355. 1: uint8(0x7e),
  3356. 2: uint8(0xfb),
  3357. 3: uint8(0xd7),
  3358. 4: uint8(0x96),
  3359. 5: uint8(0x66),
  3360. 6: uint8(0x67),
  3361. 7: uint8(0x85),
  3362. },
  3363. 4: {
  3364. 0: uint8(0xb7),
  3365. 1: uint8(0x87),
  3366. 2: uint8(0x71),
  3367. 3: uint8(0x27),
  3368. 4: uint8(0xe0),
  3369. 5: uint8(0x94),
  3370. 6: uint8(0x27),
  3371. 7: uint8(0xcf),
  3372. },
  3373. 5: {
  3374. 0: uint8(0x8d),
  3375. 1: uint8(0xa6),
  3376. 2: uint8(0x99),
  3377. 3: uint8(0xcd),
  3378. 4: uint8(0x64),
  3379. 5: uint8(0x55),
  3380. 6: uint8(0x76),
  3381. 7: uint8(0x18),
  3382. },
  3383. 6: {
  3384. 0: uint8(0xce),
  3385. 1: uint8(0xe3),
  3386. 2: uint8(0xfe),
  3387. 3: uint8(0x58),
  3388. 4: uint8(0x6e),
  3389. 5: uint8(0x46),
  3390. 6: uint8(0xc9),
  3391. 7: uint8(0xcb),
  3392. },
  3393. 7: {
  3394. 0: uint8(0x37),
  3395. 1: uint8(0xd1),
  3396. 2: uint8(0x01),
  3397. 3: uint8(0x8b),
  3398. 4: uint8(0xf5),
  3399. 6: uint8(0x02),
  3400. 7: uint8(0xab),
  3401. },
  3402. 8: {
  3403. 0: uint8(0x62),
  3404. 1: uint8(0x24),
  3405. 2: uint8(0x93),
  3406. 3: uint8(0x9a),
  3407. 4: uint8(0x79),
  3408. 5: uint8(0xf5),
  3409. 6: uint8(0xf5),
  3410. 7: uint8(0x93),
  3411. },
  3412. 9: {
  3413. 0: uint8(0xb0),
  3414. 1: uint8(0xe4),
  3415. 2: uint8(0xa9),
  3416. 3: uint8(0x0b),
  3417. 4: uint8(0xdf),
  3418. 5: uint8(0x82),
  3419. 7: uint8(0x9e),
  3420. },
  3421. 10: {
  3422. 0: uint8(0xf3),
  3423. 1: uint8(0xb9),
  3424. 2: uint8(0xdd),
  3425. 3: uint8(0x94),
  3426. 4: uint8(0xc5),
  3427. 5: uint8(0xbb),
  3428. 6: uint8(0x5d),
  3429. 7: uint8(0x7a),
  3430. },
  3431. 11: {
  3432. 0: uint8(0xa7),
  3433. 1: uint8(0xad),
  3434. 2: uint8(0x6b),
  3435. 3: uint8(0x22),
  3436. 4: uint8(0x46),
  3437. 5: uint8(0x2f),
  3438. 6: uint8(0xb3),
  3439. 7: uint8(0xf4),
  3440. },
  3441. 12: {
  3442. 0: uint8(0xfb),
  3443. 1: uint8(0xe5),
  3444. 2: uint8(0x0e),
  3445. 3: uint8(0x86),
  3446. 4: uint8(0xbc),
  3447. 5: uint8(0x8f),
  3448. 6: uint8(0x1e),
  3449. 7: uint8(0x75),
  3450. },
  3451. 13: {
  3452. 0: uint8(0x90),
  3453. 1: uint8(0x3d),
  3454. 2: uint8(0x84),
  3455. 3: uint8(0xc0),
  3456. 4: uint8(0x27),
  3457. 5: uint8(0x56),
  3458. 6: uint8(0xea),
  3459. 7: uint8(0x14),
  3460. },
  3461. 14: {
  3462. 0: uint8(0xee),
  3463. 1: uint8(0xf2),
  3464. 2: uint8(0x7a),
  3465. 3: uint8(0x8e),
  3466. 4: uint8(0x90),
  3467. 5: uint8(0xca),
  3468. 6: uint8(0x23),
  3469. 7: uint8(0xf7),
  3470. },
  3471. 15: {
  3472. 0: uint8(0xe5),
  3473. 1: uint8(0x45),
  3474. 2: uint8(0xbe),
  3475. 3: uint8(0x49),
  3476. 4: uint8(0x61),
  3477. 5: uint8(0xca),
  3478. 6: uint8(0x29),
  3479. 7: uint8(0xa1),
  3480. },
  3481. 16: {
  3482. 0: uint8(0xdb),
  3483. 1: uint8(0x9b),
  3484. 2: uint8(0xc2),
  3485. 3: uint8(0x57),
  3486. 4: uint8(0x7f),
  3487. 5: uint8(0xcc),
  3488. 6: uint8(0x2a),
  3489. 7: uint8(0x3f),
  3490. },
  3491. 17: {
  3492. 0: uint8(0x94),
  3493. 1: uint8(0x47),
  3494. 2: uint8(0xbe),
  3495. 3: uint8(0x2c),
  3496. 4: uint8(0xf5),
  3497. 5: uint8(0xe9),
  3498. 6: uint8(0x9a),
  3499. 7: uint8(0x69),
  3500. },
  3501. 18: {
  3502. 0: uint8(0x9c),
  3503. 1: uint8(0xd3),
  3504. 2: uint8(0x8d),
  3505. 3: uint8(0x96),
  3506. 4: uint8(0xf0),
  3507. 5: uint8(0xb3),
  3508. 6: uint8(0xc1),
  3509. 7: uint8(0x4b),
  3510. },
  3511. 19: {
  3512. 0: uint8(0xbd),
  3513. 1: uint8(0x61),
  3514. 2: uint8(0x79),
  3515. 3: uint8(0xa7),
  3516. 4: uint8(0x1d),
  3517. 5: uint8(0xc9),
  3518. 6: uint8(0x6d),
  3519. 7: uint8(0xbb),
  3520. },
  3521. 20: {
  3522. 0: uint8(0x98),
  3523. 1: uint8(0xee),
  3524. 2: uint8(0xa2),
  3525. 3: uint8(0x1a),
  3526. 4: uint8(0xf2),
  3527. 5: uint8(0x5c),
  3528. 6: uint8(0xd6),
  3529. 7: uint8(0xbe),
  3530. },
  3531. 21: {
  3532. 0: uint8(0xc7),
  3533. 1: uint8(0x67),
  3534. 2: uint8(0x3b),
  3535. 3: uint8(0x2e),
  3536. 4: uint8(0xb0),
  3537. 5: uint8(0xcb),
  3538. 6: uint8(0xf2),
  3539. 7: uint8(0xd0),
  3540. },
  3541. 22: {
  3542. 0: uint8(0x88),
  3543. 1: uint8(0x3e),
  3544. 2: uint8(0xa3),
  3545. 3: uint8(0xe3),
  3546. 4: uint8(0x95),
  3547. 5: uint8(0x67),
  3548. 6: uint8(0x53),
  3549. 7: uint8(0x93),
  3550. },
  3551. 23: {
  3552. 0: uint8(0xc8),
  3553. 1: uint8(0xce),
  3554. 2: uint8(0x5c),
  3555. 3: uint8(0xcd),
  3556. 4: uint8(0x8c),
  3557. 5: uint8(0x03),
  3558. 6: uint8(0x0c),
  3559. 7: uint8(0xa8),
  3560. },
  3561. 24: {
  3562. 0: uint8(0x94),
  3563. 1: uint8(0xaf),
  3564. 2: uint8(0x49),
  3565. 3: uint8(0xf6),
  3566. 4: uint8(0xc6),
  3567. 5: uint8(0x50),
  3568. 6: uint8(0xad),
  3569. 7: uint8(0xb8),
  3570. },
  3571. 25: {
  3572. 0: uint8(0xea),
  3573. 1: uint8(0xb8),
  3574. 2: uint8(0x85),
  3575. 3: uint8(0x8a),
  3576. 4: uint8(0xde),
  3577. 5: uint8(0x92),
  3578. 6: uint8(0xe1),
  3579. 7: uint8(0xbc),
  3580. },
  3581. 26: {
  3582. 0: uint8(0xf3),
  3583. 1: uint8(0x15),
  3584. 2: uint8(0xbb),
  3585. 3: uint8(0x5b),
  3586. 4: uint8(0xb8),
  3587. 5: uint8(0x35),
  3588. 6: uint8(0xd8),
  3589. 7: uint8(0x17),
  3590. },
  3591. 27: {
  3592. 0: uint8(0xad),
  3593. 1: uint8(0xcf),
  3594. 2: uint8(0x6b),
  3595. 3: uint8(0x07),
  3596. 4: uint8(0x63),
  3597. 5: uint8(0x61),
  3598. 6: uint8(0x2e),
  3599. 7: uint8(0x2f),
  3600. },
  3601. 28: {
  3602. 0: uint8(0xa5),
  3603. 1: uint8(0xc9),
  3604. 2: uint8(0x1d),
  3605. 3: uint8(0xa7),
  3606. 4: uint8(0xac),
  3607. 5: uint8(0xaa),
  3608. 6: uint8(0x4d),
  3609. 7: uint8(0xde),
  3610. },
  3611. 29: {
  3612. 0: uint8(0x71),
  3613. 1: uint8(0x65),
  3614. 2: uint8(0x95),
  3615. 3: uint8(0x87),
  3616. 4: uint8(0x66),
  3617. 5: uint8(0x50),
  3618. 6: uint8(0xa2),
  3619. 7: uint8(0xa6),
  3620. },
  3621. 30: {
  3622. 0: uint8(0x28),
  3623. 1: uint8(0xef),
  3624. 2: uint8(0x49),
  3625. 3: uint8(0x5c),
  3626. 4: uint8(0x53),
  3627. 5: uint8(0xa3),
  3628. 6: uint8(0x87),
  3629. 7: uint8(0xad),
  3630. },
  3631. 31: {
  3632. 0: uint8(0x42),
  3633. 1: uint8(0xc3),
  3634. 2: uint8(0x41),
  3635. 3: uint8(0xd8),
  3636. 4: uint8(0xfa),
  3637. 5: uint8(0x92),
  3638. 6: uint8(0xd8),
  3639. 7: uint8(0x32),
  3640. },
  3641. 32: {
  3642. 0: uint8(0xce),
  3643. 1: uint8(0x7c),
  3644. 2: uint8(0xf2),
  3645. 3: uint8(0x72),
  3646. 4: uint8(0x2f),
  3647. 5: uint8(0x51),
  3648. 6: uint8(0x27),
  3649. 7: uint8(0x71),
  3650. },
  3651. 33: {
  3652. 0: uint8(0xe3),
  3653. 1: uint8(0x78),
  3654. 2: uint8(0x59),
  3655. 3: uint8(0xf9),
  3656. 4: uint8(0x46),
  3657. 5: uint8(0x23),
  3658. 6: uint8(0xf3),
  3659. 7: uint8(0xa7),
  3660. },
  3661. 34: {
  3662. 0: uint8(0x38),
  3663. 1: uint8(0x12),
  3664. 2: uint8(0x05),
  3665. 3: uint8(0xbb),
  3666. 4: uint8(0x1a),
  3667. 5: uint8(0xb0),
  3668. 6: uint8(0xe0),
  3669. 7: uint8(0x12),
  3670. },
  3671. 35: {
  3672. 0: uint8(0xae),
  3673. 1: uint8(0x97),
  3674. 2: uint8(0xa1),
  3675. 3: uint8(0x0f),
  3676. 4: uint8(0xd4),
  3677. 5: uint8(0x34),
  3678. 6: uint8(0xe0),
  3679. 7: uint8(0x15),
  3680. },
  3681. 36: {
  3682. 0: uint8(0xb4),
  3683. 1: uint8(0xa3),
  3684. 2: uint8(0x15),
  3685. 3: uint8(0x08),
  3686. 4: uint8(0xbe),
  3687. 5: uint8(0xff),
  3688. 6: uint8(0x4d),
  3689. 7: uint8(0x31),
  3690. },
  3691. 37: {
  3692. 0: uint8(0x81),
  3693. 1: uint8(0x39),
  3694. 2: uint8(0x62),
  3695. 3: uint8(0x29),
  3696. 4: uint8(0xf0),
  3697. 5: uint8(0x90),
  3698. 6: uint8(0x79),
  3699. 7: uint8(0x02),
  3700. },
  3701. 38: {
  3702. 0: uint8(0x4d),
  3703. 1: uint8(0x0c),
  3704. 2: uint8(0xf4),
  3705. 3: uint8(0x9e),
  3706. 4: uint8(0xe5),
  3707. 5: uint8(0xd4),
  3708. 6: uint8(0xdc),
  3709. 7: uint8(0xca),
  3710. },
  3711. 39: {
  3712. 0: uint8(0x5c),
  3713. 1: uint8(0x73),
  3714. 2: uint8(0x33),
  3715. 3: uint8(0x6a),
  3716. 4: uint8(0x76),
  3717. 5: uint8(0xd8),
  3718. 6: uint8(0xbf),
  3719. 7: uint8(0x9a),
  3720. },
  3721. 40: {
  3722. 0: uint8(0xd0),
  3723. 1: uint8(0xa7),
  3724. 2: uint8(0x04),
  3725. 3: uint8(0x53),
  3726. 4: uint8(0x6b),
  3727. 5: uint8(0xa9),
  3728. 6: uint8(0x3e),
  3729. 7: uint8(0x0e),
  3730. },
  3731. 41: {
  3732. 0: uint8(0x92),
  3733. 1: uint8(0x59),
  3734. 2: uint8(0x58),
  3735. 3: uint8(0xfc),
  3736. 4: uint8(0xd6),
  3737. 5: uint8(0x42),
  3738. 6: uint8(0x0c),
  3739. 7: uint8(0xad),
  3740. },
  3741. 42: {
  3742. 0: uint8(0xa9),
  3743. 1: uint8(0x15),
  3744. 2: uint8(0xc2),
  3745. 3: uint8(0x9b),
  3746. 4: uint8(0xc8),
  3747. 5: uint8(0x06),
  3748. 6: uint8(0x73),
  3749. 7: uint8(0x18),
  3750. },
  3751. 43: {
  3752. 0: uint8(0x95),
  3753. 1: uint8(0x2b),
  3754. 2: uint8(0x79),
  3755. 3: uint8(0xf3),
  3756. 4: uint8(0xbc),
  3757. 5: uint8(0x0a),
  3758. 6: uint8(0xa6),
  3759. 7: uint8(0xd4),
  3760. },
  3761. 44: {
  3762. 0: uint8(0xf2),
  3763. 1: uint8(0x1d),
  3764. 2: uint8(0xf2),
  3765. 3: uint8(0xe4),
  3766. 4: uint8(0x1d),
  3767. 5: uint8(0x45),
  3768. 6: uint8(0x35),
  3769. 7: uint8(0xf9),
  3770. },
  3771. 45: {
  3772. 0: uint8(0x87),
  3773. 1: uint8(0x57),
  3774. 2: uint8(0x75),
  3775. 3: uint8(0x19),
  3776. 4: uint8(0x04),
  3777. 5: uint8(0x8f),
  3778. 6: uint8(0x53),
  3779. 7: uint8(0xa9),
  3780. },
  3781. 46: {
  3782. 0: uint8(0x10),
  3783. 1: uint8(0xa5),
  3784. 2: uint8(0x6c),
  3785. 3: uint8(0xf5),
  3786. 4: uint8(0xdf),
  3787. 5: uint8(0xcd),
  3788. 6: uint8(0x9a),
  3789. 7: uint8(0xdb),
  3790. },
  3791. 47: {
  3792. 0: uint8(0xeb),
  3793. 1: uint8(0x75),
  3794. 2: uint8(0x09),
  3795. 3: uint8(0x5c),
  3796. 4: uint8(0xcd),
  3797. 5: uint8(0x98),
  3798. 6: uint8(0x6c),
  3799. 7: uint8(0xd0),
  3800. },
  3801. 48: {
  3802. 0: uint8(0x51),
  3803. 1: uint8(0xa9),
  3804. 2: uint8(0xcb),
  3805. 3: uint8(0x9e),
  3806. 4: uint8(0xcb),
  3807. 5: uint8(0xa3),
  3808. 6: uint8(0x12),
  3809. 7: uint8(0xe6),
  3810. },
  3811. 49: {
  3812. 0: uint8(0x96),
  3813. 1: uint8(0xaf),
  3814. 2: uint8(0xad),
  3815. 3: uint8(0xfc),
  3816. 4: uint8(0x2c),
  3817. 5: uint8(0xe6),
  3818. 6: uint8(0x66),
  3819. 7: uint8(0xc7),
  3820. },
  3821. 50: {
  3822. 0: uint8(0x72),
  3823. 1: uint8(0xfe),
  3824. 2: uint8(0x52),
  3825. 3: uint8(0x97),
  3826. 4: uint8(0x5a),
  3827. 5: uint8(0x43),
  3828. 6: uint8(0x64),
  3829. 7: uint8(0xee),
  3830. },
  3831. 51: {
  3832. 0: uint8(0x5a),
  3833. 1: uint8(0x16),
  3834. 2: uint8(0x45),
  3835. 3: uint8(0xb2),
  3836. 4: uint8(0x76),
  3837. 5: uint8(0xd5),
  3838. 6: uint8(0x92),
  3839. 7: uint8(0xa1),
  3840. },
  3841. 52: {
  3842. 0: uint8(0xb2),
  3843. 1: uint8(0x74),
  3844. 2: uint8(0xcb),
  3845. 3: uint8(0x8e),
  3846. 4: uint8(0xbf),
  3847. 5: uint8(0x87),
  3848. 6: uint8(0x87),
  3849. 7: uint8(0x0a),
  3850. },
  3851. 53: {
  3852. 0: uint8(0x6f),
  3853. 1: uint8(0x9b),
  3854. 2: uint8(0xb4),
  3855. 3: uint8(0x20),
  3856. 4: uint8(0x3d),
  3857. 5: uint8(0xe7),
  3858. 6: uint8(0xb3),
  3859. 7: uint8(0x81),
  3860. },
  3861. 54: {
  3862. 0: uint8(0xea),
  3863. 1: uint8(0xec),
  3864. 2: uint8(0xb2),
  3865. 3: uint8(0xa3),
  3866. 4: uint8(0x0b),
  3867. 5: uint8(0x22),
  3868. 6: uint8(0xa8),
  3869. 7: uint8(0x7f),
  3870. },
  3871. 55: {
  3872. 0: uint8(0x99),
  3873. 1: uint8(0x24),
  3874. 2: uint8(0xa4),
  3875. 3: uint8(0x3c),
  3876. 4: uint8(0xc1),
  3877. 5: uint8(0x31),
  3878. 6: uint8(0x57),
  3879. 7: uint8(0x24),
  3880. },
  3881. 56: {
  3882. 0: uint8(0xbd),
  3883. 1: uint8(0x83),
  3884. 2: uint8(0x8d),
  3885. 3: uint8(0x3a),
  3886. 4: uint8(0xaf),
  3887. 5: uint8(0xbf),
  3888. 6: uint8(0x8d),
  3889. 7: uint8(0xb7),
  3890. },
  3891. 57: {
  3892. 0: uint8(0x0b),
  3893. 1: uint8(0x1a),
  3894. 2: uint8(0x2a),
  3895. 3: uint8(0x32),
  3896. 4: uint8(0x65),
  3897. 5: uint8(0xd5),
  3898. 6: uint8(0x1a),
  3899. 7: uint8(0xea),
  3900. },
  3901. 58: {
  3902. 0: uint8(0x13),
  3903. 1: uint8(0x50),
  3904. 2: uint8(0x79),
  3905. 3: uint8(0xa3),
  3906. 4: uint8(0x23),
  3907. 5: uint8(0x1c),
  3908. 6: uint8(0xe6),
  3909. 7: uint8(0x60),
  3910. },
  3911. 59: {
  3912. 0: uint8(0x93),
  3913. 1: uint8(0x2b),
  3914. 2: uint8(0x28),
  3915. 3: uint8(0x46),
  3916. 4: uint8(0xe4),
  3917. 5: uint8(0xd7),
  3918. 6: uint8(0x06),
  3919. 7: uint8(0x66),
  3920. },
  3921. 60: {
  3922. 0: uint8(0xe1),
  3923. 1: uint8(0x91),
  3924. 2: uint8(0x5f),
  3925. 3: uint8(0x5c),
  3926. 4: uint8(0xb1),
  3927. 5: uint8(0xec),
  3928. 6: uint8(0xa4),
  3929. 7: uint8(0x6c),
  3930. },
  3931. 61: {
  3932. 0: uint8(0xf3),
  3933. 1: uint8(0x25),
  3934. 2: uint8(0x96),
  3935. 3: uint8(0x5c),
  3936. 4: uint8(0xa1),
  3937. 5: uint8(0x6d),
  3938. 6: uint8(0x62),
  3939. 7: uint8(0x9f),
  3940. },
  3941. 62: {
  3942. 0: uint8(0x57),
  3943. 1: uint8(0x5f),
  3944. 2: uint8(0xf2),
  3945. 3: uint8(0x8e),
  3946. 4: uint8(0x60),
  3947. 5: uint8(0x38),
  3948. 6: uint8(0x1b),
  3949. 7: uint8(0xe5),
  3950. },
  3951. 63: {
  3952. 0: uint8(0x72),
  3953. 1: uint8(0x45),
  3954. 2: uint8(0x06),
  3955. 3: uint8(0xeb),
  3956. 4: uint8(0x4c),
  3957. 5: uint8(0x32),
  3958. 6: uint8(0x8a),
  3959. 7: uint8(0x95),
  3960. },
  3961. }
  3962. /* sip24_valid() */
  3963. type TICHAR = int8
  3964. type TPOSITION = struct {
  3965. FlineNumber TXML_Size
  3966. FcolumnNumber TXML_Size
  3967. }
  3968. type Tposition = TPOSITION
  3969. type TATTRIBUTE = struct {
  3970. Fname uintptr
  3971. FvaluePtr uintptr
  3972. FvalueEnd uintptr
  3973. Fnormalized int8
  3974. }
  3975. type Tencoding = struct {
  3976. Fscanners [4]TSCANNER
  3977. FliteralScanners [2]TSCANNER
  3978. FnameMatchesAscii uintptr
  3979. FnameLength uintptr
  3980. FskipS uintptr
  3981. FgetAtts uintptr
  3982. FcharRefNumber uintptr
  3983. FpredefinedEntityName uintptr
  3984. FupdatePosition uintptr
  3985. FisPublicId uintptr
  3986. Futf8Convert uintptr
  3987. Futf16Convert uintptr
  3988. FminBytesPerChar int32
  3989. FisUtf8 int8
  3990. FisUtf16 int8
  3991. }
  3992. type TENCODING = struct {
  3993. Fscanners [4]TSCANNER
  3994. FliteralScanners [2]TSCANNER
  3995. FnameMatchesAscii uintptr
  3996. FnameLength uintptr
  3997. FskipS uintptr
  3998. FgetAtts uintptr
  3999. FcharRefNumber uintptr
  4000. FpredefinedEntityName uintptr
  4001. FupdatePosition uintptr
  4002. FisPublicId uintptr
  4003. Futf8Convert uintptr
  4004. Futf16Convert uintptr
  4005. FminBytesPerChar int32
  4006. FisUtf8 int8
  4007. FisUtf16 int8
  4008. }
  4009. type TSCANNER = uintptr
  4010. type _XML_Convert_Result = int32
  4011. const _XML_CONVERT_COMPLETED = 0
  4012. const _XML_CONVERT_INPUT_INCOMPLETE = 1
  4013. const _XML_CONVERT_OUTPUT_EXHAUSTED = 2
  4014. type TINIT_ENCODING = struct {
  4015. FinitEnc TENCODING
  4016. FencPtr uintptr
  4017. }
  4018. type TCONVERTER = uintptr
  4019. const _XML_ROLE_ERROR = -1
  4020. const _XML_ROLE_NONE = 0
  4021. const _XML_ROLE_XML_DECL = 1
  4022. const _XML_ROLE_INSTANCE_START = 2
  4023. const _XML_ROLE_DOCTYPE_NONE = 3
  4024. const _XML_ROLE_DOCTYPE_NAME = 4
  4025. const _XML_ROLE_DOCTYPE_SYSTEM_ID = 5
  4026. const _XML_ROLE_DOCTYPE_PUBLIC_ID = 6
  4027. const _XML_ROLE_DOCTYPE_INTERNAL_SUBSET = 7
  4028. const _XML_ROLE_DOCTYPE_CLOSE = 8
  4029. const _XML_ROLE_GENERAL_ENTITY_NAME = 9
  4030. const _XML_ROLE_PARAM_ENTITY_NAME = 10
  4031. const _XML_ROLE_ENTITY_NONE = 11
  4032. const _XML_ROLE_ENTITY_VALUE = 12
  4033. const _XML_ROLE_ENTITY_SYSTEM_ID = 13
  4034. const _XML_ROLE_ENTITY_PUBLIC_ID = 14
  4035. const _XML_ROLE_ENTITY_COMPLETE = 15
  4036. const _XML_ROLE_ENTITY_NOTATION_NAME = 16
  4037. const _XML_ROLE_NOTATION_NONE = 17
  4038. const _XML_ROLE_NOTATION_NAME = 18
  4039. const _XML_ROLE_NOTATION_SYSTEM_ID = 19
  4040. const _XML_ROLE_NOTATION_NO_SYSTEM_ID = 20
  4041. const _XML_ROLE_NOTATION_PUBLIC_ID = 21
  4042. const _XML_ROLE_ATTRIBUTE_NAME = 22
  4043. const _XML_ROLE_ATTRIBUTE_TYPE_CDATA = 23
  4044. const _XML_ROLE_ATTRIBUTE_TYPE_ID = 24
  4045. const _XML_ROLE_ATTRIBUTE_TYPE_IDREF = 25
  4046. const _XML_ROLE_ATTRIBUTE_TYPE_IDREFS = 26
  4047. const _XML_ROLE_ATTRIBUTE_TYPE_ENTITY = 27
  4048. const _XML_ROLE_ATTRIBUTE_TYPE_ENTITIES = 28
  4049. const _XML_ROLE_ATTRIBUTE_TYPE_NMTOKEN = 29
  4050. const _XML_ROLE_ATTRIBUTE_TYPE_NMTOKENS = 30
  4051. const _XML_ROLE_ATTRIBUTE_ENUM_VALUE = 31
  4052. const _XML_ROLE_ATTRIBUTE_NOTATION_VALUE = 32
  4053. const _XML_ROLE_ATTLIST_NONE = 33
  4054. const _XML_ROLE_ATTLIST_ELEMENT_NAME = 34
  4055. const _XML_ROLE_IMPLIED_ATTRIBUTE_VALUE = 35
  4056. const _XML_ROLE_REQUIRED_ATTRIBUTE_VALUE = 36
  4057. const _XML_ROLE_DEFAULT_ATTRIBUTE_VALUE = 37
  4058. const _XML_ROLE_FIXED_ATTRIBUTE_VALUE = 38
  4059. const _XML_ROLE_ELEMENT_NONE = 39
  4060. const _XML_ROLE_ELEMENT_NAME = 40
  4061. const _XML_ROLE_CONTENT_ANY = 41
  4062. const _XML_ROLE_CONTENT_EMPTY = 42
  4063. const _XML_ROLE_CONTENT_PCDATA = 43
  4064. const _XML_ROLE_GROUP_OPEN = 44
  4065. const _XML_ROLE_GROUP_CLOSE = 45
  4066. const _XML_ROLE_GROUP_CLOSE_REP = 46
  4067. const _XML_ROLE_GROUP_CLOSE_OPT = 47
  4068. const _XML_ROLE_GROUP_CLOSE_PLUS = 48
  4069. const _XML_ROLE_GROUP_CHOICE = 49
  4070. const _XML_ROLE_GROUP_SEQUENCE = 50
  4071. const _XML_ROLE_CONTENT_ELEMENT = 51
  4072. const _XML_ROLE_CONTENT_ELEMENT_REP = 52
  4073. const _XML_ROLE_CONTENT_ELEMENT_OPT = 53
  4074. const _XML_ROLE_CONTENT_ELEMENT_PLUS = 54
  4075. const _XML_ROLE_PI = 55
  4076. const _XML_ROLE_COMMENT = 56
  4077. const _XML_ROLE_TEXT_DECL = 57
  4078. const _XML_ROLE_IGNORE_SECT = 58
  4079. const _XML_ROLE_INNER_PARAM_ENTITY_REF = 59
  4080. const _XML_ROLE_PARAM_ENTITY_REF = 60
  4081. type TPROLOG_STATE = struct {
  4082. Fhandler uintptr
  4083. Flevel uint32
  4084. Frole_none int32
  4085. FincludeLevel uint32
  4086. FdocumentEntity int32
  4087. FinEntityValue int32
  4088. }
  4089. type Tprolog_state = TPROLOG_STATE
  4090. type TKEY = uintptr
  4091. type TNAMED = struct {
  4092. Fname TKEY
  4093. }
  4094. type THASH_TABLE = struct {
  4095. Fv uintptr
  4096. Fpower uint8
  4097. Fsize Tsize_t
  4098. Fused Tsize_t
  4099. Fmem uintptr
  4100. }
  4101. /* For probing (after a collision) we need a step size relative prime
  4102. to the hash table size, which is a power of 2. We use double-hashing,
  4103. since we can calculate a second hash value cheaply by taking those bits
  4104. of the first hash value that were discarded (masked out) when the table
  4105. index was calculated: index = hash & mask, where mask = table->size - 1.
  4106. We limit the maximum step size to table->size / 4 (mask >> 2) and make
  4107. it odd, since odd numbers are always relative prime to a power of 2.
  4108. */
  4109. type THASH_TABLE_ITER = struct {
  4110. Fp uintptr
  4111. Fend uintptr
  4112. }
  4113. type TBINDING = struct {
  4114. Fprefix uintptr
  4115. FnextTagBinding uintptr
  4116. FprevPrefixBinding uintptr
  4117. FattId uintptr
  4118. Furi uintptr
  4119. FuriLen int32
  4120. FuriAlloc int32
  4121. }
  4122. type Tbinding = TBINDING
  4123. type TPREFIX = struct {
  4124. Fname uintptr
  4125. Fbinding uintptr
  4126. }
  4127. type Tprefix = TPREFIX
  4128. type TTAG_NAME = struct {
  4129. Fstr uintptr
  4130. FlocalPart uintptr
  4131. Fprefix uintptr
  4132. FstrLen int32
  4133. FuriLen int32
  4134. FprefixLen int32
  4135. }
  4136. // C documentation
  4137. //
  4138. // /* TAG represents an open element.
  4139. // The name of the element is stored in both the document and API
  4140. // encodings. The memory buffer 'buf' is a separately-allocated
  4141. // memory area which stores the name. During the XML_Parse()/
  4142. // XMLParseBuffer() when the element is open, the memory for the 'raw'
  4143. // version of the name (in the document encoding) is shared with the
  4144. // document buffer. If the element is open across calls to
  4145. // XML_Parse()/XML_ParseBuffer(), the buffer is re-allocated to
  4146. // contain the 'raw' name as well.
  4147. //
  4148. // A parser re-uses these structures, maintaining a list of allocated
  4149. // TAG objects in a free list.
  4150. // */
  4151. type TTAG = struct {
  4152. Fparent uintptr
  4153. FrawName uintptr
  4154. FrawNameLength int32
  4155. Fname TTAG_NAME
  4156. Fbuf uintptr
  4157. FbufEnd uintptr
  4158. Fbindings uintptr
  4159. }
  4160. // C documentation
  4161. //
  4162. // /* TAG represents an open element.
  4163. // The name of the element is stored in both the document and API
  4164. // encodings. The memory buffer 'buf' is a separately-allocated
  4165. // memory area which stores the name. During the XML_Parse()/
  4166. // XMLParseBuffer() when the element is open, the memory for the 'raw'
  4167. // version of the name (in the document encoding) is shared with the
  4168. // document buffer. If the element is open across calls to
  4169. // XML_Parse()/XML_ParseBuffer(), the buffer is re-allocated to
  4170. // contain the 'raw' name as well.
  4171. //
  4172. // A parser re-uses these structures, maintaining a list of allocated
  4173. // TAG objects in a free list.
  4174. // */
  4175. type Ttag = TTAG
  4176. type TENTITY = struct {
  4177. Fname uintptr
  4178. FtextPtr uintptr
  4179. FtextLen int32
  4180. Fprocessed int32
  4181. FsystemId uintptr
  4182. Fbase uintptr
  4183. FpublicId uintptr
  4184. Fnotation uintptr
  4185. Fopen TXML_Bool
  4186. Fis_param TXML_Bool
  4187. Fis_internal TXML_Bool
  4188. }
  4189. type TCONTENT_SCAFFOLD = struct {
  4190. Ftype1 _XML_Content_Type
  4191. Fquant _XML_Content_Quant
  4192. Fname uintptr
  4193. Ffirstchild int32
  4194. Flastchild int32
  4195. Fchildcnt int32
  4196. Fnextsib int32
  4197. }
  4198. type TBLOCK = struct {
  4199. Fnext uintptr
  4200. Fsize int32
  4201. Fs [1]TXML_Char
  4202. }
  4203. type Tblock = TBLOCK
  4204. type TSTRING_POOL = struct {
  4205. Fblocks uintptr
  4206. FfreeBlocks uintptr
  4207. Fend uintptr
  4208. Fptr uintptr
  4209. Fstart uintptr
  4210. Fmem uintptr
  4211. }
  4212. // C documentation
  4213. //
  4214. // /* The XML_Char before the name is used to determine whether
  4215. // an attribute has been specified. */
  4216. type TATTRIBUTE_ID = struct {
  4217. Fname uintptr
  4218. Fprefix uintptr
  4219. FmaybeTokenized TXML_Bool
  4220. Fxmlns TXML_Bool
  4221. }
  4222. // C documentation
  4223. //
  4224. // /* The XML_Char before the name is used to determine whether
  4225. // an attribute has been specified. */
  4226. type Tattribute_id = TATTRIBUTE_ID
  4227. type TDEFAULT_ATTRIBUTE = struct {
  4228. Fid uintptr
  4229. FisCdata TXML_Bool
  4230. Fvalue uintptr
  4231. }
  4232. type TNS_ATT = struct {
  4233. Fversion uint64
  4234. Fhash uint64
  4235. FuriName uintptr
  4236. }
  4237. type TELEMENT_TYPE = struct {
  4238. Fname uintptr
  4239. Fprefix uintptr
  4240. FidAtt uintptr
  4241. FnDefaultAtts int32
  4242. FallocDefaultAtts int32
  4243. FdefaultAtts uintptr
  4244. }
  4245. type TDTD = struct {
  4246. FgeneralEntities THASH_TABLE
  4247. FelementTypes THASH_TABLE
  4248. FattributeIds THASH_TABLE
  4249. Fprefixes THASH_TABLE
  4250. Fpool TSTRING_POOL
  4251. FentityValuePool TSTRING_POOL
  4252. FkeepProcessing TXML_Bool
  4253. FhasParamEntityRefs TXML_Bool
  4254. Fstandalone TXML_Bool
  4255. FparamEntityRead TXML_Bool
  4256. FparamEntities THASH_TABLE
  4257. FdefaultPrefix TPREFIX
  4258. Fin_eldecl TXML_Bool
  4259. Fscaffold uintptr
  4260. FcontentStringLen uint32
  4261. FscaffSize uint32
  4262. FscaffCount uint32
  4263. FscaffLevel int32
  4264. FscaffIndex uintptr
  4265. }
  4266. type TOPEN_INTERNAL_ENTITY = struct {
  4267. FinternalEventPtr uintptr
  4268. FinternalEventEndPtr uintptr
  4269. Fnext uintptr
  4270. Fentity uintptr
  4271. FstartTagLevel int32
  4272. FbetweenDecl TXML_Bool
  4273. }
  4274. type Topen_internal_entity = TOPEN_INTERNAL_ENTITY
  4275. type _XML_Account = int32
  4276. const _XML_ACCOUNT_DIRECT = 0
  4277. const /* bytes directly passed to the Expat parser */
  4278. _XML_ACCOUNT_ENTITY_EXPANSION = 1
  4279. const /* intermediate bytes produced during entity
  4280. expansion */
  4281. _XML_ACCOUNT_NONE = 2
  4282. type TXmlBigCount = uint64
  4283. type TACCOUNTING = struct {
  4284. FcountBytesDirect TXmlBigCount
  4285. FcountBytesIndirect TXmlBigCount
  4286. FdebugLevel int32
  4287. FmaximumAmplificationFactor float32
  4288. FactivationThresholdBytes uint64
  4289. }
  4290. type Taccounting = TACCOUNTING
  4291. type TENTITY_STATS = struct {
  4292. FcountEverOpened uint32
  4293. FcurrentDepth uint32
  4294. FmaximumDepthSeen uint32
  4295. FdebugLevel int32
  4296. }
  4297. type Tentity_stats = TENTITY_STATS
  4298. func XXML_ParserCreate(tls *libc.TLS, encodingName uintptr) (r TXML_Parser) {
  4299. return XXML_ParserCreate_MM(tls, encodingName, libc.UintptrFromInt32(0), libc.UintptrFromInt32(0))
  4300. }
  4301. func XXML_ParserCreateNS(tls *libc.TLS, encodingName uintptr, nsSep TXML_Char) (r TXML_Parser) {
  4302. bp := tls.Alloc(16)
  4303. defer tls.Free(16)
  4304. var _ /* tmp at bp+0 */ [2]TXML_Char
  4305. *(*[2]TXML_Char)(unsafe.Pointer(bp)) = [2]TXML_Char{
  4306. 0: nsSep,
  4307. }
  4308. return XXML_ParserCreate_MM(tls, encodingName, libc.UintptrFromInt32(0), bp)
  4309. }
  4310. // C documentation
  4311. //
  4312. // // "xml=http://www.w3.org/XML/1998/namespace"
  4313. var _implicitContext = [41]TXML_Char{
  4314. 0: int8(m_ASCII_x),
  4315. 1: int8(m_ASCII_m),
  4316. 2: int8(m_ASCII_l),
  4317. 3: int8(m_ASCII_EQUALS),
  4318. 4: int8(m_ASCII_h),
  4319. 5: int8(m_ASCII_t),
  4320. 6: int8(m_ASCII_t),
  4321. 7: int8(m_ASCII_p),
  4322. 8: int8(m_ASCII_COLON),
  4323. 9: int8(m_ASCII_SLASH),
  4324. 10: int8(m_ASCII_SLASH),
  4325. 11: int8(m_ASCII_w),
  4326. 12: int8(m_ASCII_w),
  4327. 13: int8(m_ASCII_w),
  4328. 14: int8(m_ASCII_PERIOD),
  4329. 15: int8(m_ASCII_w),
  4330. 16: int8(m_ASCII_3),
  4331. 17: int8(m_ASCII_PERIOD),
  4332. 18: int8(m_ASCII_o),
  4333. 19: int8(m_ASCII_r),
  4334. 20: int8(m_ASCII_g),
  4335. 21: int8(m_ASCII_SLASH),
  4336. 22: int8(m_ASCII_X),
  4337. 23: int8(m_ASCII_M),
  4338. 24: int8(m_ASCII_L),
  4339. 25: int8(m_ASCII_SLASH),
  4340. 26: int8(m_ASCII_1),
  4341. 27: int8(m_ASCII_9),
  4342. 28: int8(m_ASCII_9),
  4343. 29: int8(m_ASCII_8),
  4344. 30: int8(m_ASCII_SLASH),
  4345. 31: int8(m_ASCII_n),
  4346. 32: int8(m_ASCII_a),
  4347. 33: int8(m_ASCII_m),
  4348. 34: int8(m_ASCII_e),
  4349. 35: int8(m_ASCII_s),
  4350. 36: int8(m_ASCII_p),
  4351. 37: int8(m_ASCII_a),
  4352. 38: int8(m_ASCII_c),
  4353. 39: int8(m_ASCII_e),
  4354. }
  4355. /* To avoid warnings about unused functions: */
  4356. func _ENTROPY_DEBUG(tls *libc.TLS, label uintptr, entropy uint64) (r uint64) {
  4357. bp := tls.Alloc(48)
  4358. defer tls.Free(48)
  4359. if _getDebugLevel(tls, __ccgo_ts+17, uint64(0)) >= uint64(1) {
  4360. libc.Xfprintf(tls, libc.X__stderrp, __ccgo_ts+37, libc.VaList(bp+8, label, libc.Int32FromInt64(8)*libc.Int32FromInt32(2), entropy, libc.Uint64FromInt64(8)))
  4361. }
  4362. return entropy
  4363. }
  4364. func _generate_hash_secret_salt(tls *libc.TLS, parser TXML_Parser) (r uint64) {
  4365. bp := tls.Alloc(16)
  4366. defer tls.Free(16)
  4367. var _ /* entropy at bp+0 */ uint64
  4368. _ = parser
  4369. /* "Failproof" high quality providers: */
  4370. libc.Xarc4random_buf(tls, bp, uint64(8))
  4371. return _ENTROPY_DEBUG(tls, __ccgo_ts+81, *(*uint64)(unsafe.Pointer(bp)))
  4372. }
  4373. func _get_hash_secret_salt(tls *libc.TLS, parser TXML_Parser) (r uint64) {
  4374. if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parentParser != libc.UintptrFromInt32(0) {
  4375. return _get_hash_secret_salt(tls, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parentParser)
  4376. }
  4377. return (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_hash_secret_salt
  4378. }
  4379. func _startParsing(tls *libc.TLS, parser TXML_Parser) (r TXML_Bool) {
  4380. /* hash functions must be initialized before setContext() is called */
  4381. if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_hash_secret_salt == uint64(0) {
  4382. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_hash_secret_salt = _generate_hash_secret_salt(tls, parser)
  4383. }
  4384. if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_ns != 0 {
  4385. /* implicit context only set for root parser, since child
  4386. parsers (i.e. external entity parsers) will inherit it
  4387. */
  4388. return _setContext(tls, parser, uintptr(unsafe.Pointer(&_implicitContext)))
  4389. }
  4390. return libc.Uint8FromInt32(1)
  4391. }
  4392. func XXML_ParserCreate_MM(tls *libc.TLS, encodingName uintptr, memsuite uintptr, nameSep uintptr) (r TXML_Parser) {
  4393. return _parserCreate(tls, encodingName, memsuite, nameSep, libc.UintptrFromInt32(0))
  4394. }
  4395. func _parserCreate(tls *libc.TLS, encodingName uintptr, memsuite uintptr, nameSep uintptr, dtd uintptr) (r TXML_Parser) {
  4396. var mtemp, mtemp1 uintptr
  4397. var parser TXML_Parser
  4398. _, _, _ = mtemp, mtemp1, parser
  4399. if memsuite != 0 {
  4400. parser = (*(*func(*libc.TLS, Tsize_t) uintptr)(unsafe.Pointer(&struct{ uintptr }{(*TXML_Memory_Handling_Suite)(unsafe.Pointer(memsuite)).Fmalloc_fcn})))(tls, uint64(976))
  4401. if parser != libc.UintptrFromInt32(0) {
  4402. mtemp = parser + 24
  4403. (*TXML_Memory_Handling_Suite)(unsafe.Pointer(mtemp)).Fmalloc_fcn = (*TXML_Memory_Handling_Suite)(unsafe.Pointer(memsuite)).Fmalloc_fcn
  4404. (*TXML_Memory_Handling_Suite)(unsafe.Pointer(mtemp)).Frealloc_fcn = (*TXML_Memory_Handling_Suite)(unsafe.Pointer(memsuite)).Frealloc_fcn
  4405. (*TXML_Memory_Handling_Suite)(unsafe.Pointer(mtemp)).Ffree_fcn = (*TXML_Memory_Handling_Suite)(unsafe.Pointer(memsuite)).Ffree_fcn
  4406. }
  4407. } else {
  4408. parser = libc.Xmalloc(tls, uint64(976))
  4409. if parser != libc.UintptrFromInt32(0) {
  4410. mtemp1 = parser + 24
  4411. (*TXML_Memory_Handling_Suite)(unsafe.Pointer(mtemp1)).Fmalloc_fcn = __ccgo_fp(libc.Xmalloc)
  4412. (*TXML_Memory_Handling_Suite)(unsafe.Pointer(mtemp1)).Frealloc_fcn = __ccgo_fp(libc.Xrealloc)
  4413. (*TXML_Memory_Handling_Suite)(unsafe.Pointer(mtemp1)).Ffree_fcn = __ccgo_fp(libc.Xfree)
  4414. }
  4415. }
  4416. if !(parser != 0) {
  4417. return parser
  4418. }
  4419. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_buffer = libc.UintptrFromInt32(0)
  4420. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_bufferLim = libc.UintptrFromInt32(0)
  4421. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_attsSize = int32(m_INIT_ATTS_SIZE)
  4422. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_atts = (*(*func(*libc.TLS, Tsize_t) uintptr)(unsafe.Pointer(&struct{ uintptr }{(*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_mem.Fmalloc_fcn})))(tls, libc.Uint64FromInt32((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_attsSize)*libc.Uint64FromInt64(32))
  4423. if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_atts == libc.UintptrFromInt32(0) {
  4424. (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_mem.Ffree_fcn})))(tls, parser)
  4425. return libc.UintptrFromInt32(0)
  4426. }
  4427. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_dataBuf = (*(*func(*libc.TLS, Tsize_t) uintptr)(unsafe.Pointer(&struct{ uintptr }{(*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_mem.Fmalloc_fcn})))(tls, libc.Uint64FromInt32(m_INIT_DATA_BUF_SIZE)*libc.Uint64FromInt64(1))
  4428. if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_dataBuf == libc.UintptrFromInt32(0) {
  4429. (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_mem.Ffree_fcn})))(tls, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_atts)
  4430. (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_mem.Ffree_fcn})))(tls, parser)
  4431. return libc.UintptrFromInt32(0)
  4432. }
  4433. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_dataBufEnd = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_dataBuf + uintptr(m_INIT_DATA_BUF_SIZE)
  4434. if dtd != 0 {
  4435. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_dtd = dtd
  4436. } else {
  4437. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_dtd = _dtdCreate(tls, parser+24)
  4438. if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_dtd == libc.UintptrFromInt32(0) {
  4439. (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_mem.Ffree_fcn})))(tls, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_dataBuf)
  4440. (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_mem.Ffree_fcn})))(tls, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_atts)
  4441. (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_mem.Ffree_fcn})))(tls, parser)
  4442. return libc.UintptrFromInt32(0)
  4443. }
  4444. }
  4445. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_freeBindingList = libc.UintptrFromInt32(0)
  4446. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_freeTagList = libc.UintptrFromInt32(0)
  4447. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_freeInternalEntities = libc.UintptrFromInt32(0)
  4448. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_groupSize = uint32(0)
  4449. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_groupConnector = libc.UintptrFromInt32(0)
  4450. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_unknownEncodingHandler = libc.UintptrFromInt32(0)
  4451. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_unknownEncodingHandlerData = libc.UintptrFromInt32(0)
  4452. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_namespaceSeparator = int8(m_ASCII_EXCL)
  4453. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_ns = libc.Uint8FromInt32(0)
  4454. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_ns_triplets = libc.Uint8FromInt32(0)
  4455. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_nsAtts = libc.UintptrFromInt32(0)
  4456. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_nsAttsVersion = uint64(0)
  4457. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_nsAttsPower = uint8(0)
  4458. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_protocolEncodingName = libc.UintptrFromInt32(0)
  4459. _poolInit(tls, parser+784, parser+24)
  4460. _poolInit(tls, parser+832, parser+24)
  4461. _parserInit(tls, parser, encodingName)
  4462. if encodingName != 0 && !((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_protocolEncodingName != 0) {
  4463. if dtd != 0 {
  4464. // We need to stop the upcoming call to XML_ParserFree from happily
  4465. // destroying parser->m_dtd because the DTD is shared with the parent
  4466. // parser and the only guard that keeps XML_ParserFree from destroying
  4467. // parser->m_dtd is parser->m_isParamEntity but it will be set to
  4468. // XML_TRUE only later in XML_ExternalEntityParserCreate (or not at all).
  4469. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_dtd = libc.UintptrFromInt32(0)
  4470. }
  4471. XXML_ParserFree(tls, parser)
  4472. return libc.UintptrFromInt32(0)
  4473. }
  4474. if nameSep != 0 {
  4475. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_ns = libc.Uint8FromInt32(1)
  4476. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_internalEncoding = XXmlGetUtf8InternalEncodingNS(tls)
  4477. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_namespaceSeparator = *(*TXML_Char)(unsafe.Pointer(nameSep))
  4478. } else {
  4479. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_internalEncoding = XXmlGetUtf8InternalEncoding(tls)
  4480. }
  4481. return parser
  4482. }
  4483. func _parserInit(tls *libc.TLS, parser TXML_Parser, encodingName uintptr) {
  4484. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_processor = __ccgo_fp(_prologInitProcessor)
  4485. XXmlPrologStateInit(tls, parser+496)
  4486. if encodingName != libc.UintptrFromInt32(0) {
  4487. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_protocolEncodingName = _copyString(tls, encodingName, parser+24)
  4488. }
  4489. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_curBase = libc.UintptrFromInt32(0)
  4490. XXmlInitEncoding(tls, parser+296, parser+288, uintptr(0))
  4491. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_userData = libc.UintptrFromInt32(0)
  4492. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_handlerArg = libc.UintptrFromInt32(0)
  4493. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_startElementHandler = libc.UintptrFromInt32(0)
  4494. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_endElementHandler = libc.UintptrFromInt32(0)
  4495. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_characterDataHandler = libc.UintptrFromInt32(0)
  4496. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_processingInstructionHandler = libc.UintptrFromInt32(0)
  4497. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_commentHandler = libc.UintptrFromInt32(0)
  4498. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_startCdataSectionHandler = libc.UintptrFromInt32(0)
  4499. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_endCdataSectionHandler = libc.UintptrFromInt32(0)
  4500. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_defaultHandler = libc.UintptrFromInt32(0)
  4501. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_startDoctypeDeclHandler = libc.UintptrFromInt32(0)
  4502. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_endDoctypeDeclHandler = libc.UintptrFromInt32(0)
  4503. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_unparsedEntityDeclHandler = libc.UintptrFromInt32(0)
  4504. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_notationDeclHandler = libc.UintptrFromInt32(0)
  4505. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_startNamespaceDeclHandler = libc.UintptrFromInt32(0)
  4506. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_endNamespaceDeclHandler = libc.UintptrFromInt32(0)
  4507. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_notStandaloneHandler = libc.UintptrFromInt32(0)
  4508. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_externalEntityRefHandler = libc.UintptrFromInt32(0)
  4509. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_externalEntityRefHandlerArg = parser
  4510. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_skippedEntityHandler = libc.UintptrFromInt32(0)
  4511. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_elementDeclHandler = libc.UintptrFromInt32(0)
  4512. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_attlistDeclHandler = libc.UintptrFromInt32(0)
  4513. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_entityDeclHandler = libc.UintptrFromInt32(0)
  4514. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_xmlDeclHandler = libc.UintptrFromInt32(0)
  4515. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_bufferPtr = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_buffer
  4516. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_bufferEnd = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_buffer
  4517. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parseEndByteIndex = 0
  4518. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parseEndPtr = libc.UintptrFromInt32(0)
  4519. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declElementType = libc.UintptrFromInt32(0)
  4520. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declAttributeId = libc.UintptrFromInt32(0)
  4521. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declEntity = libc.UintptrFromInt32(0)
  4522. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_doctypeName = libc.UintptrFromInt32(0)
  4523. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_doctypeSysid = libc.UintptrFromInt32(0)
  4524. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_doctypePubid = libc.UintptrFromInt32(0)
  4525. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declAttributeType = libc.UintptrFromInt32(0)
  4526. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declNotationName = libc.UintptrFromInt32(0)
  4527. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declNotationPublicId = libc.UintptrFromInt32(0)
  4528. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declAttributeIsCdata = libc.Uint8FromInt32(0)
  4529. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declAttributeIsId = libc.Uint8FromInt32(0)
  4530. libc.X__builtin___memset_chk(tls, parser+768, 0, uint64(16), ^t__predefined_size_t(0))
  4531. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_errorCode = int32(_XML_ERROR_NONE)
  4532. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_eventPtr = libc.UintptrFromInt32(0)
  4533. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_eventEndPtr = libc.UintptrFromInt32(0)
  4534. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_positionPtr = libc.UintptrFromInt32(0)
  4535. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_openInternalEntities = libc.UintptrFromInt32(0)
  4536. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_defaultExpandInternalEntities = libc.Uint8FromInt32(1)
  4537. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_tagLevel = 0
  4538. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_tagStack = libc.UintptrFromInt32(0)
  4539. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_inheritedBindings = libc.UintptrFromInt32(0)
  4540. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_nSpecifiedAtts = 0
  4541. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_unknownEncodingMem = libc.UintptrFromInt32(0)
  4542. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_unknownEncodingRelease = libc.UintptrFromInt32(0)
  4543. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_unknownEncodingData = libc.UintptrFromInt32(0)
  4544. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parentParser = libc.UintptrFromInt32(0)
  4545. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parsingStatus.Fparsing = int32(_XML_INITIALIZED)
  4546. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_isParamEntity = libc.Uint8FromInt32(0)
  4547. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_useForeignDTD = libc.Uint8FromInt32(0)
  4548. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_paramEntityParsing = int32(_XML_PARAM_ENTITY_PARSING_NEVER)
  4549. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_hash_secret_salt = uint64(0)
  4550. libc.X__builtin___memset_chk(tls, parser+928, 0, uint64(32), ^t__predefined_size_t(0))
  4551. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_accounting.FdebugLevel = libc.Int32FromUint64(_getDebugLevel(tls, __ccgo_ts+96, 0))
  4552. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_accounting.FmaximumAmplificationFactor = libc.Float32FromFloat32(100)
  4553. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_accounting.FactivationThresholdBytes = uint64(m_EXPAT_BILLION_LAUGHS_ATTACK_PROTECTION_ACTIVATION_THRESHOLD_DEFAULT)
  4554. libc.X__builtin___memset_chk(tls, parser+960, 0, uint64(16), ^t__predefined_size_t(0))
  4555. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_entity_stats.FdebugLevel = libc.Int32FromUint64(_getDebugLevel(tls, __ccgo_ts+119, 0))
  4556. }
  4557. // C documentation
  4558. //
  4559. // /* moves list of bindings to m_freeBindingList */
  4560. func _moveToFreeBindingList(tls *libc.TLS, parser TXML_Parser, bindings uintptr) {
  4561. var b uintptr
  4562. _ = b
  4563. for bindings != 0 {
  4564. b = bindings
  4565. bindings = (*TBINDING)(unsafe.Pointer(bindings)).FnextTagBinding
  4566. (*TBINDING)(unsafe.Pointer(b)).FnextTagBinding = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_freeBindingList
  4567. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_freeBindingList = b
  4568. }
  4569. }
  4570. func XXML_ParserReset(tls *libc.TLS, parser TXML_Parser, encodingName uintptr) (r TXML_Bool) {
  4571. var openEntity, openEntityList, tStk, tag uintptr
  4572. _, _, _, _ = openEntity, openEntityList, tStk, tag
  4573. if parser == libc.UintptrFromInt32(0) {
  4574. return libc.Uint8FromInt32(0)
  4575. }
  4576. if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parentParser != 0 {
  4577. return libc.Uint8FromInt32(0)
  4578. }
  4579. /* move m_tagStack to m_freeTagList */
  4580. tStk = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_tagStack
  4581. for tStk != 0 {
  4582. tag = tStk
  4583. tStk = (*TTAG)(unsafe.Pointer(tStk)).Fparent
  4584. (*TTAG)(unsafe.Pointer(tag)).Fparent = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_freeTagList
  4585. _moveToFreeBindingList(tls, parser, (*TTAG)(unsafe.Pointer(tag)).Fbindings)
  4586. (*TTAG)(unsafe.Pointer(tag)).Fbindings = libc.UintptrFromInt32(0)
  4587. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_freeTagList = tag
  4588. }
  4589. /* move m_openInternalEntities to m_freeInternalEntities */
  4590. openEntityList = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_openInternalEntities
  4591. for openEntityList != 0 {
  4592. openEntity = openEntityList
  4593. openEntityList = (*TOPEN_INTERNAL_ENTITY)(unsafe.Pointer(openEntity)).Fnext
  4594. (*TOPEN_INTERNAL_ENTITY)(unsafe.Pointer(openEntity)).Fnext = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_freeInternalEntities
  4595. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_freeInternalEntities = openEntity
  4596. }
  4597. _moveToFreeBindingList(tls, parser, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_inheritedBindings)
  4598. (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_mem.Ffree_fcn})))(tls, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_unknownEncodingMem)
  4599. if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_unknownEncodingRelease != 0 {
  4600. (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_unknownEncodingRelease})))(tls, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_unknownEncodingData)
  4601. }
  4602. _poolClear(tls, parser+784)
  4603. _poolClear(tls, parser+832)
  4604. (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_mem.Ffree_fcn})))(tls, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_protocolEncodingName)
  4605. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_protocolEncodingName = libc.UintptrFromInt32(0)
  4606. _parserInit(tls, parser, encodingName)
  4607. _dtdReset(tls, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_dtd, parser+24)
  4608. return libc.Uint8FromInt32(1)
  4609. }
  4610. func XXML_SetEncoding(tls *libc.TLS, parser TXML_Parser, encodingName uintptr) (r _XML_Status) {
  4611. if parser == libc.UintptrFromInt32(0) {
  4612. return int32(_XML_STATUS_ERROR)
  4613. }
  4614. /* Block after XML_Parse()/XML_ParseBuffer() has been called.
  4615. XXX There's no way for the caller to determine which of the
  4616. XXX possible error cases caused the XML_STATUS_ERROR return.
  4617. */
  4618. if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parsingStatus.Fparsing == int32(_XML_PARSING) || (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parsingStatus.Fparsing == int32(_XML_SUSPENDED) {
  4619. return int32(_XML_STATUS_ERROR)
  4620. }
  4621. /* Get rid of any previous encoding name */
  4622. (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_mem.Ffree_fcn})))(tls, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_protocolEncodingName)
  4623. if encodingName == libc.UintptrFromInt32(0) {
  4624. /* No new encoding name */
  4625. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_protocolEncodingName = libc.UintptrFromInt32(0)
  4626. } else {
  4627. /* Copy the new encoding name into allocated memory */
  4628. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_protocolEncodingName = _copyString(tls, encodingName, parser+24)
  4629. if !((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_protocolEncodingName != 0) {
  4630. return int32(_XML_STATUS_ERROR)
  4631. }
  4632. }
  4633. return int32(_XML_STATUS_OK)
  4634. }
  4635. func XXML_ExternalEntityParserCreate(tls *libc.TLS, oldParser TXML_Parser, context uintptr, encodingName uintptr) (r TXML_Parser) {
  4636. bp := tls.Alloc(16)
  4637. defer tls.Free(16)
  4638. var newDtd, oldDeclElementType, oldDtd, oldHandlerArg, oldUserData uintptr
  4639. var oldAttlistDeclHandler TXML_AttlistDeclHandler
  4640. var oldCharacterDataHandler TXML_CharacterDataHandler
  4641. var oldCommentHandler TXML_CommentHandler
  4642. var oldDefaultExpandInternalEntities, oldns_triplets TXML_Bool
  4643. var oldDefaultHandler TXML_DefaultHandler
  4644. var oldElementDeclHandler TXML_ElementDeclHandler
  4645. var oldEndCdataSectionHandler TXML_EndCdataSectionHandler
  4646. var oldEndElementHandler TXML_EndElementHandler
  4647. var oldEndNamespaceDeclHandler TXML_EndNamespaceDeclHandler
  4648. var oldEntityDeclHandler TXML_EntityDeclHandler
  4649. var oldExternalEntityRefHandler TXML_ExternalEntityRefHandler
  4650. var oldExternalEntityRefHandlerArg, parser TXML_Parser
  4651. var oldInEntityValue int32
  4652. var oldNotStandaloneHandler TXML_NotStandaloneHandler
  4653. var oldNotationDeclHandler TXML_NotationDeclHandler
  4654. var oldParamEntityParsing _XML_ParamEntityParsing
  4655. var oldProcessingInstructionHandler TXML_ProcessingInstructionHandler
  4656. var oldSkippedEntityHandler TXML_SkippedEntityHandler
  4657. var oldStartCdataSectionHandler TXML_StartCdataSectionHandler
  4658. var oldStartElementHandler TXML_StartElementHandler
  4659. var oldStartNamespaceDeclHandler TXML_StartNamespaceDeclHandler
  4660. var oldUnknownEncodingHandler TXML_UnknownEncodingHandler
  4661. var oldUnparsedEntityDeclHandler TXML_UnparsedEntityDeclHandler
  4662. var oldXmlDeclHandler TXML_XmlDeclHandler
  4663. var oldhash_secret_salt uint64
  4664. var _ /* tmp at bp+0 */ [2]TXML_Char
  4665. _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = newDtd, oldAttlistDeclHandler, oldCharacterDataHandler, oldCommentHandler, oldDeclElementType, oldDefaultExpandInternalEntities, oldDefaultHandler, oldDtd, oldElementDeclHandler, oldEndCdataSectionHandler, oldEndElementHandler, oldEndNamespaceDeclHandler, oldEntityDeclHandler, oldExternalEntityRefHandler, oldExternalEntityRefHandlerArg, oldHandlerArg, oldInEntityValue, oldNotStandaloneHandler, oldNotationDeclHandler, oldParamEntityParsing, oldProcessingInstructionHandler, oldSkippedEntityHandler, oldStartCdataSectionHandler, oldStartElementHandler, oldStartNamespaceDeclHandler, oldUnknownEncodingHandler, oldUnparsedEntityDeclHandler, oldUserData, oldXmlDeclHandler, oldhash_secret_salt, oldns_triplets, parser
  4666. parser = oldParser
  4667. newDtd = libc.UintptrFromInt32(0)
  4668. /* Validate the oldParser parameter before we pull everything out of it */
  4669. if oldParser == libc.UintptrFromInt32(0) {
  4670. return libc.UintptrFromInt32(0)
  4671. }
  4672. /* Stash the original parser contents on the stack */
  4673. oldDtd = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_dtd
  4674. oldStartElementHandler = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_startElementHandler
  4675. oldEndElementHandler = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_endElementHandler
  4676. oldCharacterDataHandler = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_characterDataHandler
  4677. oldProcessingInstructionHandler = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_processingInstructionHandler
  4678. oldCommentHandler = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_commentHandler
  4679. oldStartCdataSectionHandler = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_startCdataSectionHandler
  4680. oldEndCdataSectionHandler = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_endCdataSectionHandler
  4681. oldDefaultHandler = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_defaultHandler
  4682. oldUnparsedEntityDeclHandler = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_unparsedEntityDeclHandler
  4683. oldNotationDeclHandler = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_notationDeclHandler
  4684. oldStartNamespaceDeclHandler = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_startNamespaceDeclHandler
  4685. oldEndNamespaceDeclHandler = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_endNamespaceDeclHandler
  4686. oldNotStandaloneHandler = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_notStandaloneHandler
  4687. oldExternalEntityRefHandler = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_externalEntityRefHandler
  4688. oldSkippedEntityHandler = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_skippedEntityHandler
  4689. oldUnknownEncodingHandler = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_unknownEncodingHandler
  4690. oldElementDeclHandler = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_elementDeclHandler
  4691. oldAttlistDeclHandler = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_attlistDeclHandler
  4692. oldEntityDeclHandler = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_entityDeclHandler
  4693. oldXmlDeclHandler = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_xmlDeclHandler
  4694. oldDeclElementType = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declElementType
  4695. oldUserData = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_userData
  4696. oldHandlerArg = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_handlerArg
  4697. oldDefaultExpandInternalEntities = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_defaultExpandInternalEntities
  4698. oldExternalEntityRefHandlerArg = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_externalEntityRefHandlerArg
  4699. oldParamEntityParsing = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_paramEntityParsing
  4700. oldInEntityValue = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_prologState.FinEntityValue
  4701. oldns_triplets = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_ns_triplets
  4702. /* Note that the new parser shares the same hash secret as the old
  4703. parser, so that dtdCopy and copyEntityTable can lookup values
  4704. from hash tables associated with either parser without us having
  4705. to worry which hash secrets each table has.
  4706. */
  4707. oldhash_secret_salt = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_hash_secret_salt
  4708. if !(context != 0) {
  4709. newDtd = oldDtd
  4710. }
  4711. /* Note that the magical uses of the pre-processor to make field
  4712. access look more like C++ require that `parser' be overwritten
  4713. here. This makes this function more painful to follow than it
  4714. would be otherwise.
  4715. */
  4716. if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_ns != 0 {
  4717. *(*[2]TXML_Char)(unsafe.Pointer(bp)) = [2]TXML_Char{
  4718. 0: (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_namespaceSeparator,
  4719. }
  4720. parser = _parserCreate(tls, encodingName, parser+24, bp, newDtd)
  4721. } else {
  4722. parser = _parserCreate(tls, encodingName, parser+24, libc.UintptrFromInt32(0), newDtd)
  4723. }
  4724. if !(parser != 0) {
  4725. return libc.UintptrFromInt32(0)
  4726. }
  4727. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_startElementHandler = oldStartElementHandler
  4728. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_endElementHandler = oldEndElementHandler
  4729. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_characterDataHandler = oldCharacterDataHandler
  4730. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_processingInstructionHandler = oldProcessingInstructionHandler
  4731. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_commentHandler = oldCommentHandler
  4732. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_startCdataSectionHandler = oldStartCdataSectionHandler
  4733. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_endCdataSectionHandler = oldEndCdataSectionHandler
  4734. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_defaultHandler = oldDefaultHandler
  4735. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_unparsedEntityDeclHandler = oldUnparsedEntityDeclHandler
  4736. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_notationDeclHandler = oldNotationDeclHandler
  4737. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_startNamespaceDeclHandler = oldStartNamespaceDeclHandler
  4738. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_endNamespaceDeclHandler = oldEndNamespaceDeclHandler
  4739. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_notStandaloneHandler = oldNotStandaloneHandler
  4740. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_externalEntityRefHandler = oldExternalEntityRefHandler
  4741. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_skippedEntityHandler = oldSkippedEntityHandler
  4742. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_unknownEncodingHandler = oldUnknownEncodingHandler
  4743. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_elementDeclHandler = oldElementDeclHandler
  4744. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_attlistDeclHandler = oldAttlistDeclHandler
  4745. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_entityDeclHandler = oldEntityDeclHandler
  4746. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_xmlDeclHandler = oldXmlDeclHandler
  4747. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declElementType = oldDeclElementType
  4748. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_userData = oldUserData
  4749. if oldUserData == oldHandlerArg {
  4750. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_handlerArg = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_userData
  4751. } else {
  4752. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_handlerArg = parser
  4753. }
  4754. if oldExternalEntityRefHandlerArg != oldParser {
  4755. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_externalEntityRefHandlerArg = oldExternalEntityRefHandlerArg
  4756. }
  4757. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_defaultExpandInternalEntities = oldDefaultExpandInternalEntities
  4758. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_ns_triplets = oldns_triplets
  4759. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_hash_secret_salt = oldhash_secret_salt
  4760. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parentParser = oldParser
  4761. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_paramEntityParsing = oldParamEntityParsing
  4762. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_prologState.FinEntityValue = oldInEntityValue
  4763. if context != 0 {
  4764. if !(_dtdCopy(tls, oldParser, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_dtd, oldDtd, parser+24) != 0) || !(_setContext(tls, parser, context) != 0) {
  4765. XXML_ParserFree(tls, parser)
  4766. return libc.UintptrFromInt32(0)
  4767. }
  4768. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_processor = __ccgo_fp(_externalEntityInitProcessor)
  4769. } else {
  4770. /* The DTD instance referenced by parser->m_dtd is shared between the
  4771. document's root parser and external PE parsers, therefore one does not
  4772. need to call setContext. In addition, one also *must* not call
  4773. setContext, because this would overwrite existing prefix->binding
  4774. pointers in parser->m_dtd with ones that get destroyed with the external
  4775. PE parser. This would leave those prefixes with dangling pointers.
  4776. */
  4777. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_isParamEntity = libc.Uint8FromInt32(1)
  4778. XXmlPrologStateInitExternalEntity(tls, parser+496)
  4779. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_processor = __ccgo_fp(_externalParEntInitProcessor)
  4780. }
  4781. return parser
  4782. }
  4783. func _destroyBindings(tls *libc.TLS, bindings uintptr, parser TXML_Parser) {
  4784. var b uintptr
  4785. _ = b
  4786. for {
  4787. b = bindings
  4788. if !(b != 0) {
  4789. break
  4790. }
  4791. bindings = (*TBINDING)(unsafe.Pointer(b)).FnextTagBinding
  4792. (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_mem.Ffree_fcn})))(tls, (*TBINDING)(unsafe.Pointer(b)).Furi)
  4793. (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_mem.Ffree_fcn})))(tls, b)
  4794. goto _1
  4795. _1:
  4796. }
  4797. }
  4798. func XXML_ParserFree(tls *libc.TLS, parser TXML_Parser) {
  4799. var entityList, openEntity, p, tagList uintptr
  4800. _, _, _, _ = entityList, openEntity, p, tagList
  4801. if parser == libc.UintptrFromInt32(0) {
  4802. return
  4803. }
  4804. /* free m_tagStack and m_freeTagList */
  4805. tagList = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_tagStack
  4806. for {
  4807. if tagList == libc.UintptrFromInt32(0) {
  4808. if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_freeTagList == libc.UintptrFromInt32(0) {
  4809. break
  4810. }
  4811. tagList = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_freeTagList
  4812. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_freeTagList = libc.UintptrFromInt32(0)
  4813. }
  4814. p = tagList
  4815. tagList = (*TTAG)(unsafe.Pointer(tagList)).Fparent
  4816. (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_mem.Ffree_fcn})))(tls, (*TTAG)(unsafe.Pointer(p)).Fbuf)
  4817. _destroyBindings(tls, (*TTAG)(unsafe.Pointer(p)).Fbindings, parser)
  4818. (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_mem.Ffree_fcn})))(tls, p)
  4819. goto _1
  4820. _1:
  4821. }
  4822. /* free m_openInternalEntities and m_freeInternalEntities */
  4823. entityList = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_openInternalEntities
  4824. for {
  4825. if entityList == libc.UintptrFromInt32(0) {
  4826. if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_freeInternalEntities == libc.UintptrFromInt32(0) {
  4827. break
  4828. }
  4829. entityList = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_freeInternalEntities
  4830. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_freeInternalEntities = libc.UintptrFromInt32(0)
  4831. }
  4832. openEntity = entityList
  4833. entityList = (*TOPEN_INTERNAL_ENTITY)(unsafe.Pointer(entityList)).Fnext
  4834. (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_mem.Ffree_fcn})))(tls, openEntity)
  4835. goto _2
  4836. _2:
  4837. }
  4838. _destroyBindings(tls, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_freeBindingList, parser)
  4839. _destroyBindings(tls, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_inheritedBindings, parser)
  4840. _poolDestroy(tls, parser+784)
  4841. _poolDestroy(tls, parser+832)
  4842. (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_mem.Ffree_fcn})))(tls, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_protocolEncodingName)
  4843. /* external parameter entity parsers share the DTD structure
  4844. parser->m_dtd with the root parser, so we must not destroy it
  4845. */
  4846. if !((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_isParamEntity != 0) && (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_dtd != 0 {
  4847. _dtdDestroy(tls, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_dtd, libc.BoolUint8(!((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parentParser != 0)), parser+24)
  4848. }
  4849. (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_mem.Ffree_fcn})))(tls, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_atts)
  4850. (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_mem.Ffree_fcn})))(tls, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_groupConnector)
  4851. (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_mem.Ffree_fcn})))(tls, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_buffer)
  4852. (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_mem.Ffree_fcn})))(tls, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_dataBuf)
  4853. (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_mem.Ffree_fcn})))(tls, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_nsAtts)
  4854. (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_mem.Ffree_fcn})))(tls, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_unknownEncodingMem)
  4855. if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_unknownEncodingRelease != 0 {
  4856. (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_unknownEncodingRelease})))(tls, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_unknownEncodingData)
  4857. }
  4858. (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_mem.Ffree_fcn})))(tls, parser)
  4859. }
  4860. func XXML_UseParserAsHandlerArg(tls *libc.TLS, parser TXML_Parser) {
  4861. if parser != libc.UintptrFromInt32(0) {
  4862. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_handlerArg = parser
  4863. }
  4864. }
  4865. func XXML_UseForeignDTD(tls *libc.TLS, parser TXML_Parser, useDTD TXML_Bool) (r _XML_Error) {
  4866. if parser == libc.UintptrFromInt32(0) {
  4867. return int32(_XML_ERROR_INVALID_ARGUMENT)
  4868. }
  4869. /* block after XML_Parse()/XML_ParseBuffer() has been called */
  4870. if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parsingStatus.Fparsing == int32(_XML_PARSING) || (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parsingStatus.Fparsing == int32(_XML_SUSPENDED) {
  4871. return int32(_XML_ERROR_CANT_CHANGE_FEATURE_ONCE_PARSING)
  4872. }
  4873. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_useForeignDTD = useDTD
  4874. return int32(_XML_ERROR_NONE)
  4875. }
  4876. func XXML_SetReturnNSTriplet(tls *libc.TLS, parser TXML_Parser, do_nst int32) {
  4877. var v1 int32
  4878. _ = v1
  4879. if parser == libc.UintptrFromInt32(0) {
  4880. return
  4881. }
  4882. /* block after XML_Parse()/XML_ParseBuffer() has been called */
  4883. if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parsingStatus.Fparsing == int32(_XML_PARSING) || (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parsingStatus.Fparsing == int32(_XML_SUSPENDED) {
  4884. return
  4885. }
  4886. if do_nst != 0 {
  4887. v1 = libc.Int32FromUint8(libc.Uint8FromInt32(1))
  4888. } else {
  4889. v1 = libc.Int32FromUint8(libc.Uint8FromInt32(0))
  4890. }
  4891. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_ns_triplets = libc.Uint8FromInt32(v1)
  4892. }
  4893. func XXML_SetUserData(tls *libc.TLS, parser TXML_Parser, p uintptr) {
  4894. var v1 uintptr
  4895. _ = v1
  4896. if parser == libc.UintptrFromInt32(0) {
  4897. return
  4898. }
  4899. if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_handlerArg == (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_userData {
  4900. v1 = p
  4901. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_userData = v1
  4902. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_handlerArg = v1
  4903. } else {
  4904. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_userData = p
  4905. }
  4906. }
  4907. func XXML_SetBase(tls *libc.TLS, parser TXML_Parser, p uintptr) (r _XML_Status) {
  4908. if parser == libc.UintptrFromInt32(0) {
  4909. return int32(_XML_STATUS_ERROR)
  4910. }
  4911. if p != 0 {
  4912. p = _poolCopyString(tls, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_dtd+160, p)
  4913. if !(p != 0) {
  4914. return int32(_XML_STATUS_ERROR)
  4915. }
  4916. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_curBase = p
  4917. } else {
  4918. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_curBase = libc.UintptrFromInt32(0)
  4919. }
  4920. return int32(_XML_STATUS_OK)
  4921. }
  4922. func XXML_GetBase(tls *libc.TLS, parser TXML_Parser) (r uintptr) {
  4923. if parser == libc.UintptrFromInt32(0) {
  4924. return libc.UintptrFromInt32(0)
  4925. }
  4926. return (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_curBase
  4927. }
  4928. func XXML_GetSpecifiedAttributeCount(tls *libc.TLS, parser TXML_Parser) (r int32) {
  4929. if parser == libc.UintptrFromInt32(0) {
  4930. return -int32(1)
  4931. }
  4932. return (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_nSpecifiedAtts
  4933. }
  4934. func XXML_GetIdAttributeIndex(tls *libc.TLS, parser TXML_Parser) (r int32) {
  4935. if parser == libc.UintptrFromInt32(0) {
  4936. return -int32(1)
  4937. }
  4938. return (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_idAttIndex
  4939. }
  4940. func XXML_SetElementHandler(tls *libc.TLS, parser TXML_Parser, start TXML_StartElementHandler, end TXML_EndElementHandler) {
  4941. if parser == libc.UintptrFromInt32(0) {
  4942. return
  4943. }
  4944. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_startElementHandler = start
  4945. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_endElementHandler = end
  4946. }
  4947. func XXML_SetStartElementHandler(tls *libc.TLS, parser TXML_Parser, start TXML_StartElementHandler) {
  4948. if parser != libc.UintptrFromInt32(0) {
  4949. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_startElementHandler = start
  4950. }
  4951. }
  4952. func XXML_SetEndElementHandler(tls *libc.TLS, parser TXML_Parser, end TXML_EndElementHandler) {
  4953. if parser != libc.UintptrFromInt32(0) {
  4954. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_endElementHandler = end
  4955. }
  4956. }
  4957. func XXML_SetCharacterDataHandler(tls *libc.TLS, parser TXML_Parser, handler TXML_CharacterDataHandler) {
  4958. if parser != libc.UintptrFromInt32(0) {
  4959. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_characterDataHandler = handler
  4960. }
  4961. }
  4962. func XXML_SetProcessingInstructionHandler(tls *libc.TLS, parser TXML_Parser, handler TXML_ProcessingInstructionHandler) {
  4963. if parser != libc.UintptrFromInt32(0) {
  4964. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_processingInstructionHandler = handler
  4965. }
  4966. }
  4967. func XXML_SetCommentHandler(tls *libc.TLS, parser TXML_Parser, handler TXML_CommentHandler) {
  4968. if parser != libc.UintptrFromInt32(0) {
  4969. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_commentHandler = handler
  4970. }
  4971. }
  4972. func XXML_SetCdataSectionHandler(tls *libc.TLS, parser TXML_Parser, start TXML_StartCdataSectionHandler, end TXML_EndCdataSectionHandler) {
  4973. if parser == libc.UintptrFromInt32(0) {
  4974. return
  4975. }
  4976. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_startCdataSectionHandler = start
  4977. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_endCdataSectionHandler = end
  4978. }
  4979. func XXML_SetStartCdataSectionHandler(tls *libc.TLS, parser TXML_Parser, start TXML_StartCdataSectionHandler) {
  4980. if parser != libc.UintptrFromInt32(0) {
  4981. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_startCdataSectionHandler = start
  4982. }
  4983. }
  4984. func XXML_SetEndCdataSectionHandler(tls *libc.TLS, parser TXML_Parser, end TXML_EndCdataSectionHandler) {
  4985. if parser != libc.UintptrFromInt32(0) {
  4986. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_endCdataSectionHandler = end
  4987. }
  4988. }
  4989. func XXML_SetDefaultHandler(tls *libc.TLS, parser TXML_Parser, handler TXML_DefaultHandler) {
  4990. if parser == libc.UintptrFromInt32(0) {
  4991. return
  4992. }
  4993. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_defaultHandler = handler
  4994. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_defaultExpandInternalEntities = libc.Uint8FromInt32(0)
  4995. }
  4996. func XXML_SetDefaultHandlerExpand(tls *libc.TLS, parser TXML_Parser, handler TXML_DefaultHandler) {
  4997. if parser == libc.UintptrFromInt32(0) {
  4998. return
  4999. }
  5000. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_defaultHandler = handler
  5001. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_defaultExpandInternalEntities = libc.Uint8FromInt32(1)
  5002. }
  5003. func XXML_SetDoctypeDeclHandler(tls *libc.TLS, parser TXML_Parser, start TXML_StartDoctypeDeclHandler, end TXML_EndDoctypeDeclHandler) {
  5004. if parser == libc.UintptrFromInt32(0) {
  5005. return
  5006. }
  5007. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_startDoctypeDeclHandler = start
  5008. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_endDoctypeDeclHandler = end
  5009. }
  5010. func XXML_SetStartDoctypeDeclHandler(tls *libc.TLS, parser TXML_Parser, start TXML_StartDoctypeDeclHandler) {
  5011. if parser != libc.UintptrFromInt32(0) {
  5012. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_startDoctypeDeclHandler = start
  5013. }
  5014. }
  5015. func XXML_SetEndDoctypeDeclHandler(tls *libc.TLS, parser TXML_Parser, end TXML_EndDoctypeDeclHandler) {
  5016. if parser != libc.UintptrFromInt32(0) {
  5017. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_endDoctypeDeclHandler = end
  5018. }
  5019. }
  5020. func XXML_SetUnparsedEntityDeclHandler(tls *libc.TLS, parser TXML_Parser, handler TXML_UnparsedEntityDeclHandler) {
  5021. if parser != libc.UintptrFromInt32(0) {
  5022. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_unparsedEntityDeclHandler = handler
  5023. }
  5024. }
  5025. func XXML_SetNotationDeclHandler(tls *libc.TLS, parser TXML_Parser, handler TXML_NotationDeclHandler) {
  5026. if parser != libc.UintptrFromInt32(0) {
  5027. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_notationDeclHandler = handler
  5028. }
  5029. }
  5030. func XXML_SetNamespaceDeclHandler(tls *libc.TLS, parser TXML_Parser, start TXML_StartNamespaceDeclHandler, end TXML_EndNamespaceDeclHandler) {
  5031. if parser == libc.UintptrFromInt32(0) {
  5032. return
  5033. }
  5034. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_startNamespaceDeclHandler = start
  5035. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_endNamespaceDeclHandler = end
  5036. }
  5037. func XXML_SetStartNamespaceDeclHandler(tls *libc.TLS, parser TXML_Parser, start TXML_StartNamespaceDeclHandler) {
  5038. if parser != libc.UintptrFromInt32(0) {
  5039. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_startNamespaceDeclHandler = start
  5040. }
  5041. }
  5042. func XXML_SetEndNamespaceDeclHandler(tls *libc.TLS, parser TXML_Parser, end TXML_EndNamespaceDeclHandler) {
  5043. if parser != libc.UintptrFromInt32(0) {
  5044. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_endNamespaceDeclHandler = end
  5045. }
  5046. }
  5047. func XXML_SetNotStandaloneHandler(tls *libc.TLS, parser TXML_Parser, handler TXML_NotStandaloneHandler) {
  5048. if parser != libc.UintptrFromInt32(0) {
  5049. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_notStandaloneHandler = handler
  5050. }
  5051. }
  5052. func XXML_SetExternalEntityRefHandler(tls *libc.TLS, parser TXML_Parser, handler TXML_ExternalEntityRefHandler) {
  5053. if parser != libc.UintptrFromInt32(0) {
  5054. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_externalEntityRefHandler = handler
  5055. }
  5056. }
  5057. func XXML_SetExternalEntityRefHandlerArg(tls *libc.TLS, parser TXML_Parser, arg uintptr) {
  5058. if parser == libc.UintptrFromInt32(0) {
  5059. return
  5060. }
  5061. if arg != 0 {
  5062. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_externalEntityRefHandlerArg = arg
  5063. } else {
  5064. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_externalEntityRefHandlerArg = parser
  5065. }
  5066. }
  5067. func XXML_SetSkippedEntityHandler(tls *libc.TLS, parser TXML_Parser, handler TXML_SkippedEntityHandler) {
  5068. if parser != libc.UintptrFromInt32(0) {
  5069. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_skippedEntityHandler = handler
  5070. }
  5071. }
  5072. func XXML_SetUnknownEncodingHandler(tls *libc.TLS, parser TXML_Parser, handler TXML_UnknownEncodingHandler, data uintptr) {
  5073. if parser == libc.UintptrFromInt32(0) {
  5074. return
  5075. }
  5076. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_unknownEncodingHandler = handler
  5077. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_unknownEncodingHandlerData = data
  5078. }
  5079. func XXML_SetElementDeclHandler(tls *libc.TLS, parser TXML_Parser, eldecl TXML_ElementDeclHandler) {
  5080. if parser != libc.UintptrFromInt32(0) {
  5081. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_elementDeclHandler = eldecl
  5082. }
  5083. }
  5084. func XXML_SetAttlistDeclHandler(tls *libc.TLS, parser TXML_Parser, attdecl TXML_AttlistDeclHandler) {
  5085. if parser != libc.UintptrFromInt32(0) {
  5086. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_attlistDeclHandler = attdecl
  5087. }
  5088. }
  5089. func XXML_SetEntityDeclHandler(tls *libc.TLS, parser TXML_Parser, handler TXML_EntityDeclHandler) {
  5090. if parser != libc.UintptrFromInt32(0) {
  5091. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_entityDeclHandler = handler
  5092. }
  5093. }
  5094. func XXML_SetXmlDeclHandler(tls *libc.TLS, parser TXML_Parser, handler TXML_XmlDeclHandler) {
  5095. if parser != libc.UintptrFromInt32(0) {
  5096. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_xmlDeclHandler = handler
  5097. }
  5098. }
  5099. func XXML_SetParamEntityParsing(tls *libc.TLS, parser TXML_Parser, peParsing _XML_ParamEntityParsing) (r int32) {
  5100. if parser == libc.UintptrFromInt32(0) {
  5101. return 0
  5102. }
  5103. /* block after XML_Parse()/XML_ParseBuffer() has been called */
  5104. if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parsingStatus.Fparsing == int32(_XML_PARSING) || (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parsingStatus.Fparsing == int32(_XML_SUSPENDED) {
  5105. return 0
  5106. }
  5107. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_paramEntityParsing = peParsing
  5108. return int32(1)
  5109. }
  5110. func XXML_SetHashSalt(tls *libc.TLS, parser TXML_Parser, hash_salt uint64) (r int32) {
  5111. if parser == libc.UintptrFromInt32(0) {
  5112. return 0
  5113. }
  5114. if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parentParser != 0 {
  5115. return XXML_SetHashSalt(tls, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parentParser, hash_salt)
  5116. }
  5117. /* block after XML_Parse()/XML_ParseBuffer() has been called */
  5118. if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parsingStatus.Fparsing == int32(_XML_PARSING) || (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parsingStatus.Fparsing == int32(_XML_SUSPENDED) {
  5119. return 0
  5120. }
  5121. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_hash_secret_salt = hash_salt
  5122. return int32(1)
  5123. }
  5124. func XXML_Parse(tls *libc.TLS, parser TXML_Parser, s uintptr, len1 int32, isFinal int32) (r _XML_Status) {
  5125. var buff uintptr
  5126. _ = buff
  5127. if parser == libc.UintptrFromInt32(0) || len1 < 0 || s == libc.UintptrFromInt32(0) && len1 != 0 {
  5128. if parser != libc.UintptrFromInt32(0) {
  5129. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_errorCode = int32(_XML_ERROR_INVALID_ARGUMENT)
  5130. }
  5131. return int32(_XML_STATUS_ERROR)
  5132. }
  5133. switch (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parsingStatus.Fparsing {
  5134. case int32(_XML_SUSPENDED):
  5135. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_errorCode = int32(_XML_ERROR_SUSPENDED)
  5136. return int32(_XML_STATUS_ERROR)
  5137. case int32(_XML_FINISHED):
  5138. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_errorCode = int32(_XML_ERROR_FINISHED)
  5139. return int32(_XML_STATUS_ERROR)
  5140. case int32(_XML_INITIALIZED):
  5141. if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parentParser == libc.UintptrFromInt32(0) && !(_startParsing(tls, parser) != 0) {
  5142. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_errorCode = int32(_XML_ERROR_NO_MEMORY)
  5143. return int32(_XML_STATUS_ERROR)
  5144. }
  5145. /* fall through */
  5146. fallthrough
  5147. default:
  5148. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parsingStatus.Fparsing = int32(_XML_PARSING)
  5149. }
  5150. if len1 == 0 {
  5151. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parsingStatus.FfinalBuffer = libc.Uint8FromInt32(isFinal)
  5152. if !(isFinal != 0) {
  5153. return int32(_XML_STATUS_OK)
  5154. }
  5155. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_positionPtr = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_bufferPtr
  5156. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parseEndPtr = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_bufferEnd
  5157. /* If data are left over from last buffer, and we now know that these
  5158. data are the final chunk of input, then we have to check them again
  5159. to detect errors based on that fact.
  5160. */
  5161. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_errorCode = (*(*func(*libc.TLS, TXML_Parser, uintptr, uintptr, uintptr) _XML_Error)(unsafe.Pointer(&struct{ uintptr }{(*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_processor})))(tls, parser, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_bufferPtr, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parseEndPtr, parser+48)
  5162. if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_errorCode == int32(_XML_ERROR_NONE) {
  5163. switch (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parsingStatus.Fparsing {
  5164. case int32(_XML_SUSPENDED):
  5165. /* It is hard to be certain, but it seems that this case
  5166. * cannot occur. This code is cleaning up a previous parse
  5167. * with no new data (since len == 0). Changing the parsing
  5168. * state requires getting to execute a handler function, and
  5169. * there doesn't seem to be an opportunity for that while in
  5170. * this circumstance.
  5171. *
  5172. * Given the uncertainty, we retain the code but exclude it
  5173. * from coverage tests.
  5174. *
  5175. * LCOV_EXCL_START
  5176. */
  5177. (*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TENCODING)(unsafe.Pointer((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_encoding)).FupdatePosition})))(tls, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_encoding, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_positionPtr, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_bufferPtr, parser+768)
  5178. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_positionPtr = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_bufferPtr
  5179. return int32(_XML_STATUS_SUSPENDED)
  5180. /* LCOV_EXCL_STOP */
  5181. fallthrough
  5182. case int32(_XML_INITIALIZED):
  5183. fallthrough
  5184. case int32(_XML_PARSING):
  5185. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parsingStatus.Fparsing = int32(_XML_FINISHED)
  5186. /* fall through */
  5187. fallthrough
  5188. default:
  5189. return int32(_XML_STATUS_OK)
  5190. }
  5191. }
  5192. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_eventEndPtr = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_eventPtr
  5193. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_processor = __ccgo_fp(_errorProcessor)
  5194. return int32(_XML_STATUS_ERROR)
  5195. } else {
  5196. buff = XXML_GetBuffer(tls, parser, len1)
  5197. if buff == libc.UintptrFromInt32(0) {
  5198. return int32(_XML_STATUS_ERROR)
  5199. } else {
  5200. libc.X__builtin___memcpy_chk(tls, buff, s, libc.Uint64FromInt32(len1), ^t__predefined_size_t(0))
  5201. return XXML_ParseBuffer(tls, parser, len1, isFinal)
  5202. }
  5203. }
  5204. return r
  5205. }
  5206. func XXML_ParseBuffer(tls *libc.TLS, parser TXML_Parser, len1 int32, isFinal int32) (r _XML_Status) {
  5207. var result _XML_Status
  5208. var start uintptr
  5209. _, _ = result, start
  5210. result = int32(_XML_STATUS_OK)
  5211. if parser == libc.UintptrFromInt32(0) {
  5212. return int32(_XML_STATUS_ERROR)
  5213. }
  5214. switch (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parsingStatus.Fparsing {
  5215. case int32(_XML_SUSPENDED):
  5216. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_errorCode = int32(_XML_ERROR_SUSPENDED)
  5217. return int32(_XML_STATUS_ERROR)
  5218. case int32(_XML_FINISHED):
  5219. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_errorCode = int32(_XML_ERROR_FINISHED)
  5220. return int32(_XML_STATUS_ERROR)
  5221. case int32(_XML_INITIALIZED):
  5222. /* Has someone called XML_GetBuffer successfully before? */
  5223. if !((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_bufferPtr != 0) {
  5224. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_errorCode = int32(_XML_ERROR_NO_BUFFER)
  5225. return int32(_XML_STATUS_ERROR)
  5226. }
  5227. if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parentParser == libc.UintptrFromInt32(0) && !(_startParsing(tls, parser) != 0) {
  5228. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_errorCode = int32(_XML_ERROR_NO_MEMORY)
  5229. return int32(_XML_STATUS_ERROR)
  5230. }
  5231. /* fall through */
  5232. fallthrough
  5233. default:
  5234. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parsingStatus.Fparsing = int32(_XML_PARSING)
  5235. }
  5236. start = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_bufferPtr
  5237. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_positionPtr = start
  5238. *(*uintptr)(unsafe.Pointer(parser + 56)) += uintptr(len1)
  5239. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parseEndPtr = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_bufferEnd
  5240. *(*TXML_Index)(unsafe.Pointer(parser + 72)) += int64(len1)
  5241. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parsingStatus.FfinalBuffer = libc.Uint8FromInt32(isFinal)
  5242. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_errorCode = (*(*func(*libc.TLS, TXML_Parser, uintptr, uintptr, uintptr) _XML_Error)(unsafe.Pointer(&struct{ uintptr }{(*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_processor})))(tls, parser, start, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parseEndPtr, parser+48)
  5243. if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_errorCode != int32(_XML_ERROR_NONE) {
  5244. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_eventEndPtr = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_eventPtr
  5245. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_processor = __ccgo_fp(_errorProcessor)
  5246. return int32(_XML_STATUS_ERROR)
  5247. } else {
  5248. switch (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parsingStatus.Fparsing {
  5249. case int32(_XML_SUSPENDED):
  5250. result = int32(_XML_STATUS_SUSPENDED)
  5251. case int32(_XML_INITIALIZED):
  5252. fallthrough
  5253. case int32(_XML_PARSING):
  5254. if isFinal != 0 {
  5255. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parsingStatus.Fparsing = int32(_XML_FINISHED)
  5256. return result
  5257. }
  5258. fallthrough
  5259. default: /* should not happen */
  5260. }
  5261. }
  5262. (*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TENCODING)(unsafe.Pointer((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_encoding)).FupdatePosition})))(tls, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_encoding, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_positionPtr, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_bufferPtr, parser+768)
  5263. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_positionPtr = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_bufferPtr
  5264. return result
  5265. }
  5266. func XXML_GetBuffer(tls *libc.TLS, parser TXML_Parser, len1 int32) (r uintptr) {
  5267. var bufferSize, keep, neededSize, offset int32
  5268. var newBuf, v10, v11 uintptr
  5269. var v1, v2, v3, v4, v5, v6, v7, v8, v9 int64
  5270. _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = bufferSize, keep, neededSize, newBuf, offset, v1, v10, v11, v2, v3, v4, v5, v6, v7, v8, v9
  5271. if parser == libc.UintptrFromInt32(0) {
  5272. return libc.UintptrFromInt32(0)
  5273. }
  5274. if len1 < 0 {
  5275. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_errorCode = int32(_XML_ERROR_NO_MEMORY)
  5276. return libc.UintptrFromInt32(0)
  5277. }
  5278. switch (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parsingStatus.Fparsing {
  5279. case int32(_XML_SUSPENDED):
  5280. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_errorCode = int32(_XML_ERROR_SUSPENDED)
  5281. return libc.UintptrFromInt32(0)
  5282. case int32(_XML_FINISHED):
  5283. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_errorCode = int32(_XML_ERROR_FINISHED)
  5284. return libc.UintptrFromInt32(0)
  5285. default:
  5286. }
  5287. if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_bufferLim != 0 && (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_bufferEnd != 0 {
  5288. v1 = int64((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_bufferLim) - int64((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_bufferEnd)
  5289. } else {
  5290. v1 = 0
  5291. }
  5292. if int64(len1) > v1 {
  5293. if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_bufferEnd != 0 && (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_bufferPtr != 0 {
  5294. v2 = int64((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_bufferEnd) - int64((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_bufferPtr)
  5295. } else {
  5296. v2 = 0
  5297. }
  5298. /* Do not invoke signed arithmetic overflow: */
  5299. neededSize = libc.Int32FromUint32(libc.Uint32FromInt32(len1) + libc.Uint32FromInt64(v2))
  5300. if neededSize < 0 {
  5301. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_errorCode = int32(_XML_ERROR_NO_MEMORY)
  5302. return libc.UintptrFromInt32(0)
  5303. }
  5304. if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_bufferPtr != 0 && (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_buffer != 0 {
  5305. v3 = int64((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_bufferPtr) - int64((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_buffer)
  5306. } else {
  5307. v3 = 0
  5308. }
  5309. keep = int32(v3)
  5310. if keep > int32(m_XML_CONTEXT_BYTES) {
  5311. keep = int32(m_XML_CONTEXT_BYTES)
  5312. }
  5313. /* Detect and prevent integer overflow */
  5314. if keep > int32(m___INT_MAX__)-neededSize {
  5315. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_errorCode = int32(_XML_ERROR_NO_MEMORY)
  5316. return libc.UintptrFromInt32(0)
  5317. }
  5318. neededSize += keep
  5319. if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_bufferLim != 0 && (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_buffer != 0 {
  5320. v4 = int64((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_bufferLim) - int64((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_buffer)
  5321. } else {
  5322. v4 = 0
  5323. }
  5324. if int64(neededSize) <= v4 {
  5325. if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_bufferPtr != 0 && (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_buffer != 0 {
  5326. v5 = int64((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_bufferPtr) - int64((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_buffer)
  5327. } else {
  5328. v5 = 0
  5329. }
  5330. if int64(keep) < v5 {
  5331. if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_bufferPtr != 0 && (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_buffer != 0 {
  5332. v6 = int64((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_bufferPtr) - int64((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_buffer)
  5333. } else {
  5334. v6 = 0
  5335. }
  5336. offset = int32(v6) - keep
  5337. /* The buffer pointers cannot be NULL here; we have at least some bytes
  5338. * in the buffer */
  5339. libc.X__builtin___memmove_chk(tls, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_buffer, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_buffer+uintptr(offset), libc.Uint64FromInt64(int64((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_bufferEnd)-int64((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_bufferPtr)+int64(keep)), ^t__predefined_size_t(0))
  5340. *(*uintptr)(unsafe.Pointer(parser + 56)) -= uintptr(offset)
  5341. *(*uintptr)(unsafe.Pointer(parser + 48)) -= uintptr(offset)
  5342. }
  5343. } else {
  5344. if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_bufferLim != 0 && (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_bufferPtr != 0 {
  5345. v7 = int64((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_bufferLim) - int64((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_bufferPtr)
  5346. } else {
  5347. v7 = 0
  5348. }
  5349. bufferSize = int32(v7)
  5350. if bufferSize == 0 {
  5351. bufferSize = int32(m_INIT_BUFFER_SIZE)
  5352. }
  5353. for cond := true; cond; cond = bufferSize < neededSize && bufferSize > 0 {
  5354. /* Do not invoke signed arithmetic overflow: */
  5355. bufferSize = libc.Int32FromUint32(libc.Uint32FromUint32(2) * libc.Uint32FromInt32(bufferSize))
  5356. }
  5357. if bufferSize <= 0 {
  5358. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_errorCode = int32(_XML_ERROR_NO_MEMORY)
  5359. return libc.UintptrFromInt32(0)
  5360. }
  5361. newBuf = (*(*func(*libc.TLS, Tsize_t) uintptr)(unsafe.Pointer(&struct{ uintptr }{(*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_mem.Fmalloc_fcn})))(tls, libc.Uint64FromInt32(bufferSize))
  5362. if newBuf == uintptr(0) {
  5363. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_errorCode = int32(_XML_ERROR_NO_MEMORY)
  5364. return libc.UintptrFromInt32(0)
  5365. }
  5366. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_bufferLim = newBuf + uintptr(bufferSize)
  5367. if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_bufferPtr != 0 {
  5368. if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_bufferEnd != 0 && (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_bufferPtr != 0 {
  5369. v8 = int64((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_bufferEnd) - int64((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_bufferPtr)
  5370. } else {
  5371. v8 = 0
  5372. }
  5373. libc.X__builtin___memcpy_chk(tls, newBuf, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_bufferPtr+uintptr(-keep), libc.Uint64FromInt64(v8+int64(keep)), ^t__predefined_size_t(0))
  5374. (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_mem.Ffree_fcn})))(tls, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_buffer)
  5375. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_buffer = newBuf
  5376. if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_bufferEnd != 0 && (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_bufferPtr != 0 {
  5377. v9 = int64((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_bufferEnd) - int64((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_bufferPtr)
  5378. } else {
  5379. v9 = 0
  5380. }
  5381. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_bufferEnd = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_buffer + uintptr(v9) + uintptr(keep)
  5382. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_bufferPtr = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_buffer + uintptr(keep)
  5383. } else {
  5384. /* This must be a brand new buffer with no data in it yet */
  5385. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_bufferEnd = newBuf
  5386. v10 = newBuf
  5387. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_buffer = v10
  5388. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_bufferPtr = v10
  5389. }
  5390. }
  5391. v11 = libc.UintptrFromInt32(0)
  5392. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_eventEndPtr = v11
  5393. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_eventPtr = v11
  5394. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_positionPtr = libc.UintptrFromInt32(0)
  5395. }
  5396. return (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_bufferEnd
  5397. }
  5398. func XXML_StopParser(tls *libc.TLS, parser TXML_Parser, resumable TXML_Bool) (r _XML_Status) {
  5399. if parser == libc.UintptrFromInt32(0) {
  5400. return int32(_XML_STATUS_ERROR)
  5401. }
  5402. switch (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parsingStatus.Fparsing {
  5403. case int32(_XML_SUSPENDED):
  5404. if resumable != 0 {
  5405. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_errorCode = int32(_XML_ERROR_SUSPENDED)
  5406. return int32(_XML_STATUS_ERROR)
  5407. }
  5408. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parsingStatus.Fparsing = int32(_XML_FINISHED)
  5409. case int32(_XML_FINISHED):
  5410. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_errorCode = int32(_XML_ERROR_FINISHED)
  5411. return int32(_XML_STATUS_ERROR)
  5412. default:
  5413. if resumable != 0 {
  5414. if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_isParamEntity != 0 {
  5415. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_errorCode = int32(_XML_ERROR_SUSPEND_PE)
  5416. return int32(_XML_STATUS_ERROR)
  5417. }
  5418. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parsingStatus.Fparsing = int32(_XML_SUSPENDED)
  5419. } else {
  5420. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parsingStatus.Fparsing = int32(_XML_FINISHED)
  5421. }
  5422. }
  5423. return int32(_XML_STATUS_OK)
  5424. }
  5425. func XXML_ResumeParser(tls *libc.TLS, parser TXML_Parser) (r _XML_Status) {
  5426. var result _XML_Status
  5427. _ = result
  5428. result = int32(_XML_STATUS_OK)
  5429. if parser == libc.UintptrFromInt32(0) {
  5430. return int32(_XML_STATUS_ERROR)
  5431. }
  5432. if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parsingStatus.Fparsing != int32(_XML_SUSPENDED) {
  5433. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_errorCode = int32(_XML_ERROR_NOT_SUSPENDED)
  5434. return int32(_XML_STATUS_ERROR)
  5435. }
  5436. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parsingStatus.Fparsing = int32(_XML_PARSING)
  5437. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_errorCode = (*(*func(*libc.TLS, TXML_Parser, uintptr, uintptr, uintptr) _XML_Error)(unsafe.Pointer(&struct{ uintptr }{(*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_processor})))(tls, parser, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_bufferPtr, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parseEndPtr, parser+48)
  5438. if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_errorCode != int32(_XML_ERROR_NONE) {
  5439. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_eventEndPtr = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_eventPtr
  5440. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_processor = __ccgo_fp(_errorProcessor)
  5441. return int32(_XML_STATUS_ERROR)
  5442. } else {
  5443. switch (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parsingStatus.Fparsing {
  5444. case int32(_XML_SUSPENDED):
  5445. result = int32(_XML_STATUS_SUSPENDED)
  5446. case int32(_XML_INITIALIZED):
  5447. fallthrough
  5448. case int32(_XML_PARSING):
  5449. if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parsingStatus.FfinalBuffer != 0 {
  5450. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parsingStatus.Fparsing = int32(_XML_FINISHED)
  5451. return result
  5452. }
  5453. fallthrough
  5454. default:
  5455. }
  5456. }
  5457. (*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TENCODING)(unsafe.Pointer((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_encoding)).FupdatePosition})))(tls, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_encoding, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_positionPtr, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_bufferPtr, parser+768)
  5458. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_positionPtr = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_bufferPtr
  5459. return result
  5460. }
  5461. func XXML_GetParsingStatus(tls *libc.TLS, parser TXML_Parser, status uintptr) {
  5462. if parser == libc.UintptrFromInt32(0) {
  5463. return
  5464. }
  5465. *(*TXML_ParsingStatus)(unsafe.Pointer(status)) = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parsingStatus
  5466. }
  5467. func XXML_GetErrorCode(tls *libc.TLS, parser TXML_Parser) (r _XML_Error) {
  5468. if parser == libc.UintptrFromInt32(0) {
  5469. return int32(_XML_ERROR_INVALID_ARGUMENT)
  5470. }
  5471. return (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_errorCode
  5472. }
  5473. func XXML_GetCurrentByteIndex(tls *libc.TLS, parser TXML_Parser) (r TXML_Index) {
  5474. if parser == libc.UintptrFromInt32(0) {
  5475. return int64(-int32(1))
  5476. }
  5477. if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_eventPtr != 0 {
  5478. return (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parseEndByteIndex - (int64((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parseEndPtr) - int64((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_eventPtr))
  5479. }
  5480. return int64(-int32(1))
  5481. }
  5482. func XXML_GetCurrentByteCount(tls *libc.TLS, parser TXML_Parser) (r int32) {
  5483. if parser == libc.UintptrFromInt32(0) {
  5484. return 0
  5485. }
  5486. if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_eventEndPtr != 0 && (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_eventPtr != 0 {
  5487. return int32(int64((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_eventEndPtr) - int64((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_eventPtr))
  5488. }
  5489. return 0
  5490. }
  5491. func XXML_GetInputContext(tls *libc.TLS, parser TXML_Parser, offset uintptr, size uintptr) (r uintptr) {
  5492. if parser == libc.UintptrFromInt32(0) {
  5493. return libc.UintptrFromInt32(0)
  5494. }
  5495. if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_eventPtr != 0 && (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_buffer != 0 {
  5496. if offset != libc.UintptrFromInt32(0) {
  5497. *(*int32)(unsafe.Pointer(offset)) = int32(int64((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_eventPtr) - int64((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_buffer))
  5498. }
  5499. if size != libc.UintptrFromInt32(0) {
  5500. *(*int32)(unsafe.Pointer(size)) = int32(int64((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_bufferEnd) - int64((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_buffer))
  5501. }
  5502. return (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_buffer
  5503. }
  5504. return libc.UintptrFromInt32(0)
  5505. }
  5506. func XXML_GetCurrentLineNumber(tls *libc.TLS, parser TXML_Parser) (r TXML_Size) {
  5507. if parser == libc.UintptrFromInt32(0) {
  5508. return uint64(0)
  5509. }
  5510. if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_eventPtr != 0 && (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_eventPtr >= (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_positionPtr {
  5511. (*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TENCODING)(unsafe.Pointer((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_encoding)).FupdatePosition})))(tls, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_encoding, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_positionPtr, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_eventPtr, parser+768)
  5512. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_positionPtr = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_eventPtr
  5513. }
  5514. return (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_position.FlineNumber + uint64(1)
  5515. }
  5516. func XXML_GetCurrentColumnNumber(tls *libc.TLS, parser TXML_Parser) (r TXML_Size) {
  5517. if parser == libc.UintptrFromInt32(0) {
  5518. return uint64(0)
  5519. }
  5520. if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_eventPtr != 0 && (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_eventPtr >= (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_positionPtr {
  5521. (*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TENCODING)(unsafe.Pointer((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_encoding)).FupdatePosition})))(tls, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_encoding, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_positionPtr, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_eventPtr, parser+768)
  5522. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_positionPtr = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_eventPtr
  5523. }
  5524. return (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_position.FcolumnNumber
  5525. }
  5526. func XXML_FreeContentModel(tls *libc.TLS, parser TXML_Parser, model uintptr) {
  5527. if parser != libc.UintptrFromInt32(0) {
  5528. (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_mem.Ffree_fcn})))(tls, model)
  5529. }
  5530. }
  5531. func XXML_MemMalloc(tls *libc.TLS, parser TXML_Parser, size Tsize_t) (r uintptr) {
  5532. if parser == libc.UintptrFromInt32(0) {
  5533. return libc.UintptrFromInt32(0)
  5534. }
  5535. return (*(*func(*libc.TLS, Tsize_t) uintptr)(unsafe.Pointer(&struct{ uintptr }{(*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_mem.Fmalloc_fcn})))(tls, size)
  5536. }
  5537. func XXML_MemRealloc(tls *libc.TLS, parser TXML_Parser, ptr uintptr, size Tsize_t) (r uintptr) {
  5538. if parser == libc.UintptrFromInt32(0) {
  5539. return libc.UintptrFromInt32(0)
  5540. }
  5541. return (*(*func(*libc.TLS, uintptr, Tsize_t) uintptr)(unsafe.Pointer(&struct{ uintptr }{(*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_mem.Frealloc_fcn})))(tls, ptr, size)
  5542. }
  5543. func XXML_MemFree(tls *libc.TLS, parser TXML_Parser, ptr uintptr) {
  5544. if parser != libc.UintptrFromInt32(0) {
  5545. (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_mem.Ffree_fcn})))(tls, ptr)
  5546. }
  5547. }
  5548. func XXML_DefaultCurrent(tls *libc.TLS, parser TXML_Parser) {
  5549. if parser == libc.UintptrFromInt32(0) {
  5550. return
  5551. }
  5552. if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_defaultHandler != 0 {
  5553. if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_openInternalEntities != 0 {
  5554. _reportDefault(tls, parser, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_internalEncoding, (*TOPEN_INTERNAL_ENTITY)(unsafe.Pointer((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_openInternalEntities)).FinternalEventPtr, (*TOPEN_INTERNAL_ENTITY)(unsafe.Pointer((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_openInternalEntities)).FinternalEventEndPtr)
  5555. } else {
  5556. _reportDefault(tls, parser, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_encoding, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_eventPtr, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_eventEndPtr)
  5557. }
  5558. }
  5559. }
  5560. func XXML_ErrorString(tls *libc.TLS, code _XML_Error) (r uintptr) {
  5561. switch code {
  5562. case int32(_XML_ERROR_NONE):
  5563. return libc.UintptrFromInt32(0)
  5564. case int32(_XML_ERROR_NO_MEMORY):
  5565. return __ccgo_ts + 138
  5566. case int32(_XML_ERROR_SYNTAX):
  5567. return __ccgo_ts + 152
  5568. case int32(_XML_ERROR_NO_ELEMENTS):
  5569. return __ccgo_ts + 165
  5570. case int32(_XML_ERROR_INVALID_TOKEN):
  5571. return __ccgo_ts + 182
  5572. case int32(_XML_ERROR_UNCLOSED_TOKEN):
  5573. return __ccgo_ts + 214
  5574. case int32(_XML_ERROR_PARTIAL_CHAR):
  5575. return __ccgo_ts + 229
  5576. case int32(_XML_ERROR_TAG_MISMATCH):
  5577. return __ccgo_ts + 247
  5578. case int32(_XML_ERROR_DUPLICATE_ATTRIBUTE):
  5579. return __ccgo_ts + 262
  5580. case int32(_XML_ERROR_JUNK_AFTER_DOC_ELEMENT):
  5581. return __ccgo_ts + 282
  5582. case int32(_XML_ERROR_PARAM_ENTITY_REF):
  5583. return __ccgo_ts + 310
  5584. case int32(_XML_ERROR_UNDEFINED_ENTITY):
  5585. return __ccgo_ts + 345
  5586. case int32(_XML_ERROR_RECURSIVE_ENTITY_REF):
  5587. return __ccgo_ts + 362
  5588. case int32(_XML_ERROR_ASYNC_ENTITY):
  5589. return __ccgo_ts + 389
  5590. case int32(_XML_ERROR_BAD_CHAR_REF):
  5591. return __ccgo_ts + 409
  5592. case int32(_XML_ERROR_BINARY_ENTITY_REF):
  5593. return __ccgo_ts + 447
  5594. case int32(_XML_ERROR_ATTRIBUTE_EXTERNAL_ENTITY_REF):
  5595. return __ccgo_ts + 474
  5596. case int32(_XML_ERROR_MISPLACED_XML_PI):
  5597. return __ccgo_ts + 516
  5598. case int32(_XML_ERROR_UNKNOWN_ENCODING):
  5599. return __ccgo_ts + 563
  5600. case int32(_XML_ERROR_INCORRECT_ENCODING):
  5601. return __ccgo_ts + 580
  5602. case int32(_XML_ERROR_UNCLOSED_CDATA_SECTION):
  5603. return __ccgo_ts + 631
  5604. case int32(_XML_ERROR_EXTERNAL_ENTITY_HANDLING):
  5605. return __ccgo_ts + 654
  5606. case int32(_XML_ERROR_NOT_STANDALONE):
  5607. return __ccgo_ts + 700
  5608. case int32(_XML_ERROR_UNEXPECTED_STATE):
  5609. return __ccgo_ts + 727
  5610. case int32(_XML_ERROR_ENTITY_DECLARED_IN_PE):
  5611. return __ccgo_ts + 778
  5612. case int32(_XML_ERROR_FEATURE_REQUIRES_XML_DTD):
  5613. return __ccgo_ts + 814
  5614. case int32(_XML_ERROR_CANT_CHANGE_FEATURE_ONCE_PARSING):
  5615. return __ccgo_ts + 866
  5616. /* Added in 1.95.7. */
  5617. fallthrough
  5618. case int32(_XML_ERROR_UNBOUND_PREFIX):
  5619. return __ccgo_ts + 911
  5620. /* Added in 1.95.8. */
  5621. fallthrough
  5622. case int32(_XML_ERROR_UNDECLARING_PREFIX):
  5623. return __ccgo_ts + 926
  5624. case int32(_XML_ERROR_INCOMPLETE_PE):
  5625. return __ccgo_ts + 952
  5626. case int32(_XML_ERROR_XML_DECL):
  5627. return __ccgo_ts + 990
  5628. case int32(_XML_ERROR_TEXT_DECL):
  5629. return __ccgo_ts + 1022
  5630. case int32(_XML_ERROR_PUBLICID):
  5631. return __ccgo_ts + 1055
  5632. case int32(_XML_ERROR_SUSPENDED):
  5633. return __ccgo_ts + 1089
  5634. case int32(_XML_ERROR_NOT_SUSPENDED):
  5635. return __ccgo_ts + 1106
  5636. case int32(_XML_ERROR_ABORTED):
  5637. return __ccgo_ts + 1127
  5638. case int32(_XML_ERROR_FINISHED):
  5639. return __ccgo_ts + 1143
  5640. case int32(_XML_ERROR_SUSPEND_PE):
  5641. return __ccgo_ts + 1160
  5642. /* Added in 2.0.0. */
  5643. fallthrough
  5644. case int32(_XML_ERROR_RESERVED_PREFIX_XML):
  5645. return __ccgo_ts + 1204
  5646. case int32(_XML_ERROR_RESERVED_PREFIX_XMLNS):
  5647. return __ccgo_ts + 1284
  5648. case int32(_XML_ERROR_RESERVED_NAMESPACE_URI):
  5649. return __ccgo_ts + 1343
  5650. /* Added in 2.2.5. */
  5651. fallthrough
  5652. case int32(_XML_ERROR_INVALID_ARGUMENT): /* Constant added in 2.2.1, already */
  5653. return __ccgo_ts + 1407
  5654. /* Added in 2.3.0. */
  5655. fallthrough
  5656. case int32(_XML_ERROR_NO_BUFFER):
  5657. return __ccgo_ts + 1424
  5658. /* Added in 2.4.0. */
  5659. fallthrough
  5660. case int32(_XML_ERROR_AMPLIFICATION_LIMIT_BREACH):
  5661. return __ccgo_ts + 1486
  5662. }
  5663. return libc.UintptrFromInt32(0)
  5664. }
  5665. func XXML_ExpatVersion(tls *libc.TLS) (r uintptr) {
  5666. /* V1 is used to string-ize the version number. However, it would
  5667. string-ize the actual version macro *names* unless we get them
  5668. substituted before being passed to V1. CPP is defined to expand
  5669. a macro, then rescan for more expansions. Thus, we use V2 to expand
  5670. the version macros, then CPP will expand the resulting V1() macro
  5671. with the correct numerals. */
  5672. /* ### I'm assuming cpp is portable in this respect... */
  5673. return __ccgo_ts + 1555
  5674. }
  5675. func XXML_ExpatVersionInfo(tls *libc.TLS) (r TXML_Expat_Version) {
  5676. var version TXML_Expat_Version
  5677. _ = version
  5678. version.Fmajor = int32(m_XML_MAJOR_VERSION)
  5679. version.Fminor = int32(m_XML_MINOR_VERSION)
  5680. version.Fmicro = m_XML_MICRO_VERSION
  5681. return version
  5682. }
  5683. func XXML_GetFeatureList(tls *libc.TLS) (r uintptr) {
  5684. return uintptr(unsafe.Pointer(&_features))
  5685. }
  5686. var _features = [8]TXML_Feature{
  5687. 0: {
  5688. Ffeature: int32(_XML_FEATURE_SIZEOF_XML_CHAR),
  5689. Fname: __ccgo_ts + 1567,
  5690. Fvalue: int64(1),
  5691. },
  5692. 1: {
  5693. Ffeature: int32(_XML_FEATURE_SIZEOF_XML_LCHAR),
  5694. Fname: __ccgo_ts + 1584,
  5695. Fvalue: int64(1),
  5696. },
  5697. 2: {
  5698. Ffeature: int32(_XML_FEATURE_DTD),
  5699. Fname: __ccgo_ts + 1602,
  5700. },
  5701. 3: {
  5702. Ffeature: int32(_XML_FEATURE_CONTEXT_BYTES),
  5703. Fname: __ccgo_ts + 1610,
  5704. Fvalue: int64(m_XML_CONTEXT_BYTES),
  5705. },
  5706. 4: {
  5707. Ffeature: int32(_XML_FEATURE_NS),
  5708. Fname: __ccgo_ts + 1628,
  5709. },
  5710. 5: {
  5711. Ffeature: int32(_XML_FEATURE_BILLION_LAUGHS_ATTACK_PROTECTION_MAXIMUM_AMPLIFICATION_DEFAULT),
  5712. Fname: __ccgo_ts + 1635,
  5713. Fvalue: libc.Int64FromFloat32(100),
  5714. },
  5715. 6: {
  5716. Ffeature: int32(_XML_FEATURE_BILLION_LAUGHS_ATTACK_PROTECTION_ACTIVATION_THRESHOLD_DEFAULT),
  5717. Fname: __ccgo_ts + 1652,
  5718. Fvalue: int64(m_EXPAT_BILLION_LAUGHS_ATTACK_PROTECTION_ACTIVATION_THRESHOLD_DEFAULT),
  5719. },
  5720. 7: {},
  5721. }
  5722. func XXML_SetBillionLaughsAttackProtectionMaximumAmplification(tls *libc.TLS, parser TXML_Parser, maximumAmplificationFactor float32) (r TXML_Bool) {
  5723. var v1 float32
  5724. var v2 int32
  5725. var v4 bool
  5726. _, _, _ = v1, v2, v4
  5727. if v4 = parser == libc.UintptrFromInt32(0) || (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parentParser != libc.UintptrFromInt32(0); !v4 {
  5728. v1 = maximumAmplificationFactor
  5729. v2 = libc.BoolInt32(v1 != v1)
  5730. goto _3
  5731. _3:
  5732. }
  5733. if v4 || v2 != 0 || maximumAmplificationFactor < libc.Float32FromFloat32(1) {
  5734. return libc.Uint8FromInt32(0)
  5735. }
  5736. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_accounting.FmaximumAmplificationFactor = maximumAmplificationFactor
  5737. return libc.Uint8FromInt32(1)
  5738. }
  5739. func XXML_SetBillionLaughsAttackProtectionActivationThreshold(tls *libc.TLS, parser TXML_Parser, activationThresholdBytes uint64) (r TXML_Bool) {
  5740. if parser == libc.UintptrFromInt32(0) || (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parentParser != libc.UintptrFromInt32(0) {
  5741. return libc.Uint8FromInt32(0)
  5742. }
  5743. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_accounting.FactivationThresholdBytes = activationThresholdBytes
  5744. return libc.Uint8FromInt32(1)
  5745. }
  5746. // C documentation
  5747. //
  5748. // /* Initially tag->rawName always points into the parse buffer;
  5749. // for those TAG instances opened while the current parse buffer was
  5750. // processed, and not yet closed, we need to store tag->rawName in a more
  5751. // permanent location, since the parse buffer is about to be discarded.
  5752. // */
  5753. func _storeRawNames(tls *libc.TLS, parser TXML_Parser) (r TXML_Bool) {
  5754. var bufSize, nameLen int32
  5755. var rawNameBuf, tag, temp uintptr
  5756. var rawNameLen Tsize_t
  5757. _, _, _, _, _, _ = bufSize, nameLen, rawNameBuf, rawNameLen, tag, temp
  5758. tag = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_tagStack
  5759. for tag != 0 {
  5760. nameLen = libc.Int32FromUint64(uint64(1) * libc.Uint64FromInt32((*TTAG)(unsafe.Pointer(tag)).Fname.FstrLen+libc.Int32FromInt32(1)))
  5761. rawNameBuf = (*TTAG)(unsafe.Pointer(tag)).Fbuf + uintptr(nameLen)
  5762. /* Stop if already stored. Since m_tagStack is a stack, we can stop
  5763. at the first entry that has already been copied; everything
  5764. below it in the stack is already been accounted for in a
  5765. previous call to this function.
  5766. */
  5767. if (*TTAG)(unsafe.Pointer(tag)).FrawName == rawNameBuf {
  5768. break
  5769. }
  5770. /* For re-use purposes we need to ensure that the
  5771. size of tag->buf is a multiple of sizeof(XML_Char).
  5772. */
  5773. rawNameLen = (libc.Uint64FromInt32((*TTAG)(unsafe.Pointer(tag)).FrawNameLength) + (libc.Uint64FromInt64(1) - libc.Uint64FromInt32(1))) & ^(libc.Uint64FromInt64(1) - libc.Uint64FromInt32(1))
  5774. /* Detect and prevent integer overflow. */
  5775. if rawNameLen > libc.Uint64FromInt32(m___INT_MAX__)-libc.Uint64FromInt32(nameLen) {
  5776. return libc.Uint8FromInt32(0)
  5777. }
  5778. bufSize = nameLen + libc.Int32FromUint64(rawNameLen)
  5779. if int64(bufSize) > int64((*TTAG)(unsafe.Pointer(tag)).FbufEnd)-int64((*TTAG)(unsafe.Pointer(tag)).Fbuf) {
  5780. temp = (*(*func(*libc.TLS, uintptr, Tsize_t) uintptr)(unsafe.Pointer(&struct{ uintptr }{(*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_mem.Frealloc_fcn})))(tls, (*TTAG)(unsafe.Pointer(tag)).Fbuf, libc.Uint64FromInt32(bufSize))
  5781. if temp == libc.UintptrFromInt32(0) {
  5782. return libc.Uint8FromInt32(0)
  5783. }
  5784. /* if tag->name.str points to tag->buf (only when namespace
  5785. processing is off) then we have to update it
  5786. */
  5787. if (*TTAG)(unsafe.Pointer(tag)).Fname.Fstr == (*TTAG)(unsafe.Pointer(tag)).Fbuf {
  5788. (*TTAG)(unsafe.Pointer(tag)).Fname.Fstr = temp
  5789. }
  5790. /* if tag->name.localPart is set (when namespace processing is on)
  5791. then update it as well, since it will always point into tag->buf
  5792. */
  5793. if (*TTAG)(unsafe.Pointer(tag)).Fname.FlocalPart != 0 {
  5794. (*TTAG)(unsafe.Pointer(tag)).Fname.FlocalPart = temp + uintptr(int64((*TTAG)(unsafe.Pointer(tag)).Fname.FlocalPart)-int64((*TTAG)(unsafe.Pointer(tag)).Fbuf))
  5795. }
  5796. (*TTAG)(unsafe.Pointer(tag)).Fbuf = temp
  5797. (*TTAG)(unsafe.Pointer(tag)).FbufEnd = temp + uintptr(bufSize)
  5798. rawNameBuf = temp + uintptr(nameLen)
  5799. }
  5800. libc.X__builtin___memcpy_chk(tls, rawNameBuf, (*TTAG)(unsafe.Pointer(tag)).FrawName, libc.Uint64FromInt32((*TTAG)(unsafe.Pointer(tag)).FrawNameLength), ^t__predefined_size_t(0))
  5801. (*TTAG)(unsafe.Pointer(tag)).FrawName = rawNameBuf
  5802. tag = (*TTAG)(unsafe.Pointer(tag)).Fparent
  5803. }
  5804. return libc.Uint8FromInt32(1)
  5805. }
  5806. func _contentProcessor(tls *libc.TLS, parser TXML_Parser, start uintptr, end uintptr, endPtr uintptr) (r _XML_Error) {
  5807. var result _XML_Error
  5808. _ = result
  5809. result = _doContent(tls, parser, 0, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_encoding, start, end, endPtr, libc.BoolUint8(!((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parsingStatus.FfinalBuffer != 0)), int32(_XML_ACCOUNT_DIRECT))
  5810. if result == int32(_XML_ERROR_NONE) {
  5811. if !(_storeRawNames(tls, parser) != 0) {
  5812. return int32(_XML_ERROR_NO_MEMORY)
  5813. }
  5814. }
  5815. return result
  5816. }
  5817. func _externalEntityInitProcessor(tls *libc.TLS, parser TXML_Parser, start uintptr, end uintptr, endPtr uintptr) (r _XML_Error) {
  5818. var result _XML_Error
  5819. _ = result
  5820. result = _initializeEncoding(tls, parser)
  5821. if result != int32(_XML_ERROR_NONE) {
  5822. return result
  5823. }
  5824. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_processor = __ccgo_fp(_externalEntityInitProcessor2)
  5825. return _externalEntityInitProcessor2(tls, parser, start, end, endPtr)
  5826. }
  5827. func _externalEntityInitProcessor2(tls *libc.TLS, parser TXML_Parser, start uintptr, end uintptr, endPtr uintptr) (r _XML_Error) {
  5828. bp := tls.Alloc(16)
  5829. defer tls.Free(16)
  5830. var tok int32
  5831. var _ /* next at bp+0 */ uintptr
  5832. _ = tok
  5833. *(*uintptr)(unsafe.Pointer(bp)) = start /* XmlContentTok doesn't always set the last arg */
  5834. tok = (*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{*(*TSCANNER)(unsafe.Pointer((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_encoding + 1*8))})))(tls, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_encoding, start, end, bp)
  5835. switch tok {
  5836. case int32(m_XML_TOK_BOM):
  5837. if !(_accountingDiffTolerated(tls, parser, tok, start, *(*uintptr)(unsafe.Pointer(bp)), int32(2649), int32(_XML_ACCOUNT_DIRECT)) != 0) {
  5838. _accountingOnAbort(tls, parser)
  5839. return int32(_XML_ERROR_AMPLIFICATION_LIMIT_BREACH)
  5840. }
  5841. /* If we are at the end of the buffer, this would cause the next stage,
  5842. i.e. externalEntityInitProcessor3, to pass control directly to
  5843. doContent (by detecting XML_TOK_NONE) without processing any xml text
  5844. declaration - causing the error XML_ERROR_MISPLACED_XML_PI in doContent.
  5845. */
  5846. if *(*uintptr)(unsafe.Pointer(bp)) == end && !((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parsingStatus.FfinalBuffer != 0) {
  5847. *(*uintptr)(unsafe.Pointer(endPtr)) = *(*uintptr)(unsafe.Pointer(bp))
  5848. return int32(_XML_ERROR_NONE)
  5849. }
  5850. start = *(*uintptr)(unsafe.Pointer(bp))
  5851. case -int32(1):
  5852. if !((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parsingStatus.FfinalBuffer != 0) {
  5853. *(*uintptr)(unsafe.Pointer(endPtr)) = start
  5854. return int32(_XML_ERROR_NONE)
  5855. }
  5856. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_eventPtr = start
  5857. return int32(_XML_ERROR_UNCLOSED_TOKEN)
  5858. case -int32(2):
  5859. if !((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parsingStatus.FfinalBuffer != 0) {
  5860. *(*uintptr)(unsafe.Pointer(endPtr)) = start
  5861. return int32(_XML_ERROR_NONE)
  5862. }
  5863. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_eventPtr = start
  5864. return int32(_XML_ERROR_PARTIAL_CHAR)
  5865. }
  5866. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_processor = __ccgo_fp(_externalEntityInitProcessor3)
  5867. return _externalEntityInitProcessor3(tls, parser, start, end, endPtr)
  5868. }
  5869. func _externalEntityInitProcessor3(tls *libc.TLS, parser TXML_Parser, start uintptr, end uintptr, endPtr uintptr) (r _XML_Error) {
  5870. bp := tls.Alloc(16)
  5871. defer tls.Free(16)
  5872. var result _XML_Error
  5873. var tok int32
  5874. var _ /* next at bp+0 */ uintptr
  5875. _, _ = result, tok
  5876. *(*uintptr)(unsafe.Pointer(bp)) = start /* XmlContentTok doesn't always set the last arg */
  5877. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_eventPtr = start
  5878. tok = (*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{*(*TSCANNER)(unsafe.Pointer((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_encoding + 1*8))})))(tls, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_encoding, start, end, bp)
  5879. /* Note: These bytes are accounted later in:
  5880. - processXmlDecl
  5881. - externalEntityContentProcessor
  5882. */
  5883. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_eventEndPtr = *(*uintptr)(unsafe.Pointer(bp))
  5884. switch tok {
  5885. case int32(m_XML_TOK_XML_DECL):
  5886. result = _processXmlDecl(tls, parser, int32(1), start, *(*uintptr)(unsafe.Pointer(bp)))
  5887. if result != int32(_XML_ERROR_NONE) {
  5888. return result
  5889. }
  5890. switch (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parsingStatus.Fparsing {
  5891. case int32(_XML_SUSPENDED):
  5892. *(*uintptr)(unsafe.Pointer(endPtr)) = *(*uintptr)(unsafe.Pointer(bp))
  5893. return int32(_XML_ERROR_NONE)
  5894. case int32(_XML_FINISHED):
  5895. return int32(_XML_ERROR_ABORTED)
  5896. default:
  5897. start = *(*uintptr)(unsafe.Pointer(bp))
  5898. }
  5899. case -int32(1):
  5900. if !((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parsingStatus.FfinalBuffer != 0) {
  5901. *(*uintptr)(unsafe.Pointer(endPtr)) = start
  5902. return int32(_XML_ERROR_NONE)
  5903. }
  5904. return int32(_XML_ERROR_UNCLOSED_TOKEN)
  5905. case -int32(2):
  5906. if !((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parsingStatus.FfinalBuffer != 0) {
  5907. *(*uintptr)(unsafe.Pointer(endPtr)) = start
  5908. return int32(_XML_ERROR_NONE)
  5909. }
  5910. return int32(_XML_ERROR_PARTIAL_CHAR)
  5911. }
  5912. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_processor = __ccgo_fp(_externalEntityContentProcessor)
  5913. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_tagLevel = int32(1)
  5914. return _externalEntityContentProcessor(tls, parser, start, end, endPtr)
  5915. }
  5916. func _externalEntityContentProcessor(tls *libc.TLS, parser TXML_Parser, start uintptr, end uintptr, endPtr uintptr) (r _XML_Error) {
  5917. var result _XML_Error
  5918. _ = result
  5919. result = _doContent(tls, parser, int32(1), (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_encoding, start, end, endPtr, libc.BoolUint8(!((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parsingStatus.FfinalBuffer != 0)), int32(_XML_ACCOUNT_ENTITY_EXPANSION))
  5920. if result == int32(_XML_ERROR_NONE) {
  5921. if !(_storeRawNames(tls, parser) != 0) {
  5922. return int32(_XML_ERROR_NO_MEMORY)
  5923. }
  5924. }
  5925. return result
  5926. }
  5927. func _doContent(tls *libc.TLS, parser TXML_Parser, startTagLevel int32, enc uintptr, _s uintptr, end uintptr, nextPtr uintptr, haveMore TXML_Bool, account _XML_Account) (r _XML_Error) {
  5928. bp := tls.Alloc(112)
  5929. defer tls.Free(112)
  5930. *(*uintptr)(unsafe.Pointer(bp)) = _s
  5931. var accountAfter, b, context, dtd, entity, eventEndPP, eventPP, localPart, name, prefix, rawName, rawName1, rawNameEnd, tag, tag1, temp, uri, v11, v2, v3, v5, v6, v7, v8, v9 uintptr
  5932. var bufSize, convLen, len1, n, tok int32
  5933. var charDataHandler TXML_CharacterDataHandler
  5934. var convert_res, convert_res1 _XML_Convert_Result
  5935. var noElmHandlers TXML_Bool
  5936. var result, result1, result2, result3 _XML_Error
  5937. var _ /* bindings at bp+40 */ uintptr
  5938. var _ /* buf at bp+88 */ [4]TXML_Char
  5939. var _ /* c at bp+16 */ TXML_Char
  5940. var _ /* c at bp+92 */ TXML_Char
  5941. var _ /* ch at bp+17 */ TXML_Char
  5942. var _ /* dataPtr at bp+104 */ uintptr
  5943. var _ /* dataPtr at bp+96 */ uintptr
  5944. var _ /* fromPtr at bp+32 */ uintptr
  5945. var _ /* name at bp+48 */ TTAG_NAME
  5946. var _ /* next at bp+8 */ uintptr
  5947. var _ /* toPtr at bp+24 */ uintptr
  5948. _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = accountAfter, b, bufSize, charDataHandler, context, convLen, convert_res, convert_res1, dtd, entity, eventEndPP, eventPP, len1, localPart, n, name, noElmHandlers, prefix, rawName, rawName1, rawNameEnd, result, result1, result2, result3, tag, tag1, temp, tok, uri, v11, v2, v3, v5, v6, v7, v8, v9
  5949. /* save one level of indirection */
  5950. dtd = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_dtd
  5951. if enc == (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_encoding {
  5952. eventPP = parser + 544
  5953. eventEndPP = parser + 552
  5954. } else {
  5955. eventPP = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_openInternalEntities
  5956. eventEndPP = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_openInternalEntities + 8
  5957. }
  5958. *(*uintptr)(unsafe.Pointer(eventPP)) = *(*uintptr)(unsafe.Pointer(bp))
  5959. for {
  5960. *(*uintptr)(unsafe.Pointer(bp + 8)) = *(*uintptr)(unsafe.Pointer(bp)) /* XmlContentTok doesn't always set the last arg */
  5961. tok = (*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{*(*TSCANNER)(unsafe.Pointer(enc + 1*8))})))(tls, enc, *(*uintptr)(unsafe.Pointer(bp)), end, bp+8)
  5962. if tok == -int32(5) || tok == -int32(3) {
  5963. if haveMore != 0 {
  5964. v3 = *(*uintptr)(unsafe.Pointer(bp))
  5965. } else {
  5966. v3 = end
  5967. }
  5968. v2 = v3
  5969. } else {
  5970. v2 = *(*uintptr)(unsafe.Pointer(bp + 8))
  5971. }
  5972. accountAfter = v2
  5973. if !(_accountingDiffTolerated(tls, parser, tok, *(*uintptr)(unsafe.Pointer(bp)), accountAfter, int32(2773), account) != 0) {
  5974. _accountingOnAbort(tls, parser)
  5975. return int32(_XML_ERROR_AMPLIFICATION_LIMIT_BREACH)
  5976. }
  5977. *(*uintptr)(unsafe.Pointer(eventEndPP)) = *(*uintptr)(unsafe.Pointer(bp + 8))
  5978. switch tok {
  5979. case -int32(3):
  5980. if haveMore != 0 {
  5981. *(*uintptr)(unsafe.Pointer(nextPtr)) = *(*uintptr)(unsafe.Pointer(bp))
  5982. return int32(_XML_ERROR_NONE)
  5983. }
  5984. *(*uintptr)(unsafe.Pointer(eventEndPP)) = end
  5985. if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_characterDataHandler != 0 {
  5986. *(*TXML_Char)(unsafe.Pointer(bp + 16)) = int8(0xA)
  5987. (*(*func(*libc.TLS, uintptr, uintptr, int32))(unsafe.Pointer(&struct{ uintptr }{(*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_characterDataHandler})))(tls, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_handlerArg, bp+16, int32(1))
  5988. } else {
  5989. if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_defaultHandler != 0 {
  5990. _reportDefault(tls, parser, enc, *(*uintptr)(unsafe.Pointer(bp)), end)
  5991. }
  5992. }
  5993. /* We are at the end of the final buffer, should we check for
  5994. XML_SUSPENDED, XML_FINISHED?
  5995. */
  5996. if startTagLevel == 0 {
  5997. return int32(_XML_ERROR_NO_ELEMENTS)
  5998. }
  5999. if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_tagLevel != startTagLevel {
  6000. return int32(_XML_ERROR_ASYNC_ENTITY)
  6001. }
  6002. *(*uintptr)(unsafe.Pointer(nextPtr)) = end
  6003. return int32(_XML_ERROR_NONE)
  6004. case -int32(4):
  6005. if haveMore != 0 {
  6006. *(*uintptr)(unsafe.Pointer(nextPtr)) = *(*uintptr)(unsafe.Pointer(bp))
  6007. return int32(_XML_ERROR_NONE)
  6008. }
  6009. if startTagLevel > 0 {
  6010. if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_tagLevel != startTagLevel {
  6011. return int32(_XML_ERROR_ASYNC_ENTITY)
  6012. }
  6013. *(*uintptr)(unsafe.Pointer(nextPtr)) = *(*uintptr)(unsafe.Pointer(bp))
  6014. return int32(_XML_ERROR_NONE)
  6015. }
  6016. return int32(_XML_ERROR_NO_ELEMENTS)
  6017. case m_XML_TOK_INVALID:
  6018. *(*uintptr)(unsafe.Pointer(eventPP)) = *(*uintptr)(unsafe.Pointer(bp + 8))
  6019. return int32(_XML_ERROR_INVALID_TOKEN)
  6020. case -int32(1):
  6021. if haveMore != 0 {
  6022. *(*uintptr)(unsafe.Pointer(nextPtr)) = *(*uintptr)(unsafe.Pointer(bp))
  6023. return int32(_XML_ERROR_NONE)
  6024. }
  6025. return int32(_XML_ERROR_UNCLOSED_TOKEN)
  6026. case -int32(2):
  6027. if haveMore != 0 {
  6028. *(*uintptr)(unsafe.Pointer(nextPtr)) = *(*uintptr)(unsafe.Pointer(bp))
  6029. return int32(_XML_ERROR_NONE)
  6030. }
  6031. return int32(_XML_ERROR_PARTIAL_CHAR)
  6032. case int32(m_XML_TOK_ENTITY_REF):
  6033. *(*TXML_Char)(unsafe.Pointer(bp + 17)) = int8((*(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*TENCODING)(unsafe.Pointer(enc)).FpredefinedEntityName})))(tls, enc, *(*uintptr)(unsafe.Pointer(bp))+uintptr((*TENCODING)(unsafe.Pointer(enc)).FminBytesPerChar), *(*uintptr)(unsafe.Pointer(bp + 8))-uintptr((*TENCODING)(unsafe.Pointer(enc)).FminBytesPerChar)))
  6034. if *(*TXML_Char)(unsafe.Pointer(bp + 17)) != 0 {
  6035. /* NOTE: We are replacing 4-6 characters original input for 1 character
  6036. * so there is no amplification and hence recording without
  6037. * protection. */
  6038. _accountingDiffTolerated(tls, parser, tok, bp+17, bp+17+uintptr(1), int32(2839), int32(_XML_ACCOUNT_ENTITY_EXPANSION))
  6039. if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_characterDataHandler != 0 {
  6040. (*(*func(*libc.TLS, uintptr, uintptr, int32))(unsafe.Pointer(&struct{ uintptr }{(*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_characterDataHandler})))(tls, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_handlerArg, bp+17, int32(1))
  6041. } else {
  6042. if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_defaultHandler != 0 {
  6043. _reportDefault(tls, parser, enc, *(*uintptr)(unsafe.Pointer(bp)), *(*uintptr)(unsafe.Pointer(bp + 8)))
  6044. }
  6045. }
  6046. break
  6047. }
  6048. name = _poolStoreString(tls, dtd+160, enc, *(*uintptr)(unsafe.Pointer(bp))+uintptr((*TENCODING)(unsafe.Pointer(enc)).FminBytesPerChar), *(*uintptr)(unsafe.Pointer(bp + 8))-uintptr((*TENCODING)(unsafe.Pointer(enc)).FminBytesPerChar))
  6049. if !(name != 0) {
  6050. return int32(_XML_ERROR_NO_MEMORY)
  6051. }
  6052. entity = _lookup(tls, parser, dtd, name, uint64(0))
  6053. (*TSTRING_POOL)(unsafe.Pointer(dtd + 160)).Fptr = (*TSTRING_POOL)(unsafe.Pointer(dtd + 160)).Fstart
  6054. /* First, determine if a check for an existing declaration is needed;
  6055. if yes, check that the entity exists, and that it is internal,
  6056. otherwise call the skipped entity or default handler.
  6057. */
  6058. if !((*TDTD)(unsafe.Pointer(dtd)).FhasParamEntityRefs != 0) || (*TDTD)(unsafe.Pointer(dtd)).Fstandalone != 0 {
  6059. if !(entity != 0) {
  6060. return int32(_XML_ERROR_UNDEFINED_ENTITY)
  6061. } else {
  6062. if !((*TENTITY)(unsafe.Pointer(entity)).Fis_internal != 0) {
  6063. return int32(_XML_ERROR_ENTITY_DECLARED_IN_PE)
  6064. }
  6065. }
  6066. } else {
  6067. if !(entity != 0) {
  6068. if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_skippedEntityHandler != 0 {
  6069. (*(*func(*libc.TLS, uintptr, uintptr, int32))(unsafe.Pointer(&struct{ uintptr }{(*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_skippedEntityHandler})))(tls, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_handlerArg, name, 0)
  6070. } else {
  6071. if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_defaultHandler != 0 {
  6072. _reportDefault(tls, parser, enc, *(*uintptr)(unsafe.Pointer(bp)), *(*uintptr)(unsafe.Pointer(bp + 8)))
  6073. }
  6074. }
  6075. break
  6076. }
  6077. }
  6078. if (*TENTITY)(unsafe.Pointer(entity)).Fopen != 0 {
  6079. return int32(_XML_ERROR_RECURSIVE_ENTITY_REF)
  6080. }
  6081. if (*TENTITY)(unsafe.Pointer(entity)).Fnotation != 0 {
  6082. return int32(_XML_ERROR_BINARY_ENTITY_REF)
  6083. }
  6084. if (*TENTITY)(unsafe.Pointer(entity)).FtextPtr != 0 {
  6085. if !((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_defaultExpandInternalEntities != 0) {
  6086. if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_skippedEntityHandler != 0 {
  6087. (*(*func(*libc.TLS, uintptr, uintptr, int32))(unsafe.Pointer(&struct{ uintptr }{(*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_skippedEntityHandler})))(tls, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_handlerArg, (*TENTITY)(unsafe.Pointer(entity)).Fname, 0)
  6088. } else {
  6089. if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_defaultHandler != 0 {
  6090. _reportDefault(tls, parser, enc, *(*uintptr)(unsafe.Pointer(bp)), *(*uintptr)(unsafe.Pointer(bp + 8)))
  6091. }
  6092. }
  6093. break
  6094. }
  6095. result = _processInternalEntity(tls, parser, entity, libc.Uint8FromInt32(0))
  6096. if result != int32(_XML_ERROR_NONE) {
  6097. return result
  6098. }
  6099. } else {
  6100. if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_externalEntityRefHandler != 0 {
  6101. (*TENTITY)(unsafe.Pointer(entity)).Fopen = libc.Uint8FromInt32(1)
  6102. context = _getContext(tls, parser)
  6103. (*TENTITY)(unsafe.Pointer(entity)).Fopen = libc.Uint8FromInt32(0)
  6104. if !(context != 0) {
  6105. return int32(_XML_ERROR_NO_MEMORY)
  6106. }
  6107. if !((*(*func(*libc.TLS, TXML_Parser, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_externalEntityRefHandler})))(tls, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_externalEntityRefHandlerArg, context, (*TENTITY)(unsafe.Pointer(entity)).Fbase, (*TENTITY)(unsafe.Pointer(entity)).FsystemId, (*TENTITY)(unsafe.Pointer(entity)).FpublicId) != 0) {
  6108. return int32(_XML_ERROR_EXTERNAL_ENTITY_HANDLING)
  6109. }
  6110. (*TSTRING_POOL)(unsafe.Pointer(parser + 784)).Fptr = (*TSTRING_POOL)(unsafe.Pointer(parser + 784)).Fstart
  6111. } else {
  6112. if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_defaultHandler != 0 {
  6113. _reportDefault(tls, parser, enc, *(*uintptr)(unsafe.Pointer(bp)), *(*uintptr)(unsafe.Pointer(bp + 8)))
  6114. }
  6115. }
  6116. }
  6117. case int32(m_XML_TOK_START_TAG_NO_ATTS):
  6118. /* fall through */
  6119. fallthrough
  6120. case int32(m_XML_TOK_START_TAG_WITH_ATTS):
  6121. if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_freeTagList != 0 {
  6122. tag = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_freeTagList
  6123. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_freeTagList = (*TTAG)(unsafe.Pointer((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_freeTagList)).Fparent
  6124. } else {
  6125. tag = (*(*func(*libc.TLS, Tsize_t) uintptr)(unsafe.Pointer(&struct{ uintptr }{(*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_mem.Fmalloc_fcn})))(tls, libc.Uint64FromInt64(88))
  6126. if !(tag != 0) {
  6127. return int32(_XML_ERROR_NO_MEMORY)
  6128. }
  6129. (*TTAG)(unsafe.Pointer(tag)).Fbuf = (*(*func(*libc.TLS, Tsize_t) uintptr)(unsafe.Pointer(&struct{ uintptr }{(*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_mem.Fmalloc_fcn})))(tls, libc.Uint64FromInt32(libc.Int32FromInt32(m_INIT_TAG_BUF_SIZE)))
  6130. if !((*TTAG)(unsafe.Pointer(tag)).Fbuf != 0) {
  6131. (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_mem.Ffree_fcn})))(tls, tag)
  6132. return int32(_XML_ERROR_NO_MEMORY)
  6133. }
  6134. (*TTAG)(unsafe.Pointer(tag)).FbufEnd = (*TTAG)(unsafe.Pointer(tag)).Fbuf + uintptr(m_INIT_TAG_BUF_SIZE)
  6135. }
  6136. (*TTAG)(unsafe.Pointer(tag)).Fbindings = libc.UintptrFromInt32(0)
  6137. (*TTAG)(unsafe.Pointer(tag)).Fparent = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_tagStack
  6138. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_tagStack = tag
  6139. (*TTAG)(unsafe.Pointer(tag)).Fname.FlocalPart = libc.UintptrFromInt32(0)
  6140. (*TTAG)(unsafe.Pointer(tag)).Fname.Fprefix = libc.UintptrFromInt32(0)
  6141. (*TTAG)(unsafe.Pointer(tag)).FrawName = *(*uintptr)(unsafe.Pointer(bp)) + uintptr((*TENCODING)(unsafe.Pointer(enc)).FminBytesPerChar)
  6142. (*TTAG)(unsafe.Pointer(tag)).FrawNameLength = (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*TENCODING)(unsafe.Pointer(enc)).FnameLength})))(tls, enc, (*TTAG)(unsafe.Pointer(tag)).FrawName)
  6143. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_tagLevel++
  6144. rawNameEnd = (*TTAG)(unsafe.Pointer(tag)).FrawName + uintptr((*TTAG)(unsafe.Pointer(tag)).FrawNameLength)
  6145. *(*uintptr)(unsafe.Pointer(bp + 32)) = (*TTAG)(unsafe.Pointer(tag)).FrawName
  6146. *(*uintptr)(unsafe.Pointer(bp + 24)) = (*TTAG)(unsafe.Pointer(tag)).Fbuf
  6147. for {
  6148. convert_res = (*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr, uintptr) _XML_Convert_Result)(unsafe.Pointer(&struct{ uintptr }{(*TENCODING)(unsafe.Pointer(enc)).Futf8Convert})))(tls, enc, bp+32, rawNameEnd, bp+24, (*TTAG)(unsafe.Pointer(tag)).FbufEnd-uintptr(1))
  6149. convLen = int32(int64(*(*uintptr)(unsafe.Pointer(bp + 24))) - int64((*TTAG)(unsafe.Pointer(tag)).Fbuf))
  6150. if *(*uintptr)(unsafe.Pointer(bp + 32)) >= rawNameEnd || convert_res == int32(_XML_CONVERT_INPUT_INCOMPLETE) {
  6151. (*TTAG)(unsafe.Pointer(tag)).Fname.FstrLen = convLen
  6152. break
  6153. }
  6154. bufSize = int32(int64((*TTAG)(unsafe.Pointer(tag)).FbufEnd)-int64((*TTAG)(unsafe.Pointer(tag)).Fbuf)) << int32(1)
  6155. temp = (*(*func(*libc.TLS, uintptr, Tsize_t) uintptr)(unsafe.Pointer(&struct{ uintptr }{(*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_mem.Frealloc_fcn})))(tls, (*TTAG)(unsafe.Pointer(tag)).Fbuf, libc.Uint64FromInt32(bufSize))
  6156. if temp == libc.UintptrFromInt32(0) {
  6157. return int32(_XML_ERROR_NO_MEMORY)
  6158. }
  6159. (*TTAG)(unsafe.Pointer(tag)).Fbuf = temp
  6160. (*TTAG)(unsafe.Pointer(tag)).FbufEnd = temp + uintptr(bufSize)
  6161. *(*uintptr)(unsafe.Pointer(bp + 24)) = temp + uintptr(convLen)
  6162. goto _4
  6163. _4:
  6164. }
  6165. (*TTAG)(unsafe.Pointer(tag)).Fname.Fstr = (*TTAG)(unsafe.Pointer(tag)).Fbuf
  6166. *(*TXML_Char)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 24)))) = int8('\000')
  6167. result1 = _storeAtts(tls, parser, enc, *(*uintptr)(unsafe.Pointer(bp)), tag+24, tag+80, account)
  6168. if result1 != 0 {
  6169. return result1
  6170. }
  6171. if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_startElementHandler != 0 {
  6172. (*(*func(*libc.TLS, uintptr, uintptr, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_startElementHandler})))(tls, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_handlerArg, (*TTAG)(unsafe.Pointer(tag)).Fname.Fstr, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_atts)
  6173. } else {
  6174. if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_defaultHandler != 0 {
  6175. _reportDefault(tls, parser, enc, *(*uintptr)(unsafe.Pointer(bp)), *(*uintptr)(unsafe.Pointer(bp + 8)))
  6176. }
  6177. }
  6178. _poolClear(tls, parser+784)
  6179. case int32(m_XML_TOK_EMPTY_ELEMENT_NO_ATTS):
  6180. /* fall through */
  6181. fallthrough
  6182. case int32(m_XML_TOK_EMPTY_ELEMENT_WITH_ATTS):
  6183. rawName = *(*uintptr)(unsafe.Pointer(bp)) + uintptr((*TENCODING)(unsafe.Pointer(enc)).FminBytesPerChar)
  6184. *(*uintptr)(unsafe.Pointer(bp + 40)) = libc.UintptrFromInt32(0)
  6185. noElmHandlers = libc.Uint8FromInt32(1)
  6186. (*(*TTAG_NAME)(unsafe.Pointer(bp + 48))).Fstr = _poolStoreString(tls, parser+784, enc, rawName, rawName+uintptr((*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*TENCODING)(unsafe.Pointer(enc)).FnameLength})))(tls, enc, rawName)))
  6187. if !((*(*TTAG_NAME)(unsafe.Pointer(bp + 48))).Fstr != 0) {
  6188. return int32(_XML_ERROR_NO_MEMORY)
  6189. }
  6190. (*TSTRING_POOL)(unsafe.Pointer(parser + 784)).Fstart = (*TSTRING_POOL)(unsafe.Pointer(parser + 784)).Fptr
  6191. result2 = _storeAtts(tls, parser, enc, *(*uintptr)(unsafe.Pointer(bp)), bp+48, bp+40, int32(_XML_ACCOUNT_NONE))
  6192. if result2 != int32(_XML_ERROR_NONE) {
  6193. _freeBindings(tls, parser, *(*uintptr)(unsafe.Pointer(bp + 40)))
  6194. return result2
  6195. }
  6196. (*TSTRING_POOL)(unsafe.Pointer(parser + 784)).Fstart = (*TSTRING_POOL)(unsafe.Pointer(parser + 784)).Fptr
  6197. if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_startElementHandler != 0 {
  6198. (*(*func(*libc.TLS, uintptr, uintptr, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_startElementHandler})))(tls, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_handlerArg, (*(*TTAG_NAME)(unsafe.Pointer(bp + 48))).Fstr, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_atts)
  6199. noElmHandlers = libc.Uint8FromInt32(0)
  6200. }
  6201. if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_endElementHandler != 0 {
  6202. if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_startElementHandler != 0 {
  6203. *(*uintptr)(unsafe.Pointer(eventPP)) = *(*uintptr)(unsafe.Pointer(eventEndPP))
  6204. }
  6205. (*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_endElementHandler})))(tls, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_handlerArg, (*(*TTAG_NAME)(unsafe.Pointer(bp + 48))).Fstr)
  6206. noElmHandlers = libc.Uint8FromInt32(0)
  6207. }
  6208. if noElmHandlers != 0 && (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_defaultHandler != 0 {
  6209. _reportDefault(tls, parser, enc, *(*uintptr)(unsafe.Pointer(bp)), *(*uintptr)(unsafe.Pointer(bp + 8)))
  6210. }
  6211. _poolClear(tls, parser+784)
  6212. _freeBindings(tls, parser, *(*uintptr)(unsafe.Pointer(bp + 40)))
  6213. if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_tagLevel == 0 && (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parsingStatus.Fparsing != int32(_XML_FINISHED) {
  6214. if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parsingStatus.Fparsing == int32(_XML_SUSPENDED) {
  6215. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_processor = __ccgo_fp(_epilogProcessor)
  6216. } else {
  6217. return _epilogProcessor(tls, parser, *(*uintptr)(unsafe.Pointer(bp + 8)), end, nextPtr)
  6218. }
  6219. }
  6220. case int32(m_XML_TOK_END_TAG):
  6221. if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_tagLevel == startTagLevel {
  6222. return int32(_XML_ERROR_ASYNC_ENTITY)
  6223. } else {
  6224. tag1 = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_tagStack
  6225. rawName1 = *(*uintptr)(unsafe.Pointer(bp)) + uintptr((*TENCODING)(unsafe.Pointer(enc)).FminBytesPerChar*int32(2))
  6226. len1 = (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*TENCODING)(unsafe.Pointer(enc)).FnameLength})))(tls, enc, rawName1)
  6227. if len1 != (*TTAG)(unsafe.Pointer(tag1)).FrawNameLength || libc.Xmemcmp(tls, (*TTAG)(unsafe.Pointer(tag1)).FrawName, rawName1, libc.Uint64FromInt32(len1)) != 0 {
  6228. *(*uintptr)(unsafe.Pointer(eventPP)) = rawName1
  6229. return int32(_XML_ERROR_TAG_MISMATCH)
  6230. }
  6231. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_tagStack = (*TTAG)(unsafe.Pointer(tag1)).Fparent
  6232. (*TTAG)(unsafe.Pointer(tag1)).Fparent = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_freeTagList
  6233. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_freeTagList = tag1
  6234. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_tagLevel--
  6235. if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_endElementHandler != 0 {
  6236. localPart = (*TTAG)(unsafe.Pointer(tag1)).Fname.FlocalPart
  6237. if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_ns != 0 && localPart != 0 {
  6238. /* localPart and prefix may have been overwritten in
  6239. tag->name.str, since this points to the binding->uri
  6240. buffer which gets re-used; so we have to add them again
  6241. */
  6242. uri = (*TTAG)(unsafe.Pointer(tag1)).Fname.Fstr + uintptr((*TTAG)(unsafe.Pointer(tag1)).Fname.FuriLen)
  6243. /* don't need to check for space - already done in storeAtts() */
  6244. for *(*TXML_Char)(unsafe.Pointer(localPart)) != 0 {
  6245. v5 = uri
  6246. uri++
  6247. v6 = localPart
  6248. localPart++
  6249. *(*TXML_Char)(unsafe.Pointer(v5)) = *(*TXML_Char)(unsafe.Pointer(v6))
  6250. }
  6251. prefix = (*TTAG)(unsafe.Pointer(tag1)).Fname.Fprefix
  6252. if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_ns_triplets != 0 && prefix != 0 {
  6253. v7 = uri
  6254. uri++
  6255. *(*TXML_Char)(unsafe.Pointer(v7)) = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_namespaceSeparator
  6256. for *(*TXML_Char)(unsafe.Pointer(prefix)) != 0 {
  6257. v8 = uri
  6258. uri++
  6259. v9 = prefix
  6260. prefix++
  6261. *(*TXML_Char)(unsafe.Pointer(v8)) = *(*TXML_Char)(unsafe.Pointer(v9))
  6262. }
  6263. }
  6264. *(*TXML_Char)(unsafe.Pointer(uri)) = int8('\000')
  6265. }
  6266. (*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_endElementHandler})))(tls, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_handlerArg, (*TTAG)(unsafe.Pointer(tag1)).Fname.Fstr)
  6267. } else {
  6268. if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_defaultHandler != 0 {
  6269. _reportDefault(tls, parser, enc, *(*uintptr)(unsafe.Pointer(bp)), *(*uintptr)(unsafe.Pointer(bp + 8)))
  6270. }
  6271. }
  6272. for (*TTAG)(unsafe.Pointer(tag1)).Fbindings != 0 {
  6273. b = (*TTAG)(unsafe.Pointer(tag1)).Fbindings
  6274. if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_endNamespaceDeclHandler != 0 {
  6275. (*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_endNamespaceDeclHandler})))(tls, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_handlerArg, (*Tprefix)(unsafe.Pointer((*TBINDING)(unsafe.Pointer(b)).Fprefix)).Fname)
  6276. }
  6277. (*TTAG)(unsafe.Pointer(tag1)).Fbindings = (*TBINDING)(unsafe.Pointer((*TTAG)(unsafe.Pointer(tag1)).Fbindings)).FnextTagBinding
  6278. (*TBINDING)(unsafe.Pointer(b)).FnextTagBinding = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_freeBindingList
  6279. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_freeBindingList = b
  6280. (*Tprefix)(unsafe.Pointer((*TBINDING)(unsafe.Pointer(b)).Fprefix)).Fbinding = (*TBINDING)(unsafe.Pointer(b)).FprevPrefixBinding
  6281. }
  6282. if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_tagLevel == 0 && (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parsingStatus.Fparsing != int32(_XML_FINISHED) {
  6283. if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parsingStatus.Fparsing == int32(_XML_SUSPENDED) {
  6284. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_processor = __ccgo_fp(_epilogProcessor)
  6285. } else {
  6286. return _epilogProcessor(tls, parser, *(*uintptr)(unsafe.Pointer(bp + 8)), end, nextPtr)
  6287. }
  6288. }
  6289. }
  6290. case int32(m_XML_TOK_CHAR_REF):
  6291. n = (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*TENCODING)(unsafe.Pointer(enc)).FcharRefNumber})))(tls, enc, *(*uintptr)(unsafe.Pointer(bp)))
  6292. if n < 0 {
  6293. return int32(_XML_ERROR_BAD_CHAR_REF)
  6294. }
  6295. if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_characterDataHandler != 0 {
  6296. (*(*func(*libc.TLS, uintptr, uintptr, int32))(unsafe.Pointer(&struct{ uintptr }{(*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_characterDataHandler})))(tls, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_handlerArg, bp+88, XXmlUtf8Encode(tls, n, bp+88))
  6297. } else {
  6298. if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_defaultHandler != 0 {
  6299. _reportDefault(tls, parser, enc, *(*uintptr)(unsafe.Pointer(bp)), *(*uintptr)(unsafe.Pointer(bp + 8)))
  6300. }
  6301. }
  6302. case int32(m_XML_TOK_XML_DECL):
  6303. return int32(_XML_ERROR_MISPLACED_XML_PI)
  6304. case int32(m_XML_TOK_DATA_NEWLINE):
  6305. if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_characterDataHandler != 0 {
  6306. *(*TXML_Char)(unsafe.Pointer(bp + 92)) = int8(0xA)
  6307. (*(*func(*libc.TLS, uintptr, uintptr, int32))(unsafe.Pointer(&struct{ uintptr }{(*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_characterDataHandler})))(tls, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_handlerArg, bp+92, int32(1))
  6308. } else {
  6309. if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_defaultHandler != 0 {
  6310. _reportDefault(tls, parser, enc, *(*uintptr)(unsafe.Pointer(bp)), *(*uintptr)(unsafe.Pointer(bp + 8)))
  6311. }
  6312. }
  6313. case int32(m_XML_TOK_CDATA_SECT_OPEN):
  6314. if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_startCdataSectionHandler != 0 {
  6315. (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_startCdataSectionHandler})))(tls, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_handlerArg)
  6316. } else {
  6317. if libc.Bool(0 != 0) && (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_characterDataHandler != 0 {
  6318. (*(*func(*libc.TLS, uintptr, uintptr, int32))(unsafe.Pointer(&struct{ uintptr }{(*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_characterDataHandler})))(tls, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_handlerArg, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_dataBuf, 0)
  6319. } else {
  6320. if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_defaultHandler != 0 {
  6321. _reportDefault(tls, parser, enc, *(*uintptr)(unsafe.Pointer(bp)), *(*uintptr)(unsafe.Pointer(bp + 8)))
  6322. }
  6323. }
  6324. }
  6325. result3 = _doCdataSection(tls, parser, enc, bp+8, end, nextPtr, haveMore, account)
  6326. if result3 != int32(_XML_ERROR_NONE) {
  6327. return result3
  6328. } else {
  6329. if !(*(*uintptr)(unsafe.Pointer(bp + 8)) != 0) {
  6330. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_processor = __ccgo_fp(_cdataSectionProcessor)
  6331. return result3
  6332. }
  6333. }
  6334. case -int32(5):
  6335. if haveMore != 0 {
  6336. *(*uintptr)(unsafe.Pointer(nextPtr)) = *(*uintptr)(unsafe.Pointer(bp))
  6337. return int32(_XML_ERROR_NONE)
  6338. }
  6339. if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_characterDataHandler != 0 {
  6340. if !((*TENCODING)(unsafe.Pointer(enc)).FisUtf8 != 0) {
  6341. *(*uintptr)(unsafe.Pointer(bp + 96)) = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_dataBuf
  6342. (*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr, uintptr) _XML_Convert_Result)(unsafe.Pointer(&struct{ uintptr }{(*TENCODING)(unsafe.Pointer(enc)).Futf8Convert})))(tls, enc, bp, end, bp+96, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_dataBufEnd)
  6343. (*(*func(*libc.TLS, uintptr, uintptr, int32))(unsafe.Pointer(&struct{ uintptr }{(*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_characterDataHandler})))(tls, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_handlerArg, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_dataBuf, int32(int64(*(*uintptr)(unsafe.Pointer(bp + 96)))-int64((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_dataBuf)))
  6344. } else {
  6345. (*(*func(*libc.TLS, uintptr, uintptr, int32))(unsafe.Pointer(&struct{ uintptr }{(*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_characterDataHandler})))(tls, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_handlerArg, *(*uintptr)(unsafe.Pointer(bp)), int32(int64(end)-int64(*(*uintptr)(unsafe.Pointer(bp)))))
  6346. }
  6347. } else {
  6348. if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_defaultHandler != 0 {
  6349. _reportDefault(tls, parser, enc, *(*uintptr)(unsafe.Pointer(bp)), end)
  6350. }
  6351. }
  6352. /* We are at the end of the final buffer, should we check for
  6353. XML_SUSPENDED, XML_FINISHED?
  6354. */
  6355. if startTagLevel == 0 {
  6356. *(*uintptr)(unsafe.Pointer(eventPP)) = end
  6357. return int32(_XML_ERROR_NO_ELEMENTS)
  6358. }
  6359. if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_tagLevel != startTagLevel {
  6360. *(*uintptr)(unsafe.Pointer(eventPP)) = end
  6361. return int32(_XML_ERROR_ASYNC_ENTITY)
  6362. }
  6363. *(*uintptr)(unsafe.Pointer(nextPtr)) = end
  6364. return int32(_XML_ERROR_NONE)
  6365. case int32(m_XML_TOK_DATA_CHARS):
  6366. charDataHandler = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_characterDataHandler
  6367. if charDataHandler != 0 {
  6368. if !((*TENCODING)(unsafe.Pointer(enc)).FisUtf8 != 0) {
  6369. for {
  6370. *(*uintptr)(unsafe.Pointer(bp + 104)) = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_dataBuf
  6371. convert_res1 = (*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr, uintptr) _XML_Convert_Result)(unsafe.Pointer(&struct{ uintptr }{(*TENCODING)(unsafe.Pointer(enc)).Futf8Convert})))(tls, enc, bp, *(*uintptr)(unsafe.Pointer(bp + 8)), bp+104, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_dataBufEnd)
  6372. *(*uintptr)(unsafe.Pointer(eventEndPP)) = *(*uintptr)(unsafe.Pointer(bp))
  6373. (*(*func(*libc.TLS, uintptr, uintptr, int32))(unsafe.Pointer(&struct{ uintptr }{charDataHandler})))(tls, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_handlerArg, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_dataBuf, int32(int64(*(*uintptr)(unsafe.Pointer(bp + 104)))-int64((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_dataBuf)))
  6374. if convert_res1 == int32(_XML_CONVERT_COMPLETED) || convert_res1 == int32(_XML_CONVERT_INPUT_INCOMPLETE) {
  6375. break
  6376. }
  6377. *(*uintptr)(unsafe.Pointer(eventPP)) = *(*uintptr)(unsafe.Pointer(bp))
  6378. goto _10
  6379. _10:
  6380. }
  6381. } else {
  6382. (*(*func(*libc.TLS, uintptr, uintptr, int32))(unsafe.Pointer(&struct{ uintptr }{charDataHandler})))(tls, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_handlerArg, *(*uintptr)(unsafe.Pointer(bp)), int32(int64(*(*uintptr)(unsafe.Pointer(bp + 8)))-int64(*(*uintptr)(unsafe.Pointer(bp)))))
  6383. }
  6384. } else {
  6385. if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_defaultHandler != 0 {
  6386. _reportDefault(tls, parser, enc, *(*uintptr)(unsafe.Pointer(bp)), *(*uintptr)(unsafe.Pointer(bp + 8)))
  6387. }
  6388. }
  6389. case int32(m_XML_TOK_PI):
  6390. if !(_reportProcessingInstruction(tls, parser, enc, *(*uintptr)(unsafe.Pointer(bp)), *(*uintptr)(unsafe.Pointer(bp + 8))) != 0) {
  6391. return int32(_XML_ERROR_NO_MEMORY)
  6392. }
  6393. case int32(m_XML_TOK_COMMENT):
  6394. if !(_reportComment(tls, parser, enc, *(*uintptr)(unsafe.Pointer(bp)), *(*uintptr)(unsafe.Pointer(bp + 8))) != 0) {
  6395. return int32(_XML_ERROR_NO_MEMORY)
  6396. }
  6397. default:
  6398. /* All of the tokens produced by XmlContentTok() have their own
  6399. * explicit cases, so this default is not strictly necessary.
  6400. * However it is a useful safety net, so we retain the code and
  6401. * simply exclude it from the coverage tests.
  6402. *
  6403. * LCOV_EXCL_START
  6404. */
  6405. if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_defaultHandler != 0 {
  6406. _reportDefault(tls, parser, enc, *(*uintptr)(unsafe.Pointer(bp)), *(*uintptr)(unsafe.Pointer(bp + 8)))
  6407. }
  6408. break
  6409. /* LCOV_EXCL_STOP */
  6410. }
  6411. v11 = *(*uintptr)(unsafe.Pointer(bp + 8))
  6412. *(*uintptr)(unsafe.Pointer(bp)) = v11
  6413. *(*uintptr)(unsafe.Pointer(eventPP)) = v11
  6414. switch (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parsingStatus.Fparsing {
  6415. case int32(_XML_SUSPENDED):
  6416. *(*uintptr)(unsafe.Pointer(nextPtr)) = *(*uintptr)(unsafe.Pointer(bp + 8))
  6417. return int32(_XML_ERROR_NONE)
  6418. case int32(_XML_FINISHED):
  6419. return int32(_XML_ERROR_ABORTED)
  6420. default:
  6421. }
  6422. goto _1
  6423. _1:
  6424. }
  6425. /* not reached */
  6426. return r
  6427. }
  6428. // C documentation
  6429. //
  6430. // /* This function does not call free() on the allocated memory, merely
  6431. // * moving it to the parser's m_freeBindingList where it can be freed or
  6432. // * reused as appropriate.
  6433. // */
  6434. func _freeBindings(tls *libc.TLS, parser TXML_Parser, bindings uintptr) {
  6435. var b uintptr
  6436. _ = b
  6437. for bindings != 0 {
  6438. b = bindings
  6439. /* m_startNamespaceDeclHandler will have been called for this
  6440. * binding in addBindings(), so call the end handler now.
  6441. */
  6442. if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_endNamespaceDeclHandler != 0 {
  6443. (*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_endNamespaceDeclHandler})))(tls, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_handlerArg, (*Tprefix)(unsafe.Pointer((*TBINDING)(unsafe.Pointer(b)).Fprefix)).Fname)
  6444. }
  6445. bindings = (*TBINDING)(unsafe.Pointer(bindings)).FnextTagBinding
  6446. (*TBINDING)(unsafe.Pointer(b)).FnextTagBinding = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_freeBindingList
  6447. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_freeBindingList = b
  6448. (*Tprefix)(unsafe.Pointer((*TBINDING)(unsafe.Pointer(b)).Fprefix)).Fbinding = (*TBINDING)(unsafe.Pointer(b)).FprevPrefixBinding
  6449. }
  6450. }
  6451. // C documentation
  6452. //
  6453. // /* Precondition: all arguments must be non-NULL;
  6454. // Purpose:
  6455. // - normalize attributes
  6456. // - check attributes for well-formedness
  6457. // - generate namespace aware attribute names (URI, prefix)
  6458. // - build list of attributes for startElementHandler
  6459. // - default attributes
  6460. // - process namespace declarations (check and report them)
  6461. // - generate namespace aware element name (URI, prefix)
  6462. // */
  6463. func _storeAtts(tls *libc.TLS, parser TXML_Parser, enc uintptr, attStr uintptr, tagNamePtr uintptr, bindingsPtr uintptr, account _XML_Account) (r _XML_Error) {
  6464. bp := tls.Alloc(80)
  6465. defer tls.Free(80)
  6466. var appAtts, attId, b, binding, currAtt, da, dtd, elementType, id, localPart, name, p, s, s1, s2, temp, temp1, uri, v11, v18, v19, v20, v21, v24, v25, v28, v31, v32, v36 uintptr
  6467. var attIndex, i, j, j1, n, nDefaultAtts, nPrefixes, oldAttsSize, prefixLen, v13, v17, v2, v23, v30, v33, v38, v40, v6, v7, v8, v9 int32
  6468. var c TXML_Char
  6469. var isCdata TXML_Bool
  6470. var mask, uriHash, version, v14 uint64
  6471. var nsAttsSize uint32
  6472. var oldNsAttsPower, step, v10 uint8
  6473. var result, result1, result2 _XML_Error
  6474. var _ /* sip_key at bp+56 */ Tsipkey
  6475. var _ /* sip_state at bp+0 */ Tsiphash
  6476. _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = appAtts, attId, attIndex, b, binding, c, currAtt, da, dtd, elementType, i, id, isCdata, j, j1, localPart, mask, n, nDefaultAtts, nPrefixes, name, nsAttsSize, oldAttsSize, oldNsAttsPower, p, prefixLen, result, result1, result2, s, s1, s2, step, temp, temp1, uri, uriHash, version, v10, v11, v13, v14, v17, v18, v19, v2, v20, v21, v23, v24, v25, v28, v30, v31, v32, v33, v36, v38, v40, v6, v7, v8, v9
  6477. dtd = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_dtd /* the attribute list for the application */
  6478. attIndex = 0
  6479. nPrefixes = 0
  6480. /* lookup the element type name */
  6481. elementType = _lookup(tls, parser, dtd+40, (*TTAG_NAME)(unsafe.Pointer(tagNamePtr)).Fstr, uint64(0))
  6482. if !(elementType != 0) {
  6483. name = _poolCopyString(tls, dtd+160, (*TTAG_NAME)(unsafe.Pointer(tagNamePtr)).Fstr)
  6484. if !(name != 0) {
  6485. return int32(_XML_ERROR_NO_MEMORY)
  6486. }
  6487. elementType = _lookup(tls, parser, dtd+40, name, uint64(40))
  6488. if !(elementType != 0) {
  6489. return int32(_XML_ERROR_NO_MEMORY)
  6490. }
  6491. if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_ns != 0 && !(_setElementTypePrefix(tls, parser, elementType) != 0) {
  6492. return int32(_XML_ERROR_NO_MEMORY)
  6493. }
  6494. }
  6495. nDefaultAtts = (*TELEMENT_TYPE)(unsafe.Pointer(elementType)).FnDefaultAtts
  6496. /* get the attributes from the tokenizer */
  6497. n = (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*TENCODING)(unsafe.Pointer(enc)).FgetAtts})))(tls, enc, attStr, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_attsSize, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_atts)
  6498. /* Detect and prevent integer overflow */
  6499. if n > int32(m___INT_MAX__)-nDefaultAtts {
  6500. return int32(_XML_ERROR_NO_MEMORY)
  6501. }
  6502. if n+nDefaultAtts > (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_attsSize {
  6503. oldAttsSize = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_attsSize
  6504. /* Detect and prevent integer overflow */
  6505. if nDefaultAtts > libc.Int32FromInt32(m___INT_MAX__)-libc.Int32FromInt32(m_INIT_ATTS_SIZE) || n > int32(m___INT_MAX__)-(nDefaultAtts+int32(m_INIT_ATTS_SIZE)) {
  6506. return int32(_XML_ERROR_NO_MEMORY)
  6507. }
  6508. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_attsSize = n + nDefaultAtts + int32(m_INIT_ATTS_SIZE)
  6509. /* Detect and prevent integer overflow.
  6510. * The preprocessor guard addresses the "always false" warning
  6511. * from -Wtype-limits on platforms where
  6512. * sizeof(unsigned int) < sizeof(size_t), e.g. on x86_64. */
  6513. temp = (*(*func(*libc.TLS, uintptr, Tsize_t) uintptr)(unsafe.Pointer(&struct{ uintptr }{(*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_mem.Frealloc_fcn})))(tls, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_atts, libc.Uint64FromInt32((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_attsSize)*libc.Uint64FromInt64(32))
  6514. if temp == libc.UintptrFromInt32(0) {
  6515. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_attsSize = oldAttsSize
  6516. return int32(_XML_ERROR_NO_MEMORY)
  6517. }
  6518. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_atts = temp
  6519. if n > oldAttsSize {
  6520. (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*TENCODING)(unsafe.Pointer(enc)).FgetAtts})))(tls, enc, attStr, n, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_atts)
  6521. }
  6522. }
  6523. appAtts = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_atts
  6524. i = 0
  6525. for {
  6526. if !(i < n) {
  6527. break
  6528. }
  6529. currAtt = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_atts + uintptr(i)*32
  6530. /* add the name and value to the attribute list */
  6531. attId = _getAttributeId(tls, parser, enc, (*TATTRIBUTE)(unsafe.Pointer(currAtt)).Fname, (*TATTRIBUTE)(unsafe.Pointer(currAtt)).Fname+uintptr((*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*TENCODING)(unsafe.Pointer(enc)).FnameLength})))(tls, enc, (*TATTRIBUTE)(unsafe.Pointer(currAtt)).Fname)))
  6532. if !(attId != 0) {
  6533. return int32(_XML_ERROR_NO_MEMORY)
  6534. }
  6535. /* Detect duplicate attributes by their QNames. This does not work when
  6536. namespace processing is turned on and different prefixes for the same
  6537. namespace are used. For this case we have a check further down.
  6538. */
  6539. if *(*TXML_Char)(unsafe.Pointer((*TATTRIBUTE_ID)(unsafe.Pointer(attId)).Fname + uintptr(-libc.Int32FromInt32(1)))) != 0 {
  6540. if enc == (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_encoding {
  6541. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_eventPtr = (*(*TATTRIBUTE)(unsafe.Pointer((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_atts + uintptr(i)*32))).Fname
  6542. }
  6543. return int32(_XML_ERROR_DUPLICATE_ATTRIBUTE)
  6544. }
  6545. *(*TXML_Char)(unsafe.Pointer((*TATTRIBUTE_ID)(unsafe.Pointer(attId)).Fname + uintptr(-libc.Int32FromInt32(1)))) = int8(1)
  6546. v2 = attIndex
  6547. attIndex++
  6548. *(*uintptr)(unsafe.Pointer(appAtts + uintptr(v2)*8)) = (*TATTRIBUTE_ID)(unsafe.Pointer(attId)).Fname
  6549. if !((*(*TATTRIBUTE)(unsafe.Pointer((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_atts + uintptr(i)*32))).Fnormalized != 0) {
  6550. isCdata = libc.Uint8FromInt32(1)
  6551. /* figure out whether declared as other than CDATA */
  6552. if (*TATTRIBUTE_ID)(unsafe.Pointer(attId)).FmaybeTokenized != 0 {
  6553. j = 0
  6554. for {
  6555. if !(j < nDefaultAtts) {
  6556. break
  6557. }
  6558. if attId == (*(*TDEFAULT_ATTRIBUTE)(unsafe.Pointer((*TELEMENT_TYPE)(unsafe.Pointer(elementType)).FdefaultAtts + uintptr(j)*24))).Fid {
  6559. isCdata = (*(*TDEFAULT_ATTRIBUTE)(unsafe.Pointer((*TELEMENT_TYPE)(unsafe.Pointer(elementType)).FdefaultAtts + uintptr(j)*24))).FisCdata
  6560. break
  6561. }
  6562. goto _3
  6563. _3:
  6564. ;
  6565. j++
  6566. }
  6567. }
  6568. /* normalize the attribute value */
  6569. result = _storeAttributeValue(tls, parser, enc, isCdata, (*(*TATTRIBUTE)(unsafe.Pointer((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_atts + uintptr(i)*32))).FvaluePtr, (*(*TATTRIBUTE)(unsafe.Pointer((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_atts + uintptr(i)*32))).FvalueEnd, parser+784, account)
  6570. if result != 0 {
  6571. return result
  6572. }
  6573. *(*uintptr)(unsafe.Pointer(appAtts + uintptr(attIndex)*8)) = (*TSTRING_POOL)(unsafe.Pointer(parser + 784)).Fstart
  6574. (*TSTRING_POOL)(unsafe.Pointer(parser + 784)).Fstart = (*TSTRING_POOL)(unsafe.Pointer(parser + 784)).Fptr
  6575. } else {
  6576. /* the value did not need normalizing */
  6577. *(*uintptr)(unsafe.Pointer(appAtts + uintptr(attIndex)*8)) = _poolStoreString(tls, parser+784, enc, (*(*TATTRIBUTE)(unsafe.Pointer((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_atts + uintptr(i)*32))).FvaluePtr, (*(*TATTRIBUTE)(unsafe.Pointer((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_atts + uintptr(i)*32))).FvalueEnd)
  6578. if *(*uintptr)(unsafe.Pointer(appAtts + uintptr(attIndex)*8)) == uintptr(0) {
  6579. return int32(_XML_ERROR_NO_MEMORY)
  6580. }
  6581. (*TSTRING_POOL)(unsafe.Pointer(parser + 784)).Fstart = (*TSTRING_POOL)(unsafe.Pointer(parser + 784)).Fptr
  6582. }
  6583. /* handle prefixed attribute names */
  6584. if (*TATTRIBUTE_ID)(unsafe.Pointer(attId)).Fprefix != 0 {
  6585. if (*TATTRIBUTE_ID)(unsafe.Pointer(attId)).Fxmlns != 0 {
  6586. /* deal with namespace declarations here */
  6587. result1 = _addBinding(tls, parser, (*TATTRIBUTE_ID)(unsafe.Pointer(attId)).Fprefix, attId, *(*uintptr)(unsafe.Pointer(appAtts + uintptr(attIndex)*8)), bindingsPtr)
  6588. if result1 != 0 {
  6589. return result1
  6590. }
  6591. attIndex--
  6592. } else {
  6593. /* deal with other prefixed names later */
  6594. attIndex++
  6595. nPrefixes++
  6596. *(*TXML_Char)(unsafe.Pointer((*TATTRIBUTE_ID)(unsafe.Pointer(attId)).Fname + uintptr(-libc.Int32FromInt32(1)))) = int8(2)
  6597. }
  6598. } else {
  6599. attIndex++
  6600. }
  6601. goto _1
  6602. _1:
  6603. ;
  6604. i++
  6605. }
  6606. /* set-up for XML_GetSpecifiedAttributeCount and XML_GetIdAttributeIndex */
  6607. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_nSpecifiedAtts = attIndex
  6608. if (*TELEMENT_TYPE)(unsafe.Pointer(elementType)).FidAtt != 0 && *(*TXML_Char)(unsafe.Pointer((*TATTRIBUTE_ID)(unsafe.Pointer((*TELEMENT_TYPE)(unsafe.Pointer(elementType)).FidAtt)).Fname + uintptr(-libc.Int32FromInt32(1)))) != 0 {
  6609. i = 0
  6610. for {
  6611. if !(i < attIndex) {
  6612. break
  6613. }
  6614. if *(*uintptr)(unsafe.Pointer(appAtts + uintptr(i)*8)) == (*TATTRIBUTE_ID)(unsafe.Pointer((*TELEMENT_TYPE)(unsafe.Pointer(elementType)).FidAtt)).Fname {
  6615. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_idAttIndex = i
  6616. break
  6617. }
  6618. goto _4
  6619. _4:
  6620. ;
  6621. i += int32(2)
  6622. }
  6623. } else {
  6624. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_idAttIndex = -int32(1)
  6625. }
  6626. /* do attribute defaulting */
  6627. i = 0
  6628. for {
  6629. if !(i < nDefaultAtts) {
  6630. break
  6631. }
  6632. da = (*TELEMENT_TYPE)(unsafe.Pointer(elementType)).FdefaultAtts + uintptr(i)*24
  6633. if !(*(*TXML_Char)(unsafe.Pointer((*TATTRIBUTE_ID)(unsafe.Pointer((*TDEFAULT_ATTRIBUTE)(unsafe.Pointer(da)).Fid)).Fname + uintptr(-libc.Int32FromInt32(1)))) != 0) && (*TDEFAULT_ATTRIBUTE)(unsafe.Pointer(da)).Fvalue != 0 {
  6634. if (*TATTRIBUTE_ID)(unsafe.Pointer((*TDEFAULT_ATTRIBUTE)(unsafe.Pointer(da)).Fid)).Fprefix != 0 {
  6635. if (*TATTRIBUTE_ID)(unsafe.Pointer((*TDEFAULT_ATTRIBUTE)(unsafe.Pointer(da)).Fid)).Fxmlns != 0 {
  6636. result2 = _addBinding(tls, parser, (*TATTRIBUTE_ID)(unsafe.Pointer((*TDEFAULT_ATTRIBUTE)(unsafe.Pointer(da)).Fid)).Fprefix, (*TDEFAULT_ATTRIBUTE)(unsafe.Pointer(da)).Fid, (*TDEFAULT_ATTRIBUTE)(unsafe.Pointer(da)).Fvalue, bindingsPtr)
  6637. if result2 != 0 {
  6638. return result2
  6639. }
  6640. } else {
  6641. *(*TXML_Char)(unsafe.Pointer((*TATTRIBUTE_ID)(unsafe.Pointer((*TDEFAULT_ATTRIBUTE)(unsafe.Pointer(da)).Fid)).Fname + uintptr(-libc.Int32FromInt32(1)))) = int8(2)
  6642. nPrefixes++
  6643. v6 = attIndex
  6644. attIndex++
  6645. *(*uintptr)(unsafe.Pointer(appAtts + uintptr(v6)*8)) = (*TATTRIBUTE_ID)(unsafe.Pointer((*TDEFAULT_ATTRIBUTE)(unsafe.Pointer(da)).Fid)).Fname
  6646. v7 = attIndex
  6647. attIndex++
  6648. *(*uintptr)(unsafe.Pointer(appAtts + uintptr(v7)*8)) = (*TDEFAULT_ATTRIBUTE)(unsafe.Pointer(da)).Fvalue
  6649. }
  6650. } else {
  6651. *(*TXML_Char)(unsafe.Pointer((*TATTRIBUTE_ID)(unsafe.Pointer((*TDEFAULT_ATTRIBUTE)(unsafe.Pointer(da)).Fid)).Fname + uintptr(-libc.Int32FromInt32(1)))) = int8(1)
  6652. v8 = attIndex
  6653. attIndex++
  6654. *(*uintptr)(unsafe.Pointer(appAtts + uintptr(v8)*8)) = (*TATTRIBUTE_ID)(unsafe.Pointer((*TDEFAULT_ATTRIBUTE)(unsafe.Pointer(da)).Fid)).Fname
  6655. v9 = attIndex
  6656. attIndex++
  6657. *(*uintptr)(unsafe.Pointer(appAtts + uintptr(v9)*8)) = (*TDEFAULT_ATTRIBUTE)(unsafe.Pointer(da)).Fvalue
  6658. }
  6659. }
  6660. goto _5
  6661. _5:
  6662. ;
  6663. i++
  6664. }
  6665. *(*uintptr)(unsafe.Pointer(appAtts + uintptr(attIndex)*8)) = uintptr(0)
  6666. /* expand prefixed attribute names, check for duplicates,
  6667. and clear flags that say whether attributes were specified */
  6668. i = 0
  6669. if nPrefixes != 0 { /* hash table index */
  6670. version = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_nsAttsVersion
  6671. /* Detect and prevent invalid shift */
  6672. if uint64((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_nsAttsPower) >= libc.Uint64FromInt64(4)*libc.Uint64FromInt32(8) {
  6673. return int32(_XML_ERROR_NO_MEMORY)
  6674. }
  6675. nsAttsSize = uint32(1) << (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_nsAttsPower
  6676. oldNsAttsPower = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_nsAttsPower
  6677. /* size of hash table must be at least 2 * (# of prefixed attributes) */
  6678. if nPrefixes<<int32(1)>>(*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_nsAttsPower != 0 {
  6679. /* hash table size must also be a power of 2 and >= 8 */
  6680. for {
  6681. v11 = parser + 760
  6682. v10 = *(*uint8)(unsafe.Pointer(v11))
  6683. *(*uint8)(unsafe.Pointer(v11))++
  6684. if !(nPrefixes>>v10 != 0) {
  6685. break
  6686. }
  6687. }
  6688. if libc.Int32FromUint8((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_nsAttsPower) < int32(3) {
  6689. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_nsAttsPower = uint8(3)
  6690. }
  6691. /* Detect and prevent invalid shift */
  6692. if uint64((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_nsAttsPower) >= libc.Uint64FromInt64(4)*libc.Uint64FromInt32(8) {
  6693. /* Restore actual size of memory in m_nsAtts */
  6694. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_nsAttsPower = oldNsAttsPower
  6695. return int32(_XML_ERROR_NO_MEMORY)
  6696. }
  6697. nsAttsSize = uint32(1) << (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_nsAttsPower
  6698. /* Detect and prevent integer overflow.
  6699. * The preprocessor guard addresses the "always false" warning
  6700. * from -Wtype-limits on platforms where
  6701. * sizeof(unsigned int) < sizeof(size_t), e.g. on x86_64. */
  6702. temp1 = (*(*func(*libc.TLS, uintptr, Tsize_t) uintptr)(unsafe.Pointer(&struct{ uintptr }{(*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_mem.Frealloc_fcn})))(tls, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_nsAtts, uint64(nsAttsSize)*libc.Uint64FromInt64(24))
  6703. if !(temp1 != 0) {
  6704. /* Restore actual size of memory in m_nsAtts */
  6705. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_nsAttsPower = oldNsAttsPower
  6706. return int32(_XML_ERROR_NO_MEMORY)
  6707. }
  6708. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_nsAtts = temp1
  6709. version = uint64(0) /* force re-initialization of m_nsAtts hash table */
  6710. }
  6711. /* using a version flag saves us from initializing m_nsAtts every time */
  6712. if !(version != 0) { /* initialize version flags when version wraps around */
  6713. version = uint64(m_INIT_ATTS_VERSION)
  6714. j1 = libc.Int32FromUint32(nsAttsSize)
  6715. for {
  6716. if !(j1 != 0) {
  6717. break
  6718. }
  6719. j1--
  6720. v13 = j1
  6721. (*(*TNS_ATT)(unsafe.Pointer((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_nsAtts + uintptr(v13)*24))).Fversion = version
  6722. goto _12
  6723. _12:
  6724. }
  6725. }
  6726. version--
  6727. v14 = version
  6728. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_nsAttsVersion = v14
  6729. /* expand prefixed names and check for duplicates */
  6730. for {
  6731. if !(i < attIndex) {
  6732. break
  6733. }
  6734. s = *(*uintptr)(unsafe.Pointer(appAtts + uintptr(i)*8))
  6735. if int32(*(*TXML_Char)(unsafe.Pointer(s + uintptr(-libc.Int32FromInt32(1))))) == int32(2) {
  6736. _copy_salt_to_sipkey(tls, parser, bp+56)
  6737. _sip24_init(tls, bp, bp+56)
  6738. *(*TXML_Char)(unsafe.Pointer(s + uintptr(-libc.Int32FromInt32(1)))) = 0 /* clear flag */
  6739. id = _lookup(tls, parser, dtd+80, s, uint64(0))
  6740. if !(id != 0) || !((*TATTRIBUTE_ID)(unsafe.Pointer(id)).Fprefix != 0) {
  6741. /* This code is walking through the appAtts array, dealing
  6742. * with (in this case) a prefixed attribute name. To be in
  6743. * the array, the attribute must have already been bound, so
  6744. * has to have passed through the hash table lookup once
  6745. * already. That implies that an entry for it already
  6746. * exists, so the lookup above will return a pointer to
  6747. * already allocated memory. There is no opportunaity for
  6748. * the allocator to fail, so the condition above cannot be
  6749. * fulfilled.
  6750. *
  6751. * Since it is difficult to be certain that the above
  6752. * analysis is complete, we retain the test and merely
  6753. * remove the code from coverage tests.
  6754. */
  6755. return int32(_XML_ERROR_NO_MEMORY) /* LCOV_EXCL_LINE */
  6756. }
  6757. b = (*TPREFIX)(unsafe.Pointer((*TATTRIBUTE_ID)(unsafe.Pointer(id)).Fprefix)).Fbinding
  6758. if !(b != 0) {
  6759. return int32(_XML_ERROR_UNBOUND_PREFIX)
  6760. }
  6761. j1 = 0
  6762. for {
  6763. if !(j1 < (*TBINDING)(unsafe.Pointer(b)).FuriLen) {
  6764. break
  6765. }
  6766. c = *(*TXML_Char)(unsafe.Pointer((*TBINDING)(unsafe.Pointer(b)).Furi + uintptr(j1)))
  6767. if (*TSTRING_POOL)(unsafe.Pointer(parser+784)).Fptr == (*TSTRING_POOL)(unsafe.Pointer(parser+784)).Fend && !(_poolGrow(tls, parser+784) != 0) {
  6768. v17 = 0
  6769. } else {
  6770. v19 = parser + 784 + 24
  6771. v18 = *(*uintptr)(unsafe.Pointer(v19))
  6772. *(*uintptr)(unsafe.Pointer(v19))++
  6773. *(*TXML_Char)(unsafe.Pointer(v18)) = c
  6774. v17 = libc.Int32FromInt32(1)
  6775. }
  6776. if !(v17 != 0) {
  6777. return int32(_XML_ERROR_NO_MEMORY)
  6778. }
  6779. goto _16
  6780. _16:
  6781. ;
  6782. j1++
  6783. }
  6784. _sip24_update(tls, bp, (*TBINDING)(unsafe.Pointer(b)).Furi, libc.Uint64FromInt32((*TBINDING)(unsafe.Pointer(b)).FuriLen)*uint64(1))
  6785. for {
  6786. v20 = s
  6787. s++
  6788. if !(int32(*(*TXML_Char)(unsafe.Pointer(v20))) != int32(m_ASCII_COLON)) {
  6789. break
  6790. }
  6791. }
  6792. _sip24_update(tls, bp, s, _keylen(tls, s)*uint64(1))
  6793. for { /* copies null terminator */
  6794. if (*TSTRING_POOL)(unsafe.Pointer(parser+784)).Fptr == (*TSTRING_POOL)(unsafe.Pointer(parser+784)).Fend && !(_poolGrow(tls, parser+784) != 0) {
  6795. v23 = 0
  6796. } else {
  6797. v25 = parser + 784 + 24
  6798. v24 = *(*uintptr)(unsafe.Pointer(v25))
  6799. *(*uintptr)(unsafe.Pointer(v25))++
  6800. *(*TXML_Char)(unsafe.Pointer(v24)) = *(*TXML_Char)(unsafe.Pointer(s))
  6801. v23 = libc.Int32FromInt32(1)
  6802. }
  6803. if !(v23 != 0) {
  6804. return int32(_XML_ERROR_NO_MEMORY)
  6805. }
  6806. goto _22
  6807. _22:
  6808. ;
  6809. v21 = s
  6810. s++
  6811. if !(*(*TXML_Char)(unsafe.Pointer(v21)) != 0) {
  6812. break
  6813. }
  6814. }
  6815. uriHash = _sip24_final(tls, bp)
  6816. /* Check hash table for duplicate of expanded name (uriName).
  6817. Derived from code in lookup(parser, HASH_TABLE *table, ...).
  6818. */
  6819. step = uint8(0)
  6820. mask = uint64(nsAttsSize - uint32(1))
  6821. j1 = libc.Int32FromUint64(uriHash & mask) /* index into hash table */
  6822. for (*(*TNS_ATT)(unsafe.Pointer((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_nsAtts + uintptr(j1)*24))).Fversion == version {
  6823. /* for speed we compare stored hash values first */
  6824. if uriHash == (*(*TNS_ATT)(unsafe.Pointer((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_nsAtts + uintptr(j1)*24))).Fhash {
  6825. s1 = (*TSTRING_POOL)(unsafe.Pointer(parser + 784)).Fstart
  6826. s2 = (*(*TNS_ATT)(unsafe.Pointer((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_nsAtts + uintptr(j1)*24))).FuriName
  6827. /* s1 is null terminated, but not s2 */
  6828. for {
  6829. if !(int32(*(*TXML_Char)(unsafe.Pointer(s1))) == int32(*(*TXML_Char)(unsafe.Pointer(s2))) && int32(*(*TXML_Char)(unsafe.Pointer(s1))) != 0) {
  6830. break
  6831. }
  6832. goto _26
  6833. _26:
  6834. ;
  6835. s1++
  6836. s2++
  6837. }
  6838. if int32(*(*TXML_Char)(unsafe.Pointer(s1))) == 0 {
  6839. return int32(_XML_ERROR_DUPLICATE_ATTRIBUTE)
  6840. }
  6841. }
  6842. if !(step != 0) {
  6843. step = uint8(uriHash & ^mask >> (libc.Int32FromUint8((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_nsAttsPower)-libc.Int32FromInt32(1)) & (mask>>libc.Int32FromInt32(2)) | libc.Uint64FromInt32(1))
  6844. }
  6845. if j1 < libc.Int32FromUint8(step) {
  6846. j1 = int32(uint32(j1) + (nsAttsSize - uint32(step)))
  6847. } else {
  6848. j1 -= libc.Int32FromUint8(step)
  6849. }
  6850. }
  6851. if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_ns_triplets != 0 { /* append namespace separator and prefix */
  6852. *(*TXML_Char)(unsafe.Pointer((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_tempPool.Fptr + uintptr(-libc.Int32FromInt32(1)))) = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_namespaceSeparator
  6853. s = (*Tprefix)(unsafe.Pointer((*TBINDING)(unsafe.Pointer(b)).Fprefix)).Fname
  6854. for {
  6855. if (*TSTRING_POOL)(unsafe.Pointer(parser+784)).Fptr == (*TSTRING_POOL)(unsafe.Pointer(parser+784)).Fend && !(_poolGrow(tls, parser+784) != 0) {
  6856. v30 = 0
  6857. } else {
  6858. v32 = parser + 784 + 24
  6859. v31 = *(*uintptr)(unsafe.Pointer(v32))
  6860. *(*uintptr)(unsafe.Pointer(v32))++
  6861. *(*TXML_Char)(unsafe.Pointer(v31)) = *(*TXML_Char)(unsafe.Pointer(s))
  6862. v30 = libc.Int32FromInt32(1)
  6863. }
  6864. if !(v30 != 0) {
  6865. return int32(_XML_ERROR_NO_MEMORY)
  6866. }
  6867. goto _29
  6868. _29:
  6869. ;
  6870. v28 = s
  6871. s++
  6872. if !(*(*TXML_Char)(unsafe.Pointer(v28)) != 0) {
  6873. break
  6874. }
  6875. }
  6876. }
  6877. /* store expanded name in attribute list */
  6878. s = (*TSTRING_POOL)(unsafe.Pointer(parser + 784)).Fstart
  6879. (*TSTRING_POOL)(unsafe.Pointer(parser + 784)).Fstart = (*TSTRING_POOL)(unsafe.Pointer(parser + 784)).Fptr
  6880. *(*uintptr)(unsafe.Pointer(appAtts + uintptr(i)*8)) = s
  6881. /* fill empty slot with new version, uriName and hash value */
  6882. (*(*TNS_ATT)(unsafe.Pointer((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_nsAtts + uintptr(j1)*24))).Fversion = version
  6883. (*(*TNS_ATT)(unsafe.Pointer((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_nsAtts + uintptr(j1)*24))).Fhash = uriHash
  6884. (*(*TNS_ATT)(unsafe.Pointer((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_nsAtts + uintptr(j1)*24))).FuriName = s
  6885. nPrefixes--
  6886. v33 = nPrefixes
  6887. if !(v33 != 0) {
  6888. i += int32(2)
  6889. break
  6890. }
  6891. } else { /* not prefixed */
  6892. *(*TXML_Char)(unsafe.Pointer(s + uintptr(-libc.Int32FromInt32(1)))) = 0
  6893. } /* clear flag */
  6894. goto _15
  6895. _15:
  6896. ;
  6897. i += int32(2)
  6898. }
  6899. }
  6900. /* clear flags for the remaining attributes */
  6901. for {
  6902. if !(i < attIndex) {
  6903. break
  6904. }
  6905. *(*TXML_Char)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(appAtts + uintptr(i)*8)) + uintptr(-libc.Int32FromInt32(1)))) = 0
  6906. goto _34
  6907. _34:
  6908. ;
  6909. i += int32(2)
  6910. }
  6911. binding = *(*uintptr)(unsafe.Pointer(bindingsPtr))
  6912. for {
  6913. if !(binding != 0) {
  6914. break
  6915. }
  6916. *(*TXML_Char)(unsafe.Pointer((*Tattribute_id)(unsafe.Pointer((*TBINDING)(unsafe.Pointer(binding)).FattId)).Fname + uintptr(-libc.Int32FromInt32(1)))) = 0
  6917. goto _35
  6918. _35:
  6919. ;
  6920. binding = (*TBINDING)(unsafe.Pointer(binding)).FnextTagBinding
  6921. }
  6922. if !((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_ns != 0) {
  6923. return int32(_XML_ERROR_NONE)
  6924. }
  6925. /* expand the element type name */
  6926. if (*TELEMENT_TYPE)(unsafe.Pointer(elementType)).Fprefix != 0 {
  6927. binding = (*TPREFIX)(unsafe.Pointer((*TELEMENT_TYPE)(unsafe.Pointer(elementType)).Fprefix)).Fbinding
  6928. if !(binding != 0) {
  6929. return int32(_XML_ERROR_UNBOUND_PREFIX)
  6930. }
  6931. localPart = (*TTAG_NAME)(unsafe.Pointer(tagNamePtr)).Fstr
  6932. for {
  6933. v36 = localPart
  6934. localPart++
  6935. if !(int32(*(*TXML_Char)(unsafe.Pointer(v36))) != int32(m_ASCII_COLON)) {
  6936. break
  6937. }
  6938. }
  6939. } else {
  6940. if (*TDTD)(unsafe.Pointer(dtd)).FdefaultPrefix.Fbinding != 0 {
  6941. binding = (*TDTD)(unsafe.Pointer(dtd)).FdefaultPrefix.Fbinding
  6942. localPart = (*TTAG_NAME)(unsafe.Pointer(tagNamePtr)).Fstr
  6943. } else {
  6944. return int32(_XML_ERROR_NONE)
  6945. }
  6946. }
  6947. prefixLen = 0
  6948. if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_ns_triplets != 0 && (*Tprefix)(unsafe.Pointer((*TBINDING)(unsafe.Pointer(binding)).Fprefix)).Fname != 0 {
  6949. for {
  6950. v38 = prefixLen
  6951. prefixLen++
  6952. if !(*(*TXML_Char)(unsafe.Pointer((*Tprefix)(unsafe.Pointer((*TBINDING)(unsafe.Pointer(binding)).Fprefix)).Fname + uintptr(v38))) != 0) {
  6953. break
  6954. }
  6955. goto _37
  6956. _37:
  6957. } /* prefixLen includes null terminator */
  6958. }
  6959. (*TTAG_NAME)(unsafe.Pointer(tagNamePtr)).FlocalPart = localPart
  6960. (*TTAG_NAME)(unsafe.Pointer(tagNamePtr)).FuriLen = (*TBINDING)(unsafe.Pointer(binding)).FuriLen
  6961. (*TTAG_NAME)(unsafe.Pointer(tagNamePtr)).Fprefix = (*Tprefix)(unsafe.Pointer((*TBINDING)(unsafe.Pointer(binding)).Fprefix)).Fname
  6962. (*TTAG_NAME)(unsafe.Pointer(tagNamePtr)).FprefixLen = prefixLen
  6963. i = 0
  6964. for {
  6965. v40 = i
  6966. i++
  6967. if !(*(*TXML_Char)(unsafe.Pointer(localPart + uintptr(v40))) != 0) {
  6968. break
  6969. }
  6970. goto _39
  6971. _39:
  6972. } /* i includes null terminator */
  6973. /* Detect and prevent integer overflow */
  6974. if (*TBINDING)(unsafe.Pointer(binding)).FuriLen > int32(m___INT_MAX__)-prefixLen || i > int32(m___INT_MAX__)-((*TBINDING)(unsafe.Pointer(binding)).FuriLen+prefixLen) {
  6975. return int32(_XML_ERROR_NO_MEMORY)
  6976. }
  6977. n = i + (*TBINDING)(unsafe.Pointer(binding)).FuriLen + prefixLen
  6978. if n > (*TBINDING)(unsafe.Pointer(binding)).FuriAlloc {
  6979. /* Detect and prevent integer overflow */
  6980. if n > libc.Int32FromInt32(m___INT_MAX__)-libc.Int32FromInt32(m_EXPAND_SPARE) {
  6981. return int32(_XML_ERROR_NO_MEMORY)
  6982. }
  6983. /* Detect and prevent integer overflow.
  6984. * The preprocessor guard addresses the "always false" warning
  6985. * from -Wtype-limits on platforms where
  6986. * sizeof(unsigned int) < sizeof(size_t), e.g. on x86_64. */
  6987. uri = (*(*func(*libc.TLS, Tsize_t) uintptr)(unsafe.Pointer(&struct{ uintptr }{(*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_mem.Fmalloc_fcn})))(tls, libc.Uint64FromInt32(n+libc.Int32FromInt32(m_EXPAND_SPARE))*libc.Uint64FromInt64(1))
  6988. if !(uri != 0) {
  6989. return int32(_XML_ERROR_NO_MEMORY)
  6990. }
  6991. (*TBINDING)(unsafe.Pointer(binding)).FuriAlloc = n + int32(m_EXPAND_SPARE)
  6992. libc.X__builtin___memcpy_chk(tls, uri, (*TBINDING)(unsafe.Pointer(binding)).Furi, libc.Uint64FromInt32((*TBINDING)(unsafe.Pointer(binding)).FuriLen)*uint64(1), ^t__predefined_size_t(0))
  6993. p = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_tagStack
  6994. for {
  6995. if !(p != 0) {
  6996. break
  6997. }
  6998. if (*TTAG)(unsafe.Pointer(p)).Fname.Fstr == (*TBINDING)(unsafe.Pointer(binding)).Furi {
  6999. (*TTAG)(unsafe.Pointer(p)).Fname.Fstr = uri
  7000. }
  7001. goto _41
  7002. _41:
  7003. ;
  7004. p = (*TTAG)(unsafe.Pointer(p)).Fparent
  7005. }
  7006. (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_mem.Ffree_fcn})))(tls, (*TBINDING)(unsafe.Pointer(binding)).Furi)
  7007. (*TBINDING)(unsafe.Pointer(binding)).Furi = uri
  7008. }
  7009. /* if m_namespaceSeparator != '\0' then uri includes it already */
  7010. uri = (*TBINDING)(unsafe.Pointer(binding)).Furi + uintptr((*TBINDING)(unsafe.Pointer(binding)).FuriLen)
  7011. libc.X__builtin___memcpy_chk(tls, uri, localPart, libc.Uint64FromInt32(i)*uint64(1), ^t__predefined_size_t(0))
  7012. /* we always have a namespace separator between localPart and prefix */
  7013. if prefixLen != 0 {
  7014. uri += uintptr(i - int32(1))
  7015. *(*TXML_Char)(unsafe.Pointer(uri)) = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_namespaceSeparator /* replace null terminator */
  7016. libc.X__builtin___memcpy_chk(tls, uri+uintptr(1), (*Tprefix)(unsafe.Pointer((*TBINDING)(unsafe.Pointer(binding)).Fprefix)).Fname, libc.Uint64FromInt32(prefixLen)*uint64(1), ^t__predefined_size_t(0))
  7017. }
  7018. (*TTAG_NAME)(unsafe.Pointer(tagNamePtr)).Fstr = (*TBINDING)(unsafe.Pointer(binding)).Furi
  7019. return int32(_XML_ERROR_NONE)
  7020. }
  7021. func _is_rfc3986_uri_char(tls *libc.TLS, candidate TXML_Char) (r TXML_Bool) {
  7022. // For the RFC 3986 ANBF grammar see
  7023. // https://datatracker.ietf.org/doc/html/rfc3986#appendix-A
  7024. switch int32(candidate) {
  7025. // From rule "ALPHA" (uppercase half)
  7026. case int32('A'):
  7027. fallthrough
  7028. case int32('B'):
  7029. fallthrough
  7030. case int32('C'):
  7031. fallthrough
  7032. case int32('D'):
  7033. fallthrough
  7034. case int32('E'):
  7035. fallthrough
  7036. case int32('F'):
  7037. fallthrough
  7038. case int32('G'):
  7039. fallthrough
  7040. case int32('H'):
  7041. fallthrough
  7042. case int32('I'):
  7043. fallthrough
  7044. case int32('J'):
  7045. fallthrough
  7046. case int32('K'):
  7047. fallthrough
  7048. case int32('L'):
  7049. fallthrough
  7050. case int32('M'):
  7051. fallthrough
  7052. case int32('N'):
  7053. fallthrough
  7054. case int32('O'):
  7055. fallthrough
  7056. case int32('P'):
  7057. fallthrough
  7058. case int32('Q'):
  7059. fallthrough
  7060. case int32('R'):
  7061. fallthrough
  7062. case int32('S'):
  7063. fallthrough
  7064. case int32('T'):
  7065. fallthrough
  7066. case int32('U'):
  7067. fallthrough
  7068. case int32('V'):
  7069. fallthrough
  7070. case int32('W'):
  7071. fallthrough
  7072. case int32('X'):
  7073. fallthrough
  7074. case int32('Y'):
  7075. fallthrough
  7076. case int32('Z'):
  7077. // From rule "ALPHA" (lowercase half)
  7078. fallthrough
  7079. case int32('a'):
  7080. fallthrough
  7081. case int32('b'):
  7082. fallthrough
  7083. case int32('c'):
  7084. fallthrough
  7085. case int32('d'):
  7086. fallthrough
  7087. case int32('e'):
  7088. fallthrough
  7089. case int32('f'):
  7090. fallthrough
  7091. case int32('g'):
  7092. fallthrough
  7093. case int32('h'):
  7094. fallthrough
  7095. case int32('i'):
  7096. fallthrough
  7097. case int32('j'):
  7098. fallthrough
  7099. case int32('k'):
  7100. fallthrough
  7101. case int32('l'):
  7102. fallthrough
  7103. case int32('m'):
  7104. fallthrough
  7105. case int32('n'):
  7106. fallthrough
  7107. case int32('o'):
  7108. fallthrough
  7109. case int32('p'):
  7110. fallthrough
  7111. case int32('q'):
  7112. fallthrough
  7113. case int32('r'):
  7114. fallthrough
  7115. case int32('s'):
  7116. fallthrough
  7117. case int32('t'):
  7118. fallthrough
  7119. case int32('u'):
  7120. fallthrough
  7121. case int32('v'):
  7122. fallthrough
  7123. case int32('w'):
  7124. fallthrough
  7125. case int32('x'):
  7126. fallthrough
  7127. case int32('y'):
  7128. fallthrough
  7129. case int32('z'):
  7130. // From rule "DIGIT"
  7131. fallthrough
  7132. case int32('0'):
  7133. fallthrough
  7134. case int32('1'):
  7135. fallthrough
  7136. case int32('2'):
  7137. fallthrough
  7138. case int32('3'):
  7139. fallthrough
  7140. case int32('4'):
  7141. fallthrough
  7142. case int32('5'):
  7143. fallthrough
  7144. case int32('6'):
  7145. fallthrough
  7146. case int32('7'):
  7147. fallthrough
  7148. case int32('8'):
  7149. fallthrough
  7150. case int32('9'):
  7151. // From rule "pct-encoded"
  7152. fallthrough
  7153. case int32('%'):
  7154. // From rule "unreserved"
  7155. fallthrough
  7156. case int32('-'):
  7157. fallthrough
  7158. case int32('.'):
  7159. fallthrough
  7160. case int32('_'):
  7161. fallthrough
  7162. case int32('~'):
  7163. // From rule "gen-delims"
  7164. fallthrough
  7165. case int32(':'):
  7166. fallthrough
  7167. case int32('/'):
  7168. fallthrough
  7169. case int32('?'):
  7170. fallthrough
  7171. case int32('#'):
  7172. fallthrough
  7173. case int32('['):
  7174. fallthrough
  7175. case int32(']'):
  7176. fallthrough
  7177. case int32('@'):
  7178. // From rule "sub-delims"
  7179. fallthrough
  7180. case int32('!'):
  7181. fallthrough
  7182. case int32('$'):
  7183. fallthrough
  7184. case int32('&'):
  7185. fallthrough
  7186. case int32('\''):
  7187. fallthrough
  7188. case int32('('):
  7189. fallthrough
  7190. case int32(')'):
  7191. fallthrough
  7192. case int32('*'):
  7193. fallthrough
  7194. case int32('+'):
  7195. fallthrough
  7196. case int32(','):
  7197. fallthrough
  7198. case int32(';'):
  7199. fallthrough
  7200. case int32('='):
  7201. return libc.Uint8FromInt32(1)
  7202. default:
  7203. return libc.Uint8FromInt32(0)
  7204. }
  7205. return r
  7206. }
  7207. // C documentation
  7208. //
  7209. // /* addBinding() overwrites the value of prefix->binding without checking.
  7210. // Therefore one must keep track of the old value outside of addBinding().
  7211. // */
  7212. func _addBinding(tls *libc.TLS, parser TXML_Parser, prefix uintptr, attId uintptr, uri uintptr, bindingsPtr uintptr) (r _XML_Error) {
  7213. var b, temp, v3 uintptr
  7214. var isXML, isXMLNS, mustBeXML TXML_Bool
  7215. var len1, v2 int32
  7216. _, _, _, _, _, _, _, _ = b, isXML, isXMLNS, len1, mustBeXML, temp, v2, v3
  7217. mustBeXML = libc.Uint8FromInt32(0)
  7218. isXML = libc.Uint8FromInt32(1)
  7219. isXMLNS = libc.Uint8FromInt32(1)
  7220. /* empty URI is only valid for default namespace per XML NS 1.0 (not 1.1) */
  7221. if int32(*(*TXML_Char)(unsafe.Pointer(uri))) == int32('\000') && (*TPREFIX)(unsafe.Pointer(prefix)).Fname != 0 {
  7222. return int32(_XML_ERROR_UNDECLARING_PREFIX)
  7223. }
  7224. if (*TPREFIX)(unsafe.Pointer(prefix)).Fname != 0 && int32(*(*TXML_Char)(unsafe.Pointer((*TPREFIX)(unsafe.Pointer(prefix)).Fname))) == int32(m_ASCII_x) && int32(*(*TXML_Char)(unsafe.Pointer((*TPREFIX)(unsafe.Pointer(prefix)).Fname + 1))) == int32(m_ASCII_m) && int32(*(*TXML_Char)(unsafe.Pointer((*TPREFIX)(unsafe.Pointer(prefix)).Fname + 2))) == int32(m_ASCII_l) {
  7225. /* Not allowed to bind xmlns */
  7226. if int32(*(*TXML_Char)(unsafe.Pointer((*TPREFIX)(unsafe.Pointer(prefix)).Fname + 3))) == int32(m_ASCII_n) && int32(*(*TXML_Char)(unsafe.Pointer((*TPREFIX)(unsafe.Pointer(prefix)).Fname + 4))) == int32(m_ASCII_s) && int32(*(*TXML_Char)(unsafe.Pointer((*TPREFIX)(unsafe.Pointer(prefix)).Fname + 5))) == int32('\000') {
  7227. return int32(_XML_ERROR_RESERVED_PREFIX_XMLNS)
  7228. }
  7229. if int32(*(*TXML_Char)(unsafe.Pointer((*TPREFIX)(unsafe.Pointer(prefix)).Fname + 3))) == int32('\000') {
  7230. mustBeXML = libc.Uint8FromInt32(1)
  7231. }
  7232. }
  7233. len1 = 0
  7234. for {
  7235. if !(*(*TXML_Char)(unsafe.Pointer(uri + uintptr(len1))) != 0) {
  7236. break
  7237. }
  7238. if isXML != 0 && (len1 > _xmlLen || int32(*(*TXML_Char)(unsafe.Pointer(uri + uintptr(len1)))) != int32(_xmlNamespace[len1])) {
  7239. isXML = libc.Uint8FromInt32(0)
  7240. }
  7241. if !(mustBeXML != 0) && isXMLNS != 0 && (len1 > _xmlnsLen || int32(*(*TXML_Char)(unsafe.Pointer(uri + uintptr(len1)))) != int32(_xmlnsNamespace[len1])) {
  7242. isXMLNS = libc.Uint8FromInt32(0)
  7243. }
  7244. // NOTE: While Expat does not validate namespace URIs against RFC 3986
  7245. // today (and is not REQUIRED to do so with regard to the XML 1.0
  7246. // namespaces specification) we have to at least make sure, that
  7247. // the application on top of Expat (that is likely splitting expanded
  7248. // element names ("qualified names") of form
  7249. // "[uri sep] local [sep prefix] '\0'" back into 1, 2 or 3 pieces
  7250. // in its element handler code) cannot be confused by an attacker
  7251. // putting additional namespace separator characters into namespace
  7252. // declarations. That would be ambiguous and not to be expected.
  7253. //
  7254. // While the HTML API docs of function XML_ParserCreateNS have been
  7255. // advising against use of a namespace separator character that can
  7256. // appear in a URI for >20 years now, some widespread applications
  7257. // are using URI characters (':' (colon) in particular) for a
  7258. // namespace separator, in practice. To keep these applications
  7259. // functional, we only reject namespaces URIs containing the
  7260. // application-chosen namespace separator if the chosen separator
  7261. // is a non-URI character with regard to RFC 3986.
  7262. if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_ns != 0 && int32(*(*TXML_Char)(unsafe.Pointer(uri + uintptr(len1)))) == int32((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_namespaceSeparator) && !(_is_rfc3986_uri_char(tls, *(*TXML_Char)(unsafe.Pointer(uri + uintptr(len1)))) != 0) {
  7263. return int32(_XML_ERROR_SYNTAX)
  7264. }
  7265. goto _1
  7266. _1:
  7267. ;
  7268. len1++
  7269. }
  7270. isXML = libc.BoolUint8(isXML != 0 && len1 == _xmlLen)
  7271. isXMLNS = libc.BoolUint8(isXMLNS != 0 && len1 == _xmlnsLen)
  7272. if libc.Int32FromUint8(mustBeXML) != libc.Int32FromUint8(isXML) {
  7273. if mustBeXML != 0 {
  7274. v2 = int32(_XML_ERROR_RESERVED_PREFIX_XML)
  7275. } else {
  7276. v2 = int32(_XML_ERROR_RESERVED_NAMESPACE_URI)
  7277. }
  7278. return v2
  7279. }
  7280. if isXMLNS != 0 {
  7281. return int32(_XML_ERROR_RESERVED_NAMESPACE_URI)
  7282. }
  7283. if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_namespaceSeparator != 0 {
  7284. len1++
  7285. }
  7286. if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_freeBindingList != 0 {
  7287. b = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_freeBindingList
  7288. if len1 > (*TBINDING)(unsafe.Pointer(b)).FuriAlloc {
  7289. /* Detect and prevent integer overflow */
  7290. if len1 > libc.Int32FromInt32(m___INT_MAX__)-libc.Int32FromInt32(m_EXPAND_SPARE) {
  7291. return int32(_XML_ERROR_NO_MEMORY)
  7292. }
  7293. /* Detect and prevent integer overflow.
  7294. * The preprocessor guard addresses the "always false" warning
  7295. * from -Wtype-limits on platforms where
  7296. * sizeof(unsigned int) < sizeof(size_t), e.g. on x86_64. */
  7297. temp = (*(*func(*libc.TLS, uintptr, Tsize_t) uintptr)(unsafe.Pointer(&struct{ uintptr }{(*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_mem.Frealloc_fcn})))(tls, (*TBINDING)(unsafe.Pointer(b)).Furi, libc.Uint64FromInt64(1)*libc.Uint64FromInt32(len1+libc.Int32FromInt32(m_EXPAND_SPARE)))
  7298. if temp == libc.UintptrFromInt32(0) {
  7299. return int32(_XML_ERROR_NO_MEMORY)
  7300. }
  7301. (*TBINDING)(unsafe.Pointer(b)).Furi = temp
  7302. (*TBINDING)(unsafe.Pointer(b)).FuriAlloc = len1 + int32(m_EXPAND_SPARE)
  7303. }
  7304. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_freeBindingList = (*TBINDING)(unsafe.Pointer(b)).FnextTagBinding
  7305. } else {
  7306. b = (*(*func(*libc.TLS, Tsize_t) uintptr)(unsafe.Pointer(&struct{ uintptr }{(*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_mem.Fmalloc_fcn})))(tls, libc.Uint64FromInt64(48))
  7307. if !(b != 0) {
  7308. return int32(_XML_ERROR_NO_MEMORY)
  7309. }
  7310. /* Detect and prevent integer overflow */
  7311. if len1 > libc.Int32FromInt32(m___INT_MAX__)-libc.Int32FromInt32(m_EXPAND_SPARE) {
  7312. return int32(_XML_ERROR_NO_MEMORY)
  7313. }
  7314. /* Detect and prevent integer overflow.
  7315. * The preprocessor guard addresses the "always false" warning
  7316. * from -Wtype-limits on platforms where
  7317. * sizeof(unsigned int) < sizeof(size_t), e.g. on x86_64. */
  7318. (*TBINDING)(unsafe.Pointer(b)).Furi = (*(*func(*libc.TLS, Tsize_t) uintptr)(unsafe.Pointer(&struct{ uintptr }{(*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_mem.Fmalloc_fcn})))(tls, libc.Uint64FromInt64(1)*libc.Uint64FromInt32(len1+libc.Int32FromInt32(m_EXPAND_SPARE)))
  7319. if !((*TBINDING)(unsafe.Pointer(b)).Furi != 0) {
  7320. (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_mem.Ffree_fcn})))(tls, b)
  7321. return int32(_XML_ERROR_NO_MEMORY)
  7322. }
  7323. (*TBINDING)(unsafe.Pointer(b)).FuriAlloc = len1 + int32(m_EXPAND_SPARE)
  7324. }
  7325. (*TBINDING)(unsafe.Pointer(b)).FuriLen = len1
  7326. libc.X__builtin___memcpy_chk(tls, (*TBINDING)(unsafe.Pointer(b)).Furi, uri, libc.Uint64FromInt32(len1)*uint64(1), ^t__predefined_size_t(0))
  7327. if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_namespaceSeparator != 0 {
  7328. *(*TXML_Char)(unsafe.Pointer((*TBINDING)(unsafe.Pointer(b)).Furi + uintptr(len1-int32(1)))) = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_namespaceSeparator
  7329. }
  7330. (*TBINDING)(unsafe.Pointer(b)).Fprefix = prefix
  7331. (*TBINDING)(unsafe.Pointer(b)).FattId = attId
  7332. (*TBINDING)(unsafe.Pointer(b)).FprevPrefixBinding = (*TPREFIX)(unsafe.Pointer(prefix)).Fbinding
  7333. /* NULL binding when default namespace undeclared */
  7334. if int32(*(*TXML_Char)(unsafe.Pointer(uri))) == int32('\000') && prefix == (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_dtd+304 {
  7335. (*TPREFIX)(unsafe.Pointer(prefix)).Fbinding = libc.UintptrFromInt32(0)
  7336. } else {
  7337. (*TPREFIX)(unsafe.Pointer(prefix)).Fbinding = b
  7338. }
  7339. (*TBINDING)(unsafe.Pointer(b)).FnextTagBinding = *(*uintptr)(unsafe.Pointer(bindingsPtr))
  7340. *(*uintptr)(unsafe.Pointer(bindingsPtr)) = b
  7341. /* if attId == NULL then we are not starting a namespace scope */
  7342. if attId != 0 && (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_startNamespaceDeclHandler != 0 {
  7343. if (*TPREFIX)(unsafe.Pointer(prefix)).Fbinding != 0 {
  7344. v3 = uri
  7345. } else {
  7346. v3 = uintptr(0)
  7347. }
  7348. (*(*func(*libc.TLS, uintptr, uintptr, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_startNamespaceDeclHandler})))(tls, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_handlerArg, (*TPREFIX)(unsafe.Pointer(prefix)).Fname, v3)
  7349. }
  7350. return int32(_XML_ERROR_NONE)
  7351. }
  7352. // "http://www.w3.org/XML/1998/namespace"
  7353. var _xmlNamespace = [37]TXML_Char{
  7354. 0: int8(m_ASCII_h),
  7355. 1: int8(m_ASCII_t),
  7356. 2: int8(m_ASCII_t),
  7357. 3: int8(m_ASCII_p),
  7358. 4: int8(m_ASCII_COLON),
  7359. 5: int8(m_ASCII_SLASH),
  7360. 6: int8(m_ASCII_SLASH),
  7361. 7: int8(m_ASCII_w),
  7362. 8: int8(m_ASCII_w),
  7363. 9: int8(m_ASCII_w),
  7364. 10: int8(m_ASCII_PERIOD),
  7365. 11: int8(m_ASCII_w),
  7366. 12: int8(m_ASCII_3),
  7367. 13: int8(m_ASCII_PERIOD),
  7368. 14: int8(m_ASCII_o),
  7369. 15: int8(m_ASCII_r),
  7370. 16: int8(m_ASCII_g),
  7371. 17: int8(m_ASCII_SLASH),
  7372. 18: int8(m_ASCII_X),
  7373. 19: int8(m_ASCII_M),
  7374. 20: int8(m_ASCII_L),
  7375. 21: int8(m_ASCII_SLASH),
  7376. 22: int8(m_ASCII_1),
  7377. 23: int8(m_ASCII_9),
  7378. 24: int8(m_ASCII_9),
  7379. 25: int8(m_ASCII_8),
  7380. 26: int8(m_ASCII_SLASH),
  7381. 27: int8(m_ASCII_n),
  7382. 28: int8(m_ASCII_a),
  7383. 29: int8(m_ASCII_m),
  7384. 30: int8(m_ASCII_e),
  7385. 31: int8(m_ASCII_s),
  7386. 32: int8(m_ASCII_p),
  7387. 33: int8(m_ASCII_a),
  7388. 34: int8(m_ASCII_c),
  7389. 35: int8(m_ASCII_e),
  7390. }
  7391. var _xmlLen = libc.Int32FromUint64(libc.Uint64FromInt32(libc.Int32FromInt64(37))/libc.Uint64FromInt64(1) - libc.Uint64FromInt32(1))
  7392. // "http://www.w3.org/2000/xmlns/"
  7393. var _xmlnsNamespace = [30]TXML_Char{
  7394. 0: int8(m_ASCII_h),
  7395. 1: int8(m_ASCII_t),
  7396. 2: int8(m_ASCII_t),
  7397. 3: int8(m_ASCII_p),
  7398. 4: int8(m_ASCII_COLON),
  7399. 5: int8(m_ASCII_SLASH),
  7400. 6: int8(m_ASCII_SLASH),
  7401. 7: int8(m_ASCII_w),
  7402. 8: int8(m_ASCII_w),
  7403. 9: int8(m_ASCII_w),
  7404. 10: int8(m_ASCII_PERIOD),
  7405. 11: int8(m_ASCII_w),
  7406. 12: int8(m_ASCII_3),
  7407. 13: int8(m_ASCII_PERIOD),
  7408. 14: int8(m_ASCII_o),
  7409. 15: int8(m_ASCII_r),
  7410. 16: int8(m_ASCII_g),
  7411. 17: int8(m_ASCII_SLASH),
  7412. 18: int8(m_ASCII_2),
  7413. 19: int8(m_ASCII_0),
  7414. 20: int8(m_ASCII_0),
  7415. 21: int8(m_ASCII_0),
  7416. 22: int8(m_ASCII_SLASH),
  7417. 23: int8(m_ASCII_x),
  7418. 24: int8(m_ASCII_m),
  7419. 25: int8(m_ASCII_l),
  7420. 26: int8(m_ASCII_n),
  7421. 27: int8(m_ASCII_s),
  7422. 28: int8(m_ASCII_SLASH),
  7423. }
  7424. var _xmlnsLen = libc.Int32FromUint64(libc.Uint64FromInt32(libc.Int32FromInt64(30))/libc.Uint64FromInt64(1) - libc.Uint64FromInt32(1))
  7425. // C documentation
  7426. //
  7427. // /* The idea here is to avoid using stack for each CDATA section when
  7428. // the whole file is parsed with one call.
  7429. // */
  7430. func _cdataSectionProcessor(tls *libc.TLS, parser TXML_Parser, _start uintptr, end uintptr, endPtr uintptr) (r _XML_Error) {
  7431. bp := tls.Alloc(16)
  7432. defer tls.Free(16)
  7433. *(*uintptr)(unsafe.Pointer(bp)) = _start
  7434. var result _XML_Error
  7435. _ = result
  7436. result = _doCdataSection(tls, parser, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_encoding, bp, end, endPtr, libc.BoolUint8(!((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parsingStatus.FfinalBuffer != 0)), int32(_XML_ACCOUNT_DIRECT))
  7437. if result != int32(_XML_ERROR_NONE) {
  7438. return result
  7439. }
  7440. if *(*uintptr)(unsafe.Pointer(bp)) != 0 {
  7441. if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parentParser != 0 { /* we are parsing an external entity */
  7442. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_processor = __ccgo_fp(_externalEntityContentProcessor)
  7443. return _externalEntityContentProcessor(tls, parser, *(*uintptr)(unsafe.Pointer(bp)), end, endPtr)
  7444. } else {
  7445. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_processor = __ccgo_fp(_contentProcessor)
  7446. return _contentProcessor(tls, parser, *(*uintptr)(unsafe.Pointer(bp)), end, endPtr)
  7447. }
  7448. }
  7449. return result
  7450. }
  7451. // C documentation
  7452. //
  7453. // /* startPtr gets set to non-null if the section is closed, and to null if
  7454. // the section is not yet closed.
  7455. // */
  7456. func _doCdataSection(tls *libc.TLS, parser TXML_Parser, enc uintptr, startPtr uintptr, end uintptr, nextPtr uintptr, haveMore TXML_Bool, account _XML_Account) (r _XML_Error) {
  7457. bp := tls.Alloc(32)
  7458. defer tls.Free(32)
  7459. var charDataHandler TXML_CharacterDataHandler
  7460. var convert_res _XML_Convert_Result
  7461. var eventEndPP, eventPP, v3 uintptr
  7462. var tok int32
  7463. var _ /* c at bp+16 */ TXML_Char
  7464. var _ /* dataPtr at bp+24 */ uintptr
  7465. var _ /* next at bp+8 */ uintptr
  7466. var _ /* s at bp+0 */ uintptr
  7467. _, _, _, _, _, _ = charDataHandler, convert_res, eventEndPP, eventPP, tok, v3
  7468. *(*uintptr)(unsafe.Pointer(bp)) = *(*uintptr)(unsafe.Pointer(startPtr))
  7469. if enc == (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_encoding {
  7470. eventPP = parser + 544
  7471. *(*uintptr)(unsafe.Pointer(eventPP)) = *(*uintptr)(unsafe.Pointer(bp))
  7472. eventEndPP = parser + 552
  7473. } else {
  7474. eventPP = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_openInternalEntities
  7475. eventEndPP = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_openInternalEntities + 8
  7476. }
  7477. *(*uintptr)(unsafe.Pointer(eventPP)) = *(*uintptr)(unsafe.Pointer(bp))
  7478. *(*uintptr)(unsafe.Pointer(startPtr)) = libc.UintptrFromInt32(0)
  7479. for {
  7480. *(*uintptr)(unsafe.Pointer(bp + 8)) = *(*uintptr)(unsafe.Pointer(bp)) /* in case of XML_TOK_NONE or XML_TOK_PARTIAL */
  7481. tok = (*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{*(*TSCANNER)(unsafe.Pointer(enc + 2*8))})))(tls, enc, *(*uintptr)(unsafe.Pointer(bp)), end, bp+8)
  7482. if !(_accountingDiffTolerated(tls, parser, tok, *(*uintptr)(unsafe.Pointer(bp)), *(*uintptr)(unsafe.Pointer(bp + 8)), int32(4044), account) != 0) {
  7483. _accountingOnAbort(tls, parser)
  7484. return int32(_XML_ERROR_AMPLIFICATION_LIMIT_BREACH)
  7485. }
  7486. *(*uintptr)(unsafe.Pointer(eventEndPP)) = *(*uintptr)(unsafe.Pointer(bp + 8))
  7487. switch tok {
  7488. case int32(m_XML_TOK_CDATA_SECT_CLOSE):
  7489. if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_endCdataSectionHandler != 0 {
  7490. (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_endCdataSectionHandler})))(tls, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_handlerArg)
  7491. } else {
  7492. if libc.Bool(0 != 0) && (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_characterDataHandler != 0 {
  7493. (*(*func(*libc.TLS, uintptr, uintptr, int32))(unsafe.Pointer(&struct{ uintptr }{(*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_characterDataHandler})))(tls, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_handlerArg, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_dataBuf, 0)
  7494. } else {
  7495. if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_defaultHandler != 0 {
  7496. _reportDefault(tls, parser, enc, *(*uintptr)(unsafe.Pointer(bp)), *(*uintptr)(unsafe.Pointer(bp + 8)))
  7497. }
  7498. }
  7499. }
  7500. *(*uintptr)(unsafe.Pointer(startPtr)) = *(*uintptr)(unsafe.Pointer(bp + 8))
  7501. *(*uintptr)(unsafe.Pointer(nextPtr)) = *(*uintptr)(unsafe.Pointer(bp + 8))
  7502. if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parsingStatus.Fparsing == int32(_XML_FINISHED) {
  7503. return int32(_XML_ERROR_ABORTED)
  7504. } else {
  7505. return int32(_XML_ERROR_NONE)
  7506. }
  7507. fallthrough
  7508. case int32(m_XML_TOK_DATA_NEWLINE):
  7509. if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_characterDataHandler != 0 {
  7510. *(*TXML_Char)(unsafe.Pointer(bp + 16)) = int8(0xA)
  7511. (*(*func(*libc.TLS, uintptr, uintptr, int32))(unsafe.Pointer(&struct{ uintptr }{(*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_characterDataHandler})))(tls, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_handlerArg, bp+16, int32(1))
  7512. } else {
  7513. if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_defaultHandler != 0 {
  7514. _reportDefault(tls, parser, enc, *(*uintptr)(unsafe.Pointer(bp)), *(*uintptr)(unsafe.Pointer(bp + 8)))
  7515. }
  7516. }
  7517. case int32(m_XML_TOK_DATA_CHARS):
  7518. charDataHandler = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_characterDataHandler
  7519. if charDataHandler != 0 {
  7520. if !((*TENCODING)(unsafe.Pointer(enc)).FisUtf8 != 0) {
  7521. for {
  7522. *(*uintptr)(unsafe.Pointer(bp + 24)) = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_dataBuf
  7523. convert_res = (*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr, uintptr) _XML_Convert_Result)(unsafe.Pointer(&struct{ uintptr }{(*TENCODING)(unsafe.Pointer(enc)).Futf8Convert})))(tls, enc, bp, *(*uintptr)(unsafe.Pointer(bp + 8)), bp+24, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_dataBufEnd)
  7524. *(*uintptr)(unsafe.Pointer(eventEndPP)) = *(*uintptr)(unsafe.Pointer(bp + 8))
  7525. (*(*func(*libc.TLS, uintptr, uintptr, int32))(unsafe.Pointer(&struct{ uintptr }{charDataHandler})))(tls, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_handlerArg, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_dataBuf, int32(int64(*(*uintptr)(unsafe.Pointer(bp + 24)))-int64((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_dataBuf)))
  7526. if convert_res == int32(_XML_CONVERT_COMPLETED) || convert_res == int32(_XML_CONVERT_INPUT_INCOMPLETE) {
  7527. break
  7528. }
  7529. *(*uintptr)(unsafe.Pointer(eventPP)) = *(*uintptr)(unsafe.Pointer(bp))
  7530. goto _2
  7531. _2:
  7532. }
  7533. } else {
  7534. (*(*func(*libc.TLS, uintptr, uintptr, int32))(unsafe.Pointer(&struct{ uintptr }{charDataHandler})))(tls, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_handlerArg, *(*uintptr)(unsafe.Pointer(bp)), int32(int64(*(*uintptr)(unsafe.Pointer(bp + 8)))-int64(*(*uintptr)(unsafe.Pointer(bp)))))
  7535. }
  7536. } else {
  7537. if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_defaultHandler != 0 {
  7538. _reportDefault(tls, parser, enc, *(*uintptr)(unsafe.Pointer(bp)), *(*uintptr)(unsafe.Pointer(bp + 8)))
  7539. }
  7540. }
  7541. case m_XML_TOK_INVALID:
  7542. *(*uintptr)(unsafe.Pointer(eventPP)) = *(*uintptr)(unsafe.Pointer(bp + 8))
  7543. return int32(_XML_ERROR_INVALID_TOKEN)
  7544. case -int32(2):
  7545. if haveMore != 0 {
  7546. *(*uintptr)(unsafe.Pointer(nextPtr)) = *(*uintptr)(unsafe.Pointer(bp))
  7547. return int32(_XML_ERROR_NONE)
  7548. }
  7549. return int32(_XML_ERROR_PARTIAL_CHAR)
  7550. case -int32(1):
  7551. fallthrough
  7552. case -int32(4):
  7553. if haveMore != 0 {
  7554. *(*uintptr)(unsafe.Pointer(nextPtr)) = *(*uintptr)(unsafe.Pointer(bp))
  7555. return int32(_XML_ERROR_NONE)
  7556. }
  7557. return int32(_XML_ERROR_UNCLOSED_CDATA_SECTION)
  7558. default:
  7559. /* Every token returned by XmlCdataSectionTok() has its own
  7560. * explicit case, so this default case will never be executed.
  7561. * We retain it as a safety net and exclude it from the coverage
  7562. * statistics.
  7563. *
  7564. * LCOV_EXCL_START
  7565. */
  7566. *(*uintptr)(unsafe.Pointer(eventPP)) = *(*uintptr)(unsafe.Pointer(bp + 8))
  7567. return int32(_XML_ERROR_UNEXPECTED_STATE)
  7568. /* LCOV_EXCL_STOP */
  7569. }
  7570. v3 = *(*uintptr)(unsafe.Pointer(bp + 8))
  7571. *(*uintptr)(unsafe.Pointer(bp)) = v3
  7572. *(*uintptr)(unsafe.Pointer(eventPP)) = v3
  7573. switch (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parsingStatus.Fparsing {
  7574. case int32(_XML_SUSPENDED):
  7575. *(*uintptr)(unsafe.Pointer(nextPtr)) = *(*uintptr)(unsafe.Pointer(bp + 8))
  7576. return int32(_XML_ERROR_NONE)
  7577. case int32(_XML_FINISHED):
  7578. return int32(_XML_ERROR_ABORTED)
  7579. default:
  7580. }
  7581. goto _1
  7582. _1:
  7583. }
  7584. /* not reached */
  7585. return r
  7586. }
  7587. // C documentation
  7588. //
  7589. // /* The idea here is to avoid using stack for each IGNORE section when
  7590. // the whole file is parsed with one call.
  7591. // */
  7592. func _ignoreSectionProcessor(tls *libc.TLS, parser TXML_Parser, _start uintptr, end uintptr, endPtr uintptr) (r _XML_Error) {
  7593. bp := tls.Alloc(16)
  7594. defer tls.Free(16)
  7595. *(*uintptr)(unsafe.Pointer(bp)) = _start
  7596. var result _XML_Error
  7597. _ = result
  7598. result = _doIgnoreSection(tls, parser, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_encoding, bp, end, endPtr, libc.BoolUint8(!((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parsingStatus.FfinalBuffer != 0)))
  7599. if result != int32(_XML_ERROR_NONE) {
  7600. return result
  7601. }
  7602. if *(*uintptr)(unsafe.Pointer(bp)) != 0 {
  7603. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_processor = __ccgo_fp(_prologProcessor)
  7604. return _prologProcessor(tls, parser, *(*uintptr)(unsafe.Pointer(bp)), end, endPtr)
  7605. }
  7606. return result
  7607. }
  7608. // C documentation
  7609. //
  7610. // /* startPtr gets set to non-null is the section is closed, and to null
  7611. // if the section is not yet closed.
  7612. // */
  7613. func _doIgnoreSection(tls *libc.TLS, parser TXML_Parser, enc uintptr, startPtr uintptr, end uintptr, nextPtr uintptr, haveMore TXML_Bool) (r _XML_Error) {
  7614. bp := tls.Alloc(16)
  7615. defer tls.Free(16)
  7616. var eventEndPP, eventPP, s uintptr
  7617. var tok int32
  7618. var _ /* next at bp+0 */ uintptr
  7619. _, _, _, _ = eventEndPP, eventPP, s, tok
  7620. *(*uintptr)(unsafe.Pointer(bp)) = *(*uintptr)(unsafe.Pointer(startPtr))
  7621. s = *(*uintptr)(unsafe.Pointer(startPtr))
  7622. if enc == (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_encoding {
  7623. eventPP = parser + 544
  7624. *(*uintptr)(unsafe.Pointer(eventPP)) = s
  7625. eventEndPP = parser + 552
  7626. } else {
  7627. /* It's not entirely clear, but it seems the following two lines
  7628. * of code cannot be executed. The only occasions on which 'enc'
  7629. * is not 'encoding' are when this function is called
  7630. * from the internal entity processing, and IGNORE sections are an
  7631. * error in internal entities.
  7632. *
  7633. * Since it really isn't clear that this is true, we keep the code
  7634. * and just remove it from our coverage tests.
  7635. *
  7636. * LCOV_EXCL_START
  7637. */
  7638. eventPP = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_openInternalEntities
  7639. eventEndPP = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_openInternalEntities + 8
  7640. /* LCOV_EXCL_STOP */
  7641. }
  7642. *(*uintptr)(unsafe.Pointer(eventPP)) = s
  7643. *(*uintptr)(unsafe.Pointer(startPtr)) = libc.UintptrFromInt32(0)
  7644. tok = (*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{*(*TSCANNER)(unsafe.Pointer(enc + 3*8))})))(tls, enc, s, end, bp)
  7645. if !(_accountingDiffTolerated(tls, parser, tok, s, *(*uintptr)(unsafe.Pointer(bp)), int32(4196), int32(_XML_ACCOUNT_DIRECT)) != 0) {
  7646. _accountingOnAbort(tls, parser)
  7647. return int32(_XML_ERROR_AMPLIFICATION_LIMIT_BREACH)
  7648. }
  7649. *(*uintptr)(unsafe.Pointer(eventEndPP)) = *(*uintptr)(unsafe.Pointer(bp))
  7650. switch tok {
  7651. case int32(m_XML_TOK_IGNORE_SECT):
  7652. if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_defaultHandler != 0 {
  7653. _reportDefault(tls, parser, enc, s, *(*uintptr)(unsafe.Pointer(bp)))
  7654. }
  7655. *(*uintptr)(unsafe.Pointer(startPtr)) = *(*uintptr)(unsafe.Pointer(bp))
  7656. *(*uintptr)(unsafe.Pointer(nextPtr)) = *(*uintptr)(unsafe.Pointer(bp))
  7657. if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parsingStatus.Fparsing == int32(_XML_FINISHED) {
  7658. return int32(_XML_ERROR_ABORTED)
  7659. } else {
  7660. return int32(_XML_ERROR_NONE)
  7661. }
  7662. fallthrough
  7663. case m_XML_TOK_INVALID:
  7664. *(*uintptr)(unsafe.Pointer(eventPP)) = *(*uintptr)(unsafe.Pointer(bp))
  7665. return int32(_XML_ERROR_INVALID_TOKEN)
  7666. case -int32(2):
  7667. if haveMore != 0 {
  7668. *(*uintptr)(unsafe.Pointer(nextPtr)) = s
  7669. return int32(_XML_ERROR_NONE)
  7670. }
  7671. return int32(_XML_ERROR_PARTIAL_CHAR)
  7672. case -int32(1):
  7673. fallthrough
  7674. case -int32(4):
  7675. if haveMore != 0 {
  7676. *(*uintptr)(unsafe.Pointer(nextPtr)) = s
  7677. return int32(_XML_ERROR_NONE)
  7678. }
  7679. return int32(_XML_ERROR_SYNTAX) /* XML_ERROR_UNCLOSED_IGNORE_SECTION */
  7680. default:
  7681. /* All of the tokens that XmlIgnoreSectionTok() returns have
  7682. * explicit cases to handle them, so this default case is never
  7683. * executed. We keep it as a safety net anyway, and remove it
  7684. * from our test coverage statistics.
  7685. *
  7686. * LCOV_EXCL_START
  7687. */
  7688. *(*uintptr)(unsafe.Pointer(eventPP)) = *(*uintptr)(unsafe.Pointer(bp))
  7689. return int32(_XML_ERROR_UNEXPECTED_STATE)
  7690. /* LCOV_EXCL_STOP */
  7691. }
  7692. /* not reached */
  7693. return r
  7694. }
  7695. func _initializeEncoding(tls *libc.TLS, parser TXML_Parser) (r _XML_Error) {
  7696. var s uintptr
  7697. var v1 func(*libc.TLS, uintptr, uintptr, uintptr) int32
  7698. _, _ = s, v1
  7699. s = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_protocolEncodingName
  7700. if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_ns != 0 {
  7701. v1 = XXmlInitEncodingNS
  7702. } else {
  7703. v1 = XXmlInitEncoding
  7704. }
  7705. if v1(tls, parser+296, parser+288, s) != 0 {
  7706. return int32(_XML_ERROR_NONE)
  7707. }
  7708. return _handleUnknownEncoding(tls, parser, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_protocolEncodingName)
  7709. }
  7710. func _processXmlDecl(tls *libc.TLS, parser TXML_Parser, isGeneralTextEntity int32, s uintptr, next uintptr) (r _XML_Error) {
  7711. bp := tls.Alloc(48)
  7712. defer tls.Free(48)
  7713. var result _XML_Error
  7714. var storedEncName, storedversion uintptr
  7715. var v1 func(*libc.TLS, int32, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr) int32
  7716. var _ /* encodingName at bp+0 */ uintptr
  7717. var _ /* newEncoding at bp+8 */ uintptr
  7718. var _ /* standalone at bp+32 */ int32
  7719. var _ /* version at bp+16 */ uintptr
  7720. var _ /* versionend at bp+24 */ uintptr
  7721. _, _, _, _ = result, storedEncName, storedversion, v1
  7722. *(*uintptr)(unsafe.Pointer(bp)) = libc.UintptrFromInt32(0)
  7723. storedEncName = libc.UintptrFromInt32(0)
  7724. *(*uintptr)(unsafe.Pointer(bp + 8)) = libc.UintptrFromInt32(0)
  7725. *(*uintptr)(unsafe.Pointer(bp + 16)) = libc.UintptrFromInt32(0)
  7726. *(*uintptr)(unsafe.Pointer(bp + 24)) = libc.UintptrFromInt32(0)
  7727. storedversion = libc.UintptrFromInt32(0)
  7728. *(*int32)(unsafe.Pointer(bp + 32)) = -int32(1)
  7729. if !(_accountingDiffTolerated(tls, parser, int32(m_XML_TOK_XML_DECL), s, next, int32(4288), int32(_XML_ACCOUNT_DIRECT)) != 0) {
  7730. _accountingOnAbort(tls, parser)
  7731. return int32(_XML_ERROR_AMPLIFICATION_LIMIT_BREACH)
  7732. }
  7733. if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_ns != 0 {
  7734. v1 = XXmlParseXmlDeclNS
  7735. } else {
  7736. v1 = XXmlParseXmlDecl
  7737. }
  7738. if !(v1(tls, isGeneralTextEntity, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_encoding, s, next, parser+544, bp+16, bp+24, bp, bp+8, bp+32) != 0) {
  7739. if isGeneralTextEntity != 0 {
  7740. return int32(_XML_ERROR_TEXT_DECL)
  7741. } else {
  7742. return int32(_XML_ERROR_XML_DECL)
  7743. }
  7744. }
  7745. if !(isGeneralTextEntity != 0) && *(*int32)(unsafe.Pointer(bp + 32)) == int32(1) {
  7746. (*TDTD)(unsafe.Pointer((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_dtd)).Fstandalone = libc.Uint8FromInt32(1)
  7747. if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_paramEntityParsing == int32(_XML_PARAM_ENTITY_PARSING_UNLESS_STANDALONE) {
  7748. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_paramEntityParsing = int32(_XML_PARAM_ENTITY_PARSING_NEVER)
  7749. }
  7750. }
  7751. if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_xmlDeclHandler != 0 {
  7752. if *(*uintptr)(unsafe.Pointer(bp)) != libc.UintptrFromInt32(0) {
  7753. storedEncName = _poolStoreString(tls, parser+832, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_encoding, *(*uintptr)(unsafe.Pointer(bp)), *(*uintptr)(unsafe.Pointer(bp))+uintptr((*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*TENCODING)(unsafe.Pointer((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_encoding)).FnameLength})))(tls, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_encoding, *(*uintptr)(unsafe.Pointer(bp)))))
  7754. if !(storedEncName != 0) {
  7755. return int32(_XML_ERROR_NO_MEMORY)
  7756. }
  7757. (*TSTRING_POOL)(unsafe.Pointer(parser + 832)).Fstart = (*TSTRING_POOL)(unsafe.Pointer(parser + 832)).Fptr
  7758. }
  7759. if *(*uintptr)(unsafe.Pointer(bp + 16)) != 0 {
  7760. storedversion = _poolStoreString(tls, parser+832, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_encoding, *(*uintptr)(unsafe.Pointer(bp + 16)), *(*uintptr)(unsafe.Pointer(bp + 24))-uintptr((*TENCODING)(unsafe.Pointer((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_encoding)).FminBytesPerChar))
  7761. if !(storedversion != 0) {
  7762. return int32(_XML_ERROR_NO_MEMORY)
  7763. }
  7764. }
  7765. (*(*func(*libc.TLS, uintptr, uintptr, uintptr, int32))(unsafe.Pointer(&struct{ uintptr }{(*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_xmlDeclHandler})))(tls, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_handlerArg, storedversion, storedEncName, *(*int32)(unsafe.Pointer(bp + 32)))
  7766. } else {
  7767. if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_defaultHandler != 0 {
  7768. _reportDefault(tls, parser, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_encoding, s, next)
  7769. }
  7770. }
  7771. if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_protocolEncodingName == libc.UintptrFromInt32(0) {
  7772. if *(*uintptr)(unsafe.Pointer(bp + 8)) != 0 {
  7773. /* Check that the specified encoding does not conflict with what
  7774. * the parser has already deduced. Do we have the same number
  7775. * of bytes in the smallest representation of a character? If
  7776. * this is UTF-16, is it the same endianness?
  7777. */
  7778. if (*TENCODING)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FminBytesPerChar != (*TENCODING)(unsafe.Pointer((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_encoding)).FminBytesPerChar || (*TENCODING)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FminBytesPerChar == int32(2) && *(*uintptr)(unsafe.Pointer(bp + 8)) != (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_encoding {
  7779. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_eventPtr = *(*uintptr)(unsafe.Pointer(bp))
  7780. return int32(_XML_ERROR_INCORRECT_ENCODING)
  7781. }
  7782. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_encoding = *(*uintptr)(unsafe.Pointer(bp + 8))
  7783. } else {
  7784. if *(*uintptr)(unsafe.Pointer(bp)) != 0 {
  7785. if !(storedEncName != 0) {
  7786. storedEncName = _poolStoreString(tls, parser+832, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_encoding, *(*uintptr)(unsafe.Pointer(bp)), *(*uintptr)(unsafe.Pointer(bp))+uintptr((*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*TENCODING)(unsafe.Pointer((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_encoding)).FnameLength})))(tls, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_encoding, *(*uintptr)(unsafe.Pointer(bp)))))
  7787. if !(storedEncName != 0) {
  7788. return int32(_XML_ERROR_NO_MEMORY)
  7789. }
  7790. }
  7791. result = _handleUnknownEncoding(tls, parser, storedEncName)
  7792. _poolClear(tls, parser+832)
  7793. if result == int32(_XML_ERROR_UNKNOWN_ENCODING) {
  7794. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_eventPtr = *(*uintptr)(unsafe.Pointer(bp))
  7795. }
  7796. return result
  7797. }
  7798. }
  7799. }
  7800. if storedEncName != 0 || storedversion != 0 {
  7801. _poolClear(tls, parser+832)
  7802. }
  7803. return int32(_XML_ERROR_NONE)
  7804. }
  7805. func _handleUnknownEncoding(tls *libc.TLS, parser TXML_Parser, encodingName uintptr) (r _XML_Error) {
  7806. bp := tls.Alloc(1056)
  7807. defer tls.Free(1056)
  7808. var enc uintptr
  7809. var i int32
  7810. var v2 func(*libc.TLS, uintptr, uintptr, TCONVERTER, uintptr) uintptr
  7811. var _ /* info at bp+0 */ TXML_Encoding
  7812. _, _, _ = enc, i, v2
  7813. if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_unknownEncodingHandler != 0 {
  7814. i = 0
  7815. for {
  7816. if !(i < int32(256)) {
  7817. break
  7818. }
  7819. *(*int32)(unsafe.Pointer(bp + uintptr(i)*4)) = -int32(1)
  7820. goto _1
  7821. _1:
  7822. ;
  7823. i++
  7824. }
  7825. (*(*TXML_Encoding)(unsafe.Pointer(bp))).Fconvert = libc.UintptrFromInt32(0)
  7826. (*(*TXML_Encoding)(unsafe.Pointer(bp))).Fdata = libc.UintptrFromInt32(0)
  7827. (*(*TXML_Encoding)(unsafe.Pointer(bp))).Frelease = libc.UintptrFromInt32(0)
  7828. if (*(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_unknownEncodingHandler})))(tls, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_unknownEncodingHandlerData, encodingName, bp) != 0 {
  7829. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_unknownEncodingMem = (*(*func(*libc.TLS, Tsize_t) uintptr)(unsafe.Pointer(&struct{ uintptr }{(*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_mem.Fmalloc_fcn})))(tls, libc.Uint64FromInt32(XXmlSizeOfUnknownEncoding(tls)))
  7830. if !((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_unknownEncodingMem != 0) {
  7831. if (*(*TXML_Encoding)(unsafe.Pointer(bp))).Frelease != 0 {
  7832. (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*(*TXML_Encoding)(unsafe.Pointer(bp))).Frelease})))(tls, (*(*TXML_Encoding)(unsafe.Pointer(bp))).Fdata)
  7833. }
  7834. return int32(_XML_ERROR_NO_MEMORY)
  7835. }
  7836. if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_ns != 0 {
  7837. v2 = XXmlInitUnknownEncodingNS
  7838. } else {
  7839. v2 = XXmlInitUnknownEncoding
  7840. }
  7841. enc = v2(tls, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_unknownEncodingMem, bp, (*(*TXML_Encoding)(unsafe.Pointer(bp))).Fconvert, (*(*TXML_Encoding)(unsafe.Pointer(bp))).Fdata)
  7842. if enc != 0 {
  7843. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_unknownEncodingData = (*(*TXML_Encoding)(unsafe.Pointer(bp))).Fdata
  7844. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_unknownEncodingRelease = (*(*TXML_Encoding)(unsafe.Pointer(bp))).Frelease
  7845. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_encoding = enc
  7846. return int32(_XML_ERROR_NONE)
  7847. }
  7848. }
  7849. if (*(*TXML_Encoding)(unsafe.Pointer(bp))).Frelease != libc.UintptrFromInt32(0) {
  7850. (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*(*TXML_Encoding)(unsafe.Pointer(bp))).Frelease})))(tls, (*(*TXML_Encoding)(unsafe.Pointer(bp))).Fdata)
  7851. }
  7852. }
  7853. return int32(_XML_ERROR_UNKNOWN_ENCODING)
  7854. }
  7855. func _prologInitProcessor(tls *libc.TLS, parser TXML_Parser, s uintptr, end uintptr, nextPtr uintptr) (r _XML_Error) {
  7856. var result _XML_Error
  7857. _ = result
  7858. result = _initializeEncoding(tls, parser)
  7859. if result != int32(_XML_ERROR_NONE) {
  7860. return result
  7861. }
  7862. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_processor = __ccgo_fp(_prologProcessor)
  7863. return _prologProcessor(tls, parser, s, end, nextPtr)
  7864. }
  7865. func _externalParEntInitProcessor(tls *libc.TLS, parser TXML_Parser, s uintptr, end uintptr, nextPtr uintptr) (r _XML_Error) {
  7866. var result _XML_Error
  7867. _ = result
  7868. result = _initializeEncoding(tls, parser)
  7869. if result != int32(_XML_ERROR_NONE) {
  7870. return result
  7871. }
  7872. /* we know now that XML_Parse(Buffer) has been called,
  7873. so we consider the external parameter entity read */
  7874. (*TDTD)(unsafe.Pointer((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_dtd)).FparamEntityRead = libc.Uint8FromInt32(1)
  7875. if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_prologState.FinEntityValue != 0 {
  7876. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_processor = __ccgo_fp(_entityValueInitProcessor)
  7877. return _entityValueInitProcessor(tls, parser, s, end, nextPtr)
  7878. } else {
  7879. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_processor = __ccgo_fp(_externalParEntProcessor)
  7880. return _externalParEntProcessor(tls, parser, s, end, nextPtr)
  7881. }
  7882. return r
  7883. }
  7884. func _entityValueInitProcessor(tls *libc.TLS, parser TXML_Parser, s uintptr, end uintptr, nextPtr uintptr) (r _XML_Error) {
  7885. bp := tls.Alloc(16)
  7886. defer tls.Free(16)
  7887. var result _XML_Error
  7888. var start uintptr
  7889. var tok int32
  7890. var _ /* next at bp+0 */ uintptr
  7891. _, _, _ = result, start, tok
  7892. start = s
  7893. *(*uintptr)(unsafe.Pointer(bp)) = start
  7894. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_eventPtr = start
  7895. for {
  7896. tok = (*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{*(*TSCANNER)(unsafe.Pointer((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_encoding))})))(tls, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_encoding, start, end, bp)
  7897. /* Note: Except for XML_TOK_BOM below, these bytes are accounted later in:
  7898. - storeEntityValue
  7899. - processXmlDecl
  7900. */
  7901. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_eventEndPtr = *(*uintptr)(unsafe.Pointer(bp))
  7902. if tok <= 0 {
  7903. if !((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parsingStatus.FfinalBuffer != 0) && tok != m_XML_TOK_INVALID {
  7904. *(*uintptr)(unsafe.Pointer(nextPtr)) = s
  7905. return int32(_XML_ERROR_NONE)
  7906. }
  7907. switch tok {
  7908. case m_XML_TOK_INVALID:
  7909. return int32(_XML_ERROR_INVALID_TOKEN)
  7910. case -int32(1):
  7911. return int32(_XML_ERROR_UNCLOSED_TOKEN)
  7912. case -int32(2):
  7913. return int32(_XML_ERROR_PARTIAL_CHAR)
  7914. case -int32(4): /* start == end */
  7915. fallthrough
  7916. default:
  7917. break
  7918. }
  7919. /* found end of entity value - can store it now */
  7920. return _storeEntityValue(tls, parser, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_encoding, s, end, int32(_XML_ACCOUNT_DIRECT))
  7921. } else {
  7922. if tok == int32(m_XML_TOK_XML_DECL) {
  7923. result = _processXmlDecl(tls, parser, 0, start, *(*uintptr)(unsafe.Pointer(bp)))
  7924. if result != int32(_XML_ERROR_NONE) {
  7925. return result
  7926. }
  7927. /* At this point, m_parsingStatus.parsing cannot be XML_SUSPENDED. For
  7928. * that to happen, a parameter entity parsing handler must have attempted
  7929. * to suspend the parser, which fails and raises an error. The parser can
  7930. * be aborted, but can't be suspended.
  7931. */
  7932. if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parsingStatus.Fparsing == int32(_XML_FINISHED) {
  7933. return int32(_XML_ERROR_ABORTED)
  7934. }
  7935. *(*uintptr)(unsafe.Pointer(nextPtr)) = *(*uintptr)(unsafe.Pointer(bp))
  7936. /* stop scanning for text declaration - we found one */
  7937. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_processor = __ccgo_fp(_entityValueProcessor)
  7938. return _entityValueProcessor(tls, parser, *(*uintptr)(unsafe.Pointer(bp)), end, nextPtr)
  7939. } else {
  7940. if tok == int32(m_XML_TOK_BOM) && *(*uintptr)(unsafe.Pointer(bp)) == end && !((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parsingStatus.FfinalBuffer != 0) {
  7941. if !(_accountingDiffTolerated(tls, parser, tok, s, *(*uintptr)(unsafe.Pointer(bp)), int32(4495), int32(_XML_ACCOUNT_DIRECT)) != 0) {
  7942. _accountingOnAbort(tls, parser)
  7943. return int32(_XML_ERROR_AMPLIFICATION_LIMIT_BREACH)
  7944. }
  7945. *(*uintptr)(unsafe.Pointer(nextPtr)) = *(*uintptr)(unsafe.Pointer(bp))
  7946. return int32(_XML_ERROR_NONE)
  7947. } else {
  7948. if tok == int32(m_XML_TOK_INSTANCE_START) {
  7949. *(*uintptr)(unsafe.Pointer(nextPtr)) = *(*uintptr)(unsafe.Pointer(bp))
  7950. return int32(_XML_ERROR_SYNTAX)
  7951. }
  7952. }
  7953. }
  7954. }
  7955. start = *(*uintptr)(unsafe.Pointer(bp))
  7956. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_eventPtr = start
  7957. goto _1
  7958. _1:
  7959. }
  7960. return r
  7961. }
  7962. func _externalParEntProcessor(tls *libc.TLS, parser TXML_Parser, s uintptr, end uintptr, nextPtr uintptr) (r _XML_Error) {
  7963. bp := tls.Alloc(16)
  7964. defer tls.Free(16)
  7965. var tok int32
  7966. var _ /* next at bp+0 */ uintptr
  7967. _ = tok
  7968. *(*uintptr)(unsafe.Pointer(bp)) = s
  7969. tok = (*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{*(*TSCANNER)(unsafe.Pointer((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_encoding))})))(tls, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_encoding, s, end, bp)
  7970. if tok <= 0 {
  7971. if !((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parsingStatus.FfinalBuffer != 0) && tok != m_XML_TOK_INVALID {
  7972. *(*uintptr)(unsafe.Pointer(nextPtr)) = s
  7973. return int32(_XML_ERROR_NONE)
  7974. }
  7975. switch tok {
  7976. case m_XML_TOK_INVALID:
  7977. return int32(_XML_ERROR_INVALID_TOKEN)
  7978. case -int32(1):
  7979. return int32(_XML_ERROR_UNCLOSED_TOKEN)
  7980. case -int32(2):
  7981. return int32(_XML_ERROR_PARTIAL_CHAR)
  7982. case -int32(4): /* start == end */
  7983. fallthrough
  7984. default:
  7985. break
  7986. }
  7987. } else {
  7988. if tok == int32(m_XML_TOK_BOM) {
  7989. if !(_accountingDiffTolerated(tls, parser, tok, s, *(*uintptr)(unsafe.Pointer(bp)), int32(4548), int32(_XML_ACCOUNT_DIRECT)) != 0) {
  7990. _accountingOnAbort(tls, parser)
  7991. return int32(_XML_ERROR_AMPLIFICATION_LIMIT_BREACH)
  7992. }
  7993. s = *(*uintptr)(unsafe.Pointer(bp))
  7994. tok = (*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{*(*TSCANNER)(unsafe.Pointer((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_encoding))})))(tls, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_encoding, s, end, bp)
  7995. }
  7996. }
  7997. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_processor = __ccgo_fp(_prologProcessor)
  7998. return _doProlog(tls, parser, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_encoding, s, end, tok, *(*uintptr)(unsafe.Pointer(bp)), nextPtr, libc.BoolUint8(!((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parsingStatus.FfinalBuffer != 0)), libc.Uint8FromInt32(1), int32(_XML_ACCOUNT_DIRECT))
  7999. }
  8000. func _entityValueProcessor(tls *libc.TLS, parser TXML_Parser, s uintptr, end uintptr, nextPtr uintptr) (r _XML_Error) {
  8001. bp := tls.Alloc(16)
  8002. defer tls.Free(16)
  8003. var enc, start uintptr
  8004. var tok int32
  8005. var _ /* next at bp+0 */ uintptr
  8006. _, _, _ = enc, start, tok
  8007. start = s
  8008. *(*uintptr)(unsafe.Pointer(bp)) = s
  8009. enc = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_encoding
  8010. for {
  8011. tok = (*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{*(*TSCANNER)(unsafe.Pointer(enc))})))(tls, enc, start, end, bp)
  8012. /* Note: These bytes are accounted later in:
  8013. - storeEntityValue
  8014. */
  8015. if tok <= 0 {
  8016. if !((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parsingStatus.FfinalBuffer != 0) && tok != m_XML_TOK_INVALID {
  8017. *(*uintptr)(unsafe.Pointer(nextPtr)) = s
  8018. return int32(_XML_ERROR_NONE)
  8019. }
  8020. switch tok {
  8021. case m_XML_TOK_INVALID:
  8022. return int32(_XML_ERROR_INVALID_TOKEN)
  8023. case -int32(1):
  8024. return int32(_XML_ERROR_UNCLOSED_TOKEN)
  8025. case -int32(2):
  8026. return int32(_XML_ERROR_PARTIAL_CHAR)
  8027. case -int32(4): /* start == end */
  8028. fallthrough
  8029. default:
  8030. break
  8031. }
  8032. /* found end of entity value - can store it now */
  8033. return _storeEntityValue(tls, parser, enc, s, end, int32(_XML_ACCOUNT_DIRECT))
  8034. }
  8035. start = *(*uintptr)(unsafe.Pointer(bp))
  8036. goto _1
  8037. _1:
  8038. }
  8039. return r
  8040. }
  8041. func _prologProcessor(tls *libc.TLS, parser TXML_Parser, s uintptr, end uintptr, nextPtr uintptr) (r _XML_Error) {
  8042. bp := tls.Alloc(16)
  8043. defer tls.Free(16)
  8044. var tok int32
  8045. var _ /* next at bp+0 */ uintptr
  8046. _ = tok
  8047. *(*uintptr)(unsafe.Pointer(bp)) = s
  8048. tok = (*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{*(*TSCANNER)(unsafe.Pointer((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_encoding))})))(tls, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_encoding, s, end, bp)
  8049. return _doProlog(tls, parser, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_encoding, s, end, tok, *(*uintptr)(unsafe.Pointer(bp)), nextPtr, libc.BoolUint8(!((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parsingStatus.FfinalBuffer != 0)), libc.Uint8FromInt32(1), int32(_XML_ACCOUNT_DIRECT))
  8050. }
  8051. func _doProlog(tls *libc.TLS, parser TXML_Parser, enc uintptr, s uintptr, end uintptr, tok int32, _next uintptr, nextPtr uintptr, haveMore TXML_Bool, allowClosingDoctype TXML_Bool, account _XML_Account) (r _XML_Error) {
  8052. bp := tls.Alloc(16)
  8053. defer tls.Free(16)
  8054. *(*uintptr)(unsafe.Pointer(bp)) = _next
  8055. var attVal, content, dtd, el, entity, entity1, entity2, eventEndPP, eventPP, model, name, name1, name2, name3, new_connector, new_scaff_index, nxt, prefix, pubId, systemId, tem, tem1, v65, v67, v68, v70, v71, v74, v75, v77, v78, v86, p80 uintptr
  8056. var betweenDecl, hadParamEntityRefs, hadParamEntityRefs1, handleDefault TXML_Bool
  8057. var myindex, myindex1, role, v66, v69, v73, v76, v82, v84, v85 int32
  8058. var nameLen, v88 Tsize_t
  8059. var quant _XML_Content_Quant
  8060. var result, result1, result2, result3, result4, result5 _XML_Error
  8061. var v72, v79, v83 bool
  8062. var v81 uint32
  8063. _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = attVal, betweenDecl, content, dtd, el, entity, entity1, entity2, eventEndPP, eventPP, hadParamEntityRefs, hadParamEntityRefs1, handleDefault, model, myindex, myindex1, name, name1, name2, name3, nameLen, new_connector, new_scaff_index, nxt, prefix, pubId, quant, result, result1, result2, result3, result4, result5, role, systemId, tem, tem1, v65, v66, v67, v68, v69, v70, v71, v72, v73, v74, v75, v76, v77, v78, v79, v81, v82, v83, v84, v85, v86, v88, p80
  8064. /* save one level of indirection */
  8065. dtd = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_dtd
  8066. if enc == (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_encoding {
  8067. eventPP = parser + 544
  8068. eventEndPP = parser + 552
  8069. } else {
  8070. eventPP = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_openInternalEntities
  8071. eventEndPP = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_openInternalEntities + 8
  8072. }
  8073. for {
  8074. handleDefault = libc.Uint8FromInt32(1)
  8075. *(*uintptr)(unsafe.Pointer(eventPP)) = s
  8076. *(*uintptr)(unsafe.Pointer(eventEndPP)) = *(*uintptr)(unsafe.Pointer(bp))
  8077. if tok <= 0 {
  8078. if haveMore != 0 && tok != m_XML_TOK_INVALID {
  8079. *(*uintptr)(unsafe.Pointer(nextPtr)) = s
  8080. return int32(_XML_ERROR_NONE)
  8081. }
  8082. switch tok {
  8083. case m_XML_TOK_INVALID:
  8084. *(*uintptr)(unsafe.Pointer(eventPP)) = *(*uintptr)(unsafe.Pointer(bp))
  8085. return int32(_XML_ERROR_INVALID_TOKEN)
  8086. case -int32(1):
  8087. return int32(_XML_ERROR_UNCLOSED_TOKEN)
  8088. case -int32(2):
  8089. return int32(_XML_ERROR_PARTIAL_CHAR)
  8090. case -int32(m_XML_TOK_PROLOG_S):
  8091. tok = -tok
  8092. case -int32(4):
  8093. /* for internal PE NOT referenced between declarations */
  8094. if enc != (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_encoding && !((*TOPEN_INTERNAL_ENTITY)(unsafe.Pointer((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_openInternalEntities)).FbetweenDecl != 0) {
  8095. *(*uintptr)(unsafe.Pointer(nextPtr)) = s
  8096. return int32(_XML_ERROR_NONE)
  8097. }
  8098. /* WFC: PE Between Declarations - must check that PE contains
  8099. complete markup, not only for external PEs, but also for
  8100. internal PEs if the reference occurs between declarations.
  8101. */
  8102. if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_isParamEntity != 0 || enc != (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_encoding {
  8103. if (*(*func(*libc.TLS, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*TPROLOG_STATE)(unsafe.Pointer(parser + 496)).Fhandler})))(tls, parser+496, -int32(4), end, end, enc) == int32(_XML_ROLE_ERROR) {
  8104. return int32(_XML_ERROR_INCOMPLETE_PE)
  8105. }
  8106. *(*uintptr)(unsafe.Pointer(nextPtr)) = s
  8107. return int32(_XML_ERROR_NONE)
  8108. }
  8109. return int32(_XML_ERROR_NO_ELEMENTS)
  8110. default:
  8111. tok = -tok
  8112. *(*uintptr)(unsafe.Pointer(bp)) = end
  8113. break
  8114. }
  8115. }
  8116. role = (*(*func(*libc.TLS, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*TPROLOG_STATE)(unsafe.Pointer(parser + 496)).Fhandler})))(tls, parser+496, tok, s, *(*uintptr)(unsafe.Pointer(bp)), enc)
  8117. switch role {
  8118. case int32(_XML_ROLE_INSTANCE_START): // bytes accounted in contentProcessor
  8119. fallthrough
  8120. case int32(_XML_ROLE_XML_DECL): // bytes accounted in processXmlDecl
  8121. fallthrough
  8122. case int32(_XML_ROLE_TEXT_DECL): // bytes accounted in processXmlDecl
  8123. default:
  8124. if !(_accountingDiffTolerated(tls, parser, tok, s, *(*uintptr)(unsafe.Pointer(bp)), int32(4717), account) != 0) {
  8125. _accountingOnAbort(tls, parser)
  8126. return int32(_XML_ERROR_AMPLIFICATION_LIMIT_BREACH)
  8127. }
  8128. }
  8129. switch role {
  8130. case int32(_XML_ROLE_XML_DECL):
  8131. goto _2
  8132. case int32(_XML_ROLE_DOCTYPE_NAME):
  8133. goto _3
  8134. case int32(_XML_ROLE_DOCTYPE_INTERNAL_SUBSET):
  8135. goto _4
  8136. case int32(_XML_ROLE_TEXT_DECL):
  8137. goto _5
  8138. case int32(_XML_ROLE_DOCTYPE_PUBLIC_ID):
  8139. goto _6
  8140. case int32(_XML_ROLE_ENTITY_PUBLIC_ID):
  8141. goto _7
  8142. case int32(_XML_ROLE_DOCTYPE_CLOSE):
  8143. goto _8
  8144. case int32(_XML_ROLE_INSTANCE_START):
  8145. goto _9
  8146. case int32(_XML_ROLE_ATTLIST_ELEMENT_NAME):
  8147. goto _10
  8148. case int32(_XML_ROLE_ATTRIBUTE_NAME):
  8149. goto _11
  8150. case int32(_XML_ROLE_ATTRIBUTE_TYPE_CDATA):
  8151. goto _12
  8152. case int32(_XML_ROLE_ATTRIBUTE_TYPE_ID):
  8153. goto _13
  8154. case int32(_XML_ROLE_ATTRIBUTE_TYPE_IDREF):
  8155. goto _14
  8156. case int32(_XML_ROLE_ATTRIBUTE_TYPE_IDREFS):
  8157. goto _15
  8158. case int32(_XML_ROLE_ATTRIBUTE_TYPE_ENTITY):
  8159. goto _16
  8160. case int32(_XML_ROLE_ATTRIBUTE_TYPE_ENTITIES):
  8161. goto _17
  8162. case int32(_XML_ROLE_ATTRIBUTE_TYPE_NMTOKEN):
  8163. goto _18
  8164. case int32(_XML_ROLE_ATTRIBUTE_TYPE_NMTOKENS):
  8165. goto _19
  8166. case int32(_XML_ROLE_ATTRIBUTE_NOTATION_VALUE):
  8167. goto _20
  8168. case int32(_XML_ROLE_ATTRIBUTE_ENUM_VALUE):
  8169. goto _21
  8170. case int32(_XML_ROLE_REQUIRED_ATTRIBUTE_VALUE):
  8171. goto _22
  8172. case int32(_XML_ROLE_IMPLIED_ATTRIBUTE_VALUE):
  8173. goto _23
  8174. case int32(_XML_ROLE_FIXED_ATTRIBUTE_VALUE):
  8175. goto _24
  8176. case int32(_XML_ROLE_DEFAULT_ATTRIBUTE_VALUE):
  8177. goto _25
  8178. case int32(_XML_ROLE_ENTITY_VALUE):
  8179. goto _26
  8180. case int32(_XML_ROLE_DOCTYPE_SYSTEM_ID):
  8181. goto _27
  8182. case int32(_XML_ROLE_ENTITY_SYSTEM_ID):
  8183. goto _28
  8184. case int32(_XML_ROLE_ENTITY_COMPLETE):
  8185. goto _29
  8186. case int32(_XML_ROLE_ENTITY_NOTATION_NAME):
  8187. goto _30
  8188. case int32(_XML_ROLE_GENERAL_ENTITY_NAME):
  8189. goto _31
  8190. case int32(_XML_ROLE_PARAM_ENTITY_NAME):
  8191. goto _32
  8192. case int32(_XML_ROLE_NOTATION_NAME):
  8193. goto _33
  8194. case int32(_XML_ROLE_NOTATION_PUBLIC_ID):
  8195. goto _34
  8196. case int32(_XML_ROLE_NOTATION_SYSTEM_ID):
  8197. goto _35
  8198. case int32(_XML_ROLE_NOTATION_NO_SYSTEM_ID):
  8199. goto _36
  8200. case int32(_XML_ROLE_ERROR):
  8201. goto _37
  8202. case int32(_XML_ROLE_IGNORE_SECT):
  8203. goto _38
  8204. case int32(_XML_ROLE_GROUP_OPEN):
  8205. goto _39
  8206. case int32(_XML_ROLE_GROUP_SEQUENCE):
  8207. goto _40
  8208. case int32(_XML_ROLE_GROUP_CHOICE):
  8209. goto _41
  8210. case int32(_XML_ROLE_INNER_PARAM_ENTITY_REF):
  8211. goto _42
  8212. case int32(_XML_ROLE_PARAM_ENTITY_REF):
  8213. goto _43
  8214. case int32(_XML_ROLE_ELEMENT_NAME):
  8215. goto _44
  8216. case int32(_XML_ROLE_CONTENT_EMPTY):
  8217. goto _45
  8218. case int32(_XML_ROLE_CONTENT_ANY):
  8219. goto _46
  8220. case int32(_XML_ROLE_CONTENT_PCDATA):
  8221. goto _47
  8222. case int32(_XML_ROLE_CONTENT_ELEMENT):
  8223. goto _48
  8224. case int32(_XML_ROLE_CONTENT_ELEMENT_OPT):
  8225. goto _49
  8226. case int32(_XML_ROLE_CONTENT_ELEMENT_REP):
  8227. goto _50
  8228. case int32(_XML_ROLE_CONTENT_ELEMENT_PLUS):
  8229. goto _51
  8230. case int32(_XML_ROLE_GROUP_CLOSE):
  8231. goto _52
  8232. case int32(_XML_ROLE_GROUP_CLOSE_OPT):
  8233. goto _53
  8234. case int32(_XML_ROLE_GROUP_CLOSE_REP):
  8235. goto _54
  8236. case int32(_XML_ROLE_GROUP_CLOSE_PLUS):
  8237. goto _55
  8238. case int32(_XML_ROLE_PI):
  8239. goto _56
  8240. case int32(_XML_ROLE_COMMENT):
  8241. goto _57
  8242. case int32(_XML_ROLE_NONE):
  8243. goto _58
  8244. case int32(_XML_ROLE_DOCTYPE_NONE):
  8245. goto _59
  8246. case int32(_XML_ROLE_ENTITY_NONE):
  8247. goto _60
  8248. case int32(_XML_ROLE_NOTATION_NONE):
  8249. goto _61
  8250. case int32(_XML_ROLE_ATTLIST_NONE):
  8251. goto _62
  8252. case int32(_XML_ROLE_ELEMENT_NONE):
  8253. goto _63
  8254. }
  8255. goto _64
  8256. _2:
  8257. ;
  8258. result = _processXmlDecl(tls, parser, 0, s, *(*uintptr)(unsafe.Pointer(bp)))
  8259. if result != int32(_XML_ERROR_NONE) {
  8260. return result
  8261. }
  8262. enc = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_encoding
  8263. handleDefault = libc.Uint8FromInt32(0)
  8264. goto _64
  8265. _3:
  8266. ;
  8267. if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_startDoctypeDeclHandler != 0 {
  8268. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_doctypeName = _poolStoreString(tls, parser+784, enc, s, *(*uintptr)(unsafe.Pointer(bp)))
  8269. if !((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_doctypeName != 0) {
  8270. return int32(_XML_ERROR_NO_MEMORY)
  8271. }
  8272. (*TSTRING_POOL)(unsafe.Pointer(parser + 784)).Fstart = (*TSTRING_POOL)(unsafe.Pointer(parser + 784)).Fptr
  8273. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_doctypePubid = libc.UintptrFromInt32(0)
  8274. handleDefault = libc.Uint8FromInt32(0)
  8275. }
  8276. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_doctypeSysid = libc.UintptrFromInt32(0) /* always initialize to NULL */
  8277. goto _64
  8278. _4:
  8279. ;
  8280. if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_startDoctypeDeclHandler != 0 {
  8281. (*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr, int32))(unsafe.Pointer(&struct{ uintptr }{(*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_startDoctypeDeclHandler})))(tls, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_handlerArg, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_doctypeName, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_doctypeSysid, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_doctypePubid, int32(1))
  8282. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_doctypeName = libc.UintptrFromInt32(0)
  8283. _poolClear(tls, parser+784)
  8284. handleDefault = libc.Uint8FromInt32(0)
  8285. }
  8286. goto _64
  8287. _5:
  8288. ;
  8289. result1 = _processXmlDecl(tls, parser, int32(1), s, *(*uintptr)(unsafe.Pointer(bp)))
  8290. if result1 != int32(_XML_ERROR_NONE) {
  8291. return result1
  8292. }
  8293. enc = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_encoding
  8294. handleDefault = libc.Uint8FromInt32(0)
  8295. goto _64
  8296. _6:
  8297. ;
  8298. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_useForeignDTD = libc.Uint8FromInt32(0)
  8299. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declEntity = _lookup(tls, parser, dtd+264, uintptr(unsafe.Pointer(&_externalSubsetName)), uint64(64))
  8300. if !((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declEntity != 0) {
  8301. return int32(_XML_ERROR_NO_MEMORY)
  8302. }
  8303. (*TDTD)(unsafe.Pointer(dtd)).FhasParamEntityRefs = libc.Uint8FromInt32(1)
  8304. if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_startDoctypeDeclHandler != 0 {
  8305. if !((*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*TENCODING)(unsafe.Pointer(enc)).FisPublicId})))(tls, enc, s, *(*uintptr)(unsafe.Pointer(bp)), eventPP) != 0) {
  8306. return int32(_XML_ERROR_PUBLICID)
  8307. }
  8308. pubId = _poolStoreString(tls, parser+784, enc, s+uintptr((*TENCODING)(unsafe.Pointer(enc)).FminBytesPerChar), *(*uintptr)(unsafe.Pointer(bp))-uintptr((*TENCODING)(unsafe.Pointer(enc)).FminBytesPerChar))
  8309. if !(pubId != 0) {
  8310. return int32(_XML_ERROR_NO_MEMORY)
  8311. }
  8312. _normalizePublicId(tls, pubId)
  8313. (*TSTRING_POOL)(unsafe.Pointer(parser + 784)).Fstart = (*TSTRING_POOL)(unsafe.Pointer(parser + 784)).Fptr
  8314. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_doctypePubid = pubId
  8315. handleDefault = libc.Uint8FromInt32(0)
  8316. goto alreadyChecked
  8317. }
  8318. /* fall through */
  8319. _7:
  8320. ;
  8321. if !((*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*TENCODING)(unsafe.Pointer(enc)).FisPublicId})))(tls, enc, s, *(*uintptr)(unsafe.Pointer(bp)), eventPP) != 0) {
  8322. return int32(_XML_ERROR_PUBLICID)
  8323. }
  8324. goto alreadyChecked
  8325. alreadyChecked:
  8326. ;
  8327. if (*TDTD)(unsafe.Pointer(dtd)).FkeepProcessing != 0 && (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declEntity != 0 {
  8328. tem = _poolStoreString(tls, dtd+160, enc, s+uintptr((*TENCODING)(unsafe.Pointer(enc)).FminBytesPerChar), *(*uintptr)(unsafe.Pointer(bp))-uintptr((*TENCODING)(unsafe.Pointer(enc)).FminBytesPerChar))
  8329. if !(tem != 0) {
  8330. return int32(_XML_ERROR_NO_MEMORY)
  8331. }
  8332. _normalizePublicId(tls, tem)
  8333. (*TENTITY)(unsafe.Pointer((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declEntity)).FpublicId = tem
  8334. (*TSTRING_POOL)(unsafe.Pointer(dtd + 160)).Fstart = (*TSTRING_POOL)(unsafe.Pointer(dtd + 160)).Fptr
  8335. /* Don't suppress the default handler if we fell through from
  8336. * the XML_ROLE_DOCTYPE_PUBLIC_ID case.
  8337. */
  8338. if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_entityDeclHandler != 0 && role == int32(_XML_ROLE_ENTITY_PUBLIC_ID) {
  8339. handleDefault = libc.Uint8FromInt32(0)
  8340. }
  8341. }
  8342. goto _64
  8343. _8:
  8344. ;
  8345. if libc.Int32FromUint8(allowClosingDoctype) != libc.Int32FromUint8(libc.Uint8FromInt32(1)) {
  8346. /* Must not close doctype from within expanded parameter entities */
  8347. return int32(_XML_ERROR_INVALID_TOKEN)
  8348. }
  8349. if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_doctypeName != 0 {
  8350. (*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr, int32))(unsafe.Pointer(&struct{ uintptr }{(*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_startDoctypeDeclHandler})))(tls, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_handlerArg, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_doctypeName, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_doctypeSysid, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_doctypePubid, 0)
  8351. _poolClear(tls, parser+784)
  8352. handleDefault = libc.Uint8FromInt32(0)
  8353. }
  8354. /* parser->m_doctypeSysid will be non-NULL in the case of a previous
  8355. XML_ROLE_DOCTYPE_SYSTEM_ID, even if parser->m_startDoctypeDeclHandler
  8356. was not set, indicating an external subset
  8357. */
  8358. if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_doctypeSysid != 0 || (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_useForeignDTD != 0 {
  8359. hadParamEntityRefs = (*TDTD)(unsafe.Pointer(dtd)).FhasParamEntityRefs
  8360. (*TDTD)(unsafe.Pointer(dtd)).FhasParamEntityRefs = libc.Uint8FromInt32(1)
  8361. if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_paramEntityParsing != 0 && (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_externalEntityRefHandler != 0 {
  8362. entity = _lookup(tls, parser, dtd+264, uintptr(unsafe.Pointer(&_externalSubsetName)), uint64(64))
  8363. if !(entity != 0) {
  8364. /* The external subset name "#" will have already been
  8365. * inserted into the hash table at the start of the
  8366. * external entity parsing, so no allocation will happen
  8367. * and lookup() cannot fail.
  8368. */
  8369. return int32(_XML_ERROR_NO_MEMORY) /* LCOV_EXCL_LINE */
  8370. }
  8371. if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_useForeignDTD != 0 {
  8372. (*TENTITY)(unsafe.Pointer(entity)).Fbase = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_curBase
  8373. }
  8374. (*TDTD)(unsafe.Pointer(dtd)).FparamEntityRead = libc.Uint8FromInt32(0)
  8375. if !((*(*func(*libc.TLS, TXML_Parser, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_externalEntityRefHandler})))(tls, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_externalEntityRefHandlerArg, uintptr(0), (*TENTITY)(unsafe.Pointer(entity)).Fbase, (*TENTITY)(unsafe.Pointer(entity)).FsystemId, (*TENTITY)(unsafe.Pointer(entity)).FpublicId) != 0) {
  8376. return int32(_XML_ERROR_EXTERNAL_ENTITY_HANDLING)
  8377. }
  8378. if (*TDTD)(unsafe.Pointer(dtd)).FparamEntityRead != 0 {
  8379. if !((*TDTD)(unsafe.Pointer(dtd)).Fstandalone != 0) && (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_notStandaloneHandler != 0 && !((*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_notStandaloneHandler})))(tls, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_handlerArg) != 0) {
  8380. return int32(_XML_ERROR_NOT_STANDALONE)
  8381. }
  8382. } else {
  8383. if !((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_doctypeSysid != 0) {
  8384. (*TDTD)(unsafe.Pointer(dtd)).FhasParamEntityRefs = hadParamEntityRefs
  8385. }
  8386. }
  8387. /* end of DTD - no need to update dtd->keepProcessing */
  8388. }
  8389. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_useForeignDTD = libc.Uint8FromInt32(0)
  8390. }
  8391. if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_endDoctypeDeclHandler != 0 {
  8392. (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_endDoctypeDeclHandler})))(tls, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_handlerArg)
  8393. handleDefault = libc.Uint8FromInt32(0)
  8394. }
  8395. goto _64
  8396. _9:
  8397. ;
  8398. /* if there is no DOCTYPE declaration then now is the
  8399. last chance to read the foreign DTD
  8400. */
  8401. if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_useForeignDTD != 0 {
  8402. hadParamEntityRefs1 = (*TDTD)(unsafe.Pointer(dtd)).FhasParamEntityRefs
  8403. (*TDTD)(unsafe.Pointer(dtd)).FhasParamEntityRefs = libc.Uint8FromInt32(1)
  8404. if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_paramEntityParsing != 0 && (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_externalEntityRefHandler != 0 {
  8405. entity1 = _lookup(tls, parser, dtd+264, uintptr(unsafe.Pointer(&_externalSubsetName)), uint64(64))
  8406. if !(entity1 != 0) {
  8407. return int32(_XML_ERROR_NO_MEMORY)
  8408. }
  8409. (*TENTITY)(unsafe.Pointer(entity1)).Fbase = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_curBase
  8410. (*TDTD)(unsafe.Pointer(dtd)).FparamEntityRead = libc.Uint8FromInt32(0)
  8411. if !((*(*func(*libc.TLS, TXML_Parser, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_externalEntityRefHandler})))(tls, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_externalEntityRefHandlerArg, uintptr(0), (*TENTITY)(unsafe.Pointer(entity1)).Fbase, (*TENTITY)(unsafe.Pointer(entity1)).FsystemId, (*TENTITY)(unsafe.Pointer(entity1)).FpublicId) != 0) {
  8412. return int32(_XML_ERROR_EXTERNAL_ENTITY_HANDLING)
  8413. }
  8414. if (*TDTD)(unsafe.Pointer(dtd)).FparamEntityRead != 0 {
  8415. if !((*TDTD)(unsafe.Pointer(dtd)).Fstandalone != 0) && (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_notStandaloneHandler != 0 && !((*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_notStandaloneHandler})))(tls, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_handlerArg) != 0) {
  8416. return int32(_XML_ERROR_NOT_STANDALONE)
  8417. }
  8418. } else {
  8419. (*TDTD)(unsafe.Pointer(dtd)).FhasParamEntityRefs = hadParamEntityRefs1
  8420. }
  8421. /* end of DTD - no need to update dtd->keepProcessing */
  8422. }
  8423. }
  8424. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_processor = __ccgo_fp(_contentProcessor)
  8425. return _contentProcessor(tls, parser, s, end, nextPtr)
  8426. _10:
  8427. ;
  8428. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declElementType = _getElementType(tls, parser, enc, s, *(*uintptr)(unsafe.Pointer(bp)))
  8429. if !((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declElementType != 0) {
  8430. return int32(_XML_ERROR_NO_MEMORY)
  8431. }
  8432. goto checkAttListDeclHandler
  8433. _11:
  8434. ;
  8435. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declAttributeId = _getAttributeId(tls, parser, enc, s, *(*uintptr)(unsafe.Pointer(bp)))
  8436. if !((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declAttributeId != 0) {
  8437. return int32(_XML_ERROR_NO_MEMORY)
  8438. }
  8439. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declAttributeIsCdata = libc.Uint8FromInt32(0)
  8440. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declAttributeType = libc.UintptrFromInt32(0)
  8441. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declAttributeIsId = libc.Uint8FromInt32(0)
  8442. goto checkAttListDeclHandler
  8443. _12:
  8444. ;
  8445. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declAttributeIsCdata = libc.Uint8FromInt32(1)
  8446. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declAttributeType = uintptr(unsafe.Pointer(&_atypeCDATA))
  8447. goto checkAttListDeclHandler
  8448. _13:
  8449. ;
  8450. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declAttributeIsId = libc.Uint8FromInt32(1)
  8451. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declAttributeType = uintptr(unsafe.Pointer(&_atypeID))
  8452. goto checkAttListDeclHandler
  8453. _14:
  8454. ;
  8455. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declAttributeType = uintptr(unsafe.Pointer(&_atypeIDREF))
  8456. goto checkAttListDeclHandler
  8457. _15:
  8458. ;
  8459. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declAttributeType = uintptr(unsafe.Pointer(&_atypeIDREFS))
  8460. goto checkAttListDeclHandler
  8461. _16:
  8462. ;
  8463. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declAttributeType = uintptr(unsafe.Pointer(&_atypeENTITY))
  8464. goto checkAttListDeclHandler
  8465. _17:
  8466. ;
  8467. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declAttributeType = uintptr(unsafe.Pointer(&_atypeENTITIES))
  8468. goto checkAttListDeclHandler
  8469. _18:
  8470. ;
  8471. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declAttributeType = uintptr(unsafe.Pointer(&_atypeNMTOKEN))
  8472. goto checkAttListDeclHandler
  8473. _19:
  8474. ;
  8475. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declAttributeType = uintptr(unsafe.Pointer(&_atypeNMTOKENS))
  8476. goto checkAttListDeclHandler
  8477. checkAttListDeclHandler:
  8478. ;
  8479. if (*TDTD)(unsafe.Pointer(dtd)).FkeepProcessing != 0 && (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_attlistDeclHandler != 0 {
  8480. handleDefault = libc.Uint8FromInt32(0)
  8481. }
  8482. goto _64
  8483. _21:
  8484. ;
  8485. _20:
  8486. ;
  8487. if (*TDTD)(unsafe.Pointer(dtd)).FkeepProcessing != 0 && (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_attlistDeclHandler != 0 {
  8488. if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declAttributeType != 0 {
  8489. prefix = uintptr(unsafe.Pointer(&_enumValueSep))
  8490. } else {
  8491. if role == int32(_XML_ROLE_ATTRIBUTE_NOTATION_VALUE) {
  8492. v65 = uintptr(unsafe.Pointer(&_notationPrefix))
  8493. } else {
  8494. v65 = uintptr(unsafe.Pointer(&_enumValueStart))
  8495. }
  8496. prefix = v65
  8497. }
  8498. if !(_poolAppendString(tls, parser+784, prefix) != 0) {
  8499. return int32(_XML_ERROR_NO_MEMORY)
  8500. }
  8501. if !(_poolAppend(tls, parser+784, enc, s, *(*uintptr)(unsafe.Pointer(bp))) != 0) {
  8502. return int32(_XML_ERROR_NO_MEMORY)
  8503. }
  8504. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declAttributeType = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_tempPool.Fstart
  8505. handleDefault = libc.Uint8FromInt32(0)
  8506. }
  8507. goto _64
  8508. _23:
  8509. ;
  8510. _22:
  8511. ;
  8512. if (*TDTD)(unsafe.Pointer(dtd)).FkeepProcessing != 0 {
  8513. if !(_defineAttribute(tls, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declElementType, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declAttributeId, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declAttributeIsCdata, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declAttributeIsId, uintptr(0), parser) != 0) {
  8514. return int32(_XML_ERROR_NO_MEMORY)
  8515. }
  8516. if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_attlistDeclHandler != 0 && (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declAttributeType != 0 {
  8517. if int32(*(*TXML_Char)(unsafe.Pointer((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declAttributeType))) == int32(m_ASCII_LPAREN) || int32(*(*TXML_Char)(unsafe.Pointer((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declAttributeType))) == int32(m_ASCII_N) && int32(*(*TXML_Char)(unsafe.Pointer((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declAttributeType + 1))) == int32(m_ASCII_O) {
  8518. /* Enumerated or Notation type */
  8519. if (*TSTRING_POOL)(unsafe.Pointer(parser+784)).Fptr == (*TSTRING_POOL)(unsafe.Pointer(parser+784)).Fend && !(_poolGrow(tls, parser+784) != 0) {
  8520. v66 = 0
  8521. } else {
  8522. v68 = parser + 784 + 24
  8523. v67 = *(*uintptr)(unsafe.Pointer(v68))
  8524. *(*uintptr)(unsafe.Pointer(v68))++
  8525. *(*TXML_Char)(unsafe.Pointer(v67)) = int8(m_ASCII_RPAREN)
  8526. v66 = libc.Int32FromInt32(1)
  8527. }
  8528. if v72 = !(v66 != 0); !v72 {
  8529. if (*TSTRING_POOL)(unsafe.Pointer(parser+784)).Fptr == (*TSTRING_POOL)(unsafe.Pointer(parser+784)).Fend && !(_poolGrow(tls, parser+784) != 0) {
  8530. v69 = 0
  8531. } else {
  8532. v71 = parser + 784 + 24
  8533. v70 = *(*uintptr)(unsafe.Pointer(v71))
  8534. *(*uintptr)(unsafe.Pointer(v71))++
  8535. *(*TXML_Char)(unsafe.Pointer(v70)) = int8('\000')
  8536. v69 = libc.Int32FromInt32(1)
  8537. }
  8538. }
  8539. if v72 || !(v69 != 0) {
  8540. return int32(_XML_ERROR_NO_MEMORY)
  8541. }
  8542. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declAttributeType = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_tempPool.Fstart
  8543. (*TSTRING_POOL)(unsafe.Pointer(parser + 784)).Fstart = (*TSTRING_POOL)(unsafe.Pointer(parser + 784)).Fptr
  8544. }
  8545. *(*uintptr)(unsafe.Pointer(eventEndPP)) = s
  8546. (*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr, uintptr, int32))(unsafe.Pointer(&struct{ uintptr }{(*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_attlistDeclHandler})))(tls, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_handlerArg, (*TELEMENT_TYPE)(unsafe.Pointer((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declElementType)).Fname, (*TATTRIBUTE_ID)(unsafe.Pointer((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declAttributeId)).Fname, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declAttributeType, uintptr(0), libc.BoolInt32(role == int32(_XML_ROLE_REQUIRED_ATTRIBUTE_VALUE)))
  8547. handleDefault = libc.Uint8FromInt32(0)
  8548. }
  8549. }
  8550. _poolClear(tls, parser+784)
  8551. goto _64
  8552. _25:
  8553. ;
  8554. _24:
  8555. ;
  8556. if (*TDTD)(unsafe.Pointer(dtd)).FkeepProcessing != 0 {
  8557. result2 = _storeAttributeValue(tls, parser, enc, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declAttributeIsCdata, s+uintptr((*TENCODING)(unsafe.Pointer(enc)).FminBytesPerChar), *(*uintptr)(unsafe.Pointer(bp))-uintptr((*TENCODING)(unsafe.Pointer(enc)).FminBytesPerChar), dtd+160, int32(_XML_ACCOUNT_NONE))
  8558. if result2 != 0 {
  8559. return result2
  8560. }
  8561. attVal = (*TSTRING_POOL)(unsafe.Pointer(dtd + 160)).Fstart
  8562. (*TSTRING_POOL)(unsafe.Pointer(dtd + 160)).Fstart = (*TSTRING_POOL)(unsafe.Pointer(dtd + 160)).Fptr
  8563. /* ID attributes aren't allowed to have a default */
  8564. if !(_defineAttribute(tls, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declElementType, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declAttributeId, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declAttributeIsCdata, libc.Uint8FromInt32(0), attVal, parser) != 0) {
  8565. return int32(_XML_ERROR_NO_MEMORY)
  8566. }
  8567. if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_attlistDeclHandler != 0 && (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declAttributeType != 0 {
  8568. if int32(*(*TXML_Char)(unsafe.Pointer((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declAttributeType))) == int32(m_ASCII_LPAREN) || int32(*(*TXML_Char)(unsafe.Pointer((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declAttributeType))) == int32(m_ASCII_N) && int32(*(*TXML_Char)(unsafe.Pointer((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declAttributeType + 1))) == int32(m_ASCII_O) {
  8569. /* Enumerated or Notation type */
  8570. if (*TSTRING_POOL)(unsafe.Pointer(parser+784)).Fptr == (*TSTRING_POOL)(unsafe.Pointer(parser+784)).Fend && !(_poolGrow(tls, parser+784) != 0) {
  8571. v73 = 0
  8572. } else {
  8573. v75 = parser + 784 + 24
  8574. v74 = *(*uintptr)(unsafe.Pointer(v75))
  8575. *(*uintptr)(unsafe.Pointer(v75))++
  8576. *(*TXML_Char)(unsafe.Pointer(v74)) = int8(m_ASCII_RPAREN)
  8577. v73 = libc.Int32FromInt32(1)
  8578. }
  8579. if v79 = !(v73 != 0); !v79 {
  8580. if (*TSTRING_POOL)(unsafe.Pointer(parser+784)).Fptr == (*TSTRING_POOL)(unsafe.Pointer(parser+784)).Fend && !(_poolGrow(tls, parser+784) != 0) {
  8581. v76 = 0
  8582. } else {
  8583. v78 = parser + 784 + 24
  8584. v77 = *(*uintptr)(unsafe.Pointer(v78))
  8585. *(*uintptr)(unsafe.Pointer(v78))++
  8586. *(*TXML_Char)(unsafe.Pointer(v77)) = int8('\000')
  8587. v76 = libc.Int32FromInt32(1)
  8588. }
  8589. }
  8590. if v79 || !(v76 != 0) {
  8591. return int32(_XML_ERROR_NO_MEMORY)
  8592. }
  8593. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declAttributeType = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_tempPool.Fstart
  8594. (*TSTRING_POOL)(unsafe.Pointer(parser + 784)).Fstart = (*TSTRING_POOL)(unsafe.Pointer(parser + 784)).Fptr
  8595. }
  8596. *(*uintptr)(unsafe.Pointer(eventEndPP)) = s
  8597. (*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr, uintptr, int32))(unsafe.Pointer(&struct{ uintptr }{(*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_attlistDeclHandler})))(tls, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_handlerArg, (*TELEMENT_TYPE)(unsafe.Pointer((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declElementType)).Fname, (*TATTRIBUTE_ID)(unsafe.Pointer((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declAttributeId)).Fname, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declAttributeType, attVal, libc.BoolInt32(role == int32(_XML_ROLE_FIXED_ATTRIBUTE_VALUE)))
  8598. _poolClear(tls, parser+784)
  8599. handleDefault = libc.Uint8FromInt32(0)
  8600. }
  8601. }
  8602. goto _64
  8603. _26:
  8604. ;
  8605. if (*TDTD)(unsafe.Pointer(dtd)).FkeepProcessing != 0 {
  8606. result3 = _storeEntityValue(tls, parser, enc, s+uintptr((*TENCODING)(unsafe.Pointer(enc)).FminBytesPerChar), *(*uintptr)(unsafe.Pointer(bp))-uintptr((*TENCODING)(unsafe.Pointer(enc)).FminBytesPerChar), int32(_XML_ACCOUNT_NONE))
  8607. if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declEntity != 0 {
  8608. (*TENTITY)(unsafe.Pointer((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declEntity)).FtextPtr = (*TSTRING_POOL)(unsafe.Pointer(dtd + 208)).Fstart
  8609. (*TENTITY)(unsafe.Pointer((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declEntity)).FtextLen = int32(int64((*TSTRING_POOL)(unsafe.Pointer(dtd+208)).Fptr) - int64((*TSTRING_POOL)(unsafe.Pointer(dtd+208)).Fstart))
  8610. (*TSTRING_POOL)(unsafe.Pointer(dtd + 208)).Fstart = (*TSTRING_POOL)(unsafe.Pointer(dtd + 208)).Fptr
  8611. if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_entityDeclHandler != 0 {
  8612. *(*uintptr)(unsafe.Pointer(eventEndPP)) = s
  8613. (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, int32, uintptr, uintptr, uintptr, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_entityDeclHandler})))(tls, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_handlerArg, (*TENTITY)(unsafe.Pointer((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declEntity)).Fname, libc.Int32FromUint8((*TENTITY)(unsafe.Pointer((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declEntity)).Fis_param), (*TENTITY)(unsafe.Pointer((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declEntity)).FtextPtr, (*TENTITY)(unsafe.Pointer((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declEntity)).FtextLen, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_curBase, uintptr(0), uintptr(0), uintptr(0))
  8614. handleDefault = libc.Uint8FromInt32(0)
  8615. }
  8616. } else {
  8617. (*TSTRING_POOL)(unsafe.Pointer(dtd + 208)).Fptr = (*TSTRING_POOL)(unsafe.Pointer(dtd + 208)).Fstart
  8618. }
  8619. if result3 != int32(_XML_ERROR_NONE) {
  8620. return result3
  8621. }
  8622. }
  8623. goto _64
  8624. _27:
  8625. ;
  8626. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_useForeignDTD = libc.Uint8FromInt32(0)
  8627. (*TDTD)(unsafe.Pointer(dtd)).FhasParamEntityRefs = libc.Uint8FromInt32(1)
  8628. if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_startDoctypeDeclHandler != 0 {
  8629. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_doctypeSysid = _poolStoreString(tls, parser+784, enc, s+uintptr((*TENCODING)(unsafe.Pointer(enc)).FminBytesPerChar), *(*uintptr)(unsafe.Pointer(bp))-uintptr((*TENCODING)(unsafe.Pointer(enc)).FminBytesPerChar))
  8630. if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_doctypeSysid == libc.UintptrFromInt32(0) {
  8631. return int32(_XML_ERROR_NO_MEMORY)
  8632. }
  8633. (*TSTRING_POOL)(unsafe.Pointer(parser + 784)).Fstart = (*TSTRING_POOL)(unsafe.Pointer(parser + 784)).Fptr
  8634. handleDefault = libc.Uint8FromInt32(0)
  8635. } else {
  8636. /* use externalSubsetName to make parser->m_doctypeSysid non-NULL
  8637. for the case where no parser->m_startDoctypeDeclHandler is set */
  8638. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_doctypeSysid = uintptr(unsafe.Pointer(&_externalSubsetName))
  8639. }
  8640. if !((*TDTD)(unsafe.Pointer(dtd)).Fstandalone != 0) && !((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_paramEntityParsing != 0) && (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_notStandaloneHandler != 0 && !((*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_notStandaloneHandler})))(tls, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_handlerArg) != 0) {
  8641. return int32(_XML_ERROR_NOT_STANDALONE)
  8642. }
  8643. if !((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declEntity != 0) {
  8644. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declEntity = _lookup(tls, parser, dtd+264, uintptr(unsafe.Pointer(&_externalSubsetName)), uint64(64))
  8645. if !((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declEntity != 0) {
  8646. return int32(_XML_ERROR_NO_MEMORY)
  8647. }
  8648. (*TENTITY)(unsafe.Pointer((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declEntity)).FpublicId = libc.UintptrFromInt32(0)
  8649. }
  8650. /* fall through */
  8651. _28:
  8652. ;
  8653. if (*TDTD)(unsafe.Pointer(dtd)).FkeepProcessing != 0 && (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declEntity != 0 {
  8654. (*TENTITY)(unsafe.Pointer((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declEntity)).FsystemId = _poolStoreString(tls, dtd+160, enc, s+uintptr((*TENCODING)(unsafe.Pointer(enc)).FminBytesPerChar), *(*uintptr)(unsafe.Pointer(bp))-uintptr((*TENCODING)(unsafe.Pointer(enc)).FminBytesPerChar))
  8655. if !((*TENTITY)(unsafe.Pointer((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declEntity)).FsystemId != 0) {
  8656. return int32(_XML_ERROR_NO_MEMORY)
  8657. }
  8658. (*TENTITY)(unsafe.Pointer((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declEntity)).Fbase = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_curBase
  8659. (*TSTRING_POOL)(unsafe.Pointer(dtd + 160)).Fstart = (*TSTRING_POOL)(unsafe.Pointer(dtd + 160)).Fptr
  8660. /* Don't suppress the default handler if we fell through from
  8661. * the XML_ROLE_DOCTYPE_SYSTEM_ID case.
  8662. */
  8663. if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_entityDeclHandler != 0 && role == int32(_XML_ROLE_ENTITY_SYSTEM_ID) {
  8664. handleDefault = libc.Uint8FromInt32(0)
  8665. }
  8666. }
  8667. goto _64
  8668. _29:
  8669. ;
  8670. if (*TDTD)(unsafe.Pointer(dtd)).FkeepProcessing != 0 && (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declEntity != 0 && (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_entityDeclHandler != 0 {
  8671. *(*uintptr)(unsafe.Pointer(eventEndPP)) = s
  8672. (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, int32, uintptr, uintptr, uintptr, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_entityDeclHandler})))(tls, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_handlerArg, (*TENTITY)(unsafe.Pointer((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declEntity)).Fname, libc.Int32FromUint8((*TENTITY)(unsafe.Pointer((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declEntity)).Fis_param), uintptr(0), 0, (*TENTITY)(unsafe.Pointer((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declEntity)).Fbase, (*TENTITY)(unsafe.Pointer((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declEntity)).FsystemId, (*TENTITY)(unsafe.Pointer((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declEntity)).FpublicId, uintptr(0))
  8673. handleDefault = libc.Uint8FromInt32(0)
  8674. }
  8675. goto _64
  8676. _30:
  8677. ;
  8678. if (*TDTD)(unsafe.Pointer(dtd)).FkeepProcessing != 0 && (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declEntity != 0 {
  8679. (*TENTITY)(unsafe.Pointer((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declEntity)).Fnotation = _poolStoreString(tls, dtd+160, enc, s, *(*uintptr)(unsafe.Pointer(bp)))
  8680. if !((*TENTITY)(unsafe.Pointer((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declEntity)).Fnotation != 0) {
  8681. return int32(_XML_ERROR_NO_MEMORY)
  8682. }
  8683. (*TSTRING_POOL)(unsafe.Pointer(dtd + 160)).Fstart = (*TSTRING_POOL)(unsafe.Pointer(dtd + 160)).Fptr
  8684. if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_unparsedEntityDeclHandler != 0 {
  8685. *(*uintptr)(unsafe.Pointer(eventEndPP)) = s
  8686. (*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_unparsedEntityDeclHandler})))(tls, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_handlerArg, (*TENTITY)(unsafe.Pointer((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declEntity)).Fname, (*TENTITY)(unsafe.Pointer((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declEntity)).Fbase, (*TENTITY)(unsafe.Pointer((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declEntity)).FsystemId, (*TENTITY)(unsafe.Pointer((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declEntity)).FpublicId, (*TENTITY)(unsafe.Pointer((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declEntity)).Fnotation)
  8687. handleDefault = libc.Uint8FromInt32(0)
  8688. } else {
  8689. if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_entityDeclHandler != 0 {
  8690. *(*uintptr)(unsafe.Pointer(eventEndPP)) = s
  8691. (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, int32, uintptr, uintptr, uintptr, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_entityDeclHandler})))(tls, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_handlerArg, (*TENTITY)(unsafe.Pointer((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declEntity)).Fname, 0, uintptr(0), 0, (*TENTITY)(unsafe.Pointer((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declEntity)).Fbase, (*TENTITY)(unsafe.Pointer((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declEntity)).FsystemId, (*TENTITY)(unsafe.Pointer((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declEntity)).FpublicId, (*TENTITY)(unsafe.Pointer((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declEntity)).Fnotation)
  8692. handleDefault = libc.Uint8FromInt32(0)
  8693. }
  8694. }
  8695. }
  8696. goto _64
  8697. _31:
  8698. ;
  8699. if (*(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*TENCODING)(unsafe.Pointer(enc)).FpredefinedEntityName})))(tls, enc, s, *(*uintptr)(unsafe.Pointer(bp))) != 0 {
  8700. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declEntity = libc.UintptrFromInt32(0)
  8701. goto _64
  8702. }
  8703. if (*TDTD)(unsafe.Pointer(dtd)).FkeepProcessing != 0 {
  8704. name = _poolStoreString(tls, dtd+160, enc, s, *(*uintptr)(unsafe.Pointer(bp)))
  8705. if !(name != 0) {
  8706. return int32(_XML_ERROR_NO_MEMORY)
  8707. }
  8708. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declEntity = _lookup(tls, parser, dtd, name, uint64(64))
  8709. if !((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declEntity != 0) {
  8710. return int32(_XML_ERROR_NO_MEMORY)
  8711. }
  8712. if (*TENTITY)(unsafe.Pointer((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declEntity)).Fname != name {
  8713. (*TSTRING_POOL)(unsafe.Pointer(dtd + 160)).Fptr = (*TSTRING_POOL)(unsafe.Pointer(dtd + 160)).Fstart
  8714. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declEntity = libc.UintptrFromInt32(0)
  8715. } else {
  8716. (*TSTRING_POOL)(unsafe.Pointer(dtd + 160)).Fstart = (*TSTRING_POOL)(unsafe.Pointer(dtd + 160)).Fptr
  8717. (*TENTITY)(unsafe.Pointer((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declEntity)).FpublicId = libc.UintptrFromInt32(0)
  8718. (*TENTITY)(unsafe.Pointer((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declEntity)).Fis_param = libc.Uint8FromInt32(0)
  8719. /* if we have a parent parser or are reading an internal parameter
  8720. entity, then the entity declaration is not considered "internal"
  8721. */
  8722. (*TENTITY)(unsafe.Pointer((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declEntity)).Fis_internal = libc.BoolUint8(!((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parentParser != 0 || (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_openInternalEntities != 0))
  8723. if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_entityDeclHandler != 0 {
  8724. handleDefault = libc.Uint8FromInt32(0)
  8725. }
  8726. }
  8727. } else {
  8728. (*TSTRING_POOL)(unsafe.Pointer(dtd + 160)).Fptr = (*TSTRING_POOL)(unsafe.Pointer(dtd + 160)).Fstart
  8729. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declEntity = libc.UintptrFromInt32(0)
  8730. }
  8731. goto _64
  8732. _32:
  8733. ;
  8734. if (*TDTD)(unsafe.Pointer(dtd)).FkeepProcessing != 0 {
  8735. name1 = _poolStoreString(tls, dtd+160, enc, s, *(*uintptr)(unsafe.Pointer(bp)))
  8736. if !(name1 != 0) {
  8737. return int32(_XML_ERROR_NO_MEMORY)
  8738. }
  8739. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declEntity = _lookup(tls, parser, dtd+264, name1, uint64(64))
  8740. if !((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declEntity != 0) {
  8741. return int32(_XML_ERROR_NO_MEMORY)
  8742. }
  8743. if (*TENTITY)(unsafe.Pointer((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declEntity)).Fname != name1 {
  8744. (*TSTRING_POOL)(unsafe.Pointer(dtd + 160)).Fptr = (*TSTRING_POOL)(unsafe.Pointer(dtd + 160)).Fstart
  8745. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declEntity = libc.UintptrFromInt32(0)
  8746. } else {
  8747. (*TSTRING_POOL)(unsafe.Pointer(dtd + 160)).Fstart = (*TSTRING_POOL)(unsafe.Pointer(dtd + 160)).Fptr
  8748. (*TENTITY)(unsafe.Pointer((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declEntity)).FpublicId = libc.UintptrFromInt32(0)
  8749. (*TENTITY)(unsafe.Pointer((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declEntity)).Fis_param = libc.Uint8FromInt32(1)
  8750. /* if we have a parent parser or are reading an internal parameter
  8751. entity, then the entity declaration is not considered "internal"
  8752. */
  8753. (*TENTITY)(unsafe.Pointer((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declEntity)).Fis_internal = libc.BoolUint8(!((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parentParser != 0 || (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_openInternalEntities != 0))
  8754. if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_entityDeclHandler != 0 {
  8755. handleDefault = libc.Uint8FromInt32(0)
  8756. }
  8757. }
  8758. } else {
  8759. (*TSTRING_POOL)(unsafe.Pointer(dtd + 160)).Fptr = (*TSTRING_POOL)(unsafe.Pointer(dtd + 160)).Fstart
  8760. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declEntity = libc.UintptrFromInt32(0)
  8761. }
  8762. goto _64
  8763. _33:
  8764. ;
  8765. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declNotationPublicId = libc.UintptrFromInt32(0)
  8766. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declNotationName = libc.UintptrFromInt32(0)
  8767. if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_notationDeclHandler != 0 {
  8768. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declNotationName = _poolStoreString(tls, parser+784, enc, s, *(*uintptr)(unsafe.Pointer(bp)))
  8769. if !((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declNotationName != 0) {
  8770. return int32(_XML_ERROR_NO_MEMORY)
  8771. }
  8772. (*TSTRING_POOL)(unsafe.Pointer(parser + 784)).Fstart = (*TSTRING_POOL)(unsafe.Pointer(parser + 784)).Fptr
  8773. handleDefault = libc.Uint8FromInt32(0)
  8774. }
  8775. goto _64
  8776. _34:
  8777. ;
  8778. if !((*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*TENCODING)(unsafe.Pointer(enc)).FisPublicId})))(tls, enc, s, *(*uintptr)(unsafe.Pointer(bp)), eventPP) != 0) {
  8779. return int32(_XML_ERROR_PUBLICID)
  8780. }
  8781. if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declNotationName != 0 { /* means m_notationDeclHandler != NULL */
  8782. tem1 = _poolStoreString(tls, parser+784, enc, s+uintptr((*TENCODING)(unsafe.Pointer(enc)).FminBytesPerChar), *(*uintptr)(unsafe.Pointer(bp))-uintptr((*TENCODING)(unsafe.Pointer(enc)).FminBytesPerChar))
  8783. if !(tem1 != 0) {
  8784. return int32(_XML_ERROR_NO_MEMORY)
  8785. }
  8786. _normalizePublicId(tls, tem1)
  8787. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declNotationPublicId = tem1
  8788. (*TSTRING_POOL)(unsafe.Pointer(parser + 784)).Fstart = (*TSTRING_POOL)(unsafe.Pointer(parser + 784)).Fptr
  8789. handleDefault = libc.Uint8FromInt32(0)
  8790. }
  8791. goto _64
  8792. _35:
  8793. ;
  8794. if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declNotationName != 0 && (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_notationDeclHandler != 0 {
  8795. systemId = _poolStoreString(tls, parser+784, enc, s+uintptr((*TENCODING)(unsafe.Pointer(enc)).FminBytesPerChar), *(*uintptr)(unsafe.Pointer(bp))-uintptr((*TENCODING)(unsafe.Pointer(enc)).FminBytesPerChar))
  8796. if !(systemId != 0) {
  8797. return int32(_XML_ERROR_NO_MEMORY)
  8798. }
  8799. *(*uintptr)(unsafe.Pointer(eventEndPP)) = s
  8800. (*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_notationDeclHandler})))(tls, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_handlerArg, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declNotationName, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_curBase, systemId, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declNotationPublicId)
  8801. handleDefault = libc.Uint8FromInt32(0)
  8802. }
  8803. _poolClear(tls, parser+784)
  8804. goto _64
  8805. _36:
  8806. ;
  8807. if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declNotationPublicId != 0 && (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_notationDeclHandler != 0 {
  8808. *(*uintptr)(unsafe.Pointer(eventEndPP)) = s
  8809. (*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_notationDeclHandler})))(tls, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_handlerArg, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declNotationName, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_curBase, uintptr(0), (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declNotationPublicId)
  8810. handleDefault = libc.Uint8FromInt32(0)
  8811. }
  8812. _poolClear(tls, parser+784)
  8813. goto _64
  8814. _37:
  8815. ;
  8816. switch tok {
  8817. case int32(m_XML_TOK_PARAM_ENTITY_REF):
  8818. /* PE references in internal subset are
  8819. not allowed within declarations. */
  8820. return int32(_XML_ERROR_PARAM_ENTITY_REF)
  8821. case int32(m_XML_TOK_XML_DECL):
  8822. return int32(_XML_ERROR_MISPLACED_XML_PI)
  8823. default:
  8824. return int32(_XML_ERROR_SYNTAX)
  8825. }
  8826. _38:
  8827. ;
  8828. if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_defaultHandler != 0 {
  8829. _reportDefault(tls, parser, enc, s, *(*uintptr)(unsafe.Pointer(bp)))
  8830. }
  8831. handleDefault = libc.Uint8FromInt32(0)
  8832. result4 = _doIgnoreSection(tls, parser, enc, bp, end, nextPtr, haveMore)
  8833. if result4 != int32(_XML_ERROR_NONE) {
  8834. return result4
  8835. } else {
  8836. if !(*(*uintptr)(unsafe.Pointer(bp)) != 0) {
  8837. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_processor = __ccgo_fp(_ignoreSectionProcessor)
  8838. return result4
  8839. }
  8840. }
  8841. goto _64
  8842. _39:
  8843. ;
  8844. if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_prologState.Flevel >= (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_groupSize {
  8845. if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_groupSize != 0 {
  8846. /* Detect and prevent integer overflow */
  8847. if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_groupSize > libc.Uint32FromInt32(-libc.Int32FromInt32(1))/libc.Uint32FromUint32(2) {
  8848. return int32(_XML_ERROR_NO_MEMORY)
  8849. }
  8850. p80 = parser + 888
  8851. *(*uint32)(unsafe.Pointer(p80)) *= uint32(2)
  8852. new_connector = (*(*func(*libc.TLS, uintptr, Tsize_t) uintptr)(unsafe.Pointer(&struct{ uintptr }{(*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_mem.Frealloc_fcn})))(tls, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_groupConnector, uint64(*(*uint32)(unsafe.Pointer(p80))))
  8853. if new_connector == libc.UintptrFromInt32(0) {
  8854. *(*uint32)(unsafe.Pointer(parser + 888)) /= uint32(2)
  8855. return int32(_XML_ERROR_NO_MEMORY)
  8856. }
  8857. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_groupConnector = new_connector
  8858. if (*TDTD)(unsafe.Pointer(dtd)).FscaffIndex != 0 {
  8859. /* Detect and prevent integer overflow.
  8860. * The preprocessor guard addresses the "always false" warning
  8861. * from -Wtype-limits on platforms where
  8862. * sizeof(unsigned int) < sizeof(size_t), e.g. on x86_64. */
  8863. new_scaff_index = (*(*func(*libc.TLS, uintptr, Tsize_t) uintptr)(unsafe.Pointer(&struct{ uintptr }{(*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_mem.Frealloc_fcn})))(tls, (*TDTD)(unsafe.Pointer(dtd)).FscaffIndex, uint64((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_groupSize)*libc.Uint64FromInt64(4))
  8864. if new_scaff_index == libc.UintptrFromInt32(0) {
  8865. return int32(_XML_ERROR_NO_MEMORY)
  8866. }
  8867. (*TDTD)(unsafe.Pointer(dtd)).FscaffIndex = new_scaff_index
  8868. }
  8869. } else {
  8870. v81 = libc.Uint32FromInt32(32)
  8871. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_groupSize = v81
  8872. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_groupConnector = (*(*func(*libc.TLS, Tsize_t) uintptr)(unsafe.Pointer(&struct{ uintptr }{(*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_mem.Fmalloc_fcn})))(tls, uint64(v81))
  8873. if !((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_groupConnector != 0) {
  8874. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_groupSize = uint32(0)
  8875. return int32(_XML_ERROR_NO_MEMORY)
  8876. }
  8877. }
  8878. }
  8879. *(*int8)(unsafe.Pointer((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_groupConnector + uintptr((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_prologState.Flevel))) = 0
  8880. if (*TDTD)(unsafe.Pointer(dtd)).Fin_eldecl != 0 {
  8881. myindex = _nextScaffoldPart(tls, parser)
  8882. if myindex < 0 {
  8883. return int32(_XML_ERROR_NO_MEMORY)
  8884. }
  8885. *(*int32)(unsafe.Pointer((*TDTD)(unsafe.Pointer(dtd)).FscaffIndex + uintptr((*TDTD)(unsafe.Pointer(dtd)).FscaffLevel)*4)) = myindex
  8886. (*TDTD)(unsafe.Pointer(dtd)).FscaffLevel++
  8887. (*(*TCONTENT_SCAFFOLD)(unsafe.Pointer((*TDTD)(unsafe.Pointer(dtd)).Fscaffold + uintptr(myindex)*32))).Ftype1 = int32(_XML_CTYPE_SEQ)
  8888. if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_elementDeclHandler != 0 {
  8889. handleDefault = libc.Uint8FromInt32(0)
  8890. }
  8891. }
  8892. goto _64
  8893. _40:
  8894. ;
  8895. if int32(*(*int8)(unsafe.Pointer((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_groupConnector + uintptr((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_prologState.Flevel)))) == int32(m_ASCII_PIPE) {
  8896. return int32(_XML_ERROR_SYNTAX)
  8897. }
  8898. *(*int8)(unsafe.Pointer((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_groupConnector + uintptr((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_prologState.Flevel))) = int8(m_ASCII_COMMA)
  8899. if (*TDTD)(unsafe.Pointer(dtd)).Fin_eldecl != 0 && (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_elementDeclHandler != 0 {
  8900. handleDefault = libc.Uint8FromInt32(0)
  8901. }
  8902. goto _64
  8903. _41:
  8904. ;
  8905. if int32(*(*int8)(unsafe.Pointer((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_groupConnector + uintptr((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_prologState.Flevel)))) == int32(m_ASCII_COMMA) {
  8906. return int32(_XML_ERROR_SYNTAX)
  8907. }
  8908. if (*TDTD)(unsafe.Pointer(dtd)).Fin_eldecl != 0 && !(*(*int8)(unsafe.Pointer((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_groupConnector + uintptr((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_prologState.Flevel))) != 0) && (*(*TCONTENT_SCAFFOLD)(unsafe.Pointer((*TDTD)(unsafe.Pointer(dtd)).Fscaffold + uintptr(*(*int32)(unsafe.Pointer((*TDTD)(unsafe.Pointer(dtd)).FscaffIndex + uintptr((*TDTD)(unsafe.Pointer(dtd)).FscaffLevel-int32(1))*4)))*32))).Ftype1 != int32(_XML_CTYPE_MIXED) {
  8909. (*(*TCONTENT_SCAFFOLD)(unsafe.Pointer((*TDTD)(unsafe.Pointer(dtd)).Fscaffold + uintptr(*(*int32)(unsafe.Pointer((*TDTD)(unsafe.Pointer(dtd)).FscaffIndex + uintptr((*TDTD)(unsafe.Pointer(dtd)).FscaffLevel-int32(1))*4)))*32))).Ftype1 = int32(_XML_CTYPE_CHOICE)
  8910. if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_elementDeclHandler != 0 {
  8911. handleDefault = libc.Uint8FromInt32(0)
  8912. }
  8913. }
  8914. *(*int8)(unsafe.Pointer((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_groupConnector + uintptr((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_prologState.Flevel))) = int8(m_ASCII_PIPE)
  8915. goto _64
  8916. _43:
  8917. ;
  8918. _42:
  8919. ;
  8920. (*TDTD)(unsafe.Pointer(dtd)).FhasParamEntityRefs = libc.Uint8FromInt32(1)
  8921. if !((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_paramEntityParsing != 0) {
  8922. (*TDTD)(unsafe.Pointer(dtd)).FkeepProcessing = (*TDTD)(unsafe.Pointer(dtd)).Fstandalone
  8923. } else {
  8924. name2 = _poolStoreString(tls, dtd+160, enc, s+uintptr((*TENCODING)(unsafe.Pointer(enc)).FminBytesPerChar), *(*uintptr)(unsafe.Pointer(bp))-uintptr((*TENCODING)(unsafe.Pointer(enc)).FminBytesPerChar))
  8925. if !(name2 != 0) {
  8926. return int32(_XML_ERROR_NO_MEMORY)
  8927. }
  8928. entity2 = _lookup(tls, parser, dtd+264, name2, uint64(0))
  8929. (*TSTRING_POOL)(unsafe.Pointer(dtd + 160)).Fptr = (*TSTRING_POOL)(unsafe.Pointer(dtd + 160)).Fstart
  8930. /* first, determine if a check for an existing declaration is needed;
  8931. if yes, check that the entity exists, and that it is internal,
  8932. otherwise call the skipped entity handler
  8933. */
  8934. if v83 = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_prologState.FdocumentEntity != 0; v83 {
  8935. if (*TDTD)(unsafe.Pointer(dtd)).Fstandalone != 0 {
  8936. v82 = libc.BoolInt32(!((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_openInternalEntities != 0))
  8937. } else {
  8938. v82 = libc.BoolInt32(!((*TDTD)(unsafe.Pointer(dtd)).FhasParamEntityRefs != 0))
  8939. }
  8940. }
  8941. if v83 && v82 != 0 {
  8942. if !(entity2 != 0) {
  8943. return int32(_XML_ERROR_UNDEFINED_ENTITY)
  8944. } else {
  8945. if !((*TENTITY)(unsafe.Pointer(entity2)).Fis_internal != 0) {
  8946. /* It's hard to exhaustively search the code to be sure,
  8947. * but there doesn't seem to be a way of executing the
  8948. * following line. There are two cases:
  8949. *
  8950. * If 'standalone' is false, the DTD must have no
  8951. * parameter entities or we wouldn't have passed the outer
  8952. * 'if' statement. That means the only entity in the hash
  8953. * table is the external subset name "#" which cannot be
  8954. * given as a parameter entity name in XML syntax, so the
  8955. * lookup must have returned NULL and we don't even reach
  8956. * the test for an internal entity.
  8957. *
  8958. * If 'standalone' is true, it does not seem to be
  8959. * possible to create entities taking this code path that
  8960. * are not internal entities, so fail the test above.
  8961. *
  8962. * Because this analysis is very uncertain, the code is
  8963. * being left in place and merely removed from the
  8964. * coverage test statistics.
  8965. */
  8966. return int32(_XML_ERROR_ENTITY_DECLARED_IN_PE) /* LCOV_EXCL_LINE */
  8967. }
  8968. }
  8969. } else {
  8970. if !(entity2 != 0) {
  8971. (*TDTD)(unsafe.Pointer(dtd)).FkeepProcessing = (*TDTD)(unsafe.Pointer(dtd)).Fstandalone
  8972. /* cannot report skipped entities in declarations */
  8973. if role == int32(_XML_ROLE_PARAM_ENTITY_REF) && (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_skippedEntityHandler != 0 {
  8974. (*(*func(*libc.TLS, uintptr, uintptr, int32))(unsafe.Pointer(&struct{ uintptr }{(*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_skippedEntityHandler})))(tls, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_handlerArg, name2, int32(1))
  8975. handleDefault = libc.Uint8FromInt32(0)
  8976. }
  8977. goto _64
  8978. }
  8979. }
  8980. if (*TENTITY)(unsafe.Pointer(entity2)).Fopen != 0 {
  8981. return int32(_XML_ERROR_RECURSIVE_ENTITY_REF)
  8982. }
  8983. if (*TENTITY)(unsafe.Pointer(entity2)).FtextPtr != 0 {
  8984. if role == int32(_XML_ROLE_PARAM_ENTITY_REF) {
  8985. v84 = libc.Int32FromUint8(libc.Uint8FromInt32(1))
  8986. } else {
  8987. v84 = libc.Int32FromUint8(libc.Uint8FromInt32(0))
  8988. }
  8989. betweenDecl = libc.Uint8FromInt32(v84)
  8990. result5 = _processInternalEntity(tls, parser, entity2, betweenDecl)
  8991. if result5 != int32(_XML_ERROR_NONE) {
  8992. return result5
  8993. }
  8994. handleDefault = libc.Uint8FromInt32(0)
  8995. goto _64
  8996. }
  8997. if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_externalEntityRefHandler != 0 {
  8998. (*TDTD)(unsafe.Pointer(dtd)).FparamEntityRead = libc.Uint8FromInt32(0)
  8999. (*TENTITY)(unsafe.Pointer(entity2)).Fopen = libc.Uint8FromInt32(1)
  9000. _entityTrackingOnOpen(tls, parser, entity2, int32(5439))
  9001. if !((*(*func(*libc.TLS, TXML_Parser, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_externalEntityRefHandler})))(tls, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_externalEntityRefHandlerArg, uintptr(0), (*TENTITY)(unsafe.Pointer(entity2)).Fbase, (*TENTITY)(unsafe.Pointer(entity2)).FsystemId, (*TENTITY)(unsafe.Pointer(entity2)).FpublicId) != 0) {
  9002. _entityTrackingOnClose(tls, parser, entity2, int32(5443))
  9003. (*TENTITY)(unsafe.Pointer(entity2)).Fopen = libc.Uint8FromInt32(0)
  9004. return int32(_XML_ERROR_EXTERNAL_ENTITY_HANDLING)
  9005. }
  9006. _entityTrackingOnClose(tls, parser, entity2, int32(5447))
  9007. (*TENTITY)(unsafe.Pointer(entity2)).Fopen = libc.Uint8FromInt32(0)
  9008. handleDefault = libc.Uint8FromInt32(0)
  9009. if !((*TDTD)(unsafe.Pointer(dtd)).FparamEntityRead != 0) {
  9010. (*TDTD)(unsafe.Pointer(dtd)).FkeepProcessing = (*TDTD)(unsafe.Pointer(dtd)).Fstandalone
  9011. goto _64
  9012. }
  9013. } else {
  9014. (*TDTD)(unsafe.Pointer(dtd)).FkeepProcessing = (*TDTD)(unsafe.Pointer(dtd)).Fstandalone
  9015. goto _64
  9016. }
  9017. }
  9018. if !((*TDTD)(unsafe.Pointer(dtd)).Fstandalone != 0) && (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_notStandaloneHandler != 0 && !((*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_notStandaloneHandler})))(tls, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_handlerArg) != 0) {
  9019. return int32(_XML_ERROR_NOT_STANDALONE)
  9020. }
  9021. goto _64
  9022. /* Element declaration stuff */
  9023. _44:
  9024. ;
  9025. if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_elementDeclHandler != 0 {
  9026. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declElementType = _getElementType(tls, parser, enc, s, *(*uintptr)(unsafe.Pointer(bp)))
  9027. if !((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declElementType != 0) {
  9028. return int32(_XML_ERROR_NO_MEMORY)
  9029. }
  9030. (*TDTD)(unsafe.Pointer(dtd)).FscaffLevel = 0
  9031. (*TDTD)(unsafe.Pointer(dtd)).FscaffCount = uint32(0)
  9032. (*TDTD)(unsafe.Pointer(dtd)).Fin_eldecl = libc.Uint8FromInt32(1)
  9033. handleDefault = libc.Uint8FromInt32(0)
  9034. }
  9035. goto _64
  9036. _46:
  9037. ;
  9038. _45:
  9039. ;
  9040. if (*TDTD)(unsafe.Pointer(dtd)).Fin_eldecl != 0 {
  9041. if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_elementDeclHandler != 0 {
  9042. content = (*(*func(*libc.TLS, Tsize_t) uintptr)(unsafe.Pointer(&struct{ uintptr }{(*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_mem.Fmalloc_fcn})))(tls, libc.Uint64FromInt64(32))
  9043. if !(content != 0) {
  9044. return int32(_XML_ERROR_NO_MEMORY)
  9045. }
  9046. (*TXML_Content)(unsafe.Pointer(content)).Fquant = int32(_XML_CQUANT_NONE)
  9047. (*TXML_Content)(unsafe.Pointer(content)).Fname = libc.UintptrFromInt32(0)
  9048. (*TXML_Content)(unsafe.Pointer(content)).Fnumchildren = uint32(0)
  9049. (*TXML_Content)(unsafe.Pointer(content)).Fchildren = libc.UintptrFromInt32(0)
  9050. if role == int32(_XML_ROLE_CONTENT_ANY) {
  9051. v85 = int32(_XML_CTYPE_ANY)
  9052. } else {
  9053. v85 = int32(_XML_CTYPE_EMPTY)
  9054. }
  9055. (*TXML_Content)(unsafe.Pointer(content)).Ftype1 = v85
  9056. *(*uintptr)(unsafe.Pointer(eventEndPP)) = s
  9057. (*(*func(*libc.TLS, uintptr, uintptr, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_elementDeclHandler})))(tls, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_handlerArg, (*TELEMENT_TYPE)(unsafe.Pointer((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declElementType)).Fname, content)
  9058. handleDefault = libc.Uint8FromInt32(0)
  9059. }
  9060. (*TDTD)(unsafe.Pointer(dtd)).Fin_eldecl = libc.Uint8FromInt32(0)
  9061. }
  9062. goto _64
  9063. _47:
  9064. ;
  9065. if (*TDTD)(unsafe.Pointer(dtd)).Fin_eldecl != 0 {
  9066. (*(*TCONTENT_SCAFFOLD)(unsafe.Pointer((*TDTD)(unsafe.Pointer(dtd)).Fscaffold + uintptr(*(*int32)(unsafe.Pointer((*TDTD)(unsafe.Pointer(dtd)).FscaffIndex + uintptr((*TDTD)(unsafe.Pointer(dtd)).FscaffLevel-int32(1))*4)))*32))).Ftype1 = int32(_XML_CTYPE_MIXED)
  9067. if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_elementDeclHandler != 0 {
  9068. handleDefault = libc.Uint8FromInt32(0)
  9069. }
  9070. }
  9071. goto _64
  9072. _48:
  9073. ;
  9074. quant = int32(_XML_CQUANT_NONE)
  9075. goto elementContent
  9076. _49:
  9077. ;
  9078. quant = int32(_XML_CQUANT_OPT)
  9079. goto elementContent
  9080. _50:
  9081. ;
  9082. quant = int32(_XML_CQUANT_REP)
  9083. goto elementContent
  9084. _51:
  9085. ;
  9086. quant = int32(_XML_CQUANT_PLUS)
  9087. goto elementContent
  9088. elementContent:
  9089. ;
  9090. if (*TDTD)(unsafe.Pointer(dtd)).Fin_eldecl != 0 {
  9091. if quant == int32(_XML_CQUANT_NONE) {
  9092. v86 = *(*uintptr)(unsafe.Pointer(bp))
  9093. } else {
  9094. v86 = *(*uintptr)(unsafe.Pointer(bp)) - uintptr((*TENCODING)(unsafe.Pointer(enc)).FminBytesPerChar)
  9095. }
  9096. nxt = v86
  9097. myindex1 = _nextScaffoldPart(tls, parser)
  9098. if myindex1 < 0 {
  9099. return int32(_XML_ERROR_NO_MEMORY)
  9100. }
  9101. (*(*TCONTENT_SCAFFOLD)(unsafe.Pointer((*TDTD)(unsafe.Pointer(dtd)).Fscaffold + uintptr(myindex1)*32))).Ftype1 = int32(_XML_CTYPE_NAME)
  9102. (*(*TCONTENT_SCAFFOLD)(unsafe.Pointer((*TDTD)(unsafe.Pointer(dtd)).Fscaffold + uintptr(myindex1)*32))).Fquant = quant
  9103. el = _getElementType(tls, parser, enc, s, nxt)
  9104. if !(el != 0) {
  9105. return int32(_XML_ERROR_NO_MEMORY)
  9106. }
  9107. name3 = (*TELEMENT_TYPE)(unsafe.Pointer(el)).Fname
  9108. (*(*TCONTENT_SCAFFOLD)(unsafe.Pointer((*TDTD)(unsafe.Pointer(dtd)).Fscaffold + uintptr(myindex1)*32))).Fname = name3
  9109. nameLen = uint64(0)
  9110. for {
  9111. v88 = nameLen
  9112. nameLen++
  9113. if !(*(*TXML_Char)(unsafe.Pointer(name3 + uintptr(v88))) != 0) {
  9114. break
  9115. }
  9116. goto _87
  9117. _87:
  9118. }
  9119. /* Detect and prevent integer overflow */
  9120. if nameLen > uint64(libc.Uint32FromInt32(m___INT_MAX__)*libc.Uint32FromUint32(2)+libc.Uint32FromUint32(1)-(*TDTD)(unsafe.Pointer(dtd)).FcontentStringLen) {
  9121. return int32(_XML_ERROR_NO_MEMORY)
  9122. }
  9123. *(*uint32)(unsafe.Pointer(dtd + 336)) += uint32(nameLen)
  9124. if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_elementDeclHandler != 0 {
  9125. handleDefault = libc.Uint8FromInt32(0)
  9126. }
  9127. }
  9128. goto _64
  9129. _52:
  9130. ;
  9131. quant = int32(_XML_CQUANT_NONE)
  9132. goto closeGroup
  9133. _53:
  9134. ;
  9135. quant = int32(_XML_CQUANT_OPT)
  9136. goto closeGroup
  9137. _54:
  9138. ;
  9139. quant = int32(_XML_CQUANT_REP)
  9140. goto closeGroup
  9141. _55:
  9142. ;
  9143. quant = int32(_XML_CQUANT_PLUS)
  9144. goto closeGroup
  9145. closeGroup:
  9146. ;
  9147. if (*TDTD)(unsafe.Pointer(dtd)).Fin_eldecl != 0 {
  9148. if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_elementDeclHandler != 0 {
  9149. handleDefault = libc.Uint8FromInt32(0)
  9150. }
  9151. (*TDTD)(unsafe.Pointer(dtd)).FscaffLevel--
  9152. (*(*TCONTENT_SCAFFOLD)(unsafe.Pointer((*TDTD)(unsafe.Pointer(dtd)).Fscaffold + uintptr(*(*int32)(unsafe.Pointer((*TDTD)(unsafe.Pointer(dtd)).FscaffIndex + uintptr((*TDTD)(unsafe.Pointer(dtd)).FscaffLevel)*4)))*32))).Fquant = quant
  9153. if (*TDTD)(unsafe.Pointer(dtd)).FscaffLevel == 0 {
  9154. if !(handleDefault != 0) {
  9155. model = _build_model(tls, parser)
  9156. if !(model != 0) {
  9157. return int32(_XML_ERROR_NO_MEMORY)
  9158. }
  9159. *(*uintptr)(unsafe.Pointer(eventEndPP)) = s
  9160. (*(*func(*libc.TLS, uintptr, uintptr, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_elementDeclHandler})))(tls, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_handlerArg, (*TELEMENT_TYPE)(unsafe.Pointer((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declElementType)).Fname, model)
  9161. }
  9162. (*TDTD)(unsafe.Pointer(dtd)).Fin_eldecl = libc.Uint8FromInt32(0)
  9163. (*TDTD)(unsafe.Pointer(dtd)).FcontentStringLen = uint32(0)
  9164. }
  9165. }
  9166. goto _64
  9167. /* End element declaration stuff */
  9168. _56:
  9169. ;
  9170. if !(_reportProcessingInstruction(tls, parser, enc, s, *(*uintptr)(unsafe.Pointer(bp))) != 0) {
  9171. return int32(_XML_ERROR_NO_MEMORY)
  9172. }
  9173. handleDefault = libc.Uint8FromInt32(0)
  9174. goto _64
  9175. _57:
  9176. ;
  9177. if !(_reportComment(tls, parser, enc, s, *(*uintptr)(unsafe.Pointer(bp))) != 0) {
  9178. return int32(_XML_ERROR_NO_MEMORY)
  9179. }
  9180. handleDefault = libc.Uint8FromInt32(0)
  9181. goto _64
  9182. _58:
  9183. ;
  9184. switch tok {
  9185. case int32(m_XML_TOK_BOM):
  9186. handleDefault = libc.Uint8FromInt32(0)
  9187. break
  9188. }
  9189. goto _64
  9190. _59:
  9191. ;
  9192. if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_startDoctypeDeclHandler != 0 {
  9193. handleDefault = libc.Uint8FromInt32(0)
  9194. }
  9195. goto _64
  9196. _60:
  9197. ;
  9198. if (*TDTD)(unsafe.Pointer(dtd)).FkeepProcessing != 0 && (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_entityDeclHandler != 0 {
  9199. handleDefault = libc.Uint8FromInt32(0)
  9200. }
  9201. goto _64
  9202. _61:
  9203. ;
  9204. if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_notationDeclHandler != 0 {
  9205. handleDefault = libc.Uint8FromInt32(0)
  9206. }
  9207. goto _64
  9208. _62:
  9209. ;
  9210. if (*TDTD)(unsafe.Pointer(dtd)).FkeepProcessing != 0 && (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_attlistDeclHandler != 0 {
  9211. handleDefault = libc.Uint8FromInt32(0)
  9212. }
  9213. goto _64
  9214. _63:
  9215. ;
  9216. if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_elementDeclHandler != 0 {
  9217. handleDefault = libc.Uint8FromInt32(0)
  9218. }
  9219. goto _64
  9220. _64:
  9221. ; /* end of big switch */
  9222. if handleDefault != 0 && (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_defaultHandler != 0 {
  9223. _reportDefault(tls, parser, enc, s, *(*uintptr)(unsafe.Pointer(bp)))
  9224. }
  9225. switch (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parsingStatus.Fparsing {
  9226. case int32(_XML_SUSPENDED):
  9227. *(*uintptr)(unsafe.Pointer(nextPtr)) = *(*uintptr)(unsafe.Pointer(bp))
  9228. return int32(_XML_ERROR_NONE)
  9229. case int32(_XML_FINISHED):
  9230. return int32(_XML_ERROR_ABORTED)
  9231. default:
  9232. s = *(*uintptr)(unsafe.Pointer(bp))
  9233. tok = (*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{*(*TSCANNER)(unsafe.Pointer(enc))})))(tls, enc, s, end, bp)
  9234. }
  9235. goto _1
  9236. _1:
  9237. }
  9238. /* not reached */
  9239. return r
  9240. }
  9241. var _externalSubsetName = [2]TXML_Char{
  9242. 0: int8(m_ASCII_HASH),
  9243. }
  9244. var _atypeCDATA = [6]TXML_Char{
  9245. 0: int8(m_ASCII_C),
  9246. 1: int8(m_ASCII_D),
  9247. 2: int8(m_ASCII_A),
  9248. 3: int8(m_ASCII_T),
  9249. 4: int8(m_ASCII_A),
  9250. }
  9251. var _atypeID = [3]TXML_Char{
  9252. 0: int8(m_ASCII_I),
  9253. 1: int8(m_ASCII_D),
  9254. }
  9255. var _atypeIDREF = [6]TXML_Char{
  9256. 0: int8(m_ASCII_I),
  9257. 1: int8(m_ASCII_D),
  9258. 2: int8(m_ASCII_R),
  9259. 3: int8(m_ASCII_E),
  9260. 4: int8(m_ASCII_F),
  9261. }
  9262. var _atypeIDREFS = [7]TXML_Char{
  9263. 0: int8(m_ASCII_I),
  9264. 1: int8(m_ASCII_D),
  9265. 2: int8(m_ASCII_R),
  9266. 3: int8(m_ASCII_E),
  9267. 4: int8(m_ASCII_F),
  9268. 5: int8(m_ASCII_S),
  9269. }
  9270. var _atypeENTITY = [7]TXML_Char{
  9271. 0: int8(m_ASCII_E),
  9272. 1: int8(m_ASCII_N),
  9273. 2: int8(m_ASCII_T),
  9274. 3: int8(m_ASCII_I),
  9275. 4: int8(m_ASCII_T),
  9276. 5: int8(m_ASCII_Y),
  9277. }
  9278. var _atypeENTITIES = [9]TXML_Char{
  9279. 0: int8(m_ASCII_E),
  9280. 1: int8(m_ASCII_N),
  9281. 2: int8(m_ASCII_T),
  9282. 3: int8(m_ASCII_I),
  9283. 4: int8(m_ASCII_T),
  9284. 5: int8(m_ASCII_I),
  9285. 6: int8(m_ASCII_E),
  9286. 7: int8(m_ASCII_S),
  9287. }
  9288. var _atypeNMTOKEN = [8]TXML_Char{
  9289. 0: int8(m_ASCII_N),
  9290. 1: int8(m_ASCII_M),
  9291. 2: int8(m_ASCII_T),
  9292. 3: int8(m_ASCII_O),
  9293. 4: int8(m_ASCII_K),
  9294. 5: int8(m_ASCII_E),
  9295. 6: int8(m_ASCII_N),
  9296. }
  9297. var _atypeNMTOKENS = [9]TXML_Char{
  9298. 0: int8(m_ASCII_N),
  9299. 1: int8(m_ASCII_M),
  9300. 2: int8(m_ASCII_T),
  9301. 3: int8(m_ASCII_O),
  9302. 4: int8(m_ASCII_K),
  9303. 5: int8(m_ASCII_E),
  9304. 6: int8(m_ASCII_N),
  9305. 7: int8(m_ASCII_S),
  9306. }
  9307. var _notationPrefix = [10]TXML_Char{
  9308. 0: int8(m_ASCII_N),
  9309. 1: int8(m_ASCII_O),
  9310. 2: int8(m_ASCII_T),
  9311. 3: int8(m_ASCII_A),
  9312. 4: int8(m_ASCII_T),
  9313. 5: int8(m_ASCII_I),
  9314. 6: int8(m_ASCII_O),
  9315. 7: int8(m_ASCII_N),
  9316. 8: int8(m_ASCII_LPAREN),
  9317. }
  9318. var _enumValueSep = [2]TXML_Char{
  9319. 0: int8(m_ASCII_PIPE),
  9320. }
  9321. var _enumValueStart = [2]TXML_Char{
  9322. 0: int8(m_ASCII_LPAREN),
  9323. }
  9324. func _epilogProcessor(tls *libc.TLS, parser TXML_Parser, s uintptr, end uintptr, nextPtr uintptr) (r _XML_Error) {
  9325. bp := tls.Alloc(16)
  9326. defer tls.Free(16)
  9327. var tok int32
  9328. var v2 uintptr
  9329. var _ /* next at bp+0 */ uintptr
  9330. _, _ = tok, v2
  9331. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_processor = __ccgo_fp(_epilogProcessor)
  9332. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_eventPtr = s
  9333. for {
  9334. *(*uintptr)(unsafe.Pointer(bp)) = libc.UintptrFromInt32(0)
  9335. tok = (*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{*(*TSCANNER)(unsafe.Pointer((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_encoding))})))(tls, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_encoding, s, end, bp)
  9336. if !(_accountingDiffTolerated(tls, parser, tok, s, *(*uintptr)(unsafe.Pointer(bp)), int32(5652), int32(_XML_ACCOUNT_DIRECT)) != 0) {
  9337. _accountingOnAbort(tls, parser)
  9338. return int32(_XML_ERROR_AMPLIFICATION_LIMIT_BREACH)
  9339. }
  9340. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_eventEndPtr = *(*uintptr)(unsafe.Pointer(bp))
  9341. switch tok {
  9342. /* report partial linebreak - it might be the last token */
  9343. case -int32(m_XML_TOK_PROLOG_S):
  9344. if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_defaultHandler != 0 {
  9345. _reportDefault(tls, parser, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_encoding, s, *(*uintptr)(unsafe.Pointer(bp)))
  9346. if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parsingStatus.Fparsing == int32(_XML_FINISHED) {
  9347. return int32(_XML_ERROR_ABORTED)
  9348. }
  9349. }
  9350. *(*uintptr)(unsafe.Pointer(nextPtr)) = *(*uintptr)(unsafe.Pointer(bp))
  9351. return int32(_XML_ERROR_NONE)
  9352. case -int32(4):
  9353. *(*uintptr)(unsafe.Pointer(nextPtr)) = s
  9354. return int32(_XML_ERROR_NONE)
  9355. case int32(m_XML_TOK_PROLOG_S):
  9356. if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_defaultHandler != 0 {
  9357. _reportDefault(tls, parser, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_encoding, s, *(*uintptr)(unsafe.Pointer(bp)))
  9358. }
  9359. case int32(m_XML_TOK_PI):
  9360. if !(_reportProcessingInstruction(tls, parser, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_encoding, s, *(*uintptr)(unsafe.Pointer(bp))) != 0) {
  9361. return int32(_XML_ERROR_NO_MEMORY)
  9362. }
  9363. case int32(m_XML_TOK_COMMENT):
  9364. if !(_reportComment(tls, parser, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_encoding, s, *(*uintptr)(unsafe.Pointer(bp))) != 0) {
  9365. return int32(_XML_ERROR_NO_MEMORY)
  9366. }
  9367. case m_XML_TOK_INVALID:
  9368. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_eventPtr = *(*uintptr)(unsafe.Pointer(bp))
  9369. return int32(_XML_ERROR_INVALID_TOKEN)
  9370. case -int32(1):
  9371. if !((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parsingStatus.FfinalBuffer != 0) {
  9372. *(*uintptr)(unsafe.Pointer(nextPtr)) = s
  9373. return int32(_XML_ERROR_NONE)
  9374. }
  9375. return int32(_XML_ERROR_UNCLOSED_TOKEN)
  9376. case -int32(2):
  9377. if !((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parsingStatus.FfinalBuffer != 0) {
  9378. *(*uintptr)(unsafe.Pointer(nextPtr)) = s
  9379. return int32(_XML_ERROR_NONE)
  9380. }
  9381. return int32(_XML_ERROR_PARTIAL_CHAR)
  9382. default:
  9383. return int32(_XML_ERROR_JUNK_AFTER_DOC_ELEMENT)
  9384. }
  9385. v2 = *(*uintptr)(unsafe.Pointer(bp))
  9386. s = v2
  9387. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_eventPtr = v2
  9388. switch (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parsingStatus.Fparsing {
  9389. case int32(_XML_SUSPENDED):
  9390. *(*uintptr)(unsafe.Pointer(nextPtr)) = *(*uintptr)(unsafe.Pointer(bp))
  9391. return int32(_XML_ERROR_NONE)
  9392. case int32(_XML_FINISHED):
  9393. return int32(_XML_ERROR_ABORTED)
  9394. default:
  9395. }
  9396. goto _1
  9397. _1:
  9398. }
  9399. return r
  9400. }
  9401. func _processInternalEntity(tls *libc.TLS, parser TXML_Parser, entity uintptr, betweenDecl TXML_Bool) (r _XML_Error) {
  9402. bp := tls.Alloc(16)
  9403. defer tls.Free(16)
  9404. var openEntity, textEnd, textStart uintptr
  9405. var result _XML_Error
  9406. var tok int32
  9407. var _ /* next at bp+0 */ uintptr
  9408. _, _, _, _, _ = openEntity, result, textEnd, textStart, tok
  9409. if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_freeInternalEntities != 0 {
  9410. openEntity = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_freeInternalEntities
  9411. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_freeInternalEntities = (*TOPEN_INTERNAL_ENTITY)(unsafe.Pointer(openEntity)).Fnext
  9412. } else {
  9413. openEntity = (*(*func(*libc.TLS, Tsize_t) uintptr)(unsafe.Pointer(&struct{ uintptr }{(*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_mem.Fmalloc_fcn})))(tls, libc.Uint64FromInt64(40))
  9414. if !(openEntity != 0) {
  9415. return int32(_XML_ERROR_NO_MEMORY)
  9416. }
  9417. }
  9418. (*TENTITY)(unsafe.Pointer(entity)).Fopen = libc.Uint8FromInt32(1)
  9419. _entityTrackingOnOpen(tls, parser, entity, int32(5732))
  9420. (*TENTITY)(unsafe.Pointer(entity)).Fprocessed = 0
  9421. (*TOPEN_INTERNAL_ENTITY)(unsafe.Pointer(openEntity)).Fnext = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_openInternalEntities
  9422. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_openInternalEntities = openEntity
  9423. (*TOPEN_INTERNAL_ENTITY)(unsafe.Pointer(openEntity)).Fentity = entity
  9424. (*TOPEN_INTERNAL_ENTITY)(unsafe.Pointer(openEntity)).FstartTagLevel = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_tagLevel
  9425. (*TOPEN_INTERNAL_ENTITY)(unsafe.Pointer(openEntity)).FbetweenDecl = betweenDecl
  9426. (*TOPEN_INTERNAL_ENTITY)(unsafe.Pointer(openEntity)).FinternalEventPtr = libc.UintptrFromInt32(0)
  9427. (*TOPEN_INTERNAL_ENTITY)(unsafe.Pointer(openEntity)).FinternalEventEndPtr = libc.UintptrFromInt32(0)
  9428. textStart = (*TENTITY)(unsafe.Pointer(entity)).FtextPtr
  9429. textEnd = (*TENTITY)(unsafe.Pointer(entity)).FtextPtr + uintptr((*TENTITY)(unsafe.Pointer(entity)).FtextLen)
  9430. /* Set a safe default value in case 'next' does not get set */
  9431. *(*uintptr)(unsafe.Pointer(bp)) = textStart
  9432. if (*TENTITY)(unsafe.Pointer(entity)).Fis_param != 0 {
  9433. tok = (*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{*(*TSCANNER)(unsafe.Pointer((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_internalEncoding))})))(tls, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_internalEncoding, textStart, textEnd, bp)
  9434. result = _doProlog(tls, parser, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_internalEncoding, textStart, textEnd, tok, *(*uintptr)(unsafe.Pointer(bp)), bp, libc.Uint8FromInt32(0), libc.Uint8FromInt32(0), int32(_XML_ACCOUNT_ENTITY_EXPANSION))
  9435. } else {
  9436. result = _doContent(tls, parser, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_tagLevel, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_internalEncoding, textStart, textEnd, bp, libc.Uint8FromInt32(0), int32(_XML_ACCOUNT_ENTITY_EXPANSION))
  9437. }
  9438. if result == int32(_XML_ERROR_NONE) {
  9439. if textEnd != *(*uintptr)(unsafe.Pointer(bp)) && (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parsingStatus.Fparsing == int32(_XML_SUSPENDED) {
  9440. (*TENTITY)(unsafe.Pointer(entity)).Fprocessed = int32(int64(*(*uintptr)(unsafe.Pointer(bp))) - int64(textStart))
  9441. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_processor = __ccgo_fp(_internalEntityProcessor)
  9442. } else {
  9443. _entityTrackingOnClose(tls, parser, entity, int32(5766))
  9444. (*TENTITY)(unsafe.Pointer(entity)).Fopen = libc.Uint8FromInt32(0)
  9445. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_openInternalEntities = (*TOPEN_INTERNAL_ENTITY)(unsafe.Pointer(openEntity)).Fnext
  9446. /* put openEntity back in list of free instances */
  9447. (*TOPEN_INTERNAL_ENTITY)(unsafe.Pointer(openEntity)).Fnext = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_freeInternalEntities
  9448. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_freeInternalEntities = openEntity
  9449. }
  9450. }
  9451. return result
  9452. }
  9453. func _internalEntityProcessor(tls *libc.TLS, parser TXML_Parser, s uintptr, end uintptr, nextPtr uintptr) (r _XML_Error) {
  9454. bp := tls.Alloc(16)
  9455. defer tls.Free(16)
  9456. var entity, openEntity, textEnd, textStart uintptr
  9457. var result _XML_Error
  9458. var tok, tok1, v1 int32
  9459. var _ /* next at bp+0 */ uintptr
  9460. _, _, _, _, _, _, _, _ = entity, openEntity, result, textEnd, textStart, tok, tok1, v1
  9461. openEntity = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_openInternalEntities
  9462. if !(openEntity != 0) {
  9463. return int32(_XML_ERROR_UNEXPECTED_STATE)
  9464. }
  9465. entity = (*TOPEN_INTERNAL_ENTITY)(unsafe.Pointer(openEntity)).Fentity
  9466. textStart = (*TENTITY)(unsafe.Pointer(entity)).FtextPtr + uintptr((*TENTITY)(unsafe.Pointer(entity)).Fprocessed)
  9467. textEnd = (*TENTITY)(unsafe.Pointer(entity)).FtextPtr + uintptr((*TENTITY)(unsafe.Pointer(entity)).FtextLen)
  9468. /* Set a safe default value in case 'next' does not get set */
  9469. *(*uintptr)(unsafe.Pointer(bp)) = textStart
  9470. if (*TENTITY)(unsafe.Pointer(entity)).Fis_param != 0 {
  9471. tok = (*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{*(*TSCANNER)(unsafe.Pointer((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_internalEncoding))})))(tls, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_internalEncoding, textStart, textEnd, bp)
  9472. result = _doProlog(tls, parser, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_internalEncoding, textStart, textEnd, tok, *(*uintptr)(unsafe.Pointer(bp)), bp, libc.Uint8FromInt32(0), libc.Uint8FromInt32(1), int32(_XML_ACCOUNT_ENTITY_EXPANSION))
  9473. } else {
  9474. result = _doContent(tls, parser, (*TOPEN_INTERNAL_ENTITY)(unsafe.Pointer(openEntity)).FstartTagLevel, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_internalEncoding, textStart, textEnd, bp, libc.Uint8FromInt32(0), int32(_XML_ACCOUNT_ENTITY_EXPANSION))
  9475. }
  9476. if result != int32(_XML_ERROR_NONE) {
  9477. return result
  9478. }
  9479. if textEnd != *(*uintptr)(unsafe.Pointer(bp)) && (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parsingStatus.Fparsing == int32(_XML_SUSPENDED) {
  9480. (*TENTITY)(unsafe.Pointer(entity)).Fprocessed = int32(int64(*(*uintptr)(unsafe.Pointer(bp))) - int64((*TENTITY)(unsafe.Pointer(entity)).FtextPtr))
  9481. return result
  9482. }
  9483. _entityTrackingOnClose(tls, parser, entity, int32(5817))
  9484. (*TENTITY)(unsafe.Pointer(entity)).Fopen = libc.Uint8FromInt32(0)
  9485. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_openInternalEntities = (*TOPEN_INTERNAL_ENTITY)(unsafe.Pointer(openEntity)).Fnext
  9486. /* put openEntity back in list of free instances */
  9487. (*TOPEN_INTERNAL_ENTITY)(unsafe.Pointer(openEntity)).Fnext = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_freeInternalEntities
  9488. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_freeInternalEntities = openEntity
  9489. // If there are more open entities we want to stop right here and have the
  9490. // upcoming call to XML_ResumeParser continue with entity content, or it would
  9491. // be ignored altogether.
  9492. if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_openInternalEntities != libc.UintptrFromInt32(0) && (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parsingStatus.Fparsing == int32(_XML_SUSPENDED) {
  9493. return int32(_XML_ERROR_NONE)
  9494. }
  9495. if (*TENTITY)(unsafe.Pointer(entity)).Fis_param != 0 {
  9496. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_processor = __ccgo_fp(_prologProcessor)
  9497. tok1 = (*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{*(*TSCANNER)(unsafe.Pointer((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_encoding))})))(tls, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_encoding, s, end, bp)
  9498. return _doProlog(tls, parser, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_encoding, s, end, tok1, *(*uintptr)(unsafe.Pointer(bp)), nextPtr, libc.BoolUint8(!((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parsingStatus.FfinalBuffer != 0)), libc.Uint8FromInt32(1), int32(_XML_ACCOUNT_DIRECT))
  9499. } else {
  9500. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_processor = __ccgo_fp(_contentProcessor)
  9501. /* see externalEntityContentProcessor vs contentProcessor */
  9502. if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parentParser != 0 {
  9503. v1 = int32(1)
  9504. } else {
  9505. v1 = 0
  9506. }
  9507. result = _doContent(tls, parser, v1, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_encoding, s, end, nextPtr, libc.BoolUint8(!((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parsingStatus.FfinalBuffer != 0)), int32(_XML_ACCOUNT_DIRECT))
  9508. if result == int32(_XML_ERROR_NONE) {
  9509. if !(_storeRawNames(tls, parser) != 0) {
  9510. return int32(_XML_ERROR_NO_MEMORY)
  9511. }
  9512. }
  9513. return result
  9514. }
  9515. return r
  9516. }
  9517. func _errorProcessor(tls *libc.TLS, parser TXML_Parser, s uintptr, end uintptr, nextPtr uintptr) (r _XML_Error) {
  9518. _ = s
  9519. _ = end
  9520. _ = nextPtr
  9521. return (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_errorCode
  9522. }
  9523. func _storeAttributeValue(tls *libc.TLS, parser TXML_Parser, enc uintptr, isCdata TXML_Bool, ptr uintptr, end uintptr, pool uintptr, account _XML_Account) (r _XML_Error) {
  9524. var result _XML_Error
  9525. var v1 int32
  9526. var v2, v3 uintptr
  9527. _, _, _, _ = result, v1, v2, v3
  9528. result = _appendAttributeValue(tls, parser, enc, isCdata, ptr, end, pool, account)
  9529. if result != 0 {
  9530. return result
  9531. }
  9532. if !(isCdata != 0) && int64((*TSTRING_POOL)(unsafe.Pointer(pool)).Fptr)-int64((*TSTRING_POOL)(unsafe.Pointer(pool)).Fstart) != 0 && int32(*(*TXML_Char)(unsafe.Pointer((*TSTRING_POOL)(unsafe.Pointer(pool)).Fptr + uintptr(-libc.Int32FromInt32(1))))) == int32(0x20) {
  9533. (*TSTRING_POOL)(unsafe.Pointer(pool)).Fptr--
  9534. }
  9535. if (*TSTRING_POOL)(unsafe.Pointer(pool)).Fptr == (*TSTRING_POOL)(unsafe.Pointer(pool)).Fend && !(_poolGrow(tls, pool) != 0) {
  9536. v1 = 0
  9537. } else {
  9538. v3 = pool + 24
  9539. v2 = *(*uintptr)(unsafe.Pointer(v3))
  9540. *(*uintptr)(unsafe.Pointer(v3))++
  9541. *(*TXML_Char)(unsafe.Pointer(v2)) = int8('\000')
  9542. v1 = libc.Int32FromInt32(1)
  9543. }
  9544. if !(v1 != 0) {
  9545. return int32(_XML_ERROR_NO_MEMORY)
  9546. }
  9547. return int32(_XML_ERROR_NONE)
  9548. }
  9549. func _appendAttributeValue(tls *libc.TLS, parser TXML_Parser, enc uintptr, isCdata TXML_Bool, ptr uintptr, end uintptr, pool uintptr, account _XML_Account) (r _XML_Error) {
  9550. bp := tls.Alloc(16)
  9551. defer tls.Free(16)
  9552. var checkEntityDecl int8
  9553. var dtd, entity, name, textEnd, v10, v11, v4, v5, v7, v8 uintptr
  9554. var i, n, tok, v12, v3, v6, v9 int32
  9555. var result _XML_Error
  9556. var v13 bool
  9557. var _ /* buf at bp+8 */ [4]TXML_Char
  9558. var _ /* ch at bp+12 */ TXML_Char
  9559. var _ /* next at bp+0 */ uintptr
  9560. _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = checkEntityDecl, dtd, entity, i, n, name, result, textEnd, tok, v10, v11, v12, v13, v3, v4, v5, v6, v7, v8, v9
  9561. dtd = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_dtd /* save one level of indirection */
  9562. for {
  9563. *(*uintptr)(unsafe.Pointer(bp)) = ptr /* XmlAttributeValueTok doesn't always set the last arg */
  9564. tok = (*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{*(*TSCANNER)(unsafe.Pointer(enc + 32))})))(tls, enc, ptr, end, bp)
  9565. if !(_accountingDiffTolerated(tls, parser, tok, ptr, *(*uintptr)(unsafe.Pointer(bp)), int32(5896), account) != 0) {
  9566. _accountingOnAbort(tls, parser)
  9567. return int32(_XML_ERROR_AMPLIFICATION_LIMIT_BREACH)
  9568. }
  9569. switch tok {
  9570. case -int32(4):
  9571. return int32(_XML_ERROR_NONE)
  9572. case m_XML_TOK_INVALID:
  9573. if enc == (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_encoding {
  9574. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_eventPtr = *(*uintptr)(unsafe.Pointer(bp))
  9575. }
  9576. return int32(_XML_ERROR_INVALID_TOKEN)
  9577. case -int32(1):
  9578. if enc == (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_encoding {
  9579. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_eventPtr = ptr
  9580. }
  9581. return int32(_XML_ERROR_INVALID_TOKEN)
  9582. case int32(m_XML_TOK_CHAR_REF):
  9583. n = (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*TENCODING)(unsafe.Pointer(enc)).FcharRefNumber})))(tls, enc, ptr)
  9584. if n < 0 {
  9585. if enc == (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_encoding {
  9586. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_eventPtr = ptr
  9587. }
  9588. return int32(_XML_ERROR_BAD_CHAR_REF)
  9589. }
  9590. if !(isCdata != 0) && n == int32(0x20) && (int64((*TSTRING_POOL)(unsafe.Pointer(pool)).Fptr)-int64((*TSTRING_POOL)(unsafe.Pointer(pool)).Fstart) == 0 || int32(*(*TXML_Char)(unsafe.Pointer((*TSTRING_POOL)(unsafe.Pointer(pool)).Fptr + uintptr(-libc.Int32FromInt32(1))))) == int32(0x20)) {
  9591. break
  9592. }
  9593. n = XXmlUtf8Encode(tls, n, bp+8)
  9594. /* The XmlEncode() functions can never return 0 here. That
  9595. * error return happens if the code point passed in is either
  9596. * negative or greater than or equal to 0x110000. The
  9597. * XmlCharRefNumber() functions will all return a number
  9598. * strictly less than 0x110000 or a negative value if an error
  9599. * occurred. The negative value is intercepted above, so
  9600. * XmlEncode() is never passed a value it might return an
  9601. * error for.
  9602. */
  9603. i = 0
  9604. for {
  9605. if !(i < n) {
  9606. break
  9607. }
  9608. if (*TSTRING_POOL)(unsafe.Pointer(pool)).Fptr == (*TSTRING_POOL)(unsafe.Pointer(pool)).Fend && !(_poolGrow(tls, pool) != 0) {
  9609. v3 = 0
  9610. } else {
  9611. v5 = pool + 24
  9612. v4 = *(*uintptr)(unsafe.Pointer(v5))
  9613. *(*uintptr)(unsafe.Pointer(v5))++
  9614. *(*TXML_Char)(unsafe.Pointer(v4)) = (*(*[4]TXML_Char)(unsafe.Pointer(bp + 8)))[i]
  9615. v3 = libc.Int32FromInt32(1)
  9616. }
  9617. if !(v3 != 0) {
  9618. return int32(_XML_ERROR_NO_MEMORY)
  9619. }
  9620. goto _2
  9621. _2:
  9622. ;
  9623. i++
  9624. }
  9625. case int32(m_XML_TOK_DATA_CHARS):
  9626. if !(_poolAppend(tls, pool, enc, ptr, *(*uintptr)(unsafe.Pointer(bp))) != 0) {
  9627. return int32(_XML_ERROR_NO_MEMORY)
  9628. }
  9629. case -int32(3):
  9630. *(*uintptr)(unsafe.Pointer(bp)) = ptr + uintptr((*TENCODING)(unsafe.Pointer(enc)).FminBytesPerChar)
  9631. /* fall through */
  9632. fallthrough
  9633. case int32(m_XML_TOK_ATTRIBUTE_VALUE_S):
  9634. fallthrough
  9635. case int32(m_XML_TOK_DATA_NEWLINE):
  9636. if !(isCdata != 0) && (int64((*TSTRING_POOL)(unsafe.Pointer(pool)).Fptr)-int64((*TSTRING_POOL)(unsafe.Pointer(pool)).Fstart) == 0 || int32(*(*TXML_Char)(unsafe.Pointer((*TSTRING_POOL)(unsafe.Pointer(pool)).Fptr + uintptr(-libc.Int32FromInt32(1))))) == int32(0x20)) {
  9637. break
  9638. }
  9639. if (*TSTRING_POOL)(unsafe.Pointer(pool)).Fptr == (*TSTRING_POOL)(unsafe.Pointer(pool)).Fend && !(_poolGrow(tls, pool) != 0) {
  9640. v6 = 0
  9641. } else {
  9642. v8 = pool + 24
  9643. v7 = *(*uintptr)(unsafe.Pointer(v8))
  9644. *(*uintptr)(unsafe.Pointer(v8))++
  9645. *(*TXML_Char)(unsafe.Pointer(v7)) = int8(0x20)
  9646. v6 = libc.Int32FromInt32(1)
  9647. }
  9648. if !(v6 != 0) {
  9649. return int32(_XML_ERROR_NO_MEMORY)
  9650. }
  9651. case int32(m_XML_TOK_ENTITY_REF):
  9652. *(*TXML_Char)(unsafe.Pointer(bp + 12)) = int8((*(*func(*libc.TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*TENCODING)(unsafe.Pointer(enc)).FpredefinedEntityName})))(tls, enc, ptr+uintptr((*TENCODING)(unsafe.Pointer(enc)).FminBytesPerChar), *(*uintptr)(unsafe.Pointer(bp))-uintptr((*TENCODING)(unsafe.Pointer(enc)).FminBytesPerChar)))
  9653. if *(*TXML_Char)(unsafe.Pointer(bp + 12)) != 0 {
  9654. /* NOTE: We are replacing 4-6 characters original input for 1 character
  9655. * so there is no amplification and hence recording without
  9656. * protection. */
  9657. _accountingDiffTolerated(tls, parser, tok, bp+12, bp+12+uintptr(1), int32(5965), int32(_XML_ACCOUNT_ENTITY_EXPANSION))
  9658. if (*TSTRING_POOL)(unsafe.Pointer(pool)).Fptr == (*TSTRING_POOL)(unsafe.Pointer(pool)).Fend && !(_poolGrow(tls, pool) != 0) {
  9659. v9 = 0
  9660. } else {
  9661. v11 = pool + 24
  9662. v10 = *(*uintptr)(unsafe.Pointer(v11))
  9663. *(*uintptr)(unsafe.Pointer(v11))++
  9664. *(*TXML_Char)(unsafe.Pointer(v10)) = *(*TXML_Char)(unsafe.Pointer(bp + 12))
  9665. v9 = libc.Int32FromInt32(1)
  9666. }
  9667. if !(v9 != 0) {
  9668. return int32(_XML_ERROR_NO_MEMORY)
  9669. }
  9670. break
  9671. }
  9672. name = _poolStoreString(tls, parser+832, enc, ptr+uintptr((*TENCODING)(unsafe.Pointer(enc)).FminBytesPerChar), *(*uintptr)(unsafe.Pointer(bp))-uintptr((*TENCODING)(unsafe.Pointer(enc)).FminBytesPerChar))
  9673. if !(name != 0) {
  9674. return int32(_XML_ERROR_NO_MEMORY)
  9675. }
  9676. entity = _lookup(tls, parser, dtd, name, uint64(0))
  9677. (*TSTRING_POOL)(unsafe.Pointer(parser + 832)).Fptr = (*TSTRING_POOL)(unsafe.Pointer(parser + 832)).Fstart
  9678. /* First, determine if a check for an existing declaration is needed;
  9679. if yes, check that the entity exists, and that it is internal.
  9680. */
  9681. if pool == dtd+160 { /* are we called from prolog? */
  9682. if v13 = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_prologState.FdocumentEntity != 0; v13 {
  9683. if (*TDTD)(unsafe.Pointer(dtd)).Fstandalone != 0 {
  9684. v12 = libc.BoolInt32(!((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_openInternalEntities != 0))
  9685. } else {
  9686. v12 = libc.BoolInt32(!((*TDTD)(unsafe.Pointer(dtd)).FhasParamEntityRefs != 0))
  9687. }
  9688. }
  9689. checkEntityDecl = libc.BoolInt8(v13 && v12 != 0)
  9690. } else { /* if (pool == &parser->m_tempPool): we are called from content */
  9691. checkEntityDecl = libc.BoolInt8(!((*TDTD)(unsafe.Pointer(dtd)).FhasParamEntityRefs != 0) || (*TDTD)(unsafe.Pointer(dtd)).Fstandalone != 0)
  9692. }
  9693. if checkEntityDecl != 0 {
  9694. if !(entity != 0) {
  9695. return int32(_XML_ERROR_UNDEFINED_ENTITY)
  9696. } else {
  9697. if !((*TENTITY)(unsafe.Pointer(entity)).Fis_internal != 0) {
  9698. return int32(_XML_ERROR_ENTITY_DECLARED_IN_PE)
  9699. }
  9700. }
  9701. } else {
  9702. if !(entity != 0) {
  9703. /* Cannot report skipped entity here - see comments on
  9704. parser->m_skippedEntityHandler.
  9705. if (parser->m_skippedEntityHandler)
  9706. parser->m_skippedEntityHandler(parser->m_handlerArg, name, 0);
  9707. */
  9708. /* Cannot call the default handler because this would be
  9709. out of sync with the call to the startElementHandler.
  9710. if ((pool == &parser->m_tempPool) && parser->m_defaultHandler)
  9711. reportDefault(parser, enc, ptr, next);
  9712. */
  9713. break
  9714. }
  9715. }
  9716. if (*TENTITY)(unsafe.Pointer(entity)).Fopen != 0 {
  9717. if enc == (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_encoding {
  9718. /* It does not appear that this line can be executed.
  9719. *
  9720. * The "if (entity->open)" check catches recursive entity
  9721. * definitions. In order to be called with an open
  9722. * entity, it must have gone through this code before and
  9723. * been through the recursive call to
  9724. * appendAttributeValue() some lines below. That call
  9725. * sets the local encoding ("enc") to the parser's
  9726. * internal encoding (internal_utf8 or internal_utf16),
  9727. * which can never be the same as the principle encoding.
  9728. * It doesn't appear there is another code path that gets
  9729. * here with entity->open being TRUE.
  9730. *
  9731. * Since it is not certain that this logic is watertight,
  9732. * we keep the line and merely exclude it from coverage
  9733. * tests.
  9734. */
  9735. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_eventPtr = ptr /* LCOV_EXCL_LINE */
  9736. }
  9737. return int32(_XML_ERROR_RECURSIVE_ENTITY_REF)
  9738. }
  9739. if (*TENTITY)(unsafe.Pointer(entity)).Fnotation != 0 {
  9740. if enc == (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_encoding {
  9741. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_eventPtr = ptr
  9742. }
  9743. return int32(_XML_ERROR_BINARY_ENTITY_REF)
  9744. }
  9745. if !((*TENTITY)(unsafe.Pointer(entity)).FtextPtr != 0) {
  9746. if enc == (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_encoding {
  9747. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_eventPtr = ptr
  9748. }
  9749. return int32(_XML_ERROR_ATTRIBUTE_EXTERNAL_ENTITY_REF)
  9750. } else {
  9751. textEnd = (*TENTITY)(unsafe.Pointer(entity)).FtextPtr + uintptr((*TENTITY)(unsafe.Pointer(entity)).FtextLen)
  9752. (*TENTITY)(unsafe.Pointer(entity)).Fopen = libc.Uint8FromInt32(1)
  9753. _entityTrackingOnOpen(tls, parser, entity, int32(6046))
  9754. result = _appendAttributeValue(tls, parser, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_internalEncoding, isCdata, (*TENTITY)(unsafe.Pointer(entity)).FtextPtr, textEnd, pool, int32(_XML_ACCOUNT_ENTITY_EXPANSION))
  9755. _entityTrackingOnClose(tls, parser, entity, int32(6053))
  9756. (*TENTITY)(unsafe.Pointer(entity)).Fopen = libc.Uint8FromInt32(0)
  9757. if result != 0 {
  9758. return result
  9759. }
  9760. }
  9761. default:
  9762. /* The only token returned by XmlAttributeValueTok() that does
  9763. * not have an explicit case here is XML_TOK_PARTIAL_CHAR.
  9764. * Getting that would require an entity name to contain an
  9765. * incomplete XML character (e.g. \xE2\x82); however previous
  9766. * tokenisers will have already recognised and rejected such
  9767. * names before XmlAttributeValueTok() gets a look-in. This
  9768. * default case should be retained as a safety net, but the code
  9769. * excluded from coverage tests.
  9770. *
  9771. * LCOV_EXCL_START
  9772. */
  9773. if enc == (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_encoding {
  9774. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_eventPtr = ptr
  9775. }
  9776. return int32(_XML_ERROR_UNEXPECTED_STATE)
  9777. /* LCOV_EXCL_STOP */
  9778. }
  9779. ptr = *(*uintptr)(unsafe.Pointer(bp))
  9780. goto _1
  9781. _1:
  9782. }
  9783. /* not reached */
  9784. return r
  9785. }
  9786. func _storeEntityValue(tls *libc.TLS, parser TXML_Parser, enc uintptr, entityTextPtr uintptr, entityTextEnd uintptr, account _XML_Account) (r _XML_Error) {
  9787. bp := tls.Alloc(16)
  9788. defer tls.Free(16)
  9789. var dtd, entity, name, pool, v2, v3, v5, v6 uintptr
  9790. var i, n, oldInEntityValue, tok int32
  9791. var result _XML_Error
  9792. var _ /* buf at bp+8 */ [4]TXML_Char
  9793. var _ /* next at bp+0 */ uintptr
  9794. _, _, _, _, _, _, _, _, _, _, _, _, _ = dtd, entity, i, n, name, oldInEntityValue, pool, result, tok, v2, v3, v5, v6
  9795. dtd = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_dtd /* save one level of indirection */
  9796. pool = dtd + 208
  9797. result = int32(_XML_ERROR_NONE)
  9798. oldInEntityValue = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_prologState.FinEntityValue
  9799. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_prologState.FinEntityValue = int32(1)
  9800. /* never return Null for the value argument in EntityDeclHandler,
  9801. since this would indicate an external entity; therefore we
  9802. have to make sure that entityValuePool.start is not null */
  9803. if !((*TSTRING_POOL)(unsafe.Pointer(pool)).Fblocks != 0) {
  9804. if !(_poolGrow(tls, pool) != 0) {
  9805. return int32(_XML_ERROR_NO_MEMORY)
  9806. }
  9807. }
  9808. for {
  9809. *(*uintptr)(unsafe.Pointer(bp)) = entityTextPtr /* XmlEntityValueTok doesn't always set the last arg */
  9810. tok = (*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{*(*TSCANNER)(unsafe.Pointer(enc + 32 + 1*8))})))(tls, enc, entityTextPtr, entityTextEnd, bp)
  9811. if !(_accountingDiffTolerated(tls, parser, tok, entityTextPtr, *(*uintptr)(unsafe.Pointer(bp)), int32(6109), account) != 0) {
  9812. _accountingOnAbort(tls, parser)
  9813. result = int32(_XML_ERROR_AMPLIFICATION_LIMIT_BREACH)
  9814. goto endEntityValue
  9815. }
  9816. switch tok {
  9817. case int32(m_XML_TOK_PARAM_ENTITY_REF):
  9818. if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_isParamEntity != 0 || enc != (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_encoding {
  9819. name = _poolStoreString(tls, parser+784, enc, entityTextPtr+uintptr((*TENCODING)(unsafe.Pointer(enc)).FminBytesPerChar), *(*uintptr)(unsafe.Pointer(bp))-uintptr((*TENCODING)(unsafe.Pointer(enc)).FminBytesPerChar))
  9820. if !(name != 0) {
  9821. result = int32(_XML_ERROR_NO_MEMORY)
  9822. goto endEntityValue
  9823. }
  9824. entity = _lookup(tls, parser, dtd+264, name, uint64(0))
  9825. (*TSTRING_POOL)(unsafe.Pointer(parser + 784)).Fptr = (*TSTRING_POOL)(unsafe.Pointer(parser + 784)).Fstart
  9826. if !(entity != 0) {
  9827. /* not a well-formedness error - see XML 1.0: WFC Entity Declared */
  9828. /* cannot report skipped entity here - see comments on
  9829. parser->m_skippedEntityHandler
  9830. if (parser->m_skippedEntityHandler)
  9831. parser->m_skippedEntityHandler(parser->m_handlerArg, name, 0);
  9832. */
  9833. (*TDTD)(unsafe.Pointer(dtd)).FkeepProcessing = (*TDTD)(unsafe.Pointer(dtd)).Fstandalone
  9834. goto endEntityValue
  9835. }
  9836. if (*TENTITY)(unsafe.Pointer(entity)).Fopen != 0 {
  9837. if enc == (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_encoding {
  9838. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_eventPtr = entityTextPtr
  9839. }
  9840. result = int32(_XML_ERROR_RECURSIVE_ENTITY_REF)
  9841. goto endEntityValue
  9842. }
  9843. if (*TENTITY)(unsafe.Pointer(entity)).FsystemId != 0 {
  9844. if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_externalEntityRefHandler != 0 {
  9845. (*TDTD)(unsafe.Pointer(dtd)).FparamEntityRead = libc.Uint8FromInt32(0)
  9846. (*TENTITY)(unsafe.Pointer(entity)).Fopen = libc.Uint8FromInt32(1)
  9847. _entityTrackingOnOpen(tls, parser, entity, int32(6152))
  9848. if !((*(*func(*libc.TLS, TXML_Parser, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_externalEntityRefHandler})))(tls, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_externalEntityRefHandlerArg, uintptr(0), (*TENTITY)(unsafe.Pointer(entity)).Fbase, (*TENTITY)(unsafe.Pointer(entity)).FsystemId, (*TENTITY)(unsafe.Pointer(entity)).FpublicId) != 0) {
  9849. _entityTrackingOnClose(tls, parser, entity, int32(6156))
  9850. (*TENTITY)(unsafe.Pointer(entity)).Fopen = libc.Uint8FromInt32(0)
  9851. result = int32(_XML_ERROR_EXTERNAL_ENTITY_HANDLING)
  9852. goto endEntityValue
  9853. }
  9854. _entityTrackingOnClose(tls, parser, entity, int32(6161))
  9855. (*TENTITY)(unsafe.Pointer(entity)).Fopen = libc.Uint8FromInt32(0)
  9856. if !((*TDTD)(unsafe.Pointer(dtd)).FparamEntityRead != 0) {
  9857. (*TDTD)(unsafe.Pointer(dtd)).FkeepProcessing = (*TDTD)(unsafe.Pointer(dtd)).Fstandalone
  9858. }
  9859. } else {
  9860. (*TDTD)(unsafe.Pointer(dtd)).FkeepProcessing = (*TDTD)(unsafe.Pointer(dtd)).Fstandalone
  9861. }
  9862. } else {
  9863. (*TENTITY)(unsafe.Pointer(entity)).Fopen = libc.Uint8FromInt32(1)
  9864. _entityTrackingOnOpen(tls, parser, entity, int32(6169))
  9865. result = _storeEntityValue(tls, parser, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_internalEncoding, (*TENTITY)(unsafe.Pointer(entity)).FtextPtr, (*TENTITY)(unsafe.Pointer(entity)).FtextPtr+uintptr((*TENTITY)(unsafe.Pointer(entity)).FtextLen), int32(_XML_ACCOUNT_ENTITY_EXPANSION))
  9866. _entityTrackingOnClose(tls, parser, entity, int32(6174))
  9867. (*TENTITY)(unsafe.Pointer(entity)).Fopen = libc.Uint8FromInt32(0)
  9868. if result != 0 {
  9869. goto endEntityValue
  9870. }
  9871. }
  9872. break
  9873. }
  9874. /* In the internal subset, PE references are not legal
  9875. within markup declarations, e.g entity values in this case. */
  9876. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_eventPtr = entityTextPtr
  9877. result = int32(_XML_ERROR_PARAM_ENTITY_REF)
  9878. goto endEntityValue
  9879. case -int32(4):
  9880. result = int32(_XML_ERROR_NONE)
  9881. goto endEntityValue
  9882. case int32(m_XML_TOK_ENTITY_REF):
  9883. fallthrough
  9884. case int32(m_XML_TOK_DATA_CHARS):
  9885. if !(_poolAppend(tls, pool, enc, entityTextPtr, *(*uintptr)(unsafe.Pointer(bp))) != 0) {
  9886. result = int32(_XML_ERROR_NO_MEMORY)
  9887. goto endEntityValue
  9888. }
  9889. case -int32(3):
  9890. *(*uintptr)(unsafe.Pointer(bp)) = entityTextPtr + uintptr((*TENCODING)(unsafe.Pointer(enc)).FminBytesPerChar)
  9891. /* fall through */
  9892. fallthrough
  9893. case int32(m_XML_TOK_DATA_NEWLINE):
  9894. if (*TSTRING_POOL)(unsafe.Pointer(pool)).Fend == (*TSTRING_POOL)(unsafe.Pointer(pool)).Fptr && !(_poolGrow(tls, pool) != 0) {
  9895. result = int32(_XML_ERROR_NO_MEMORY)
  9896. goto endEntityValue
  9897. }
  9898. v3 = pool + 24
  9899. v2 = *(*uintptr)(unsafe.Pointer(v3))
  9900. *(*uintptr)(unsafe.Pointer(v3))++
  9901. *(*TXML_Char)(unsafe.Pointer(v2)) = int8(0xA)
  9902. case int32(m_XML_TOK_CHAR_REF):
  9903. n = (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*TENCODING)(unsafe.Pointer(enc)).FcharRefNumber})))(tls, enc, entityTextPtr)
  9904. if n < 0 {
  9905. if enc == (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_encoding {
  9906. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_eventPtr = entityTextPtr
  9907. }
  9908. result = int32(_XML_ERROR_BAD_CHAR_REF)
  9909. goto endEntityValue
  9910. }
  9911. n = XXmlUtf8Encode(tls, n, bp+8)
  9912. /* The XmlEncode() functions can never return 0 here. That
  9913. * error return happens if the code point passed in is either
  9914. * negative or greater than or equal to 0x110000. The
  9915. * XmlCharRefNumber() functions will all return a number
  9916. * strictly less than 0x110000 or a negative value if an error
  9917. * occurred. The negative value is intercepted above, so
  9918. * XmlEncode() is never passed a value it might return an
  9919. * error for.
  9920. */
  9921. i = 0
  9922. for {
  9923. if !(i < n) {
  9924. break
  9925. }
  9926. if (*TSTRING_POOL)(unsafe.Pointer(pool)).Fend == (*TSTRING_POOL)(unsafe.Pointer(pool)).Fptr && !(_poolGrow(tls, pool) != 0) {
  9927. result = int32(_XML_ERROR_NO_MEMORY)
  9928. goto endEntityValue
  9929. }
  9930. v6 = pool + 24
  9931. v5 = *(*uintptr)(unsafe.Pointer(v6))
  9932. *(*uintptr)(unsafe.Pointer(v6))++
  9933. *(*TXML_Char)(unsafe.Pointer(v5)) = (*(*[4]TXML_Char)(unsafe.Pointer(bp + 8)))[i]
  9934. goto _4
  9935. _4:
  9936. ;
  9937. i++
  9938. }
  9939. case -int32(1):
  9940. if enc == (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_encoding {
  9941. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_eventPtr = entityTextPtr
  9942. }
  9943. result = int32(_XML_ERROR_INVALID_TOKEN)
  9944. goto endEntityValue
  9945. case m_XML_TOK_INVALID:
  9946. if enc == (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_encoding {
  9947. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_eventPtr = *(*uintptr)(unsafe.Pointer(bp))
  9948. }
  9949. result = int32(_XML_ERROR_INVALID_TOKEN)
  9950. goto endEntityValue
  9951. default:
  9952. /* This default case should be unnecessary -- all the tokens
  9953. * that XmlEntityValueTok() can return have their own explicit
  9954. * cases -- but should be retained for safety. We do however
  9955. * exclude it from the coverage statistics.
  9956. *
  9957. * LCOV_EXCL_START
  9958. */
  9959. if enc == (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_encoding {
  9960. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_eventPtr = entityTextPtr
  9961. }
  9962. result = int32(_XML_ERROR_UNEXPECTED_STATE)
  9963. goto endEntityValue
  9964. /* LCOV_EXCL_STOP */
  9965. }
  9966. entityTextPtr = *(*uintptr)(unsafe.Pointer(bp))
  9967. goto _1
  9968. _1:
  9969. }
  9970. goto endEntityValue
  9971. endEntityValue:
  9972. ;
  9973. (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_prologState.FinEntityValue = oldInEntityValue
  9974. return result
  9975. }
  9976. func _normalizeLines(tls *libc.TLS, s uintptr) {
  9977. var p, v2, v3, v4, v5 uintptr
  9978. _, _, _, _, _ = p, v2, v3, v4, v5
  9979. for {
  9980. if int32(*(*TXML_Char)(unsafe.Pointer(s))) == int32('\000') {
  9981. return
  9982. }
  9983. if int32(*(*TXML_Char)(unsafe.Pointer(s))) == int32(0xD) {
  9984. break
  9985. }
  9986. goto _1
  9987. _1:
  9988. ;
  9989. s++
  9990. }
  9991. p = s
  9992. for cond := true; cond; cond = *(*TXML_Char)(unsafe.Pointer(s)) != 0 {
  9993. if int32(*(*TXML_Char)(unsafe.Pointer(s))) == int32(0xD) {
  9994. v2 = p
  9995. p++
  9996. *(*TXML_Char)(unsafe.Pointer(v2)) = int8(0xA)
  9997. s++
  9998. v3 = s
  9999. if int32(*(*TXML_Char)(unsafe.Pointer(v3))) == int32(0xA) {
  10000. s++
  10001. }
  10002. } else {
  10003. v4 = p
  10004. p++
  10005. v5 = s
  10006. s++
  10007. *(*TXML_Char)(unsafe.Pointer(v4)) = *(*TXML_Char)(unsafe.Pointer(v5))
  10008. }
  10009. }
  10010. *(*TXML_Char)(unsafe.Pointer(p)) = int8('\000')
  10011. }
  10012. func _reportProcessingInstruction(tls *libc.TLS, parser TXML_Parser, enc uintptr, start uintptr, end uintptr) (r int32) {
  10013. var data, target, tem uintptr
  10014. _, _, _ = data, target, tem
  10015. if !((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_processingInstructionHandler != 0) {
  10016. if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_defaultHandler != 0 {
  10017. _reportDefault(tls, parser, enc, start, end)
  10018. }
  10019. return int32(1)
  10020. }
  10021. start += uintptr((*TENCODING)(unsafe.Pointer(enc)).FminBytesPerChar * int32(2))
  10022. tem = start + uintptr((*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*TENCODING)(unsafe.Pointer(enc)).FnameLength})))(tls, enc, start))
  10023. target = _poolStoreString(tls, parser+784, enc, start, tem)
  10024. if !(target != 0) {
  10025. return 0
  10026. }
  10027. (*TSTRING_POOL)(unsafe.Pointer(parser + 784)).Fstart = (*TSTRING_POOL)(unsafe.Pointer(parser + 784)).Fptr
  10028. data = _poolStoreString(tls, parser+784, enc, (*(*func(*libc.TLS, uintptr, uintptr) uintptr)(unsafe.Pointer(&struct{ uintptr }{(*TENCODING)(unsafe.Pointer(enc)).FskipS})))(tls, enc, tem), end-uintptr((*TENCODING)(unsafe.Pointer(enc)).FminBytesPerChar*int32(2)))
  10029. if !(data != 0) {
  10030. return 0
  10031. }
  10032. _normalizeLines(tls, data)
  10033. (*(*func(*libc.TLS, uintptr, uintptr, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_processingInstructionHandler})))(tls, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_handlerArg, target, data)
  10034. _poolClear(tls, parser+784)
  10035. return int32(1)
  10036. }
  10037. func _reportComment(tls *libc.TLS, parser TXML_Parser, enc uintptr, start uintptr, end uintptr) (r int32) {
  10038. var data uintptr
  10039. _ = data
  10040. if !((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_commentHandler != 0) {
  10041. if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_defaultHandler != 0 {
  10042. _reportDefault(tls, parser, enc, start, end)
  10043. }
  10044. return int32(1)
  10045. }
  10046. data = _poolStoreString(tls, parser+784, enc, start+uintptr((*TENCODING)(unsafe.Pointer(enc)).FminBytesPerChar*int32(4)), end-uintptr((*TENCODING)(unsafe.Pointer(enc)).FminBytesPerChar*int32(3)))
  10047. if !(data != 0) {
  10048. return 0
  10049. }
  10050. _normalizeLines(tls, data)
  10051. (*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_commentHandler})))(tls, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_handlerArg, data)
  10052. _poolClear(tls, parser+784)
  10053. return int32(1)
  10054. }
  10055. func _reportDefault(tls *libc.TLS, parser TXML_Parser, enc uintptr, _s uintptr, end uintptr) {
  10056. bp := tls.Alloc(16)
  10057. defer tls.Free(16)
  10058. *(*uintptr)(unsafe.Pointer(bp)) = _s
  10059. var convert_res _XML_Convert_Result
  10060. var eventEndPP, eventPP uintptr
  10061. var _ /* dataPtr at bp+8 */ uintptr
  10062. _, _, _ = convert_res, eventEndPP, eventPP
  10063. if !((*TENCODING)(unsafe.Pointer(enc)).FisUtf8 != 0) {
  10064. if enc == (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_encoding {
  10065. eventPP = parser + 544
  10066. eventEndPP = parser + 552
  10067. } else {
  10068. /* To get here, two things must be true; the parser must be
  10069. * using a character encoding that is not the same as the
  10070. * encoding passed in, and the encoding passed in must need
  10071. * conversion to the internal format (UTF-8 unless XML_UNICODE
  10072. * is defined). The only occasions on which the encoding passed
  10073. * in is not the same as the parser's encoding are when it is
  10074. * the internal encoding (e.g. a previously defined parameter
  10075. * entity, already converted to internal format). This by
  10076. * definition doesn't need conversion, so the whole branch never
  10077. * gets executed.
  10078. *
  10079. * For safety's sake we don't delete these lines and merely
  10080. * exclude them from coverage statistics.
  10081. *
  10082. * LCOV_EXCL_START
  10083. */
  10084. eventPP = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_openInternalEntities
  10085. eventEndPP = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_openInternalEntities + 8
  10086. /* LCOV_EXCL_STOP */
  10087. }
  10088. for cond := true; cond; cond = convert_res != int32(_XML_CONVERT_COMPLETED) && convert_res != int32(_XML_CONVERT_INPUT_INCOMPLETE) {
  10089. *(*uintptr)(unsafe.Pointer(bp + 8)) = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_dataBuf
  10090. convert_res = (*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr, uintptr) _XML_Convert_Result)(unsafe.Pointer(&struct{ uintptr }{(*TENCODING)(unsafe.Pointer(enc)).Futf8Convert})))(tls, enc, bp, end, bp+8, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_dataBufEnd)
  10091. *(*uintptr)(unsafe.Pointer(eventEndPP)) = *(*uintptr)(unsafe.Pointer(bp))
  10092. (*(*func(*libc.TLS, uintptr, uintptr, int32))(unsafe.Pointer(&struct{ uintptr }{(*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_defaultHandler})))(tls, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_handlerArg, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_dataBuf, int32(int64(*(*uintptr)(unsafe.Pointer(bp + 8)))-int64((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_dataBuf)))
  10093. *(*uintptr)(unsafe.Pointer(eventPP)) = *(*uintptr)(unsafe.Pointer(bp))
  10094. }
  10095. } else {
  10096. (*(*func(*libc.TLS, uintptr, uintptr, int32))(unsafe.Pointer(&struct{ uintptr }{(*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_defaultHandler})))(tls, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_handlerArg, *(*uintptr)(unsafe.Pointer(bp)), int32(int64(end)-int64(*(*uintptr)(unsafe.Pointer(bp)))))
  10097. }
  10098. }
  10099. func _defineAttribute(tls *libc.TLS, type1 uintptr, attId uintptr, isCdata TXML_Bool, isId TXML_Bool, value uintptr, parser TXML_Parser) (r int32) {
  10100. var att, temp uintptr
  10101. var count, i int32
  10102. _, _, _, _ = att, count, i, temp
  10103. if value != 0 || isId != 0 {
  10104. i = 0
  10105. for {
  10106. if !(i < (*TELEMENT_TYPE)(unsafe.Pointer(type1)).FnDefaultAtts) {
  10107. break
  10108. }
  10109. if attId == (*(*TDEFAULT_ATTRIBUTE)(unsafe.Pointer((*TELEMENT_TYPE)(unsafe.Pointer(type1)).FdefaultAtts + uintptr(i)*24))).Fid {
  10110. return int32(1)
  10111. }
  10112. goto _1
  10113. _1:
  10114. ;
  10115. i++
  10116. }
  10117. if isId != 0 && !((*TELEMENT_TYPE)(unsafe.Pointer(type1)).FidAtt != 0) && !((*TATTRIBUTE_ID)(unsafe.Pointer(attId)).Fxmlns != 0) {
  10118. (*TELEMENT_TYPE)(unsafe.Pointer(type1)).FidAtt = attId
  10119. }
  10120. }
  10121. if (*TELEMENT_TYPE)(unsafe.Pointer(type1)).FnDefaultAtts == (*TELEMENT_TYPE)(unsafe.Pointer(type1)).FallocDefaultAtts {
  10122. if (*TELEMENT_TYPE)(unsafe.Pointer(type1)).FallocDefaultAtts == 0 {
  10123. (*TELEMENT_TYPE)(unsafe.Pointer(type1)).FallocDefaultAtts = int32(8)
  10124. (*TELEMENT_TYPE)(unsafe.Pointer(type1)).FdefaultAtts = (*(*func(*libc.TLS, Tsize_t) uintptr)(unsafe.Pointer(&struct{ uintptr }{(*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_mem.Fmalloc_fcn})))(tls, libc.Uint64FromInt32((*TELEMENT_TYPE)(unsafe.Pointer(type1)).FallocDefaultAtts)*libc.Uint64FromInt64(24))
  10125. if !((*TELEMENT_TYPE)(unsafe.Pointer(type1)).FdefaultAtts != 0) {
  10126. (*TELEMENT_TYPE)(unsafe.Pointer(type1)).FallocDefaultAtts = 0
  10127. return 0
  10128. }
  10129. } else {
  10130. /* Detect and prevent integer overflow */
  10131. if (*TELEMENT_TYPE)(unsafe.Pointer(type1)).FallocDefaultAtts > libc.Int32FromInt32(m___INT_MAX__)/libc.Int32FromInt32(2) {
  10132. return 0
  10133. }
  10134. count = (*TELEMENT_TYPE)(unsafe.Pointer(type1)).FallocDefaultAtts * int32(2)
  10135. /* Detect and prevent integer overflow.
  10136. * The preprocessor guard addresses the "always false" warning
  10137. * from -Wtype-limits on platforms where
  10138. * sizeof(unsigned int) < sizeof(size_t), e.g. on x86_64. */
  10139. temp = (*(*func(*libc.TLS, uintptr, Tsize_t) uintptr)(unsafe.Pointer(&struct{ uintptr }{(*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_mem.Frealloc_fcn})))(tls, (*TELEMENT_TYPE)(unsafe.Pointer(type1)).FdefaultAtts, libc.Uint64FromInt32(count)*libc.Uint64FromInt64(24))
  10140. if temp == libc.UintptrFromInt32(0) {
  10141. return 0
  10142. }
  10143. (*TELEMENT_TYPE)(unsafe.Pointer(type1)).FallocDefaultAtts = count
  10144. (*TELEMENT_TYPE)(unsafe.Pointer(type1)).FdefaultAtts = temp
  10145. }
  10146. }
  10147. att = (*TELEMENT_TYPE)(unsafe.Pointer(type1)).FdefaultAtts + uintptr((*TELEMENT_TYPE)(unsafe.Pointer(type1)).FnDefaultAtts)*24
  10148. (*TDEFAULT_ATTRIBUTE)(unsafe.Pointer(att)).Fid = attId
  10149. (*TDEFAULT_ATTRIBUTE)(unsafe.Pointer(att)).Fvalue = value
  10150. (*TDEFAULT_ATTRIBUTE)(unsafe.Pointer(att)).FisCdata = isCdata
  10151. if !(isCdata != 0) {
  10152. (*TATTRIBUTE_ID)(unsafe.Pointer(attId)).FmaybeTokenized = libc.Uint8FromInt32(1)
  10153. }
  10154. *(*int32)(unsafe.Pointer(type1 + 24)) += int32(1)
  10155. return int32(1)
  10156. }
  10157. func _setElementTypePrefix(tls *libc.TLS, parser TXML_Parser, elementType uintptr) (r int32) {
  10158. var dtd, name, prefix, s, v4, v5, v7, v8 uintptr
  10159. var v3, v6 int32
  10160. _, _, _, _, _, _, _, _, _, _ = dtd, name, prefix, s, v3, v4, v5, v6, v7, v8
  10161. dtd = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_dtd
  10162. name = (*TELEMENT_TYPE)(unsafe.Pointer(elementType)).Fname
  10163. for {
  10164. if !(*(*TXML_Char)(unsafe.Pointer(name)) != 0) {
  10165. break
  10166. }
  10167. if int32(*(*TXML_Char)(unsafe.Pointer(name))) == int32(m_ASCII_COLON) {
  10168. s = (*TELEMENT_TYPE)(unsafe.Pointer(elementType)).Fname
  10169. for {
  10170. if !(s != name) {
  10171. break
  10172. }
  10173. if (*TSTRING_POOL)(unsafe.Pointer(dtd+160)).Fptr == (*TSTRING_POOL)(unsafe.Pointer(dtd+160)).Fend && !(_poolGrow(tls, dtd+160) != 0) {
  10174. v3 = 0
  10175. } else {
  10176. v5 = dtd + 160 + 24
  10177. v4 = *(*uintptr)(unsafe.Pointer(v5))
  10178. *(*uintptr)(unsafe.Pointer(v5))++
  10179. *(*TXML_Char)(unsafe.Pointer(v4)) = *(*TXML_Char)(unsafe.Pointer(s))
  10180. v3 = libc.Int32FromInt32(1)
  10181. }
  10182. if !(v3 != 0) {
  10183. return 0
  10184. }
  10185. goto _2
  10186. _2:
  10187. ;
  10188. s++
  10189. }
  10190. if (*TSTRING_POOL)(unsafe.Pointer(dtd+160)).Fptr == (*TSTRING_POOL)(unsafe.Pointer(dtd+160)).Fend && !(_poolGrow(tls, dtd+160) != 0) {
  10191. v6 = 0
  10192. } else {
  10193. v8 = dtd + 160 + 24
  10194. v7 = *(*uintptr)(unsafe.Pointer(v8))
  10195. *(*uintptr)(unsafe.Pointer(v8))++
  10196. *(*TXML_Char)(unsafe.Pointer(v7)) = int8('\000')
  10197. v6 = libc.Int32FromInt32(1)
  10198. }
  10199. if !(v6 != 0) {
  10200. return 0
  10201. }
  10202. prefix = _lookup(tls, parser, dtd+120, (*TSTRING_POOL)(unsafe.Pointer(dtd+160)).Fstart, uint64(16))
  10203. if !(prefix != 0) {
  10204. return 0
  10205. }
  10206. if (*TPREFIX)(unsafe.Pointer(prefix)).Fname == (*TSTRING_POOL)(unsafe.Pointer(dtd+160)).Fstart {
  10207. (*TSTRING_POOL)(unsafe.Pointer(dtd + 160)).Fstart = (*TSTRING_POOL)(unsafe.Pointer(dtd + 160)).Fptr
  10208. } else {
  10209. (*TSTRING_POOL)(unsafe.Pointer(dtd + 160)).Fptr = (*TSTRING_POOL)(unsafe.Pointer(dtd + 160)).Fstart
  10210. }
  10211. (*TELEMENT_TYPE)(unsafe.Pointer(elementType)).Fprefix = prefix
  10212. break
  10213. }
  10214. goto _1
  10215. _1:
  10216. ;
  10217. name++
  10218. }
  10219. return int32(1)
  10220. }
  10221. func _getAttributeId(tls *libc.TLS, parser TXML_Parser, enc uintptr, start uintptr, end uintptr) (r uintptr) {
  10222. var dtd, id, name, v10, v11, v2, v3, v7, v8 uintptr
  10223. var i, j, v1, v6, v9 int32
  10224. _, _, _, _, _, _, _, _, _, _, _, _, _, _ = dtd, i, id, j, name, v1, v10, v11, v2, v3, v6, v7, v8, v9
  10225. dtd = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_dtd
  10226. if (*TSTRING_POOL)(unsafe.Pointer(dtd+160)).Fptr == (*TSTRING_POOL)(unsafe.Pointer(dtd+160)).Fend && !(_poolGrow(tls, dtd+160) != 0) {
  10227. v1 = 0
  10228. } else {
  10229. v3 = dtd + 160 + 24
  10230. v2 = *(*uintptr)(unsafe.Pointer(v3))
  10231. *(*uintptr)(unsafe.Pointer(v3))++
  10232. *(*TXML_Char)(unsafe.Pointer(v2)) = int8('\000')
  10233. v1 = libc.Int32FromInt32(1)
  10234. }
  10235. if !(v1 != 0) {
  10236. return libc.UintptrFromInt32(0)
  10237. }
  10238. name = _poolStoreString(tls, dtd+160, enc, start, end)
  10239. if !(name != 0) {
  10240. return libc.UintptrFromInt32(0)
  10241. }
  10242. /* skip quotation mark - its storage will be re-used (like in name[-1]) */
  10243. name++
  10244. id = _lookup(tls, parser, dtd+80, name, uint64(24))
  10245. if !(id != 0) {
  10246. return libc.UintptrFromInt32(0)
  10247. }
  10248. if (*TATTRIBUTE_ID)(unsafe.Pointer(id)).Fname != name {
  10249. (*TSTRING_POOL)(unsafe.Pointer(dtd + 160)).Fptr = (*TSTRING_POOL)(unsafe.Pointer(dtd + 160)).Fstart
  10250. } else {
  10251. (*TSTRING_POOL)(unsafe.Pointer(dtd + 160)).Fstart = (*TSTRING_POOL)(unsafe.Pointer(dtd + 160)).Fptr
  10252. if !!((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_ns != 0) {
  10253. if int32(*(*TXML_Char)(unsafe.Pointer(name))) == int32(m_ASCII_x) && int32(*(*TXML_Char)(unsafe.Pointer(name + 1))) == int32(m_ASCII_m) && int32(*(*TXML_Char)(unsafe.Pointer(name + 2))) == int32(m_ASCII_l) && int32(*(*TXML_Char)(unsafe.Pointer(name + 3))) == int32(m_ASCII_n) && int32(*(*TXML_Char)(unsafe.Pointer(name + 4))) == int32(m_ASCII_s) && (int32(*(*TXML_Char)(unsafe.Pointer(name + 5))) == int32('\000') || int32(*(*TXML_Char)(unsafe.Pointer(name + 5))) == int32(m_ASCII_COLON)) {
  10254. if int32(*(*TXML_Char)(unsafe.Pointer(name + 5))) == int32('\000') {
  10255. (*TATTRIBUTE_ID)(unsafe.Pointer(id)).Fprefix = dtd + 304
  10256. } else {
  10257. (*TATTRIBUTE_ID)(unsafe.Pointer(id)).Fprefix = _lookup(tls, parser, dtd+120, name+uintptr(6), uint64(16))
  10258. }
  10259. (*TATTRIBUTE_ID)(unsafe.Pointer(id)).Fxmlns = libc.Uint8FromInt32(1)
  10260. } else {
  10261. i = 0
  10262. for {
  10263. if !(*(*TXML_Char)(unsafe.Pointer(name + uintptr(i))) != 0) {
  10264. break
  10265. }
  10266. /* attributes without prefix are *not* in the default namespace */
  10267. if int32(*(*TXML_Char)(unsafe.Pointer(name + uintptr(i)))) == int32(m_ASCII_COLON) {
  10268. j = 0
  10269. for {
  10270. if !(j < i) {
  10271. break
  10272. }
  10273. if (*TSTRING_POOL)(unsafe.Pointer(dtd+160)).Fptr == (*TSTRING_POOL)(unsafe.Pointer(dtd+160)).Fend && !(_poolGrow(tls, dtd+160) != 0) {
  10274. v6 = 0
  10275. } else {
  10276. v8 = dtd + 160 + 24
  10277. v7 = *(*uintptr)(unsafe.Pointer(v8))
  10278. *(*uintptr)(unsafe.Pointer(v8))++
  10279. *(*TXML_Char)(unsafe.Pointer(v7)) = *(*TXML_Char)(unsafe.Pointer(name + uintptr(j)))
  10280. v6 = libc.Int32FromInt32(1)
  10281. }
  10282. if !(v6 != 0) {
  10283. return libc.UintptrFromInt32(0)
  10284. }
  10285. goto _5
  10286. _5:
  10287. ;
  10288. j++
  10289. }
  10290. if (*TSTRING_POOL)(unsafe.Pointer(dtd+160)).Fptr == (*TSTRING_POOL)(unsafe.Pointer(dtd+160)).Fend && !(_poolGrow(tls, dtd+160) != 0) {
  10291. v9 = 0
  10292. } else {
  10293. v11 = dtd + 160 + 24
  10294. v10 = *(*uintptr)(unsafe.Pointer(v11))
  10295. *(*uintptr)(unsafe.Pointer(v11))++
  10296. *(*TXML_Char)(unsafe.Pointer(v10)) = int8('\000')
  10297. v9 = libc.Int32FromInt32(1)
  10298. }
  10299. if !(v9 != 0) {
  10300. return libc.UintptrFromInt32(0)
  10301. }
  10302. (*TATTRIBUTE_ID)(unsafe.Pointer(id)).Fprefix = _lookup(tls, parser, dtd+120, (*TSTRING_POOL)(unsafe.Pointer(dtd+160)).Fstart, uint64(16))
  10303. if !((*TATTRIBUTE_ID)(unsafe.Pointer(id)).Fprefix != 0) {
  10304. return libc.UintptrFromInt32(0)
  10305. }
  10306. if (*TPREFIX)(unsafe.Pointer((*TATTRIBUTE_ID)(unsafe.Pointer(id)).Fprefix)).Fname == (*TSTRING_POOL)(unsafe.Pointer(dtd+160)).Fstart {
  10307. (*TSTRING_POOL)(unsafe.Pointer(dtd + 160)).Fstart = (*TSTRING_POOL)(unsafe.Pointer(dtd + 160)).Fptr
  10308. } else {
  10309. (*TSTRING_POOL)(unsafe.Pointer(dtd + 160)).Fptr = (*TSTRING_POOL)(unsafe.Pointer(dtd + 160)).Fstart
  10310. }
  10311. break
  10312. }
  10313. goto _4
  10314. _4:
  10315. ;
  10316. i++
  10317. }
  10318. }
  10319. }
  10320. }
  10321. return id
  10322. }
  10323. func _getContext(tls *libc.TLS, parser TXML_Parser) (r uintptr) {
  10324. bp := tls.Alloc(16)
  10325. defer tls.Free(16)
  10326. var dtd, e, prefix, s, s1, v10, v11, v15, v16, v18, v19, v2, v22, v23, v26, v27, v3, v31, v32, v34, v35, v6, v7 uintptr
  10327. var i, i1, len1, len11, v1, v14, v17, v21, v25, v30, v33, v5, v9 int32
  10328. var needSep TXML_Bool
  10329. var v12, v28 bool
  10330. var _ /* iter at bp+0 */ THASH_TABLE_ITER
  10331. _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = dtd, e, i, i1, len1, len11, needSep, prefix, s, s1, v1, v10, v11, v12, v14, v15, v16, v17, v18, v19, v2, v21, v22, v23, v25, v26, v27, v28, v3, v30, v31, v32, v33, v34, v35, v5, v6, v7, v9
  10332. dtd = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_dtd
  10333. needSep = libc.Uint8FromInt32(0)
  10334. if (*TDTD)(unsafe.Pointer(dtd)).FdefaultPrefix.Fbinding != 0 {
  10335. if (*TSTRING_POOL)(unsafe.Pointer(parser+784)).Fptr == (*TSTRING_POOL)(unsafe.Pointer(parser+784)).Fend && !(_poolGrow(tls, parser+784) != 0) {
  10336. v1 = 0
  10337. } else {
  10338. v3 = parser + 784 + 24
  10339. v2 = *(*uintptr)(unsafe.Pointer(v3))
  10340. *(*uintptr)(unsafe.Pointer(v3))++
  10341. *(*TXML_Char)(unsafe.Pointer(v2)) = int8(m_ASCII_EQUALS)
  10342. v1 = libc.Int32FromInt32(1)
  10343. }
  10344. if !(v1 != 0) {
  10345. return libc.UintptrFromInt32(0)
  10346. }
  10347. len1 = (*TBINDING)(unsafe.Pointer((*TDTD)(unsafe.Pointer(dtd)).FdefaultPrefix.Fbinding)).FuriLen
  10348. if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_namespaceSeparator != 0 {
  10349. len1--
  10350. }
  10351. i = 0
  10352. for {
  10353. if !(i < len1) {
  10354. break
  10355. }
  10356. if (*TSTRING_POOL)(unsafe.Pointer(parser+784)).Fptr == (*TSTRING_POOL)(unsafe.Pointer(parser+784)).Fend && !(_poolGrow(tls, parser+784) != 0) {
  10357. v5 = 0
  10358. } else {
  10359. v7 = parser + 784 + 24
  10360. v6 = *(*uintptr)(unsafe.Pointer(v7))
  10361. *(*uintptr)(unsafe.Pointer(v7))++
  10362. *(*TXML_Char)(unsafe.Pointer(v6)) = *(*TXML_Char)(unsafe.Pointer((*TBINDING)(unsafe.Pointer((*TDTD)(unsafe.Pointer(dtd)).FdefaultPrefix.Fbinding)).Furi + uintptr(i)))
  10363. v5 = libc.Int32FromInt32(1)
  10364. }
  10365. if !(v5 != 0) {
  10366. /* Because of memory caching, I don't believe this line can be
  10367. * executed.
  10368. *
  10369. * This is part of a loop copying the default prefix binding
  10370. * URI into the parser's temporary string pool. Previously,
  10371. * that URI was copied into the same string pool, with a
  10372. * terminating NUL character, as part of setContext(). When
  10373. * the pool was cleared, that leaves a block definitely big
  10374. * enough to hold the URI on the free block list of the pool.
  10375. * The URI copy in getContext() therefore cannot run out of
  10376. * memory.
  10377. *
  10378. * If the pool is used between the setContext() and
  10379. * getContext() calls, the worst it can do is leave a bigger
  10380. * block on the front of the free list. Given that this is
  10381. * all somewhat inobvious and program logic can be changed, we
  10382. * don't delete the line but we do exclude it from the test
  10383. * coverage statistics.
  10384. */
  10385. return libc.UintptrFromInt32(0) /* LCOV_EXCL_LINE */
  10386. }
  10387. goto _4
  10388. _4:
  10389. ;
  10390. i++
  10391. }
  10392. needSep = libc.Uint8FromInt32(1)
  10393. }
  10394. _hashTableIterInit(tls, bp, dtd+120)
  10395. for {
  10396. prefix = _hashTableIterNext(tls, bp)
  10397. if !(prefix != 0) {
  10398. break
  10399. }
  10400. if !((*TPREFIX)(unsafe.Pointer(prefix)).Fbinding != 0) {
  10401. /* This test appears to be (justifiable) paranoia. There does
  10402. * not seem to be a way of injecting a prefix without a binding
  10403. * that doesn't get errored long before this function is called.
  10404. * The test should remain for safety's sake, so we instead
  10405. * exclude the following line from the coverage statistics.
  10406. */
  10407. goto _8 /* LCOV_EXCL_LINE */
  10408. }
  10409. if v12 = needSep != 0; v12 {
  10410. if (*TSTRING_POOL)(unsafe.Pointer(parser+784)).Fptr == (*TSTRING_POOL)(unsafe.Pointer(parser+784)).Fend && !(_poolGrow(tls, parser+784) != 0) {
  10411. v9 = 0
  10412. } else {
  10413. v11 = parser + 784 + 24
  10414. v10 = *(*uintptr)(unsafe.Pointer(v11))
  10415. *(*uintptr)(unsafe.Pointer(v11))++
  10416. *(*TXML_Char)(unsafe.Pointer(v10)) = int8(m_ASCII_FF)
  10417. v9 = libc.Int32FromInt32(1)
  10418. }
  10419. }
  10420. if v12 && !(v9 != 0) {
  10421. return libc.UintptrFromInt32(0)
  10422. }
  10423. s = (*TPREFIX)(unsafe.Pointer(prefix)).Fname
  10424. for {
  10425. if !(*(*TXML_Char)(unsafe.Pointer(s)) != 0) {
  10426. break
  10427. }
  10428. if (*TSTRING_POOL)(unsafe.Pointer(parser+784)).Fptr == (*TSTRING_POOL)(unsafe.Pointer(parser+784)).Fend && !(_poolGrow(tls, parser+784) != 0) {
  10429. v14 = 0
  10430. } else {
  10431. v16 = parser + 784 + 24
  10432. v15 = *(*uintptr)(unsafe.Pointer(v16))
  10433. *(*uintptr)(unsafe.Pointer(v16))++
  10434. *(*TXML_Char)(unsafe.Pointer(v15)) = *(*TXML_Char)(unsafe.Pointer(s))
  10435. v14 = libc.Int32FromInt32(1)
  10436. }
  10437. if !(v14 != 0) {
  10438. return libc.UintptrFromInt32(0)
  10439. }
  10440. goto _13
  10441. _13:
  10442. ;
  10443. s++
  10444. }
  10445. if (*TSTRING_POOL)(unsafe.Pointer(parser+784)).Fptr == (*TSTRING_POOL)(unsafe.Pointer(parser+784)).Fend && !(_poolGrow(tls, parser+784) != 0) {
  10446. v17 = 0
  10447. } else {
  10448. v19 = parser + 784 + 24
  10449. v18 = *(*uintptr)(unsafe.Pointer(v19))
  10450. *(*uintptr)(unsafe.Pointer(v19))++
  10451. *(*TXML_Char)(unsafe.Pointer(v18)) = int8(m_ASCII_EQUALS)
  10452. v17 = libc.Int32FromInt32(1)
  10453. }
  10454. if !(v17 != 0) {
  10455. return libc.UintptrFromInt32(0)
  10456. }
  10457. len11 = (*TBINDING)(unsafe.Pointer((*TPREFIX)(unsafe.Pointer(prefix)).Fbinding)).FuriLen
  10458. if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_namespaceSeparator != 0 {
  10459. len11--
  10460. }
  10461. i1 = 0
  10462. for {
  10463. if !(i1 < len11) {
  10464. break
  10465. }
  10466. if (*TSTRING_POOL)(unsafe.Pointer(parser+784)).Fptr == (*TSTRING_POOL)(unsafe.Pointer(parser+784)).Fend && !(_poolGrow(tls, parser+784) != 0) {
  10467. v21 = 0
  10468. } else {
  10469. v23 = parser + 784 + 24
  10470. v22 = *(*uintptr)(unsafe.Pointer(v23))
  10471. *(*uintptr)(unsafe.Pointer(v23))++
  10472. *(*TXML_Char)(unsafe.Pointer(v22)) = *(*TXML_Char)(unsafe.Pointer((*TBINDING)(unsafe.Pointer((*TPREFIX)(unsafe.Pointer(prefix)).Fbinding)).Furi + uintptr(i1)))
  10473. v21 = libc.Int32FromInt32(1)
  10474. }
  10475. if !(v21 != 0) {
  10476. return libc.UintptrFromInt32(0)
  10477. }
  10478. goto _20
  10479. _20:
  10480. ;
  10481. i1++
  10482. }
  10483. needSep = libc.Uint8FromInt32(1)
  10484. goto _8
  10485. _8:
  10486. }
  10487. _hashTableIterInit(tls, bp, dtd)
  10488. for {
  10489. e = _hashTableIterNext(tls, bp)
  10490. if !(e != 0) {
  10491. break
  10492. }
  10493. if !((*TENTITY)(unsafe.Pointer(e)).Fopen != 0) {
  10494. goto _24
  10495. }
  10496. if v28 = needSep != 0; v28 {
  10497. if (*TSTRING_POOL)(unsafe.Pointer(parser+784)).Fptr == (*TSTRING_POOL)(unsafe.Pointer(parser+784)).Fend && !(_poolGrow(tls, parser+784) != 0) {
  10498. v25 = 0
  10499. } else {
  10500. v27 = parser + 784 + 24
  10501. v26 = *(*uintptr)(unsafe.Pointer(v27))
  10502. *(*uintptr)(unsafe.Pointer(v27))++
  10503. *(*TXML_Char)(unsafe.Pointer(v26)) = int8(m_ASCII_FF)
  10504. v25 = libc.Int32FromInt32(1)
  10505. }
  10506. }
  10507. if v28 && !(v25 != 0) {
  10508. return libc.UintptrFromInt32(0)
  10509. }
  10510. s1 = (*TENTITY)(unsafe.Pointer(e)).Fname
  10511. for {
  10512. if !(*(*TXML_Char)(unsafe.Pointer(s1)) != 0) {
  10513. break
  10514. }
  10515. if (*TSTRING_POOL)(unsafe.Pointer(parser+784)).Fptr == (*TSTRING_POOL)(unsafe.Pointer(parser+784)).Fend && !(_poolGrow(tls, parser+784) != 0) {
  10516. v30 = 0
  10517. } else {
  10518. v32 = parser + 784 + 24
  10519. v31 = *(*uintptr)(unsafe.Pointer(v32))
  10520. *(*uintptr)(unsafe.Pointer(v32))++
  10521. *(*TXML_Char)(unsafe.Pointer(v31)) = *(*TXML_Char)(unsafe.Pointer(s1))
  10522. v30 = libc.Int32FromInt32(1)
  10523. }
  10524. if !(v30 != 0) {
  10525. return uintptr(0)
  10526. }
  10527. goto _29
  10528. _29:
  10529. ;
  10530. s1++
  10531. }
  10532. needSep = libc.Uint8FromInt32(1)
  10533. goto _24
  10534. _24:
  10535. }
  10536. if (*TSTRING_POOL)(unsafe.Pointer(parser+784)).Fptr == (*TSTRING_POOL)(unsafe.Pointer(parser+784)).Fend && !(_poolGrow(tls, parser+784) != 0) {
  10537. v33 = 0
  10538. } else {
  10539. v35 = parser + 784 + 24
  10540. v34 = *(*uintptr)(unsafe.Pointer(v35))
  10541. *(*uintptr)(unsafe.Pointer(v35))++
  10542. *(*TXML_Char)(unsafe.Pointer(v34)) = int8('\000')
  10543. v33 = libc.Int32FromInt32(1)
  10544. }
  10545. if !(v33 != 0) {
  10546. return libc.UintptrFromInt32(0)
  10547. }
  10548. return (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_tempPool.Fstart
  10549. }
  10550. func _setContext(tls *libc.TLS, parser TXML_Parser, context uintptr) (r TXML_Bool) {
  10551. var dtd, e, prefix, s, v10, v12, v13, v15, v16, v2, v3, v5, v6, v9 uintptr
  10552. var v1, v11, v14, v4, v8 int32
  10553. _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = dtd, e, prefix, s, v1, v10, v11, v12, v13, v14, v15, v16, v2, v3, v4, v5, v6, v8, v9
  10554. dtd = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_dtd /* save one level of indirection */
  10555. s = context
  10556. for int32(*(*TXML_Char)(unsafe.Pointer(context))) != int32('\000') {
  10557. if int32(*(*TXML_Char)(unsafe.Pointer(s))) == int32(m_ASCII_FF) || int32(*(*TXML_Char)(unsafe.Pointer(s))) == int32('\000') {
  10558. if (*TSTRING_POOL)(unsafe.Pointer(parser+784)).Fptr == (*TSTRING_POOL)(unsafe.Pointer(parser+784)).Fend && !(_poolGrow(tls, parser+784) != 0) {
  10559. v1 = 0
  10560. } else {
  10561. v3 = parser + 784 + 24
  10562. v2 = *(*uintptr)(unsafe.Pointer(v3))
  10563. *(*uintptr)(unsafe.Pointer(v3))++
  10564. *(*TXML_Char)(unsafe.Pointer(v2)) = int8('\000')
  10565. v1 = libc.Int32FromInt32(1)
  10566. }
  10567. if !(v1 != 0) {
  10568. return libc.Uint8FromInt32(0)
  10569. }
  10570. e = _lookup(tls, parser, dtd, (*TSTRING_POOL)(unsafe.Pointer(parser+784)).Fstart, uint64(0))
  10571. if e != 0 {
  10572. (*TENTITY)(unsafe.Pointer(e)).Fopen = libc.Uint8FromInt32(1)
  10573. }
  10574. if int32(*(*TXML_Char)(unsafe.Pointer(s))) != int32('\000') {
  10575. s++
  10576. }
  10577. context = s
  10578. (*TSTRING_POOL)(unsafe.Pointer(parser + 784)).Fptr = (*TSTRING_POOL)(unsafe.Pointer(parser + 784)).Fstart
  10579. } else {
  10580. if int32(*(*TXML_Char)(unsafe.Pointer(s))) == int32(m_ASCII_EQUALS) {
  10581. if int64((*TSTRING_POOL)(unsafe.Pointer(parser+784)).Fptr)-int64((*TSTRING_POOL)(unsafe.Pointer(parser+784)).Fstart) == 0 {
  10582. prefix = dtd + 304
  10583. } else {
  10584. if (*TSTRING_POOL)(unsafe.Pointer(parser+784)).Fptr == (*TSTRING_POOL)(unsafe.Pointer(parser+784)).Fend && !(_poolGrow(tls, parser+784) != 0) {
  10585. v4 = 0
  10586. } else {
  10587. v6 = parser + 784 + 24
  10588. v5 = *(*uintptr)(unsafe.Pointer(v6))
  10589. *(*uintptr)(unsafe.Pointer(v6))++
  10590. *(*TXML_Char)(unsafe.Pointer(v5)) = int8('\000')
  10591. v4 = libc.Int32FromInt32(1)
  10592. }
  10593. if !(v4 != 0) {
  10594. return libc.Uint8FromInt32(0)
  10595. }
  10596. prefix = _lookup(tls, parser, dtd+120, (*TSTRING_POOL)(unsafe.Pointer(parser+784)).Fstart, uint64(16))
  10597. if !(prefix != 0) {
  10598. return libc.Uint8FromInt32(0)
  10599. }
  10600. if (*TPREFIX)(unsafe.Pointer(prefix)).Fname == (*TSTRING_POOL)(unsafe.Pointer(parser+784)).Fstart {
  10601. (*TPREFIX)(unsafe.Pointer(prefix)).Fname = _poolCopyString(tls, dtd+160, (*TPREFIX)(unsafe.Pointer(prefix)).Fname)
  10602. if !((*TPREFIX)(unsafe.Pointer(prefix)).Fname != 0) {
  10603. return libc.Uint8FromInt32(0)
  10604. }
  10605. }
  10606. (*TSTRING_POOL)(unsafe.Pointer(parser + 784)).Fptr = (*TSTRING_POOL)(unsafe.Pointer(parser + 784)).Fstart
  10607. }
  10608. context = s + uintptr(1)
  10609. for {
  10610. if !(int32(*(*TXML_Char)(unsafe.Pointer(context))) != int32(m_ASCII_FF) && int32(*(*TXML_Char)(unsafe.Pointer(context))) != int32('\000')) {
  10611. break
  10612. }
  10613. if (*TSTRING_POOL)(unsafe.Pointer(parser+784)).Fptr == (*TSTRING_POOL)(unsafe.Pointer(parser+784)).Fend && !(_poolGrow(tls, parser+784) != 0) {
  10614. v8 = 0
  10615. } else {
  10616. v10 = parser + 784 + 24
  10617. v9 = *(*uintptr)(unsafe.Pointer(v10))
  10618. *(*uintptr)(unsafe.Pointer(v10))++
  10619. *(*TXML_Char)(unsafe.Pointer(v9)) = *(*TXML_Char)(unsafe.Pointer(context))
  10620. v8 = libc.Int32FromInt32(1)
  10621. }
  10622. if !(v8 != 0) {
  10623. return libc.Uint8FromInt32(0)
  10624. }
  10625. goto _7
  10626. _7:
  10627. ;
  10628. context++
  10629. }
  10630. if (*TSTRING_POOL)(unsafe.Pointer(parser+784)).Fptr == (*TSTRING_POOL)(unsafe.Pointer(parser+784)).Fend && !(_poolGrow(tls, parser+784) != 0) {
  10631. v11 = 0
  10632. } else {
  10633. v13 = parser + 784 + 24
  10634. v12 = *(*uintptr)(unsafe.Pointer(v13))
  10635. *(*uintptr)(unsafe.Pointer(v13))++
  10636. *(*TXML_Char)(unsafe.Pointer(v12)) = int8('\000')
  10637. v11 = libc.Int32FromInt32(1)
  10638. }
  10639. if !(v11 != 0) {
  10640. return libc.Uint8FromInt32(0)
  10641. }
  10642. if _addBinding(tls, parser, prefix, libc.UintptrFromInt32(0), (*TSTRING_POOL)(unsafe.Pointer(parser+784)).Fstart, parser+704) != int32(_XML_ERROR_NONE) {
  10643. return libc.Uint8FromInt32(0)
  10644. }
  10645. (*TSTRING_POOL)(unsafe.Pointer(parser + 784)).Fptr = (*TSTRING_POOL)(unsafe.Pointer(parser + 784)).Fstart
  10646. if int32(*(*TXML_Char)(unsafe.Pointer(context))) != int32('\000') {
  10647. context++
  10648. }
  10649. s = context
  10650. } else {
  10651. if (*TSTRING_POOL)(unsafe.Pointer(parser+784)).Fptr == (*TSTRING_POOL)(unsafe.Pointer(parser+784)).Fend && !(_poolGrow(tls, parser+784) != 0) {
  10652. v14 = 0
  10653. } else {
  10654. v16 = parser + 784 + 24
  10655. v15 = *(*uintptr)(unsafe.Pointer(v16))
  10656. *(*uintptr)(unsafe.Pointer(v16))++
  10657. *(*TXML_Char)(unsafe.Pointer(v15)) = *(*TXML_Char)(unsafe.Pointer(s))
  10658. v14 = libc.Int32FromInt32(1)
  10659. }
  10660. if !(v14 != 0) {
  10661. return libc.Uint8FromInt32(0)
  10662. }
  10663. s++
  10664. }
  10665. }
  10666. }
  10667. return libc.Uint8FromInt32(1)
  10668. }
  10669. func _normalizePublicId(tls *libc.TLS, publicId uintptr) {
  10670. var p, s, v2, v3 uintptr
  10671. _, _, _, _ = p, s, v2, v3
  10672. p = publicId
  10673. s = publicId
  10674. for {
  10675. if !(*(*TXML_Char)(unsafe.Pointer(s)) != 0) {
  10676. break
  10677. }
  10678. switch int32(*(*TXML_Char)(unsafe.Pointer(s))) {
  10679. case int32(0x20):
  10680. fallthrough
  10681. case int32(0xD):
  10682. fallthrough
  10683. case int32(0xA):
  10684. if p != publicId && int32(*(*TXML_Char)(unsafe.Pointer(p + uintptr(-libc.Int32FromInt32(1))))) != int32(0x20) {
  10685. v2 = p
  10686. p++
  10687. *(*TXML_Char)(unsafe.Pointer(v2)) = int8(0x20)
  10688. }
  10689. default:
  10690. v3 = p
  10691. p++
  10692. *(*TXML_Char)(unsafe.Pointer(v3)) = *(*TXML_Char)(unsafe.Pointer(s))
  10693. }
  10694. goto _1
  10695. _1:
  10696. ;
  10697. s++
  10698. }
  10699. if p != publicId && int32(*(*TXML_Char)(unsafe.Pointer(p + uintptr(-libc.Int32FromInt32(1))))) == int32(0x20) {
  10700. p--
  10701. }
  10702. *(*TXML_Char)(unsafe.Pointer(p)) = int8('\000')
  10703. }
  10704. func _dtdCreate(tls *libc.TLS, ms uintptr) (r uintptr) {
  10705. var p uintptr
  10706. _ = p
  10707. p = (*(*func(*libc.TLS, Tsize_t) uintptr)(unsafe.Pointer(&struct{ uintptr }{(*TXML_Memory_Handling_Suite)(unsafe.Pointer(ms)).Fmalloc_fcn})))(tls, uint64(360))
  10708. if p == libc.UintptrFromInt32(0) {
  10709. return p
  10710. }
  10711. _poolInit(tls, p+160, ms)
  10712. _poolInit(tls, p+208, ms)
  10713. _hashTableInit(tls, p, ms)
  10714. _hashTableInit(tls, p+40, ms)
  10715. _hashTableInit(tls, p+80, ms)
  10716. _hashTableInit(tls, p+120, ms)
  10717. (*TDTD)(unsafe.Pointer(p)).FparamEntityRead = libc.Uint8FromInt32(0)
  10718. _hashTableInit(tls, p+264, ms)
  10719. (*TDTD)(unsafe.Pointer(p)).FdefaultPrefix.Fname = libc.UintptrFromInt32(0)
  10720. (*TDTD)(unsafe.Pointer(p)).FdefaultPrefix.Fbinding = libc.UintptrFromInt32(0)
  10721. (*TDTD)(unsafe.Pointer(p)).Fin_eldecl = libc.Uint8FromInt32(0)
  10722. (*TDTD)(unsafe.Pointer(p)).FscaffIndex = libc.UintptrFromInt32(0)
  10723. (*TDTD)(unsafe.Pointer(p)).Fscaffold = libc.UintptrFromInt32(0)
  10724. (*TDTD)(unsafe.Pointer(p)).FscaffLevel = 0
  10725. (*TDTD)(unsafe.Pointer(p)).FscaffSize = uint32(0)
  10726. (*TDTD)(unsafe.Pointer(p)).FscaffCount = uint32(0)
  10727. (*TDTD)(unsafe.Pointer(p)).FcontentStringLen = uint32(0)
  10728. (*TDTD)(unsafe.Pointer(p)).FkeepProcessing = libc.Uint8FromInt32(1)
  10729. (*TDTD)(unsafe.Pointer(p)).FhasParamEntityRefs = libc.Uint8FromInt32(0)
  10730. (*TDTD)(unsafe.Pointer(p)).Fstandalone = libc.Uint8FromInt32(0)
  10731. return p
  10732. }
  10733. func _dtdReset(tls *libc.TLS, p uintptr, ms uintptr) {
  10734. bp := tls.Alloc(16)
  10735. defer tls.Free(16)
  10736. var e uintptr
  10737. var _ /* iter at bp+0 */ THASH_TABLE_ITER
  10738. _ = e
  10739. _hashTableIterInit(tls, bp, p+40)
  10740. for {
  10741. e = _hashTableIterNext(tls, bp)
  10742. if !(e != 0) {
  10743. break
  10744. }
  10745. if (*TELEMENT_TYPE)(unsafe.Pointer(e)).FallocDefaultAtts != 0 {
  10746. (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TXML_Memory_Handling_Suite)(unsafe.Pointer(ms)).Ffree_fcn})))(tls, (*TELEMENT_TYPE)(unsafe.Pointer(e)).FdefaultAtts)
  10747. }
  10748. goto _1
  10749. _1:
  10750. }
  10751. _hashTableClear(tls, p)
  10752. (*TDTD)(unsafe.Pointer(p)).FparamEntityRead = libc.Uint8FromInt32(0)
  10753. _hashTableClear(tls, p+264)
  10754. _hashTableClear(tls, p+40)
  10755. _hashTableClear(tls, p+80)
  10756. _hashTableClear(tls, p+120)
  10757. _poolClear(tls, p+160)
  10758. _poolClear(tls, p+208)
  10759. (*TDTD)(unsafe.Pointer(p)).FdefaultPrefix.Fname = libc.UintptrFromInt32(0)
  10760. (*TDTD)(unsafe.Pointer(p)).FdefaultPrefix.Fbinding = libc.UintptrFromInt32(0)
  10761. (*TDTD)(unsafe.Pointer(p)).Fin_eldecl = libc.Uint8FromInt32(0)
  10762. (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TXML_Memory_Handling_Suite)(unsafe.Pointer(ms)).Ffree_fcn})))(tls, (*TDTD)(unsafe.Pointer(p)).FscaffIndex)
  10763. (*TDTD)(unsafe.Pointer(p)).FscaffIndex = libc.UintptrFromInt32(0)
  10764. (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TXML_Memory_Handling_Suite)(unsafe.Pointer(ms)).Ffree_fcn})))(tls, (*TDTD)(unsafe.Pointer(p)).Fscaffold)
  10765. (*TDTD)(unsafe.Pointer(p)).Fscaffold = libc.UintptrFromInt32(0)
  10766. (*TDTD)(unsafe.Pointer(p)).FscaffLevel = 0
  10767. (*TDTD)(unsafe.Pointer(p)).FscaffSize = uint32(0)
  10768. (*TDTD)(unsafe.Pointer(p)).FscaffCount = uint32(0)
  10769. (*TDTD)(unsafe.Pointer(p)).FcontentStringLen = uint32(0)
  10770. (*TDTD)(unsafe.Pointer(p)).FkeepProcessing = libc.Uint8FromInt32(1)
  10771. (*TDTD)(unsafe.Pointer(p)).FhasParamEntityRefs = libc.Uint8FromInt32(0)
  10772. (*TDTD)(unsafe.Pointer(p)).Fstandalone = libc.Uint8FromInt32(0)
  10773. }
  10774. func _dtdDestroy(tls *libc.TLS, p uintptr, isDocEntity TXML_Bool, ms uintptr) {
  10775. bp := tls.Alloc(16)
  10776. defer tls.Free(16)
  10777. var e uintptr
  10778. var _ /* iter at bp+0 */ THASH_TABLE_ITER
  10779. _ = e
  10780. _hashTableIterInit(tls, bp, p+40)
  10781. for {
  10782. e = _hashTableIterNext(tls, bp)
  10783. if !(e != 0) {
  10784. break
  10785. }
  10786. if (*TELEMENT_TYPE)(unsafe.Pointer(e)).FallocDefaultAtts != 0 {
  10787. (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TXML_Memory_Handling_Suite)(unsafe.Pointer(ms)).Ffree_fcn})))(tls, (*TELEMENT_TYPE)(unsafe.Pointer(e)).FdefaultAtts)
  10788. }
  10789. goto _1
  10790. _1:
  10791. }
  10792. _hashTableDestroy(tls, p)
  10793. _hashTableDestroy(tls, p+264)
  10794. _hashTableDestroy(tls, p+40)
  10795. _hashTableDestroy(tls, p+80)
  10796. _hashTableDestroy(tls, p+120)
  10797. _poolDestroy(tls, p+160)
  10798. _poolDestroy(tls, p+208)
  10799. if isDocEntity != 0 {
  10800. (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TXML_Memory_Handling_Suite)(unsafe.Pointer(ms)).Ffree_fcn})))(tls, (*TDTD)(unsafe.Pointer(p)).FscaffIndex)
  10801. (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TXML_Memory_Handling_Suite)(unsafe.Pointer(ms)).Ffree_fcn})))(tls, (*TDTD)(unsafe.Pointer(p)).Fscaffold)
  10802. }
  10803. (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TXML_Memory_Handling_Suite)(unsafe.Pointer(ms)).Ffree_fcn})))(tls, p)
  10804. }
  10805. // C documentation
  10806. //
  10807. // /* Do a deep copy of the DTD. Return 0 for out of memory, non-zero otherwise.
  10808. // The new DTD has already been initialized.
  10809. // */
  10810. func _dtdCopy(tls *libc.TLS, oldParser TXML_Parser, newDtd uintptr, oldDtd uintptr, ms uintptr) (r int32) {
  10811. bp := tls.Alloc(16)
  10812. defer tls.Free(16)
  10813. var i, v3, v7 int32
  10814. var name, name1, name2, newA, newE, oldA, oldE, oldP, v4, v5 uintptr
  10815. var _ /* iter at bp+0 */ THASH_TABLE_ITER
  10816. _, _, _, _, _, _, _, _, _, _, _, _, _ = i, name, name1, name2, newA, newE, oldA, oldE, oldP, v3, v4, v5, v7
  10817. /* Copy the prefix table. */
  10818. _hashTableIterInit(tls, bp, oldDtd+120)
  10819. for {
  10820. oldP = _hashTableIterNext(tls, bp)
  10821. if !(oldP != 0) {
  10822. break
  10823. }
  10824. name = _poolCopyString(tls, newDtd+160, (*TPREFIX)(unsafe.Pointer(oldP)).Fname)
  10825. if !(name != 0) {
  10826. return 0
  10827. }
  10828. if !(_lookup(tls, oldParser, newDtd+120, name, uint64(16)) != 0) {
  10829. return 0
  10830. }
  10831. goto _1
  10832. _1:
  10833. }
  10834. _hashTableIterInit(tls, bp, oldDtd+80)
  10835. /* Copy the attribute id table. */
  10836. for {
  10837. oldA = _hashTableIterNext(tls, bp)
  10838. if !(oldA != 0) {
  10839. break
  10840. }
  10841. /* Remember to allocate the scratch byte before the name. */
  10842. if (*TSTRING_POOL)(unsafe.Pointer(newDtd+160)).Fptr == (*TSTRING_POOL)(unsafe.Pointer(newDtd+160)).Fend && !(_poolGrow(tls, newDtd+160) != 0) {
  10843. v3 = 0
  10844. } else {
  10845. v5 = newDtd + 160 + 24
  10846. v4 = *(*uintptr)(unsafe.Pointer(v5))
  10847. *(*uintptr)(unsafe.Pointer(v5))++
  10848. *(*TXML_Char)(unsafe.Pointer(v4)) = int8('\000')
  10849. v3 = libc.Int32FromInt32(1)
  10850. }
  10851. if !(v3 != 0) {
  10852. return 0
  10853. }
  10854. name1 = _poolCopyString(tls, newDtd+160, (*TATTRIBUTE_ID)(unsafe.Pointer(oldA)).Fname)
  10855. if !(name1 != 0) {
  10856. return 0
  10857. }
  10858. name1++
  10859. newA = _lookup(tls, oldParser, newDtd+80, name1, uint64(24))
  10860. if !(newA != 0) {
  10861. return 0
  10862. }
  10863. (*TATTRIBUTE_ID)(unsafe.Pointer(newA)).FmaybeTokenized = (*TATTRIBUTE_ID)(unsafe.Pointer(oldA)).FmaybeTokenized
  10864. if (*TATTRIBUTE_ID)(unsafe.Pointer(oldA)).Fprefix != 0 {
  10865. (*TATTRIBUTE_ID)(unsafe.Pointer(newA)).Fxmlns = (*TATTRIBUTE_ID)(unsafe.Pointer(oldA)).Fxmlns
  10866. if (*TATTRIBUTE_ID)(unsafe.Pointer(oldA)).Fprefix == oldDtd+304 {
  10867. (*TATTRIBUTE_ID)(unsafe.Pointer(newA)).Fprefix = newDtd + 304
  10868. } else {
  10869. (*TATTRIBUTE_ID)(unsafe.Pointer(newA)).Fprefix = _lookup(tls, oldParser, newDtd+120, (*TPREFIX)(unsafe.Pointer((*TATTRIBUTE_ID)(unsafe.Pointer(oldA)).Fprefix)).Fname, uint64(0))
  10870. }
  10871. }
  10872. goto _2
  10873. _2:
  10874. }
  10875. /* Copy the element type table. */
  10876. _hashTableIterInit(tls, bp, oldDtd+40)
  10877. for {
  10878. oldE = _hashTableIterNext(tls, bp)
  10879. if !(oldE != 0) {
  10880. break
  10881. }
  10882. name2 = _poolCopyString(tls, newDtd+160, (*TELEMENT_TYPE)(unsafe.Pointer(oldE)).Fname)
  10883. if !(name2 != 0) {
  10884. return 0
  10885. }
  10886. newE = _lookup(tls, oldParser, newDtd+40, name2, uint64(40))
  10887. if !(newE != 0) {
  10888. return 0
  10889. }
  10890. if (*TELEMENT_TYPE)(unsafe.Pointer(oldE)).FnDefaultAtts != 0 {
  10891. (*TELEMENT_TYPE)(unsafe.Pointer(newE)).FdefaultAtts = (*(*func(*libc.TLS, Tsize_t) uintptr)(unsafe.Pointer(&struct{ uintptr }{(*TXML_Memory_Handling_Suite)(unsafe.Pointer(ms)).Fmalloc_fcn})))(tls, libc.Uint64FromInt32((*TELEMENT_TYPE)(unsafe.Pointer(oldE)).FnDefaultAtts)*uint64(24))
  10892. if !((*TELEMENT_TYPE)(unsafe.Pointer(newE)).FdefaultAtts != 0) {
  10893. return 0
  10894. }
  10895. }
  10896. if (*TELEMENT_TYPE)(unsafe.Pointer(oldE)).FidAtt != 0 {
  10897. (*TELEMENT_TYPE)(unsafe.Pointer(newE)).FidAtt = _lookup(tls, oldParser, newDtd+80, (*TATTRIBUTE_ID)(unsafe.Pointer((*TELEMENT_TYPE)(unsafe.Pointer(oldE)).FidAtt)).Fname, uint64(0))
  10898. }
  10899. v7 = (*TELEMENT_TYPE)(unsafe.Pointer(oldE)).FnDefaultAtts
  10900. (*TELEMENT_TYPE)(unsafe.Pointer(newE)).FnDefaultAtts = v7
  10901. (*TELEMENT_TYPE)(unsafe.Pointer(newE)).FallocDefaultAtts = v7
  10902. if (*TELEMENT_TYPE)(unsafe.Pointer(oldE)).Fprefix != 0 {
  10903. (*TELEMENT_TYPE)(unsafe.Pointer(newE)).Fprefix = _lookup(tls, oldParser, newDtd+120, (*TPREFIX)(unsafe.Pointer((*TELEMENT_TYPE)(unsafe.Pointer(oldE)).Fprefix)).Fname, uint64(0))
  10904. }
  10905. i = 0
  10906. for {
  10907. if !(i < (*TELEMENT_TYPE)(unsafe.Pointer(newE)).FnDefaultAtts) {
  10908. break
  10909. }
  10910. (*(*TDEFAULT_ATTRIBUTE)(unsafe.Pointer((*TELEMENT_TYPE)(unsafe.Pointer(newE)).FdefaultAtts + uintptr(i)*24))).Fid = _lookup(tls, oldParser, newDtd+80, (*TATTRIBUTE_ID)(unsafe.Pointer((*(*TDEFAULT_ATTRIBUTE)(unsafe.Pointer((*TELEMENT_TYPE)(unsafe.Pointer(oldE)).FdefaultAtts + uintptr(i)*24))).Fid)).Fname, uint64(0))
  10911. (*(*TDEFAULT_ATTRIBUTE)(unsafe.Pointer((*TELEMENT_TYPE)(unsafe.Pointer(newE)).FdefaultAtts + uintptr(i)*24))).FisCdata = (*(*TDEFAULT_ATTRIBUTE)(unsafe.Pointer((*TELEMENT_TYPE)(unsafe.Pointer(oldE)).FdefaultAtts + uintptr(i)*24))).FisCdata
  10912. if (*(*TDEFAULT_ATTRIBUTE)(unsafe.Pointer((*TELEMENT_TYPE)(unsafe.Pointer(oldE)).FdefaultAtts + uintptr(i)*24))).Fvalue != 0 {
  10913. (*(*TDEFAULT_ATTRIBUTE)(unsafe.Pointer((*TELEMENT_TYPE)(unsafe.Pointer(newE)).FdefaultAtts + uintptr(i)*24))).Fvalue = _poolCopyString(tls, newDtd+160, (*(*TDEFAULT_ATTRIBUTE)(unsafe.Pointer((*TELEMENT_TYPE)(unsafe.Pointer(oldE)).FdefaultAtts + uintptr(i)*24))).Fvalue)
  10914. if !((*(*TDEFAULT_ATTRIBUTE)(unsafe.Pointer((*TELEMENT_TYPE)(unsafe.Pointer(newE)).FdefaultAtts + uintptr(i)*24))).Fvalue != 0) {
  10915. return 0
  10916. }
  10917. } else {
  10918. (*(*TDEFAULT_ATTRIBUTE)(unsafe.Pointer((*TELEMENT_TYPE)(unsafe.Pointer(newE)).FdefaultAtts + uintptr(i)*24))).Fvalue = libc.UintptrFromInt32(0)
  10919. }
  10920. goto _8
  10921. _8:
  10922. ;
  10923. i++
  10924. }
  10925. goto _6
  10926. _6:
  10927. }
  10928. /* Copy the entity tables. */
  10929. if !(_copyEntityTable(tls, oldParser, newDtd, newDtd+160, oldDtd) != 0) {
  10930. return 0
  10931. }
  10932. if !(_copyEntityTable(tls, oldParser, newDtd+264, newDtd+160, oldDtd+264) != 0) {
  10933. return 0
  10934. }
  10935. (*TDTD)(unsafe.Pointer(newDtd)).FparamEntityRead = (*TDTD)(unsafe.Pointer(oldDtd)).FparamEntityRead
  10936. (*TDTD)(unsafe.Pointer(newDtd)).FkeepProcessing = (*TDTD)(unsafe.Pointer(oldDtd)).FkeepProcessing
  10937. (*TDTD)(unsafe.Pointer(newDtd)).FhasParamEntityRefs = (*TDTD)(unsafe.Pointer(oldDtd)).FhasParamEntityRefs
  10938. (*TDTD)(unsafe.Pointer(newDtd)).Fstandalone = (*TDTD)(unsafe.Pointer(oldDtd)).Fstandalone
  10939. /* Don't want deep copying for scaffolding */
  10940. (*TDTD)(unsafe.Pointer(newDtd)).Fin_eldecl = (*TDTD)(unsafe.Pointer(oldDtd)).Fin_eldecl
  10941. (*TDTD)(unsafe.Pointer(newDtd)).Fscaffold = (*TDTD)(unsafe.Pointer(oldDtd)).Fscaffold
  10942. (*TDTD)(unsafe.Pointer(newDtd)).FcontentStringLen = (*TDTD)(unsafe.Pointer(oldDtd)).FcontentStringLen
  10943. (*TDTD)(unsafe.Pointer(newDtd)).FscaffSize = (*TDTD)(unsafe.Pointer(oldDtd)).FscaffSize
  10944. (*TDTD)(unsafe.Pointer(newDtd)).FscaffLevel = (*TDTD)(unsafe.Pointer(oldDtd)).FscaffLevel
  10945. (*TDTD)(unsafe.Pointer(newDtd)).FscaffIndex = (*TDTD)(unsafe.Pointer(oldDtd)).FscaffIndex
  10946. return int32(1)
  10947. }
  10948. /* End dtdCopy */
  10949. func _copyEntityTable(tls *libc.TLS, oldParser TXML_Parser, newTable uintptr, newPool uintptr, oldTable uintptr) (r int32) {
  10950. bp := tls.Alloc(16)
  10951. defer tls.Free(16)
  10952. var cachedNewBase, cachedOldBase, name, newE, oldE, tem, tem1, tem2, v2 uintptr
  10953. var _ /* iter at bp+0 */ THASH_TABLE_ITER
  10954. _, _, _, _, _, _, _, _, _ = cachedNewBase, cachedOldBase, name, newE, oldE, tem, tem1, tem2, v2
  10955. cachedOldBase = libc.UintptrFromInt32(0)
  10956. cachedNewBase = libc.UintptrFromInt32(0)
  10957. _hashTableIterInit(tls, bp, oldTable)
  10958. for {
  10959. oldE = _hashTableIterNext(tls, bp)
  10960. if !(oldE != 0) {
  10961. break
  10962. }
  10963. name = _poolCopyString(tls, newPool, (*TENTITY)(unsafe.Pointer(oldE)).Fname)
  10964. if !(name != 0) {
  10965. return 0
  10966. }
  10967. newE = _lookup(tls, oldParser, newTable, name, uint64(64))
  10968. if !(newE != 0) {
  10969. return 0
  10970. }
  10971. if (*TENTITY)(unsafe.Pointer(oldE)).FsystemId != 0 {
  10972. tem = _poolCopyString(tls, newPool, (*TENTITY)(unsafe.Pointer(oldE)).FsystemId)
  10973. if !(tem != 0) {
  10974. return 0
  10975. }
  10976. (*TENTITY)(unsafe.Pointer(newE)).FsystemId = tem
  10977. if (*TENTITY)(unsafe.Pointer(oldE)).Fbase != 0 {
  10978. if (*TENTITY)(unsafe.Pointer(oldE)).Fbase == cachedOldBase {
  10979. (*TENTITY)(unsafe.Pointer(newE)).Fbase = cachedNewBase
  10980. } else {
  10981. cachedOldBase = (*TENTITY)(unsafe.Pointer(oldE)).Fbase
  10982. tem = _poolCopyString(tls, newPool, cachedOldBase)
  10983. if !(tem != 0) {
  10984. return 0
  10985. }
  10986. v2 = tem
  10987. (*TENTITY)(unsafe.Pointer(newE)).Fbase = v2
  10988. cachedNewBase = v2
  10989. }
  10990. }
  10991. if (*TENTITY)(unsafe.Pointer(oldE)).FpublicId != 0 {
  10992. tem = _poolCopyString(tls, newPool, (*TENTITY)(unsafe.Pointer(oldE)).FpublicId)
  10993. if !(tem != 0) {
  10994. return 0
  10995. }
  10996. (*TENTITY)(unsafe.Pointer(newE)).FpublicId = tem
  10997. }
  10998. } else {
  10999. tem1 = _poolCopyStringN(tls, newPool, (*TENTITY)(unsafe.Pointer(oldE)).FtextPtr, (*TENTITY)(unsafe.Pointer(oldE)).FtextLen)
  11000. if !(tem1 != 0) {
  11001. return 0
  11002. }
  11003. (*TENTITY)(unsafe.Pointer(newE)).FtextPtr = tem1
  11004. (*TENTITY)(unsafe.Pointer(newE)).FtextLen = (*TENTITY)(unsafe.Pointer(oldE)).FtextLen
  11005. }
  11006. if (*TENTITY)(unsafe.Pointer(oldE)).Fnotation != 0 {
  11007. tem2 = _poolCopyString(tls, newPool, (*TENTITY)(unsafe.Pointer(oldE)).Fnotation)
  11008. if !(tem2 != 0) {
  11009. return 0
  11010. }
  11011. (*TENTITY)(unsafe.Pointer(newE)).Fnotation = tem2
  11012. }
  11013. (*TENTITY)(unsafe.Pointer(newE)).Fis_param = (*TENTITY)(unsafe.Pointer(oldE)).Fis_param
  11014. (*TENTITY)(unsafe.Pointer(newE)).Fis_internal = (*TENTITY)(unsafe.Pointer(oldE)).Fis_internal
  11015. goto _1
  11016. _1:
  11017. }
  11018. return int32(1)
  11019. }
  11020. func _keyeq(tls *libc.TLS, s1 TKEY, s2 TKEY) (r TXML_Bool) {
  11021. for {
  11022. if !(int32(*(*TXML_Char)(unsafe.Pointer(s1))) == int32(*(*TXML_Char)(unsafe.Pointer(s2)))) {
  11023. break
  11024. }
  11025. if int32(*(*TXML_Char)(unsafe.Pointer(s1))) == 0 {
  11026. return libc.Uint8FromInt32(1)
  11027. }
  11028. goto _1
  11029. _1:
  11030. ;
  11031. s1++
  11032. s2++
  11033. }
  11034. return libc.Uint8FromInt32(0)
  11035. }
  11036. func _keylen(tls *libc.TLS, s TKEY) (r Tsize_t) {
  11037. var len1 Tsize_t
  11038. _ = len1
  11039. len1 = uint64(0)
  11040. for {
  11041. if !(*(*TXML_Char)(unsafe.Pointer(s)) != 0) {
  11042. break
  11043. }
  11044. goto _1
  11045. _1:
  11046. ;
  11047. s++
  11048. len1++
  11049. }
  11050. return len1
  11051. }
  11052. func _copy_salt_to_sipkey(tls *libc.TLS, parser TXML_Parser, key uintptr) {
  11053. *(*Tuint64_t)(unsafe.Pointer(key)) = uint64(0)
  11054. *(*Tuint64_t)(unsafe.Pointer(key + 1*8)) = _get_hash_secret_salt(tls, parser)
  11055. }
  11056. func _hash(tls *libc.TLS, parser TXML_Parser, s TKEY) (r uint64) {
  11057. bp := tls.Alloc(80)
  11058. defer tls.Free(80)
  11059. var _ /* key at bp+56 */ Tsipkey
  11060. var _ /* state at bp+0 */ Tsiphash
  11061. _ = __ccgo_fp(_sip24_valid)
  11062. _copy_salt_to_sipkey(tls, parser, bp+56)
  11063. _sip24_init(tls, bp, bp+56)
  11064. _sip24_update(tls, bp, s, _keylen(tls, s)*uint64(1))
  11065. return _sip24_final(tls, bp)
  11066. }
  11067. func _lookup(tls *libc.TLS, parser TXML_Parser, table uintptr, name TKEY, createSize Tsize_t) (r uintptr) {
  11068. var h, mask, newHash, newMask uint64
  11069. var i, j, newSize, tsize, tsize1 Tsize_t
  11070. var newPower, step uint8
  11071. var newV uintptr
  11072. _, _, _, _, _, _, _, _, _, _, _, _ = h, i, j, mask, newHash, newMask, newPower, newSize, newV, step, tsize, tsize1
  11073. if (*THASH_TABLE)(unsafe.Pointer(table)).Fsize == uint64(0) {
  11074. if !(createSize != 0) {
  11075. return libc.UintptrFromInt32(0)
  11076. }
  11077. (*THASH_TABLE)(unsafe.Pointer(table)).Fpower = uint8(m_INIT_POWER)
  11078. /* table->size is a power of 2 */
  11079. (*THASH_TABLE)(unsafe.Pointer(table)).Fsize = libc.Uint64FromInt32(1) << libc.Int32FromInt32(m_INIT_POWER)
  11080. tsize = (*THASH_TABLE)(unsafe.Pointer(table)).Fsize * uint64(8)
  11081. (*THASH_TABLE)(unsafe.Pointer(table)).Fv = (*(*func(*libc.TLS, Tsize_t) uintptr)(unsafe.Pointer(&struct{ uintptr }{(*TXML_Memory_Handling_Suite)(unsafe.Pointer((*THASH_TABLE)(unsafe.Pointer(table)).Fmem)).Fmalloc_fcn})))(tls, tsize)
  11082. if !((*THASH_TABLE)(unsafe.Pointer(table)).Fv != 0) {
  11083. (*THASH_TABLE)(unsafe.Pointer(table)).Fsize = uint64(0)
  11084. return libc.UintptrFromInt32(0)
  11085. }
  11086. libc.X__builtin___memset_chk(tls, (*THASH_TABLE)(unsafe.Pointer(table)).Fv, 0, tsize, ^t__predefined_size_t(0))
  11087. i = _hash(tls, parser, name) & ((*THASH_TABLE)(unsafe.Pointer(table)).Fsize - uint64(1))
  11088. } else {
  11089. h = _hash(tls, parser, name)
  11090. mask = (*THASH_TABLE)(unsafe.Pointer(table)).Fsize - uint64(1)
  11091. step = uint8(0)
  11092. i = h & mask
  11093. for *(*uintptr)(unsafe.Pointer((*THASH_TABLE)(unsafe.Pointer(table)).Fv + uintptr(i)*8)) != 0 {
  11094. if _keyeq(tls, name, (*TNAMED)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*THASH_TABLE)(unsafe.Pointer(table)).Fv + uintptr(i)*8)))).Fname) != 0 {
  11095. return *(*uintptr)(unsafe.Pointer((*THASH_TABLE)(unsafe.Pointer(table)).Fv + uintptr(i)*8))
  11096. }
  11097. if !(step != 0) {
  11098. step = uint8(h & ^mask >> (libc.Int32FromUint8((*THASH_TABLE)(unsafe.Pointer(table)).Fpower)-libc.Int32FromInt32(1)) & (mask>>libc.Int32FromInt32(2)) | libc.Uint64FromInt32(1))
  11099. }
  11100. if i < uint64(step) {
  11101. i += (*THASH_TABLE)(unsafe.Pointer(table)).Fsize - uint64(step)
  11102. } else {
  11103. i -= uint64(step)
  11104. }
  11105. }
  11106. if !(createSize != 0) {
  11107. return libc.UintptrFromInt32(0)
  11108. }
  11109. /* check for overflow (table is half full) */
  11110. if (*THASH_TABLE)(unsafe.Pointer(table)).Fused>>(libc.Int32FromUint8((*THASH_TABLE)(unsafe.Pointer(table)).Fpower)-int32(1)) != 0 {
  11111. newPower = libc.Uint8FromInt32(libc.Int32FromUint8((*THASH_TABLE)(unsafe.Pointer(table)).Fpower) + int32(1))
  11112. /* Detect and prevent invalid shift */
  11113. if uint64(newPower) >= libc.Uint64FromInt64(8)*libc.Uint64FromInt32(8) {
  11114. return libc.UintptrFromInt32(0)
  11115. }
  11116. newSize = libc.Uint64FromInt32(1) << newPower
  11117. newMask = newSize - uint64(1)
  11118. /* Detect and prevent integer overflow */
  11119. if newSize > libc.Uint64FromInt32(-libc.Int32FromInt32(1))/libc.Uint64FromInt64(8) {
  11120. return libc.UintptrFromInt32(0)
  11121. }
  11122. tsize1 = newSize * uint64(8)
  11123. newV = (*(*func(*libc.TLS, Tsize_t) uintptr)(unsafe.Pointer(&struct{ uintptr }{(*TXML_Memory_Handling_Suite)(unsafe.Pointer((*THASH_TABLE)(unsafe.Pointer(table)).Fmem)).Fmalloc_fcn})))(tls, tsize1)
  11124. if !(newV != 0) {
  11125. return libc.UintptrFromInt32(0)
  11126. }
  11127. libc.X__builtin___memset_chk(tls, newV, 0, tsize1, ^t__predefined_size_t(0))
  11128. i = uint64(0)
  11129. for {
  11130. if !(i < (*THASH_TABLE)(unsafe.Pointer(table)).Fsize) {
  11131. break
  11132. }
  11133. if *(*uintptr)(unsafe.Pointer((*THASH_TABLE)(unsafe.Pointer(table)).Fv + uintptr(i)*8)) != 0 {
  11134. newHash = _hash(tls, parser, (*TNAMED)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*THASH_TABLE)(unsafe.Pointer(table)).Fv + uintptr(i)*8)))).Fname)
  11135. j = newHash & newMask
  11136. step = uint8(0)
  11137. for *(*uintptr)(unsafe.Pointer(newV + uintptr(j)*8)) != 0 {
  11138. if !(step != 0) {
  11139. step = uint8(newHash & ^newMask >> (libc.Int32FromUint8(newPower)-libc.Int32FromInt32(1)) & (newMask>>libc.Int32FromInt32(2)) | libc.Uint64FromInt32(1))
  11140. }
  11141. if j < uint64(step) {
  11142. j += newSize - uint64(step)
  11143. } else {
  11144. j -= uint64(step)
  11145. }
  11146. }
  11147. *(*uintptr)(unsafe.Pointer(newV + uintptr(j)*8)) = *(*uintptr)(unsafe.Pointer((*THASH_TABLE)(unsafe.Pointer(table)).Fv + uintptr(i)*8))
  11148. }
  11149. goto _2
  11150. _2:
  11151. ;
  11152. i++
  11153. }
  11154. (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TXML_Memory_Handling_Suite)(unsafe.Pointer((*THASH_TABLE)(unsafe.Pointer(table)).Fmem)).Ffree_fcn})))(tls, (*THASH_TABLE)(unsafe.Pointer(table)).Fv)
  11155. (*THASH_TABLE)(unsafe.Pointer(table)).Fv = newV
  11156. (*THASH_TABLE)(unsafe.Pointer(table)).Fpower = newPower
  11157. (*THASH_TABLE)(unsafe.Pointer(table)).Fsize = newSize
  11158. i = h & newMask
  11159. step = uint8(0)
  11160. for *(*uintptr)(unsafe.Pointer((*THASH_TABLE)(unsafe.Pointer(table)).Fv + uintptr(i)*8)) != 0 {
  11161. if !(step != 0) {
  11162. step = uint8(h & ^newMask >> (libc.Int32FromUint8(newPower)-libc.Int32FromInt32(1)) & (newMask>>libc.Int32FromInt32(2)) | libc.Uint64FromInt32(1))
  11163. }
  11164. if i < uint64(step) {
  11165. i += newSize - uint64(step)
  11166. } else {
  11167. i -= uint64(step)
  11168. }
  11169. }
  11170. }
  11171. }
  11172. *(*uintptr)(unsafe.Pointer((*THASH_TABLE)(unsafe.Pointer(table)).Fv + uintptr(i)*8)) = (*(*func(*libc.TLS, Tsize_t) uintptr)(unsafe.Pointer(&struct{ uintptr }{(*TXML_Memory_Handling_Suite)(unsafe.Pointer((*THASH_TABLE)(unsafe.Pointer(table)).Fmem)).Fmalloc_fcn})))(tls, createSize)
  11173. if !(*(*uintptr)(unsafe.Pointer((*THASH_TABLE)(unsafe.Pointer(table)).Fv + uintptr(i)*8)) != 0) {
  11174. return libc.UintptrFromInt32(0)
  11175. }
  11176. libc.X__builtin___memset_chk(tls, *(*uintptr)(unsafe.Pointer((*THASH_TABLE)(unsafe.Pointer(table)).Fv + uintptr(i)*8)), 0, createSize, ^t__predefined_size_t(0))
  11177. (*TNAMED)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*THASH_TABLE)(unsafe.Pointer(table)).Fv + uintptr(i)*8)))).Fname = name
  11178. (*THASH_TABLE)(unsafe.Pointer(table)).Fused++
  11179. return *(*uintptr)(unsafe.Pointer((*THASH_TABLE)(unsafe.Pointer(table)).Fv + uintptr(i)*8))
  11180. }
  11181. func _hashTableClear(tls *libc.TLS, table uintptr) {
  11182. var i Tsize_t
  11183. _ = i
  11184. i = uint64(0)
  11185. for {
  11186. if !(i < (*THASH_TABLE)(unsafe.Pointer(table)).Fsize) {
  11187. break
  11188. }
  11189. (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TXML_Memory_Handling_Suite)(unsafe.Pointer((*THASH_TABLE)(unsafe.Pointer(table)).Fmem)).Ffree_fcn})))(tls, *(*uintptr)(unsafe.Pointer((*THASH_TABLE)(unsafe.Pointer(table)).Fv + uintptr(i)*8)))
  11190. *(*uintptr)(unsafe.Pointer((*THASH_TABLE)(unsafe.Pointer(table)).Fv + uintptr(i)*8)) = libc.UintptrFromInt32(0)
  11191. goto _1
  11192. _1:
  11193. ;
  11194. i++
  11195. }
  11196. (*THASH_TABLE)(unsafe.Pointer(table)).Fused = uint64(0)
  11197. }
  11198. func _hashTableDestroy(tls *libc.TLS, table uintptr) {
  11199. var i Tsize_t
  11200. _ = i
  11201. i = uint64(0)
  11202. for {
  11203. if !(i < (*THASH_TABLE)(unsafe.Pointer(table)).Fsize) {
  11204. break
  11205. }
  11206. (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TXML_Memory_Handling_Suite)(unsafe.Pointer((*THASH_TABLE)(unsafe.Pointer(table)).Fmem)).Ffree_fcn})))(tls, *(*uintptr)(unsafe.Pointer((*THASH_TABLE)(unsafe.Pointer(table)).Fv + uintptr(i)*8)))
  11207. goto _1
  11208. _1:
  11209. ;
  11210. i++
  11211. }
  11212. (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TXML_Memory_Handling_Suite)(unsafe.Pointer((*THASH_TABLE)(unsafe.Pointer(table)).Fmem)).Ffree_fcn})))(tls, (*THASH_TABLE)(unsafe.Pointer(table)).Fv)
  11213. }
  11214. func _hashTableInit(tls *libc.TLS, p uintptr, ms uintptr) {
  11215. (*THASH_TABLE)(unsafe.Pointer(p)).Fpower = uint8(0)
  11216. (*THASH_TABLE)(unsafe.Pointer(p)).Fsize = uint64(0)
  11217. (*THASH_TABLE)(unsafe.Pointer(p)).Fused = uint64(0)
  11218. (*THASH_TABLE)(unsafe.Pointer(p)).Fv = libc.UintptrFromInt32(0)
  11219. (*THASH_TABLE)(unsafe.Pointer(p)).Fmem = ms
  11220. }
  11221. func _hashTableIterInit(tls *libc.TLS, iter uintptr, table uintptr) {
  11222. var v1 uintptr
  11223. _ = v1
  11224. (*THASH_TABLE_ITER)(unsafe.Pointer(iter)).Fp = (*THASH_TABLE)(unsafe.Pointer(table)).Fv
  11225. if (*THASH_TABLE_ITER)(unsafe.Pointer(iter)).Fp != 0 {
  11226. v1 = (*THASH_TABLE_ITER)(unsafe.Pointer(iter)).Fp + uintptr((*THASH_TABLE)(unsafe.Pointer(table)).Fsize)*8
  11227. } else {
  11228. v1 = libc.UintptrFromInt32(0)
  11229. }
  11230. (*THASH_TABLE_ITER)(unsafe.Pointer(iter)).Fend = v1
  11231. }
  11232. func _hashTableIterNext(tls *libc.TLS, iter uintptr) (r uintptr) {
  11233. var tem, v1, v2 uintptr
  11234. _, _, _ = tem, v1, v2
  11235. for (*THASH_TABLE_ITER)(unsafe.Pointer(iter)).Fp != (*THASH_TABLE_ITER)(unsafe.Pointer(iter)).Fend {
  11236. v2 = iter
  11237. v1 = *(*uintptr)(unsafe.Pointer(v2))
  11238. *(*uintptr)(unsafe.Pointer(v2)) += 8
  11239. tem = *(*uintptr)(unsafe.Pointer(v1))
  11240. if tem != 0 {
  11241. return tem
  11242. }
  11243. }
  11244. return libc.UintptrFromInt32(0)
  11245. }
  11246. func _poolInit(tls *libc.TLS, pool uintptr, ms uintptr) {
  11247. (*TSTRING_POOL)(unsafe.Pointer(pool)).Fblocks = libc.UintptrFromInt32(0)
  11248. (*TSTRING_POOL)(unsafe.Pointer(pool)).FfreeBlocks = libc.UintptrFromInt32(0)
  11249. (*TSTRING_POOL)(unsafe.Pointer(pool)).Fstart = libc.UintptrFromInt32(0)
  11250. (*TSTRING_POOL)(unsafe.Pointer(pool)).Fptr = libc.UintptrFromInt32(0)
  11251. (*TSTRING_POOL)(unsafe.Pointer(pool)).Fend = libc.UintptrFromInt32(0)
  11252. (*TSTRING_POOL)(unsafe.Pointer(pool)).Fmem = ms
  11253. }
  11254. func _poolClear(tls *libc.TLS, pool uintptr) {
  11255. var p, tem uintptr
  11256. _, _ = p, tem
  11257. if !((*TSTRING_POOL)(unsafe.Pointer(pool)).FfreeBlocks != 0) {
  11258. (*TSTRING_POOL)(unsafe.Pointer(pool)).FfreeBlocks = (*TSTRING_POOL)(unsafe.Pointer(pool)).Fblocks
  11259. } else {
  11260. p = (*TSTRING_POOL)(unsafe.Pointer(pool)).Fblocks
  11261. for p != 0 {
  11262. tem = (*TBLOCK)(unsafe.Pointer(p)).Fnext
  11263. (*TBLOCK)(unsafe.Pointer(p)).Fnext = (*TSTRING_POOL)(unsafe.Pointer(pool)).FfreeBlocks
  11264. (*TSTRING_POOL)(unsafe.Pointer(pool)).FfreeBlocks = p
  11265. p = tem
  11266. }
  11267. }
  11268. (*TSTRING_POOL)(unsafe.Pointer(pool)).Fblocks = libc.UintptrFromInt32(0)
  11269. (*TSTRING_POOL)(unsafe.Pointer(pool)).Fstart = libc.UintptrFromInt32(0)
  11270. (*TSTRING_POOL)(unsafe.Pointer(pool)).Fptr = libc.UintptrFromInt32(0)
  11271. (*TSTRING_POOL)(unsafe.Pointer(pool)).Fend = libc.UintptrFromInt32(0)
  11272. }
  11273. func _poolDestroy(tls *libc.TLS, pool uintptr) {
  11274. var p, tem, tem1 uintptr
  11275. _, _, _ = p, tem, tem1
  11276. p = (*TSTRING_POOL)(unsafe.Pointer(pool)).Fblocks
  11277. for p != 0 {
  11278. tem = (*TBLOCK)(unsafe.Pointer(p)).Fnext
  11279. (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TXML_Memory_Handling_Suite)(unsafe.Pointer((*TSTRING_POOL)(unsafe.Pointer(pool)).Fmem)).Ffree_fcn})))(tls, p)
  11280. p = tem
  11281. }
  11282. p = (*TSTRING_POOL)(unsafe.Pointer(pool)).FfreeBlocks
  11283. for p != 0 {
  11284. tem1 = (*TBLOCK)(unsafe.Pointer(p)).Fnext
  11285. (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TXML_Memory_Handling_Suite)(unsafe.Pointer((*TSTRING_POOL)(unsafe.Pointer(pool)).Fmem)).Ffree_fcn})))(tls, p)
  11286. p = tem1
  11287. }
  11288. }
  11289. func _poolAppend(tls *libc.TLS, pool uintptr, enc uintptr, _ptr uintptr, end uintptr) (r uintptr) {
  11290. bp := tls.Alloc(16)
  11291. defer tls.Free(16)
  11292. *(*uintptr)(unsafe.Pointer(bp)) = _ptr
  11293. var convert_res _XML_Convert_Result
  11294. _ = convert_res
  11295. if !((*TSTRING_POOL)(unsafe.Pointer(pool)).Fptr != 0) && !(_poolGrow(tls, pool) != 0) {
  11296. return libc.UintptrFromInt32(0)
  11297. }
  11298. for {
  11299. convert_res = (*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr, uintptr) _XML_Convert_Result)(unsafe.Pointer(&struct{ uintptr }{(*TENCODING)(unsafe.Pointer(enc)).Futf8Convert})))(tls, enc, bp, end, pool+24, (*TSTRING_POOL)(unsafe.Pointer(pool)).Fend)
  11300. if convert_res == int32(_XML_CONVERT_COMPLETED) || convert_res == int32(_XML_CONVERT_INPUT_INCOMPLETE) {
  11301. break
  11302. }
  11303. if !(_poolGrow(tls, pool) != 0) {
  11304. return libc.UintptrFromInt32(0)
  11305. }
  11306. goto _1
  11307. _1:
  11308. }
  11309. return (*TSTRING_POOL)(unsafe.Pointer(pool)).Fstart
  11310. }
  11311. func _poolCopyString(tls *libc.TLS, pool uintptr, s uintptr) (r uintptr) {
  11312. var v1, v4, v5 uintptr
  11313. var v3 int32
  11314. _, _, _, _ = v1, v3, v4, v5
  11315. for {
  11316. if (*TSTRING_POOL)(unsafe.Pointer(pool)).Fptr == (*TSTRING_POOL)(unsafe.Pointer(pool)).Fend && !(_poolGrow(tls, pool) != 0) {
  11317. v3 = 0
  11318. } else {
  11319. v5 = pool + 24
  11320. v4 = *(*uintptr)(unsafe.Pointer(v5))
  11321. *(*uintptr)(unsafe.Pointer(v5))++
  11322. *(*TXML_Char)(unsafe.Pointer(v4)) = *(*TXML_Char)(unsafe.Pointer(s))
  11323. v3 = libc.Int32FromInt32(1)
  11324. }
  11325. if !(v3 != 0) {
  11326. return libc.UintptrFromInt32(0)
  11327. }
  11328. goto _2
  11329. _2:
  11330. ;
  11331. v1 = s
  11332. s++
  11333. if !(*(*TXML_Char)(unsafe.Pointer(v1)) != 0) {
  11334. break
  11335. }
  11336. }
  11337. s = (*TSTRING_POOL)(unsafe.Pointer(pool)).Fstart
  11338. (*TSTRING_POOL)(unsafe.Pointer(pool)).Fstart = (*TSTRING_POOL)(unsafe.Pointer(pool)).Fptr
  11339. return s
  11340. }
  11341. func _poolCopyStringN(tls *libc.TLS, pool uintptr, s uintptr, n int32) (r uintptr) {
  11342. var v2 int32
  11343. var v3, v4 uintptr
  11344. _, _, _ = v2, v3, v4
  11345. if !((*TSTRING_POOL)(unsafe.Pointer(pool)).Fptr != 0) && !(_poolGrow(tls, pool) != 0) {
  11346. /* The following line is unreachable given the current usage of
  11347. * poolCopyStringN(). Currently it is called from exactly one
  11348. * place to copy the text of a simple general entity. By that
  11349. * point, the name of the entity is already stored in the pool, so
  11350. * pool->ptr cannot be NULL.
  11351. *
  11352. * If poolCopyStringN() is used elsewhere as it well might be,
  11353. * this line may well become executable again. Regardless, this
  11354. * sort of check shouldn't be removed lightly, so we just exclude
  11355. * it from the coverage statistics.
  11356. */
  11357. return libc.UintptrFromInt32(0) /* LCOV_EXCL_LINE */
  11358. }
  11359. for {
  11360. if !(n > 0) {
  11361. break
  11362. }
  11363. if (*TSTRING_POOL)(unsafe.Pointer(pool)).Fptr == (*TSTRING_POOL)(unsafe.Pointer(pool)).Fend && !(_poolGrow(tls, pool) != 0) {
  11364. v2 = 0
  11365. } else {
  11366. v4 = pool + 24
  11367. v3 = *(*uintptr)(unsafe.Pointer(v4))
  11368. *(*uintptr)(unsafe.Pointer(v4))++
  11369. *(*TXML_Char)(unsafe.Pointer(v3)) = *(*TXML_Char)(unsafe.Pointer(s))
  11370. v2 = libc.Int32FromInt32(1)
  11371. }
  11372. if !(v2 != 0) {
  11373. return libc.UintptrFromInt32(0)
  11374. }
  11375. goto _1
  11376. _1:
  11377. ;
  11378. n--
  11379. s++
  11380. }
  11381. s = (*TSTRING_POOL)(unsafe.Pointer(pool)).Fstart
  11382. (*TSTRING_POOL)(unsafe.Pointer(pool)).Fstart = (*TSTRING_POOL)(unsafe.Pointer(pool)).Fptr
  11383. return s
  11384. }
  11385. func _poolAppendString(tls *libc.TLS, pool uintptr, s uintptr) (r uintptr) {
  11386. var v1 int32
  11387. var v2, v3 uintptr
  11388. _, _, _ = v1, v2, v3
  11389. for *(*TXML_Char)(unsafe.Pointer(s)) != 0 {
  11390. if (*TSTRING_POOL)(unsafe.Pointer(pool)).Fptr == (*TSTRING_POOL)(unsafe.Pointer(pool)).Fend && !(_poolGrow(tls, pool) != 0) {
  11391. v1 = 0
  11392. } else {
  11393. v3 = pool + 24
  11394. v2 = *(*uintptr)(unsafe.Pointer(v3))
  11395. *(*uintptr)(unsafe.Pointer(v3))++
  11396. *(*TXML_Char)(unsafe.Pointer(v2)) = *(*TXML_Char)(unsafe.Pointer(s))
  11397. v1 = libc.Int32FromInt32(1)
  11398. }
  11399. if !(v1 != 0) {
  11400. return libc.UintptrFromInt32(0)
  11401. }
  11402. s++
  11403. }
  11404. return (*TSTRING_POOL)(unsafe.Pointer(pool)).Fstart
  11405. }
  11406. func _poolStoreString(tls *libc.TLS, pool uintptr, enc uintptr, ptr uintptr, end uintptr) (r uintptr) {
  11407. var v1, v2 uintptr
  11408. _, _ = v1, v2
  11409. if !(_poolAppend(tls, pool, enc, ptr, end) != 0) {
  11410. return libc.UintptrFromInt32(0)
  11411. }
  11412. if (*TSTRING_POOL)(unsafe.Pointer(pool)).Fptr == (*TSTRING_POOL)(unsafe.Pointer(pool)).Fend && !(_poolGrow(tls, pool) != 0) {
  11413. return libc.UintptrFromInt32(0)
  11414. }
  11415. v2 = pool + 24
  11416. v1 = *(*uintptr)(unsafe.Pointer(v2))
  11417. *(*uintptr)(unsafe.Pointer(v2))++
  11418. *(*TXML_Char)(unsafe.Pointer(v1)) = 0
  11419. return (*TSTRING_POOL)(unsafe.Pointer(pool)).Fstart
  11420. }
  11421. func _poolBytesToAllocateFor(tls *libc.TLS, blockSize int32) (r Tsize_t) {
  11422. var bytesToAllocate, stretchedBlockSize int32
  11423. var stretch Tsize_t
  11424. _, _, _ = bytesToAllocate, stretch, stretchedBlockSize
  11425. /* Unprotected math would be:
  11426. ** return offsetof(BLOCK, s) + blockSize * sizeof(XML_Char);
  11427. **
  11428. ** Detect overflow, avoiding _signed_ overflow undefined behavior
  11429. ** For a + b * c we check b * c in isolation first, so that addition of a
  11430. ** on top has no chance of making us accept a small non-negative number
  11431. */
  11432. stretch = uint64(1) /* can be 4 bytes */
  11433. if blockSize <= 0 {
  11434. return uint64(0)
  11435. }
  11436. if blockSize > libc.Int32FromUint64(libc.Uint64FromInt32(m___INT_MAX__)/stretch) {
  11437. return uint64(0)
  11438. }
  11439. stretchedBlockSize = blockSize * libc.Int32FromUint64(stretch)
  11440. bytesToAllocate = libc.Int32FromUint64(uint64(libc.UintptrFromInt32(0)+12) + uint64(libc.Uint32FromInt32(stretchedBlockSize)))
  11441. if bytesToAllocate < 0 {
  11442. return uint64(0)
  11443. }
  11444. return libc.Uint64FromInt32(bytesToAllocate)
  11445. return r
  11446. }
  11447. func _poolGrow(tls *libc.TLS, pool uintptr) (r TXML_Bool) {
  11448. var blockSize, blockSize1 int32
  11449. var bytesToAllocate, bytesToAllocate1 Tsize_t
  11450. var offsetInsideBlock Tptrdiff_t
  11451. var tem, tem1, temp uintptr
  11452. _, _, _, _, _, _, _, _ = blockSize, blockSize1, bytesToAllocate, bytesToAllocate1, offsetInsideBlock, tem, tem1, temp
  11453. if (*TSTRING_POOL)(unsafe.Pointer(pool)).FfreeBlocks != 0 {
  11454. if (*TSTRING_POOL)(unsafe.Pointer(pool)).Fstart == uintptr(0) {
  11455. (*TSTRING_POOL)(unsafe.Pointer(pool)).Fblocks = (*TSTRING_POOL)(unsafe.Pointer(pool)).FfreeBlocks
  11456. (*TSTRING_POOL)(unsafe.Pointer(pool)).FfreeBlocks = (*TBLOCK)(unsafe.Pointer((*TSTRING_POOL)(unsafe.Pointer(pool)).FfreeBlocks)).Fnext
  11457. (*TBLOCK)(unsafe.Pointer((*TSTRING_POOL)(unsafe.Pointer(pool)).Fblocks)).Fnext = libc.UintptrFromInt32(0)
  11458. (*TSTRING_POOL)(unsafe.Pointer(pool)).Fstart = (*TSTRING_POOL)(unsafe.Pointer(pool)).Fblocks + 12
  11459. (*TSTRING_POOL)(unsafe.Pointer(pool)).Fend = (*TSTRING_POOL)(unsafe.Pointer(pool)).Fstart + uintptr((*TBLOCK)(unsafe.Pointer((*TSTRING_POOL)(unsafe.Pointer(pool)).Fblocks)).Fsize)
  11460. (*TSTRING_POOL)(unsafe.Pointer(pool)).Fptr = (*TSTRING_POOL)(unsafe.Pointer(pool)).Fstart
  11461. return libc.Uint8FromInt32(1)
  11462. }
  11463. if int64((*TSTRING_POOL)(unsafe.Pointer(pool)).Fend)-int64((*TSTRING_POOL)(unsafe.Pointer(pool)).Fstart) < int64((*TBLOCK)(unsafe.Pointer((*TSTRING_POOL)(unsafe.Pointer(pool)).FfreeBlocks)).Fsize) {
  11464. tem = (*TBLOCK)(unsafe.Pointer((*TSTRING_POOL)(unsafe.Pointer(pool)).FfreeBlocks)).Fnext
  11465. (*TBLOCK)(unsafe.Pointer((*TSTRING_POOL)(unsafe.Pointer(pool)).FfreeBlocks)).Fnext = (*TSTRING_POOL)(unsafe.Pointer(pool)).Fblocks
  11466. (*TSTRING_POOL)(unsafe.Pointer(pool)).Fblocks = (*TSTRING_POOL)(unsafe.Pointer(pool)).FfreeBlocks
  11467. (*TSTRING_POOL)(unsafe.Pointer(pool)).FfreeBlocks = tem
  11468. libc.X__builtin___memcpy_chk(tls, (*TSTRING_POOL)(unsafe.Pointer(pool)).Fblocks+12, (*TSTRING_POOL)(unsafe.Pointer(pool)).Fstart, libc.Uint64FromInt64(int64((*TSTRING_POOL)(unsafe.Pointer(pool)).Fend)-int64((*TSTRING_POOL)(unsafe.Pointer(pool)).Fstart))*uint64(1), ^t__predefined_size_t(0))
  11469. (*TSTRING_POOL)(unsafe.Pointer(pool)).Fptr = (*TSTRING_POOL)(unsafe.Pointer(pool)).Fblocks + 12 + uintptr(int64((*TSTRING_POOL)(unsafe.Pointer(pool)).Fptr)-int64((*TSTRING_POOL)(unsafe.Pointer(pool)).Fstart))
  11470. (*TSTRING_POOL)(unsafe.Pointer(pool)).Fstart = (*TSTRING_POOL)(unsafe.Pointer(pool)).Fblocks + 12
  11471. (*TSTRING_POOL)(unsafe.Pointer(pool)).Fend = (*TSTRING_POOL)(unsafe.Pointer(pool)).Fstart + uintptr((*TBLOCK)(unsafe.Pointer((*TSTRING_POOL)(unsafe.Pointer(pool)).Fblocks)).Fsize)
  11472. return libc.Uint8FromInt32(1)
  11473. }
  11474. }
  11475. if (*TSTRING_POOL)(unsafe.Pointer(pool)).Fblocks != 0 && (*TSTRING_POOL)(unsafe.Pointer(pool)).Fstart == (*TSTRING_POOL)(unsafe.Pointer(pool)).Fblocks+12 {
  11476. blockSize = libc.Int32FromUint32(libc.Uint32FromInt64(int64((*TSTRING_POOL)(unsafe.Pointer(pool)).Fend)-int64((*TSTRING_POOL)(unsafe.Pointer(pool)).Fstart)) * libc.Uint32FromUint32(2))
  11477. /* NOTE: Needs to be calculated prior to calling `realloc`
  11478. to avoid dangling pointers: */
  11479. offsetInsideBlock = int64((*TSTRING_POOL)(unsafe.Pointer(pool)).Fptr) - int64((*TSTRING_POOL)(unsafe.Pointer(pool)).Fstart)
  11480. if blockSize < 0 {
  11481. /* This condition traps a situation where either more than
  11482. * INT_MAX/2 bytes have already been allocated. This isn't
  11483. * readily testable, since it is unlikely that an average
  11484. * machine will have that much memory, so we exclude it from the
  11485. * coverage statistics.
  11486. */
  11487. return libc.Uint8FromInt32(0) /* LCOV_EXCL_LINE */
  11488. }
  11489. bytesToAllocate = _poolBytesToAllocateFor(tls, blockSize)
  11490. if bytesToAllocate == uint64(0) {
  11491. return libc.Uint8FromInt32(0)
  11492. }
  11493. temp = (*(*func(*libc.TLS, uintptr, Tsize_t) uintptr)(unsafe.Pointer(&struct{ uintptr }{(*TXML_Memory_Handling_Suite)(unsafe.Pointer((*TSTRING_POOL)(unsafe.Pointer(pool)).Fmem)).Frealloc_fcn})))(tls, (*TSTRING_POOL)(unsafe.Pointer(pool)).Fblocks, uint64(uint32(bytesToAllocate)))
  11494. if temp == libc.UintptrFromInt32(0) {
  11495. return libc.Uint8FromInt32(0)
  11496. }
  11497. (*TSTRING_POOL)(unsafe.Pointer(pool)).Fblocks = temp
  11498. (*TBLOCK)(unsafe.Pointer((*TSTRING_POOL)(unsafe.Pointer(pool)).Fblocks)).Fsize = blockSize
  11499. (*TSTRING_POOL)(unsafe.Pointer(pool)).Fptr = (*TSTRING_POOL)(unsafe.Pointer(pool)).Fblocks + 12 + uintptr(offsetInsideBlock)
  11500. (*TSTRING_POOL)(unsafe.Pointer(pool)).Fstart = (*TSTRING_POOL)(unsafe.Pointer(pool)).Fblocks + 12
  11501. (*TSTRING_POOL)(unsafe.Pointer(pool)).Fend = (*TSTRING_POOL)(unsafe.Pointer(pool)).Fstart + uintptr(blockSize)
  11502. } else {
  11503. blockSize1 = int32(int64((*TSTRING_POOL)(unsafe.Pointer(pool)).Fend) - int64((*TSTRING_POOL)(unsafe.Pointer(pool)).Fstart))
  11504. if blockSize1 < 0 {
  11505. /* This condition traps a situation where either more than
  11506. * INT_MAX bytes have already been allocated (which is prevented
  11507. * by various pieces of program logic, not least this one, never
  11508. * mind the unlikelihood of actually having that much memory) or
  11509. * the pool control fields have been corrupted (which could
  11510. * conceivably happen in an extremely buggy user handler
  11511. * function). Either way it isn't readily testable, so we
  11512. * exclude it from the coverage statistics.
  11513. */
  11514. return libc.Uint8FromInt32(0) /* LCOV_EXCL_LINE */
  11515. }
  11516. if blockSize1 < int32(m_INIT_BLOCK_SIZE) {
  11517. blockSize1 = int32(m_INIT_BLOCK_SIZE)
  11518. } else {
  11519. /* Detect overflow, avoiding _signed_ overflow undefined behavior */
  11520. if libc.Int32FromUint32(libc.Uint32FromInt32(blockSize1)*libc.Uint32FromUint32(2)) < 0 {
  11521. return libc.Uint8FromInt32(0)
  11522. }
  11523. blockSize1 *= int32(2)
  11524. }
  11525. bytesToAllocate1 = _poolBytesToAllocateFor(tls, blockSize1)
  11526. if bytesToAllocate1 == uint64(0) {
  11527. return libc.Uint8FromInt32(0)
  11528. }
  11529. tem1 = (*(*func(*libc.TLS, Tsize_t) uintptr)(unsafe.Pointer(&struct{ uintptr }{(*TXML_Memory_Handling_Suite)(unsafe.Pointer((*TSTRING_POOL)(unsafe.Pointer(pool)).Fmem)).Fmalloc_fcn})))(tls, bytesToAllocate1)
  11530. if !(tem1 != 0) {
  11531. return libc.Uint8FromInt32(0)
  11532. }
  11533. (*TBLOCK)(unsafe.Pointer(tem1)).Fsize = blockSize1
  11534. (*TBLOCK)(unsafe.Pointer(tem1)).Fnext = (*TSTRING_POOL)(unsafe.Pointer(pool)).Fblocks
  11535. (*TSTRING_POOL)(unsafe.Pointer(pool)).Fblocks = tem1
  11536. if (*TSTRING_POOL)(unsafe.Pointer(pool)).Fptr != (*TSTRING_POOL)(unsafe.Pointer(pool)).Fstart {
  11537. libc.X__builtin___memcpy_chk(tls, tem1+12, (*TSTRING_POOL)(unsafe.Pointer(pool)).Fstart, libc.Uint64FromInt64(int64((*TSTRING_POOL)(unsafe.Pointer(pool)).Fptr)-int64((*TSTRING_POOL)(unsafe.Pointer(pool)).Fstart))*uint64(1), ^t__predefined_size_t(0))
  11538. }
  11539. (*TSTRING_POOL)(unsafe.Pointer(pool)).Fptr = tem1 + 12 + uintptr(int64((*TSTRING_POOL)(unsafe.Pointer(pool)).Fptr)-int64((*TSTRING_POOL)(unsafe.Pointer(pool)).Fstart))
  11540. (*TSTRING_POOL)(unsafe.Pointer(pool)).Fstart = tem1 + 12
  11541. (*TSTRING_POOL)(unsafe.Pointer(pool)).Fend = tem1 + 12 + uintptr(blockSize1)
  11542. }
  11543. return libc.Uint8FromInt32(1)
  11544. }
  11545. func _nextScaffoldPart(tls *libc.TLS, parser TXML_Parser) (r int32) {
  11546. var dtd, me, parent, temp, v2 uintptr
  11547. var next, v3, v4, v5 int32
  11548. var v1 uint32
  11549. _, _, _, _, _, _, _, _, _, _ = dtd, me, next, parent, temp, v1, v2, v3, v4, v5
  11550. dtd = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_dtd
  11551. if !((*TDTD)(unsafe.Pointer(dtd)).FscaffIndex != 0) {
  11552. (*TDTD)(unsafe.Pointer(dtd)).FscaffIndex = (*(*func(*libc.TLS, Tsize_t) uintptr)(unsafe.Pointer(&struct{ uintptr }{(*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_mem.Fmalloc_fcn})))(tls, uint64((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_groupSize)*libc.Uint64FromInt64(4))
  11553. if !((*TDTD)(unsafe.Pointer(dtd)).FscaffIndex != 0) {
  11554. return -int32(1)
  11555. }
  11556. *(*int32)(unsafe.Pointer((*TDTD)(unsafe.Pointer(dtd)).FscaffIndex)) = 0
  11557. }
  11558. if (*TDTD)(unsafe.Pointer(dtd)).FscaffCount >= (*TDTD)(unsafe.Pointer(dtd)).FscaffSize {
  11559. if (*TDTD)(unsafe.Pointer(dtd)).Fscaffold != 0 {
  11560. /* Detect and prevent integer overflow */
  11561. if (*TDTD)(unsafe.Pointer(dtd)).FscaffSize > (libc.Uint32FromInt32(m___INT_MAX__)*libc.Uint32FromUint32(2)+libc.Uint32FromUint32(1))/libc.Uint32FromUint32(2) {
  11562. return -int32(1)
  11563. }
  11564. /* Detect and prevent integer overflow.
  11565. * The preprocessor guard addresses the "always false" warning
  11566. * from -Wtype-limits on platforms where
  11567. * sizeof(unsigned int) < sizeof(size_t), e.g. on x86_64. */
  11568. temp = (*(*func(*libc.TLS, uintptr, Tsize_t) uintptr)(unsafe.Pointer(&struct{ uintptr }{(*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_mem.Frealloc_fcn})))(tls, (*TDTD)(unsafe.Pointer(dtd)).Fscaffold, uint64((*TDTD)(unsafe.Pointer(dtd)).FscaffSize*libc.Uint32FromInt32(2))*libc.Uint64FromInt64(32))
  11569. if temp == libc.UintptrFromInt32(0) {
  11570. return -int32(1)
  11571. }
  11572. *(*uint32)(unsafe.Pointer(dtd + 340)) *= uint32(2)
  11573. } else {
  11574. temp = (*(*func(*libc.TLS, Tsize_t) uintptr)(unsafe.Pointer(&struct{ uintptr }{(*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_mem.Fmalloc_fcn})))(tls, libc.Uint64FromInt32(m_INIT_SCAFFOLD_ELEMENTS)*libc.Uint64FromInt64(32))
  11575. if temp == libc.UintptrFromInt32(0) {
  11576. return -int32(1)
  11577. }
  11578. (*TDTD)(unsafe.Pointer(dtd)).FscaffSize = uint32(m_INIT_SCAFFOLD_ELEMENTS)
  11579. }
  11580. (*TDTD)(unsafe.Pointer(dtd)).Fscaffold = temp
  11581. }
  11582. v2 = dtd + 344
  11583. v1 = *(*uint32)(unsafe.Pointer(v2))
  11584. *(*uint32)(unsafe.Pointer(v2))++
  11585. next = libc.Int32FromUint32(v1)
  11586. me = (*TDTD)(unsafe.Pointer(dtd)).Fscaffold + uintptr(next)*32
  11587. if (*TDTD)(unsafe.Pointer(dtd)).FscaffLevel != 0 {
  11588. parent = (*TDTD)(unsafe.Pointer(dtd)).Fscaffold + uintptr(*(*int32)(unsafe.Pointer((*TDTD)(unsafe.Pointer(dtd)).FscaffIndex + uintptr((*TDTD)(unsafe.Pointer(dtd)).FscaffLevel-int32(1))*4)))*32
  11589. if (*TCONTENT_SCAFFOLD)(unsafe.Pointer(parent)).Flastchild != 0 {
  11590. (*(*TCONTENT_SCAFFOLD)(unsafe.Pointer((*TDTD)(unsafe.Pointer(dtd)).Fscaffold + uintptr((*TCONTENT_SCAFFOLD)(unsafe.Pointer(parent)).Flastchild)*32))).Fnextsib = next
  11591. }
  11592. if !((*TCONTENT_SCAFFOLD)(unsafe.Pointer(parent)).Fchildcnt != 0) {
  11593. (*TCONTENT_SCAFFOLD)(unsafe.Pointer(parent)).Ffirstchild = next
  11594. }
  11595. (*TCONTENT_SCAFFOLD)(unsafe.Pointer(parent)).Flastchild = next
  11596. (*TCONTENT_SCAFFOLD)(unsafe.Pointer(parent)).Fchildcnt++
  11597. }
  11598. v5 = libc.Int32FromInt32(0)
  11599. (*TCONTENT_SCAFFOLD)(unsafe.Pointer(me)).Fnextsib = v5
  11600. v4 = v5
  11601. (*TCONTENT_SCAFFOLD)(unsafe.Pointer(me)).Fchildcnt = v4
  11602. v3 = v4
  11603. (*TCONTENT_SCAFFOLD)(unsafe.Pointer(me)).Flastchild = v3
  11604. (*TCONTENT_SCAFFOLD)(unsafe.Pointer(me)).Ffirstchild = v3
  11605. return next
  11606. }
  11607. func _build_model(tls *libc.TLS, parser TXML_Parser) (r uintptr) {
  11608. var allocsize Tsize_t
  11609. var cn, src_node int32
  11610. var dest, destLimit, dtd, jobDest, ret, src, str, v1, v4, v6 uintptr
  11611. var i uint32
  11612. _, _, _, _, _, _, _, _, _, _, _, _, _, _ = allocsize, cn, dest, destLimit, dtd, i, jobDest, ret, src, src_node, str, v1, v4, v6
  11613. /* Function build_model transforms the existing parser->m_dtd->scaffold
  11614. * array of CONTENT_SCAFFOLD tree nodes into a new array of
  11615. * XML_Content tree nodes followed by a gapless list of zero-terminated
  11616. * strings. */
  11617. dtd = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_dtd /* the current string writing location */
  11618. /* Detect and prevent integer overflow.
  11619. * The preprocessor guard addresses the "always false" warning
  11620. * from -Wtype-limits on platforms where
  11621. * sizeof(unsigned int) < sizeof(size_t), e.g. on x86_64. */
  11622. if uint64((*TDTD)(unsafe.Pointer(dtd)).FscaffCount)*uint64(32) > libc.Uint64FromInt32(-libc.Int32FromInt32(1))-uint64((*TDTD)(unsafe.Pointer(dtd)).FcontentStringLen)*uint64(1) {
  11623. return libc.UintptrFromInt32(0)
  11624. }
  11625. allocsize = uint64((*TDTD)(unsafe.Pointer(dtd)).FscaffCount)*libc.Uint64FromInt64(32) + uint64((*TDTD)(unsafe.Pointer(dtd)).FcontentStringLen)*libc.Uint64FromInt64(1)
  11626. ret = (*(*func(*libc.TLS, Tsize_t) uintptr)(unsafe.Pointer(&struct{ uintptr }{(*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_mem.Fmalloc_fcn})))(tls, allocsize)
  11627. if !(ret != 0) {
  11628. return libc.UintptrFromInt32(0)
  11629. }
  11630. /* What follows is an iterative implementation (of what was previously done
  11631. * recursively in a dedicated function called "build_node". The old recursive
  11632. * build_node could be forced into stack exhaustion from input as small as a
  11633. * few megabyte, and so that was a security issue. Hence, a function call
  11634. * stack is avoided now by resolving recursion.)
  11635. *
  11636. * The iterative approach works as follows:
  11637. *
  11638. * - We have two writing pointers, both walking up the result array; one does
  11639. * the work, the other creates "jobs" for its colleague to do, and leads
  11640. * the way:
  11641. *
  11642. * - The faster one, pointer jobDest, always leads and writes "what job
  11643. * to do" by the other, once they reach that place in the
  11644. * array: leader "jobDest" stores the source node array index (relative
  11645. * to array dtd->scaffold) in field "numchildren".
  11646. *
  11647. * - The slower one, pointer dest, looks at the value stored in the
  11648. * "numchildren" field (which actually holds a source node array index
  11649. * at that time) and puts the real data from dtd->scaffold in.
  11650. *
  11651. * - Before the loop starts, jobDest writes source array index 0
  11652. * (where the root node is located) so that dest will have something to do
  11653. * when it starts operation.
  11654. *
  11655. * - Whenever nodes with children are encountered, jobDest appends
  11656. * them as new jobs, in order. As a result, tree node siblings are
  11657. * adjacent in the resulting array, for example:
  11658. *
  11659. * [0] root, has two children
  11660. * [1] first child of 0, has three children
  11661. * [3] first child of 1, does not have children
  11662. * [4] second child of 1, does not have children
  11663. * [5] third child of 1, does not have children
  11664. * [2] second child of 0, does not have children
  11665. *
  11666. * Or (the same data) presented in flat array view:
  11667. *
  11668. * [0] root, has two children
  11669. *
  11670. * [1] first child of 0, has three children
  11671. * [2] second child of 0, does not have children
  11672. *
  11673. * [3] first child of 1, does not have children
  11674. * [4] second child of 1, does not have children
  11675. * [5] third child of 1, does not have children
  11676. *
  11677. * - The algorithm repeats until all target array indices have been processed.
  11678. */
  11679. dest = ret /* tree node writing location, moves upwards */
  11680. destLimit = ret + uintptr((*TDTD)(unsafe.Pointer(dtd)).FscaffCount)*32
  11681. jobDest = ret /* next free writing location in target array */
  11682. str = ret + uintptr((*TDTD)(unsafe.Pointer(dtd)).FscaffCount)*32
  11683. /* Add the starting job, the root node (index 0) of the source tree */
  11684. v1 = jobDest
  11685. jobDest += 32
  11686. (*TXML_Content)(unsafe.Pointer(v1)).Fnumchildren = uint32(0)
  11687. for {
  11688. if !(dest < destLimit) {
  11689. break
  11690. }
  11691. /* Retrieve source tree array index from job storage */
  11692. src_node = libc.Int32FromUint32((*TXML_Content)(unsafe.Pointer(dest)).Fnumchildren)
  11693. /* Convert item */
  11694. (*TXML_Content)(unsafe.Pointer(dest)).Ftype1 = (*(*TCONTENT_SCAFFOLD)(unsafe.Pointer((*TDTD)(unsafe.Pointer(dtd)).Fscaffold + uintptr(src_node)*32))).Ftype1
  11695. (*TXML_Content)(unsafe.Pointer(dest)).Fquant = (*(*TCONTENT_SCAFFOLD)(unsafe.Pointer((*TDTD)(unsafe.Pointer(dtd)).Fscaffold + uintptr(src_node)*32))).Fquant
  11696. if (*TXML_Content)(unsafe.Pointer(dest)).Ftype1 == int32(_XML_CTYPE_NAME) {
  11697. (*TXML_Content)(unsafe.Pointer(dest)).Fname = str
  11698. src = (*(*TCONTENT_SCAFFOLD)(unsafe.Pointer((*TDTD)(unsafe.Pointer(dtd)).Fscaffold + uintptr(src_node)*32))).Fname
  11699. for {
  11700. v4 = str
  11701. str++
  11702. *(*TXML_Char)(unsafe.Pointer(v4)) = *(*TXML_Char)(unsafe.Pointer(src))
  11703. if !(*(*TXML_Char)(unsafe.Pointer(src)) != 0) {
  11704. break
  11705. }
  11706. src++
  11707. goto _3
  11708. _3:
  11709. }
  11710. (*TXML_Content)(unsafe.Pointer(dest)).Fnumchildren = uint32(0)
  11711. (*TXML_Content)(unsafe.Pointer(dest)).Fchildren = libc.UintptrFromInt32(0)
  11712. } else {
  11713. (*TXML_Content)(unsafe.Pointer(dest)).Fname = libc.UintptrFromInt32(0)
  11714. (*TXML_Content)(unsafe.Pointer(dest)).Fnumchildren = libc.Uint32FromInt32((*(*TCONTENT_SCAFFOLD)(unsafe.Pointer((*TDTD)(unsafe.Pointer(dtd)).Fscaffold + uintptr(src_node)*32))).Fchildcnt)
  11715. (*TXML_Content)(unsafe.Pointer(dest)).Fchildren = jobDest
  11716. /* Append scaffold indices of children to array */
  11717. i = uint32(0)
  11718. cn = (*(*TCONTENT_SCAFFOLD)(unsafe.Pointer((*TDTD)(unsafe.Pointer(dtd)).Fscaffold + uintptr(src_node)*32))).Ffirstchild
  11719. for {
  11720. if !(i < (*TXML_Content)(unsafe.Pointer(dest)).Fnumchildren) {
  11721. break
  11722. }
  11723. v6 = jobDest
  11724. jobDest += 32
  11725. (*TXML_Content)(unsafe.Pointer(v6)).Fnumchildren = libc.Uint32FromInt32(cn)
  11726. goto _5
  11727. _5:
  11728. ;
  11729. i++
  11730. cn = (*(*TCONTENT_SCAFFOLD)(unsafe.Pointer((*TDTD)(unsafe.Pointer(dtd)).Fscaffold + uintptr(cn)*32))).Fnextsib
  11731. }
  11732. }
  11733. goto _2
  11734. _2:
  11735. ;
  11736. dest += 32
  11737. }
  11738. return ret
  11739. }
  11740. func _getElementType(tls *libc.TLS, parser TXML_Parser, enc uintptr, ptr uintptr, end uintptr) (r uintptr) {
  11741. var dtd, name, ret uintptr
  11742. _, _, _ = dtd, name, ret
  11743. dtd = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_dtd /* save one level of indirection */
  11744. name = _poolStoreString(tls, dtd+160, enc, ptr, end)
  11745. if !(name != 0) {
  11746. return libc.UintptrFromInt32(0)
  11747. }
  11748. ret = _lookup(tls, parser, dtd+40, name, uint64(40))
  11749. if !(ret != 0) {
  11750. return libc.UintptrFromInt32(0)
  11751. }
  11752. if (*TELEMENT_TYPE)(unsafe.Pointer(ret)).Fname != name {
  11753. (*TSTRING_POOL)(unsafe.Pointer(dtd + 160)).Fptr = (*TSTRING_POOL)(unsafe.Pointer(dtd + 160)).Fstart
  11754. } else {
  11755. (*TSTRING_POOL)(unsafe.Pointer(dtd + 160)).Fstart = (*TSTRING_POOL)(unsafe.Pointer(dtd + 160)).Fptr
  11756. if !(_setElementTypePrefix(tls, parser, ret) != 0) {
  11757. return libc.UintptrFromInt32(0)
  11758. }
  11759. }
  11760. return ret
  11761. }
  11762. func _copyString(tls *libc.TLS, s uintptr, memsuite uintptr) (r uintptr) {
  11763. var charsRequired Tsize_t
  11764. var result uintptr
  11765. _, _ = charsRequired, result
  11766. charsRequired = uint64(0)
  11767. /* First determine how long the string is */
  11768. for int32(*(*TXML_Char)(unsafe.Pointer(s + uintptr(charsRequired)))) != 0 {
  11769. charsRequired++
  11770. }
  11771. /* Include the terminator */
  11772. charsRequired++
  11773. /* Now allocate space for the copy */
  11774. result = (*(*func(*libc.TLS, Tsize_t) uintptr)(unsafe.Pointer(&struct{ uintptr }{(*TXML_Memory_Handling_Suite)(unsafe.Pointer(memsuite)).Fmalloc_fcn})))(tls, charsRequired*uint64(1))
  11775. if result == libc.UintptrFromInt32(0) {
  11776. return libc.UintptrFromInt32(0)
  11777. }
  11778. /* Copy the original into place */
  11779. libc.X__builtin___memcpy_chk(tls, result, s, charsRequired*uint64(1), ^t__predefined_size_t(0))
  11780. return result
  11781. }
  11782. func _accountingGetCurrentAmplification(tls *libc.TLS, rootParser TXML_Parser) (r float32) {
  11783. var amplificationFactor, v1 float32
  11784. var countBytesOutput TXmlBigCount
  11785. _, _, _ = amplificationFactor, countBytesOutput, v1
  11786. countBytesOutput = (*TXML_ParserStruct)(unsafe.Pointer(rootParser)).Fm_accounting.FcountBytesDirect + (*TXML_ParserStruct)(unsafe.Pointer(rootParser)).Fm_accounting.FcountBytesIndirect
  11787. if (*TXML_ParserStruct)(unsafe.Pointer(rootParser)).Fm_accounting.FcountBytesDirect != 0 {
  11788. v1 = float32(countBytesOutput) / float32((*TXML_ParserStruct)(unsafe.Pointer(rootParser)).Fm_accounting.FcountBytesDirect)
  11789. } else {
  11790. v1 = libc.Float32FromFloat32(1)
  11791. }
  11792. amplificationFactor = v1
  11793. return amplificationFactor
  11794. }
  11795. func _accountingReportStats(tls *libc.TLS, originParser TXML_Parser, epilog uintptr) {
  11796. bp := tls.Alloc(48)
  11797. defer tls.Free(48)
  11798. var amplificationFactor float32
  11799. var rootParser TXML_Parser
  11800. _, _ = amplificationFactor, rootParser
  11801. rootParser = _getRootParserOf(tls, originParser, libc.UintptrFromInt32(0))
  11802. if (*TXML_ParserStruct)(unsafe.Pointer(rootParser)).Fm_accounting.FdebugLevel < int32(1) {
  11803. return
  11804. }
  11805. amplificationFactor = _accountingGetCurrentAmplification(tls, rootParser)
  11806. libc.Xfprintf(tls, libc.X__stderrp, __ccgo_ts+1671, libc.VaList(bp+8, rootParser, (*TXML_ParserStruct)(unsafe.Pointer(rootParser)).Fm_accounting.FcountBytesDirect, (*TXML_ParserStruct)(unsafe.Pointer(rootParser)).Fm_accounting.FcountBytesIndirect, float64(amplificationFactor), epilog))
  11807. }
  11808. func _accountingOnAbort(tls *libc.TLS, originParser TXML_Parser) {
  11809. _accountingReportStats(tls, originParser, __ccgo_ts+1748)
  11810. }
  11811. func _accountingReportDiff(tls *libc.TLS, rootParser TXML_Parser, levelsAwayFromRootParser uint32, before uintptr, after uintptr, bytesMore Tptrdiff_t, source_line int32, account _XML_Account) {
  11812. bp := tls.Alloc(64)
  11813. defer tls.Free(64)
  11814. var contextLength uint32
  11815. var ellipsisLength Tsize_t
  11816. var walker, v1 uintptr
  11817. var _ /* ellipis at bp+0 */ [5]int8
  11818. _, _, _, _ = contextLength, ellipsisLength, walker, v1
  11819. if account == int32(_XML_ACCOUNT_DIRECT) {
  11820. v1 = __ccgo_ts + 1759
  11821. } else {
  11822. v1 = __ccgo_ts + 1763
  11823. }
  11824. libc.Xfprintf(tls, libc.X__stderrp, __ccgo_ts+1767, libc.VaList(bp+16, bytesMore, v1, levelsAwayFromRootParser, source_line, int32(10), __ccgo_ts+1808))
  11825. *(*[5]int8)(unsafe.Pointer(bp)) = [5]int8{'[', '.', '.', ']'}
  11826. ellipsisLength = libc.Uint64FromInt64(5) - libc.Uint64FromInt32(1)
  11827. contextLength = uint32(10)
  11828. /* Note: Performance is of no concern here */
  11829. walker = before
  11830. if (*TXML_ParserStruct)(unsafe.Pointer(rootParser)).Fm_accounting.FdebugLevel >= int32(3) || int64(after)-int64(before) <= libc.Int64FromUint64(uint64(contextLength)+ellipsisLength+uint64(contextLength)) {
  11831. for {
  11832. if !(walker < after) {
  11833. break
  11834. }
  11835. libc.Xfprintf(tls, libc.X__stderrp, __ccgo_ts+1809, libc.VaList(bp+16, XunsignedCharToPrintable(tls, libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(walker))))))
  11836. goto _2
  11837. _2:
  11838. ;
  11839. walker++
  11840. }
  11841. } else {
  11842. for {
  11843. if !(walker < before+uintptr(contextLength)) {
  11844. break
  11845. }
  11846. libc.Xfprintf(tls, libc.X__stderrp, __ccgo_ts+1809, libc.VaList(bp+16, XunsignedCharToPrintable(tls, libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(walker))))))
  11847. goto _3
  11848. _3:
  11849. ;
  11850. walker++
  11851. }
  11852. libc.Xfprintf(tls, libc.X__stderrp, bp, 0)
  11853. walker = after - uintptr(contextLength)
  11854. for {
  11855. if !(walker < after) {
  11856. break
  11857. }
  11858. libc.Xfprintf(tls, libc.X__stderrp, __ccgo_ts+1809, libc.VaList(bp+16, XunsignedCharToPrintable(tls, libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(walker))))))
  11859. goto _4
  11860. _4:
  11861. ;
  11862. walker++
  11863. }
  11864. }
  11865. libc.Xfprintf(tls, libc.X__stderrp, __ccgo_ts+1812, 0)
  11866. }
  11867. func _accountingDiffTolerated(tls *libc.TLS, originParser TXML_Parser, tok int32, before uintptr, after uintptr, source_line int32, account _XML_Account) (r TXML_Bool) {
  11868. bp := tls.Alloc(16)
  11869. defer tls.Free(16)
  11870. var additionTarget, v1 uintptr
  11871. var amplificationFactor float32
  11872. var bytesMore Tptrdiff_t
  11873. var countBytesOutput TXmlBigCount
  11874. var isDirect int32
  11875. var rootParser TXML_Parser
  11876. var tolerated TXML_Bool
  11877. var _ /* levelsAwayFromRootParser at bp+0 */ uint32
  11878. _, _, _, _, _, _, _, _ = additionTarget, amplificationFactor, bytesMore, countBytesOutput, isDirect, rootParser, tolerated, v1
  11879. /* Note: We need to check the token type *first* to be sure that
  11880. * we can even access variable <after>, safely.
  11881. * E.g. for XML_TOK_NONE <after> may hold an invalid pointer. */
  11882. switch tok {
  11883. case m_XML_TOK_INVALID:
  11884. fallthrough
  11885. case -int32(1):
  11886. fallthrough
  11887. case -int32(2):
  11888. fallthrough
  11889. case -int32(4):
  11890. return libc.Uint8FromInt32(1)
  11891. }
  11892. if account == int32(_XML_ACCOUNT_NONE) {
  11893. return libc.Uint8FromInt32(1)
  11894. }
  11895. rootParser = _getRootParserOf(tls, originParser, bp)
  11896. isDirect = libc.BoolInt32(account == int32(_XML_ACCOUNT_DIRECT) && originParser == rootParser)
  11897. bytesMore = int64(after) - int64(before)
  11898. if isDirect != 0 {
  11899. v1 = rootParser + 928
  11900. } else {
  11901. v1 = rootParser + 928 + 8
  11902. }
  11903. additionTarget = v1
  11904. /* Detect and avoid integer overflow */
  11905. if *(*TXmlBigCount)(unsafe.Pointer(additionTarget)) > libc.Uint64FromInt32(-libc.Int32FromInt32(1))-libc.Uint64FromInt64(bytesMore) {
  11906. return libc.Uint8FromInt32(0)
  11907. }
  11908. *(*TXmlBigCount)(unsafe.Pointer(additionTarget)) += libc.Uint64FromInt64(bytesMore)
  11909. countBytesOutput = (*TXML_ParserStruct)(unsafe.Pointer(rootParser)).Fm_accounting.FcountBytesDirect + (*TXML_ParserStruct)(unsafe.Pointer(rootParser)).Fm_accounting.FcountBytesIndirect
  11910. amplificationFactor = _accountingGetCurrentAmplification(tls, rootParser)
  11911. tolerated = libc.BoolUint8(countBytesOutput < (*TXML_ParserStruct)(unsafe.Pointer(rootParser)).Fm_accounting.FactivationThresholdBytes || amplificationFactor <= (*TXML_ParserStruct)(unsafe.Pointer(rootParser)).Fm_accounting.FmaximumAmplificationFactor)
  11912. if (*TXML_ParserStruct)(unsafe.Pointer(rootParser)).Fm_accounting.FdebugLevel >= int32(2) {
  11913. _accountingReportStats(tls, rootParser, __ccgo_ts+1808)
  11914. _accountingReportDiff(tls, rootParser, *(*uint32)(unsafe.Pointer(bp)), before, after, bytesMore, source_line, account)
  11915. }
  11916. return tolerated
  11917. }
  11918. func XtestingAccountingGetCountBytesDirect(tls *libc.TLS, parser TXML_Parser) (r uint64) {
  11919. if !(parser != 0) {
  11920. return uint64(0)
  11921. }
  11922. return (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_accounting.FcountBytesDirect
  11923. }
  11924. func XtestingAccountingGetCountBytesIndirect(tls *libc.TLS, parser TXML_Parser) (r uint64) {
  11925. if !(parser != 0) {
  11926. return uint64(0)
  11927. }
  11928. return (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_accounting.FcountBytesIndirect
  11929. }
  11930. func _entityTrackingReportStats(tls *libc.TLS, rootParser TXML_Parser, entity uintptr, action uintptr, sourceLine int32) {
  11931. bp := tls.Alloc(96)
  11932. defer tls.Free(96)
  11933. var entityName, v1 uintptr
  11934. _, _ = entityName, v1
  11935. if (*TXML_ParserStruct)(unsafe.Pointer(rootParser)).Fm_entity_stats.FdebugLevel < int32(1) {
  11936. return
  11937. }
  11938. entityName = (*TENTITY)(unsafe.Pointer(entity)).Fname
  11939. if (*TENTITY)(unsafe.Pointer(entity)).Fis_param != 0 {
  11940. v1 = __ccgo_ts + 1815
  11941. } else {
  11942. v1 = __ccgo_ts + 1817
  11943. }
  11944. libc.Xfprintf(tls, libc.X__stderrp, __ccgo_ts+1819, libc.VaList(bp+8, rootParser, (*TXML_ParserStruct)(unsafe.Pointer(rootParser)).Fm_entity_stats.FcountEverOpened, (*TXML_ParserStruct)(unsafe.Pointer(rootParser)).Fm_entity_stats.FcurrentDepth, (*TXML_ParserStruct)(unsafe.Pointer(rootParser)).Fm_entity_stats.FmaximumDepthSeen, ((*TXML_ParserStruct)(unsafe.Pointer(rootParser)).Fm_entity_stats.FcurrentDepth-uint32(1))*uint32(2), __ccgo_ts+1808, v1, entityName, action, (*TENTITY)(unsafe.Pointer(entity)).FtextLen, sourceLine))
  11945. }
  11946. func _entityTrackingOnOpen(tls *libc.TLS, originParser TXML_Parser, entity uintptr, sourceLine int32) {
  11947. var rootParser TXML_Parser
  11948. _ = rootParser
  11949. rootParser = _getRootParserOf(tls, originParser, libc.UintptrFromInt32(0))
  11950. (*TXML_ParserStruct)(unsafe.Pointer(rootParser)).Fm_entity_stats.FcountEverOpened++
  11951. (*TXML_ParserStruct)(unsafe.Pointer(rootParser)).Fm_entity_stats.FcurrentDepth++
  11952. if (*TXML_ParserStruct)(unsafe.Pointer(rootParser)).Fm_entity_stats.FcurrentDepth > (*TXML_ParserStruct)(unsafe.Pointer(rootParser)).Fm_entity_stats.FmaximumDepthSeen {
  11953. (*TXML_ParserStruct)(unsafe.Pointer(rootParser)).Fm_entity_stats.FmaximumDepthSeen++
  11954. }
  11955. _entityTrackingReportStats(tls, rootParser, entity, __ccgo_ts+1904, sourceLine)
  11956. }
  11957. func _entityTrackingOnClose(tls *libc.TLS, originParser TXML_Parser, entity uintptr, sourceLine int32) {
  11958. var rootParser TXML_Parser
  11959. _ = rootParser
  11960. rootParser = _getRootParserOf(tls, originParser, libc.UintptrFromInt32(0))
  11961. _entityTrackingReportStats(tls, rootParser, entity, __ccgo_ts+1910, sourceLine)
  11962. (*TXML_ParserStruct)(unsafe.Pointer(rootParser)).Fm_entity_stats.FcurrentDepth--
  11963. }
  11964. func _getRootParserOf(tls *libc.TLS, parser TXML_Parser, outLevelDiff uintptr) (r TXML_Parser) {
  11965. var rootParser TXML_Parser
  11966. var stepsTakenUpwards uint32
  11967. _, _ = rootParser, stepsTakenUpwards
  11968. rootParser = parser
  11969. stepsTakenUpwards = uint32(0)
  11970. for (*TXML_ParserStruct)(unsafe.Pointer(rootParser)).Fm_parentParser != 0 {
  11971. rootParser = (*TXML_ParserStruct)(unsafe.Pointer(rootParser)).Fm_parentParser
  11972. stepsTakenUpwards++
  11973. }
  11974. if outLevelDiff != libc.UintptrFromInt32(0) {
  11975. *(*uint32)(unsafe.Pointer(outLevelDiff)) = stepsTakenUpwards
  11976. }
  11977. return rootParser
  11978. }
  11979. func XunsignedCharToPrintable(tls *libc.TLS, c uint8) (r uintptr) {
  11980. switch libc.Int32FromUint8(c) {
  11981. case 0:
  11982. return __ccgo_ts + 1916
  11983. case int32(1):
  11984. return __ccgo_ts + 1919
  11985. case int32(2):
  11986. return __ccgo_ts + 1923
  11987. case int32(3):
  11988. return __ccgo_ts + 1927
  11989. case int32(4):
  11990. return __ccgo_ts + 1931
  11991. case int32(5):
  11992. return __ccgo_ts + 1935
  11993. case int32(6):
  11994. return __ccgo_ts + 1939
  11995. case int32(7):
  11996. return __ccgo_ts + 1943
  11997. case int32(8):
  11998. return __ccgo_ts + 1947
  11999. case int32(9):
  12000. return __ccgo_ts + 1951
  12001. case int32(10):
  12002. return __ccgo_ts + 1954
  12003. case int32(11):
  12004. return __ccgo_ts + 1957
  12005. case int32(12):
  12006. return __ccgo_ts + 1961
  12007. case int32(13):
  12008. return __ccgo_ts + 1965
  12009. case int32(14):
  12010. return __ccgo_ts + 1968
  12011. case int32(15):
  12012. return __ccgo_ts + 1972
  12013. case int32(16):
  12014. return __ccgo_ts + 1976
  12015. case int32(17):
  12016. return __ccgo_ts + 1981
  12017. case int32(18):
  12018. return __ccgo_ts + 1986
  12019. case int32(19):
  12020. return __ccgo_ts + 1991
  12021. case int32(20):
  12022. return __ccgo_ts + 1996
  12023. case int32(21):
  12024. return __ccgo_ts + 2001
  12025. case int32(22):
  12026. return __ccgo_ts + 2006
  12027. case int32(23):
  12028. return __ccgo_ts + 2011
  12029. case int32(24):
  12030. return __ccgo_ts + 2016
  12031. case int32(25):
  12032. return __ccgo_ts + 2021
  12033. case int32(26):
  12034. return __ccgo_ts + 2026
  12035. case int32(27):
  12036. return __ccgo_ts + 2031
  12037. case int32(28):
  12038. return __ccgo_ts + 2036
  12039. case int32(29):
  12040. return __ccgo_ts + 2041
  12041. case int32(30):
  12042. return __ccgo_ts + 2046
  12043. case int32(31):
  12044. return __ccgo_ts + 2051
  12045. case int32(32):
  12046. return __ccgo_ts + 2056
  12047. case int32(33):
  12048. return __ccgo_ts + 2058
  12049. case int32(34):
  12050. return __ccgo_ts + 2060
  12051. case int32(35):
  12052. return __ccgo_ts + 2063
  12053. case int32(36):
  12054. return __ccgo_ts + 2065
  12055. case int32(37):
  12056. return __ccgo_ts + 1815
  12057. case int32(38):
  12058. return __ccgo_ts + 1817
  12059. case int32(39):
  12060. return __ccgo_ts + 2067
  12061. case int32(40):
  12062. return __ccgo_ts + 2069
  12063. case int32(41):
  12064. return __ccgo_ts + 2071
  12065. case int32(42):
  12066. return __ccgo_ts + 2073
  12067. case int32(43):
  12068. return __ccgo_ts + 2075
  12069. case int32(44):
  12070. return __ccgo_ts + 2077
  12071. case int32(45):
  12072. return __ccgo_ts + 2079
  12073. case int32(46):
  12074. return __ccgo_ts + 2081
  12075. case int32(47):
  12076. return __ccgo_ts + 2083
  12077. case int32(48):
  12078. return __ccgo_ts + 2085
  12079. case int32(49):
  12080. return __ccgo_ts + 2087
  12081. case int32(50):
  12082. return __ccgo_ts + 2089
  12083. case int32(51):
  12084. return __ccgo_ts + 2091
  12085. case int32(52):
  12086. return __ccgo_ts + 2093
  12087. case int32(53):
  12088. return __ccgo_ts + 2095
  12089. case int32(54):
  12090. return __ccgo_ts + 2097
  12091. case int32(55):
  12092. return __ccgo_ts + 2099
  12093. case int32(56):
  12094. return __ccgo_ts + 2101
  12095. case int32(57):
  12096. return __ccgo_ts + 2103
  12097. case int32(58):
  12098. return __ccgo_ts + 2105
  12099. case int32(59):
  12100. return __ccgo_ts + 2107
  12101. case int32(60):
  12102. return __ccgo_ts + 2109
  12103. case int32(61):
  12104. return __ccgo_ts + 2111
  12105. case int32(62):
  12106. return __ccgo_ts + 2113
  12107. case int32(63):
  12108. return __ccgo_ts + 2115
  12109. case int32(64):
  12110. return __ccgo_ts + 2117
  12111. case int32(65):
  12112. return __ccgo_ts + 2119
  12113. case int32(66):
  12114. return __ccgo_ts + 2121
  12115. case int32(67):
  12116. return __ccgo_ts + 2123
  12117. case int32(68):
  12118. return __ccgo_ts + 2125
  12119. case int32(69):
  12120. return __ccgo_ts + 2127
  12121. case int32(70):
  12122. return __ccgo_ts + 2129
  12123. case int32(71):
  12124. return __ccgo_ts + 2131
  12125. case int32(72):
  12126. return __ccgo_ts + 2133
  12127. case int32(73):
  12128. return __ccgo_ts + 2135
  12129. case int32(74):
  12130. return __ccgo_ts + 2137
  12131. case int32(75):
  12132. return __ccgo_ts + 2139
  12133. case int32(76):
  12134. return __ccgo_ts + 2141
  12135. case int32(77):
  12136. return __ccgo_ts + 2143
  12137. case int32(78):
  12138. return __ccgo_ts + 2145
  12139. case int32(79):
  12140. return __ccgo_ts + 2147
  12141. case int32(80):
  12142. return __ccgo_ts + 2149
  12143. case int32(81):
  12144. return __ccgo_ts + 2151
  12145. case int32(82):
  12146. return __ccgo_ts + 2153
  12147. case int32(83):
  12148. return __ccgo_ts + 2155
  12149. case int32(84):
  12150. return __ccgo_ts + 2157
  12151. case int32(85):
  12152. return __ccgo_ts + 2159
  12153. case int32(86):
  12154. return __ccgo_ts + 2161
  12155. case int32(87):
  12156. return __ccgo_ts + 2163
  12157. case int32(88):
  12158. return __ccgo_ts + 2165
  12159. case int32(89):
  12160. return __ccgo_ts + 2167
  12161. case int32(90):
  12162. return __ccgo_ts + 2169
  12163. case int32(91):
  12164. return __ccgo_ts + 2171
  12165. case int32(92):
  12166. return __ccgo_ts + 2173
  12167. case int32(93):
  12168. return __ccgo_ts + 2176
  12169. case int32(94):
  12170. return __ccgo_ts + 2178
  12171. case int32(95):
  12172. return __ccgo_ts + 2180
  12173. case int32(96):
  12174. return __ccgo_ts + 2182
  12175. case int32(97):
  12176. return __ccgo_ts + 2184
  12177. case int32(98):
  12178. return __ccgo_ts + 2186
  12179. case int32(99):
  12180. return __ccgo_ts + 2188
  12181. case int32(100):
  12182. return __ccgo_ts + 2190
  12183. case int32(101):
  12184. return __ccgo_ts + 2192
  12185. case int32(102):
  12186. return __ccgo_ts + 2194
  12187. case int32(103):
  12188. return __ccgo_ts + 2196
  12189. case int32(104):
  12190. return __ccgo_ts + 2198
  12191. case int32(105):
  12192. return __ccgo_ts + 2200
  12193. case int32(106):
  12194. return __ccgo_ts + 2202
  12195. case int32(107):
  12196. return __ccgo_ts + 2204
  12197. case int32(108):
  12198. return __ccgo_ts + 2206
  12199. case int32(109):
  12200. return __ccgo_ts + 2208
  12201. case int32(110):
  12202. return __ccgo_ts + 2210
  12203. case int32(111):
  12204. return __ccgo_ts + 2212
  12205. case int32(112):
  12206. return __ccgo_ts + 2214
  12207. case int32(113):
  12208. return __ccgo_ts + 2216
  12209. case int32(114):
  12210. return __ccgo_ts + 2218
  12211. case int32(115):
  12212. return __ccgo_ts + 2220
  12213. case int32(116):
  12214. return __ccgo_ts + 2222
  12215. case int32(117):
  12216. return __ccgo_ts + 2224
  12217. case int32(118):
  12218. return __ccgo_ts + 2226
  12219. case int32(119):
  12220. return __ccgo_ts + 2228
  12221. case int32(120):
  12222. return __ccgo_ts + 2230
  12223. case int32(121):
  12224. return __ccgo_ts + 2232
  12225. case int32(122):
  12226. return __ccgo_ts + 2234
  12227. case int32(123):
  12228. return __ccgo_ts + 2236
  12229. case int32(124):
  12230. return __ccgo_ts + 2238
  12231. case int32(125):
  12232. return __ccgo_ts + 2240
  12233. case int32(126):
  12234. return __ccgo_ts + 2242
  12235. case int32(127):
  12236. return __ccgo_ts + 2244
  12237. case int32(128):
  12238. return __ccgo_ts + 2249
  12239. case int32(129):
  12240. return __ccgo_ts + 2254
  12241. case int32(130):
  12242. return __ccgo_ts + 2259
  12243. case int32(131):
  12244. return __ccgo_ts + 2264
  12245. case int32(132):
  12246. return __ccgo_ts + 2269
  12247. case int32(133):
  12248. return __ccgo_ts + 2274
  12249. case int32(134):
  12250. return __ccgo_ts + 2279
  12251. case int32(135):
  12252. return __ccgo_ts + 2284
  12253. case int32(136):
  12254. return __ccgo_ts + 2289
  12255. case int32(137):
  12256. return __ccgo_ts + 2294
  12257. case int32(138):
  12258. return __ccgo_ts + 2299
  12259. case int32(139):
  12260. return __ccgo_ts + 2304
  12261. case int32(140):
  12262. return __ccgo_ts + 2309
  12263. case int32(141):
  12264. return __ccgo_ts + 2314
  12265. case int32(142):
  12266. return __ccgo_ts + 2319
  12267. case int32(143):
  12268. return __ccgo_ts + 2324
  12269. case int32(144):
  12270. return __ccgo_ts + 2329
  12271. case int32(145):
  12272. return __ccgo_ts + 2334
  12273. case int32(146):
  12274. return __ccgo_ts + 2339
  12275. case int32(147):
  12276. return __ccgo_ts + 2344
  12277. case int32(148):
  12278. return __ccgo_ts + 2349
  12279. case int32(149):
  12280. return __ccgo_ts + 2354
  12281. case int32(150):
  12282. return __ccgo_ts + 2359
  12283. case int32(151):
  12284. return __ccgo_ts + 2364
  12285. case int32(152):
  12286. return __ccgo_ts + 2369
  12287. case int32(153):
  12288. return __ccgo_ts + 2374
  12289. case int32(154):
  12290. return __ccgo_ts + 2379
  12291. case int32(155):
  12292. return __ccgo_ts + 2384
  12293. case int32(156):
  12294. return __ccgo_ts + 2389
  12295. case int32(157):
  12296. return __ccgo_ts + 2394
  12297. case int32(158):
  12298. return __ccgo_ts + 2399
  12299. case int32(159):
  12300. return __ccgo_ts + 2404
  12301. case int32(160):
  12302. return __ccgo_ts + 2409
  12303. case int32(161):
  12304. return __ccgo_ts + 2414
  12305. case int32(162):
  12306. return __ccgo_ts + 2419
  12307. case int32(163):
  12308. return __ccgo_ts + 2424
  12309. case int32(164):
  12310. return __ccgo_ts + 2429
  12311. case int32(165):
  12312. return __ccgo_ts + 2434
  12313. case int32(166):
  12314. return __ccgo_ts + 2439
  12315. case int32(167):
  12316. return __ccgo_ts + 2444
  12317. case int32(168):
  12318. return __ccgo_ts + 2449
  12319. case int32(169):
  12320. return __ccgo_ts + 2454
  12321. case int32(170):
  12322. return __ccgo_ts + 2459
  12323. case int32(171):
  12324. return __ccgo_ts + 2464
  12325. case int32(172):
  12326. return __ccgo_ts + 2469
  12327. case int32(173):
  12328. return __ccgo_ts + 2474
  12329. case int32(174):
  12330. return __ccgo_ts + 2479
  12331. case int32(175):
  12332. return __ccgo_ts + 2484
  12333. case int32(176):
  12334. return __ccgo_ts + 2489
  12335. case int32(177):
  12336. return __ccgo_ts + 2494
  12337. case int32(178):
  12338. return __ccgo_ts + 2499
  12339. case int32(179):
  12340. return __ccgo_ts + 2504
  12341. case int32(180):
  12342. return __ccgo_ts + 2509
  12343. case int32(181):
  12344. return __ccgo_ts + 2514
  12345. case int32(182):
  12346. return __ccgo_ts + 2519
  12347. case int32(183):
  12348. return __ccgo_ts + 2524
  12349. case int32(184):
  12350. return __ccgo_ts + 2529
  12351. case int32(185):
  12352. return __ccgo_ts + 2534
  12353. case int32(186):
  12354. return __ccgo_ts + 2539
  12355. case int32(187):
  12356. return __ccgo_ts + 2544
  12357. case int32(188):
  12358. return __ccgo_ts + 2549
  12359. case int32(189):
  12360. return __ccgo_ts + 2554
  12361. case int32(190):
  12362. return __ccgo_ts + 2559
  12363. case int32(191):
  12364. return __ccgo_ts + 2564
  12365. case int32(192):
  12366. return __ccgo_ts + 2569
  12367. case int32(193):
  12368. return __ccgo_ts + 2574
  12369. case int32(194):
  12370. return __ccgo_ts + 2579
  12371. case int32(195):
  12372. return __ccgo_ts + 2584
  12373. case int32(196):
  12374. return __ccgo_ts + 2589
  12375. case int32(197):
  12376. return __ccgo_ts + 2594
  12377. case int32(198):
  12378. return __ccgo_ts + 2599
  12379. case int32(199):
  12380. return __ccgo_ts + 2604
  12381. case int32(200):
  12382. return __ccgo_ts + 2609
  12383. case int32(201):
  12384. return __ccgo_ts + 2614
  12385. case int32(202):
  12386. return __ccgo_ts + 2619
  12387. case int32(203):
  12388. return __ccgo_ts + 2624
  12389. case int32(204):
  12390. return __ccgo_ts + 2629
  12391. case int32(205):
  12392. return __ccgo_ts + 2634
  12393. case int32(206):
  12394. return __ccgo_ts + 2639
  12395. case int32(207):
  12396. return __ccgo_ts + 2644
  12397. case int32(208):
  12398. return __ccgo_ts + 2649
  12399. case int32(209):
  12400. return __ccgo_ts + 2654
  12401. case int32(210):
  12402. return __ccgo_ts + 2659
  12403. case int32(211):
  12404. return __ccgo_ts + 2664
  12405. case int32(212):
  12406. return __ccgo_ts + 2669
  12407. case int32(213):
  12408. return __ccgo_ts + 2674
  12409. case int32(214):
  12410. return __ccgo_ts + 2679
  12411. case int32(215):
  12412. return __ccgo_ts + 2684
  12413. case int32(216):
  12414. return __ccgo_ts + 2689
  12415. case int32(217):
  12416. return __ccgo_ts + 2694
  12417. case int32(218):
  12418. return __ccgo_ts + 2699
  12419. case int32(219):
  12420. return __ccgo_ts + 2704
  12421. case int32(220):
  12422. return __ccgo_ts + 2709
  12423. case int32(221):
  12424. return __ccgo_ts + 2714
  12425. case int32(222):
  12426. return __ccgo_ts + 2719
  12427. case int32(223):
  12428. return __ccgo_ts + 2724
  12429. case int32(224):
  12430. return __ccgo_ts + 2729
  12431. case int32(225):
  12432. return __ccgo_ts + 2734
  12433. case int32(226):
  12434. return __ccgo_ts + 2739
  12435. case int32(227):
  12436. return __ccgo_ts + 2744
  12437. case int32(228):
  12438. return __ccgo_ts + 2749
  12439. case int32(229):
  12440. return __ccgo_ts + 2754
  12441. case int32(230):
  12442. return __ccgo_ts + 2759
  12443. case int32(231):
  12444. return __ccgo_ts + 2764
  12445. case int32(232):
  12446. return __ccgo_ts + 2769
  12447. case int32(233):
  12448. return __ccgo_ts + 2774
  12449. case int32(234):
  12450. return __ccgo_ts + 2779
  12451. case int32(235):
  12452. return __ccgo_ts + 2784
  12453. case int32(236):
  12454. return __ccgo_ts + 2789
  12455. case int32(237):
  12456. return __ccgo_ts + 2794
  12457. case int32(238):
  12458. return __ccgo_ts + 2799
  12459. case int32(239):
  12460. return __ccgo_ts + 2804
  12461. case int32(240):
  12462. return __ccgo_ts + 2809
  12463. case int32(241):
  12464. return __ccgo_ts + 2814
  12465. case int32(242):
  12466. return __ccgo_ts + 2819
  12467. case int32(243):
  12468. return __ccgo_ts + 2824
  12469. case int32(244):
  12470. return __ccgo_ts + 2829
  12471. case int32(245):
  12472. return __ccgo_ts + 2834
  12473. case int32(246):
  12474. return __ccgo_ts + 2839
  12475. case int32(247):
  12476. return __ccgo_ts + 2844
  12477. case int32(248):
  12478. return __ccgo_ts + 2849
  12479. case int32(249):
  12480. return __ccgo_ts + 2854
  12481. case int32(250):
  12482. return __ccgo_ts + 2859
  12483. case int32(251):
  12484. return __ccgo_ts + 2864
  12485. case int32(252):
  12486. return __ccgo_ts + 2869
  12487. case int32(253):
  12488. return __ccgo_ts + 2874
  12489. case int32(254):
  12490. return __ccgo_ts + 2879
  12491. case int32(255):
  12492. return __ccgo_ts + 2884
  12493. default:
  12494. /* never gets here */
  12495. return __ccgo_ts + 2889
  12496. }
  12497. /* never gets here */
  12498. return r
  12499. }
  12500. func _getDebugLevel(tls *libc.TLS, variableName uintptr, defaultDebugLevel uint64) (r uint64) {
  12501. bp := tls.Alloc(16)
  12502. defer tls.Free(16)
  12503. var debugLevel uint64
  12504. var value, valueOrNull uintptr
  12505. var _ /* afterValue at bp+0 */ uintptr
  12506. _, _, _ = debugLevel, value, valueOrNull
  12507. valueOrNull = libc.Xgetenv(tls, variableName)
  12508. if valueOrNull == libc.UintptrFromInt32(0) {
  12509. return defaultDebugLevel
  12510. }
  12511. value = valueOrNull
  12512. *(*int32)(unsafe.Pointer(libc.X__error(tls))) = 0
  12513. *(*uintptr)(unsafe.Pointer(bp)) = value
  12514. debugLevel = libc.Xstrtoul(tls, value, bp, int32(10))
  12515. if *(*int32)(unsafe.Pointer(libc.X__error(tls))) != 0 || int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp))))) != int32('\000') {
  12516. *(*int32)(unsafe.Pointer(libc.X__error(tls))) = 0
  12517. return defaultDebugLevel
  12518. }
  12519. return debugLevel
  12520. }
  12521. const m_ASCII_01 = 0x30
  12522. const m_ASCII_11 = 0x31
  12523. const m_ASCII_21 = 0x32
  12524. const m_ASCII_31 = 0x33
  12525. const m_ASCII_81 = 0x38
  12526. const m_ASCII_91 = 0x39
  12527. const m_ASCII_B1 = 66
  12528. const m_ASCII_COLON1 = 0x3A
  12529. const m_ASCII_COMMA1 = 0x2C
  12530. const m_ASCII_EQUALS1 = 0x3D
  12531. const m_ASCII_EXCL1 = 0x21
  12532. const m_ASCII_FF1 = 0x0C
  12533. const m_ASCII_G1 = 71
  12534. const m_ASCII_HASH1 = 0x23
  12535. const m_ASCII_LPAREN1 = 0x28
  12536. const m_ASCII_P1 = 80
  12537. const m_ASCII_PERIOD1 = 0x2E
  12538. const m_ASCII_PIPE1 = 0x7C
  12539. const m_ASCII_Q1 = 81
  12540. const m_ASCII_RPAREN1 = 0x29
  12541. const m_ASCII_SLASH1 = 0x2F
  12542. const m_ASCII_U1 = 85
  12543. const m_ASCII_a1 = 0x61
  12544. const m_ASCII_c1 = 0x63
  12545. const m_ASCII_e1 = 0x65
  12546. const m_ASCII_g1 = 0x67
  12547. const m_ASCII_h1 = 0x68
  12548. const m_ASCII_l1 = 0x6C
  12549. const m_ASCII_m1 = 0x6D
  12550. const m_ASCII_n1 = 0x6E
  12551. const m_ASCII_o1 = 0x6F
  12552. const m_ASCII_p1 = 0x70
  12553. const m_ASCII_r1 = 0x72
  12554. const m_ASCII_s1 = 0x73
  12555. const m_ASCII_t1 = 0x74
  12556. const m_ASCII_w1 = 0x77
  12557. const m_ASCII_x1 = 0x78
  12558. const m_EXPAT_BILLION_LAUGHS_ATTACK_PROTECTION_MAXIMUM_AMPLIFICATION_DEFAULT1 = "100.0f"
  12559. /*
  12560. __ __ _
  12561. ___\ \/ /_ __ __ _| |_
  12562. / _ \\ /| '_ \ / _` | __|
  12563. | __// \| |_) | (_| | |_
  12564. \___/_/\_\ .__/ \__,_|\__|
  12565. |_| XML parser
  12566. Copyright (c) 1999-2000 Thai Open Source Software Center Ltd
  12567. Copyright (c) 2000 Clark Cooper <coopercc@users.sourceforge.net>
  12568. Copyright (c) 2002 Fred L. Drake, Jr. <fdrake@users.sourceforge.net>
  12569. Copyright (c) 2007 Karl Waclawek <karl@waclawek.net>
  12570. Copyright (c) 2017 Sebastian Pipping <sebastian@pipping.org>
  12571. Licensed under the MIT license:
  12572. Permission is hereby granted, free of charge, to any person obtaining
  12573. a copy of this software and associated documentation files (the
  12574. "Software"), to deal in the Software without restriction, including
  12575. without limitation the rights to use, copy, modify, merge, publish,
  12576. distribute, sublicense, and/or sell copies of the Software, and to permit
  12577. persons to whom the Software is furnished to do so, subject to the
  12578. following conditions:
  12579. The above copyright notice and this permission notice shall be included
  12580. in all copies or substantial portions of the Software.
  12581. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  12582. EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  12583. MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
  12584. NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
  12585. DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  12586. OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
  12587. USE OR OTHER DEALINGS IN THE SOFTWARE.
  12588. */
  12589. /* Doesn't check:
  12590. that ,| are not mixed in a model group
  12591. content of literals
  12592. */
  12593. var _KW_ANY = [4]int8{
  12594. 0: int8(m_ASCII_A),
  12595. 1: int8(m_ASCII_N),
  12596. 2: int8(m_ASCII_Y),
  12597. }
  12598. var _KW_ATTLIST = [8]int8{
  12599. 0: int8(m_ASCII_A),
  12600. 1: int8(m_ASCII_T),
  12601. 2: int8(m_ASCII_T),
  12602. 3: int8(m_ASCII_L),
  12603. 4: int8(m_ASCII_I),
  12604. 5: int8(m_ASCII_S),
  12605. 6: int8(m_ASCII_T),
  12606. }
  12607. var _KW_CDATA = [6]int8{
  12608. 0: int8(m_ASCII_C),
  12609. 1: int8(m_ASCII_D),
  12610. 2: int8(m_ASCII_A),
  12611. 3: int8(m_ASCII_T),
  12612. 4: int8(m_ASCII_A),
  12613. }
  12614. var _KW_DOCTYPE = [8]int8{
  12615. 0: int8(m_ASCII_D),
  12616. 1: int8(m_ASCII_O),
  12617. 2: int8(m_ASCII_C),
  12618. 3: int8(m_ASCII_T),
  12619. 4: int8(m_ASCII_Y),
  12620. 5: int8(m_ASCII_P1),
  12621. 6: int8(m_ASCII_E),
  12622. }
  12623. var _KW_ELEMENT = [8]int8{
  12624. 0: int8(m_ASCII_E),
  12625. 1: int8(m_ASCII_L),
  12626. 2: int8(m_ASCII_E),
  12627. 3: int8(m_ASCII_M),
  12628. 4: int8(m_ASCII_E),
  12629. 5: int8(m_ASCII_N),
  12630. 6: int8(m_ASCII_T),
  12631. }
  12632. var _KW_EMPTY = [6]int8{
  12633. 0: int8(m_ASCII_E),
  12634. 1: int8(m_ASCII_M),
  12635. 2: int8(m_ASCII_P1),
  12636. 3: int8(m_ASCII_T),
  12637. 4: int8(m_ASCII_Y),
  12638. }
  12639. var _KW_ENTITIES = [9]int8{
  12640. 0: int8(m_ASCII_E),
  12641. 1: int8(m_ASCII_N),
  12642. 2: int8(m_ASCII_T),
  12643. 3: int8(m_ASCII_I),
  12644. 4: int8(m_ASCII_T),
  12645. 5: int8(m_ASCII_I),
  12646. 6: int8(m_ASCII_E),
  12647. 7: int8(m_ASCII_S),
  12648. }
  12649. var _KW_ENTITY = [7]int8{
  12650. 0: int8(m_ASCII_E),
  12651. 1: int8(m_ASCII_N),
  12652. 2: int8(m_ASCII_T),
  12653. 3: int8(m_ASCII_I),
  12654. 4: int8(m_ASCII_T),
  12655. 5: int8(m_ASCII_Y),
  12656. }
  12657. var _KW_FIXED = [6]int8{
  12658. 0: int8(m_ASCII_F),
  12659. 1: int8(m_ASCII_I),
  12660. 2: int8(m_ASCII_X),
  12661. 3: int8(m_ASCII_E),
  12662. 4: int8(m_ASCII_D),
  12663. }
  12664. var _KW_ID = [3]int8{
  12665. 0: int8(m_ASCII_I),
  12666. 1: int8(m_ASCII_D),
  12667. }
  12668. var _KW_IDREF = [6]int8{
  12669. 0: int8(m_ASCII_I),
  12670. 1: int8(m_ASCII_D),
  12671. 2: int8(m_ASCII_R),
  12672. 3: int8(m_ASCII_E),
  12673. 4: int8(m_ASCII_F),
  12674. }
  12675. var _KW_IDREFS = [7]int8{
  12676. 0: int8(m_ASCII_I),
  12677. 1: int8(m_ASCII_D),
  12678. 2: int8(m_ASCII_R),
  12679. 3: int8(m_ASCII_E),
  12680. 4: int8(m_ASCII_F),
  12681. 5: int8(m_ASCII_S),
  12682. }
  12683. var _KW_IGNORE = [7]int8{
  12684. 0: int8(m_ASCII_I),
  12685. 1: int8(m_ASCII_G1),
  12686. 2: int8(m_ASCII_N),
  12687. 3: int8(m_ASCII_O),
  12688. 4: int8(m_ASCII_R),
  12689. 5: int8(m_ASCII_E),
  12690. }
  12691. var _KW_IMPLIED = [8]int8{
  12692. 0: int8(m_ASCII_I),
  12693. 1: int8(m_ASCII_M),
  12694. 2: int8(m_ASCII_P1),
  12695. 3: int8(m_ASCII_L),
  12696. 4: int8(m_ASCII_I),
  12697. 5: int8(m_ASCII_E),
  12698. 6: int8(m_ASCII_D),
  12699. }
  12700. var _KW_INCLUDE = [8]int8{
  12701. 0: int8(m_ASCII_I),
  12702. 1: int8(m_ASCII_N),
  12703. 2: int8(m_ASCII_C),
  12704. 3: int8(m_ASCII_L),
  12705. 4: int8(m_ASCII_U1),
  12706. 5: int8(m_ASCII_D),
  12707. 6: int8(m_ASCII_E),
  12708. }
  12709. var _KW_NDATA = [6]int8{
  12710. 0: int8(m_ASCII_N),
  12711. 1: int8(m_ASCII_D),
  12712. 2: int8(m_ASCII_A),
  12713. 3: int8(m_ASCII_T),
  12714. 4: int8(m_ASCII_A),
  12715. }
  12716. var _KW_NMTOKEN = [8]int8{
  12717. 0: int8(m_ASCII_N),
  12718. 1: int8(m_ASCII_M),
  12719. 2: int8(m_ASCII_T),
  12720. 3: int8(m_ASCII_O),
  12721. 4: int8(m_ASCII_K),
  12722. 5: int8(m_ASCII_E),
  12723. 6: int8(m_ASCII_N),
  12724. }
  12725. var _KW_NMTOKENS = [9]int8{
  12726. 0: int8(m_ASCII_N),
  12727. 1: int8(m_ASCII_M),
  12728. 2: int8(m_ASCII_T),
  12729. 3: int8(m_ASCII_O),
  12730. 4: int8(m_ASCII_K),
  12731. 5: int8(m_ASCII_E),
  12732. 6: int8(m_ASCII_N),
  12733. 7: int8(m_ASCII_S),
  12734. }
  12735. var _KW_NOTATION = [9]int8{
  12736. 0: int8(m_ASCII_N),
  12737. 1: int8(m_ASCII_O),
  12738. 2: int8(m_ASCII_T),
  12739. 3: int8(m_ASCII_A),
  12740. 4: int8(m_ASCII_T),
  12741. 5: int8(m_ASCII_I),
  12742. 6: int8(m_ASCII_O),
  12743. 7: int8(m_ASCII_N),
  12744. }
  12745. var _KW_PCDATA = [7]int8{
  12746. 0: int8(m_ASCII_P1),
  12747. 1: int8(m_ASCII_C),
  12748. 2: int8(m_ASCII_D),
  12749. 3: int8(m_ASCII_A),
  12750. 4: int8(m_ASCII_T),
  12751. 5: int8(m_ASCII_A),
  12752. }
  12753. var _KW_PUBLIC = [7]int8{
  12754. 0: int8(m_ASCII_P1),
  12755. 1: int8(m_ASCII_U1),
  12756. 2: int8(m_ASCII_B1),
  12757. 3: int8(m_ASCII_L),
  12758. 4: int8(m_ASCII_I),
  12759. 5: int8(m_ASCII_C),
  12760. }
  12761. var _KW_REQUIRED = [9]int8{
  12762. 0: int8(m_ASCII_R),
  12763. 1: int8(m_ASCII_E),
  12764. 2: int8(m_ASCII_Q1),
  12765. 3: int8(m_ASCII_U1),
  12766. 4: int8(m_ASCII_I),
  12767. 5: int8(m_ASCII_R),
  12768. 6: int8(m_ASCII_E),
  12769. 7: int8(m_ASCII_D),
  12770. }
  12771. var _KW_SYSTEM = [7]int8{
  12772. 0: int8(m_ASCII_S),
  12773. 1: int8(m_ASCII_Y),
  12774. 2: int8(m_ASCII_S),
  12775. 3: int8(m_ASCII_T),
  12776. 4: int8(m_ASCII_E),
  12777. 5: int8(m_ASCII_M),
  12778. }
  12779. func _prolog0(tls *libc.TLS, state uintptr, tok int32, ptr uintptr, end uintptr, enc uintptr) (r int32) {
  12780. switch tok {
  12781. case int32(m_XML_TOK_PROLOG_S):
  12782. (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_prolog1)
  12783. return int32(_XML_ROLE_NONE)
  12784. case int32(m_XML_TOK_XML_DECL):
  12785. (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_prolog1)
  12786. return int32(_XML_ROLE_XML_DECL)
  12787. case int32(m_XML_TOK_PI):
  12788. (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_prolog1)
  12789. return int32(_XML_ROLE_PI)
  12790. case int32(m_XML_TOK_COMMENT):
  12791. (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_prolog1)
  12792. return int32(_XML_ROLE_COMMENT)
  12793. case int32(m_XML_TOK_BOM):
  12794. return int32(_XML_ROLE_NONE)
  12795. case int32(m_XML_TOK_DECL_OPEN):
  12796. if !((*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*TENCODING)(unsafe.Pointer(enc)).FnameMatchesAscii})))(tls, enc, ptr+uintptr(int32(2)*(*TENCODING)(unsafe.Pointer(enc)).FminBytesPerChar), end, uintptr(unsafe.Pointer(&_KW_DOCTYPE))) != 0) {
  12797. break
  12798. }
  12799. (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_doctype0)
  12800. return int32(_XML_ROLE_DOCTYPE_NONE)
  12801. case int32(m_XML_TOK_INSTANCE_START):
  12802. (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_error)
  12803. return int32(_XML_ROLE_INSTANCE_START)
  12804. }
  12805. return _common(tls, state, tok)
  12806. }
  12807. func _prolog1(tls *libc.TLS, state uintptr, tok int32, ptr uintptr, end uintptr, enc uintptr) (r int32) {
  12808. switch tok {
  12809. case int32(m_XML_TOK_PROLOG_S):
  12810. return int32(_XML_ROLE_NONE)
  12811. case int32(m_XML_TOK_PI):
  12812. return int32(_XML_ROLE_PI)
  12813. case int32(m_XML_TOK_COMMENT):
  12814. return int32(_XML_ROLE_COMMENT)
  12815. case int32(m_XML_TOK_BOM):
  12816. /* This case can never arise. To reach this role function, the
  12817. * parse must have passed through prolog0 and therefore have had
  12818. * some form of input, even if only a space. At that point, a
  12819. * byte order mark is no longer a valid character (though
  12820. * technically it should be interpreted as a non-breaking space),
  12821. * so will be rejected by the tokenizing stages.
  12822. */
  12823. return int32(_XML_ROLE_NONE) /* LCOV_EXCL_LINE */
  12824. case int32(m_XML_TOK_DECL_OPEN):
  12825. if !((*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*TENCODING)(unsafe.Pointer(enc)).FnameMatchesAscii})))(tls, enc, ptr+uintptr(int32(2)*(*TENCODING)(unsafe.Pointer(enc)).FminBytesPerChar), end, uintptr(unsafe.Pointer(&_KW_DOCTYPE))) != 0) {
  12826. break
  12827. }
  12828. (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_doctype0)
  12829. return int32(_XML_ROLE_DOCTYPE_NONE)
  12830. case int32(m_XML_TOK_INSTANCE_START):
  12831. (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_error)
  12832. return int32(_XML_ROLE_INSTANCE_START)
  12833. }
  12834. return _common(tls, state, tok)
  12835. }
  12836. func _prolog2(tls *libc.TLS, state uintptr, tok int32, ptr uintptr, end uintptr, enc uintptr) (r int32) {
  12837. _ = ptr
  12838. _ = end
  12839. _ = enc
  12840. switch tok {
  12841. case int32(m_XML_TOK_PROLOG_S):
  12842. return int32(_XML_ROLE_NONE)
  12843. case int32(m_XML_TOK_PI):
  12844. return int32(_XML_ROLE_PI)
  12845. case int32(m_XML_TOK_COMMENT):
  12846. return int32(_XML_ROLE_COMMENT)
  12847. case int32(m_XML_TOK_INSTANCE_START):
  12848. (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_error)
  12849. return int32(_XML_ROLE_INSTANCE_START)
  12850. }
  12851. return _common(tls, state, tok)
  12852. }
  12853. func _doctype0(tls *libc.TLS, state uintptr, tok int32, ptr uintptr, end uintptr, enc uintptr) (r int32) {
  12854. _ = ptr
  12855. _ = end
  12856. _ = enc
  12857. switch tok {
  12858. case int32(m_XML_TOK_PROLOG_S):
  12859. return int32(_XML_ROLE_DOCTYPE_NONE)
  12860. case int32(m_XML_TOK_NAME):
  12861. fallthrough
  12862. case int32(m_XML_TOK_PREFIXED_NAME):
  12863. (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_doctype1)
  12864. return int32(_XML_ROLE_DOCTYPE_NAME)
  12865. }
  12866. return _common(tls, state, tok)
  12867. }
  12868. func _doctype1(tls *libc.TLS, state uintptr, tok int32, ptr uintptr, end uintptr, enc uintptr) (r int32) {
  12869. switch tok {
  12870. case int32(m_XML_TOK_PROLOG_S):
  12871. return int32(_XML_ROLE_DOCTYPE_NONE)
  12872. case int32(m_XML_TOK_OPEN_BRACKET):
  12873. (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_internalSubset)
  12874. return int32(_XML_ROLE_DOCTYPE_INTERNAL_SUBSET)
  12875. case int32(m_XML_TOK_DECL_CLOSE):
  12876. (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_prolog2)
  12877. return int32(_XML_ROLE_DOCTYPE_CLOSE)
  12878. case int32(m_XML_TOK_NAME):
  12879. if (*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*TENCODING)(unsafe.Pointer(enc)).FnameMatchesAscii})))(tls, enc, ptr, end, uintptr(unsafe.Pointer(&_KW_SYSTEM))) != 0 {
  12880. (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_doctype3)
  12881. return int32(_XML_ROLE_DOCTYPE_NONE)
  12882. }
  12883. if (*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*TENCODING)(unsafe.Pointer(enc)).FnameMatchesAscii})))(tls, enc, ptr, end, uintptr(unsafe.Pointer(&_KW_PUBLIC))) != 0 {
  12884. (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_doctype2)
  12885. return int32(_XML_ROLE_DOCTYPE_NONE)
  12886. }
  12887. break
  12888. }
  12889. return _common(tls, state, tok)
  12890. }
  12891. func _doctype2(tls *libc.TLS, state uintptr, tok int32, ptr uintptr, end uintptr, enc uintptr) (r int32) {
  12892. _ = ptr
  12893. _ = end
  12894. _ = enc
  12895. switch tok {
  12896. case int32(m_XML_TOK_PROLOG_S):
  12897. return int32(_XML_ROLE_DOCTYPE_NONE)
  12898. case int32(m_XML_TOK_LITERAL):
  12899. (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_doctype3)
  12900. return int32(_XML_ROLE_DOCTYPE_PUBLIC_ID)
  12901. }
  12902. return _common(tls, state, tok)
  12903. }
  12904. func _doctype3(tls *libc.TLS, state uintptr, tok int32, ptr uintptr, end uintptr, enc uintptr) (r int32) {
  12905. _ = ptr
  12906. _ = end
  12907. _ = enc
  12908. switch tok {
  12909. case int32(m_XML_TOK_PROLOG_S):
  12910. return int32(_XML_ROLE_DOCTYPE_NONE)
  12911. case int32(m_XML_TOK_LITERAL):
  12912. (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_doctype4)
  12913. return int32(_XML_ROLE_DOCTYPE_SYSTEM_ID)
  12914. }
  12915. return _common(tls, state, tok)
  12916. }
  12917. func _doctype4(tls *libc.TLS, state uintptr, tok int32, ptr uintptr, end uintptr, enc uintptr) (r int32) {
  12918. _ = ptr
  12919. _ = end
  12920. _ = enc
  12921. switch tok {
  12922. case int32(m_XML_TOK_PROLOG_S):
  12923. return int32(_XML_ROLE_DOCTYPE_NONE)
  12924. case int32(m_XML_TOK_OPEN_BRACKET):
  12925. (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_internalSubset)
  12926. return int32(_XML_ROLE_DOCTYPE_INTERNAL_SUBSET)
  12927. case int32(m_XML_TOK_DECL_CLOSE):
  12928. (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_prolog2)
  12929. return int32(_XML_ROLE_DOCTYPE_CLOSE)
  12930. }
  12931. return _common(tls, state, tok)
  12932. }
  12933. func _doctype5(tls *libc.TLS, state uintptr, tok int32, ptr uintptr, end uintptr, enc uintptr) (r int32) {
  12934. _ = ptr
  12935. _ = end
  12936. _ = enc
  12937. switch tok {
  12938. case int32(m_XML_TOK_PROLOG_S):
  12939. return int32(_XML_ROLE_DOCTYPE_NONE)
  12940. case int32(m_XML_TOK_DECL_CLOSE):
  12941. (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_prolog2)
  12942. return int32(_XML_ROLE_DOCTYPE_CLOSE)
  12943. }
  12944. return _common(tls, state, tok)
  12945. }
  12946. func _internalSubset(tls *libc.TLS, state uintptr, tok int32, ptr uintptr, end uintptr, enc uintptr) (r int32) {
  12947. switch tok {
  12948. case int32(m_XML_TOK_PROLOG_S):
  12949. return int32(_XML_ROLE_NONE)
  12950. case int32(m_XML_TOK_DECL_OPEN):
  12951. if (*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*TENCODING)(unsafe.Pointer(enc)).FnameMatchesAscii})))(tls, enc, ptr+uintptr(int32(2)*(*TENCODING)(unsafe.Pointer(enc)).FminBytesPerChar), end, uintptr(unsafe.Pointer(&_KW_ENTITY))) != 0 {
  12952. (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_entity0)
  12953. return int32(_XML_ROLE_ENTITY_NONE)
  12954. }
  12955. if (*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*TENCODING)(unsafe.Pointer(enc)).FnameMatchesAscii})))(tls, enc, ptr+uintptr(int32(2)*(*TENCODING)(unsafe.Pointer(enc)).FminBytesPerChar), end, uintptr(unsafe.Pointer(&_KW_ATTLIST))) != 0 {
  12956. (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_attlist0)
  12957. return int32(_XML_ROLE_ATTLIST_NONE)
  12958. }
  12959. if (*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*TENCODING)(unsafe.Pointer(enc)).FnameMatchesAscii})))(tls, enc, ptr+uintptr(int32(2)*(*TENCODING)(unsafe.Pointer(enc)).FminBytesPerChar), end, uintptr(unsafe.Pointer(&_KW_ELEMENT))) != 0 {
  12960. (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_element0)
  12961. return int32(_XML_ROLE_ELEMENT_NONE)
  12962. }
  12963. if (*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*TENCODING)(unsafe.Pointer(enc)).FnameMatchesAscii})))(tls, enc, ptr+uintptr(int32(2)*(*TENCODING)(unsafe.Pointer(enc)).FminBytesPerChar), end, uintptr(unsafe.Pointer(&_KW_NOTATION))) != 0 {
  12964. (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_notation0)
  12965. return int32(_XML_ROLE_NOTATION_NONE)
  12966. }
  12967. case int32(m_XML_TOK_PI):
  12968. return int32(_XML_ROLE_PI)
  12969. case int32(m_XML_TOK_COMMENT):
  12970. return int32(_XML_ROLE_COMMENT)
  12971. case int32(m_XML_TOK_PARAM_ENTITY_REF):
  12972. return int32(_XML_ROLE_PARAM_ENTITY_REF)
  12973. case int32(m_XML_TOK_CLOSE_BRACKET):
  12974. (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_doctype5)
  12975. return int32(_XML_ROLE_DOCTYPE_NONE)
  12976. case -int32(4):
  12977. return int32(_XML_ROLE_NONE)
  12978. }
  12979. return _common(tls, state, tok)
  12980. }
  12981. func _externalSubset0(tls *libc.TLS, state uintptr, tok int32, ptr uintptr, end uintptr, enc uintptr) (r int32) {
  12982. (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_externalSubset1)
  12983. if tok == int32(m_XML_TOK_XML_DECL) {
  12984. return int32(_XML_ROLE_TEXT_DECL)
  12985. }
  12986. return _externalSubset1(tls, state, tok, ptr, end, enc)
  12987. }
  12988. func _externalSubset1(tls *libc.TLS, state uintptr, tok int32, ptr uintptr, end uintptr, enc uintptr) (r int32) {
  12989. switch tok {
  12990. case int32(m_XML_TOK_COND_SECT_OPEN):
  12991. (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_condSect0)
  12992. return int32(_XML_ROLE_NONE)
  12993. case int32(m_XML_TOK_COND_SECT_CLOSE):
  12994. if (*TPROLOG_STATE)(unsafe.Pointer(state)).FincludeLevel == uint32(0) {
  12995. break
  12996. }
  12997. *(*uint32)(unsafe.Pointer(state + 16)) -= uint32(1)
  12998. return int32(_XML_ROLE_NONE)
  12999. case int32(m_XML_TOK_PROLOG_S):
  13000. return int32(_XML_ROLE_NONE)
  13001. case int32(m_XML_TOK_CLOSE_BRACKET):
  13002. case -int32(4):
  13003. if (*TPROLOG_STATE)(unsafe.Pointer(state)).FincludeLevel != 0 {
  13004. break
  13005. }
  13006. return int32(_XML_ROLE_NONE)
  13007. default:
  13008. return _internalSubset(tls, state, tok, ptr, end, enc)
  13009. }
  13010. return _common(tls, state, tok)
  13011. }
  13012. func _entity0(tls *libc.TLS, state uintptr, tok int32, ptr uintptr, end uintptr, enc uintptr) (r int32) {
  13013. _ = ptr
  13014. _ = end
  13015. _ = enc
  13016. switch tok {
  13017. case int32(m_XML_TOK_PROLOG_S):
  13018. return int32(_XML_ROLE_ENTITY_NONE)
  13019. case int32(m_XML_TOK_PERCENT):
  13020. (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_entity1)
  13021. return int32(_XML_ROLE_ENTITY_NONE)
  13022. case int32(m_XML_TOK_NAME):
  13023. (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_entity2)
  13024. return int32(_XML_ROLE_GENERAL_ENTITY_NAME)
  13025. }
  13026. return _common(tls, state, tok)
  13027. }
  13028. func _entity1(tls *libc.TLS, state uintptr, tok int32, ptr uintptr, end uintptr, enc uintptr) (r int32) {
  13029. _ = ptr
  13030. _ = end
  13031. _ = enc
  13032. switch tok {
  13033. case int32(m_XML_TOK_PROLOG_S):
  13034. return int32(_XML_ROLE_ENTITY_NONE)
  13035. case int32(m_XML_TOK_NAME):
  13036. (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_entity7)
  13037. return int32(_XML_ROLE_PARAM_ENTITY_NAME)
  13038. }
  13039. return _common(tls, state, tok)
  13040. }
  13041. func _entity2(tls *libc.TLS, state uintptr, tok int32, ptr uintptr, end uintptr, enc uintptr) (r int32) {
  13042. switch tok {
  13043. case int32(m_XML_TOK_PROLOG_S):
  13044. return int32(_XML_ROLE_ENTITY_NONE)
  13045. case int32(m_XML_TOK_NAME):
  13046. if (*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*TENCODING)(unsafe.Pointer(enc)).FnameMatchesAscii})))(tls, enc, ptr, end, uintptr(unsafe.Pointer(&_KW_SYSTEM))) != 0 {
  13047. (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_entity4)
  13048. return int32(_XML_ROLE_ENTITY_NONE)
  13049. }
  13050. if (*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*TENCODING)(unsafe.Pointer(enc)).FnameMatchesAscii})))(tls, enc, ptr, end, uintptr(unsafe.Pointer(&_KW_PUBLIC))) != 0 {
  13051. (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_entity3)
  13052. return int32(_XML_ROLE_ENTITY_NONE)
  13053. }
  13054. case int32(m_XML_TOK_LITERAL):
  13055. (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_declClose)
  13056. (*TPROLOG_STATE)(unsafe.Pointer(state)).Frole_none = int32(_XML_ROLE_ENTITY_NONE)
  13057. return int32(_XML_ROLE_ENTITY_VALUE)
  13058. }
  13059. return _common(tls, state, tok)
  13060. }
  13061. func _entity3(tls *libc.TLS, state uintptr, tok int32, ptr uintptr, end uintptr, enc uintptr) (r int32) {
  13062. _ = ptr
  13063. _ = end
  13064. _ = enc
  13065. switch tok {
  13066. case int32(m_XML_TOK_PROLOG_S):
  13067. return int32(_XML_ROLE_ENTITY_NONE)
  13068. case int32(m_XML_TOK_LITERAL):
  13069. (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_entity4)
  13070. return int32(_XML_ROLE_ENTITY_PUBLIC_ID)
  13071. }
  13072. return _common(tls, state, tok)
  13073. }
  13074. func _entity4(tls *libc.TLS, state uintptr, tok int32, ptr uintptr, end uintptr, enc uintptr) (r int32) {
  13075. _ = ptr
  13076. _ = end
  13077. _ = enc
  13078. switch tok {
  13079. case int32(m_XML_TOK_PROLOG_S):
  13080. return int32(_XML_ROLE_ENTITY_NONE)
  13081. case int32(m_XML_TOK_LITERAL):
  13082. (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_entity5)
  13083. return int32(_XML_ROLE_ENTITY_SYSTEM_ID)
  13084. }
  13085. return _common(tls, state, tok)
  13086. }
  13087. func _entity5(tls *libc.TLS, state uintptr, tok int32, ptr uintptr, end uintptr, enc uintptr) (r int32) {
  13088. var v1 uintptr
  13089. _ = v1
  13090. switch tok {
  13091. case int32(m_XML_TOK_PROLOG_S):
  13092. return int32(_XML_ROLE_ENTITY_NONE)
  13093. case int32(m_XML_TOK_DECL_CLOSE):
  13094. if (*TPROLOG_STATE)(unsafe.Pointer(state)).FdocumentEntity != 0 {
  13095. v1 = __ccgo_fp(_internalSubset)
  13096. } else {
  13097. v1 = __ccgo_fp(_externalSubset1)
  13098. }
  13099. (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = v1
  13100. return int32(_XML_ROLE_ENTITY_COMPLETE)
  13101. case int32(m_XML_TOK_NAME):
  13102. if (*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*TENCODING)(unsafe.Pointer(enc)).FnameMatchesAscii})))(tls, enc, ptr, end, uintptr(unsafe.Pointer(&_KW_NDATA))) != 0 {
  13103. (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_entity6)
  13104. return int32(_XML_ROLE_ENTITY_NONE)
  13105. }
  13106. break
  13107. }
  13108. return _common(tls, state, tok)
  13109. }
  13110. func _entity6(tls *libc.TLS, state uintptr, tok int32, ptr uintptr, end uintptr, enc uintptr) (r int32) {
  13111. _ = ptr
  13112. _ = end
  13113. _ = enc
  13114. switch tok {
  13115. case int32(m_XML_TOK_PROLOG_S):
  13116. return int32(_XML_ROLE_ENTITY_NONE)
  13117. case int32(m_XML_TOK_NAME):
  13118. (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_declClose)
  13119. (*TPROLOG_STATE)(unsafe.Pointer(state)).Frole_none = int32(_XML_ROLE_ENTITY_NONE)
  13120. return int32(_XML_ROLE_ENTITY_NOTATION_NAME)
  13121. }
  13122. return _common(tls, state, tok)
  13123. }
  13124. func _entity7(tls *libc.TLS, state uintptr, tok int32, ptr uintptr, end uintptr, enc uintptr) (r int32) {
  13125. switch tok {
  13126. case int32(m_XML_TOK_PROLOG_S):
  13127. return int32(_XML_ROLE_ENTITY_NONE)
  13128. case int32(m_XML_TOK_NAME):
  13129. if (*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*TENCODING)(unsafe.Pointer(enc)).FnameMatchesAscii})))(tls, enc, ptr, end, uintptr(unsafe.Pointer(&_KW_SYSTEM))) != 0 {
  13130. (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_entity9)
  13131. return int32(_XML_ROLE_ENTITY_NONE)
  13132. }
  13133. if (*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*TENCODING)(unsafe.Pointer(enc)).FnameMatchesAscii})))(tls, enc, ptr, end, uintptr(unsafe.Pointer(&_KW_PUBLIC))) != 0 {
  13134. (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_entity8)
  13135. return int32(_XML_ROLE_ENTITY_NONE)
  13136. }
  13137. case int32(m_XML_TOK_LITERAL):
  13138. (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_declClose)
  13139. (*TPROLOG_STATE)(unsafe.Pointer(state)).Frole_none = int32(_XML_ROLE_ENTITY_NONE)
  13140. return int32(_XML_ROLE_ENTITY_VALUE)
  13141. }
  13142. return _common(tls, state, tok)
  13143. }
  13144. func _entity8(tls *libc.TLS, state uintptr, tok int32, ptr uintptr, end uintptr, enc uintptr) (r int32) {
  13145. _ = ptr
  13146. _ = end
  13147. _ = enc
  13148. switch tok {
  13149. case int32(m_XML_TOK_PROLOG_S):
  13150. return int32(_XML_ROLE_ENTITY_NONE)
  13151. case int32(m_XML_TOK_LITERAL):
  13152. (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_entity9)
  13153. return int32(_XML_ROLE_ENTITY_PUBLIC_ID)
  13154. }
  13155. return _common(tls, state, tok)
  13156. }
  13157. func _entity9(tls *libc.TLS, state uintptr, tok int32, ptr uintptr, end uintptr, enc uintptr) (r int32) {
  13158. _ = ptr
  13159. _ = end
  13160. _ = enc
  13161. switch tok {
  13162. case int32(m_XML_TOK_PROLOG_S):
  13163. return int32(_XML_ROLE_ENTITY_NONE)
  13164. case int32(m_XML_TOK_LITERAL):
  13165. (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_entity10)
  13166. return int32(_XML_ROLE_ENTITY_SYSTEM_ID)
  13167. }
  13168. return _common(tls, state, tok)
  13169. }
  13170. func _entity10(tls *libc.TLS, state uintptr, tok int32, ptr uintptr, end uintptr, enc uintptr) (r int32) {
  13171. var v1 uintptr
  13172. _ = v1
  13173. _ = ptr
  13174. _ = end
  13175. _ = enc
  13176. switch tok {
  13177. case int32(m_XML_TOK_PROLOG_S):
  13178. return int32(_XML_ROLE_ENTITY_NONE)
  13179. case int32(m_XML_TOK_DECL_CLOSE):
  13180. if (*TPROLOG_STATE)(unsafe.Pointer(state)).FdocumentEntity != 0 {
  13181. v1 = __ccgo_fp(_internalSubset)
  13182. } else {
  13183. v1 = __ccgo_fp(_externalSubset1)
  13184. }
  13185. (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = v1
  13186. return int32(_XML_ROLE_ENTITY_COMPLETE)
  13187. }
  13188. return _common(tls, state, tok)
  13189. }
  13190. func _notation0(tls *libc.TLS, state uintptr, tok int32, ptr uintptr, end uintptr, enc uintptr) (r int32) {
  13191. _ = ptr
  13192. _ = end
  13193. _ = enc
  13194. switch tok {
  13195. case int32(m_XML_TOK_PROLOG_S):
  13196. return int32(_XML_ROLE_NOTATION_NONE)
  13197. case int32(m_XML_TOK_NAME):
  13198. (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_notation1)
  13199. return int32(_XML_ROLE_NOTATION_NAME)
  13200. }
  13201. return _common(tls, state, tok)
  13202. }
  13203. func _notation1(tls *libc.TLS, state uintptr, tok int32, ptr uintptr, end uintptr, enc uintptr) (r int32) {
  13204. switch tok {
  13205. case int32(m_XML_TOK_PROLOG_S):
  13206. return int32(_XML_ROLE_NOTATION_NONE)
  13207. case int32(m_XML_TOK_NAME):
  13208. if (*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*TENCODING)(unsafe.Pointer(enc)).FnameMatchesAscii})))(tls, enc, ptr, end, uintptr(unsafe.Pointer(&_KW_SYSTEM))) != 0 {
  13209. (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_notation3)
  13210. return int32(_XML_ROLE_NOTATION_NONE)
  13211. }
  13212. if (*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*TENCODING)(unsafe.Pointer(enc)).FnameMatchesAscii})))(tls, enc, ptr, end, uintptr(unsafe.Pointer(&_KW_PUBLIC))) != 0 {
  13213. (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_notation2)
  13214. return int32(_XML_ROLE_NOTATION_NONE)
  13215. }
  13216. break
  13217. }
  13218. return _common(tls, state, tok)
  13219. }
  13220. func _notation2(tls *libc.TLS, state uintptr, tok int32, ptr uintptr, end uintptr, enc uintptr) (r int32) {
  13221. _ = ptr
  13222. _ = end
  13223. _ = enc
  13224. switch tok {
  13225. case int32(m_XML_TOK_PROLOG_S):
  13226. return int32(_XML_ROLE_NOTATION_NONE)
  13227. case int32(m_XML_TOK_LITERAL):
  13228. (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_notation4)
  13229. return int32(_XML_ROLE_NOTATION_PUBLIC_ID)
  13230. }
  13231. return _common(tls, state, tok)
  13232. }
  13233. func _notation3(tls *libc.TLS, state uintptr, tok int32, ptr uintptr, end uintptr, enc uintptr) (r int32) {
  13234. _ = ptr
  13235. _ = end
  13236. _ = enc
  13237. switch tok {
  13238. case int32(m_XML_TOK_PROLOG_S):
  13239. return int32(_XML_ROLE_NOTATION_NONE)
  13240. case int32(m_XML_TOK_LITERAL):
  13241. (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_declClose)
  13242. (*TPROLOG_STATE)(unsafe.Pointer(state)).Frole_none = int32(_XML_ROLE_NOTATION_NONE)
  13243. return int32(_XML_ROLE_NOTATION_SYSTEM_ID)
  13244. }
  13245. return _common(tls, state, tok)
  13246. }
  13247. func _notation4(tls *libc.TLS, state uintptr, tok int32, ptr uintptr, end uintptr, enc uintptr) (r int32) {
  13248. var v1 uintptr
  13249. _ = v1
  13250. _ = ptr
  13251. _ = end
  13252. _ = enc
  13253. switch tok {
  13254. case int32(m_XML_TOK_PROLOG_S):
  13255. return int32(_XML_ROLE_NOTATION_NONE)
  13256. case int32(m_XML_TOK_LITERAL):
  13257. (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_declClose)
  13258. (*TPROLOG_STATE)(unsafe.Pointer(state)).Frole_none = int32(_XML_ROLE_NOTATION_NONE)
  13259. return int32(_XML_ROLE_NOTATION_SYSTEM_ID)
  13260. case int32(m_XML_TOK_DECL_CLOSE):
  13261. if (*TPROLOG_STATE)(unsafe.Pointer(state)).FdocumentEntity != 0 {
  13262. v1 = __ccgo_fp(_internalSubset)
  13263. } else {
  13264. v1 = __ccgo_fp(_externalSubset1)
  13265. }
  13266. (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = v1
  13267. return int32(_XML_ROLE_NOTATION_NO_SYSTEM_ID)
  13268. }
  13269. return _common(tls, state, tok)
  13270. }
  13271. func _attlist0(tls *libc.TLS, state uintptr, tok int32, ptr uintptr, end uintptr, enc uintptr) (r int32) {
  13272. _ = ptr
  13273. _ = end
  13274. _ = enc
  13275. switch tok {
  13276. case int32(m_XML_TOK_PROLOG_S):
  13277. return int32(_XML_ROLE_ATTLIST_NONE)
  13278. case int32(m_XML_TOK_NAME):
  13279. fallthrough
  13280. case int32(m_XML_TOK_PREFIXED_NAME):
  13281. (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_attlist1)
  13282. return int32(_XML_ROLE_ATTLIST_ELEMENT_NAME)
  13283. }
  13284. return _common(tls, state, tok)
  13285. }
  13286. func _attlist1(tls *libc.TLS, state uintptr, tok int32, ptr uintptr, end uintptr, enc uintptr) (r int32) {
  13287. var v1 uintptr
  13288. _ = v1
  13289. _ = ptr
  13290. _ = end
  13291. _ = enc
  13292. switch tok {
  13293. case int32(m_XML_TOK_PROLOG_S):
  13294. return int32(_XML_ROLE_ATTLIST_NONE)
  13295. case int32(m_XML_TOK_DECL_CLOSE):
  13296. if (*TPROLOG_STATE)(unsafe.Pointer(state)).FdocumentEntity != 0 {
  13297. v1 = __ccgo_fp(_internalSubset)
  13298. } else {
  13299. v1 = __ccgo_fp(_externalSubset1)
  13300. }
  13301. (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = v1
  13302. return int32(_XML_ROLE_ATTLIST_NONE)
  13303. case int32(m_XML_TOK_NAME):
  13304. fallthrough
  13305. case int32(m_XML_TOK_PREFIXED_NAME):
  13306. (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_attlist2)
  13307. return int32(_XML_ROLE_ATTRIBUTE_NAME)
  13308. }
  13309. return _common(tls, state, tok)
  13310. }
  13311. func _attlist2(tls *libc.TLS, state uintptr, tok int32, ptr uintptr, end uintptr, enc uintptr) (r int32) {
  13312. var i int32
  13313. _ = i
  13314. switch tok {
  13315. case int32(m_XML_TOK_PROLOG_S):
  13316. return int32(_XML_ROLE_ATTLIST_NONE)
  13317. case int32(m_XML_TOK_NAME):
  13318. i = 0
  13319. for {
  13320. if !(i < libc.Int32FromUint64(libc.Uint64FromInt64(64)/libc.Uint64FromInt64(8))) {
  13321. break
  13322. }
  13323. if (*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*TENCODING)(unsafe.Pointer(enc)).FnameMatchesAscii})))(tls, enc, ptr, end, _types[i]) != 0 {
  13324. (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_attlist8)
  13325. return int32(_XML_ROLE_ATTRIBUTE_TYPE_CDATA) + i
  13326. }
  13327. goto _1
  13328. _1:
  13329. ;
  13330. i++
  13331. }
  13332. if (*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*TENCODING)(unsafe.Pointer(enc)).FnameMatchesAscii})))(tls, enc, ptr, end, uintptr(unsafe.Pointer(&_KW_NOTATION))) != 0 {
  13333. (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_attlist5)
  13334. return int32(_XML_ROLE_ATTLIST_NONE)
  13335. }
  13336. case int32(m_XML_TOK_OPEN_PAREN):
  13337. (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_attlist3)
  13338. return int32(_XML_ROLE_ATTLIST_NONE)
  13339. }
  13340. return _common(tls, state, tok)
  13341. }
  13342. var _types = [8]uintptr{
  13343. 0: uintptr(unsafe.Pointer(&_KW_CDATA)),
  13344. 1: uintptr(unsafe.Pointer(&_KW_ID)),
  13345. 2: uintptr(unsafe.Pointer(&_KW_IDREF)),
  13346. 3: uintptr(unsafe.Pointer(&_KW_IDREFS)),
  13347. 4: uintptr(unsafe.Pointer(&_KW_ENTITY)),
  13348. 5: uintptr(unsafe.Pointer(&_KW_ENTITIES)),
  13349. 6: uintptr(unsafe.Pointer(&_KW_NMTOKEN)),
  13350. 7: uintptr(unsafe.Pointer(&_KW_NMTOKENS)),
  13351. }
  13352. func _attlist3(tls *libc.TLS, state uintptr, tok int32, ptr uintptr, end uintptr, enc uintptr) (r int32) {
  13353. _ = ptr
  13354. _ = end
  13355. _ = enc
  13356. switch tok {
  13357. case int32(m_XML_TOK_PROLOG_S):
  13358. return int32(_XML_ROLE_ATTLIST_NONE)
  13359. case int32(m_XML_TOK_NMTOKEN):
  13360. fallthrough
  13361. case int32(m_XML_TOK_NAME):
  13362. fallthrough
  13363. case int32(m_XML_TOK_PREFIXED_NAME):
  13364. (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_attlist4)
  13365. return int32(_XML_ROLE_ATTRIBUTE_ENUM_VALUE)
  13366. }
  13367. return _common(tls, state, tok)
  13368. }
  13369. func _attlist4(tls *libc.TLS, state uintptr, tok int32, ptr uintptr, end uintptr, enc uintptr) (r int32) {
  13370. _ = ptr
  13371. _ = end
  13372. _ = enc
  13373. switch tok {
  13374. case int32(m_XML_TOK_PROLOG_S):
  13375. return int32(_XML_ROLE_ATTLIST_NONE)
  13376. case int32(m_XML_TOK_CLOSE_PAREN):
  13377. (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_attlist8)
  13378. return int32(_XML_ROLE_ATTLIST_NONE)
  13379. case int32(m_XML_TOK_OR):
  13380. (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_attlist3)
  13381. return int32(_XML_ROLE_ATTLIST_NONE)
  13382. }
  13383. return _common(tls, state, tok)
  13384. }
  13385. func _attlist5(tls *libc.TLS, state uintptr, tok int32, ptr uintptr, end uintptr, enc uintptr) (r int32) {
  13386. _ = ptr
  13387. _ = end
  13388. _ = enc
  13389. switch tok {
  13390. case int32(m_XML_TOK_PROLOG_S):
  13391. return int32(_XML_ROLE_ATTLIST_NONE)
  13392. case int32(m_XML_TOK_OPEN_PAREN):
  13393. (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_attlist6)
  13394. return int32(_XML_ROLE_ATTLIST_NONE)
  13395. }
  13396. return _common(tls, state, tok)
  13397. }
  13398. func _attlist6(tls *libc.TLS, state uintptr, tok int32, ptr uintptr, end uintptr, enc uintptr) (r int32) {
  13399. _ = ptr
  13400. _ = end
  13401. _ = enc
  13402. switch tok {
  13403. case int32(m_XML_TOK_PROLOG_S):
  13404. return int32(_XML_ROLE_ATTLIST_NONE)
  13405. case int32(m_XML_TOK_NAME):
  13406. (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_attlist7)
  13407. return int32(_XML_ROLE_ATTRIBUTE_NOTATION_VALUE)
  13408. }
  13409. return _common(tls, state, tok)
  13410. }
  13411. func _attlist7(tls *libc.TLS, state uintptr, tok int32, ptr uintptr, end uintptr, enc uintptr) (r int32) {
  13412. _ = ptr
  13413. _ = end
  13414. _ = enc
  13415. switch tok {
  13416. case int32(m_XML_TOK_PROLOG_S):
  13417. return int32(_XML_ROLE_ATTLIST_NONE)
  13418. case int32(m_XML_TOK_CLOSE_PAREN):
  13419. (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_attlist8)
  13420. return int32(_XML_ROLE_ATTLIST_NONE)
  13421. case int32(m_XML_TOK_OR):
  13422. (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_attlist6)
  13423. return int32(_XML_ROLE_ATTLIST_NONE)
  13424. }
  13425. return _common(tls, state, tok)
  13426. }
  13427. // C documentation
  13428. //
  13429. // /* default value */
  13430. func _attlist8(tls *libc.TLS, state uintptr, tok int32, ptr uintptr, end uintptr, enc uintptr) (r int32) {
  13431. switch tok {
  13432. case int32(m_XML_TOK_PROLOG_S):
  13433. return int32(_XML_ROLE_ATTLIST_NONE)
  13434. case int32(m_XML_TOK_POUND_NAME):
  13435. if (*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*TENCODING)(unsafe.Pointer(enc)).FnameMatchesAscii})))(tls, enc, ptr+uintptr((*TENCODING)(unsafe.Pointer(enc)).FminBytesPerChar), end, uintptr(unsafe.Pointer(&_KW_IMPLIED))) != 0 {
  13436. (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_attlist1)
  13437. return int32(_XML_ROLE_IMPLIED_ATTRIBUTE_VALUE)
  13438. }
  13439. if (*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*TENCODING)(unsafe.Pointer(enc)).FnameMatchesAscii})))(tls, enc, ptr+uintptr((*TENCODING)(unsafe.Pointer(enc)).FminBytesPerChar), end, uintptr(unsafe.Pointer(&_KW_REQUIRED))) != 0 {
  13440. (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_attlist1)
  13441. return int32(_XML_ROLE_REQUIRED_ATTRIBUTE_VALUE)
  13442. }
  13443. if (*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*TENCODING)(unsafe.Pointer(enc)).FnameMatchesAscii})))(tls, enc, ptr+uintptr((*TENCODING)(unsafe.Pointer(enc)).FminBytesPerChar), end, uintptr(unsafe.Pointer(&_KW_FIXED))) != 0 {
  13444. (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_attlist9)
  13445. return int32(_XML_ROLE_ATTLIST_NONE)
  13446. }
  13447. case int32(m_XML_TOK_LITERAL):
  13448. (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_attlist1)
  13449. return int32(_XML_ROLE_DEFAULT_ATTRIBUTE_VALUE)
  13450. }
  13451. return _common(tls, state, tok)
  13452. }
  13453. func _attlist9(tls *libc.TLS, state uintptr, tok int32, ptr uintptr, end uintptr, enc uintptr) (r int32) {
  13454. _ = ptr
  13455. _ = end
  13456. _ = enc
  13457. switch tok {
  13458. case int32(m_XML_TOK_PROLOG_S):
  13459. return int32(_XML_ROLE_ATTLIST_NONE)
  13460. case int32(m_XML_TOK_LITERAL):
  13461. (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_attlist1)
  13462. return int32(_XML_ROLE_FIXED_ATTRIBUTE_VALUE)
  13463. }
  13464. return _common(tls, state, tok)
  13465. }
  13466. func _element0(tls *libc.TLS, state uintptr, tok int32, ptr uintptr, end uintptr, enc uintptr) (r int32) {
  13467. _ = ptr
  13468. _ = end
  13469. _ = enc
  13470. switch tok {
  13471. case int32(m_XML_TOK_PROLOG_S):
  13472. return int32(_XML_ROLE_ELEMENT_NONE)
  13473. case int32(m_XML_TOK_NAME):
  13474. fallthrough
  13475. case int32(m_XML_TOK_PREFIXED_NAME):
  13476. (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_element1)
  13477. return int32(_XML_ROLE_ELEMENT_NAME)
  13478. }
  13479. return _common(tls, state, tok)
  13480. }
  13481. func _element1(tls *libc.TLS, state uintptr, tok int32, ptr uintptr, end uintptr, enc uintptr) (r int32) {
  13482. switch tok {
  13483. case int32(m_XML_TOK_PROLOG_S):
  13484. return int32(_XML_ROLE_ELEMENT_NONE)
  13485. case int32(m_XML_TOK_NAME):
  13486. if (*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*TENCODING)(unsafe.Pointer(enc)).FnameMatchesAscii})))(tls, enc, ptr, end, uintptr(unsafe.Pointer(&_KW_EMPTY))) != 0 {
  13487. (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_declClose)
  13488. (*TPROLOG_STATE)(unsafe.Pointer(state)).Frole_none = int32(_XML_ROLE_ELEMENT_NONE)
  13489. return int32(_XML_ROLE_CONTENT_EMPTY)
  13490. }
  13491. if (*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*TENCODING)(unsafe.Pointer(enc)).FnameMatchesAscii})))(tls, enc, ptr, end, uintptr(unsafe.Pointer(&_KW_ANY))) != 0 {
  13492. (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_declClose)
  13493. (*TPROLOG_STATE)(unsafe.Pointer(state)).Frole_none = int32(_XML_ROLE_ELEMENT_NONE)
  13494. return int32(_XML_ROLE_CONTENT_ANY)
  13495. }
  13496. case int32(m_XML_TOK_OPEN_PAREN):
  13497. (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_element2)
  13498. (*TPROLOG_STATE)(unsafe.Pointer(state)).Flevel = uint32(1)
  13499. return int32(_XML_ROLE_GROUP_OPEN)
  13500. }
  13501. return _common(tls, state, tok)
  13502. }
  13503. func _element2(tls *libc.TLS, state uintptr, tok int32, ptr uintptr, end uintptr, enc uintptr) (r int32) {
  13504. switch tok {
  13505. case int32(m_XML_TOK_PROLOG_S):
  13506. return int32(_XML_ROLE_ELEMENT_NONE)
  13507. case int32(m_XML_TOK_POUND_NAME):
  13508. if (*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*TENCODING)(unsafe.Pointer(enc)).FnameMatchesAscii})))(tls, enc, ptr+uintptr((*TENCODING)(unsafe.Pointer(enc)).FminBytesPerChar), end, uintptr(unsafe.Pointer(&_KW_PCDATA))) != 0 {
  13509. (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_element3)
  13510. return int32(_XML_ROLE_CONTENT_PCDATA)
  13511. }
  13512. case int32(m_XML_TOK_OPEN_PAREN):
  13513. (*TPROLOG_STATE)(unsafe.Pointer(state)).Flevel = uint32(2)
  13514. (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_element6)
  13515. return int32(_XML_ROLE_GROUP_OPEN)
  13516. case int32(m_XML_TOK_NAME):
  13517. fallthrough
  13518. case int32(m_XML_TOK_PREFIXED_NAME):
  13519. (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_element7)
  13520. return int32(_XML_ROLE_CONTENT_ELEMENT)
  13521. case int32(m_XML_TOK_NAME_QUESTION):
  13522. (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_element7)
  13523. return int32(_XML_ROLE_CONTENT_ELEMENT_OPT)
  13524. case int32(m_XML_TOK_NAME_ASTERISK):
  13525. (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_element7)
  13526. return int32(_XML_ROLE_CONTENT_ELEMENT_REP)
  13527. case int32(m_XML_TOK_NAME_PLUS):
  13528. (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_element7)
  13529. return int32(_XML_ROLE_CONTENT_ELEMENT_PLUS)
  13530. }
  13531. return _common(tls, state, tok)
  13532. }
  13533. func _element3(tls *libc.TLS, state uintptr, tok int32, ptr uintptr, end uintptr, enc uintptr) (r int32) {
  13534. _ = ptr
  13535. _ = end
  13536. _ = enc
  13537. switch tok {
  13538. case int32(m_XML_TOK_PROLOG_S):
  13539. return int32(_XML_ROLE_ELEMENT_NONE)
  13540. case int32(m_XML_TOK_CLOSE_PAREN):
  13541. (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_declClose)
  13542. (*TPROLOG_STATE)(unsafe.Pointer(state)).Frole_none = int32(_XML_ROLE_ELEMENT_NONE)
  13543. return int32(_XML_ROLE_GROUP_CLOSE)
  13544. case int32(m_XML_TOK_CLOSE_PAREN_ASTERISK):
  13545. (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_declClose)
  13546. (*TPROLOG_STATE)(unsafe.Pointer(state)).Frole_none = int32(_XML_ROLE_ELEMENT_NONE)
  13547. return int32(_XML_ROLE_GROUP_CLOSE_REP)
  13548. case int32(m_XML_TOK_OR):
  13549. (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_element4)
  13550. return int32(_XML_ROLE_ELEMENT_NONE)
  13551. }
  13552. return _common(tls, state, tok)
  13553. }
  13554. func _element4(tls *libc.TLS, state uintptr, tok int32, ptr uintptr, end uintptr, enc uintptr) (r int32) {
  13555. _ = ptr
  13556. _ = end
  13557. _ = enc
  13558. switch tok {
  13559. case int32(m_XML_TOK_PROLOG_S):
  13560. return int32(_XML_ROLE_ELEMENT_NONE)
  13561. case int32(m_XML_TOK_NAME):
  13562. fallthrough
  13563. case int32(m_XML_TOK_PREFIXED_NAME):
  13564. (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_element5)
  13565. return int32(_XML_ROLE_CONTENT_ELEMENT)
  13566. }
  13567. return _common(tls, state, tok)
  13568. }
  13569. func _element5(tls *libc.TLS, state uintptr, tok int32, ptr uintptr, end uintptr, enc uintptr) (r int32) {
  13570. _ = ptr
  13571. _ = end
  13572. _ = enc
  13573. switch tok {
  13574. case int32(m_XML_TOK_PROLOG_S):
  13575. return int32(_XML_ROLE_ELEMENT_NONE)
  13576. case int32(m_XML_TOK_CLOSE_PAREN_ASTERISK):
  13577. (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_declClose)
  13578. (*TPROLOG_STATE)(unsafe.Pointer(state)).Frole_none = int32(_XML_ROLE_ELEMENT_NONE)
  13579. return int32(_XML_ROLE_GROUP_CLOSE_REP)
  13580. case int32(m_XML_TOK_OR):
  13581. (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_element4)
  13582. return int32(_XML_ROLE_ELEMENT_NONE)
  13583. }
  13584. return _common(tls, state, tok)
  13585. }
  13586. func _element6(tls *libc.TLS, state uintptr, tok int32, ptr uintptr, end uintptr, enc uintptr) (r int32) {
  13587. _ = ptr
  13588. _ = end
  13589. _ = enc
  13590. switch tok {
  13591. case int32(m_XML_TOK_PROLOG_S):
  13592. return int32(_XML_ROLE_ELEMENT_NONE)
  13593. case int32(m_XML_TOK_OPEN_PAREN):
  13594. *(*uint32)(unsafe.Pointer(state + 8)) += uint32(1)
  13595. return int32(_XML_ROLE_GROUP_OPEN)
  13596. case int32(m_XML_TOK_NAME):
  13597. fallthrough
  13598. case int32(m_XML_TOK_PREFIXED_NAME):
  13599. (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_element7)
  13600. return int32(_XML_ROLE_CONTENT_ELEMENT)
  13601. case int32(m_XML_TOK_NAME_QUESTION):
  13602. (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_element7)
  13603. return int32(_XML_ROLE_CONTENT_ELEMENT_OPT)
  13604. case int32(m_XML_TOK_NAME_ASTERISK):
  13605. (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_element7)
  13606. return int32(_XML_ROLE_CONTENT_ELEMENT_REP)
  13607. case int32(m_XML_TOK_NAME_PLUS):
  13608. (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_element7)
  13609. return int32(_XML_ROLE_CONTENT_ELEMENT_PLUS)
  13610. }
  13611. return _common(tls, state, tok)
  13612. }
  13613. func _element7(tls *libc.TLS, state uintptr, tok int32, ptr uintptr, end uintptr, enc uintptr) (r int32) {
  13614. _ = ptr
  13615. _ = end
  13616. _ = enc
  13617. switch tok {
  13618. case int32(m_XML_TOK_PROLOG_S):
  13619. return int32(_XML_ROLE_ELEMENT_NONE)
  13620. case int32(m_XML_TOK_CLOSE_PAREN):
  13621. *(*uint32)(unsafe.Pointer(state + 8)) -= uint32(1)
  13622. if (*TPROLOG_STATE)(unsafe.Pointer(state)).Flevel == uint32(0) {
  13623. (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_declClose)
  13624. (*TPROLOG_STATE)(unsafe.Pointer(state)).Frole_none = int32(_XML_ROLE_ELEMENT_NONE)
  13625. }
  13626. return int32(_XML_ROLE_GROUP_CLOSE)
  13627. case int32(m_XML_TOK_CLOSE_PAREN_ASTERISK):
  13628. *(*uint32)(unsafe.Pointer(state + 8)) -= uint32(1)
  13629. if (*TPROLOG_STATE)(unsafe.Pointer(state)).Flevel == uint32(0) {
  13630. (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_declClose)
  13631. (*TPROLOG_STATE)(unsafe.Pointer(state)).Frole_none = int32(_XML_ROLE_ELEMENT_NONE)
  13632. }
  13633. return int32(_XML_ROLE_GROUP_CLOSE_REP)
  13634. case int32(m_XML_TOK_CLOSE_PAREN_QUESTION):
  13635. *(*uint32)(unsafe.Pointer(state + 8)) -= uint32(1)
  13636. if (*TPROLOG_STATE)(unsafe.Pointer(state)).Flevel == uint32(0) {
  13637. (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_declClose)
  13638. (*TPROLOG_STATE)(unsafe.Pointer(state)).Frole_none = int32(_XML_ROLE_ELEMENT_NONE)
  13639. }
  13640. return int32(_XML_ROLE_GROUP_CLOSE_OPT)
  13641. case int32(m_XML_TOK_CLOSE_PAREN_PLUS):
  13642. *(*uint32)(unsafe.Pointer(state + 8)) -= uint32(1)
  13643. if (*TPROLOG_STATE)(unsafe.Pointer(state)).Flevel == uint32(0) {
  13644. (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_declClose)
  13645. (*TPROLOG_STATE)(unsafe.Pointer(state)).Frole_none = int32(_XML_ROLE_ELEMENT_NONE)
  13646. }
  13647. return int32(_XML_ROLE_GROUP_CLOSE_PLUS)
  13648. case int32(m_XML_TOK_COMMA):
  13649. (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_element6)
  13650. return int32(_XML_ROLE_GROUP_SEQUENCE)
  13651. case int32(m_XML_TOK_OR):
  13652. (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_element6)
  13653. return int32(_XML_ROLE_GROUP_CHOICE)
  13654. }
  13655. return _common(tls, state, tok)
  13656. }
  13657. func _condSect0(tls *libc.TLS, state uintptr, tok int32, ptr uintptr, end uintptr, enc uintptr) (r int32) {
  13658. switch tok {
  13659. case int32(m_XML_TOK_PROLOG_S):
  13660. return int32(_XML_ROLE_NONE)
  13661. case int32(m_XML_TOK_NAME):
  13662. if (*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*TENCODING)(unsafe.Pointer(enc)).FnameMatchesAscii})))(tls, enc, ptr, end, uintptr(unsafe.Pointer(&_KW_INCLUDE))) != 0 {
  13663. (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_condSect1)
  13664. return int32(_XML_ROLE_NONE)
  13665. }
  13666. if (*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*TENCODING)(unsafe.Pointer(enc)).FnameMatchesAscii})))(tls, enc, ptr, end, uintptr(unsafe.Pointer(&_KW_IGNORE))) != 0 {
  13667. (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_condSect2)
  13668. return int32(_XML_ROLE_NONE)
  13669. }
  13670. break
  13671. }
  13672. return _common(tls, state, tok)
  13673. }
  13674. func _condSect1(tls *libc.TLS, state uintptr, tok int32, ptr uintptr, end uintptr, enc uintptr) (r int32) {
  13675. _ = ptr
  13676. _ = end
  13677. _ = enc
  13678. switch tok {
  13679. case int32(m_XML_TOK_PROLOG_S):
  13680. return int32(_XML_ROLE_NONE)
  13681. case int32(m_XML_TOK_OPEN_BRACKET):
  13682. (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_externalSubset1)
  13683. *(*uint32)(unsafe.Pointer(state + 16)) += uint32(1)
  13684. return int32(_XML_ROLE_NONE)
  13685. }
  13686. return _common(tls, state, tok)
  13687. }
  13688. func _condSect2(tls *libc.TLS, state uintptr, tok int32, ptr uintptr, end uintptr, enc uintptr) (r int32) {
  13689. _ = ptr
  13690. _ = end
  13691. _ = enc
  13692. switch tok {
  13693. case int32(m_XML_TOK_PROLOG_S):
  13694. return int32(_XML_ROLE_NONE)
  13695. case int32(m_XML_TOK_OPEN_BRACKET):
  13696. (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_externalSubset1)
  13697. return int32(_XML_ROLE_IGNORE_SECT)
  13698. }
  13699. return _common(tls, state, tok)
  13700. }
  13701. func _declClose(tls *libc.TLS, state uintptr, tok int32, ptr uintptr, end uintptr, enc uintptr) (r int32) {
  13702. var v1 uintptr
  13703. _ = v1
  13704. _ = ptr
  13705. _ = end
  13706. _ = enc
  13707. switch tok {
  13708. case int32(m_XML_TOK_PROLOG_S):
  13709. return (*TPROLOG_STATE)(unsafe.Pointer(state)).Frole_none
  13710. case int32(m_XML_TOK_DECL_CLOSE):
  13711. if (*TPROLOG_STATE)(unsafe.Pointer(state)).FdocumentEntity != 0 {
  13712. v1 = __ccgo_fp(_internalSubset)
  13713. } else {
  13714. v1 = __ccgo_fp(_externalSubset1)
  13715. }
  13716. (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = v1
  13717. return (*TPROLOG_STATE)(unsafe.Pointer(state)).Frole_none
  13718. }
  13719. return _common(tls, state, tok)
  13720. }
  13721. // C documentation
  13722. //
  13723. // /* This function will only be invoked if the internal logic of the
  13724. // * parser has broken down. It is used in two cases:
  13725. // *
  13726. // * 1: When the XML prolog has been finished. At this point the
  13727. // * processor (the parser level above these role handlers) should
  13728. // * switch from prologProcessor to contentProcessor and reinitialise
  13729. // * the handler function.
  13730. // *
  13731. // * 2: When an error has been detected (via common() below). At this
  13732. // * point again the processor should be switched to errorProcessor,
  13733. // * which will never call a handler.
  13734. // *
  13735. // * The result of this is that error() can only be called if the
  13736. // * processor switch failed to happen, which is an internal error and
  13737. // * therefore we shouldn't be able to provoke it simply by using the
  13738. // * library. It is a necessary backstop, however, so we merely exclude
  13739. // * it from the coverage statistics.
  13740. // *
  13741. // * LCOV_EXCL_START
  13742. // */
  13743. func _error(tls *libc.TLS, state uintptr, tok int32, ptr uintptr, end uintptr, enc uintptr) (r int32) {
  13744. _ = state
  13745. _ = tok
  13746. _ = ptr
  13747. _ = end
  13748. _ = enc
  13749. return int32(_XML_ROLE_NONE)
  13750. }
  13751. /* LCOV_EXCL_STOP */
  13752. func _common(tls *libc.TLS, state uintptr, tok int32) (r int32) {
  13753. if !((*TPROLOG_STATE)(unsafe.Pointer(state)).FdocumentEntity != 0) && tok == int32(m_XML_TOK_PARAM_ENTITY_REF) {
  13754. return int32(_XML_ROLE_INNER_PARAM_ENTITY_REF)
  13755. }
  13756. (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_error)
  13757. return int32(_XML_ROLE_ERROR)
  13758. }
  13759. func XXmlPrologStateInit(tls *libc.TLS, state uintptr) {
  13760. (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_prolog0)
  13761. (*TPROLOG_STATE)(unsafe.Pointer(state)).FdocumentEntity = int32(1)
  13762. (*TPROLOG_STATE)(unsafe.Pointer(state)).FincludeLevel = uint32(0)
  13763. (*TPROLOG_STATE)(unsafe.Pointer(state)).FinEntityValue = 0
  13764. }
  13765. func XXmlPrologStateInitExternalEntity(tls *libc.TLS, state uintptr) {
  13766. (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_externalSubset0)
  13767. (*TPROLOG_STATE)(unsafe.Pointer(state)).FdocumentEntity = 0
  13768. (*TPROLOG_STATE)(unsafe.Pointer(state)).FincludeLevel = uint32(0)
  13769. }
  13770. const m_ASCII_02 = 48
  13771. const m_ASCII_12 = 49
  13772. const m_ASCII_22 = 50
  13773. const m_ASCII_32 = 51
  13774. const m_ASCII_41 = 52
  13775. const m_ASCII_51 = 53
  13776. const m_ASCII_61 = 54
  13777. const m_ASCII_71 = 55
  13778. const m_ASCII_82 = 56
  13779. const m_ASCII_92 = 57
  13780. const m_ASCII_AMP1 = 38
  13781. const m_ASCII_APOS1 = 39
  13782. const m_ASCII_COLON2 = 58
  13783. const m_ASCII_EQUALS2 = 61
  13784. const m_ASCII_EXCL2 = 33
  13785. const m_ASCII_G2 = 0x47
  13786. const m_ASCII_GT1 = 62
  13787. const m_ASCII_K1 = 0x4B
  13788. const m_ASCII_LSQB1 = 91
  13789. const m_ASCII_LT1 = 60
  13790. const m_ASCII_MINUS1 = 45
  13791. const m_ASCII_N1 = 0x4E
  13792. const m_ASCII_P2 = 0x50
  13793. const m_ASCII_PERIOD2 = 46
  13794. const m_ASCII_Q2 = 0x51
  13795. const m_ASCII_QUOT1 = 34
  13796. const m_ASCII_R1 = 0x52
  13797. const m_ASCII_RSQB1 = 93
  13798. const m_ASCII_SEMI1 = 59
  13799. const m_ASCII_SPACE1 = 32
  13800. const m_ASCII_TAB1 = 9
  13801. const m_ASCII_UNDERSCORE1 = 95
  13802. const m_ASCII_Y1 = 0x59
  13803. const m_ASCII_Z1 = 90
  13804. const m_ASCII_a2 = 97
  13805. const m_ASCII_b1 = 98
  13806. const m_ASCII_c2 = 99
  13807. const m_ASCII_d1 = 100
  13808. const m_ASCII_e2 = 101
  13809. const m_ASCII_f1 = 102
  13810. const m_ASCII_g2 = 103
  13811. const m_ASCII_i1 = 105
  13812. const m_ASCII_l2 = 108
  13813. const m_ASCII_m2 = 109
  13814. const m_ASCII_n2 = 110
  13815. const m_ASCII_o2 = 111
  13816. const m_ASCII_p2 = 112
  13817. const m_ASCII_q1 = 113
  13818. const m_ASCII_r2 = 114
  13819. const m_ASCII_s2 = 115
  13820. const m_ASCII_t2 = 116
  13821. const m_ASCII_u1 = 117
  13822. const m_ASCII_v1 = 118
  13823. const m_ASCII_x2 = 120
  13824. const m_ASCII_y1 = 121
  13825. const m_ASCII_z1 = 122
  13826. const m_ENCODING_MAX = 128
  13827. const m___bool_true_false_are_defined = 1
  13828. const m_bool = "_Bool"
  13829. const m_false = 0
  13830. const m_true = 1
  13831. const m_utf8_isName4 = "isNever"
  13832. const m_utf8_isNmstrt4 = "isNever"
  13833. var _namingBitmap = [320]uint32{
  13834. 8: uint32(0xFFFFFFFF),
  13835. 9: uint32(0xFFFFFFFF),
  13836. 10: uint32(0xFFFFFFFF),
  13837. 11: uint32(0xFFFFFFFF),
  13838. 12: uint32(0xFFFFFFFF),
  13839. 13: uint32(0xFFFFFFFF),
  13840. 14: uint32(0xFFFFFFFF),
  13841. 15: uint32(0xFFFFFFFF),
  13842. 17: uint32(0x04000000),
  13843. 18: uint32(0x87FFFFFE),
  13844. 19: uint32(0x07FFFFFE),
  13845. 22: uint32(0xFF7FFFFF),
  13846. 23: uint32(0xFF7FFFFF),
  13847. 24: uint32(0xFFFFFFFF),
  13848. 25: uint32(0x7FF3FFFF),
  13849. 26: uint32(0xFFFFFDFE),
  13850. 27: uint32(0x7FFFFFFF),
  13851. 28: uint32(0xFFFFFFFF),
  13852. 29: uint32(0xFFFFFFFF),
  13853. 30: uint32(0xFFFFE00F),
  13854. 31: uint32(0xFC31FFFF),
  13855. 32: uint32(0x00FFFFFF),
  13856. 34: uint32(0xFFFF0000),
  13857. 35: uint32(0xFFFFFFFF),
  13858. 36: uint32(0xFFFFFFFF),
  13859. 37: uint32(0xF80001FF),
  13860. 38: uint32(0x00000003),
  13861. 44: uint32(0xFFFFD740),
  13862. 45: uint32(0xFFFFFFFB),
  13863. 46: uint32(0x547F7FFF),
  13864. 47: uint32(0x000FFFFD),
  13865. 48: uint32(0xFFFFDFFE),
  13866. 49: uint32(0xFFFFFFFF),
  13867. 50: uint32(0xDFFEFFFF),
  13868. 51: uint32(0xFFFFFFFF),
  13869. 52: uint32(0xFFFF0003),
  13870. 53: uint32(0xFFFFFFFF),
  13871. 54: uint32(0xFFFF199F),
  13872. 55: uint32(0x033FCFFF),
  13873. 57: uint32(0xFFFE0000),
  13874. 58: uint32(0x027FFFFF),
  13875. 59: uint32(0xFFFFFFFE),
  13876. 60: uint32(0x0000007F),
  13877. 62: uint32(0xFFFF0000),
  13878. 63: uint32(0x000707FF),
  13879. 65: uint32(0x07FFFFFE),
  13880. 66: uint32(0x000007FE),
  13881. 67: uint32(0xFFFE0000),
  13882. 68: uint32(0xFFFFFFFF),
  13883. 69: uint32(0x7CFFFFFF),
  13884. 70: uint32(0x002F7FFF),
  13885. 71: uint32(0x00000060),
  13886. 72: uint32(0xFFFFFFE0),
  13887. 73: uint32(0x23FFFFFF),
  13888. 74: uint32(0xFF000000),
  13889. 75: uint32(0x00000003),
  13890. 76: uint32(0xFFF99FE0),
  13891. 77: uint32(0x03C5FDFF),
  13892. 78: uint32(0xB0000000),
  13893. 79: uint32(0x00030003),
  13894. 80: uint32(0xFFF987E0),
  13895. 81: uint32(0x036DFDFF),
  13896. 82: uint32(0x5E000000),
  13897. 83: uint32(0x001C0000),
  13898. 84: uint32(0xFFFBAFE0),
  13899. 85: uint32(0x23EDFDFF),
  13900. 87: uint32(0x00000001),
  13901. 88: uint32(0xFFF99FE0),
  13902. 89: uint32(0x23CDFDFF),
  13903. 90: uint32(0xB0000000),
  13904. 91: uint32(0x00000003),
  13905. 92: uint32(0xD63DC7E0),
  13906. 93: uint32(0x03BFC718),
  13907. 96: uint32(0xFFFDDFE0),
  13908. 97: uint32(0x03EFFDFF),
  13909. 99: uint32(0x00000003),
  13910. 100: uint32(0xFFFDDFE0),
  13911. 101: uint32(0x03EFFDFF),
  13912. 102: uint32(0x40000000),
  13913. 103: uint32(0x00000003),
  13914. 104: uint32(0xFFFDDFE0),
  13915. 105: uint32(0x03FFFDFF),
  13916. 107: uint32(0x00000003),
  13917. 112: uint32(0xFFFFFFFE),
  13918. 113: uint32(0x000D7FFF),
  13919. 114: uint32(0x0000003F),
  13920. 116: uint32(0xFEF02596),
  13921. 117: uint32(0x200D6CAE),
  13922. 118: uint32(0x0000001F),
  13923. 122: uint32(0xFFFFFEFF),
  13924. 123: uint32(0x000003FF),
  13925. 133: uint32(0xFFFFFFFF),
  13926. 134: uint32(0xFFFF003F),
  13927. 135: uint32(0x007FFFFF),
  13928. 136: uint32(0x0007DAED),
  13929. 137: uint32(0x50000000),
  13930. 138: uint32(0x82315001),
  13931. 139: uint32(0x002C62AB),
  13932. 140: uint32(0x40000000),
  13933. 141: uint32(0xF580C900),
  13934. 142: uint32(0x00000007),
  13935. 143: uint32(0x02010800),
  13936. 144: uint32(0xFFFFFFFF),
  13937. 145: uint32(0xFFFFFFFF),
  13938. 146: uint32(0xFFFFFFFF),
  13939. 147: uint32(0xFFFFFFFF),
  13940. 148: uint32(0x0FFFFFFF),
  13941. 149: uint32(0xFFFFFFFF),
  13942. 150: uint32(0xFFFFFFFF),
  13943. 151: uint32(0x03FFFFFF),
  13944. 152: uint32(0x3F3FFFFF),
  13945. 153: uint32(0xFFFFFFFF),
  13946. 154: uint32(0xAAFF3F3F),
  13947. 155: uint32(0x3FFFFFFF),
  13948. 156: uint32(0xFFFFFFFF),
  13949. 157: uint32(0x5FDFFFFF),
  13950. 158: uint32(0x0FCF1FDC),
  13951. 159: uint32(0x1FDC1FFF),
  13952. 161: uint32(0x00004C40),
  13953. 164: uint32(0x00000007),
  13954. 168: uint32(0x00000080),
  13955. 169: uint32(0x000003FE),
  13956. 170: uint32(0xFFFFFFFE),
  13957. 171: uint32(0xFFFFFFFF),
  13958. 172: uint32(0x001FFFFF),
  13959. 173: uint32(0xFFFFFFFE),
  13960. 174: uint32(0xFFFFFFFF),
  13961. 175: uint32(0x07FFFFFF),
  13962. 176: uint32(0xFFFFFFE0),
  13963. 177: uint32(0x00001FFF),
  13964. 184: uint32(0xFFFFFFFF),
  13965. 185: uint32(0xFFFFFFFF),
  13966. 186: uint32(0xFFFFFFFF),
  13967. 187: uint32(0xFFFFFFFF),
  13968. 188: uint32(0xFFFFFFFF),
  13969. 189: uint32(0x0000003F),
  13970. 192: uint32(0xFFFFFFFF),
  13971. 193: uint32(0xFFFFFFFF),
  13972. 194: uint32(0xFFFFFFFF),
  13973. 195: uint32(0xFFFFFFFF),
  13974. 196: uint32(0xFFFFFFFF),
  13975. 197: uint32(0x0000000F),
  13976. 201: uint32(0x07FF6000),
  13977. 202: uint32(0x87FFFFFE),
  13978. 203: uint32(0x07FFFFFE),
  13979. 205: uint32(0x00800000),
  13980. 206: uint32(0xFF7FFFFF),
  13981. 207: uint32(0xFF7FFFFF),
  13982. 208: uint32(0x00FFFFFF),
  13983. 210: uint32(0xFFFF0000),
  13984. 211: uint32(0xFFFFFFFF),
  13985. 212: uint32(0xFFFFFFFF),
  13986. 213: uint32(0xF80001FF),
  13987. 214: uint32(0x00030003),
  13988. 216: uint32(0xFFFFFFFF),
  13989. 217: uint32(0xFFFFFFFF),
  13990. 218: uint32(0x0000003F),
  13991. 219: uint32(0x00000003),
  13992. 220: uint32(0xFFFFD7C0),
  13993. 221: uint32(0xFFFFFFFB),
  13994. 222: uint32(0x547F7FFF),
  13995. 223: uint32(0x000FFFFD),
  13996. 224: uint32(0xFFFFDFFE),
  13997. 225: uint32(0xFFFFFFFF),
  13998. 226: uint32(0xDFFEFFFF),
  13999. 227: uint32(0xFFFFFFFF),
  14000. 228: uint32(0xFFFF007B),
  14001. 229: uint32(0xFFFFFFFF),
  14002. 230: uint32(0xFFFF199F),
  14003. 231: uint32(0x033FCFFF),
  14004. 233: uint32(0xFFFE0000),
  14005. 234: uint32(0x027FFFFF),
  14006. 235: uint32(0xFFFFFFFE),
  14007. 236: uint32(0xFFFE007F),
  14008. 237: uint32(0xBBFFFFFB),
  14009. 238: uint32(0xFFFF0016),
  14010. 239: uint32(0x000707FF),
  14011. 241: uint32(0x07FFFFFE),
  14012. 242: uint32(0x0007FFFF),
  14013. 243: uint32(0xFFFF03FF),
  14014. 244: uint32(0xFFFFFFFF),
  14015. 245: uint32(0x7CFFFFFF),
  14016. 246: uint32(0xFFEF7FFF),
  14017. 247: uint32(0x03FF3DFF),
  14018. 248: uint32(0xFFFFFFEE),
  14019. 249: uint32(0xF3FFFFFF),
  14020. 250: uint32(0xFF1E3FFF),
  14021. 251: uint32(0x0000FFCF),
  14022. 252: uint32(0xFFF99FEE),
  14023. 253: uint32(0xD3C5FDFF),
  14024. 254: uint32(0xB080399F),
  14025. 255: uint32(0x0003FFCF),
  14026. 256: uint32(0xFFF987E4),
  14027. 257: uint32(0xD36DFDFF),
  14028. 258: uint32(0x5E003987),
  14029. 259: uint32(0x001FFFC0),
  14030. 260: uint32(0xFFFBAFEE),
  14031. 261: uint32(0xF3EDFDFF),
  14032. 262: uint32(0x00003BBF),
  14033. 263: uint32(0x0000FFC1),
  14034. 264: uint32(0xFFF99FEE),
  14035. 265: uint32(0xF3CDFDFF),
  14036. 266: uint32(0xB0C0398F),
  14037. 267: uint32(0x0000FFC3),
  14038. 268: uint32(0xD63DC7EC),
  14039. 269: uint32(0xC3BFC718),
  14040. 270: uint32(0x00803DC7),
  14041. 271: uint32(0x0000FF80),
  14042. 272: uint32(0xFFFDDFEE),
  14043. 273: uint32(0xC3EFFDFF),
  14044. 274: uint32(0x00603DDF),
  14045. 275: uint32(0x0000FFC3),
  14046. 276: uint32(0xFFFDDFEC),
  14047. 277: uint32(0xC3EFFDFF),
  14048. 278: uint32(0x40603DDF),
  14049. 279: uint32(0x0000FFC3),
  14050. 280: uint32(0xFFFDDFEC),
  14051. 281: uint32(0xC3FFFDFF),
  14052. 282: uint32(0x00803DCF),
  14053. 283: uint32(0x0000FFC3),
  14054. 288: uint32(0xFFFFFFFE),
  14055. 289: uint32(0x07FF7FFF),
  14056. 290: uint32(0x03FF7FFF),
  14057. 292: uint32(0xFEF02596),
  14058. 293: uint32(0x3BFF6CAE),
  14059. 294: uint32(0x03FF3F5F),
  14060. 296: uint32(0x03000000),
  14061. 297: uint32(0xC2A003FF),
  14062. 298: uint32(0xFFFFFEFF),
  14063. 299: uint32(0xFFFE03FF),
  14064. 300: uint32(0xFEBF0FDF),
  14065. 301: uint32(0x02FE3FFF),
  14066. 310: uint32(0x1FFF0000),
  14067. 311: uint32(0x00000002),
  14068. 312: uint32(0x000000A0),
  14069. 313: uint32(0x003EFFFE),
  14070. 314: uint32(0xFFFFFFFE),
  14071. 315: uint32(0xFFFFFFFF),
  14072. 316: uint32(0x661FFFFF),
  14073. 317: uint32(0xFFFFFFFE),
  14074. 318: uint32(0xFFFFFFFF),
  14075. 319: uint32(0x77FFFFFF),
  14076. }
  14077. var _nmstrtPages = [256]uint8{
  14078. 0: uint8(0x02),
  14079. 1: uint8(0x03),
  14080. 2: uint8(0x04),
  14081. 3: uint8(0x05),
  14082. 4: uint8(0x06),
  14083. 5: uint8(0x07),
  14084. 6: uint8(0x08),
  14085. 9: uint8(0x09),
  14086. 10: uint8(0x0A),
  14087. 11: uint8(0x0B),
  14088. 12: uint8(0x0C),
  14089. 13: uint8(0x0D),
  14090. 14: uint8(0x0E),
  14091. 15: uint8(0x0F),
  14092. 16: uint8(0x10),
  14093. 17: uint8(0x11),
  14094. 30: uint8(0x12),
  14095. 31: uint8(0x13),
  14096. 33: uint8(0x14),
  14097. 48: uint8(0x15),
  14098. 49: uint8(0x16),
  14099. 78: uint8(0x01),
  14100. 79: uint8(0x01),
  14101. 80: uint8(0x01),
  14102. 81: uint8(0x01),
  14103. 82: uint8(0x01),
  14104. 83: uint8(0x01),
  14105. 84: uint8(0x01),
  14106. 85: uint8(0x01),
  14107. 86: uint8(0x01),
  14108. 87: uint8(0x01),
  14109. 88: uint8(0x01),
  14110. 89: uint8(0x01),
  14111. 90: uint8(0x01),
  14112. 91: uint8(0x01),
  14113. 92: uint8(0x01),
  14114. 93: uint8(0x01),
  14115. 94: uint8(0x01),
  14116. 95: uint8(0x01),
  14117. 96: uint8(0x01),
  14118. 97: uint8(0x01),
  14119. 98: uint8(0x01),
  14120. 99: uint8(0x01),
  14121. 100: uint8(0x01),
  14122. 101: uint8(0x01),
  14123. 102: uint8(0x01),
  14124. 103: uint8(0x01),
  14125. 104: uint8(0x01),
  14126. 105: uint8(0x01),
  14127. 106: uint8(0x01),
  14128. 107: uint8(0x01),
  14129. 108: uint8(0x01),
  14130. 109: uint8(0x01),
  14131. 110: uint8(0x01),
  14132. 111: uint8(0x01),
  14133. 112: uint8(0x01),
  14134. 113: uint8(0x01),
  14135. 114: uint8(0x01),
  14136. 115: uint8(0x01),
  14137. 116: uint8(0x01),
  14138. 117: uint8(0x01),
  14139. 118: uint8(0x01),
  14140. 119: uint8(0x01),
  14141. 120: uint8(0x01),
  14142. 121: uint8(0x01),
  14143. 122: uint8(0x01),
  14144. 123: uint8(0x01),
  14145. 124: uint8(0x01),
  14146. 125: uint8(0x01),
  14147. 126: uint8(0x01),
  14148. 127: uint8(0x01),
  14149. 128: uint8(0x01),
  14150. 129: uint8(0x01),
  14151. 130: uint8(0x01),
  14152. 131: uint8(0x01),
  14153. 132: uint8(0x01),
  14154. 133: uint8(0x01),
  14155. 134: uint8(0x01),
  14156. 135: uint8(0x01),
  14157. 136: uint8(0x01),
  14158. 137: uint8(0x01),
  14159. 138: uint8(0x01),
  14160. 139: uint8(0x01),
  14161. 140: uint8(0x01),
  14162. 141: uint8(0x01),
  14163. 142: uint8(0x01),
  14164. 143: uint8(0x01),
  14165. 144: uint8(0x01),
  14166. 145: uint8(0x01),
  14167. 146: uint8(0x01),
  14168. 147: uint8(0x01),
  14169. 148: uint8(0x01),
  14170. 149: uint8(0x01),
  14171. 150: uint8(0x01),
  14172. 151: uint8(0x01),
  14173. 152: uint8(0x01),
  14174. 153: uint8(0x01),
  14175. 154: uint8(0x01),
  14176. 155: uint8(0x01),
  14177. 156: uint8(0x01),
  14178. 157: uint8(0x01),
  14179. 158: uint8(0x01),
  14180. 159: uint8(0x17),
  14181. 172: uint8(0x01),
  14182. 173: uint8(0x01),
  14183. 174: uint8(0x01),
  14184. 175: uint8(0x01),
  14185. 176: uint8(0x01),
  14186. 177: uint8(0x01),
  14187. 178: uint8(0x01),
  14188. 179: uint8(0x01),
  14189. 180: uint8(0x01),
  14190. 181: uint8(0x01),
  14191. 182: uint8(0x01),
  14192. 183: uint8(0x01),
  14193. 184: uint8(0x01),
  14194. 185: uint8(0x01),
  14195. 186: uint8(0x01),
  14196. 187: uint8(0x01),
  14197. 188: uint8(0x01),
  14198. 189: uint8(0x01),
  14199. 190: uint8(0x01),
  14200. 191: uint8(0x01),
  14201. 192: uint8(0x01),
  14202. 193: uint8(0x01),
  14203. 194: uint8(0x01),
  14204. 195: uint8(0x01),
  14205. 196: uint8(0x01),
  14206. 197: uint8(0x01),
  14207. 198: uint8(0x01),
  14208. 199: uint8(0x01),
  14209. 200: uint8(0x01),
  14210. 201: uint8(0x01),
  14211. 202: uint8(0x01),
  14212. 203: uint8(0x01),
  14213. 204: uint8(0x01),
  14214. 205: uint8(0x01),
  14215. 206: uint8(0x01),
  14216. 207: uint8(0x01),
  14217. 208: uint8(0x01),
  14218. 209: uint8(0x01),
  14219. 210: uint8(0x01),
  14220. 211: uint8(0x01),
  14221. 212: uint8(0x01),
  14222. 213: uint8(0x01),
  14223. 214: uint8(0x01),
  14224. 215: uint8(0x18),
  14225. }
  14226. var _namePages = [256]uint8{
  14227. 0: uint8(0x19),
  14228. 1: uint8(0x03),
  14229. 2: uint8(0x1A),
  14230. 3: uint8(0x1B),
  14231. 4: uint8(0x1C),
  14232. 5: uint8(0x1D),
  14233. 6: uint8(0x1E),
  14234. 9: uint8(0x1F),
  14235. 10: uint8(0x20),
  14236. 11: uint8(0x21),
  14237. 12: uint8(0x22),
  14238. 13: uint8(0x23),
  14239. 14: uint8(0x24),
  14240. 15: uint8(0x25),
  14241. 16: uint8(0x10),
  14242. 17: uint8(0x11),
  14243. 30: uint8(0x12),
  14244. 31: uint8(0x13),
  14245. 32: uint8(0x26),
  14246. 33: uint8(0x14),
  14247. 48: uint8(0x27),
  14248. 49: uint8(0x16),
  14249. 78: uint8(0x01),
  14250. 79: uint8(0x01),
  14251. 80: uint8(0x01),
  14252. 81: uint8(0x01),
  14253. 82: uint8(0x01),
  14254. 83: uint8(0x01),
  14255. 84: uint8(0x01),
  14256. 85: uint8(0x01),
  14257. 86: uint8(0x01),
  14258. 87: uint8(0x01),
  14259. 88: uint8(0x01),
  14260. 89: uint8(0x01),
  14261. 90: uint8(0x01),
  14262. 91: uint8(0x01),
  14263. 92: uint8(0x01),
  14264. 93: uint8(0x01),
  14265. 94: uint8(0x01),
  14266. 95: uint8(0x01),
  14267. 96: uint8(0x01),
  14268. 97: uint8(0x01),
  14269. 98: uint8(0x01),
  14270. 99: uint8(0x01),
  14271. 100: uint8(0x01),
  14272. 101: uint8(0x01),
  14273. 102: uint8(0x01),
  14274. 103: uint8(0x01),
  14275. 104: uint8(0x01),
  14276. 105: uint8(0x01),
  14277. 106: uint8(0x01),
  14278. 107: uint8(0x01),
  14279. 108: uint8(0x01),
  14280. 109: uint8(0x01),
  14281. 110: uint8(0x01),
  14282. 111: uint8(0x01),
  14283. 112: uint8(0x01),
  14284. 113: uint8(0x01),
  14285. 114: uint8(0x01),
  14286. 115: uint8(0x01),
  14287. 116: uint8(0x01),
  14288. 117: uint8(0x01),
  14289. 118: uint8(0x01),
  14290. 119: uint8(0x01),
  14291. 120: uint8(0x01),
  14292. 121: uint8(0x01),
  14293. 122: uint8(0x01),
  14294. 123: uint8(0x01),
  14295. 124: uint8(0x01),
  14296. 125: uint8(0x01),
  14297. 126: uint8(0x01),
  14298. 127: uint8(0x01),
  14299. 128: uint8(0x01),
  14300. 129: uint8(0x01),
  14301. 130: uint8(0x01),
  14302. 131: uint8(0x01),
  14303. 132: uint8(0x01),
  14304. 133: uint8(0x01),
  14305. 134: uint8(0x01),
  14306. 135: uint8(0x01),
  14307. 136: uint8(0x01),
  14308. 137: uint8(0x01),
  14309. 138: uint8(0x01),
  14310. 139: uint8(0x01),
  14311. 140: uint8(0x01),
  14312. 141: uint8(0x01),
  14313. 142: uint8(0x01),
  14314. 143: uint8(0x01),
  14315. 144: uint8(0x01),
  14316. 145: uint8(0x01),
  14317. 146: uint8(0x01),
  14318. 147: uint8(0x01),
  14319. 148: uint8(0x01),
  14320. 149: uint8(0x01),
  14321. 150: uint8(0x01),
  14322. 151: uint8(0x01),
  14323. 152: uint8(0x01),
  14324. 153: uint8(0x01),
  14325. 154: uint8(0x01),
  14326. 155: uint8(0x01),
  14327. 156: uint8(0x01),
  14328. 157: uint8(0x01),
  14329. 158: uint8(0x01),
  14330. 159: uint8(0x17),
  14331. 172: uint8(0x01),
  14332. 173: uint8(0x01),
  14333. 174: uint8(0x01),
  14334. 175: uint8(0x01),
  14335. 176: uint8(0x01),
  14336. 177: uint8(0x01),
  14337. 178: uint8(0x01),
  14338. 179: uint8(0x01),
  14339. 180: uint8(0x01),
  14340. 181: uint8(0x01),
  14341. 182: uint8(0x01),
  14342. 183: uint8(0x01),
  14343. 184: uint8(0x01),
  14344. 185: uint8(0x01),
  14345. 186: uint8(0x01),
  14346. 187: uint8(0x01),
  14347. 188: uint8(0x01),
  14348. 189: uint8(0x01),
  14349. 190: uint8(0x01),
  14350. 191: uint8(0x01),
  14351. 192: uint8(0x01),
  14352. 193: uint8(0x01),
  14353. 194: uint8(0x01),
  14354. 195: uint8(0x01),
  14355. 196: uint8(0x01),
  14356. 197: uint8(0x01),
  14357. 198: uint8(0x01),
  14358. 199: uint8(0x01),
  14359. 200: uint8(0x01),
  14360. 201: uint8(0x01),
  14361. 202: uint8(0x01),
  14362. 203: uint8(0x01),
  14363. 204: uint8(0x01),
  14364. 205: uint8(0x01),
  14365. 206: uint8(0x01),
  14366. 207: uint8(0x01),
  14367. 208: uint8(0x01),
  14368. 209: uint8(0x01),
  14369. 210: uint8(0x01),
  14370. 211: uint8(0x01),
  14371. 212: uint8(0x01),
  14372. 213: uint8(0x01),
  14373. 214: uint8(0x01),
  14374. 215: uint8(0x18),
  14375. }
  14376. /* A 2 byte UTF-8 representation splits the characters 11 bits between
  14377. the bottom 5 and 6 bits of the bytes. We need 8 bits to index into
  14378. pages, 3 bits to add to that index and 5 bits to generate the mask.
  14379. */
  14380. /* A 3 byte UTF-8 representation splits the characters 16 bits between
  14381. the bottom 4, 6 and 6 bits of the bytes. We need 8 bits to index
  14382. into pages, 3 bits to add to that index and 5 bits to generate the
  14383. mask.
  14384. */
  14385. /* Detection of invalid UTF-8 sequences is based on Table 3.1B
  14386. of Unicode 3.2: http://www.unicode.org/unicode/reports/tr28/
  14387. with the additional restriction of not allowing the Unicode
  14388. code points 0xFFFF and 0xFFFE (sequences EF,BF,BF and EF,BF,BE).
  14389. Implementation details:
  14390. (A & 0x80) == 0 means A < 0x80
  14391. and
  14392. (A & 0xC0) == 0xC0 means A > 0xBF
  14393. */
  14394. func _isNever(tls *libc.TLS, enc uintptr, p uintptr) (r int32) {
  14395. _ = enc
  14396. _ = p
  14397. return 0
  14398. }
  14399. func _utf8_isName2(tls *libc.TLS, enc uintptr, p uintptr) (r int32) {
  14400. _ = enc
  14401. return libc.Int32FromUint32(_namingBitmap[libc.Int32FromUint8(_namePages[libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(p)))>>int32(2)&int32(7)])<<int32(3)+libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(p)))&int32(3)<<int32(1)+libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(p + 1)))>>int32(5)&int32(1)] & (libc.Uint32FromUint32(1) << (libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(p + 1))) & libc.Int32FromInt32(0x1F))))
  14402. }
  14403. func _utf8_isName3(tls *libc.TLS, enc uintptr, p uintptr) (r int32) {
  14404. _ = enc
  14405. return libc.Int32FromUint32(_namingBitmap[libc.Int32FromUint8(_namePages[libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(p)))&int32(0xF)<<int32(4)+libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(p + 1)))>>int32(2)&int32(0xF)])<<int32(3)+libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(p + 1)))&int32(3)<<int32(1)+libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(p + 2)))>>int32(5)&int32(1)] & (libc.Uint32FromUint32(1) << (libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(p + 2))) & libc.Int32FromInt32(0x1F))))
  14406. }
  14407. func _utf8_isNmstrt2(tls *libc.TLS, enc uintptr, p uintptr) (r int32) {
  14408. _ = enc
  14409. return libc.Int32FromUint32(_namingBitmap[libc.Int32FromUint8(_nmstrtPages[libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(p)))>>int32(2)&int32(7)])<<int32(3)+libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(p)))&int32(3)<<int32(1)+libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(p + 1)))>>int32(5)&int32(1)] & (libc.Uint32FromUint32(1) << (libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(p + 1))) & libc.Int32FromInt32(0x1F))))
  14410. }
  14411. func _utf8_isNmstrt3(tls *libc.TLS, enc uintptr, p uintptr) (r int32) {
  14412. _ = enc
  14413. return libc.Int32FromUint32(_namingBitmap[libc.Int32FromUint8(_nmstrtPages[libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(p)))&int32(0xF)<<int32(4)+libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(p + 1)))>>int32(2)&int32(0xF)])<<int32(3)+libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(p + 1)))&int32(3)<<int32(1)+libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(p + 2)))>>int32(5)&int32(1)] & (libc.Uint32FromUint32(1) << (libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(p + 2))) & libc.Int32FromInt32(0x1F))))
  14414. }
  14415. func _utf8_isInvalid2(tls *libc.TLS, enc uintptr, p uintptr) (r int32) {
  14416. _ = enc
  14417. return libc.BoolInt32(libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(p))) < int32(0xC2) || libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(p + 1)))&int32(0x80) == 0 || libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(p + 1)))&int32(0xC0) == int32(0xC0))
  14418. }
  14419. func _utf8_isInvalid3(tls *libc.TLS, enc uintptr, p uintptr) (r int32) {
  14420. var v1, v3, v4 int32
  14421. var v2, v5, v6 bool
  14422. _, _, _, _, _, _ = v1, v2, v3, v4, v5, v6
  14423. _ = enc
  14424. if v2 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(p + 2)))&int32(0x80) == 0; !v2 {
  14425. if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(p))) == int32(0xEF) && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(p + 1))) == int32(0xBF) {
  14426. v1 = libc.BoolInt32(libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(p + 2))) > int32(0xBD))
  14427. } else {
  14428. v1 = libc.BoolInt32(libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(p + 2)))&int32(0xC0) == int32(0xC0))
  14429. }
  14430. }
  14431. if v6 = v2 || v1 != 0; !v6 {
  14432. if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(p))) == int32(0xE0) {
  14433. v3 = libc.BoolInt32(libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(p + 1))) < int32(0xA0) || libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(p + 1)))&int32(0xC0) == int32(0xC0))
  14434. } else {
  14435. if v5 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(p + 1)))&int32(0x80) == 0; !v5 {
  14436. if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(p))) == int32(0xED) {
  14437. v4 = libc.BoolInt32(libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(p + 1))) > int32(0x9F))
  14438. } else {
  14439. v4 = libc.BoolInt32(libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(p + 1)))&int32(0xC0) == int32(0xC0))
  14440. }
  14441. }
  14442. v3 = libc.BoolInt32(v5 || v4 != 0)
  14443. }
  14444. }
  14445. return libc.BoolInt32(v6 || v3 != 0)
  14446. }
  14447. func _utf8_isInvalid4(tls *libc.TLS, enc uintptr, p uintptr) (r int32) {
  14448. var v1, v2 int32
  14449. var v3, v4 bool
  14450. _, _, _, _ = v1, v2, v3, v4
  14451. _ = enc
  14452. if v4 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(p + 3)))&int32(0x80) == 0 || libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(p + 3)))&int32(0xC0) == int32(0xC0) || libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(p + 2)))&int32(0x80) == 0 || libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(p + 2)))&int32(0xC0) == int32(0xC0); !v4 {
  14453. if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(p))) == int32(0xF0) {
  14454. v1 = libc.BoolInt32(libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(p + 1))) < int32(0x90) || libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(p + 1)))&int32(0xC0) == int32(0xC0))
  14455. } else {
  14456. if v3 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(p + 1)))&int32(0x80) == 0; !v3 {
  14457. if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(p))) == int32(0xF4) {
  14458. v2 = libc.BoolInt32(libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(p + 1))) > int32(0x8F))
  14459. } else {
  14460. v2 = libc.BoolInt32(libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(p + 1)))&int32(0xC0) == int32(0xC0))
  14461. }
  14462. }
  14463. v1 = libc.BoolInt32(v3 || v2 != 0)
  14464. }
  14465. }
  14466. return libc.BoolInt32(v4 || v1 != 0)
  14467. }
  14468. type Tnormal_encoding = struct {
  14469. Fenc TENCODING
  14470. Ftype1 [256]uint8
  14471. FisName2 uintptr
  14472. FisName3 uintptr
  14473. FisName4 uintptr
  14474. FisNmstrt2 uintptr
  14475. FisNmstrt3 uintptr
  14476. FisNmstrt4 uintptr
  14477. FisInvalid2 uintptr
  14478. FisInvalid3 uintptr
  14479. FisInvalid4 uintptr
  14480. }
  14481. const _BT_NONXML = 0
  14482. const _BT_MALFORM = 1
  14483. const _BT_LT = 2
  14484. const _BT_AMP = 3
  14485. const _BT_RSQB = 4
  14486. const _BT_LEAD2 = 5
  14487. const _BT_LEAD3 = 6
  14488. const _BT_LEAD4 = 7
  14489. const _BT_TRAIL = 8
  14490. const _BT_CR = 9
  14491. const _BT_LF = 10
  14492. const _BT_GT = 11
  14493. const _BT_QUOT = 12
  14494. const _BT_APOS = 13
  14495. const _BT_EQUALS = 14
  14496. const _BT_QUEST = 15
  14497. const _BT_EXCL = 16
  14498. const _BT_SOL = 17
  14499. const _BT_SEMI = 18
  14500. const _BT_NUM = 19
  14501. const _BT_LSQB = 20
  14502. const _BT_S = 21
  14503. const _BT_NMSTRT = 22
  14504. const _BT_COLON = 23
  14505. const _BT_HEX = 24
  14506. const _BT_DIGIT = 25
  14507. const _BT_NAME = 26
  14508. const _BT_MINUS = 27
  14509. const _BT_OTHER = 28
  14510. const _BT_NONASCII = 29
  14511. const _BT_PERCNT = 30
  14512. const _BT_LPAR = 31
  14513. const _BT_RPAR = 32
  14514. const _BT_AST = 33
  14515. const _BT_PLUS = 34
  14516. const _BT_COMMA = 35
  14517. const _BT_VERBAR = 36
  14518. /*===---- stddef.h - Basic type definitions --------------------------------===
  14519. *
  14520. * Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
  14521. * See https://llvm.org/LICENSE.txt for license information.
  14522. * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  14523. *
  14524. *===-----------------------------------------------------------------------===
  14525. */
  14526. /*
  14527. * This header is designed to be included multiple times. If any of the __need_
  14528. * macros are defined, then only that subset of interfaces are provided. This
  14529. * can be useful for POSIX headers that need to not expose all of stddef.h, but
  14530. * need to use some of its interfaces. Otherwise this header provides all of
  14531. * the expected interfaces.
  14532. *
  14533. * When clang modules are enabled, this header is a textual header to support
  14534. * the multiple include behavior. As such, it doesn't directly declare anything
  14535. * so that it doesn't add duplicate declarations to all of its includers'
  14536. * modules.
  14537. */
  14538. /* ISO9899:2011 7.20 (C11 Annex K): Define rsize_t if __STDC_WANT_LIB_EXT1__ is
  14539. * enabled. */
  14540. /* wint_t is provided by <wchar.h> and not <stddef.h>. It's here
  14541. * for compatibility, but must be explicitly requested. Therefore
  14542. * __need_wint_t is intentionally not defined here. */
  14543. /*===---- __stddef_header_macro.h ------------------------------------------===
  14544. *
  14545. * Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
  14546. * See https://llvm.org/LICENSE.txt for license information.
  14547. * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  14548. *
  14549. *===-----------------------------------------------------------------------===
  14550. */
  14551. /*===---- __stddef_ptrdiff_t.h - Definition of ptrdiff_t -------------------===
  14552. *
  14553. * Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
  14554. * See https://llvm.org/LICENSE.txt for license information.
  14555. * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  14556. *
  14557. *===-----------------------------------------------------------------------===
  14558. */
  14559. /*
  14560. * When -fbuiltin-headers-in-system-modules is set this is a non-modular header
  14561. * and needs to behave as if it was textual.
  14562. */
  14563. /*===---- __stddef_size_t.h - Definition of size_t -------------------------===
  14564. *
  14565. * Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
  14566. * See https://llvm.org/LICENSE.txt for license information.
  14567. * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  14568. *
  14569. *===-----------------------------------------------------------------------===
  14570. */
  14571. /*
  14572. * When -fbuiltin-headers-in-system-modules is set this is a non-modular header
  14573. * and needs to behave as if it was textual.
  14574. */
  14575. /*===---- __stddef_rsize_t.h - Definition of rsize_t -----------------------===
  14576. *
  14577. * Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
  14578. * See https://llvm.org/LICENSE.txt for license information.
  14579. * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  14580. *
  14581. *===-----------------------------------------------------------------------===
  14582. */
  14583. /*
  14584. * When -fbuiltin-headers-in-system-modules is set this is a non-modular header
  14585. * and needs to behave as if it was textual.
  14586. */
  14587. /*===---- __stddef_wchar.h - Definition of wchar_t -------------------------===
  14588. *
  14589. * Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
  14590. * See https://llvm.org/LICENSE.txt for license information.
  14591. * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  14592. *
  14593. *===-----------------------------------------------------------------------===
  14594. */
  14595. /*
  14596. * When -fbuiltin-headers-in-system-modules is set this is a non-modular header
  14597. * and needs to behave as if it was textual.
  14598. */
  14599. /*===---- __stddef_max_align_t.h - Definition of max_align_t ---------------===
  14600. *
  14601. * Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
  14602. * See https://llvm.org/LICENSE.txt for license information.
  14603. * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  14604. *
  14605. *===-----------------------------------------------------------------------===
  14606. */
  14607. /*===---- __stddef_offsetof.h - Definition of offsetof ---------------------===
  14608. *
  14609. * Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
  14610. * See https://llvm.org/LICENSE.txt for license information.
  14611. * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  14612. *
  14613. *===-----------------------------------------------------------------------===
  14614. */
  14615. /*
  14616. * When -fbuiltin-headers-in-system-modules is set this is a non-modular header
  14617. * and needs to behave as if it was textual.
  14618. */
  14619. /* Some C libraries expect to see a wint_t here. Others (notably MinGW) will use
  14620. __WINT_TYPE__ directly; accommodate both by requiring __need_wint_t */
  14621. /*
  14622. __ __ _
  14623. ___\ \/ /_ __ __ _| |_
  14624. / _ \\ /| '_ \ / _` | __|
  14625. | __// \| |_) | (_| | |_
  14626. \___/_/\_\ .__/ \__,_|\__|
  14627. |_| XML parser
  14628. Copyright (c) 1999-2000 Thai Open Source Software Center Ltd
  14629. Copyright (c) 2000 Clark Cooper <coopercc@users.sourceforge.net>
  14630. Copyright (c) 2002 Fred L. Drake, Jr. <fdrake@users.sourceforge.net>
  14631. Copyright (c) 2007 Karl Waclawek <karl@waclawek.net>
  14632. Copyright (c) 2017 Sebastian Pipping <sebastian@pipping.org>
  14633. Licensed under the MIT license:
  14634. Permission is hereby granted, free of charge, to any person obtaining
  14635. a copy of this software and associated documentation files (the
  14636. "Software"), to deal in the Software without restriction, including
  14637. without limitation the rights to use, copy, modify, merge, publish,
  14638. distribute, sublicense, and/or sell copies of the Software, and to permit
  14639. persons to whom the Software is furnished to do so, subject to the
  14640. following conditions:
  14641. The above copyright notice and this permission notice shall be included
  14642. in all copies or substantial portions of the Software.
  14643. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  14644. EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  14645. MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
  14646. NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
  14647. DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  14648. OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
  14649. USE OR OTHER DEALINGS IN THE SOFTWARE.
  14650. */
  14651. /* minimum bytes per character */
  14652. /* c is an ASCII character */
  14653. /* This file is included (from xmltok.c, 1-3 times depending on XML_MIN_SIZE)!
  14654. __ __ _
  14655. ___\ \/ /_ __ __ _| |_
  14656. / _ \\ /| '_ \ / _` | __|
  14657. | __// \| |_) | (_| | |_
  14658. \___/_/\_\ .__/ \__,_|\__|
  14659. |_| XML parser
  14660. Copyright (c) 1997-2000 Thai Open Source Software Center Ltd
  14661. Copyright (c) 2000 Clark Cooper <coopercc@users.sourceforge.net>
  14662. Copyright (c) 2002 Fred L. Drake, Jr. <fdrake@users.sourceforge.net>
  14663. Copyright (c) 2002-2016 Karl Waclawek <karl@waclawek.net>
  14664. Copyright (c) 2016-2022 Sebastian Pipping <sebastian@pipping.org>
  14665. Copyright (c) 2017 Rhodri James <rhodri@wildebeest.org.uk>
  14666. Copyright (c) 2018 Benjamin Peterson <benjamin@python.org>
  14667. Copyright (c) 2018 Anton Maklakov <antmak.pub@gmail.com>
  14668. Copyright (c) 2019 David Loffredo <loffredo@steptools.com>
  14669. Copyright (c) 2020 Boris Kolpackov <boris@codesynthesis.com>
  14670. Copyright (c) 2022 Martin Ettl <ettl.martin78@googlemail.com>
  14671. Licensed under the MIT license:
  14672. Permission is hereby granted, free of charge, to any person obtaining
  14673. a copy of this software and associated documentation files (the
  14674. "Software"), to deal in the Software without restriction, including
  14675. without limitation the rights to use, copy, modify, merge, publish,
  14676. distribute, sublicense, and/or sell copies of the Software, and to permit
  14677. persons to whom the Software is furnished to do so, subject to the
  14678. following conditions:
  14679. The above copyright notice and this permission notice shall be included
  14680. in all copies or substantial portions of the Software.
  14681. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  14682. EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  14683. MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
  14684. NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
  14685. DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  14686. OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
  14687. USE OR OTHER DEALINGS IN THE SOFTWARE.
  14688. */
  14689. /* ptr points to character following "<!-" */
  14690. func _normal_scanComment(tls *libc.TLS, enc uintptr, ptr uintptr, end uintptr, nextTokPtr uintptr) (r int32) {
  14691. if int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(1)) {
  14692. if !(int32(*(*int8)(unsafe.Pointer(ptr))) == libc.Int32FromInt32(m_ASCII_MINUS1)) {
  14693. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  14694. return m_XML_TOK_INVALID
  14695. }
  14696. ptr += uintptr(1)
  14697. for int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(1)) {
  14698. switch libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr))))))) {
  14699. case int32(_BT_LEAD2):
  14700. if int64(end)-int64(ptr) < int64(2) {
  14701. return -int32(2)
  14702. }
  14703. if (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisInvalid2})))(tls, enc, ptr) != 0 {
  14704. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  14705. return m_XML_TOK_INVALID
  14706. }
  14707. ptr += uintptr(2)
  14708. case int32(_BT_LEAD3):
  14709. if int64(end)-int64(ptr) < int64(3) {
  14710. return -int32(2)
  14711. }
  14712. if (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisInvalid3})))(tls, enc, ptr) != 0 {
  14713. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  14714. return m_XML_TOK_INVALID
  14715. }
  14716. ptr += uintptr(3)
  14717. case int32(_BT_LEAD4):
  14718. if int64(end)-int64(ptr) < int64(4) {
  14719. return -int32(2)
  14720. }
  14721. if (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisInvalid4})))(tls, enc, ptr) != 0 {
  14722. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  14723. return m_XML_TOK_INVALID
  14724. }
  14725. ptr += uintptr(4)
  14726. case int32(_BT_NONXML):
  14727. fallthrough
  14728. case int32(_BT_MALFORM):
  14729. fallthrough
  14730. case int32(_BT_TRAIL):
  14731. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  14732. return m_XML_TOK_INVALID
  14733. case int32(_BT_MINUS):
  14734. ptr += uintptr(1)
  14735. if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(1))) {
  14736. return -int32(1)
  14737. }
  14738. if int32(*(*int8)(unsafe.Pointer(ptr))) == int32(m_ASCII_MINUS1) {
  14739. ptr += uintptr(1)
  14740. if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(1))) {
  14741. return -int32(1)
  14742. }
  14743. if !(int32(*(*int8)(unsafe.Pointer(ptr))) == libc.Int32FromInt32(m_ASCII_GT1)) {
  14744. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  14745. return m_XML_TOK_INVALID
  14746. }
  14747. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(1)
  14748. return int32(m_XML_TOK_COMMENT)
  14749. }
  14750. default:
  14751. ptr += uintptr(1)
  14752. break
  14753. }
  14754. }
  14755. }
  14756. return -int32(1)
  14757. }
  14758. /* ptr points to character following "<!" */
  14759. func _normal_scanDecl(tls *libc.TLS, enc uintptr, ptr uintptr, end uintptr, nextTokPtr uintptr) (r int32) {
  14760. if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(1))) {
  14761. return -int32(1)
  14762. }
  14763. switch libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr))))))) {
  14764. case int32(_BT_MINUS):
  14765. return _normal_scanComment(tls, enc, ptr+uintptr(1), end, nextTokPtr)
  14766. case int32(_BT_LSQB):
  14767. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(1)
  14768. return int32(m_XML_TOK_COND_SECT_OPEN)
  14769. case int32(_BT_NMSTRT):
  14770. fallthrough
  14771. case int32(_BT_HEX):
  14772. ptr += uintptr(1)
  14773. default:
  14774. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  14775. return m_XML_TOK_INVALID
  14776. }
  14777. for int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(1)) {
  14778. switch libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr))))))) {
  14779. case int32(_BT_PERCNT):
  14780. if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(2)*libc.Int32FromInt32(1))) {
  14781. return -int32(1)
  14782. }
  14783. /* don't allow <!ENTITY% foo "whatever"> */
  14784. switch libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr + libc.UintptrFromInt32(1)))))))) {
  14785. case int32(_BT_S):
  14786. fallthrough
  14787. case int32(_BT_CR):
  14788. fallthrough
  14789. case int32(_BT_LF):
  14790. fallthrough
  14791. case int32(_BT_PERCNT):
  14792. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  14793. return m_XML_TOK_INVALID
  14794. }
  14795. /* fall through */
  14796. fallthrough
  14797. case int32(_BT_S):
  14798. fallthrough
  14799. case int32(_BT_CR):
  14800. fallthrough
  14801. case int32(_BT_LF):
  14802. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  14803. return int32(m_XML_TOK_DECL_OPEN)
  14804. case int32(_BT_NMSTRT):
  14805. fallthrough
  14806. case int32(_BT_HEX):
  14807. ptr += uintptr(1)
  14808. default:
  14809. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  14810. return m_XML_TOK_INVALID
  14811. }
  14812. }
  14813. return -int32(1)
  14814. }
  14815. func _normal_checkPiTarget(tls *libc.TLS, enc uintptr, ptr uintptr, end uintptr, tokPtr uintptr) (r int32) {
  14816. var upper int32
  14817. _ = upper
  14818. upper = 0
  14819. _ = enc
  14820. *(*int32)(unsafe.Pointer(tokPtr)) = int32(m_XML_TOK_PI)
  14821. if int64(end)-int64(ptr) != int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(3)) {
  14822. return int32(1)
  14823. }
  14824. switch int32(*(*int8)(unsafe.Pointer(ptr))) {
  14825. case int32(m_ASCII_x2):
  14826. case int32(m_ASCII_X):
  14827. upper = int32(1)
  14828. default:
  14829. return int32(1)
  14830. }
  14831. ptr += uintptr(1)
  14832. switch int32(*(*int8)(unsafe.Pointer(ptr))) {
  14833. case int32(m_ASCII_m2):
  14834. case int32(m_ASCII_M):
  14835. upper = int32(1)
  14836. default:
  14837. return int32(1)
  14838. }
  14839. ptr += uintptr(1)
  14840. switch int32(*(*int8)(unsafe.Pointer(ptr))) {
  14841. case int32(m_ASCII_l2):
  14842. case int32(m_ASCII_L):
  14843. upper = int32(1)
  14844. default:
  14845. return int32(1)
  14846. }
  14847. if upper != 0 {
  14848. return 0
  14849. }
  14850. *(*int32)(unsafe.Pointer(tokPtr)) = int32(m_XML_TOK_XML_DECL)
  14851. return int32(1)
  14852. }
  14853. /* ptr points to character following "<?" */
  14854. func _normal_scanPi(tls *libc.TLS, enc uintptr, ptr uintptr, end uintptr, nextTokPtr uintptr) (r int32) {
  14855. bp := tls.Alloc(16)
  14856. defer tls.Free(16)
  14857. var target uintptr
  14858. var _ /* tok at bp+0 */ int32
  14859. _ = target
  14860. target = ptr
  14861. if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(1))) {
  14862. return -int32(1)
  14863. }
  14864. switch libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr))))))) {
  14865. case int32(_BT_NONASCII):
  14866. if !(libc.Int32FromInt32(0) != 0) {
  14867. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  14868. return m_XML_TOK_INVALID
  14869. } /* fall through */
  14870. fallthrough
  14871. case int32(_BT_NMSTRT):
  14872. fallthrough
  14873. case int32(_BT_HEX):
  14874. ptr += uintptr(1)
  14875. case int32(_BT_LEAD2):
  14876. if int64(end)-int64(ptr) < int64(libc.Int32FromInt32(2)) {
  14877. return -int32(2)
  14878. }
  14879. if (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisInvalid2})))(tls, enc, ptr) != 0 || !((*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisNmstrt2})))(tls, enc, ptr) != 0) {
  14880. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  14881. return m_XML_TOK_INVALID
  14882. }
  14883. ptr += uintptr(2)
  14884. case int32(_BT_LEAD3):
  14885. if int64(end)-int64(ptr) < int64(libc.Int32FromInt32(3)) {
  14886. return -int32(2)
  14887. }
  14888. if (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisInvalid3})))(tls, enc, ptr) != 0 || !((*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisNmstrt3})))(tls, enc, ptr) != 0) {
  14889. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  14890. return m_XML_TOK_INVALID
  14891. }
  14892. ptr += uintptr(3)
  14893. case int32(_BT_LEAD4):
  14894. if int64(end)-int64(ptr) < int64(libc.Int32FromInt32(4)) {
  14895. return -int32(2)
  14896. }
  14897. if (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisInvalid4})))(tls, enc, ptr) != 0 || !((*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisNmstrt4})))(tls, enc, ptr) != 0) {
  14898. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  14899. return m_XML_TOK_INVALID
  14900. }
  14901. ptr += uintptr(4)
  14902. default:
  14903. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  14904. return m_XML_TOK_INVALID
  14905. }
  14906. for int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(1)) {
  14907. switch libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr))))))) {
  14908. case int32(_BT_NONASCII):
  14909. if !(libc.Int32FromInt32(0) != 0) {
  14910. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  14911. return m_XML_TOK_INVALID
  14912. } /* fall through */
  14913. fallthrough
  14914. case int32(_BT_NMSTRT):
  14915. fallthrough
  14916. case int32(_BT_HEX):
  14917. fallthrough
  14918. case int32(_BT_DIGIT):
  14919. fallthrough
  14920. case int32(_BT_NAME):
  14921. fallthrough
  14922. case int32(_BT_MINUS):
  14923. ptr += uintptr(1)
  14924. case int32(_BT_LEAD2):
  14925. if int64(end)-int64(ptr) < int64(2) {
  14926. return -int32(2)
  14927. }
  14928. if (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisInvalid2})))(tls, enc, ptr) != 0 || !((*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisName2})))(tls, enc, ptr) != 0) {
  14929. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  14930. return m_XML_TOK_INVALID
  14931. }
  14932. ptr += uintptr(2)
  14933. case int32(_BT_LEAD3):
  14934. if int64(end)-int64(ptr) < int64(3) {
  14935. return -int32(2)
  14936. }
  14937. if (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisInvalid3})))(tls, enc, ptr) != 0 || !((*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisName3})))(tls, enc, ptr) != 0) {
  14938. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  14939. return m_XML_TOK_INVALID
  14940. }
  14941. ptr += uintptr(3)
  14942. case int32(_BT_LEAD4):
  14943. if int64(end)-int64(ptr) < int64(4) {
  14944. return -int32(2)
  14945. }
  14946. if (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisInvalid4})))(tls, enc, ptr) != 0 || !((*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisName4})))(tls, enc, ptr) != 0) {
  14947. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  14948. return m_XML_TOK_INVALID
  14949. }
  14950. ptr += uintptr(4)
  14951. case int32(_BT_S):
  14952. fallthrough
  14953. case int32(_BT_CR):
  14954. fallthrough
  14955. case int32(_BT_LF):
  14956. if !(_normal_checkPiTarget(tls, enc, target, ptr, bp) != 0) {
  14957. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  14958. return m_XML_TOK_INVALID
  14959. }
  14960. ptr += uintptr(1)
  14961. for int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(1)) {
  14962. switch libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr))))))) {
  14963. case int32(_BT_LEAD2):
  14964. if int64(end)-int64(ptr) < int64(2) {
  14965. return -int32(2)
  14966. }
  14967. if (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisInvalid2})))(tls, enc, ptr) != 0 {
  14968. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  14969. return m_XML_TOK_INVALID
  14970. }
  14971. ptr += uintptr(2)
  14972. case int32(_BT_LEAD3):
  14973. if int64(end)-int64(ptr) < int64(3) {
  14974. return -int32(2)
  14975. }
  14976. if (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisInvalid3})))(tls, enc, ptr) != 0 {
  14977. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  14978. return m_XML_TOK_INVALID
  14979. }
  14980. ptr += uintptr(3)
  14981. case int32(_BT_LEAD4):
  14982. if int64(end)-int64(ptr) < int64(4) {
  14983. return -int32(2)
  14984. }
  14985. if (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisInvalid4})))(tls, enc, ptr) != 0 {
  14986. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  14987. return m_XML_TOK_INVALID
  14988. }
  14989. ptr += uintptr(4)
  14990. case int32(_BT_NONXML):
  14991. fallthrough
  14992. case int32(_BT_MALFORM):
  14993. fallthrough
  14994. case int32(_BT_TRAIL):
  14995. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  14996. return m_XML_TOK_INVALID
  14997. case int32(_BT_QUEST):
  14998. ptr += uintptr(1)
  14999. if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(1))) {
  15000. return -int32(1)
  15001. }
  15002. if int32(*(*int8)(unsafe.Pointer(ptr))) == int32(m_ASCII_GT1) {
  15003. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(1)
  15004. return *(*int32)(unsafe.Pointer(bp))
  15005. }
  15006. default:
  15007. ptr += uintptr(1)
  15008. break
  15009. }
  15010. }
  15011. return -int32(1)
  15012. case int32(_BT_QUEST):
  15013. if !(_normal_checkPiTarget(tls, enc, target, ptr, bp) != 0) {
  15014. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  15015. return m_XML_TOK_INVALID
  15016. }
  15017. ptr += uintptr(1)
  15018. if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(1))) {
  15019. return -int32(1)
  15020. }
  15021. if int32(*(*int8)(unsafe.Pointer(ptr))) == int32(m_ASCII_GT1) {
  15022. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(1)
  15023. return *(*int32)(unsafe.Pointer(bp))
  15024. }
  15025. /* fall through */
  15026. fallthrough
  15027. default:
  15028. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  15029. return m_XML_TOK_INVALID
  15030. }
  15031. }
  15032. return -int32(1)
  15033. }
  15034. func _normal_scanCdataSection(tls *libc.TLS, enc uintptr, ptr uintptr, end uintptr, nextTokPtr uintptr) (r int32) {
  15035. var i int32
  15036. _ = i
  15037. _ = enc
  15038. /* CDATA[ */
  15039. if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(6)*libc.Int32FromInt32(1))) {
  15040. return -int32(1)
  15041. }
  15042. i = 0
  15043. for {
  15044. if !(i < int32(6)) {
  15045. break
  15046. }
  15047. if !(int32(*(*int8)(unsafe.Pointer(ptr))) == int32(_CDATA_LSQB[i])) {
  15048. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  15049. return m_XML_TOK_INVALID
  15050. }
  15051. goto _1
  15052. _1:
  15053. ;
  15054. i++
  15055. ptr += uintptr(1)
  15056. }
  15057. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  15058. return int32(m_XML_TOK_CDATA_SECT_OPEN)
  15059. }
  15060. var _CDATA_LSQB = [6]int8{
  15061. 0: int8(m_ASCII_C),
  15062. 1: int8(m_ASCII_D),
  15063. 2: int8(m_ASCII_A),
  15064. 3: int8(m_ASCII_T),
  15065. 4: int8(m_ASCII_A),
  15066. 5: int8(m_ASCII_LSQB1),
  15067. }
  15068. func _normal_cdataSectionTok(tls *libc.TLS, enc uintptr, ptr uintptr, end uintptr, nextTokPtr uintptr) (r int32) {
  15069. var n Tsize_t
  15070. _ = n
  15071. if ptr >= end {
  15072. return -int32(4)
  15073. }
  15074. if int32(1) > int32(1) {
  15075. n = libc.Uint64FromInt64(int64(end) - int64(ptr))
  15076. if n&libc.Uint64FromInt32(libc.Int32FromInt32(1)-libc.Int32FromInt32(1)) != 0 {
  15077. n &= libc.Uint64FromInt32(^(libc.Int32FromInt32(1) - libc.Int32FromInt32(1)))
  15078. if n == uint64(0) {
  15079. return -int32(1)
  15080. }
  15081. end = ptr + uintptr(n)
  15082. }
  15083. }
  15084. switch libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr))))))) {
  15085. case int32(_BT_RSQB):
  15086. ptr += uintptr(1)
  15087. if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(1))) {
  15088. return -int32(1)
  15089. }
  15090. if !(int32(*(*int8)(unsafe.Pointer(ptr))) == libc.Int32FromInt32(m_ASCII_RSQB1)) {
  15091. break
  15092. }
  15093. ptr += uintptr(1)
  15094. if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(1))) {
  15095. return -int32(1)
  15096. }
  15097. if !(int32(*(*int8)(unsafe.Pointer(ptr))) == libc.Int32FromInt32(m_ASCII_GT1)) {
  15098. ptr -= uintptr(1)
  15099. break
  15100. }
  15101. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(1)
  15102. return int32(m_XML_TOK_CDATA_SECT_CLOSE)
  15103. case int32(_BT_CR):
  15104. ptr += uintptr(1)
  15105. if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(1))) {
  15106. return -int32(1)
  15107. }
  15108. if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr))))))) == int32(_BT_LF) {
  15109. ptr += uintptr(1)
  15110. }
  15111. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  15112. return int32(m_XML_TOK_DATA_NEWLINE)
  15113. case int32(_BT_LF):
  15114. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(1)
  15115. return int32(m_XML_TOK_DATA_NEWLINE)
  15116. case int32(_BT_LEAD2):
  15117. if int64(end)-int64(ptr) < int64(2) {
  15118. return -int32(2)
  15119. }
  15120. if (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisInvalid2})))(tls, enc, ptr) != 0 {
  15121. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  15122. return m_XML_TOK_INVALID
  15123. }
  15124. ptr += uintptr(2)
  15125. case int32(_BT_LEAD3):
  15126. if int64(end)-int64(ptr) < int64(3) {
  15127. return -int32(2)
  15128. }
  15129. if (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisInvalid3})))(tls, enc, ptr) != 0 {
  15130. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  15131. return m_XML_TOK_INVALID
  15132. }
  15133. ptr += uintptr(3)
  15134. case int32(_BT_LEAD4):
  15135. if int64(end)-int64(ptr) < int64(4) {
  15136. return -int32(2)
  15137. }
  15138. if (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisInvalid4})))(tls, enc, ptr) != 0 {
  15139. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  15140. return m_XML_TOK_INVALID
  15141. }
  15142. ptr += uintptr(4)
  15143. case int32(_BT_NONXML):
  15144. fallthrough
  15145. case int32(_BT_MALFORM):
  15146. fallthrough
  15147. case int32(_BT_TRAIL):
  15148. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  15149. return m_XML_TOK_INVALID
  15150. default:
  15151. ptr += uintptr(1)
  15152. break
  15153. }
  15154. for int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(1)) {
  15155. switch libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr))))))) {
  15156. case int32(_BT_LEAD2):
  15157. if int64(end)-int64(ptr) < int64(2) || (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisInvalid2})))(tls, enc, ptr) != 0 {
  15158. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  15159. return int32(m_XML_TOK_DATA_CHARS)
  15160. }
  15161. ptr += uintptr(2)
  15162. case int32(_BT_LEAD3):
  15163. if int64(end)-int64(ptr) < int64(3) || (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisInvalid3})))(tls, enc, ptr) != 0 {
  15164. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  15165. return int32(m_XML_TOK_DATA_CHARS)
  15166. }
  15167. ptr += uintptr(3)
  15168. case int32(_BT_LEAD4):
  15169. if int64(end)-int64(ptr) < int64(4) || (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisInvalid4})))(tls, enc, ptr) != 0 {
  15170. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  15171. return int32(m_XML_TOK_DATA_CHARS)
  15172. }
  15173. ptr += uintptr(4)
  15174. case int32(_BT_NONXML):
  15175. fallthrough
  15176. case int32(_BT_MALFORM):
  15177. fallthrough
  15178. case int32(_BT_TRAIL):
  15179. fallthrough
  15180. case int32(_BT_CR):
  15181. fallthrough
  15182. case int32(_BT_LF):
  15183. fallthrough
  15184. case int32(_BT_RSQB):
  15185. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  15186. return int32(m_XML_TOK_DATA_CHARS)
  15187. default:
  15188. ptr += uintptr(1)
  15189. break
  15190. }
  15191. }
  15192. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  15193. return int32(m_XML_TOK_DATA_CHARS)
  15194. }
  15195. /* ptr points to character following "</" */
  15196. func _normal_scanEndTag(tls *libc.TLS, enc uintptr, ptr uintptr, end uintptr, nextTokPtr uintptr) (r int32) {
  15197. if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(1))) {
  15198. return -int32(1)
  15199. }
  15200. switch libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr))))))) {
  15201. case int32(_BT_NONASCII):
  15202. if !(libc.Int32FromInt32(0) != 0) {
  15203. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  15204. return m_XML_TOK_INVALID
  15205. } /* fall through */
  15206. fallthrough
  15207. case int32(_BT_NMSTRT):
  15208. fallthrough
  15209. case int32(_BT_HEX):
  15210. ptr += uintptr(1)
  15211. case int32(_BT_LEAD2):
  15212. if int64(end)-int64(ptr) < int64(libc.Int32FromInt32(2)) {
  15213. return -int32(2)
  15214. }
  15215. if (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisInvalid2})))(tls, enc, ptr) != 0 || !((*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisNmstrt2})))(tls, enc, ptr) != 0) {
  15216. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  15217. return m_XML_TOK_INVALID
  15218. }
  15219. ptr += uintptr(2)
  15220. case int32(_BT_LEAD3):
  15221. if int64(end)-int64(ptr) < int64(libc.Int32FromInt32(3)) {
  15222. return -int32(2)
  15223. }
  15224. if (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisInvalid3})))(tls, enc, ptr) != 0 || !((*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisNmstrt3})))(tls, enc, ptr) != 0) {
  15225. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  15226. return m_XML_TOK_INVALID
  15227. }
  15228. ptr += uintptr(3)
  15229. case int32(_BT_LEAD4):
  15230. if int64(end)-int64(ptr) < int64(libc.Int32FromInt32(4)) {
  15231. return -int32(2)
  15232. }
  15233. if (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisInvalid4})))(tls, enc, ptr) != 0 || !((*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisNmstrt4})))(tls, enc, ptr) != 0) {
  15234. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  15235. return m_XML_TOK_INVALID
  15236. }
  15237. ptr += uintptr(4)
  15238. default:
  15239. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  15240. return m_XML_TOK_INVALID
  15241. }
  15242. for int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(1)) {
  15243. switch libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr))))))) {
  15244. case int32(_BT_NONASCII):
  15245. goto _1
  15246. case int32(_BT_MINUS):
  15247. goto _2
  15248. case int32(_BT_NAME):
  15249. goto _3
  15250. case int32(_BT_DIGIT):
  15251. goto _4
  15252. case int32(_BT_HEX):
  15253. goto _5
  15254. case int32(_BT_NMSTRT):
  15255. goto _6
  15256. case int32(_BT_LEAD2):
  15257. goto _7
  15258. case int32(_BT_LEAD3):
  15259. goto _8
  15260. case int32(_BT_LEAD4):
  15261. goto _9
  15262. case int32(_BT_LF):
  15263. goto _10
  15264. case int32(_BT_CR):
  15265. goto _11
  15266. case int32(_BT_S):
  15267. goto _12
  15268. case int32(_BT_COLON):
  15269. goto _13
  15270. case int32(_BT_GT):
  15271. goto _14
  15272. default:
  15273. goto _15
  15274. }
  15275. goto _16
  15276. _1:
  15277. ;
  15278. if !(libc.Int32FromInt32(0) != 0) {
  15279. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  15280. return m_XML_TOK_INVALID
  15281. } /* fall through */
  15282. _6:
  15283. ;
  15284. _5:
  15285. ;
  15286. _4:
  15287. ;
  15288. _3:
  15289. ;
  15290. _2:
  15291. ;
  15292. ptr += uintptr(1)
  15293. goto _16
  15294. _7:
  15295. ;
  15296. if int64(end)-int64(ptr) < int64(2) {
  15297. return -int32(2)
  15298. }
  15299. if (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisInvalid2})))(tls, enc, ptr) != 0 || !((*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisName2})))(tls, enc, ptr) != 0) {
  15300. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  15301. return m_XML_TOK_INVALID
  15302. }
  15303. ptr += uintptr(2)
  15304. goto _16
  15305. _8:
  15306. ;
  15307. if int64(end)-int64(ptr) < int64(3) {
  15308. return -int32(2)
  15309. }
  15310. if (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisInvalid3})))(tls, enc, ptr) != 0 || !((*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisName3})))(tls, enc, ptr) != 0) {
  15311. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  15312. return m_XML_TOK_INVALID
  15313. }
  15314. ptr += uintptr(3)
  15315. goto _16
  15316. _9:
  15317. ;
  15318. if int64(end)-int64(ptr) < int64(4) {
  15319. return -int32(2)
  15320. }
  15321. if (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisInvalid4})))(tls, enc, ptr) != 0 || !((*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisName4})))(tls, enc, ptr) != 0) {
  15322. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  15323. return m_XML_TOK_INVALID
  15324. }
  15325. ptr += uintptr(4)
  15326. goto _16
  15327. _12:
  15328. ;
  15329. _11:
  15330. ;
  15331. _10:
  15332. ;
  15333. ptr += uintptr(1)
  15334. _19:
  15335. ;
  15336. if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(1))) {
  15337. goto _17
  15338. }
  15339. switch libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr))))))) {
  15340. case int32(_BT_S):
  15341. fallthrough
  15342. case int32(_BT_CR):
  15343. fallthrough
  15344. case int32(_BT_LF):
  15345. case int32(_BT_GT):
  15346. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(1)
  15347. return int32(m_XML_TOK_END_TAG)
  15348. default:
  15349. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  15350. return m_XML_TOK_INVALID
  15351. }
  15352. goto _18
  15353. _18:
  15354. ;
  15355. ptr += uintptr(1)
  15356. goto _19
  15357. goto _17
  15358. _17:
  15359. ;
  15360. return -int32(1)
  15361. _13:
  15362. ;
  15363. /* no need to check qname syntax here,
  15364. since end-tag must match exactly */
  15365. ptr += uintptr(1)
  15366. goto _16
  15367. _14:
  15368. ;
  15369. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(1)
  15370. return int32(m_XML_TOK_END_TAG)
  15371. _15:
  15372. ;
  15373. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  15374. return m_XML_TOK_INVALID
  15375. _16:
  15376. }
  15377. return -int32(1)
  15378. }
  15379. /* ptr points to character following "&#X" */
  15380. func _normal_scanHexCharRef(tls *libc.TLS, enc uintptr, ptr uintptr, end uintptr, nextTokPtr uintptr) (r int32) {
  15381. if int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(1)) {
  15382. switch libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr))))))) {
  15383. case int32(_BT_DIGIT):
  15384. fallthrough
  15385. case int32(_BT_HEX):
  15386. default:
  15387. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  15388. return m_XML_TOK_INVALID
  15389. }
  15390. ptr += uintptr(1)
  15391. for {
  15392. if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(1))) {
  15393. break
  15394. }
  15395. switch libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr))))))) {
  15396. case int32(_BT_DIGIT):
  15397. fallthrough
  15398. case int32(_BT_HEX):
  15399. case int32(_BT_SEMI):
  15400. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(1)
  15401. return int32(m_XML_TOK_CHAR_REF)
  15402. default:
  15403. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  15404. return m_XML_TOK_INVALID
  15405. }
  15406. goto _1
  15407. _1:
  15408. ;
  15409. ptr += uintptr(1)
  15410. }
  15411. }
  15412. return -int32(1)
  15413. }
  15414. /* ptr points to character following "&#" */
  15415. func _normal_scanCharRef(tls *libc.TLS, enc uintptr, ptr uintptr, end uintptr, nextTokPtr uintptr) (r int32) {
  15416. if int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(1)) {
  15417. if int32(*(*int8)(unsafe.Pointer(ptr))) == int32(m_ASCII_x2) {
  15418. return _normal_scanHexCharRef(tls, enc, ptr+uintptr(1), end, nextTokPtr)
  15419. }
  15420. switch libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr))))))) {
  15421. case int32(_BT_DIGIT):
  15422. default:
  15423. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  15424. return m_XML_TOK_INVALID
  15425. }
  15426. ptr += uintptr(1)
  15427. for {
  15428. if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(1))) {
  15429. break
  15430. }
  15431. switch libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr))))))) {
  15432. case int32(_BT_DIGIT):
  15433. case int32(_BT_SEMI):
  15434. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(1)
  15435. return int32(m_XML_TOK_CHAR_REF)
  15436. default:
  15437. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  15438. return m_XML_TOK_INVALID
  15439. }
  15440. goto _1
  15441. _1:
  15442. ;
  15443. ptr += uintptr(1)
  15444. }
  15445. }
  15446. return -int32(1)
  15447. }
  15448. /* ptr points to character following "&" */
  15449. func _normal_scanRef(tls *libc.TLS, enc uintptr, ptr uintptr, end uintptr, nextTokPtr uintptr) (r int32) {
  15450. if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(1))) {
  15451. return -int32(1)
  15452. }
  15453. switch libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr))))))) {
  15454. case int32(_BT_NONASCII):
  15455. if !(libc.Int32FromInt32(0) != 0) {
  15456. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  15457. return m_XML_TOK_INVALID
  15458. } /* fall through */
  15459. fallthrough
  15460. case int32(_BT_NMSTRT):
  15461. fallthrough
  15462. case int32(_BT_HEX):
  15463. ptr += uintptr(1)
  15464. case int32(_BT_LEAD2):
  15465. if int64(end)-int64(ptr) < int64(libc.Int32FromInt32(2)) {
  15466. return -int32(2)
  15467. }
  15468. if (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisInvalid2})))(tls, enc, ptr) != 0 || !((*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisNmstrt2})))(tls, enc, ptr) != 0) {
  15469. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  15470. return m_XML_TOK_INVALID
  15471. }
  15472. ptr += uintptr(2)
  15473. case int32(_BT_LEAD3):
  15474. if int64(end)-int64(ptr) < int64(libc.Int32FromInt32(3)) {
  15475. return -int32(2)
  15476. }
  15477. if (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisInvalid3})))(tls, enc, ptr) != 0 || !((*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisNmstrt3})))(tls, enc, ptr) != 0) {
  15478. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  15479. return m_XML_TOK_INVALID
  15480. }
  15481. ptr += uintptr(3)
  15482. case int32(_BT_LEAD4):
  15483. if int64(end)-int64(ptr) < int64(libc.Int32FromInt32(4)) {
  15484. return -int32(2)
  15485. }
  15486. if (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisInvalid4})))(tls, enc, ptr) != 0 || !((*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisNmstrt4})))(tls, enc, ptr) != 0) {
  15487. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  15488. return m_XML_TOK_INVALID
  15489. }
  15490. ptr += uintptr(4)
  15491. case int32(_BT_NUM):
  15492. return _normal_scanCharRef(tls, enc, ptr+uintptr(1), end, nextTokPtr)
  15493. default:
  15494. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  15495. return m_XML_TOK_INVALID
  15496. }
  15497. for int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(1)) {
  15498. switch libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr))))))) {
  15499. case int32(_BT_NONASCII):
  15500. if !(libc.Int32FromInt32(0) != 0) {
  15501. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  15502. return m_XML_TOK_INVALID
  15503. } /* fall through */
  15504. fallthrough
  15505. case int32(_BT_NMSTRT):
  15506. fallthrough
  15507. case int32(_BT_HEX):
  15508. fallthrough
  15509. case int32(_BT_DIGIT):
  15510. fallthrough
  15511. case int32(_BT_NAME):
  15512. fallthrough
  15513. case int32(_BT_MINUS):
  15514. ptr += uintptr(1)
  15515. case int32(_BT_LEAD2):
  15516. if int64(end)-int64(ptr) < int64(2) {
  15517. return -int32(2)
  15518. }
  15519. if (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisInvalid2})))(tls, enc, ptr) != 0 || !((*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisName2})))(tls, enc, ptr) != 0) {
  15520. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  15521. return m_XML_TOK_INVALID
  15522. }
  15523. ptr += uintptr(2)
  15524. case int32(_BT_LEAD3):
  15525. if int64(end)-int64(ptr) < int64(3) {
  15526. return -int32(2)
  15527. }
  15528. if (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisInvalid3})))(tls, enc, ptr) != 0 || !((*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisName3})))(tls, enc, ptr) != 0) {
  15529. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  15530. return m_XML_TOK_INVALID
  15531. }
  15532. ptr += uintptr(3)
  15533. case int32(_BT_LEAD4):
  15534. if int64(end)-int64(ptr) < int64(4) {
  15535. return -int32(2)
  15536. }
  15537. if (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisInvalid4})))(tls, enc, ptr) != 0 || !((*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisName4})))(tls, enc, ptr) != 0) {
  15538. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  15539. return m_XML_TOK_INVALID
  15540. }
  15541. ptr += uintptr(4)
  15542. case int32(_BT_SEMI):
  15543. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(1)
  15544. return int32(m_XML_TOK_ENTITY_REF)
  15545. default:
  15546. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  15547. return m_XML_TOK_INVALID
  15548. }
  15549. }
  15550. return -int32(1)
  15551. }
  15552. /* ptr points to character following first character of attribute name */
  15553. func _normal_scanAtts(tls *libc.TLS, enc uintptr, _ptr uintptr, end uintptr, nextTokPtr uintptr) (r int32) {
  15554. bp := tls.Alloc(16)
  15555. defer tls.Free(16)
  15556. *(*uintptr)(unsafe.Pointer(bp)) = _ptr
  15557. var hadColon, open, t, t1, tok int32
  15558. _, _, _, _, _ = hadColon, open, t, t1, tok
  15559. hadColon = 0
  15560. for int64(end)-int64(*(*uintptr)(unsafe.Pointer(bp))) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(1)) {
  15561. switch libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp))))))))) {
  15562. case int32(_BT_NONASCII):
  15563. goto _1
  15564. case int32(_BT_MINUS):
  15565. goto _2
  15566. case int32(_BT_NAME):
  15567. goto _3
  15568. case int32(_BT_DIGIT):
  15569. goto _4
  15570. case int32(_BT_HEX):
  15571. goto _5
  15572. case int32(_BT_NMSTRT):
  15573. goto _6
  15574. case int32(_BT_LEAD2):
  15575. goto _7
  15576. case int32(_BT_LEAD3):
  15577. goto _8
  15578. case int32(_BT_LEAD4):
  15579. goto _9
  15580. case int32(_BT_COLON):
  15581. goto _10
  15582. case int32(_BT_LF):
  15583. goto _11
  15584. case int32(_BT_CR):
  15585. goto _12
  15586. case int32(_BT_S):
  15587. goto _13
  15588. case int32(_BT_EQUALS):
  15589. goto _14
  15590. default:
  15591. goto _15
  15592. }
  15593. goto _16
  15594. _1:
  15595. ;
  15596. if !(libc.Int32FromInt32(0) != 0) {
  15597. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = *(*uintptr)(unsafe.Pointer(bp))
  15598. return m_XML_TOK_INVALID
  15599. } /* fall through */
  15600. _6:
  15601. ;
  15602. _5:
  15603. ;
  15604. _4:
  15605. ;
  15606. _3:
  15607. ;
  15608. _2:
  15609. ;
  15610. *(*uintptr)(unsafe.Pointer(bp)) += uintptr(1)
  15611. goto _16
  15612. _7:
  15613. ;
  15614. if int64(end)-int64(*(*uintptr)(unsafe.Pointer(bp))) < int64(2) {
  15615. return -int32(2)
  15616. }
  15617. if (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisInvalid2})))(tls, enc, *(*uintptr)(unsafe.Pointer(bp))) != 0 || !((*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisName2})))(tls, enc, *(*uintptr)(unsafe.Pointer(bp))) != 0) {
  15618. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = *(*uintptr)(unsafe.Pointer(bp))
  15619. return m_XML_TOK_INVALID
  15620. }
  15621. *(*uintptr)(unsafe.Pointer(bp)) += uintptr(2)
  15622. goto _16
  15623. _8:
  15624. ;
  15625. if int64(end)-int64(*(*uintptr)(unsafe.Pointer(bp))) < int64(3) {
  15626. return -int32(2)
  15627. }
  15628. if (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisInvalid3})))(tls, enc, *(*uintptr)(unsafe.Pointer(bp))) != 0 || !((*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisName3})))(tls, enc, *(*uintptr)(unsafe.Pointer(bp))) != 0) {
  15629. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = *(*uintptr)(unsafe.Pointer(bp))
  15630. return m_XML_TOK_INVALID
  15631. }
  15632. *(*uintptr)(unsafe.Pointer(bp)) += uintptr(3)
  15633. goto _16
  15634. _9:
  15635. ;
  15636. if int64(end)-int64(*(*uintptr)(unsafe.Pointer(bp))) < int64(4) {
  15637. return -int32(2)
  15638. }
  15639. if (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisInvalid4})))(tls, enc, *(*uintptr)(unsafe.Pointer(bp))) != 0 || !((*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisName4})))(tls, enc, *(*uintptr)(unsafe.Pointer(bp))) != 0) {
  15640. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = *(*uintptr)(unsafe.Pointer(bp))
  15641. return m_XML_TOK_INVALID
  15642. }
  15643. *(*uintptr)(unsafe.Pointer(bp)) += uintptr(4)
  15644. goto _16
  15645. _10:
  15646. ;
  15647. if hadColon != 0 {
  15648. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = *(*uintptr)(unsafe.Pointer(bp))
  15649. return m_XML_TOK_INVALID
  15650. }
  15651. hadColon = int32(1)
  15652. *(*uintptr)(unsafe.Pointer(bp)) += uintptr(1)
  15653. if !(int64(end)-int64(*(*uintptr)(unsafe.Pointer(bp))) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(1))) {
  15654. return -int32(1)
  15655. }
  15656. switch libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp))))))))) {
  15657. case int32(_BT_NONASCII):
  15658. if !(libc.Int32FromInt32(0) != 0) {
  15659. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = *(*uintptr)(unsafe.Pointer(bp))
  15660. return m_XML_TOK_INVALID
  15661. } /* fall through */
  15662. fallthrough
  15663. case int32(_BT_NMSTRT):
  15664. fallthrough
  15665. case int32(_BT_HEX):
  15666. *(*uintptr)(unsafe.Pointer(bp)) += uintptr(1)
  15667. case int32(_BT_LEAD2):
  15668. if int64(end)-int64(*(*uintptr)(unsafe.Pointer(bp))) < int64(libc.Int32FromInt32(2)) {
  15669. return -int32(2)
  15670. }
  15671. if (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisInvalid2})))(tls, enc, *(*uintptr)(unsafe.Pointer(bp))) != 0 || !((*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisNmstrt2})))(tls, enc, *(*uintptr)(unsafe.Pointer(bp))) != 0) {
  15672. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = *(*uintptr)(unsafe.Pointer(bp))
  15673. return m_XML_TOK_INVALID
  15674. }
  15675. *(*uintptr)(unsafe.Pointer(bp)) += uintptr(2)
  15676. case int32(_BT_LEAD3):
  15677. if int64(end)-int64(*(*uintptr)(unsafe.Pointer(bp))) < int64(libc.Int32FromInt32(3)) {
  15678. return -int32(2)
  15679. }
  15680. if (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisInvalid3})))(tls, enc, *(*uintptr)(unsafe.Pointer(bp))) != 0 || !((*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisNmstrt3})))(tls, enc, *(*uintptr)(unsafe.Pointer(bp))) != 0) {
  15681. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = *(*uintptr)(unsafe.Pointer(bp))
  15682. return m_XML_TOK_INVALID
  15683. }
  15684. *(*uintptr)(unsafe.Pointer(bp)) += uintptr(3)
  15685. case int32(_BT_LEAD4):
  15686. if int64(end)-int64(*(*uintptr)(unsafe.Pointer(bp))) < int64(libc.Int32FromInt32(4)) {
  15687. return -int32(2)
  15688. }
  15689. if (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisInvalid4})))(tls, enc, *(*uintptr)(unsafe.Pointer(bp))) != 0 || !((*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisNmstrt4})))(tls, enc, *(*uintptr)(unsafe.Pointer(bp))) != 0) {
  15690. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = *(*uintptr)(unsafe.Pointer(bp))
  15691. return m_XML_TOK_INVALID
  15692. }
  15693. *(*uintptr)(unsafe.Pointer(bp)) += uintptr(4)
  15694. default:
  15695. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = *(*uintptr)(unsafe.Pointer(bp))
  15696. return m_XML_TOK_INVALID
  15697. }
  15698. goto _16
  15699. _13:
  15700. ;
  15701. _12:
  15702. ;
  15703. _11:
  15704. ;
  15705. _19:
  15706. ;
  15707. *(*uintptr)(unsafe.Pointer(bp)) += uintptr(1)
  15708. if !(int64(end)-int64(*(*uintptr)(unsafe.Pointer(bp))) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(1))) {
  15709. return -int32(1)
  15710. }
  15711. t = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))))))))
  15712. if t == int32(_BT_EQUALS) {
  15713. goto _17
  15714. }
  15715. switch t {
  15716. case int32(_BT_S):
  15717. fallthrough
  15718. case int32(_BT_LF):
  15719. fallthrough
  15720. case int32(_BT_CR):
  15721. default:
  15722. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = *(*uintptr)(unsafe.Pointer(bp))
  15723. return m_XML_TOK_INVALID
  15724. }
  15725. goto _18
  15726. _18:
  15727. ;
  15728. goto _19
  15729. goto _17
  15730. _17:
  15731. ;
  15732. /* fall through */
  15733. _14:
  15734. ;
  15735. hadColon = 0
  15736. for {
  15737. *(*uintptr)(unsafe.Pointer(bp)) += uintptr(1)
  15738. if !(int64(end)-int64(*(*uintptr)(unsafe.Pointer(bp))) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(1))) {
  15739. return -int32(1)
  15740. }
  15741. open = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))))))))
  15742. if open == int32(_BT_QUOT) || open == int32(_BT_APOS) {
  15743. break
  15744. }
  15745. switch open {
  15746. case int32(_BT_S):
  15747. fallthrough
  15748. case int32(_BT_LF):
  15749. fallthrough
  15750. case int32(_BT_CR):
  15751. default:
  15752. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = *(*uintptr)(unsafe.Pointer(bp))
  15753. return m_XML_TOK_INVALID
  15754. }
  15755. goto _20
  15756. _20:
  15757. }
  15758. *(*uintptr)(unsafe.Pointer(bp)) += uintptr(1)
  15759. /* in attribute value */
  15760. for {
  15761. if !(int64(end)-int64(*(*uintptr)(unsafe.Pointer(bp))) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(1))) {
  15762. return -int32(1)
  15763. }
  15764. t1 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))))))))
  15765. if t1 == open {
  15766. break
  15767. }
  15768. switch t1 {
  15769. case int32(_BT_LEAD2):
  15770. if int64(end)-int64(*(*uintptr)(unsafe.Pointer(bp))) < int64(2) {
  15771. return -int32(2)
  15772. }
  15773. if (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisInvalid2})))(tls, enc, *(*uintptr)(unsafe.Pointer(bp))) != 0 {
  15774. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = *(*uintptr)(unsafe.Pointer(bp))
  15775. return m_XML_TOK_INVALID
  15776. }
  15777. *(*uintptr)(unsafe.Pointer(bp)) += uintptr(2)
  15778. case int32(_BT_LEAD3):
  15779. if int64(end)-int64(*(*uintptr)(unsafe.Pointer(bp))) < int64(3) {
  15780. return -int32(2)
  15781. }
  15782. if (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisInvalid3})))(tls, enc, *(*uintptr)(unsafe.Pointer(bp))) != 0 {
  15783. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = *(*uintptr)(unsafe.Pointer(bp))
  15784. return m_XML_TOK_INVALID
  15785. }
  15786. *(*uintptr)(unsafe.Pointer(bp)) += uintptr(3)
  15787. case int32(_BT_LEAD4):
  15788. if int64(end)-int64(*(*uintptr)(unsafe.Pointer(bp))) < int64(4) {
  15789. return -int32(2)
  15790. }
  15791. if (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisInvalid4})))(tls, enc, *(*uintptr)(unsafe.Pointer(bp))) != 0 {
  15792. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = *(*uintptr)(unsafe.Pointer(bp))
  15793. return m_XML_TOK_INVALID
  15794. }
  15795. *(*uintptr)(unsafe.Pointer(bp)) += uintptr(4)
  15796. case int32(_BT_NONXML):
  15797. fallthrough
  15798. case int32(_BT_MALFORM):
  15799. fallthrough
  15800. case int32(_BT_TRAIL):
  15801. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = *(*uintptr)(unsafe.Pointer(bp))
  15802. return m_XML_TOK_INVALID
  15803. case int32(_BT_AMP):
  15804. tok = _normal_scanRef(tls, enc, *(*uintptr)(unsafe.Pointer(bp))+uintptr(1), end, bp)
  15805. if tok <= 0 {
  15806. if tok == m_XML_TOK_INVALID {
  15807. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = *(*uintptr)(unsafe.Pointer(bp))
  15808. }
  15809. return tok
  15810. }
  15811. case int32(_BT_LT):
  15812. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = *(*uintptr)(unsafe.Pointer(bp))
  15813. return m_XML_TOK_INVALID
  15814. default:
  15815. *(*uintptr)(unsafe.Pointer(bp)) += uintptr(1)
  15816. break
  15817. }
  15818. goto _21
  15819. _21:
  15820. }
  15821. *(*uintptr)(unsafe.Pointer(bp)) += uintptr(1)
  15822. if !(int64(end)-int64(*(*uintptr)(unsafe.Pointer(bp))) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(1))) {
  15823. return -int32(1)
  15824. }
  15825. switch libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp))))))))) {
  15826. case int32(_BT_S):
  15827. fallthrough
  15828. case int32(_BT_CR):
  15829. fallthrough
  15830. case int32(_BT_LF):
  15831. case int32(_BT_SOL):
  15832. goto sol
  15833. case int32(_BT_GT):
  15834. goto gt
  15835. default:
  15836. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = *(*uintptr)(unsafe.Pointer(bp))
  15837. return m_XML_TOK_INVALID
  15838. }
  15839. /* ptr points to closing quote */
  15840. _24:
  15841. ;
  15842. *(*uintptr)(unsafe.Pointer(bp)) += uintptr(1)
  15843. if !(int64(end)-int64(*(*uintptr)(unsafe.Pointer(bp))) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(1))) {
  15844. return -int32(1)
  15845. }
  15846. switch libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp))))))))) {
  15847. case int32(_BT_NONASCII):
  15848. goto _25
  15849. case int32(_BT_HEX):
  15850. goto _26
  15851. case int32(_BT_NMSTRT):
  15852. goto _27
  15853. case int32(_BT_LEAD2):
  15854. goto _28
  15855. case int32(_BT_LEAD3):
  15856. goto _29
  15857. case int32(_BT_LEAD4):
  15858. goto _30
  15859. case int32(_BT_LF):
  15860. goto _31
  15861. case int32(_BT_CR):
  15862. goto _32
  15863. case int32(_BT_S):
  15864. goto _33
  15865. case int32(_BT_GT):
  15866. goto _34
  15867. case int32(_BT_SOL):
  15868. goto _35
  15869. default:
  15870. goto _36
  15871. }
  15872. goto _37
  15873. _25:
  15874. ;
  15875. if !(libc.Int32FromInt32(0) != 0) {
  15876. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = *(*uintptr)(unsafe.Pointer(bp))
  15877. return m_XML_TOK_INVALID
  15878. } /* fall through */
  15879. _27:
  15880. ;
  15881. _26:
  15882. ;
  15883. *(*uintptr)(unsafe.Pointer(bp)) += uintptr(1)
  15884. goto _37
  15885. _28:
  15886. ;
  15887. if int64(end)-int64(*(*uintptr)(unsafe.Pointer(bp))) < int64(libc.Int32FromInt32(2)) {
  15888. return -int32(2)
  15889. }
  15890. if (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisInvalid2})))(tls, enc, *(*uintptr)(unsafe.Pointer(bp))) != 0 || !((*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisNmstrt2})))(tls, enc, *(*uintptr)(unsafe.Pointer(bp))) != 0) {
  15891. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = *(*uintptr)(unsafe.Pointer(bp))
  15892. return m_XML_TOK_INVALID
  15893. }
  15894. *(*uintptr)(unsafe.Pointer(bp)) += uintptr(2)
  15895. goto _37
  15896. _29:
  15897. ;
  15898. if int64(end)-int64(*(*uintptr)(unsafe.Pointer(bp))) < int64(libc.Int32FromInt32(3)) {
  15899. return -int32(2)
  15900. }
  15901. if (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisInvalid3})))(tls, enc, *(*uintptr)(unsafe.Pointer(bp))) != 0 || !((*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisNmstrt3})))(tls, enc, *(*uintptr)(unsafe.Pointer(bp))) != 0) {
  15902. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = *(*uintptr)(unsafe.Pointer(bp))
  15903. return m_XML_TOK_INVALID
  15904. }
  15905. *(*uintptr)(unsafe.Pointer(bp)) += uintptr(3)
  15906. goto _37
  15907. _30:
  15908. ;
  15909. if int64(end)-int64(*(*uintptr)(unsafe.Pointer(bp))) < int64(libc.Int32FromInt32(4)) {
  15910. return -int32(2)
  15911. }
  15912. if (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisInvalid4})))(tls, enc, *(*uintptr)(unsafe.Pointer(bp))) != 0 || !((*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisNmstrt4})))(tls, enc, *(*uintptr)(unsafe.Pointer(bp))) != 0) {
  15913. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = *(*uintptr)(unsafe.Pointer(bp))
  15914. return m_XML_TOK_INVALID
  15915. }
  15916. *(*uintptr)(unsafe.Pointer(bp)) += uintptr(4)
  15917. goto _37
  15918. _33:
  15919. ;
  15920. _32:
  15921. ;
  15922. _31:
  15923. ;
  15924. goto _23
  15925. _34:
  15926. ;
  15927. goto gt
  15928. gt:
  15929. ;
  15930. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = *(*uintptr)(unsafe.Pointer(bp)) + uintptr(1)
  15931. return int32(m_XML_TOK_START_TAG_WITH_ATTS)
  15932. _35:
  15933. ;
  15934. goto sol
  15935. sol:
  15936. ;
  15937. *(*uintptr)(unsafe.Pointer(bp)) += uintptr(1)
  15938. if !(int64(end)-int64(*(*uintptr)(unsafe.Pointer(bp))) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(1))) {
  15939. return -int32(1)
  15940. }
  15941. if !(int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp))))) == libc.Int32FromInt32(m_ASCII_GT1)) {
  15942. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = *(*uintptr)(unsafe.Pointer(bp))
  15943. return m_XML_TOK_INVALID
  15944. }
  15945. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = *(*uintptr)(unsafe.Pointer(bp)) + uintptr(1)
  15946. return int32(m_XML_TOK_EMPTY_ELEMENT_WITH_ATTS)
  15947. _36:
  15948. ;
  15949. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = *(*uintptr)(unsafe.Pointer(bp))
  15950. return m_XML_TOK_INVALID
  15951. _37:
  15952. ;
  15953. goto _22
  15954. goto _23
  15955. _23:
  15956. ;
  15957. goto _24
  15958. goto _22
  15959. _22:
  15960. ;
  15961. goto _16
  15962. _15:
  15963. ;
  15964. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = *(*uintptr)(unsafe.Pointer(bp))
  15965. return m_XML_TOK_INVALID
  15966. _16:
  15967. }
  15968. return -int32(1)
  15969. }
  15970. /* ptr points to character following "<" */
  15971. func _normal_scanLt(tls *libc.TLS, enc uintptr, ptr uintptr, end uintptr, nextTokPtr uintptr) (r int32) {
  15972. var hadColon int32
  15973. _ = hadColon
  15974. if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(1))) {
  15975. return -int32(1)
  15976. }
  15977. switch libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr))))))) {
  15978. case int32(_BT_NONASCII):
  15979. if !(libc.Int32FromInt32(0) != 0) {
  15980. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  15981. return m_XML_TOK_INVALID
  15982. } /* fall through */
  15983. fallthrough
  15984. case int32(_BT_NMSTRT):
  15985. fallthrough
  15986. case int32(_BT_HEX):
  15987. ptr += uintptr(1)
  15988. case int32(_BT_LEAD2):
  15989. if int64(end)-int64(ptr) < int64(libc.Int32FromInt32(2)) {
  15990. return -int32(2)
  15991. }
  15992. if (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisInvalid2})))(tls, enc, ptr) != 0 || !((*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisNmstrt2})))(tls, enc, ptr) != 0) {
  15993. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  15994. return m_XML_TOK_INVALID
  15995. }
  15996. ptr += uintptr(2)
  15997. case int32(_BT_LEAD3):
  15998. if int64(end)-int64(ptr) < int64(libc.Int32FromInt32(3)) {
  15999. return -int32(2)
  16000. }
  16001. if (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisInvalid3})))(tls, enc, ptr) != 0 || !((*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisNmstrt3})))(tls, enc, ptr) != 0) {
  16002. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  16003. return m_XML_TOK_INVALID
  16004. }
  16005. ptr += uintptr(3)
  16006. case int32(_BT_LEAD4):
  16007. if int64(end)-int64(ptr) < int64(libc.Int32FromInt32(4)) {
  16008. return -int32(2)
  16009. }
  16010. if (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisInvalid4})))(tls, enc, ptr) != 0 || !((*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisNmstrt4})))(tls, enc, ptr) != 0) {
  16011. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  16012. return m_XML_TOK_INVALID
  16013. }
  16014. ptr += uintptr(4)
  16015. case int32(_BT_EXCL):
  16016. ptr += uintptr(1)
  16017. if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(1))) {
  16018. return -int32(1)
  16019. }
  16020. switch libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr))))))) {
  16021. case int32(_BT_MINUS):
  16022. return _normal_scanComment(tls, enc, ptr+uintptr(1), end, nextTokPtr)
  16023. case int32(_BT_LSQB):
  16024. return _normal_scanCdataSection(tls, enc, ptr+uintptr(1), end, nextTokPtr)
  16025. }
  16026. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  16027. return m_XML_TOK_INVALID
  16028. case int32(_BT_QUEST):
  16029. return _normal_scanPi(tls, enc, ptr+uintptr(1), end, nextTokPtr)
  16030. case int32(_BT_SOL):
  16031. return _normal_scanEndTag(tls, enc, ptr+uintptr(1), end, nextTokPtr)
  16032. default:
  16033. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  16034. return m_XML_TOK_INVALID
  16035. }
  16036. hadColon = 0
  16037. /* we have a start-tag */
  16038. for int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(1)) {
  16039. switch libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr))))))) {
  16040. case int32(_BT_NONASCII):
  16041. goto _1
  16042. case int32(_BT_MINUS):
  16043. goto _2
  16044. case int32(_BT_NAME):
  16045. goto _3
  16046. case int32(_BT_DIGIT):
  16047. goto _4
  16048. case int32(_BT_HEX):
  16049. goto _5
  16050. case int32(_BT_NMSTRT):
  16051. goto _6
  16052. case int32(_BT_LEAD2):
  16053. goto _7
  16054. case int32(_BT_LEAD3):
  16055. goto _8
  16056. case int32(_BT_LEAD4):
  16057. goto _9
  16058. case int32(_BT_COLON):
  16059. goto _10
  16060. case int32(_BT_LF):
  16061. goto _11
  16062. case int32(_BT_CR):
  16063. goto _12
  16064. case int32(_BT_S):
  16065. goto _13
  16066. case int32(_BT_GT):
  16067. goto _14
  16068. case int32(_BT_SOL):
  16069. goto _15
  16070. default:
  16071. goto _16
  16072. }
  16073. goto _17
  16074. _1:
  16075. ;
  16076. if !(libc.Int32FromInt32(0) != 0) {
  16077. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  16078. return m_XML_TOK_INVALID
  16079. } /* fall through */
  16080. _6:
  16081. ;
  16082. _5:
  16083. ;
  16084. _4:
  16085. ;
  16086. _3:
  16087. ;
  16088. _2:
  16089. ;
  16090. ptr += uintptr(1)
  16091. goto _17
  16092. _7:
  16093. ;
  16094. if int64(end)-int64(ptr) < int64(2) {
  16095. return -int32(2)
  16096. }
  16097. if (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisInvalid2})))(tls, enc, ptr) != 0 || !((*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisName2})))(tls, enc, ptr) != 0) {
  16098. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  16099. return m_XML_TOK_INVALID
  16100. }
  16101. ptr += uintptr(2)
  16102. goto _17
  16103. _8:
  16104. ;
  16105. if int64(end)-int64(ptr) < int64(3) {
  16106. return -int32(2)
  16107. }
  16108. if (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisInvalid3})))(tls, enc, ptr) != 0 || !((*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisName3})))(tls, enc, ptr) != 0) {
  16109. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  16110. return m_XML_TOK_INVALID
  16111. }
  16112. ptr += uintptr(3)
  16113. goto _17
  16114. _9:
  16115. ;
  16116. if int64(end)-int64(ptr) < int64(4) {
  16117. return -int32(2)
  16118. }
  16119. if (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisInvalid4})))(tls, enc, ptr) != 0 || !((*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisName4})))(tls, enc, ptr) != 0) {
  16120. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  16121. return m_XML_TOK_INVALID
  16122. }
  16123. ptr += uintptr(4)
  16124. goto _17
  16125. _10:
  16126. ;
  16127. if hadColon != 0 {
  16128. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  16129. return m_XML_TOK_INVALID
  16130. }
  16131. hadColon = int32(1)
  16132. ptr += uintptr(1)
  16133. if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(1))) {
  16134. return -int32(1)
  16135. }
  16136. switch libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr))))))) {
  16137. case int32(_BT_NONASCII):
  16138. if !(libc.Int32FromInt32(0) != 0) {
  16139. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  16140. return m_XML_TOK_INVALID
  16141. } /* fall through */
  16142. fallthrough
  16143. case int32(_BT_NMSTRT):
  16144. fallthrough
  16145. case int32(_BT_HEX):
  16146. ptr += uintptr(1)
  16147. case int32(_BT_LEAD2):
  16148. if int64(end)-int64(ptr) < int64(libc.Int32FromInt32(2)) {
  16149. return -int32(2)
  16150. }
  16151. if (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisInvalid2})))(tls, enc, ptr) != 0 || !((*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisNmstrt2})))(tls, enc, ptr) != 0) {
  16152. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  16153. return m_XML_TOK_INVALID
  16154. }
  16155. ptr += uintptr(2)
  16156. case int32(_BT_LEAD3):
  16157. if int64(end)-int64(ptr) < int64(libc.Int32FromInt32(3)) {
  16158. return -int32(2)
  16159. }
  16160. if (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisInvalid3})))(tls, enc, ptr) != 0 || !((*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisNmstrt3})))(tls, enc, ptr) != 0) {
  16161. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  16162. return m_XML_TOK_INVALID
  16163. }
  16164. ptr += uintptr(3)
  16165. case int32(_BT_LEAD4):
  16166. if int64(end)-int64(ptr) < int64(libc.Int32FromInt32(4)) {
  16167. return -int32(2)
  16168. }
  16169. if (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisInvalid4})))(tls, enc, ptr) != 0 || !((*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisNmstrt4})))(tls, enc, ptr) != 0) {
  16170. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  16171. return m_XML_TOK_INVALID
  16172. }
  16173. ptr += uintptr(4)
  16174. default:
  16175. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  16176. return m_XML_TOK_INVALID
  16177. }
  16178. goto _17
  16179. _13:
  16180. ;
  16181. _12:
  16182. ;
  16183. _11:
  16184. ;
  16185. ptr += uintptr(1)
  16186. for int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(1)) {
  16187. switch libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr))))))) {
  16188. case int32(_BT_NONASCII):
  16189. if !(libc.Int32FromInt32(0) != 0) {
  16190. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  16191. return m_XML_TOK_INVALID
  16192. } /* fall through */
  16193. fallthrough
  16194. case int32(_BT_NMSTRT):
  16195. fallthrough
  16196. case int32(_BT_HEX):
  16197. ptr += uintptr(1)
  16198. case int32(_BT_LEAD2):
  16199. if int64(end)-int64(ptr) < int64(libc.Int32FromInt32(2)) {
  16200. return -int32(2)
  16201. }
  16202. if (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisInvalid2})))(tls, enc, ptr) != 0 || !((*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisNmstrt2})))(tls, enc, ptr) != 0) {
  16203. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  16204. return m_XML_TOK_INVALID
  16205. }
  16206. ptr += uintptr(2)
  16207. case int32(_BT_LEAD3):
  16208. if int64(end)-int64(ptr) < int64(libc.Int32FromInt32(3)) {
  16209. return -int32(2)
  16210. }
  16211. if (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisInvalid3})))(tls, enc, ptr) != 0 || !((*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisNmstrt3})))(tls, enc, ptr) != 0) {
  16212. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  16213. return m_XML_TOK_INVALID
  16214. }
  16215. ptr += uintptr(3)
  16216. case int32(_BT_LEAD4):
  16217. if int64(end)-int64(ptr) < int64(libc.Int32FromInt32(4)) {
  16218. return -int32(2)
  16219. }
  16220. if (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisInvalid4})))(tls, enc, ptr) != 0 || !((*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisNmstrt4})))(tls, enc, ptr) != 0) {
  16221. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  16222. return m_XML_TOK_INVALID
  16223. }
  16224. ptr += uintptr(4)
  16225. case int32(_BT_GT):
  16226. goto gt
  16227. case int32(_BT_SOL):
  16228. goto sol
  16229. case int32(_BT_S):
  16230. fallthrough
  16231. case int32(_BT_CR):
  16232. fallthrough
  16233. case int32(_BT_LF):
  16234. ptr += uintptr(1)
  16235. continue
  16236. default:
  16237. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  16238. return m_XML_TOK_INVALID
  16239. }
  16240. return _normal_scanAtts(tls, enc, ptr, end, nextTokPtr)
  16241. }
  16242. return -int32(1)
  16243. _14:
  16244. ;
  16245. goto gt
  16246. gt:
  16247. ;
  16248. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(1)
  16249. return int32(m_XML_TOK_START_TAG_NO_ATTS)
  16250. _15:
  16251. ;
  16252. goto sol
  16253. sol:
  16254. ;
  16255. ptr += uintptr(1)
  16256. if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(1))) {
  16257. return -int32(1)
  16258. }
  16259. if !(int32(*(*int8)(unsafe.Pointer(ptr))) == libc.Int32FromInt32(m_ASCII_GT1)) {
  16260. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  16261. return m_XML_TOK_INVALID
  16262. }
  16263. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(1)
  16264. return int32(m_XML_TOK_EMPTY_ELEMENT_NO_ATTS)
  16265. _16:
  16266. ;
  16267. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  16268. return m_XML_TOK_INVALID
  16269. _17:
  16270. }
  16271. return -int32(1)
  16272. }
  16273. func _normal_contentTok(tls *libc.TLS, enc uintptr, ptr uintptr, end uintptr, nextTokPtr uintptr) (r int32) {
  16274. var n Tsize_t
  16275. _ = n
  16276. if ptr >= end {
  16277. return -int32(4)
  16278. }
  16279. if int32(1) > int32(1) {
  16280. n = libc.Uint64FromInt64(int64(end) - int64(ptr))
  16281. if n&libc.Uint64FromInt32(libc.Int32FromInt32(1)-libc.Int32FromInt32(1)) != 0 {
  16282. n &= libc.Uint64FromInt32(^(libc.Int32FromInt32(1) - libc.Int32FromInt32(1)))
  16283. if n == uint64(0) {
  16284. return -int32(1)
  16285. }
  16286. end = ptr + uintptr(n)
  16287. }
  16288. }
  16289. switch libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr))))))) {
  16290. case int32(_BT_LT):
  16291. return _normal_scanLt(tls, enc, ptr+uintptr(1), end, nextTokPtr)
  16292. case int32(_BT_AMP):
  16293. return _normal_scanRef(tls, enc, ptr+uintptr(1), end, nextTokPtr)
  16294. case int32(_BT_CR):
  16295. ptr += uintptr(1)
  16296. if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(1))) {
  16297. return -int32(3)
  16298. }
  16299. if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr))))))) == int32(_BT_LF) {
  16300. ptr += uintptr(1)
  16301. }
  16302. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  16303. return int32(m_XML_TOK_DATA_NEWLINE)
  16304. case int32(_BT_LF):
  16305. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(1)
  16306. return int32(m_XML_TOK_DATA_NEWLINE)
  16307. case int32(_BT_RSQB):
  16308. ptr += uintptr(1)
  16309. if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(1))) {
  16310. return -int32(5)
  16311. }
  16312. if !(int32(*(*int8)(unsafe.Pointer(ptr))) == libc.Int32FromInt32(m_ASCII_RSQB1)) {
  16313. break
  16314. }
  16315. ptr += uintptr(1)
  16316. if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(1))) {
  16317. return -int32(5)
  16318. }
  16319. if !(int32(*(*int8)(unsafe.Pointer(ptr))) == libc.Int32FromInt32(m_ASCII_GT1)) {
  16320. ptr -= uintptr(1)
  16321. break
  16322. }
  16323. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  16324. return m_XML_TOK_INVALID
  16325. case int32(_BT_LEAD2):
  16326. if int64(end)-int64(ptr) < int64(2) {
  16327. return -int32(2)
  16328. }
  16329. if (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisInvalid2})))(tls, enc, ptr) != 0 {
  16330. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  16331. return m_XML_TOK_INVALID
  16332. }
  16333. ptr += uintptr(2)
  16334. case int32(_BT_LEAD3):
  16335. if int64(end)-int64(ptr) < int64(3) {
  16336. return -int32(2)
  16337. }
  16338. if (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisInvalid3})))(tls, enc, ptr) != 0 {
  16339. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  16340. return m_XML_TOK_INVALID
  16341. }
  16342. ptr += uintptr(3)
  16343. case int32(_BT_LEAD4):
  16344. if int64(end)-int64(ptr) < int64(4) {
  16345. return -int32(2)
  16346. }
  16347. if (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisInvalid4})))(tls, enc, ptr) != 0 {
  16348. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  16349. return m_XML_TOK_INVALID
  16350. }
  16351. ptr += uintptr(4)
  16352. case int32(_BT_NONXML):
  16353. fallthrough
  16354. case int32(_BT_MALFORM):
  16355. fallthrough
  16356. case int32(_BT_TRAIL):
  16357. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  16358. return m_XML_TOK_INVALID
  16359. default:
  16360. ptr += uintptr(1)
  16361. break
  16362. }
  16363. for int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(1)) {
  16364. switch libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr))))))) {
  16365. case int32(_BT_LEAD2):
  16366. if int64(end)-int64(ptr) < int64(2) || (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisInvalid2})))(tls, enc, ptr) != 0 {
  16367. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  16368. return int32(m_XML_TOK_DATA_CHARS)
  16369. }
  16370. ptr += uintptr(2)
  16371. case int32(_BT_LEAD3):
  16372. if int64(end)-int64(ptr) < int64(3) || (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisInvalid3})))(tls, enc, ptr) != 0 {
  16373. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  16374. return int32(m_XML_TOK_DATA_CHARS)
  16375. }
  16376. ptr += uintptr(3)
  16377. case int32(_BT_LEAD4):
  16378. if int64(end)-int64(ptr) < int64(4) || (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisInvalid4})))(tls, enc, ptr) != 0 {
  16379. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  16380. return int32(m_XML_TOK_DATA_CHARS)
  16381. }
  16382. ptr += uintptr(4)
  16383. case int32(_BT_RSQB):
  16384. if int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(2)*libc.Int32FromInt32(1)) {
  16385. if !(int32(*(*int8)(unsafe.Pointer(ptr + libc.UintptrFromInt32(1)))) == libc.Int32FromInt32(m_ASCII_RSQB1)) {
  16386. ptr += uintptr(1)
  16387. break
  16388. }
  16389. if int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(3)*libc.Int32FromInt32(1)) {
  16390. if !(int32(*(*int8)(unsafe.Pointer(ptr + uintptr(libc.Int32FromInt32(2)*libc.Int32FromInt32(1))))) == libc.Int32FromInt32(m_ASCII_GT1)) {
  16391. ptr += uintptr(1)
  16392. break
  16393. }
  16394. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(libc.Int32FromInt32(2)*libc.Int32FromInt32(1))
  16395. return m_XML_TOK_INVALID
  16396. }
  16397. }
  16398. /* fall through */
  16399. fallthrough
  16400. case int32(_BT_AMP):
  16401. fallthrough
  16402. case int32(_BT_LT):
  16403. fallthrough
  16404. case int32(_BT_NONXML):
  16405. fallthrough
  16406. case int32(_BT_MALFORM):
  16407. fallthrough
  16408. case int32(_BT_TRAIL):
  16409. fallthrough
  16410. case int32(_BT_CR):
  16411. fallthrough
  16412. case int32(_BT_LF):
  16413. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  16414. return int32(m_XML_TOK_DATA_CHARS)
  16415. default:
  16416. ptr += uintptr(1)
  16417. break
  16418. }
  16419. }
  16420. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  16421. return int32(m_XML_TOK_DATA_CHARS)
  16422. }
  16423. /* ptr points to character following "%" */
  16424. func _normal_scanPercent(tls *libc.TLS, enc uintptr, ptr uintptr, end uintptr, nextTokPtr uintptr) (r int32) {
  16425. if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(1))) {
  16426. return -int32(1)
  16427. }
  16428. switch libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr))))))) {
  16429. case int32(_BT_NONASCII):
  16430. if !(libc.Int32FromInt32(0) != 0) {
  16431. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  16432. return m_XML_TOK_INVALID
  16433. } /* fall through */
  16434. fallthrough
  16435. case int32(_BT_NMSTRT):
  16436. fallthrough
  16437. case int32(_BT_HEX):
  16438. ptr += uintptr(1)
  16439. case int32(_BT_LEAD2):
  16440. if int64(end)-int64(ptr) < int64(libc.Int32FromInt32(2)) {
  16441. return -int32(2)
  16442. }
  16443. if (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisInvalid2})))(tls, enc, ptr) != 0 || !((*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisNmstrt2})))(tls, enc, ptr) != 0) {
  16444. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  16445. return m_XML_TOK_INVALID
  16446. }
  16447. ptr += uintptr(2)
  16448. case int32(_BT_LEAD3):
  16449. if int64(end)-int64(ptr) < int64(libc.Int32FromInt32(3)) {
  16450. return -int32(2)
  16451. }
  16452. if (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisInvalid3})))(tls, enc, ptr) != 0 || !((*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisNmstrt3})))(tls, enc, ptr) != 0) {
  16453. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  16454. return m_XML_TOK_INVALID
  16455. }
  16456. ptr += uintptr(3)
  16457. case int32(_BT_LEAD4):
  16458. if int64(end)-int64(ptr) < int64(libc.Int32FromInt32(4)) {
  16459. return -int32(2)
  16460. }
  16461. if (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisInvalid4})))(tls, enc, ptr) != 0 || !((*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisNmstrt4})))(tls, enc, ptr) != 0) {
  16462. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  16463. return m_XML_TOK_INVALID
  16464. }
  16465. ptr += uintptr(4)
  16466. case int32(_BT_S):
  16467. fallthrough
  16468. case int32(_BT_LF):
  16469. fallthrough
  16470. case int32(_BT_CR):
  16471. fallthrough
  16472. case int32(_BT_PERCNT):
  16473. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  16474. return int32(m_XML_TOK_PERCENT)
  16475. default:
  16476. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  16477. return m_XML_TOK_INVALID
  16478. }
  16479. for int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(1)) {
  16480. switch libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr))))))) {
  16481. case int32(_BT_NONASCII):
  16482. if !(libc.Int32FromInt32(0) != 0) {
  16483. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  16484. return m_XML_TOK_INVALID
  16485. } /* fall through */
  16486. fallthrough
  16487. case int32(_BT_NMSTRT):
  16488. fallthrough
  16489. case int32(_BT_HEX):
  16490. fallthrough
  16491. case int32(_BT_DIGIT):
  16492. fallthrough
  16493. case int32(_BT_NAME):
  16494. fallthrough
  16495. case int32(_BT_MINUS):
  16496. ptr += uintptr(1)
  16497. case int32(_BT_LEAD2):
  16498. if int64(end)-int64(ptr) < int64(2) {
  16499. return -int32(2)
  16500. }
  16501. if (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisInvalid2})))(tls, enc, ptr) != 0 || !((*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisName2})))(tls, enc, ptr) != 0) {
  16502. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  16503. return m_XML_TOK_INVALID
  16504. }
  16505. ptr += uintptr(2)
  16506. case int32(_BT_LEAD3):
  16507. if int64(end)-int64(ptr) < int64(3) {
  16508. return -int32(2)
  16509. }
  16510. if (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisInvalid3})))(tls, enc, ptr) != 0 || !((*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisName3})))(tls, enc, ptr) != 0) {
  16511. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  16512. return m_XML_TOK_INVALID
  16513. }
  16514. ptr += uintptr(3)
  16515. case int32(_BT_LEAD4):
  16516. if int64(end)-int64(ptr) < int64(4) {
  16517. return -int32(2)
  16518. }
  16519. if (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisInvalid4})))(tls, enc, ptr) != 0 || !((*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisName4})))(tls, enc, ptr) != 0) {
  16520. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  16521. return m_XML_TOK_INVALID
  16522. }
  16523. ptr += uintptr(4)
  16524. case int32(_BT_SEMI):
  16525. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(1)
  16526. return int32(m_XML_TOK_PARAM_ENTITY_REF)
  16527. default:
  16528. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  16529. return m_XML_TOK_INVALID
  16530. }
  16531. }
  16532. return -int32(1)
  16533. }
  16534. func _normal_scanPoundName(tls *libc.TLS, enc uintptr, ptr uintptr, end uintptr, nextTokPtr uintptr) (r int32) {
  16535. if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(1))) {
  16536. return -int32(1)
  16537. }
  16538. switch libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr))))))) {
  16539. case int32(_BT_NONASCII):
  16540. if !(libc.Int32FromInt32(0) != 0) {
  16541. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  16542. return m_XML_TOK_INVALID
  16543. } /* fall through */
  16544. fallthrough
  16545. case int32(_BT_NMSTRT):
  16546. fallthrough
  16547. case int32(_BT_HEX):
  16548. ptr += uintptr(1)
  16549. case int32(_BT_LEAD2):
  16550. if int64(end)-int64(ptr) < int64(libc.Int32FromInt32(2)) {
  16551. return -int32(2)
  16552. }
  16553. if (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisInvalid2})))(tls, enc, ptr) != 0 || !((*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisNmstrt2})))(tls, enc, ptr) != 0) {
  16554. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  16555. return m_XML_TOK_INVALID
  16556. }
  16557. ptr += uintptr(2)
  16558. case int32(_BT_LEAD3):
  16559. if int64(end)-int64(ptr) < int64(libc.Int32FromInt32(3)) {
  16560. return -int32(2)
  16561. }
  16562. if (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisInvalid3})))(tls, enc, ptr) != 0 || !((*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisNmstrt3})))(tls, enc, ptr) != 0) {
  16563. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  16564. return m_XML_TOK_INVALID
  16565. }
  16566. ptr += uintptr(3)
  16567. case int32(_BT_LEAD4):
  16568. if int64(end)-int64(ptr) < int64(libc.Int32FromInt32(4)) {
  16569. return -int32(2)
  16570. }
  16571. if (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisInvalid4})))(tls, enc, ptr) != 0 || !((*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisNmstrt4})))(tls, enc, ptr) != 0) {
  16572. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  16573. return m_XML_TOK_INVALID
  16574. }
  16575. ptr += uintptr(4)
  16576. default:
  16577. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  16578. return m_XML_TOK_INVALID
  16579. }
  16580. for int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(1)) {
  16581. switch libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr))))))) {
  16582. case int32(_BT_NONASCII):
  16583. if !(libc.Int32FromInt32(0) != 0) {
  16584. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  16585. return m_XML_TOK_INVALID
  16586. } /* fall through */
  16587. fallthrough
  16588. case int32(_BT_NMSTRT):
  16589. fallthrough
  16590. case int32(_BT_HEX):
  16591. fallthrough
  16592. case int32(_BT_DIGIT):
  16593. fallthrough
  16594. case int32(_BT_NAME):
  16595. fallthrough
  16596. case int32(_BT_MINUS):
  16597. ptr += uintptr(1)
  16598. case int32(_BT_LEAD2):
  16599. if int64(end)-int64(ptr) < int64(2) {
  16600. return -int32(2)
  16601. }
  16602. if (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisInvalid2})))(tls, enc, ptr) != 0 || !((*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisName2})))(tls, enc, ptr) != 0) {
  16603. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  16604. return m_XML_TOK_INVALID
  16605. }
  16606. ptr += uintptr(2)
  16607. case int32(_BT_LEAD3):
  16608. if int64(end)-int64(ptr) < int64(3) {
  16609. return -int32(2)
  16610. }
  16611. if (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisInvalid3})))(tls, enc, ptr) != 0 || !((*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisName3})))(tls, enc, ptr) != 0) {
  16612. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  16613. return m_XML_TOK_INVALID
  16614. }
  16615. ptr += uintptr(3)
  16616. case int32(_BT_LEAD4):
  16617. if int64(end)-int64(ptr) < int64(4) {
  16618. return -int32(2)
  16619. }
  16620. if (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisInvalid4})))(tls, enc, ptr) != 0 || !((*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisName4})))(tls, enc, ptr) != 0) {
  16621. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  16622. return m_XML_TOK_INVALID
  16623. }
  16624. ptr += uintptr(4)
  16625. case int32(_BT_CR):
  16626. fallthrough
  16627. case int32(_BT_LF):
  16628. fallthrough
  16629. case int32(_BT_S):
  16630. fallthrough
  16631. case int32(_BT_RPAR):
  16632. fallthrough
  16633. case int32(_BT_GT):
  16634. fallthrough
  16635. case int32(_BT_PERCNT):
  16636. fallthrough
  16637. case int32(_BT_VERBAR):
  16638. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  16639. return int32(m_XML_TOK_POUND_NAME)
  16640. default:
  16641. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  16642. return m_XML_TOK_INVALID
  16643. }
  16644. }
  16645. return -int32(m_XML_TOK_POUND_NAME)
  16646. }
  16647. func _normal_scanLit(tls *libc.TLS, open int32, enc uintptr, ptr uintptr, end uintptr, nextTokPtr uintptr) (r int32) {
  16648. var t int32
  16649. _ = t
  16650. for int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(1)) {
  16651. t = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr)))))))
  16652. switch t {
  16653. case int32(_BT_LEAD2):
  16654. if int64(end)-int64(ptr) < int64(2) {
  16655. return -int32(2)
  16656. }
  16657. if (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisInvalid2})))(tls, enc, ptr) != 0 {
  16658. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  16659. return m_XML_TOK_INVALID
  16660. }
  16661. ptr += uintptr(2)
  16662. case int32(_BT_LEAD3):
  16663. if int64(end)-int64(ptr) < int64(3) {
  16664. return -int32(2)
  16665. }
  16666. if (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisInvalid3})))(tls, enc, ptr) != 0 {
  16667. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  16668. return m_XML_TOK_INVALID
  16669. }
  16670. ptr += uintptr(3)
  16671. case int32(_BT_LEAD4):
  16672. if int64(end)-int64(ptr) < int64(4) {
  16673. return -int32(2)
  16674. }
  16675. if (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisInvalid4})))(tls, enc, ptr) != 0 {
  16676. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  16677. return m_XML_TOK_INVALID
  16678. }
  16679. ptr += uintptr(4)
  16680. case int32(_BT_NONXML):
  16681. fallthrough
  16682. case int32(_BT_MALFORM):
  16683. fallthrough
  16684. case int32(_BT_TRAIL):
  16685. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  16686. return m_XML_TOK_INVALID
  16687. case int32(_BT_QUOT):
  16688. fallthrough
  16689. case int32(_BT_APOS):
  16690. ptr += uintptr(1)
  16691. if t != open {
  16692. break
  16693. }
  16694. if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(1))) {
  16695. return -int32(m_XML_TOK_LITERAL)
  16696. }
  16697. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  16698. switch libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr))))))) {
  16699. case int32(_BT_S):
  16700. fallthrough
  16701. case int32(_BT_CR):
  16702. fallthrough
  16703. case int32(_BT_LF):
  16704. fallthrough
  16705. case int32(_BT_GT):
  16706. fallthrough
  16707. case int32(_BT_PERCNT):
  16708. fallthrough
  16709. case int32(_BT_LSQB):
  16710. return int32(m_XML_TOK_LITERAL)
  16711. default:
  16712. return m_XML_TOK_INVALID
  16713. }
  16714. fallthrough
  16715. default:
  16716. ptr += uintptr(1)
  16717. break
  16718. }
  16719. }
  16720. return -int32(1)
  16721. }
  16722. func _normal_prologTok(tls *libc.TLS, enc uintptr, ptr uintptr, end uintptr, nextTokPtr uintptr) (r int32) {
  16723. var n Tsize_t
  16724. var tok int32
  16725. _, _ = n, tok
  16726. if ptr >= end {
  16727. return -int32(4)
  16728. }
  16729. if int32(1) > int32(1) {
  16730. n = libc.Uint64FromInt64(int64(end) - int64(ptr))
  16731. if n&libc.Uint64FromInt32(libc.Int32FromInt32(1)-libc.Int32FromInt32(1)) != 0 {
  16732. n &= libc.Uint64FromInt32(^(libc.Int32FromInt32(1) - libc.Int32FromInt32(1)))
  16733. if n == uint64(0) {
  16734. return -int32(1)
  16735. }
  16736. end = ptr + uintptr(n)
  16737. }
  16738. }
  16739. switch libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr))))))) {
  16740. case int32(_BT_QUOT):
  16741. goto _1
  16742. case int32(_BT_APOS):
  16743. goto _2
  16744. case int32(_BT_LT):
  16745. goto _3
  16746. case int32(_BT_CR):
  16747. goto _4
  16748. case int32(_BT_LF):
  16749. goto _5
  16750. case int32(_BT_S):
  16751. goto _6
  16752. case int32(_BT_PERCNT):
  16753. goto _7
  16754. case int32(_BT_COMMA):
  16755. goto _8
  16756. case int32(_BT_LSQB):
  16757. goto _9
  16758. case int32(_BT_RSQB):
  16759. goto _10
  16760. case int32(_BT_LPAR):
  16761. goto _11
  16762. case int32(_BT_RPAR):
  16763. goto _12
  16764. case int32(_BT_VERBAR):
  16765. goto _13
  16766. case int32(_BT_GT):
  16767. goto _14
  16768. case int32(_BT_NUM):
  16769. goto _15
  16770. case int32(_BT_LEAD2):
  16771. goto _16
  16772. case int32(_BT_LEAD3):
  16773. goto _17
  16774. case int32(_BT_LEAD4):
  16775. goto _18
  16776. case int32(_BT_HEX):
  16777. goto _19
  16778. case int32(_BT_NMSTRT):
  16779. goto _20
  16780. case int32(_BT_COLON):
  16781. goto _21
  16782. case int32(_BT_MINUS):
  16783. goto _22
  16784. case int32(_BT_NAME):
  16785. goto _23
  16786. case int32(_BT_DIGIT):
  16787. goto _24
  16788. case int32(_BT_NONASCII):
  16789. goto _25
  16790. default:
  16791. goto _26
  16792. }
  16793. goto _27
  16794. _1:
  16795. ;
  16796. return _normal_scanLit(tls, int32(_BT_QUOT), enc, ptr+uintptr(1), end, nextTokPtr)
  16797. _2:
  16798. ;
  16799. return _normal_scanLit(tls, int32(_BT_APOS), enc, ptr+uintptr(1), end, nextTokPtr)
  16800. _3:
  16801. ;
  16802. ptr += uintptr(1)
  16803. if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(1))) {
  16804. return -int32(1)
  16805. }
  16806. switch libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr))))))) {
  16807. case int32(_BT_EXCL):
  16808. return _normal_scanDecl(tls, enc, ptr+uintptr(1), end, nextTokPtr)
  16809. case int32(_BT_QUEST):
  16810. return _normal_scanPi(tls, enc, ptr+uintptr(1), end, nextTokPtr)
  16811. case int32(_BT_NMSTRT):
  16812. fallthrough
  16813. case int32(_BT_HEX):
  16814. fallthrough
  16815. case int32(_BT_NONASCII):
  16816. fallthrough
  16817. case int32(_BT_LEAD2):
  16818. fallthrough
  16819. case int32(_BT_LEAD3):
  16820. fallthrough
  16821. case int32(_BT_LEAD4):
  16822. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr - uintptr(1)
  16823. return int32(m_XML_TOK_INSTANCE_START)
  16824. }
  16825. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  16826. return m_XML_TOK_INVALID
  16827. _4:
  16828. ;
  16829. if ptr+uintptr(1) == end {
  16830. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = end
  16831. /* indicate that this might be part of a CR/LF pair */
  16832. return -int32(m_XML_TOK_PROLOG_S)
  16833. }
  16834. /* fall through */
  16835. _6:
  16836. ;
  16837. _5:
  16838. ;
  16839. _30:
  16840. ;
  16841. ptr += uintptr(1)
  16842. if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(1))) {
  16843. goto _28
  16844. }
  16845. switch libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr))))))) {
  16846. case int32(_BT_S):
  16847. fallthrough
  16848. case int32(_BT_LF):
  16849. case int32(_BT_CR):
  16850. /* don't split CR/LF pair */
  16851. if ptr+uintptr(1) != end {
  16852. break
  16853. }
  16854. /* fall through */
  16855. fallthrough
  16856. default:
  16857. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  16858. return int32(m_XML_TOK_PROLOG_S)
  16859. }
  16860. goto _29
  16861. _29:
  16862. ;
  16863. goto _30
  16864. goto _28
  16865. _28:
  16866. ;
  16867. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  16868. return int32(m_XML_TOK_PROLOG_S)
  16869. _7:
  16870. ;
  16871. return _normal_scanPercent(tls, enc, ptr+uintptr(1), end, nextTokPtr)
  16872. _8:
  16873. ;
  16874. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(1)
  16875. return int32(m_XML_TOK_COMMA)
  16876. _9:
  16877. ;
  16878. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(1)
  16879. return int32(m_XML_TOK_OPEN_BRACKET)
  16880. _10:
  16881. ;
  16882. ptr += uintptr(1)
  16883. if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(1))) {
  16884. return -int32(m_XML_TOK_CLOSE_BRACKET)
  16885. }
  16886. if int32(*(*int8)(unsafe.Pointer(ptr))) == int32(m_ASCII_RSQB1) {
  16887. if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(2)*libc.Int32FromInt32(1))) {
  16888. return -int32(1)
  16889. }
  16890. if int32(*(*int8)(unsafe.Pointer(ptr + libc.UintptrFromInt32(1)))) == int32(m_ASCII_GT1) {
  16891. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(libc.Int32FromInt32(2)*libc.Int32FromInt32(1))
  16892. return int32(m_XML_TOK_COND_SECT_CLOSE)
  16893. }
  16894. }
  16895. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  16896. return int32(m_XML_TOK_CLOSE_BRACKET)
  16897. _11:
  16898. ;
  16899. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(1)
  16900. return int32(m_XML_TOK_OPEN_PAREN)
  16901. _12:
  16902. ;
  16903. ptr += uintptr(1)
  16904. if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(1))) {
  16905. return -int32(m_XML_TOK_CLOSE_PAREN)
  16906. }
  16907. switch libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr))))))) {
  16908. case int32(_BT_AST):
  16909. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(1)
  16910. return int32(m_XML_TOK_CLOSE_PAREN_ASTERISK)
  16911. case int32(_BT_QUEST):
  16912. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(1)
  16913. return int32(m_XML_TOK_CLOSE_PAREN_QUESTION)
  16914. case int32(_BT_PLUS):
  16915. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(1)
  16916. return int32(m_XML_TOK_CLOSE_PAREN_PLUS)
  16917. case int32(_BT_CR):
  16918. fallthrough
  16919. case int32(_BT_LF):
  16920. fallthrough
  16921. case int32(_BT_S):
  16922. fallthrough
  16923. case int32(_BT_GT):
  16924. fallthrough
  16925. case int32(_BT_COMMA):
  16926. fallthrough
  16927. case int32(_BT_VERBAR):
  16928. fallthrough
  16929. case int32(_BT_RPAR):
  16930. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  16931. return int32(m_XML_TOK_CLOSE_PAREN)
  16932. }
  16933. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  16934. return m_XML_TOK_INVALID
  16935. _13:
  16936. ;
  16937. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(1)
  16938. return int32(m_XML_TOK_OR)
  16939. _14:
  16940. ;
  16941. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(1)
  16942. return int32(m_XML_TOK_DECL_CLOSE)
  16943. _15:
  16944. ;
  16945. return _normal_scanPoundName(tls, enc, ptr+uintptr(1), end, nextTokPtr)
  16946. _16:
  16947. ;
  16948. if int64(end)-int64(ptr) < int64(2) {
  16949. return -int32(2)
  16950. }
  16951. if (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisInvalid2})))(tls, enc, ptr) != 0 {
  16952. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  16953. return m_XML_TOK_INVALID
  16954. }
  16955. if (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisNmstrt2})))(tls, enc, ptr) != 0 {
  16956. ptr += uintptr(2)
  16957. tok = int32(m_XML_TOK_NAME)
  16958. goto _27
  16959. }
  16960. if (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisName2})))(tls, enc, ptr) != 0 {
  16961. ptr += uintptr(2)
  16962. tok = int32(m_XML_TOK_NMTOKEN)
  16963. goto _27
  16964. }
  16965. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  16966. return m_XML_TOK_INVALID
  16967. _17:
  16968. ;
  16969. if int64(end)-int64(ptr) < int64(3) {
  16970. return -int32(2)
  16971. }
  16972. if (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisInvalid3})))(tls, enc, ptr) != 0 {
  16973. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  16974. return m_XML_TOK_INVALID
  16975. }
  16976. if (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisNmstrt3})))(tls, enc, ptr) != 0 {
  16977. ptr += uintptr(3)
  16978. tok = int32(m_XML_TOK_NAME)
  16979. goto _27
  16980. }
  16981. if (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisName3})))(tls, enc, ptr) != 0 {
  16982. ptr += uintptr(3)
  16983. tok = int32(m_XML_TOK_NMTOKEN)
  16984. goto _27
  16985. }
  16986. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  16987. return m_XML_TOK_INVALID
  16988. _18:
  16989. ;
  16990. if int64(end)-int64(ptr) < int64(4) {
  16991. return -int32(2)
  16992. }
  16993. if (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisInvalid4})))(tls, enc, ptr) != 0 {
  16994. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  16995. return m_XML_TOK_INVALID
  16996. }
  16997. if (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisNmstrt4})))(tls, enc, ptr) != 0 {
  16998. ptr += uintptr(4)
  16999. tok = int32(m_XML_TOK_NAME)
  17000. goto _27
  17001. }
  17002. if (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisName4})))(tls, enc, ptr) != 0 {
  17003. ptr += uintptr(4)
  17004. tok = int32(m_XML_TOK_NMTOKEN)
  17005. goto _27
  17006. }
  17007. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  17008. return m_XML_TOK_INVALID
  17009. _20:
  17010. ;
  17011. _19:
  17012. ;
  17013. tok = int32(m_XML_TOK_NAME)
  17014. ptr += uintptr(1)
  17015. goto _27
  17016. _24:
  17017. ;
  17018. _23:
  17019. ;
  17020. _22:
  17021. ;
  17022. _21:
  17023. ;
  17024. tok = int32(m_XML_TOK_NMTOKEN)
  17025. ptr += uintptr(1)
  17026. goto _27
  17027. _25:
  17028. ;
  17029. if 0 != 0 {
  17030. ptr += uintptr(1)
  17031. tok = int32(m_XML_TOK_NAME)
  17032. goto _27
  17033. }
  17034. if 0 != 0 {
  17035. ptr += uintptr(1)
  17036. tok = int32(m_XML_TOK_NMTOKEN)
  17037. goto _27
  17038. }
  17039. /* fall through */
  17040. _26:
  17041. ;
  17042. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  17043. return m_XML_TOK_INVALID
  17044. _27:
  17045. ;
  17046. for int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(1)) {
  17047. switch libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr))))))) {
  17048. case int32(_BT_NONASCII):
  17049. if !(libc.Int32FromInt32(0) != 0) {
  17050. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  17051. return m_XML_TOK_INVALID
  17052. } /* fall through */
  17053. fallthrough
  17054. case int32(_BT_NMSTRT):
  17055. fallthrough
  17056. case int32(_BT_HEX):
  17057. fallthrough
  17058. case int32(_BT_DIGIT):
  17059. fallthrough
  17060. case int32(_BT_NAME):
  17061. fallthrough
  17062. case int32(_BT_MINUS):
  17063. ptr += uintptr(1)
  17064. case int32(_BT_LEAD2):
  17065. if int64(end)-int64(ptr) < int64(2) {
  17066. return -int32(2)
  17067. }
  17068. if (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisInvalid2})))(tls, enc, ptr) != 0 || !((*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisName2})))(tls, enc, ptr) != 0) {
  17069. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  17070. return m_XML_TOK_INVALID
  17071. }
  17072. ptr += uintptr(2)
  17073. case int32(_BT_LEAD3):
  17074. if int64(end)-int64(ptr) < int64(3) {
  17075. return -int32(2)
  17076. }
  17077. if (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisInvalid3})))(tls, enc, ptr) != 0 || !((*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisName3})))(tls, enc, ptr) != 0) {
  17078. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  17079. return m_XML_TOK_INVALID
  17080. }
  17081. ptr += uintptr(3)
  17082. case int32(_BT_LEAD4):
  17083. if int64(end)-int64(ptr) < int64(4) {
  17084. return -int32(2)
  17085. }
  17086. if (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisInvalid4})))(tls, enc, ptr) != 0 || !((*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisName4})))(tls, enc, ptr) != 0) {
  17087. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  17088. return m_XML_TOK_INVALID
  17089. }
  17090. ptr += uintptr(4)
  17091. case int32(_BT_GT):
  17092. fallthrough
  17093. case int32(_BT_RPAR):
  17094. fallthrough
  17095. case int32(_BT_COMMA):
  17096. fallthrough
  17097. case int32(_BT_VERBAR):
  17098. fallthrough
  17099. case int32(_BT_LSQB):
  17100. fallthrough
  17101. case int32(_BT_PERCNT):
  17102. fallthrough
  17103. case int32(_BT_S):
  17104. fallthrough
  17105. case int32(_BT_CR):
  17106. fallthrough
  17107. case int32(_BT_LF):
  17108. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  17109. return tok
  17110. case int32(_BT_COLON):
  17111. ptr += uintptr(1)
  17112. switch tok {
  17113. case int32(m_XML_TOK_NAME):
  17114. if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(1))) {
  17115. return -int32(1)
  17116. }
  17117. tok = int32(m_XML_TOK_PREFIXED_NAME)
  17118. switch libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr))))))) {
  17119. case int32(_BT_NONASCII):
  17120. if !(libc.Int32FromInt32(0) != 0) {
  17121. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  17122. return m_XML_TOK_INVALID
  17123. } /* fall through */
  17124. fallthrough
  17125. case int32(_BT_NMSTRT):
  17126. fallthrough
  17127. case int32(_BT_HEX):
  17128. fallthrough
  17129. case int32(_BT_DIGIT):
  17130. fallthrough
  17131. case int32(_BT_NAME):
  17132. fallthrough
  17133. case int32(_BT_MINUS):
  17134. ptr += uintptr(1)
  17135. case int32(_BT_LEAD2):
  17136. if int64(end)-int64(ptr) < int64(2) {
  17137. return -int32(2)
  17138. }
  17139. if (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisInvalid2})))(tls, enc, ptr) != 0 || !((*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisName2})))(tls, enc, ptr) != 0) {
  17140. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  17141. return m_XML_TOK_INVALID
  17142. }
  17143. ptr += uintptr(2)
  17144. case int32(_BT_LEAD3):
  17145. if int64(end)-int64(ptr) < int64(3) {
  17146. return -int32(2)
  17147. }
  17148. if (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisInvalid3})))(tls, enc, ptr) != 0 || !((*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisName3})))(tls, enc, ptr) != 0) {
  17149. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  17150. return m_XML_TOK_INVALID
  17151. }
  17152. ptr += uintptr(3)
  17153. case int32(_BT_LEAD4):
  17154. if int64(end)-int64(ptr) < int64(4) {
  17155. return -int32(2)
  17156. }
  17157. if (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisInvalid4})))(tls, enc, ptr) != 0 || !((*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisName4})))(tls, enc, ptr) != 0) {
  17158. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  17159. return m_XML_TOK_INVALID
  17160. }
  17161. ptr += uintptr(4)
  17162. default:
  17163. tok = int32(m_XML_TOK_NMTOKEN)
  17164. break
  17165. }
  17166. case int32(m_XML_TOK_PREFIXED_NAME):
  17167. tok = int32(m_XML_TOK_NMTOKEN)
  17168. break
  17169. }
  17170. case int32(_BT_PLUS):
  17171. if tok == int32(m_XML_TOK_NMTOKEN) {
  17172. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  17173. return m_XML_TOK_INVALID
  17174. }
  17175. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(1)
  17176. return int32(m_XML_TOK_NAME_PLUS)
  17177. case int32(_BT_AST):
  17178. if tok == int32(m_XML_TOK_NMTOKEN) {
  17179. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  17180. return m_XML_TOK_INVALID
  17181. }
  17182. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(1)
  17183. return int32(m_XML_TOK_NAME_ASTERISK)
  17184. case int32(_BT_QUEST):
  17185. if tok == int32(m_XML_TOK_NMTOKEN) {
  17186. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  17187. return m_XML_TOK_INVALID
  17188. }
  17189. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(1)
  17190. return int32(m_XML_TOK_NAME_QUESTION)
  17191. default:
  17192. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  17193. return m_XML_TOK_INVALID
  17194. }
  17195. }
  17196. return -tok
  17197. }
  17198. func _normal_attributeValueTok(tls *libc.TLS, enc uintptr, ptr uintptr, end uintptr, nextTokPtr uintptr) (r int32) {
  17199. var start uintptr
  17200. _ = start
  17201. if ptr >= end {
  17202. return -int32(4)
  17203. } else {
  17204. if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(1))) {
  17205. /* This line cannot be executed. The incoming data has already
  17206. * been tokenized once, so incomplete characters like this have
  17207. * already been eliminated from the input. Retaining the paranoia
  17208. * check is still valuable, however.
  17209. */
  17210. return -int32(1) /* LCOV_EXCL_LINE */
  17211. }
  17212. }
  17213. start = ptr
  17214. for int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(1)) {
  17215. switch libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr))))))) {
  17216. case int32(_BT_LEAD2):
  17217. ptr += uintptr(2) /* NOTE: The encoding has already been validated. */
  17218. case int32(_BT_LEAD3):
  17219. ptr += uintptr(3) /* NOTE: The encoding has already been validated. */
  17220. case int32(_BT_LEAD4):
  17221. ptr += uintptr(4) /* NOTE: The encoding has already been validated. */
  17222. case int32(_BT_AMP):
  17223. if ptr == start {
  17224. return _normal_scanRef(tls, enc, ptr+uintptr(1), end, nextTokPtr)
  17225. }
  17226. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  17227. return int32(m_XML_TOK_DATA_CHARS)
  17228. case int32(_BT_LT):
  17229. /* this is for inside entity references */
  17230. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  17231. return m_XML_TOK_INVALID
  17232. case int32(_BT_LF):
  17233. if ptr == start {
  17234. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(1)
  17235. return int32(m_XML_TOK_DATA_NEWLINE)
  17236. }
  17237. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  17238. return int32(m_XML_TOK_DATA_CHARS)
  17239. case int32(_BT_CR):
  17240. if ptr == start {
  17241. ptr += uintptr(1)
  17242. if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(1))) {
  17243. return -int32(3)
  17244. }
  17245. if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr))))))) == int32(_BT_LF) {
  17246. ptr += uintptr(1)
  17247. }
  17248. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  17249. return int32(m_XML_TOK_DATA_NEWLINE)
  17250. }
  17251. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  17252. return int32(m_XML_TOK_DATA_CHARS)
  17253. case int32(_BT_S):
  17254. if ptr == start {
  17255. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(1)
  17256. return int32(m_XML_TOK_ATTRIBUTE_VALUE_S)
  17257. }
  17258. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  17259. return int32(m_XML_TOK_DATA_CHARS)
  17260. default:
  17261. ptr += uintptr(1)
  17262. break
  17263. }
  17264. }
  17265. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  17266. return int32(m_XML_TOK_DATA_CHARS)
  17267. }
  17268. func _normal_entityValueTok(tls *libc.TLS, enc uintptr, ptr uintptr, end uintptr, nextTokPtr uintptr) (r int32) {
  17269. var start uintptr
  17270. var tok, v1 int32
  17271. _, _, _ = start, tok, v1
  17272. if ptr >= end {
  17273. return -int32(4)
  17274. } else {
  17275. if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(1))) {
  17276. /* This line cannot be executed. The incoming data has already
  17277. * been tokenized once, so incomplete characters like this have
  17278. * already been eliminated from the input. Retaining the paranoia
  17279. * check is still valuable, however.
  17280. */
  17281. return -int32(1) /* LCOV_EXCL_LINE */
  17282. }
  17283. }
  17284. start = ptr
  17285. for int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(1)) {
  17286. switch libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr))))))) {
  17287. case int32(_BT_LEAD2):
  17288. ptr += uintptr(2) /* NOTE: The encoding has already been validated. */
  17289. case int32(_BT_LEAD3):
  17290. ptr += uintptr(3) /* NOTE: The encoding has already been validated. */
  17291. case int32(_BT_LEAD4):
  17292. ptr += uintptr(4) /* NOTE: The encoding has already been validated. */
  17293. case int32(_BT_AMP):
  17294. if ptr == start {
  17295. return _normal_scanRef(tls, enc, ptr+uintptr(1), end, nextTokPtr)
  17296. }
  17297. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  17298. return int32(m_XML_TOK_DATA_CHARS)
  17299. case int32(_BT_PERCNT):
  17300. if ptr == start {
  17301. tok = _normal_scanPercent(tls, enc, ptr+uintptr(1), end, nextTokPtr)
  17302. if tok == int32(m_XML_TOK_PERCENT) {
  17303. v1 = m_XML_TOK_INVALID
  17304. } else {
  17305. v1 = tok
  17306. }
  17307. return v1
  17308. }
  17309. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  17310. return int32(m_XML_TOK_DATA_CHARS)
  17311. case int32(_BT_LF):
  17312. if ptr == start {
  17313. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(1)
  17314. return int32(m_XML_TOK_DATA_NEWLINE)
  17315. }
  17316. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  17317. return int32(m_XML_TOK_DATA_CHARS)
  17318. case int32(_BT_CR):
  17319. if ptr == start {
  17320. ptr += uintptr(1)
  17321. if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(1))) {
  17322. return -int32(3)
  17323. }
  17324. if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr))))))) == int32(_BT_LF) {
  17325. ptr += uintptr(1)
  17326. }
  17327. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  17328. return int32(m_XML_TOK_DATA_NEWLINE)
  17329. }
  17330. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  17331. return int32(m_XML_TOK_DATA_CHARS)
  17332. default:
  17333. ptr += uintptr(1)
  17334. break
  17335. }
  17336. }
  17337. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  17338. return int32(m_XML_TOK_DATA_CHARS)
  17339. }
  17340. func _normal_ignoreSectionTok(tls *libc.TLS, enc uintptr, ptr uintptr, end uintptr, nextTokPtr uintptr) (r int32) {
  17341. var level int32
  17342. var n Tsize_t
  17343. _, _ = level, n
  17344. level = 0
  17345. if int32(1) > int32(1) {
  17346. n = libc.Uint64FromInt64(int64(end) - int64(ptr))
  17347. if n&libc.Uint64FromInt32(libc.Int32FromInt32(1)-libc.Int32FromInt32(1)) != 0 {
  17348. n &= libc.Uint64FromInt32(^(libc.Int32FromInt32(1) - libc.Int32FromInt32(1)))
  17349. end = ptr + uintptr(n)
  17350. }
  17351. }
  17352. for int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(1)) {
  17353. switch libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr))))))) {
  17354. case int32(_BT_LEAD2):
  17355. if int64(end)-int64(ptr) < int64(2) {
  17356. return -int32(2)
  17357. }
  17358. if (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisInvalid2})))(tls, enc, ptr) != 0 {
  17359. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  17360. return m_XML_TOK_INVALID
  17361. }
  17362. ptr += uintptr(2)
  17363. case int32(_BT_LEAD3):
  17364. if int64(end)-int64(ptr) < int64(3) {
  17365. return -int32(2)
  17366. }
  17367. if (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisInvalid3})))(tls, enc, ptr) != 0 {
  17368. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  17369. return m_XML_TOK_INVALID
  17370. }
  17371. ptr += uintptr(3)
  17372. case int32(_BT_LEAD4):
  17373. if int64(end)-int64(ptr) < int64(4) {
  17374. return -int32(2)
  17375. }
  17376. if (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisInvalid4})))(tls, enc, ptr) != 0 {
  17377. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  17378. return m_XML_TOK_INVALID
  17379. }
  17380. ptr += uintptr(4)
  17381. case int32(_BT_NONXML):
  17382. fallthrough
  17383. case int32(_BT_MALFORM):
  17384. fallthrough
  17385. case int32(_BT_TRAIL):
  17386. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  17387. return m_XML_TOK_INVALID
  17388. case int32(_BT_LT):
  17389. ptr += uintptr(1)
  17390. if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(1))) {
  17391. return -int32(1)
  17392. }
  17393. if int32(*(*int8)(unsafe.Pointer(ptr))) == int32(m_ASCII_EXCL2) {
  17394. ptr += uintptr(1)
  17395. if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(1))) {
  17396. return -int32(1)
  17397. }
  17398. if int32(*(*int8)(unsafe.Pointer(ptr))) == int32(m_ASCII_LSQB1) {
  17399. level++
  17400. ptr += uintptr(1)
  17401. }
  17402. }
  17403. case int32(_BT_RSQB):
  17404. ptr += uintptr(1)
  17405. if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(1))) {
  17406. return -int32(1)
  17407. }
  17408. if int32(*(*int8)(unsafe.Pointer(ptr))) == int32(m_ASCII_RSQB1) {
  17409. ptr += uintptr(1)
  17410. if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(1))) {
  17411. return -int32(1)
  17412. }
  17413. if int32(*(*int8)(unsafe.Pointer(ptr))) == int32(m_ASCII_GT1) {
  17414. ptr += uintptr(1)
  17415. if level == 0 {
  17416. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  17417. return int32(m_XML_TOK_IGNORE_SECT)
  17418. }
  17419. level--
  17420. }
  17421. }
  17422. default:
  17423. ptr += uintptr(1)
  17424. break
  17425. }
  17426. }
  17427. return -int32(1)
  17428. }
  17429. func _normal_isPublicId(tls *libc.TLS, enc uintptr, ptr uintptr, end uintptr, badPtr uintptr) (r int32) {
  17430. ptr += uintptr(1)
  17431. end -= uintptr(1)
  17432. for {
  17433. if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(1))) {
  17434. break
  17435. }
  17436. switch libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr))))))) {
  17437. case int32(_BT_DIGIT):
  17438. fallthrough
  17439. case int32(_BT_HEX):
  17440. fallthrough
  17441. case int32(_BT_MINUS):
  17442. fallthrough
  17443. case int32(_BT_APOS):
  17444. fallthrough
  17445. case int32(_BT_LPAR):
  17446. fallthrough
  17447. case int32(_BT_RPAR):
  17448. fallthrough
  17449. case int32(_BT_PLUS):
  17450. fallthrough
  17451. case int32(_BT_COMMA):
  17452. fallthrough
  17453. case int32(_BT_SOL):
  17454. fallthrough
  17455. case int32(_BT_EQUALS):
  17456. fallthrough
  17457. case int32(_BT_QUEST):
  17458. fallthrough
  17459. case int32(_BT_CR):
  17460. fallthrough
  17461. case int32(_BT_LF):
  17462. fallthrough
  17463. case int32(_BT_SEMI):
  17464. fallthrough
  17465. case int32(_BT_EXCL):
  17466. fallthrough
  17467. case int32(_BT_AST):
  17468. fallthrough
  17469. case int32(_BT_PERCNT):
  17470. fallthrough
  17471. case int32(_BT_NUM):
  17472. fallthrough
  17473. case int32(_BT_COLON):
  17474. case int32(_BT_S):
  17475. if int32(*(*int8)(unsafe.Pointer(ptr))) == int32(m_ASCII_TAB1) {
  17476. *(*uintptr)(unsafe.Pointer(badPtr)) = ptr
  17477. return 0
  17478. }
  17479. case int32(_BT_NAME):
  17480. fallthrough
  17481. case int32(_BT_NMSTRT):
  17482. if !(int32(*(*int8)(unsafe.Pointer(ptr))) & ^libc.Int32FromInt32(0x7f) != 0) {
  17483. break
  17484. }
  17485. /* fall through */
  17486. fallthrough
  17487. default:
  17488. switch int32(*(*int8)(unsafe.Pointer(ptr))) {
  17489. case int32(0x24): /* $ */
  17490. fallthrough
  17491. case int32(0x40): /* @ */
  17492. default:
  17493. *(*uintptr)(unsafe.Pointer(badPtr)) = ptr
  17494. return 0
  17495. }
  17496. break
  17497. }
  17498. goto _1
  17499. _1:
  17500. ;
  17501. ptr += uintptr(1)
  17502. }
  17503. return int32(1)
  17504. }
  17505. /* This must only be called for a well-formed start-tag or empty
  17506. element tag. Returns the number of attributes. Pointers to the
  17507. first attsMax attributes are stored in atts.
  17508. */
  17509. func _normal_getAtts(tls *libc.TLS, enc uintptr, ptr uintptr, attsMax int32, atts uintptr) (r int32) {
  17510. var nAtts, open, state int32
  17511. _, _, _ = nAtts, open, state
  17512. state = 1
  17513. nAtts = 0
  17514. open = 0 /* defined when state == inValue;
  17515. initialization just to shut up compilers */
  17516. ptr += uintptr(1)
  17517. for {
  17518. switch libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr))))))) {
  17519. case int32(_BT_LEAD2):
  17520. if state == 0 {
  17521. if nAtts < attsMax {
  17522. (*(*TATTRIBUTE)(unsafe.Pointer(atts + uintptr(nAtts)*32))).Fname = ptr
  17523. (*(*TATTRIBUTE)(unsafe.Pointer(atts + uintptr(nAtts)*32))).Fnormalized = int8(1)
  17524. }
  17525. state = 1
  17526. }
  17527. ptr += uintptr(libc.Int32FromInt32(2) - libc.Int32FromInt32(1))
  17528. case int32(_BT_LEAD3):
  17529. if state == 0 {
  17530. if nAtts < attsMax {
  17531. (*(*TATTRIBUTE)(unsafe.Pointer(atts + uintptr(nAtts)*32))).Fname = ptr
  17532. (*(*TATTRIBUTE)(unsafe.Pointer(atts + uintptr(nAtts)*32))).Fnormalized = int8(1)
  17533. }
  17534. state = 1
  17535. }
  17536. ptr += uintptr(libc.Int32FromInt32(3) - libc.Int32FromInt32(1))
  17537. case int32(_BT_LEAD4):
  17538. if state == 0 {
  17539. if nAtts < attsMax {
  17540. (*(*TATTRIBUTE)(unsafe.Pointer(atts + uintptr(nAtts)*32))).Fname = ptr
  17541. (*(*TATTRIBUTE)(unsafe.Pointer(atts + uintptr(nAtts)*32))).Fnormalized = int8(1)
  17542. }
  17543. state = 1
  17544. }
  17545. ptr += uintptr(libc.Int32FromInt32(4) - libc.Int32FromInt32(1))
  17546. case int32(_BT_NONASCII):
  17547. fallthrough
  17548. case int32(_BT_NMSTRT):
  17549. fallthrough
  17550. case int32(_BT_HEX):
  17551. if state == 0 {
  17552. if nAtts < attsMax {
  17553. (*(*TATTRIBUTE)(unsafe.Pointer(atts + uintptr(nAtts)*32))).Fname = ptr
  17554. (*(*TATTRIBUTE)(unsafe.Pointer(atts + uintptr(nAtts)*32))).Fnormalized = int8(1)
  17555. }
  17556. state = 1
  17557. }
  17558. case int32(_BT_QUOT):
  17559. if state != 2 {
  17560. if nAtts < attsMax {
  17561. (*(*TATTRIBUTE)(unsafe.Pointer(atts + uintptr(nAtts)*32))).FvaluePtr = ptr + uintptr(1)
  17562. }
  17563. state = 2
  17564. open = int32(_BT_QUOT)
  17565. } else {
  17566. if open == int32(_BT_QUOT) {
  17567. state = 0
  17568. if nAtts < attsMax {
  17569. (*(*TATTRIBUTE)(unsafe.Pointer(atts + uintptr(nAtts)*32))).FvalueEnd = ptr
  17570. }
  17571. nAtts++
  17572. }
  17573. }
  17574. case int32(_BT_APOS):
  17575. if state != 2 {
  17576. if nAtts < attsMax {
  17577. (*(*TATTRIBUTE)(unsafe.Pointer(atts + uintptr(nAtts)*32))).FvaluePtr = ptr + uintptr(1)
  17578. }
  17579. state = 2
  17580. open = int32(_BT_APOS)
  17581. } else {
  17582. if open == int32(_BT_APOS) {
  17583. state = 0
  17584. if nAtts < attsMax {
  17585. (*(*TATTRIBUTE)(unsafe.Pointer(atts + uintptr(nAtts)*32))).FvalueEnd = ptr
  17586. }
  17587. nAtts++
  17588. }
  17589. }
  17590. case int32(_BT_AMP):
  17591. if nAtts < attsMax {
  17592. (*(*TATTRIBUTE)(unsafe.Pointer(atts + uintptr(nAtts)*32))).Fnormalized = 0
  17593. }
  17594. case int32(_BT_S):
  17595. if state == 1 {
  17596. state = 0
  17597. } else {
  17598. if state == 2 && nAtts < attsMax && (*(*TATTRIBUTE)(unsafe.Pointer(atts + uintptr(nAtts)*32))).Fnormalized != 0 && (ptr == (*(*TATTRIBUTE)(unsafe.Pointer(atts + uintptr(nAtts)*32))).FvaluePtr || int32(*(*int8)(unsafe.Pointer(ptr))) != int32(m_ASCII_SPACE1) || int32(*(*int8)(unsafe.Pointer(ptr + libc.UintptrFromInt32(1)))) == int32(m_ASCII_SPACE1) || libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr + libc.UintptrFromInt32(1)))))))) == open) {
  17599. (*(*TATTRIBUTE)(unsafe.Pointer(atts + uintptr(nAtts)*32))).Fnormalized = 0
  17600. }
  17601. }
  17602. case int32(_BT_CR):
  17603. fallthrough
  17604. case int32(_BT_LF):
  17605. /* This case ensures that the first attribute name is counted
  17606. Apart from that we could just change state on the quote. */
  17607. if state == 1 {
  17608. state = 0
  17609. } else {
  17610. if state == 2 && nAtts < attsMax {
  17611. (*(*TATTRIBUTE)(unsafe.Pointer(atts + uintptr(nAtts)*32))).Fnormalized = 0
  17612. }
  17613. }
  17614. case int32(_BT_GT):
  17615. fallthrough
  17616. case int32(_BT_SOL):
  17617. if state != 2 {
  17618. return nAtts
  17619. }
  17620. default:
  17621. break
  17622. }
  17623. goto _1
  17624. _1:
  17625. ;
  17626. ptr += uintptr(1)
  17627. }
  17628. /* not reached */
  17629. return r
  17630. }
  17631. func _normal_charRefNumber(tls *libc.TLS, enc uintptr, ptr uintptr) (r int32) {
  17632. var c, c1, result int32
  17633. _, _, _ = c, c1, result
  17634. result = 0
  17635. /* skip &# */
  17636. _ = enc
  17637. ptr += uintptr(libc.Int32FromInt32(2) * libc.Int32FromInt32(1))
  17638. if int32(*(*int8)(unsafe.Pointer(ptr))) == int32(m_ASCII_x2) {
  17639. ptr += uintptr(1)
  17640. for {
  17641. if !!(int32(*(*int8)(unsafe.Pointer(ptr))) == libc.Int32FromInt32(m_ASCII_SEMI1)) {
  17642. break
  17643. }
  17644. c = int32(*(*int8)(unsafe.Pointer(ptr)))
  17645. switch c {
  17646. case int32(m_ASCII_02):
  17647. fallthrough
  17648. case int32(m_ASCII_12):
  17649. fallthrough
  17650. case int32(m_ASCII_22):
  17651. fallthrough
  17652. case int32(m_ASCII_32):
  17653. fallthrough
  17654. case int32(m_ASCII_41):
  17655. fallthrough
  17656. case int32(m_ASCII_51):
  17657. fallthrough
  17658. case int32(m_ASCII_61):
  17659. fallthrough
  17660. case int32(m_ASCII_71):
  17661. fallthrough
  17662. case int32(m_ASCII_82):
  17663. fallthrough
  17664. case int32(m_ASCII_92):
  17665. result <<= int32(4)
  17666. result |= c - int32(m_ASCII_02)
  17667. case int32(m_ASCII_A):
  17668. fallthrough
  17669. case int32(m_ASCII_B1):
  17670. fallthrough
  17671. case int32(m_ASCII_C):
  17672. fallthrough
  17673. case int32(m_ASCII_D):
  17674. fallthrough
  17675. case int32(m_ASCII_E):
  17676. fallthrough
  17677. case int32(m_ASCII_F):
  17678. result <<= int32(4)
  17679. result += int32(10) + (c - int32(m_ASCII_A))
  17680. case int32(m_ASCII_a2):
  17681. fallthrough
  17682. case int32(m_ASCII_b1):
  17683. fallthrough
  17684. case int32(m_ASCII_c2):
  17685. fallthrough
  17686. case int32(m_ASCII_d1):
  17687. fallthrough
  17688. case int32(m_ASCII_e2):
  17689. fallthrough
  17690. case int32(m_ASCII_f1):
  17691. result <<= int32(4)
  17692. result += int32(10) + (c - int32(m_ASCII_a2))
  17693. break
  17694. }
  17695. if result >= int32(0x110000) {
  17696. return -int32(1)
  17697. }
  17698. goto _1
  17699. _1:
  17700. ;
  17701. ptr += uintptr(1)
  17702. }
  17703. } else {
  17704. for {
  17705. if !!(int32(*(*int8)(unsafe.Pointer(ptr))) == libc.Int32FromInt32(m_ASCII_SEMI1)) {
  17706. break
  17707. }
  17708. c1 = int32(*(*int8)(unsafe.Pointer(ptr)))
  17709. result *= int32(10)
  17710. result += c1 - int32(m_ASCII_02)
  17711. if result >= int32(0x110000) {
  17712. return -int32(1)
  17713. }
  17714. goto _2
  17715. _2:
  17716. ;
  17717. ptr += uintptr(1)
  17718. }
  17719. }
  17720. return _checkCharRefNumber(tls, result)
  17721. }
  17722. func _normal_predefinedEntityName(tls *libc.TLS, enc uintptr, ptr uintptr, end uintptr) (r int32) {
  17723. _ = enc
  17724. switch (int64(end) - int64(ptr)) / libc.Int64FromInt32(1) {
  17725. case int64(2):
  17726. if int32(*(*int8)(unsafe.Pointer(ptr + libc.UintptrFromInt32(1)))) == int32(m_ASCII_t2) {
  17727. switch int32(*(*int8)(unsafe.Pointer(ptr))) {
  17728. case int32(m_ASCII_l2):
  17729. return int32(m_ASCII_LT1)
  17730. case int32(m_ASCII_g2):
  17731. return int32(m_ASCII_GT1)
  17732. }
  17733. }
  17734. case int64(3):
  17735. if int32(*(*int8)(unsafe.Pointer(ptr))) == int32(m_ASCII_a2) {
  17736. ptr += uintptr(1)
  17737. if int32(*(*int8)(unsafe.Pointer(ptr))) == int32(m_ASCII_m2) {
  17738. ptr += uintptr(1)
  17739. if int32(*(*int8)(unsafe.Pointer(ptr))) == int32(m_ASCII_p2) {
  17740. return int32(m_ASCII_AMP1)
  17741. }
  17742. }
  17743. }
  17744. case int64(4):
  17745. switch int32(*(*int8)(unsafe.Pointer(ptr))) {
  17746. case int32(m_ASCII_q1):
  17747. ptr += uintptr(1)
  17748. if int32(*(*int8)(unsafe.Pointer(ptr))) == int32(m_ASCII_u1) {
  17749. ptr += uintptr(1)
  17750. if int32(*(*int8)(unsafe.Pointer(ptr))) == int32(m_ASCII_o2) {
  17751. ptr += uintptr(1)
  17752. if int32(*(*int8)(unsafe.Pointer(ptr))) == int32(m_ASCII_t2) {
  17753. return int32(m_ASCII_QUOT1)
  17754. }
  17755. }
  17756. }
  17757. case int32(m_ASCII_a2):
  17758. ptr += uintptr(1)
  17759. if int32(*(*int8)(unsafe.Pointer(ptr))) == int32(m_ASCII_p2) {
  17760. ptr += uintptr(1)
  17761. if int32(*(*int8)(unsafe.Pointer(ptr))) == int32(m_ASCII_o2) {
  17762. ptr += uintptr(1)
  17763. if int32(*(*int8)(unsafe.Pointer(ptr))) == int32(m_ASCII_s2) {
  17764. return int32(m_ASCII_APOS1)
  17765. }
  17766. }
  17767. }
  17768. break
  17769. }
  17770. }
  17771. return 0
  17772. }
  17773. func _normal_nameMatchesAscii(tls *libc.TLS, enc uintptr, ptr1 uintptr, end1 uintptr, ptr2 uintptr) (r int32) {
  17774. _ = enc
  17775. for {
  17776. if !(*(*int8)(unsafe.Pointer(ptr2)) != 0) {
  17777. break
  17778. }
  17779. if int64(end1)-int64(ptr1) < int64(1) {
  17780. /* This line cannot be executed. The incoming data has already
  17781. * been tokenized once, so incomplete characters like this have
  17782. * already been eliminated from the input. Retaining the
  17783. * paranoia check is still valuable, however.
  17784. */
  17785. return 0 /* LCOV_EXCL_LINE */
  17786. }
  17787. if !(int32(*(*int8)(unsafe.Pointer(ptr1))) == int32(*(*int8)(unsafe.Pointer(ptr2)))) {
  17788. return 0
  17789. }
  17790. goto _1
  17791. _1:
  17792. ;
  17793. ptr1 += uintptr(1)
  17794. ptr2++
  17795. }
  17796. return libc.BoolInt32(ptr1 == end1)
  17797. }
  17798. func _normal_nameLength(tls *libc.TLS, enc uintptr, ptr uintptr) (r int32) {
  17799. var start uintptr
  17800. _ = start
  17801. start = ptr
  17802. for {
  17803. switch libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr))))))) {
  17804. case int32(_BT_LEAD2):
  17805. ptr += uintptr(2) /* NOTE: The encoding has already been validated. */
  17806. case int32(_BT_LEAD3):
  17807. ptr += uintptr(3) /* NOTE: The encoding has already been validated. */
  17808. case int32(_BT_LEAD4):
  17809. ptr += uintptr(4) /* NOTE: The encoding has already been validated. */
  17810. case int32(_BT_NONASCII):
  17811. fallthrough
  17812. case int32(_BT_NMSTRT):
  17813. fallthrough
  17814. case int32(_BT_COLON):
  17815. fallthrough
  17816. case int32(_BT_HEX):
  17817. fallthrough
  17818. case int32(_BT_DIGIT):
  17819. fallthrough
  17820. case int32(_BT_NAME):
  17821. fallthrough
  17822. case int32(_BT_MINUS):
  17823. ptr += uintptr(1)
  17824. default:
  17825. return int32(int64(ptr) - int64(start))
  17826. }
  17827. goto _1
  17828. _1:
  17829. }
  17830. return r
  17831. }
  17832. func _normal_skipS(tls *libc.TLS, enc uintptr, ptr uintptr) (r uintptr) {
  17833. for {
  17834. switch libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr))))))) {
  17835. case int32(_BT_LF):
  17836. fallthrough
  17837. case int32(_BT_CR):
  17838. fallthrough
  17839. case int32(_BT_S):
  17840. ptr += uintptr(1)
  17841. default:
  17842. return ptr
  17843. }
  17844. goto _1
  17845. _1:
  17846. }
  17847. return r
  17848. }
  17849. func _normal_updatePosition(tls *libc.TLS, enc uintptr, ptr uintptr, end uintptr, pos uintptr) {
  17850. for int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(1)) {
  17851. switch libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr))))))) {
  17852. case int32(_BT_LEAD2):
  17853. ptr += uintptr(2) /* NOTE: The encoding has already been validated. */
  17854. (*TPOSITION)(unsafe.Pointer(pos)).FcolumnNumber++
  17855. case int32(_BT_LEAD3):
  17856. ptr += uintptr(3) /* NOTE: The encoding has already been validated. */
  17857. (*TPOSITION)(unsafe.Pointer(pos)).FcolumnNumber++
  17858. case int32(_BT_LEAD4):
  17859. ptr += uintptr(4) /* NOTE: The encoding has already been validated. */
  17860. (*TPOSITION)(unsafe.Pointer(pos)).FcolumnNumber++
  17861. case int32(_BT_LF):
  17862. (*TPOSITION)(unsafe.Pointer(pos)).FcolumnNumber = uint64(0)
  17863. (*TPOSITION)(unsafe.Pointer(pos)).FlineNumber++
  17864. ptr += uintptr(1)
  17865. case int32(_BT_CR):
  17866. (*TPOSITION)(unsafe.Pointer(pos)).FlineNumber++
  17867. ptr += uintptr(1)
  17868. if int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(1)) && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr))))))) == int32(_BT_LF) {
  17869. ptr += uintptr(1)
  17870. }
  17871. (*TPOSITION)(unsafe.Pointer(pos)).FcolumnNumber = uint64(0)
  17872. default:
  17873. ptr += uintptr(1)
  17874. (*TPOSITION)(unsafe.Pointer(pos)).FcolumnNumber++
  17875. break
  17876. }
  17877. }
  17878. }
  17879. const /* UTF8_cvalN is value of masked first byte of N byte sequence */
  17880. _UTF8_cval1 = 0
  17881. const _UTF8_cval2 = 192
  17882. const _UTF8_cval3 = 224
  17883. const _UTF8_cval4 = 240
  17884. func X_INTERNAL_trim_to_complete_utf8_characters(tls *libc.TLS, from uintptr, fromLimRef uintptr) {
  17885. var fromLim uintptr
  17886. var prev uint8
  17887. var walked Tsize_t
  17888. _, _, _ = fromLim, prev, walked
  17889. fromLim = *(*uintptr)(unsafe.Pointer(fromLimRef))
  17890. walked = uint64(0)
  17891. for {
  17892. if !(fromLim > from) {
  17893. break
  17894. }
  17895. prev = libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(fromLim + uintptr(-libc.Int32FromInt32(1)))))
  17896. if uint32(prev)&uint32(0xf8) == uint32(0xf0) { /* 4-byte character, lead by 0b11110xxx byte */
  17897. if walked+uint64(1) >= uint64(4) {
  17898. fromLim += uintptr(libc.Int32FromInt32(4) - libc.Int32FromInt32(1))
  17899. break
  17900. } else {
  17901. walked = uint64(0)
  17902. }
  17903. } else {
  17904. if uint32(prev)&uint32(0xf0) == uint32(0xe0) { /* 3-byte character, lead by 0b1110xxxx byte */
  17905. if walked+uint64(1) >= uint64(3) {
  17906. fromLim += uintptr(libc.Int32FromInt32(3) - libc.Int32FromInt32(1))
  17907. break
  17908. } else {
  17909. walked = uint64(0)
  17910. }
  17911. } else {
  17912. if uint32(prev)&uint32(0xe0) == uint32(0xc0) { /* 2-byte character, lead by 0b110xxxxx byte */
  17913. if walked+uint64(1) >= uint64(2) {
  17914. fromLim += uintptr(libc.Int32FromInt32(2) - libc.Int32FromInt32(1))
  17915. break
  17916. } else {
  17917. walked = uint64(0)
  17918. }
  17919. } else {
  17920. if uint32(prev)&uint32(0x80) == 0x00 { /* 1-byte character, matching 0b0xxxxxxx */
  17921. break
  17922. }
  17923. }
  17924. }
  17925. }
  17926. goto _1
  17927. _1:
  17928. ;
  17929. fromLim--
  17930. walked++
  17931. }
  17932. *(*uintptr)(unsafe.Pointer(fromLimRef)) = fromLim
  17933. }
  17934. func _utf8_toUtf8(tls *libc.TLS, enc uintptr, fromP uintptr, _fromLim uintptr, toP uintptr, toLim uintptr) (r _XML_Convert_Result) {
  17935. bp := tls.Alloc(16)
  17936. defer tls.Free(16)
  17937. *(*uintptr)(unsafe.Pointer(bp)) = _fromLim
  17938. var bytesAvailable, bytesStorable, bytesToCopy Tptrdiff_t
  17939. var fromLimBefore uintptr
  17940. var input_incomplete, output_exhausted uint8
  17941. _, _, _, _, _, _ = bytesAvailable, bytesStorable, bytesToCopy, fromLimBefore, input_incomplete, output_exhausted
  17942. input_incomplete = uint8(m_false)
  17943. output_exhausted = uint8(m_false)
  17944. /* Avoid copying partial characters (due to limited space). */
  17945. bytesAvailable = int64(*(*uintptr)(unsafe.Pointer(bp))) - int64(*(*uintptr)(unsafe.Pointer(fromP)))
  17946. bytesStorable = int64(toLim) - int64(*(*uintptr)(unsafe.Pointer(toP)))
  17947. _ = enc
  17948. if bytesAvailable > bytesStorable {
  17949. *(*uintptr)(unsafe.Pointer(bp)) = *(*uintptr)(unsafe.Pointer(fromP)) + uintptr(bytesStorable)
  17950. output_exhausted = uint8(m_true)
  17951. }
  17952. /* Avoid copying partial characters (from incomplete input). */
  17953. fromLimBefore = *(*uintptr)(unsafe.Pointer(bp))
  17954. X_INTERNAL_trim_to_complete_utf8_characters(tls, *(*uintptr)(unsafe.Pointer(fromP)), bp)
  17955. if *(*uintptr)(unsafe.Pointer(bp)) < fromLimBefore {
  17956. input_incomplete = uint8(m_true)
  17957. }
  17958. bytesToCopy = int64(*(*uintptr)(unsafe.Pointer(bp))) - int64(*(*uintptr)(unsafe.Pointer(fromP)))
  17959. libc.X__builtin___memcpy_chk(tls, *(*uintptr)(unsafe.Pointer(toP)), *(*uintptr)(unsafe.Pointer(fromP)), libc.Uint64FromInt64(bytesToCopy), ^t__predefined_size_t(0))
  17960. *(*uintptr)(unsafe.Pointer(fromP)) += uintptr(bytesToCopy)
  17961. *(*uintptr)(unsafe.Pointer(toP)) += uintptr(bytesToCopy)
  17962. if output_exhausted != 0 { /* needs to go first */
  17963. return int32(_XML_CONVERT_OUTPUT_EXHAUSTED)
  17964. } else {
  17965. if input_incomplete != 0 {
  17966. return int32(_XML_CONVERT_INPUT_INCOMPLETE)
  17967. } else {
  17968. return int32(_XML_CONVERT_COMPLETED)
  17969. }
  17970. }
  17971. return r
  17972. }
  17973. func _utf8_toUtf16(tls *libc.TLS, enc uintptr, fromP uintptr, fromLim uintptr, toP uintptr, toLim uintptr) (r _XML_Convert_Result) {
  17974. var from, to, v1, v2, v3, v4 uintptr
  17975. var n uint64
  17976. var res _XML_Convert_Result
  17977. _, _, _, _, _, _, _, _ = from, n, res, to, v1, v2, v3, v4
  17978. res = int32(_XML_CONVERT_COMPLETED)
  17979. to = *(*uintptr)(unsafe.Pointer(toP))
  17980. from = *(*uintptr)(unsafe.Pointer(fromP))
  17981. for from < fromLim && to < toLim {
  17982. switch libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(from))))))) {
  17983. case int32(_BT_LEAD2):
  17984. if int64(fromLim)-int64(from) < int64(2) {
  17985. res = int32(_XML_CONVERT_INPUT_INCOMPLETE)
  17986. goto after
  17987. }
  17988. v1 = to
  17989. to += 2
  17990. *(*uint16)(unsafe.Pointer(v1)) = libc.Uint16FromInt32(int32(*(*int8)(unsafe.Pointer(from)))&libc.Int32FromInt32(0x1f)<<libc.Int32FromInt32(6) | int32(*(*int8)(unsafe.Pointer(from + 1)))&libc.Int32FromInt32(0x3f))
  17991. from += uintptr(2)
  17992. case int32(_BT_LEAD3):
  17993. if int64(fromLim)-int64(from) < int64(3) {
  17994. res = int32(_XML_CONVERT_INPUT_INCOMPLETE)
  17995. goto after
  17996. }
  17997. v2 = to
  17998. to += 2
  17999. *(*uint16)(unsafe.Pointer(v2)) = libc.Uint16FromInt32(int32(*(*int8)(unsafe.Pointer(from)))&libc.Int32FromInt32(0xf)<<libc.Int32FromInt32(12) | int32(*(*int8)(unsafe.Pointer(from + 1)))&libc.Int32FromInt32(0x3f)<<libc.Int32FromInt32(6) | int32(*(*int8)(unsafe.Pointer(from + 2)))&libc.Int32FromInt32(0x3f))
  18000. from += uintptr(3)
  18001. case int32(_BT_LEAD4):
  18002. if (int64(toLim)-int64(to))/2 < int64(2) {
  18003. res = int32(_XML_CONVERT_OUTPUT_EXHAUSTED)
  18004. goto after
  18005. }
  18006. if int64(fromLim)-int64(from) < int64(4) {
  18007. res = int32(_XML_CONVERT_INPUT_INCOMPLETE)
  18008. goto after
  18009. }
  18010. n = libc.Uint64FromInt32(int32(*(*int8)(unsafe.Pointer(from)))&int32(0x7)<<int32(18) | int32(*(*int8)(unsafe.Pointer(from + 1)))&int32(0x3f)<<int32(12) | int32(*(*int8)(unsafe.Pointer(from + 2)))&int32(0x3f)<<int32(6) | int32(*(*int8)(unsafe.Pointer(from + 3)))&int32(0x3f))
  18011. n -= uint64(0x10000)
  18012. *(*uint16)(unsafe.Pointer(to)) = uint16(n>>libc.Int32FromInt32(10) | libc.Uint64FromInt32(0xD800))
  18013. *(*uint16)(unsafe.Pointer(to + 1*2)) = uint16(n&libc.Uint64FromInt32(0x3FF) | libc.Uint64FromInt32(0xDC00))
  18014. to += uintptr(2) * 2
  18015. from += uintptr(4)
  18016. default:
  18017. v3 = to
  18018. to += 2
  18019. v4 = from
  18020. from++
  18021. *(*uint16)(unsafe.Pointer(v3)) = libc.Uint16FromInt8(*(*int8)(unsafe.Pointer(v4)))
  18022. break
  18023. }
  18024. }
  18025. if from < fromLim {
  18026. res = int32(_XML_CONVERT_OUTPUT_EXHAUSTED)
  18027. }
  18028. goto after
  18029. after:
  18030. ;
  18031. *(*uintptr)(unsafe.Pointer(fromP)) = from
  18032. *(*uintptr)(unsafe.Pointer(toP)) = to
  18033. return res
  18034. }
  18035. var _utf8_encoding_ns = Tnormal_encoding{
  18036. Fenc: TENCODING{
  18037. Fscanners: [4]TSCANNER{},
  18038. FliteralScanners: [2]TSCANNER{},
  18039. FminBytesPerChar: int32(1),
  18040. FisUtf8: int8(1),
  18041. },
  18042. Ftype1: [256]uint8{
  18043. 9: uint8(_BT_S),
  18044. 10: uint8(_BT_LF),
  18045. 13: uint8(_BT_CR),
  18046. 32: uint8(_BT_S),
  18047. 33: uint8(_BT_EXCL),
  18048. 34: uint8(_BT_QUOT),
  18049. 35: uint8(_BT_NUM),
  18050. 36: uint8(_BT_OTHER),
  18051. 37: uint8(_BT_PERCNT),
  18052. 38: uint8(_BT_AMP),
  18053. 39: uint8(_BT_APOS),
  18054. 40: uint8(_BT_LPAR),
  18055. 41: uint8(_BT_RPAR),
  18056. 42: uint8(_BT_AST),
  18057. 43: uint8(_BT_PLUS),
  18058. 44: uint8(_BT_COMMA),
  18059. 45: uint8(_BT_MINUS),
  18060. 46: uint8(_BT_NAME),
  18061. 47: uint8(_BT_SOL),
  18062. 48: uint8(_BT_DIGIT),
  18063. 49: uint8(_BT_DIGIT),
  18064. 50: uint8(_BT_DIGIT),
  18065. 51: uint8(_BT_DIGIT),
  18066. 52: uint8(_BT_DIGIT),
  18067. 53: uint8(_BT_DIGIT),
  18068. 54: uint8(_BT_DIGIT),
  18069. 55: uint8(_BT_DIGIT),
  18070. 56: uint8(_BT_DIGIT),
  18071. 57: uint8(_BT_DIGIT),
  18072. 58: uint8(_BT_COLON),
  18073. 59: uint8(_BT_SEMI),
  18074. 60: uint8(_BT_LT),
  18075. 61: uint8(_BT_EQUALS),
  18076. 62: uint8(_BT_GT),
  18077. 63: uint8(_BT_QUEST),
  18078. 64: uint8(_BT_OTHER),
  18079. 65: uint8(_BT_HEX),
  18080. 66: uint8(_BT_HEX),
  18081. 67: uint8(_BT_HEX),
  18082. 68: uint8(_BT_HEX),
  18083. 69: uint8(_BT_HEX),
  18084. 70: uint8(_BT_HEX),
  18085. 71: uint8(_BT_NMSTRT),
  18086. 72: uint8(_BT_NMSTRT),
  18087. 73: uint8(_BT_NMSTRT),
  18088. 74: uint8(_BT_NMSTRT),
  18089. 75: uint8(_BT_NMSTRT),
  18090. 76: uint8(_BT_NMSTRT),
  18091. 77: uint8(_BT_NMSTRT),
  18092. 78: uint8(_BT_NMSTRT),
  18093. 79: uint8(_BT_NMSTRT),
  18094. 80: uint8(_BT_NMSTRT),
  18095. 81: uint8(_BT_NMSTRT),
  18096. 82: uint8(_BT_NMSTRT),
  18097. 83: uint8(_BT_NMSTRT),
  18098. 84: uint8(_BT_NMSTRT),
  18099. 85: uint8(_BT_NMSTRT),
  18100. 86: uint8(_BT_NMSTRT),
  18101. 87: uint8(_BT_NMSTRT),
  18102. 88: uint8(_BT_NMSTRT),
  18103. 89: uint8(_BT_NMSTRT),
  18104. 90: uint8(_BT_NMSTRT),
  18105. 91: uint8(_BT_LSQB),
  18106. 92: uint8(_BT_OTHER),
  18107. 93: uint8(_BT_RSQB),
  18108. 94: uint8(_BT_OTHER),
  18109. 95: uint8(_BT_NMSTRT),
  18110. 96: uint8(_BT_OTHER),
  18111. 97: uint8(_BT_HEX),
  18112. 98: uint8(_BT_HEX),
  18113. 99: uint8(_BT_HEX),
  18114. 100: uint8(_BT_HEX),
  18115. 101: uint8(_BT_HEX),
  18116. 102: uint8(_BT_HEX),
  18117. 103: uint8(_BT_NMSTRT),
  18118. 104: uint8(_BT_NMSTRT),
  18119. 105: uint8(_BT_NMSTRT),
  18120. 106: uint8(_BT_NMSTRT),
  18121. 107: uint8(_BT_NMSTRT),
  18122. 108: uint8(_BT_NMSTRT),
  18123. 109: uint8(_BT_NMSTRT),
  18124. 110: uint8(_BT_NMSTRT),
  18125. 111: uint8(_BT_NMSTRT),
  18126. 112: uint8(_BT_NMSTRT),
  18127. 113: uint8(_BT_NMSTRT),
  18128. 114: uint8(_BT_NMSTRT),
  18129. 115: uint8(_BT_NMSTRT),
  18130. 116: uint8(_BT_NMSTRT),
  18131. 117: uint8(_BT_NMSTRT),
  18132. 118: uint8(_BT_NMSTRT),
  18133. 119: uint8(_BT_NMSTRT),
  18134. 120: uint8(_BT_NMSTRT),
  18135. 121: uint8(_BT_NMSTRT),
  18136. 122: uint8(_BT_NMSTRT),
  18137. 123: uint8(_BT_OTHER),
  18138. 124: uint8(_BT_VERBAR),
  18139. 125: uint8(_BT_OTHER),
  18140. 126: uint8(_BT_OTHER),
  18141. 127: uint8(_BT_OTHER),
  18142. 128: uint8(_BT_TRAIL),
  18143. 129: uint8(_BT_TRAIL),
  18144. 130: uint8(_BT_TRAIL),
  18145. 131: uint8(_BT_TRAIL),
  18146. 132: uint8(_BT_TRAIL),
  18147. 133: uint8(_BT_TRAIL),
  18148. 134: uint8(_BT_TRAIL),
  18149. 135: uint8(_BT_TRAIL),
  18150. 136: uint8(_BT_TRAIL),
  18151. 137: uint8(_BT_TRAIL),
  18152. 138: uint8(_BT_TRAIL),
  18153. 139: uint8(_BT_TRAIL),
  18154. 140: uint8(_BT_TRAIL),
  18155. 141: uint8(_BT_TRAIL),
  18156. 142: uint8(_BT_TRAIL),
  18157. 143: uint8(_BT_TRAIL),
  18158. 144: uint8(_BT_TRAIL),
  18159. 145: uint8(_BT_TRAIL),
  18160. 146: uint8(_BT_TRAIL),
  18161. 147: uint8(_BT_TRAIL),
  18162. 148: uint8(_BT_TRAIL),
  18163. 149: uint8(_BT_TRAIL),
  18164. 150: uint8(_BT_TRAIL),
  18165. 151: uint8(_BT_TRAIL),
  18166. 152: uint8(_BT_TRAIL),
  18167. 153: uint8(_BT_TRAIL),
  18168. 154: uint8(_BT_TRAIL),
  18169. 155: uint8(_BT_TRAIL),
  18170. 156: uint8(_BT_TRAIL),
  18171. 157: uint8(_BT_TRAIL),
  18172. 158: uint8(_BT_TRAIL),
  18173. 159: uint8(_BT_TRAIL),
  18174. 160: uint8(_BT_TRAIL),
  18175. 161: uint8(_BT_TRAIL),
  18176. 162: uint8(_BT_TRAIL),
  18177. 163: uint8(_BT_TRAIL),
  18178. 164: uint8(_BT_TRAIL),
  18179. 165: uint8(_BT_TRAIL),
  18180. 166: uint8(_BT_TRAIL),
  18181. 167: uint8(_BT_TRAIL),
  18182. 168: uint8(_BT_TRAIL),
  18183. 169: uint8(_BT_TRAIL),
  18184. 170: uint8(_BT_TRAIL),
  18185. 171: uint8(_BT_TRAIL),
  18186. 172: uint8(_BT_TRAIL),
  18187. 173: uint8(_BT_TRAIL),
  18188. 174: uint8(_BT_TRAIL),
  18189. 175: uint8(_BT_TRAIL),
  18190. 176: uint8(_BT_TRAIL),
  18191. 177: uint8(_BT_TRAIL),
  18192. 178: uint8(_BT_TRAIL),
  18193. 179: uint8(_BT_TRAIL),
  18194. 180: uint8(_BT_TRAIL),
  18195. 181: uint8(_BT_TRAIL),
  18196. 182: uint8(_BT_TRAIL),
  18197. 183: uint8(_BT_TRAIL),
  18198. 184: uint8(_BT_TRAIL),
  18199. 185: uint8(_BT_TRAIL),
  18200. 186: uint8(_BT_TRAIL),
  18201. 187: uint8(_BT_TRAIL),
  18202. 188: uint8(_BT_TRAIL),
  18203. 189: uint8(_BT_TRAIL),
  18204. 190: uint8(_BT_TRAIL),
  18205. 191: uint8(_BT_TRAIL),
  18206. 192: uint8(_BT_LEAD2),
  18207. 193: uint8(_BT_LEAD2),
  18208. 194: uint8(_BT_LEAD2),
  18209. 195: uint8(_BT_LEAD2),
  18210. 196: uint8(_BT_LEAD2),
  18211. 197: uint8(_BT_LEAD2),
  18212. 198: uint8(_BT_LEAD2),
  18213. 199: uint8(_BT_LEAD2),
  18214. 200: uint8(_BT_LEAD2),
  18215. 201: uint8(_BT_LEAD2),
  18216. 202: uint8(_BT_LEAD2),
  18217. 203: uint8(_BT_LEAD2),
  18218. 204: uint8(_BT_LEAD2),
  18219. 205: uint8(_BT_LEAD2),
  18220. 206: uint8(_BT_LEAD2),
  18221. 207: uint8(_BT_LEAD2),
  18222. 208: uint8(_BT_LEAD2),
  18223. 209: uint8(_BT_LEAD2),
  18224. 210: uint8(_BT_LEAD2),
  18225. 211: uint8(_BT_LEAD2),
  18226. 212: uint8(_BT_LEAD2),
  18227. 213: uint8(_BT_LEAD2),
  18228. 214: uint8(_BT_LEAD2),
  18229. 215: uint8(_BT_LEAD2),
  18230. 216: uint8(_BT_LEAD2),
  18231. 217: uint8(_BT_LEAD2),
  18232. 218: uint8(_BT_LEAD2),
  18233. 219: uint8(_BT_LEAD2),
  18234. 220: uint8(_BT_LEAD2),
  18235. 221: uint8(_BT_LEAD2),
  18236. 222: uint8(_BT_LEAD2),
  18237. 223: uint8(_BT_LEAD2),
  18238. 224: uint8(_BT_LEAD3),
  18239. 225: uint8(_BT_LEAD3),
  18240. 226: uint8(_BT_LEAD3),
  18241. 227: uint8(_BT_LEAD3),
  18242. 228: uint8(_BT_LEAD3),
  18243. 229: uint8(_BT_LEAD3),
  18244. 230: uint8(_BT_LEAD3),
  18245. 231: uint8(_BT_LEAD3),
  18246. 232: uint8(_BT_LEAD3),
  18247. 233: uint8(_BT_LEAD3),
  18248. 234: uint8(_BT_LEAD3),
  18249. 235: uint8(_BT_LEAD3),
  18250. 236: uint8(_BT_LEAD3),
  18251. 237: uint8(_BT_LEAD3),
  18252. 238: uint8(_BT_LEAD3),
  18253. 239: uint8(_BT_LEAD3),
  18254. 240: uint8(_BT_LEAD4),
  18255. 241: uint8(_BT_LEAD4),
  18256. 242: uint8(_BT_LEAD4),
  18257. 243: uint8(_BT_LEAD4),
  18258. 244: uint8(_BT_LEAD4),
  18259. 254: uint8(_BT_MALFORM),
  18260. 255: uint8(_BT_MALFORM),
  18261. },
  18262. }
  18263. func init() {
  18264. p := unsafe.Pointer(&_utf8_encoding_ns)
  18265. *(*uintptr)(unsafe.Add(p, 0)) = __ccgo_fp(_normal_prologTok)
  18266. *(*uintptr)(unsafe.Add(p, 8)) = __ccgo_fp(_normal_contentTok)
  18267. *(*uintptr)(unsafe.Add(p, 16)) = __ccgo_fp(_normal_cdataSectionTok)
  18268. *(*uintptr)(unsafe.Add(p, 24)) = __ccgo_fp(_normal_ignoreSectionTok)
  18269. *(*uintptr)(unsafe.Add(p, 32)) = __ccgo_fp(_normal_attributeValueTok)
  18270. *(*uintptr)(unsafe.Add(p, 40)) = __ccgo_fp(_normal_entityValueTok)
  18271. *(*uintptr)(unsafe.Add(p, 48)) = __ccgo_fp(_normal_nameMatchesAscii)
  18272. *(*uintptr)(unsafe.Add(p, 56)) = __ccgo_fp(_normal_nameLength)
  18273. *(*uintptr)(unsafe.Add(p, 64)) = __ccgo_fp(_normal_skipS)
  18274. *(*uintptr)(unsafe.Add(p, 72)) = __ccgo_fp(_normal_getAtts)
  18275. *(*uintptr)(unsafe.Add(p, 80)) = __ccgo_fp(_normal_charRefNumber)
  18276. *(*uintptr)(unsafe.Add(p, 88)) = __ccgo_fp(_normal_predefinedEntityName)
  18277. *(*uintptr)(unsafe.Add(p, 96)) = __ccgo_fp(_normal_updatePosition)
  18278. *(*uintptr)(unsafe.Add(p, 104)) = __ccgo_fp(_normal_isPublicId)
  18279. *(*uintptr)(unsafe.Add(p, 112)) = __ccgo_fp(_utf8_toUtf8)
  18280. *(*uintptr)(unsafe.Add(p, 120)) = __ccgo_fp(_utf8_toUtf16)
  18281. *(*uintptr)(unsafe.Add(p, 392)) = __ccgo_fp(_utf8_isName2)
  18282. *(*uintptr)(unsafe.Add(p, 400)) = __ccgo_fp(_utf8_isName3)
  18283. *(*uintptr)(unsafe.Add(p, 408)) = __ccgo_fp(_isNever)
  18284. *(*uintptr)(unsafe.Add(p, 416)) = __ccgo_fp(_utf8_isNmstrt2)
  18285. *(*uintptr)(unsafe.Add(p, 424)) = __ccgo_fp(_utf8_isNmstrt3)
  18286. *(*uintptr)(unsafe.Add(p, 432)) = __ccgo_fp(_isNever)
  18287. *(*uintptr)(unsafe.Add(p, 440)) = __ccgo_fp(_utf8_isInvalid2)
  18288. *(*uintptr)(unsafe.Add(p, 448)) = __ccgo_fp(_utf8_isInvalid3)
  18289. *(*uintptr)(unsafe.Add(p, 456)) = __ccgo_fp(_utf8_isInvalid4)
  18290. }
  18291. var _utf8_encoding = Tnormal_encoding{
  18292. Fenc: TENCODING{
  18293. Fscanners: [4]TSCANNER{},
  18294. FliteralScanners: [2]TSCANNER{},
  18295. FminBytesPerChar: int32(1),
  18296. FisUtf8: int8(1),
  18297. },
  18298. Ftype1: [256]uint8{
  18299. 9: uint8(_BT_S),
  18300. 10: uint8(_BT_LF),
  18301. 13: uint8(_BT_CR),
  18302. 32: uint8(_BT_S),
  18303. 33: uint8(_BT_EXCL),
  18304. 34: uint8(_BT_QUOT),
  18305. 35: uint8(_BT_NUM),
  18306. 36: uint8(_BT_OTHER),
  18307. 37: uint8(_BT_PERCNT),
  18308. 38: uint8(_BT_AMP),
  18309. 39: uint8(_BT_APOS),
  18310. 40: uint8(_BT_LPAR),
  18311. 41: uint8(_BT_RPAR),
  18312. 42: uint8(_BT_AST),
  18313. 43: uint8(_BT_PLUS),
  18314. 44: uint8(_BT_COMMA),
  18315. 45: uint8(_BT_MINUS),
  18316. 46: uint8(_BT_NAME),
  18317. 47: uint8(_BT_SOL),
  18318. 48: uint8(_BT_DIGIT),
  18319. 49: uint8(_BT_DIGIT),
  18320. 50: uint8(_BT_DIGIT),
  18321. 51: uint8(_BT_DIGIT),
  18322. 52: uint8(_BT_DIGIT),
  18323. 53: uint8(_BT_DIGIT),
  18324. 54: uint8(_BT_DIGIT),
  18325. 55: uint8(_BT_DIGIT),
  18326. 56: uint8(_BT_DIGIT),
  18327. 57: uint8(_BT_DIGIT),
  18328. 58: uint8(_BT_NMSTRT),
  18329. 59: uint8(_BT_SEMI),
  18330. 60: uint8(_BT_LT),
  18331. 61: uint8(_BT_EQUALS),
  18332. 62: uint8(_BT_GT),
  18333. 63: uint8(_BT_QUEST),
  18334. 64: uint8(_BT_OTHER),
  18335. 65: uint8(_BT_HEX),
  18336. 66: uint8(_BT_HEX),
  18337. 67: uint8(_BT_HEX),
  18338. 68: uint8(_BT_HEX),
  18339. 69: uint8(_BT_HEX),
  18340. 70: uint8(_BT_HEX),
  18341. 71: uint8(_BT_NMSTRT),
  18342. 72: uint8(_BT_NMSTRT),
  18343. 73: uint8(_BT_NMSTRT),
  18344. 74: uint8(_BT_NMSTRT),
  18345. 75: uint8(_BT_NMSTRT),
  18346. 76: uint8(_BT_NMSTRT),
  18347. 77: uint8(_BT_NMSTRT),
  18348. 78: uint8(_BT_NMSTRT),
  18349. 79: uint8(_BT_NMSTRT),
  18350. 80: uint8(_BT_NMSTRT),
  18351. 81: uint8(_BT_NMSTRT),
  18352. 82: uint8(_BT_NMSTRT),
  18353. 83: uint8(_BT_NMSTRT),
  18354. 84: uint8(_BT_NMSTRT),
  18355. 85: uint8(_BT_NMSTRT),
  18356. 86: uint8(_BT_NMSTRT),
  18357. 87: uint8(_BT_NMSTRT),
  18358. 88: uint8(_BT_NMSTRT),
  18359. 89: uint8(_BT_NMSTRT),
  18360. 90: uint8(_BT_NMSTRT),
  18361. 91: uint8(_BT_LSQB),
  18362. 92: uint8(_BT_OTHER),
  18363. 93: uint8(_BT_RSQB),
  18364. 94: uint8(_BT_OTHER),
  18365. 95: uint8(_BT_NMSTRT),
  18366. 96: uint8(_BT_OTHER),
  18367. 97: uint8(_BT_HEX),
  18368. 98: uint8(_BT_HEX),
  18369. 99: uint8(_BT_HEX),
  18370. 100: uint8(_BT_HEX),
  18371. 101: uint8(_BT_HEX),
  18372. 102: uint8(_BT_HEX),
  18373. 103: uint8(_BT_NMSTRT),
  18374. 104: uint8(_BT_NMSTRT),
  18375. 105: uint8(_BT_NMSTRT),
  18376. 106: uint8(_BT_NMSTRT),
  18377. 107: uint8(_BT_NMSTRT),
  18378. 108: uint8(_BT_NMSTRT),
  18379. 109: uint8(_BT_NMSTRT),
  18380. 110: uint8(_BT_NMSTRT),
  18381. 111: uint8(_BT_NMSTRT),
  18382. 112: uint8(_BT_NMSTRT),
  18383. 113: uint8(_BT_NMSTRT),
  18384. 114: uint8(_BT_NMSTRT),
  18385. 115: uint8(_BT_NMSTRT),
  18386. 116: uint8(_BT_NMSTRT),
  18387. 117: uint8(_BT_NMSTRT),
  18388. 118: uint8(_BT_NMSTRT),
  18389. 119: uint8(_BT_NMSTRT),
  18390. 120: uint8(_BT_NMSTRT),
  18391. 121: uint8(_BT_NMSTRT),
  18392. 122: uint8(_BT_NMSTRT),
  18393. 123: uint8(_BT_OTHER),
  18394. 124: uint8(_BT_VERBAR),
  18395. 125: uint8(_BT_OTHER),
  18396. 126: uint8(_BT_OTHER),
  18397. 127: uint8(_BT_OTHER),
  18398. 128: uint8(_BT_TRAIL),
  18399. 129: uint8(_BT_TRAIL),
  18400. 130: uint8(_BT_TRAIL),
  18401. 131: uint8(_BT_TRAIL),
  18402. 132: uint8(_BT_TRAIL),
  18403. 133: uint8(_BT_TRAIL),
  18404. 134: uint8(_BT_TRAIL),
  18405. 135: uint8(_BT_TRAIL),
  18406. 136: uint8(_BT_TRAIL),
  18407. 137: uint8(_BT_TRAIL),
  18408. 138: uint8(_BT_TRAIL),
  18409. 139: uint8(_BT_TRAIL),
  18410. 140: uint8(_BT_TRAIL),
  18411. 141: uint8(_BT_TRAIL),
  18412. 142: uint8(_BT_TRAIL),
  18413. 143: uint8(_BT_TRAIL),
  18414. 144: uint8(_BT_TRAIL),
  18415. 145: uint8(_BT_TRAIL),
  18416. 146: uint8(_BT_TRAIL),
  18417. 147: uint8(_BT_TRAIL),
  18418. 148: uint8(_BT_TRAIL),
  18419. 149: uint8(_BT_TRAIL),
  18420. 150: uint8(_BT_TRAIL),
  18421. 151: uint8(_BT_TRAIL),
  18422. 152: uint8(_BT_TRAIL),
  18423. 153: uint8(_BT_TRAIL),
  18424. 154: uint8(_BT_TRAIL),
  18425. 155: uint8(_BT_TRAIL),
  18426. 156: uint8(_BT_TRAIL),
  18427. 157: uint8(_BT_TRAIL),
  18428. 158: uint8(_BT_TRAIL),
  18429. 159: uint8(_BT_TRAIL),
  18430. 160: uint8(_BT_TRAIL),
  18431. 161: uint8(_BT_TRAIL),
  18432. 162: uint8(_BT_TRAIL),
  18433. 163: uint8(_BT_TRAIL),
  18434. 164: uint8(_BT_TRAIL),
  18435. 165: uint8(_BT_TRAIL),
  18436. 166: uint8(_BT_TRAIL),
  18437. 167: uint8(_BT_TRAIL),
  18438. 168: uint8(_BT_TRAIL),
  18439. 169: uint8(_BT_TRAIL),
  18440. 170: uint8(_BT_TRAIL),
  18441. 171: uint8(_BT_TRAIL),
  18442. 172: uint8(_BT_TRAIL),
  18443. 173: uint8(_BT_TRAIL),
  18444. 174: uint8(_BT_TRAIL),
  18445. 175: uint8(_BT_TRAIL),
  18446. 176: uint8(_BT_TRAIL),
  18447. 177: uint8(_BT_TRAIL),
  18448. 178: uint8(_BT_TRAIL),
  18449. 179: uint8(_BT_TRAIL),
  18450. 180: uint8(_BT_TRAIL),
  18451. 181: uint8(_BT_TRAIL),
  18452. 182: uint8(_BT_TRAIL),
  18453. 183: uint8(_BT_TRAIL),
  18454. 184: uint8(_BT_TRAIL),
  18455. 185: uint8(_BT_TRAIL),
  18456. 186: uint8(_BT_TRAIL),
  18457. 187: uint8(_BT_TRAIL),
  18458. 188: uint8(_BT_TRAIL),
  18459. 189: uint8(_BT_TRAIL),
  18460. 190: uint8(_BT_TRAIL),
  18461. 191: uint8(_BT_TRAIL),
  18462. 192: uint8(_BT_LEAD2),
  18463. 193: uint8(_BT_LEAD2),
  18464. 194: uint8(_BT_LEAD2),
  18465. 195: uint8(_BT_LEAD2),
  18466. 196: uint8(_BT_LEAD2),
  18467. 197: uint8(_BT_LEAD2),
  18468. 198: uint8(_BT_LEAD2),
  18469. 199: uint8(_BT_LEAD2),
  18470. 200: uint8(_BT_LEAD2),
  18471. 201: uint8(_BT_LEAD2),
  18472. 202: uint8(_BT_LEAD2),
  18473. 203: uint8(_BT_LEAD2),
  18474. 204: uint8(_BT_LEAD2),
  18475. 205: uint8(_BT_LEAD2),
  18476. 206: uint8(_BT_LEAD2),
  18477. 207: uint8(_BT_LEAD2),
  18478. 208: uint8(_BT_LEAD2),
  18479. 209: uint8(_BT_LEAD2),
  18480. 210: uint8(_BT_LEAD2),
  18481. 211: uint8(_BT_LEAD2),
  18482. 212: uint8(_BT_LEAD2),
  18483. 213: uint8(_BT_LEAD2),
  18484. 214: uint8(_BT_LEAD2),
  18485. 215: uint8(_BT_LEAD2),
  18486. 216: uint8(_BT_LEAD2),
  18487. 217: uint8(_BT_LEAD2),
  18488. 218: uint8(_BT_LEAD2),
  18489. 219: uint8(_BT_LEAD2),
  18490. 220: uint8(_BT_LEAD2),
  18491. 221: uint8(_BT_LEAD2),
  18492. 222: uint8(_BT_LEAD2),
  18493. 223: uint8(_BT_LEAD2),
  18494. 224: uint8(_BT_LEAD3),
  18495. 225: uint8(_BT_LEAD3),
  18496. 226: uint8(_BT_LEAD3),
  18497. 227: uint8(_BT_LEAD3),
  18498. 228: uint8(_BT_LEAD3),
  18499. 229: uint8(_BT_LEAD3),
  18500. 230: uint8(_BT_LEAD3),
  18501. 231: uint8(_BT_LEAD3),
  18502. 232: uint8(_BT_LEAD3),
  18503. 233: uint8(_BT_LEAD3),
  18504. 234: uint8(_BT_LEAD3),
  18505. 235: uint8(_BT_LEAD3),
  18506. 236: uint8(_BT_LEAD3),
  18507. 237: uint8(_BT_LEAD3),
  18508. 238: uint8(_BT_LEAD3),
  18509. 239: uint8(_BT_LEAD3),
  18510. 240: uint8(_BT_LEAD4),
  18511. 241: uint8(_BT_LEAD4),
  18512. 242: uint8(_BT_LEAD4),
  18513. 243: uint8(_BT_LEAD4),
  18514. 244: uint8(_BT_LEAD4),
  18515. 254: uint8(_BT_MALFORM),
  18516. 255: uint8(_BT_MALFORM),
  18517. },
  18518. }
  18519. func init() {
  18520. p := unsafe.Pointer(&_utf8_encoding)
  18521. *(*uintptr)(unsafe.Add(p, 0)) = __ccgo_fp(_normal_prologTok)
  18522. *(*uintptr)(unsafe.Add(p, 8)) = __ccgo_fp(_normal_contentTok)
  18523. *(*uintptr)(unsafe.Add(p, 16)) = __ccgo_fp(_normal_cdataSectionTok)
  18524. *(*uintptr)(unsafe.Add(p, 24)) = __ccgo_fp(_normal_ignoreSectionTok)
  18525. *(*uintptr)(unsafe.Add(p, 32)) = __ccgo_fp(_normal_attributeValueTok)
  18526. *(*uintptr)(unsafe.Add(p, 40)) = __ccgo_fp(_normal_entityValueTok)
  18527. *(*uintptr)(unsafe.Add(p, 48)) = __ccgo_fp(_normal_nameMatchesAscii)
  18528. *(*uintptr)(unsafe.Add(p, 56)) = __ccgo_fp(_normal_nameLength)
  18529. *(*uintptr)(unsafe.Add(p, 64)) = __ccgo_fp(_normal_skipS)
  18530. *(*uintptr)(unsafe.Add(p, 72)) = __ccgo_fp(_normal_getAtts)
  18531. *(*uintptr)(unsafe.Add(p, 80)) = __ccgo_fp(_normal_charRefNumber)
  18532. *(*uintptr)(unsafe.Add(p, 88)) = __ccgo_fp(_normal_predefinedEntityName)
  18533. *(*uintptr)(unsafe.Add(p, 96)) = __ccgo_fp(_normal_updatePosition)
  18534. *(*uintptr)(unsafe.Add(p, 104)) = __ccgo_fp(_normal_isPublicId)
  18535. *(*uintptr)(unsafe.Add(p, 112)) = __ccgo_fp(_utf8_toUtf8)
  18536. *(*uintptr)(unsafe.Add(p, 120)) = __ccgo_fp(_utf8_toUtf16)
  18537. *(*uintptr)(unsafe.Add(p, 392)) = __ccgo_fp(_utf8_isName2)
  18538. *(*uintptr)(unsafe.Add(p, 400)) = __ccgo_fp(_utf8_isName3)
  18539. *(*uintptr)(unsafe.Add(p, 408)) = __ccgo_fp(_isNever)
  18540. *(*uintptr)(unsafe.Add(p, 416)) = __ccgo_fp(_utf8_isNmstrt2)
  18541. *(*uintptr)(unsafe.Add(p, 424)) = __ccgo_fp(_utf8_isNmstrt3)
  18542. *(*uintptr)(unsafe.Add(p, 432)) = __ccgo_fp(_isNever)
  18543. *(*uintptr)(unsafe.Add(p, 440)) = __ccgo_fp(_utf8_isInvalid2)
  18544. *(*uintptr)(unsafe.Add(p, 448)) = __ccgo_fp(_utf8_isInvalid3)
  18545. *(*uintptr)(unsafe.Add(p, 456)) = __ccgo_fp(_utf8_isInvalid4)
  18546. }
  18547. var _internal_utf8_encoding_ns = Tnormal_encoding{
  18548. Fenc: TENCODING{
  18549. Fscanners: [4]TSCANNER{},
  18550. FliteralScanners: [2]TSCANNER{},
  18551. FminBytesPerChar: int32(1),
  18552. FisUtf8: int8(1),
  18553. },
  18554. Ftype1: [256]uint8{
  18555. 9: uint8(_BT_S),
  18556. 10: uint8(_BT_LF),
  18557. 13: uint8(_BT_S),
  18558. 32: uint8(_BT_S),
  18559. 33: uint8(_BT_EXCL),
  18560. 34: uint8(_BT_QUOT),
  18561. 35: uint8(_BT_NUM),
  18562. 36: uint8(_BT_OTHER),
  18563. 37: uint8(_BT_PERCNT),
  18564. 38: uint8(_BT_AMP),
  18565. 39: uint8(_BT_APOS),
  18566. 40: uint8(_BT_LPAR),
  18567. 41: uint8(_BT_RPAR),
  18568. 42: uint8(_BT_AST),
  18569. 43: uint8(_BT_PLUS),
  18570. 44: uint8(_BT_COMMA),
  18571. 45: uint8(_BT_MINUS),
  18572. 46: uint8(_BT_NAME),
  18573. 47: uint8(_BT_SOL),
  18574. 48: uint8(_BT_DIGIT),
  18575. 49: uint8(_BT_DIGIT),
  18576. 50: uint8(_BT_DIGIT),
  18577. 51: uint8(_BT_DIGIT),
  18578. 52: uint8(_BT_DIGIT),
  18579. 53: uint8(_BT_DIGIT),
  18580. 54: uint8(_BT_DIGIT),
  18581. 55: uint8(_BT_DIGIT),
  18582. 56: uint8(_BT_DIGIT),
  18583. 57: uint8(_BT_DIGIT),
  18584. 58: uint8(_BT_COLON),
  18585. 59: uint8(_BT_SEMI),
  18586. 60: uint8(_BT_LT),
  18587. 61: uint8(_BT_EQUALS),
  18588. 62: uint8(_BT_GT),
  18589. 63: uint8(_BT_QUEST),
  18590. 64: uint8(_BT_OTHER),
  18591. 65: uint8(_BT_HEX),
  18592. 66: uint8(_BT_HEX),
  18593. 67: uint8(_BT_HEX),
  18594. 68: uint8(_BT_HEX),
  18595. 69: uint8(_BT_HEX),
  18596. 70: uint8(_BT_HEX),
  18597. 71: uint8(_BT_NMSTRT),
  18598. 72: uint8(_BT_NMSTRT),
  18599. 73: uint8(_BT_NMSTRT),
  18600. 74: uint8(_BT_NMSTRT),
  18601. 75: uint8(_BT_NMSTRT),
  18602. 76: uint8(_BT_NMSTRT),
  18603. 77: uint8(_BT_NMSTRT),
  18604. 78: uint8(_BT_NMSTRT),
  18605. 79: uint8(_BT_NMSTRT),
  18606. 80: uint8(_BT_NMSTRT),
  18607. 81: uint8(_BT_NMSTRT),
  18608. 82: uint8(_BT_NMSTRT),
  18609. 83: uint8(_BT_NMSTRT),
  18610. 84: uint8(_BT_NMSTRT),
  18611. 85: uint8(_BT_NMSTRT),
  18612. 86: uint8(_BT_NMSTRT),
  18613. 87: uint8(_BT_NMSTRT),
  18614. 88: uint8(_BT_NMSTRT),
  18615. 89: uint8(_BT_NMSTRT),
  18616. 90: uint8(_BT_NMSTRT),
  18617. 91: uint8(_BT_LSQB),
  18618. 92: uint8(_BT_OTHER),
  18619. 93: uint8(_BT_RSQB),
  18620. 94: uint8(_BT_OTHER),
  18621. 95: uint8(_BT_NMSTRT),
  18622. 96: uint8(_BT_OTHER),
  18623. 97: uint8(_BT_HEX),
  18624. 98: uint8(_BT_HEX),
  18625. 99: uint8(_BT_HEX),
  18626. 100: uint8(_BT_HEX),
  18627. 101: uint8(_BT_HEX),
  18628. 102: uint8(_BT_HEX),
  18629. 103: uint8(_BT_NMSTRT),
  18630. 104: uint8(_BT_NMSTRT),
  18631. 105: uint8(_BT_NMSTRT),
  18632. 106: uint8(_BT_NMSTRT),
  18633. 107: uint8(_BT_NMSTRT),
  18634. 108: uint8(_BT_NMSTRT),
  18635. 109: uint8(_BT_NMSTRT),
  18636. 110: uint8(_BT_NMSTRT),
  18637. 111: uint8(_BT_NMSTRT),
  18638. 112: uint8(_BT_NMSTRT),
  18639. 113: uint8(_BT_NMSTRT),
  18640. 114: uint8(_BT_NMSTRT),
  18641. 115: uint8(_BT_NMSTRT),
  18642. 116: uint8(_BT_NMSTRT),
  18643. 117: uint8(_BT_NMSTRT),
  18644. 118: uint8(_BT_NMSTRT),
  18645. 119: uint8(_BT_NMSTRT),
  18646. 120: uint8(_BT_NMSTRT),
  18647. 121: uint8(_BT_NMSTRT),
  18648. 122: uint8(_BT_NMSTRT),
  18649. 123: uint8(_BT_OTHER),
  18650. 124: uint8(_BT_VERBAR),
  18651. 125: uint8(_BT_OTHER),
  18652. 126: uint8(_BT_OTHER),
  18653. 127: uint8(_BT_OTHER),
  18654. 128: uint8(_BT_TRAIL),
  18655. 129: uint8(_BT_TRAIL),
  18656. 130: uint8(_BT_TRAIL),
  18657. 131: uint8(_BT_TRAIL),
  18658. 132: uint8(_BT_TRAIL),
  18659. 133: uint8(_BT_TRAIL),
  18660. 134: uint8(_BT_TRAIL),
  18661. 135: uint8(_BT_TRAIL),
  18662. 136: uint8(_BT_TRAIL),
  18663. 137: uint8(_BT_TRAIL),
  18664. 138: uint8(_BT_TRAIL),
  18665. 139: uint8(_BT_TRAIL),
  18666. 140: uint8(_BT_TRAIL),
  18667. 141: uint8(_BT_TRAIL),
  18668. 142: uint8(_BT_TRAIL),
  18669. 143: uint8(_BT_TRAIL),
  18670. 144: uint8(_BT_TRAIL),
  18671. 145: uint8(_BT_TRAIL),
  18672. 146: uint8(_BT_TRAIL),
  18673. 147: uint8(_BT_TRAIL),
  18674. 148: uint8(_BT_TRAIL),
  18675. 149: uint8(_BT_TRAIL),
  18676. 150: uint8(_BT_TRAIL),
  18677. 151: uint8(_BT_TRAIL),
  18678. 152: uint8(_BT_TRAIL),
  18679. 153: uint8(_BT_TRAIL),
  18680. 154: uint8(_BT_TRAIL),
  18681. 155: uint8(_BT_TRAIL),
  18682. 156: uint8(_BT_TRAIL),
  18683. 157: uint8(_BT_TRAIL),
  18684. 158: uint8(_BT_TRAIL),
  18685. 159: uint8(_BT_TRAIL),
  18686. 160: uint8(_BT_TRAIL),
  18687. 161: uint8(_BT_TRAIL),
  18688. 162: uint8(_BT_TRAIL),
  18689. 163: uint8(_BT_TRAIL),
  18690. 164: uint8(_BT_TRAIL),
  18691. 165: uint8(_BT_TRAIL),
  18692. 166: uint8(_BT_TRAIL),
  18693. 167: uint8(_BT_TRAIL),
  18694. 168: uint8(_BT_TRAIL),
  18695. 169: uint8(_BT_TRAIL),
  18696. 170: uint8(_BT_TRAIL),
  18697. 171: uint8(_BT_TRAIL),
  18698. 172: uint8(_BT_TRAIL),
  18699. 173: uint8(_BT_TRAIL),
  18700. 174: uint8(_BT_TRAIL),
  18701. 175: uint8(_BT_TRAIL),
  18702. 176: uint8(_BT_TRAIL),
  18703. 177: uint8(_BT_TRAIL),
  18704. 178: uint8(_BT_TRAIL),
  18705. 179: uint8(_BT_TRAIL),
  18706. 180: uint8(_BT_TRAIL),
  18707. 181: uint8(_BT_TRAIL),
  18708. 182: uint8(_BT_TRAIL),
  18709. 183: uint8(_BT_TRAIL),
  18710. 184: uint8(_BT_TRAIL),
  18711. 185: uint8(_BT_TRAIL),
  18712. 186: uint8(_BT_TRAIL),
  18713. 187: uint8(_BT_TRAIL),
  18714. 188: uint8(_BT_TRAIL),
  18715. 189: uint8(_BT_TRAIL),
  18716. 190: uint8(_BT_TRAIL),
  18717. 191: uint8(_BT_TRAIL),
  18718. 192: uint8(_BT_LEAD2),
  18719. 193: uint8(_BT_LEAD2),
  18720. 194: uint8(_BT_LEAD2),
  18721. 195: uint8(_BT_LEAD2),
  18722. 196: uint8(_BT_LEAD2),
  18723. 197: uint8(_BT_LEAD2),
  18724. 198: uint8(_BT_LEAD2),
  18725. 199: uint8(_BT_LEAD2),
  18726. 200: uint8(_BT_LEAD2),
  18727. 201: uint8(_BT_LEAD2),
  18728. 202: uint8(_BT_LEAD2),
  18729. 203: uint8(_BT_LEAD2),
  18730. 204: uint8(_BT_LEAD2),
  18731. 205: uint8(_BT_LEAD2),
  18732. 206: uint8(_BT_LEAD2),
  18733. 207: uint8(_BT_LEAD2),
  18734. 208: uint8(_BT_LEAD2),
  18735. 209: uint8(_BT_LEAD2),
  18736. 210: uint8(_BT_LEAD2),
  18737. 211: uint8(_BT_LEAD2),
  18738. 212: uint8(_BT_LEAD2),
  18739. 213: uint8(_BT_LEAD2),
  18740. 214: uint8(_BT_LEAD2),
  18741. 215: uint8(_BT_LEAD2),
  18742. 216: uint8(_BT_LEAD2),
  18743. 217: uint8(_BT_LEAD2),
  18744. 218: uint8(_BT_LEAD2),
  18745. 219: uint8(_BT_LEAD2),
  18746. 220: uint8(_BT_LEAD2),
  18747. 221: uint8(_BT_LEAD2),
  18748. 222: uint8(_BT_LEAD2),
  18749. 223: uint8(_BT_LEAD2),
  18750. 224: uint8(_BT_LEAD3),
  18751. 225: uint8(_BT_LEAD3),
  18752. 226: uint8(_BT_LEAD3),
  18753. 227: uint8(_BT_LEAD3),
  18754. 228: uint8(_BT_LEAD3),
  18755. 229: uint8(_BT_LEAD3),
  18756. 230: uint8(_BT_LEAD3),
  18757. 231: uint8(_BT_LEAD3),
  18758. 232: uint8(_BT_LEAD3),
  18759. 233: uint8(_BT_LEAD3),
  18760. 234: uint8(_BT_LEAD3),
  18761. 235: uint8(_BT_LEAD3),
  18762. 236: uint8(_BT_LEAD3),
  18763. 237: uint8(_BT_LEAD3),
  18764. 238: uint8(_BT_LEAD3),
  18765. 239: uint8(_BT_LEAD3),
  18766. 240: uint8(_BT_LEAD4),
  18767. 241: uint8(_BT_LEAD4),
  18768. 242: uint8(_BT_LEAD4),
  18769. 243: uint8(_BT_LEAD4),
  18770. 244: uint8(_BT_LEAD4),
  18771. 254: uint8(_BT_MALFORM),
  18772. 255: uint8(_BT_MALFORM),
  18773. },
  18774. }
  18775. func init() {
  18776. p := unsafe.Pointer(&_internal_utf8_encoding_ns)
  18777. *(*uintptr)(unsafe.Add(p, 0)) = __ccgo_fp(_normal_prologTok)
  18778. *(*uintptr)(unsafe.Add(p, 8)) = __ccgo_fp(_normal_contentTok)
  18779. *(*uintptr)(unsafe.Add(p, 16)) = __ccgo_fp(_normal_cdataSectionTok)
  18780. *(*uintptr)(unsafe.Add(p, 24)) = __ccgo_fp(_normal_ignoreSectionTok)
  18781. *(*uintptr)(unsafe.Add(p, 32)) = __ccgo_fp(_normal_attributeValueTok)
  18782. *(*uintptr)(unsafe.Add(p, 40)) = __ccgo_fp(_normal_entityValueTok)
  18783. *(*uintptr)(unsafe.Add(p, 48)) = __ccgo_fp(_normal_nameMatchesAscii)
  18784. *(*uintptr)(unsafe.Add(p, 56)) = __ccgo_fp(_normal_nameLength)
  18785. *(*uintptr)(unsafe.Add(p, 64)) = __ccgo_fp(_normal_skipS)
  18786. *(*uintptr)(unsafe.Add(p, 72)) = __ccgo_fp(_normal_getAtts)
  18787. *(*uintptr)(unsafe.Add(p, 80)) = __ccgo_fp(_normal_charRefNumber)
  18788. *(*uintptr)(unsafe.Add(p, 88)) = __ccgo_fp(_normal_predefinedEntityName)
  18789. *(*uintptr)(unsafe.Add(p, 96)) = __ccgo_fp(_normal_updatePosition)
  18790. *(*uintptr)(unsafe.Add(p, 104)) = __ccgo_fp(_normal_isPublicId)
  18791. *(*uintptr)(unsafe.Add(p, 112)) = __ccgo_fp(_utf8_toUtf8)
  18792. *(*uintptr)(unsafe.Add(p, 120)) = __ccgo_fp(_utf8_toUtf16)
  18793. *(*uintptr)(unsafe.Add(p, 392)) = __ccgo_fp(_utf8_isName2)
  18794. *(*uintptr)(unsafe.Add(p, 400)) = __ccgo_fp(_utf8_isName3)
  18795. *(*uintptr)(unsafe.Add(p, 408)) = __ccgo_fp(_isNever)
  18796. *(*uintptr)(unsafe.Add(p, 416)) = __ccgo_fp(_utf8_isNmstrt2)
  18797. *(*uintptr)(unsafe.Add(p, 424)) = __ccgo_fp(_utf8_isNmstrt3)
  18798. *(*uintptr)(unsafe.Add(p, 432)) = __ccgo_fp(_isNever)
  18799. *(*uintptr)(unsafe.Add(p, 440)) = __ccgo_fp(_utf8_isInvalid2)
  18800. *(*uintptr)(unsafe.Add(p, 448)) = __ccgo_fp(_utf8_isInvalid3)
  18801. *(*uintptr)(unsafe.Add(p, 456)) = __ccgo_fp(_utf8_isInvalid4)
  18802. }
  18803. var _internal_utf8_encoding = Tnormal_encoding{
  18804. Fenc: TENCODING{
  18805. Fscanners: [4]TSCANNER{},
  18806. FliteralScanners: [2]TSCANNER{},
  18807. FminBytesPerChar: int32(1),
  18808. FisUtf8: int8(1),
  18809. },
  18810. Ftype1: [256]uint8{
  18811. 9: uint8(_BT_S),
  18812. 10: uint8(_BT_LF),
  18813. 13: uint8(_BT_S),
  18814. 32: uint8(_BT_S),
  18815. 33: uint8(_BT_EXCL),
  18816. 34: uint8(_BT_QUOT),
  18817. 35: uint8(_BT_NUM),
  18818. 36: uint8(_BT_OTHER),
  18819. 37: uint8(_BT_PERCNT),
  18820. 38: uint8(_BT_AMP),
  18821. 39: uint8(_BT_APOS),
  18822. 40: uint8(_BT_LPAR),
  18823. 41: uint8(_BT_RPAR),
  18824. 42: uint8(_BT_AST),
  18825. 43: uint8(_BT_PLUS),
  18826. 44: uint8(_BT_COMMA),
  18827. 45: uint8(_BT_MINUS),
  18828. 46: uint8(_BT_NAME),
  18829. 47: uint8(_BT_SOL),
  18830. 48: uint8(_BT_DIGIT),
  18831. 49: uint8(_BT_DIGIT),
  18832. 50: uint8(_BT_DIGIT),
  18833. 51: uint8(_BT_DIGIT),
  18834. 52: uint8(_BT_DIGIT),
  18835. 53: uint8(_BT_DIGIT),
  18836. 54: uint8(_BT_DIGIT),
  18837. 55: uint8(_BT_DIGIT),
  18838. 56: uint8(_BT_DIGIT),
  18839. 57: uint8(_BT_DIGIT),
  18840. 58: uint8(_BT_NMSTRT),
  18841. 59: uint8(_BT_SEMI),
  18842. 60: uint8(_BT_LT),
  18843. 61: uint8(_BT_EQUALS),
  18844. 62: uint8(_BT_GT),
  18845. 63: uint8(_BT_QUEST),
  18846. 64: uint8(_BT_OTHER),
  18847. 65: uint8(_BT_HEX),
  18848. 66: uint8(_BT_HEX),
  18849. 67: uint8(_BT_HEX),
  18850. 68: uint8(_BT_HEX),
  18851. 69: uint8(_BT_HEX),
  18852. 70: uint8(_BT_HEX),
  18853. 71: uint8(_BT_NMSTRT),
  18854. 72: uint8(_BT_NMSTRT),
  18855. 73: uint8(_BT_NMSTRT),
  18856. 74: uint8(_BT_NMSTRT),
  18857. 75: uint8(_BT_NMSTRT),
  18858. 76: uint8(_BT_NMSTRT),
  18859. 77: uint8(_BT_NMSTRT),
  18860. 78: uint8(_BT_NMSTRT),
  18861. 79: uint8(_BT_NMSTRT),
  18862. 80: uint8(_BT_NMSTRT),
  18863. 81: uint8(_BT_NMSTRT),
  18864. 82: uint8(_BT_NMSTRT),
  18865. 83: uint8(_BT_NMSTRT),
  18866. 84: uint8(_BT_NMSTRT),
  18867. 85: uint8(_BT_NMSTRT),
  18868. 86: uint8(_BT_NMSTRT),
  18869. 87: uint8(_BT_NMSTRT),
  18870. 88: uint8(_BT_NMSTRT),
  18871. 89: uint8(_BT_NMSTRT),
  18872. 90: uint8(_BT_NMSTRT),
  18873. 91: uint8(_BT_LSQB),
  18874. 92: uint8(_BT_OTHER),
  18875. 93: uint8(_BT_RSQB),
  18876. 94: uint8(_BT_OTHER),
  18877. 95: uint8(_BT_NMSTRT),
  18878. 96: uint8(_BT_OTHER),
  18879. 97: uint8(_BT_HEX),
  18880. 98: uint8(_BT_HEX),
  18881. 99: uint8(_BT_HEX),
  18882. 100: uint8(_BT_HEX),
  18883. 101: uint8(_BT_HEX),
  18884. 102: uint8(_BT_HEX),
  18885. 103: uint8(_BT_NMSTRT),
  18886. 104: uint8(_BT_NMSTRT),
  18887. 105: uint8(_BT_NMSTRT),
  18888. 106: uint8(_BT_NMSTRT),
  18889. 107: uint8(_BT_NMSTRT),
  18890. 108: uint8(_BT_NMSTRT),
  18891. 109: uint8(_BT_NMSTRT),
  18892. 110: uint8(_BT_NMSTRT),
  18893. 111: uint8(_BT_NMSTRT),
  18894. 112: uint8(_BT_NMSTRT),
  18895. 113: uint8(_BT_NMSTRT),
  18896. 114: uint8(_BT_NMSTRT),
  18897. 115: uint8(_BT_NMSTRT),
  18898. 116: uint8(_BT_NMSTRT),
  18899. 117: uint8(_BT_NMSTRT),
  18900. 118: uint8(_BT_NMSTRT),
  18901. 119: uint8(_BT_NMSTRT),
  18902. 120: uint8(_BT_NMSTRT),
  18903. 121: uint8(_BT_NMSTRT),
  18904. 122: uint8(_BT_NMSTRT),
  18905. 123: uint8(_BT_OTHER),
  18906. 124: uint8(_BT_VERBAR),
  18907. 125: uint8(_BT_OTHER),
  18908. 126: uint8(_BT_OTHER),
  18909. 127: uint8(_BT_OTHER),
  18910. 128: uint8(_BT_TRAIL),
  18911. 129: uint8(_BT_TRAIL),
  18912. 130: uint8(_BT_TRAIL),
  18913. 131: uint8(_BT_TRAIL),
  18914. 132: uint8(_BT_TRAIL),
  18915. 133: uint8(_BT_TRAIL),
  18916. 134: uint8(_BT_TRAIL),
  18917. 135: uint8(_BT_TRAIL),
  18918. 136: uint8(_BT_TRAIL),
  18919. 137: uint8(_BT_TRAIL),
  18920. 138: uint8(_BT_TRAIL),
  18921. 139: uint8(_BT_TRAIL),
  18922. 140: uint8(_BT_TRAIL),
  18923. 141: uint8(_BT_TRAIL),
  18924. 142: uint8(_BT_TRAIL),
  18925. 143: uint8(_BT_TRAIL),
  18926. 144: uint8(_BT_TRAIL),
  18927. 145: uint8(_BT_TRAIL),
  18928. 146: uint8(_BT_TRAIL),
  18929. 147: uint8(_BT_TRAIL),
  18930. 148: uint8(_BT_TRAIL),
  18931. 149: uint8(_BT_TRAIL),
  18932. 150: uint8(_BT_TRAIL),
  18933. 151: uint8(_BT_TRAIL),
  18934. 152: uint8(_BT_TRAIL),
  18935. 153: uint8(_BT_TRAIL),
  18936. 154: uint8(_BT_TRAIL),
  18937. 155: uint8(_BT_TRAIL),
  18938. 156: uint8(_BT_TRAIL),
  18939. 157: uint8(_BT_TRAIL),
  18940. 158: uint8(_BT_TRAIL),
  18941. 159: uint8(_BT_TRAIL),
  18942. 160: uint8(_BT_TRAIL),
  18943. 161: uint8(_BT_TRAIL),
  18944. 162: uint8(_BT_TRAIL),
  18945. 163: uint8(_BT_TRAIL),
  18946. 164: uint8(_BT_TRAIL),
  18947. 165: uint8(_BT_TRAIL),
  18948. 166: uint8(_BT_TRAIL),
  18949. 167: uint8(_BT_TRAIL),
  18950. 168: uint8(_BT_TRAIL),
  18951. 169: uint8(_BT_TRAIL),
  18952. 170: uint8(_BT_TRAIL),
  18953. 171: uint8(_BT_TRAIL),
  18954. 172: uint8(_BT_TRAIL),
  18955. 173: uint8(_BT_TRAIL),
  18956. 174: uint8(_BT_TRAIL),
  18957. 175: uint8(_BT_TRAIL),
  18958. 176: uint8(_BT_TRAIL),
  18959. 177: uint8(_BT_TRAIL),
  18960. 178: uint8(_BT_TRAIL),
  18961. 179: uint8(_BT_TRAIL),
  18962. 180: uint8(_BT_TRAIL),
  18963. 181: uint8(_BT_TRAIL),
  18964. 182: uint8(_BT_TRAIL),
  18965. 183: uint8(_BT_TRAIL),
  18966. 184: uint8(_BT_TRAIL),
  18967. 185: uint8(_BT_TRAIL),
  18968. 186: uint8(_BT_TRAIL),
  18969. 187: uint8(_BT_TRAIL),
  18970. 188: uint8(_BT_TRAIL),
  18971. 189: uint8(_BT_TRAIL),
  18972. 190: uint8(_BT_TRAIL),
  18973. 191: uint8(_BT_TRAIL),
  18974. 192: uint8(_BT_LEAD2),
  18975. 193: uint8(_BT_LEAD2),
  18976. 194: uint8(_BT_LEAD2),
  18977. 195: uint8(_BT_LEAD2),
  18978. 196: uint8(_BT_LEAD2),
  18979. 197: uint8(_BT_LEAD2),
  18980. 198: uint8(_BT_LEAD2),
  18981. 199: uint8(_BT_LEAD2),
  18982. 200: uint8(_BT_LEAD2),
  18983. 201: uint8(_BT_LEAD2),
  18984. 202: uint8(_BT_LEAD2),
  18985. 203: uint8(_BT_LEAD2),
  18986. 204: uint8(_BT_LEAD2),
  18987. 205: uint8(_BT_LEAD2),
  18988. 206: uint8(_BT_LEAD2),
  18989. 207: uint8(_BT_LEAD2),
  18990. 208: uint8(_BT_LEAD2),
  18991. 209: uint8(_BT_LEAD2),
  18992. 210: uint8(_BT_LEAD2),
  18993. 211: uint8(_BT_LEAD2),
  18994. 212: uint8(_BT_LEAD2),
  18995. 213: uint8(_BT_LEAD2),
  18996. 214: uint8(_BT_LEAD2),
  18997. 215: uint8(_BT_LEAD2),
  18998. 216: uint8(_BT_LEAD2),
  18999. 217: uint8(_BT_LEAD2),
  19000. 218: uint8(_BT_LEAD2),
  19001. 219: uint8(_BT_LEAD2),
  19002. 220: uint8(_BT_LEAD2),
  19003. 221: uint8(_BT_LEAD2),
  19004. 222: uint8(_BT_LEAD2),
  19005. 223: uint8(_BT_LEAD2),
  19006. 224: uint8(_BT_LEAD3),
  19007. 225: uint8(_BT_LEAD3),
  19008. 226: uint8(_BT_LEAD3),
  19009. 227: uint8(_BT_LEAD3),
  19010. 228: uint8(_BT_LEAD3),
  19011. 229: uint8(_BT_LEAD3),
  19012. 230: uint8(_BT_LEAD3),
  19013. 231: uint8(_BT_LEAD3),
  19014. 232: uint8(_BT_LEAD3),
  19015. 233: uint8(_BT_LEAD3),
  19016. 234: uint8(_BT_LEAD3),
  19017. 235: uint8(_BT_LEAD3),
  19018. 236: uint8(_BT_LEAD3),
  19019. 237: uint8(_BT_LEAD3),
  19020. 238: uint8(_BT_LEAD3),
  19021. 239: uint8(_BT_LEAD3),
  19022. 240: uint8(_BT_LEAD4),
  19023. 241: uint8(_BT_LEAD4),
  19024. 242: uint8(_BT_LEAD4),
  19025. 243: uint8(_BT_LEAD4),
  19026. 244: uint8(_BT_LEAD4),
  19027. 254: uint8(_BT_MALFORM),
  19028. 255: uint8(_BT_MALFORM),
  19029. },
  19030. }
  19031. func init() {
  19032. p := unsafe.Pointer(&_internal_utf8_encoding)
  19033. *(*uintptr)(unsafe.Add(p, 0)) = __ccgo_fp(_normal_prologTok)
  19034. *(*uintptr)(unsafe.Add(p, 8)) = __ccgo_fp(_normal_contentTok)
  19035. *(*uintptr)(unsafe.Add(p, 16)) = __ccgo_fp(_normal_cdataSectionTok)
  19036. *(*uintptr)(unsafe.Add(p, 24)) = __ccgo_fp(_normal_ignoreSectionTok)
  19037. *(*uintptr)(unsafe.Add(p, 32)) = __ccgo_fp(_normal_attributeValueTok)
  19038. *(*uintptr)(unsafe.Add(p, 40)) = __ccgo_fp(_normal_entityValueTok)
  19039. *(*uintptr)(unsafe.Add(p, 48)) = __ccgo_fp(_normal_nameMatchesAscii)
  19040. *(*uintptr)(unsafe.Add(p, 56)) = __ccgo_fp(_normal_nameLength)
  19041. *(*uintptr)(unsafe.Add(p, 64)) = __ccgo_fp(_normal_skipS)
  19042. *(*uintptr)(unsafe.Add(p, 72)) = __ccgo_fp(_normal_getAtts)
  19043. *(*uintptr)(unsafe.Add(p, 80)) = __ccgo_fp(_normal_charRefNumber)
  19044. *(*uintptr)(unsafe.Add(p, 88)) = __ccgo_fp(_normal_predefinedEntityName)
  19045. *(*uintptr)(unsafe.Add(p, 96)) = __ccgo_fp(_normal_updatePosition)
  19046. *(*uintptr)(unsafe.Add(p, 104)) = __ccgo_fp(_normal_isPublicId)
  19047. *(*uintptr)(unsafe.Add(p, 112)) = __ccgo_fp(_utf8_toUtf8)
  19048. *(*uintptr)(unsafe.Add(p, 120)) = __ccgo_fp(_utf8_toUtf16)
  19049. *(*uintptr)(unsafe.Add(p, 392)) = __ccgo_fp(_utf8_isName2)
  19050. *(*uintptr)(unsafe.Add(p, 400)) = __ccgo_fp(_utf8_isName3)
  19051. *(*uintptr)(unsafe.Add(p, 408)) = __ccgo_fp(_isNever)
  19052. *(*uintptr)(unsafe.Add(p, 416)) = __ccgo_fp(_utf8_isNmstrt2)
  19053. *(*uintptr)(unsafe.Add(p, 424)) = __ccgo_fp(_utf8_isNmstrt3)
  19054. *(*uintptr)(unsafe.Add(p, 432)) = __ccgo_fp(_isNever)
  19055. *(*uintptr)(unsafe.Add(p, 440)) = __ccgo_fp(_utf8_isInvalid2)
  19056. *(*uintptr)(unsafe.Add(p, 448)) = __ccgo_fp(_utf8_isInvalid3)
  19057. *(*uintptr)(unsafe.Add(p, 456)) = __ccgo_fp(_utf8_isInvalid4)
  19058. }
  19059. func _latin1_toUtf8(tls *libc.TLS, enc uintptr, fromP uintptr, fromLim uintptr, toP uintptr, toLim uintptr) (r _XML_Convert_Result) {
  19060. var c uint8
  19061. var v2, v3, v4, v5, v6, v7, v8, v9 uintptr
  19062. _, _, _, _, _, _, _, _, _ = c, v2, v3, v4, v5, v6, v7, v8, v9
  19063. _ = enc
  19064. for {
  19065. if *(*uintptr)(unsafe.Pointer(fromP)) == fromLim {
  19066. return int32(_XML_CONVERT_COMPLETED)
  19067. }
  19068. c = libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(fromP)))))
  19069. if libc.Int32FromUint8(c)&int32(0x80) != 0 {
  19070. if int64(toLim)-int64(*(*uintptr)(unsafe.Pointer(toP))) < int64(2) {
  19071. return int32(_XML_CONVERT_OUTPUT_EXHAUSTED)
  19072. }
  19073. v3 = toP
  19074. v2 = *(*uintptr)(unsafe.Pointer(v3))
  19075. *(*uintptr)(unsafe.Pointer(v3))++
  19076. *(*int8)(unsafe.Pointer(v2)) = int8(libc.Int32FromUint8(c)>>libc.Int32FromInt32(6) | int32(_UTF8_cval2))
  19077. v5 = toP
  19078. v4 = *(*uintptr)(unsafe.Pointer(v5))
  19079. *(*uintptr)(unsafe.Pointer(v5))++
  19080. *(*int8)(unsafe.Pointer(v4)) = int8(libc.Int32FromUint8(c)&libc.Int32FromInt32(0x3f) | libc.Int32FromInt32(0x80))
  19081. *(*uintptr)(unsafe.Pointer(fromP))++
  19082. } else {
  19083. if *(*uintptr)(unsafe.Pointer(toP)) == toLim {
  19084. return int32(_XML_CONVERT_OUTPUT_EXHAUSTED)
  19085. }
  19086. v7 = toP
  19087. v6 = *(*uintptr)(unsafe.Pointer(v7))
  19088. *(*uintptr)(unsafe.Pointer(v7))++
  19089. v9 = fromP
  19090. v8 = *(*uintptr)(unsafe.Pointer(v9))
  19091. *(*uintptr)(unsafe.Pointer(v9))++
  19092. *(*int8)(unsafe.Pointer(v6)) = *(*int8)(unsafe.Pointer(v8))
  19093. }
  19094. goto _1
  19095. _1:
  19096. }
  19097. return r
  19098. }
  19099. func _latin1_toUtf16(tls *libc.TLS, enc uintptr, fromP uintptr, fromLim uintptr, toP uintptr, toLim uintptr) (r _XML_Convert_Result) {
  19100. var v1, v2, v3, v4 uintptr
  19101. _, _, _, _ = v1, v2, v3, v4
  19102. _ = enc
  19103. for *(*uintptr)(unsafe.Pointer(fromP)) < fromLim && *(*uintptr)(unsafe.Pointer(toP)) < toLim {
  19104. v2 = toP
  19105. v1 = *(*uintptr)(unsafe.Pointer(v2))
  19106. *(*uintptr)(unsafe.Pointer(v2)) += 2
  19107. v4 = fromP
  19108. v3 = *(*uintptr)(unsafe.Pointer(v4))
  19109. *(*uintptr)(unsafe.Pointer(v4))++
  19110. *(*uint16)(unsafe.Pointer(v1)) = uint16(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(v3))))
  19111. }
  19112. if *(*uintptr)(unsafe.Pointer(toP)) == toLim && *(*uintptr)(unsafe.Pointer(fromP)) < fromLim {
  19113. return int32(_XML_CONVERT_OUTPUT_EXHAUSTED)
  19114. } else {
  19115. return int32(_XML_CONVERT_COMPLETED)
  19116. }
  19117. return r
  19118. }
  19119. var _latin1_encoding_ns = Tnormal_encoding{
  19120. Fenc: TENCODING{
  19121. Fscanners: [4]TSCANNER{},
  19122. FliteralScanners: [2]TSCANNER{},
  19123. FminBytesPerChar: int32(1),
  19124. },
  19125. Ftype1: [256]uint8{
  19126. 9: uint8(_BT_S),
  19127. 10: uint8(_BT_LF),
  19128. 13: uint8(_BT_CR),
  19129. 32: uint8(_BT_S),
  19130. 33: uint8(_BT_EXCL),
  19131. 34: uint8(_BT_QUOT),
  19132. 35: uint8(_BT_NUM),
  19133. 36: uint8(_BT_OTHER),
  19134. 37: uint8(_BT_PERCNT),
  19135. 38: uint8(_BT_AMP),
  19136. 39: uint8(_BT_APOS),
  19137. 40: uint8(_BT_LPAR),
  19138. 41: uint8(_BT_RPAR),
  19139. 42: uint8(_BT_AST),
  19140. 43: uint8(_BT_PLUS),
  19141. 44: uint8(_BT_COMMA),
  19142. 45: uint8(_BT_MINUS),
  19143. 46: uint8(_BT_NAME),
  19144. 47: uint8(_BT_SOL),
  19145. 48: uint8(_BT_DIGIT),
  19146. 49: uint8(_BT_DIGIT),
  19147. 50: uint8(_BT_DIGIT),
  19148. 51: uint8(_BT_DIGIT),
  19149. 52: uint8(_BT_DIGIT),
  19150. 53: uint8(_BT_DIGIT),
  19151. 54: uint8(_BT_DIGIT),
  19152. 55: uint8(_BT_DIGIT),
  19153. 56: uint8(_BT_DIGIT),
  19154. 57: uint8(_BT_DIGIT),
  19155. 58: uint8(_BT_COLON),
  19156. 59: uint8(_BT_SEMI),
  19157. 60: uint8(_BT_LT),
  19158. 61: uint8(_BT_EQUALS),
  19159. 62: uint8(_BT_GT),
  19160. 63: uint8(_BT_QUEST),
  19161. 64: uint8(_BT_OTHER),
  19162. 65: uint8(_BT_HEX),
  19163. 66: uint8(_BT_HEX),
  19164. 67: uint8(_BT_HEX),
  19165. 68: uint8(_BT_HEX),
  19166. 69: uint8(_BT_HEX),
  19167. 70: uint8(_BT_HEX),
  19168. 71: uint8(_BT_NMSTRT),
  19169. 72: uint8(_BT_NMSTRT),
  19170. 73: uint8(_BT_NMSTRT),
  19171. 74: uint8(_BT_NMSTRT),
  19172. 75: uint8(_BT_NMSTRT),
  19173. 76: uint8(_BT_NMSTRT),
  19174. 77: uint8(_BT_NMSTRT),
  19175. 78: uint8(_BT_NMSTRT),
  19176. 79: uint8(_BT_NMSTRT),
  19177. 80: uint8(_BT_NMSTRT),
  19178. 81: uint8(_BT_NMSTRT),
  19179. 82: uint8(_BT_NMSTRT),
  19180. 83: uint8(_BT_NMSTRT),
  19181. 84: uint8(_BT_NMSTRT),
  19182. 85: uint8(_BT_NMSTRT),
  19183. 86: uint8(_BT_NMSTRT),
  19184. 87: uint8(_BT_NMSTRT),
  19185. 88: uint8(_BT_NMSTRT),
  19186. 89: uint8(_BT_NMSTRT),
  19187. 90: uint8(_BT_NMSTRT),
  19188. 91: uint8(_BT_LSQB),
  19189. 92: uint8(_BT_OTHER),
  19190. 93: uint8(_BT_RSQB),
  19191. 94: uint8(_BT_OTHER),
  19192. 95: uint8(_BT_NMSTRT),
  19193. 96: uint8(_BT_OTHER),
  19194. 97: uint8(_BT_HEX),
  19195. 98: uint8(_BT_HEX),
  19196. 99: uint8(_BT_HEX),
  19197. 100: uint8(_BT_HEX),
  19198. 101: uint8(_BT_HEX),
  19199. 102: uint8(_BT_HEX),
  19200. 103: uint8(_BT_NMSTRT),
  19201. 104: uint8(_BT_NMSTRT),
  19202. 105: uint8(_BT_NMSTRT),
  19203. 106: uint8(_BT_NMSTRT),
  19204. 107: uint8(_BT_NMSTRT),
  19205. 108: uint8(_BT_NMSTRT),
  19206. 109: uint8(_BT_NMSTRT),
  19207. 110: uint8(_BT_NMSTRT),
  19208. 111: uint8(_BT_NMSTRT),
  19209. 112: uint8(_BT_NMSTRT),
  19210. 113: uint8(_BT_NMSTRT),
  19211. 114: uint8(_BT_NMSTRT),
  19212. 115: uint8(_BT_NMSTRT),
  19213. 116: uint8(_BT_NMSTRT),
  19214. 117: uint8(_BT_NMSTRT),
  19215. 118: uint8(_BT_NMSTRT),
  19216. 119: uint8(_BT_NMSTRT),
  19217. 120: uint8(_BT_NMSTRT),
  19218. 121: uint8(_BT_NMSTRT),
  19219. 122: uint8(_BT_NMSTRT),
  19220. 123: uint8(_BT_OTHER),
  19221. 124: uint8(_BT_VERBAR),
  19222. 125: uint8(_BT_OTHER),
  19223. 126: uint8(_BT_OTHER),
  19224. 127: uint8(_BT_OTHER),
  19225. 128: uint8(_BT_OTHER),
  19226. 129: uint8(_BT_OTHER),
  19227. 130: uint8(_BT_OTHER),
  19228. 131: uint8(_BT_OTHER),
  19229. 132: uint8(_BT_OTHER),
  19230. 133: uint8(_BT_OTHER),
  19231. 134: uint8(_BT_OTHER),
  19232. 135: uint8(_BT_OTHER),
  19233. 136: uint8(_BT_OTHER),
  19234. 137: uint8(_BT_OTHER),
  19235. 138: uint8(_BT_OTHER),
  19236. 139: uint8(_BT_OTHER),
  19237. 140: uint8(_BT_OTHER),
  19238. 141: uint8(_BT_OTHER),
  19239. 142: uint8(_BT_OTHER),
  19240. 143: uint8(_BT_OTHER),
  19241. 144: uint8(_BT_OTHER),
  19242. 145: uint8(_BT_OTHER),
  19243. 146: uint8(_BT_OTHER),
  19244. 147: uint8(_BT_OTHER),
  19245. 148: uint8(_BT_OTHER),
  19246. 149: uint8(_BT_OTHER),
  19247. 150: uint8(_BT_OTHER),
  19248. 151: uint8(_BT_OTHER),
  19249. 152: uint8(_BT_OTHER),
  19250. 153: uint8(_BT_OTHER),
  19251. 154: uint8(_BT_OTHER),
  19252. 155: uint8(_BT_OTHER),
  19253. 156: uint8(_BT_OTHER),
  19254. 157: uint8(_BT_OTHER),
  19255. 158: uint8(_BT_OTHER),
  19256. 159: uint8(_BT_OTHER),
  19257. 160: uint8(_BT_OTHER),
  19258. 161: uint8(_BT_OTHER),
  19259. 162: uint8(_BT_OTHER),
  19260. 163: uint8(_BT_OTHER),
  19261. 164: uint8(_BT_OTHER),
  19262. 165: uint8(_BT_OTHER),
  19263. 166: uint8(_BT_OTHER),
  19264. 167: uint8(_BT_OTHER),
  19265. 168: uint8(_BT_OTHER),
  19266. 169: uint8(_BT_OTHER),
  19267. 170: uint8(_BT_NMSTRT),
  19268. 171: uint8(_BT_OTHER),
  19269. 172: uint8(_BT_OTHER),
  19270. 173: uint8(_BT_OTHER),
  19271. 174: uint8(_BT_OTHER),
  19272. 175: uint8(_BT_OTHER),
  19273. 176: uint8(_BT_OTHER),
  19274. 177: uint8(_BT_OTHER),
  19275. 178: uint8(_BT_OTHER),
  19276. 179: uint8(_BT_OTHER),
  19277. 180: uint8(_BT_OTHER),
  19278. 181: uint8(_BT_NMSTRT),
  19279. 182: uint8(_BT_OTHER),
  19280. 183: uint8(_BT_NAME),
  19281. 184: uint8(_BT_OTHER),
  19282. 185: uint8(_BT_OTHER),
  19283. 186: uint8(_BT_NMSTRT),
  19284. 187: uint8(_BT_OTHER),
  19285. 188: uint8(_BT_OTHER),
  19286. 189: uint8(_BT_OTHER),
  19287. 190: uint8(_BT_OTHER),
  19288. 191: uint8(_BT_OTHER),
  19289. 192: uint8(_BT_NMSTRT),
  19290. 193: uint8(_BT_NMSTRT),
  19291. 194: uint8(_BT_NMSTRT),
  19292. 195: uint8(_BT_NMSTRT),
  19293. 196: uint8(_BT_NMSTRT),
  19294. 197: uint8(_BT_NMSTRT),
  19295. 198: uint8(_BT_NMSTRT),
  19296. 199: uint8(_BT_NMSTRT),
  19297. 200: uint8(_BT_NMSTRT),
  19298. 201: uint8(_BT_NMSTRT),
  19299. 202: uint8(_BT_NMSTRT),
  19300. 203: uint8(_BT_NMSTRT),
  19301. 204: uint8(_BT_NMSTRT),
  19302. 205: uint8(_BT_NMSTRT),
  19303. 206: uint8(_BT_NMSTRT),
  19304. 207: uint8(_BT_NMSTRT),
  19305. 208: uint8(_BT_NMSTRT),
  19306. 209: uint8(_BT_NMSTRT),
  19307. 210: uint8(_BT_NMSTRT),
  19308. 211: uint8(_BT_NMSTRT),
  19309. 212: uint8(_BT_NMSTRT),
  19310. 213: uint8(_BT_NMSTRT),
  19311. 214: uint8(_BT_NMSTRT),
  19312. 215: uint8(_BT_OTHER),
  19313. 216: uint8(_BT_NMSTRT),
  19314. 217: uint8(_BT_NMSTRT),
  19315. 218: uint8(_BT_NMSTRT),
  19316. 219: uint8(_BT_NMSTRT),
  19317. 220: uint8(_BT_NMSTRT),
  19318. 221: uint8(_BT_NMSTRT),
  19319. 222: uint8(_BT_NMSTRT),
  19320. 223: uint8(_BT_NMSTRT),
  19321. 224: uint8(_BT_NMSTRT),
  19322. 225: uint8(_BT_NMSTRT),
  19323. 226: uint8(_BT_NMSTRT),
  19324. 227: uint8(_BT_NMSTRT),
  19325. 228: uint8(_BT_NMSTRT),
  19326. 229: uint8(_BT_NMSTRT),
  19327. 230: uint8(_BT_NMSTRT),
  19328. 231: uint8(_BT_NMSTRT),
  19329. 232: uint8(_BT_NMSTRT),
  19330. 233: uint8(_BT_NMSTRT),
  19331. 234: uint8(_BT_NMSTRT),
  19332. 235: uint8(_BT_NMSTRT),
  19333. 236: uint8(_BT_NMSTRT),
  19334. 237: uint8(_BT_NMSTRT),
  19335. 238: uint8(_BT_NMSTRT),
  19336. 239: uint8(_BT_NMSTRT),
  19337. 240: uint8(_BT_NMSTRT),
  19338. 241: uint8(_BT_NMSTRT),
  19339. 242: uint8(_BT_NMSTRT),
  19340. 243: uint8(_BT_NMSTRT),
  19341. 244: uint8(_BT_NMSTRT),
  19342. 245: uint8(_BT_NMSTRT),
  19343. 246: uint8(_BT_NMSTRT),
  19344. 247: uint8(_BT_OTHER),
  19345. 248: uint8(_BT_NMSTRT),
  19346. 249: uint8(_BT_NMSTRT),
  19347. 250: uint8(_BT_NMSTRT),
  19348. 251: uint8(_BT_NMSTRT),
  19349. 252: uint8(_BT_NMSTRT),
  19350. 253: uint8(_BT_NMSTRT),
  19351. 254: uint8(_BT_NMSTRT),
  19352. 255: uint8(_BT_NMSTRT),
  19353. },
  19354. }
  19355. func init() {
  19356. p := unsafe.Pointer(&_latin1_encoding_ns)
  19357. *(*uintptr)(unsafe.Add(p, 0)) = __ccgo_fp(_normal_prologTok)
  19358. *(*uintptr)(unsafe.Add(p, 8)) = __ccgo_fp(_normal_contentTok)
  19359. *(*uintptr)(unsafe.Add(p, 16)) = __ccgo_fp(_normal_cdataSectionTok)
  19360. *(*uintptr)(unsafe.Add(p, 24)) = __ccgo_fp(_normal_ignoreSectionTok)
  19361. *(*uintptr)(unsafe.Add(p, 32)) = __ccgo_fp(_normal_attributeValueTok)
  19362. *(*uintptr)(unsafe.Add(p, 40)) = __ccgo_fp(_normal_entityValueTok)
  19363. *(*uintptr)(unsafe.Add(p, 48)) = __ccgo_fp(_normal_nameMatchesAscii)
  19364. *(*uintptr)(unsafe.Add(p, 56)) = __ccgo_fp(_normal_nameLength)
  19365. *(*uintptr)(unsafe.Add(p, 64)) = __ccgo_fp(_normal_skipS)
  19366. *(*uintptr)(unsafe.Add(p, 72)) = __ccgo_fp(_normal_getAtts)
  19367. *(*uintptr)(unsafe.Add(p, 80)) = __ccgo_fp(_normal_charRefNumber)
  19368. *(*uintptr)(unsafe.Add(p, 88)) = __ccgo_fp(_normal_predefinedEntityName)
  19369. *(*uintptr)(unsafe.Add(p, 96)) = __ccgo_fp(_normal_updatePosition)
  19370. *(*uintptr)(unsafe.Add(p, 104)) = __ccgo_fp(_normal_isPublicId)
  19371. *(*uintptr)(unsafe.Add(p, 112)) = __ccgo_fp(_latin1_toUtf8)
  19372. *(*uintptr)(unsafe.Add(p, 120)) = __ccgo_fp(_latin1_toUtf16)
  19373. }
  19374. var _latin1_encoding = Tnormal_encoding{
  19375. Fenc: TENCODING{
  19376. Fscanners: [4]TSCANNER{},
  19377. FliteralScanners: [2]TSCANNER{},
  19378. FminBytesPerChar: int32(1),
  19379. },
  19380. Ftype1: [256]uint8{
  19381. 9: uint8(_BT_S),
  19382. 10: uint8(_BT_LF),
  19383. 13: uint8(_BT_CR),
  19384. 32: uint8(_BT_S),
  19385. 33: uint8(_BT_EXCL),
  19386. 34: uint8(_BT_QUOT),
  19387. 35: uint8(_BT_NUM),
  19388. 36: uint8(_BT_OTHER),
  19389. 37: uint8(_BT_PERCNT),
  19390. 38: uint8(_BT_AMP),
  19391. 39: uint8(_BT_APOS),
  19392. 40: uint8(_BT_LPAR),
  19393. 41: uint8(_BT_RPAR),
  19394. 42: uint8(_BT_AST),
  19395. 43: uint8(_BT_PLUS),
  19396. 44: uint8(_BT_COMMA),
  19397. 45: uint8(_BT_MINUS),
  19398. 46: uint8(_BT_NAME),
  19399. 47: uint8(_BT_SOL),
  19400. 48: uint8(_BT_DIGIT),
  19401. 49: uint8(_BT_DIGIT),
  19402. 50: uint8(_BT_DIGIT),
  19403. 51: uint8(_BT_DIGIT),
  19404. 52: uint8(_BT_DIGIT),
  19405. 53: uint8(_BT_DIGIT),
  19406. 54: uint8(_BT_DIGIT),
  19407. 55: uint8(_BT_DIGIT),
  19408. 56: uint8(_BT_DIGIT),
  19409. 57: uint8(_BT_DIGIT),
  19410. 58: uint8(_BT_NMSTRT),
  19411. 59: uint8(_BT_SEMI),
  19412. 60: uint8(_BT_LT),
  19413. 61: uint8(_BT_EQUALS),
  19414. 62: uint8(_BT_GT),
  19415. 63: uint8(_BT_QUEST),
  19416. 64: uint8(_BT_OTHER),
  19417. 65: uint8(_BT_HEX),
  19418. 66: uint8(_BT_HEX),
  19419. 67: uint8(_BT_HEX),
  19420. 68: uint8(_BT_HEX),
  19421. 69: uint8(_BT_HEX),
  19422. 70: uint8(_BT_HEX),
  19423. 71: uint8(_BT_NMSTRT),
  19424. 72: uint8(_BT_NMSTRT),
  19425. 73: uint8(_BT_NMSTRT),
  19426. 74: uint8(_BT_NMSTRT),
  19427. 75: uint8(_BT_NMSTRT),
  19428. 76: uint8(_BT_NMSTRT),
  19429. 77: uint8(_BT_NMSTRT),
  19430. 78: uint8(_BT_NMSTRT),
  19431. 79: uint8(_BT_NMSTRT),
  19432. 80: uint8(_BT_NMSTRT),
  19433. 81: uint8(_BT_NMSTRT),
  19434. 82: uint8(_BT_NMSTRT),
  19435. 83: uint8(_BT_NMSTRT),
  19436. 84: uint8(_BT_NMSTRT),
  19437. 85: uint8(_BT_NMSTRT),
  19438. 86: uint8(_BT_NMSTRT),
  19439. 87: uint8(_BT_NMSTRT),
  19440. 88: uint8(_BT_NMSTRT),
  19441. 89: uint8(_BT_NMSTRT),
  19442. 90: uint8(_BT_NMSTRT),
  19443. 91: uint8(_BT_LSQB),
  19444. 92: uint8(_BT_OTHER),
  19445. 93: uint8(_BT_RSQB),
  19446. 94: uint8(_BT_OTHER),
  19447. 95: uint8(_BT_NMSTRT),
  19448. 96: uint8(_BT_OTHER),
  19449. 97: uint8(_BT_HEX),
  19450. 98: uint8(_BT_HEX),
  19451. 99: uint8(_BT_HEX),
  19452. 100: uint8(_BT_HEX),
  19453. 101: uint8(_BT_HEX),
  19454. 102: uint8(_BT_HEX),
  19455. 103: uint8(_BT_NMSTRT),
  19456. 104: uint8(_BT_NMSTRT),
  19457. 105: uint8(_BT_NMSTRT),
  19458. 106: uint8(_BT_NMSTRT),
  19459. 107: uint8(_BT_NMSTRT),
  19460. 108: uint8(_BT_NMSTRT),
  19461. 109: uint8(_BT_NMSTRT),
  19462. 110: uint8(_BT_NMSTRT),
  19463. 111: uint8(_BT_NMSTRT),
  19464. 112: uint8(_BT_NMSTRT),
  19465. 113: uint8(_BT_NMSTRT),
  19466. 114: uint8(_BT_NMSTRT),
  19467. 115: uint8(_BT_NMSTRT),
  19468. 116: uint8(_BT_NMSTRT),
  19469. 117: uint8(_BT_NMSTRT),
  19470. 118: uint8(_BT_NMSTRT),
  19471. 119: uint8(_BT_NMSTRT),
  19472. 120: uint8(_BT_NMSTRT),
  19473. 121: uint8(_BT_NMSTRT),
  19474. 122: uint8(_BT_NMSTRT),
  19475. 123: uint8(_BT_OTHER),
  19476. 124: uint8(_BT_VERBAR),
  19477. 125: uint8(_BT_OTHER),
  19478. 126: uint8(_BT_OTHER),
  19479. 127: uint8(_BT_OTHER),
  19480. 128: uint8(_BT_OTHER),
  19481. 129: uint8(_BT_OTHER),
  19482. 130: uint8(_BT_OTHER),
  19483. 131: uint8(_BT_OTHER),
  19484. 132: uint8(_BT_OTHER),
  19485. 133: uint8(_BT_OTHER),
  19486. 134: uint8(_BT_OTHER),
  19487. 135: uint8(_BT_OTHER),
  19488. 136: uint8(_BT_OTHER),
  19489. 137: uint8(_BT_OTHER),
  19490. 138: uint8(_BT_OTHER),
  19491. 139: uint8(_BT_OTHER),
  19492. 140: uint8(_BT_OTHER),
  19493. 141: uint8(_BT_OTHER),
  19494. 142: uint8(_BT_OTHER),
  19495. 143: uint8(_BT_OTHER),
  19496. 144: uint8(_BT_OTHER),
  19497. 145: uint8(_BT_OTHER),
  19498. 146: uint8(_BT_OTHER),
  19499. 147: uint8(_BT_OTHER),
  19500. 148: uint8(_BT_OTHER),
  19501. 149: uint8(_BT_OTHER),
  19502. 150: uint8(_BT_OTHER),
  19503. 151: uint8(_BT_OTHER),
  19504. 152: uint8(_BT_OTHER),
  19505. 153: uint8(_BT_OTHER),
  19506. 154: uint8(_BT_OTHER),
  19507. 155: uint8(_BT_OTHER),
  19508. 156: uint8(_BT_OTHER),
  19509. 157: uint8(_BT_OTHER),
  19510. 158: uint8(_BT_OTHER),
  19511. 159: uint8(_BT_OTHER),
  19512. 160: uint8(_BT_OTHER),
  19513. 161: uint8(_BT_OTHER),
  19514. 162: uint8(_BT_OTHER),
  19515. 163: uint8(_BT_OTHER),
  19516. 164: uint8(_BT_OTHER),
  19517. 165: uint8(_BT_OTHER),
  19518. 166: uint8(_BT_OTHER),
  19519. 167: uint8(_BT_OTHER),
  19520. 168: uint8(_BT_OTHER),
  19521. 169: uint8(_BT_OTHER),
  19522. 170: uint8(_BT_NMSTRT),
  19523. 171: uint8(_BT_OTHER),
  19524. 172: uint8(_BT_OTHER),
  19525. 173: uint8(_BT_OTHER),
  19526. 174: uint8(_BT_OTHER),
  19527. 175: uint8(_BT_OTHER),
  19528. 176: uint8(_BT_OTHER),
  19529. 177: uint8(_BT_OTHER),
  19530. 178: uint8(_BT_OTHER),
  19531. 179: uint8(_BT_OTHER),
  19532. 180: uint8(_BT_OTHER),
  19533. 181: uint8(_BT_NMSTRT),
  19534. 182: uint8(_BT_OTHER),
  19535. 183: uint8(_BT_NAME),
  19536. 184: uint8(_BT_OTHER),
  19537. 185: uint8(_BT_OTHER),
  19538. 186: uint8(_BT_NMSTRT),
  19539. 187: uint8(_BT_OTHER),
  19540. 188: uint8(_BT_OTHER),
  19541. 189: uint8(_BT_OTHER),
  19542. 190: uint8(_BT_OTHER),
  19543. 191: uint8(_BT_OTHER),
  19544. 192: uint8(_BT_NMSTRT),
  19545. 193: uint8(_BT_NMSTRT),
  19546. 194: uint8(_BT_NMSTRT),
  19547. 195: uint8(_BT_NMSTRT),
  19548. 196: uint8(_BT_NMSTRT),
  19549. 197: uint8(_BT_NMSTRT),
  19550. 198: uint8(_BT_NMSTRT),
  19551. 199: uint8(_BT_NMSTRT),
  19552. 200: uint8(_BT_NMSTRT),
  19553. 201: uint8(_BT_NMSTRT),
  19554. 202: uint8(_BT_NMSTRT),
  19555. 203: uint8(_BT_NMSTRT),
  19556. 204: uint8(_BT_NMSTRT),
  19557. 205: uint8(_BT_NMSTRT),
  19558. 206: uint8(_BT_NMSTRT),
  19559. 207: uint8(_BT_NMSTRT),
  19560. 208: uint8(_BT_NMSTRT),
  19561. 209: uint8(_BT_NMSTRT),
  19562. 210: uint8(_BT_NMSTRT),
  19563. 211: uint8(_BT_NMSTRT),
  19564. 212: uint8(_BT_NMSTRT),
  19565. 213: uint8(_BT_NMSTRT),
  19566. 214: uint8(_BT_NMSTRT),
  19567. 215: uint8(_BT_OTHER),
  19568. 216: uint8(_BT_NMSTRT),
  19569. 217: uint8(_BT_NMSTRT),
  19570. 218: uint8(_BT_NMSTRT),
  19571. 219: uint8(_BT_NMSTRT),
  19572. 220: uint8(_BT_NMSTRT),
  19573. 221: uint8(_BT_NMSTRT),
  19574. 222: uint8(_BT_NMSTRT),
  19575. 223: uint8(_BT_NMSTRT),
  19576. 224: uint8(_BT_NMSTRT),
  19577. 225: uint8(_BT_NMSTRT),
  19578. 226: uint8(_BT_NMSTRT),
  19579. 227: uint8(_BT_NMSTRT),
  19580. 228: uint8(_BT_NMSTRT),
  19581. 229: uint8(_BT_NMSTRT),
  19582. 230: uint8(_BT_NMSTRT),
  19583. 231: uint8(_BT_NMSTRT),
  19584. 232: uint8(_BT_NMSTRT),
  19585. 233: uint8(_BT_NMSTRT),
  19586. 234: uint8(_BT_NMSTRT),
  19587. 235: uint8(_BT_NMSTRT),
  19588. 236: uint8(_BT_NMSTRT),
  19589. 237: uint8(_BT_NMSTRT),
  19590. 238: uint8(_BT_NMSTRT),
  19591. 239: uint8(_BT_NMSTRT),
  19592. 240: uint8(_BT_NMSTRT),
  19593. 241: uint8(_BT_NMSTRT),
  19594. 242: uint8(_BT_NMSTRT),
  19595. 243: uint8(_BT_NMSTRT),
  19596. 244: uint8(_BT_NMSTRT),
  19597. 245: uint8(_BT_NMSTRT),
  19598. 246: uint8(_BT_NMSTRT),
  19599. 247: uint8(_BT_OTHER),
  19600. 248: uint8(_BT_NMSTRT),
  19601. 249: uint8(_BT_NMSTRT),
  19602. 250: uint8(_BT_NMSTRT),
  19603. 251: uint8(_BT_NMSTRT),
  19604. 252: uint8(_BT_NMSTRT),
  19605. 253: uint8(_BT_NMSTRT),
  19606. 254: uint8(_BT_NMSTRT),
  19607. 255: uint8(_BT_NMSTRT),
  19608. },
  19609. }
  19610. func init() {
  19611. p := unsafe.Pointer(&_latin1_encoding)
  19612. *(*uintptr)(unsafe.Add(p, 0)) = __ccgo_fp(_normal_prologTok)
  19613. *(*uintptr)(unsafe.Add(p, 8)) = __ccgo_fp(_normal_contentTok)
  19614. *(*uintptr)(unsafe.Add(p, 16)) = __ccgo_fp(_normal_cdataSectionTok)
  19615. *(*uintptr)(unsafe.Add(p, 24)) = __ccgo_fp(_normal_ignoreSectionTok)
  19616. *(*uintptr)(unsafe.Add(p, 32)) = __ccgo_fp(_normal_attributeValueTok)
  19617. *(*uintptr)(unsafe.Add(p, 40)) = __ccgo_fp(_normal_entityValueTok)
  19618. *(*uintptr)(unsafe.Add(p, 48)) = __ccgo_fp(_normal_nameMatchesAscii)
  19619. *(*uintptr)(unsafe.Add(p, 56)) = __ccgo_fp(_normal_nameLength)
  19620. *(*uintptr)(unsafe.Add(p, 64)) = __ccgo_fp(_normal_skipS)
  19621. *(*uintptr)(unsafe.Add(p, 72)) = __ccgo_fp(_normal_getAtts)
  19622. *(*uintptr)(unsafe.Add(p, 80)) = __ccgo_fp(_normal_charRefNumber)
  19623. *(*uintptr)(unsafe.Add(p, 88)) = __ccgo_fp(_normal_predefinedEntityName)
  19624. *(*uintptr)(unsafe.Add(p, 96)) = __ccgo_fp(_normal_updatePosition)
  19625. *(*uintptr)(unsafe.Add(p, 104)) = __ccgo_fp(_normal_isPublicId)
  19626. *(*uintptr)(unsafe.Add(p, 112)) = __ccgo_fp(_latin1_toUtf8)
  19627. *(*uintptr)(unsafe.Add(p, 120)) = __ccgo_fp(_latin1_toUtf16)
  19628. }
  19629. func _ascii_toUtf8(tls *libc.TLS, enc uintptr, fromP uintptr, fromLim uintptr, toP uintptr, toLim uintptr) (r _XML_Convert_Result) {
  19630. var v1, v2, v3, v4 uintptr
  19631. _, _, _, _ = v1, v2, v3, v4
  19632. _ = enc
  19633. for *(*uintptr)(unsafe.Pointer(fromP)) < fromLim && *(*uintptr)(unsafe.Pointer(toP)) < toLim {
  19634. v2 = toP
  19635. v1 = *(*uintptr)(unsafe.Pointer(v2))
  19636. *(*uintptr)(unsafe.Pointer(v2))++
  19637. v4 = fromP
  19638. v3 = *(*uintptr)(unsafe.Pointer(v4))
  19639. *(*uintptr)(unsafe.Pointer(v4))++
  19640. *(*int8)(unsafe.Pointer(v1)) = *(*int8)(unsafe.Pointer(v3))
  19641. }
  19642. if *(*uintptr)(unsafe.Pointer(toP)) == toLim && *(*uintptr)(unsafe.Pointer(fromP)) < fromLim {
  19643. return int32(_XML_CONVERT_OUTPUT_EXHAUSTED)
  19644. } else {
  19645. return int32(_XML_CONVERT_COMPLETED)
  19646. }
  19647. return r
  19648. }
  19649. var _ascii_encoding_ns = Tnormal_encoding{
  19650. Fenc: TENCODING{
  19651. Fscanners: [4]TSCANNER{},
  19652. FliteralScanners: [2]TSCANNER{},
  19653. FminBytesPerChar: int32(1),
  19654. FisUtf8: int8(1),
  19655. },
  19656. Ftype1: [256]uint8{
  19657. 9: uint8(_BT_S),
  19658. 10: uint8(_BT_LF),
  19659. 13: uint8(_BT_CR),
  19660. 32: uint8(_BT_S),
  19661. 33: uint8(_BT_EXCL),
  19662. 34: uint8(_BT_QUOT),
  19663. 35: uint8(_BT_NUM),
  19664. 36: uint8(_BT_OTHER),
  19665. 37: uint8(_BT_PERCNT),
  19666. 38: uint8(_BT_AMP),
  19667. 39: uint8(_BT_APOS),
  19668. 40: uint8(_BT_LPAR),
  19669. 41: uint8(_BT_RPAR),
  19670. 42: uint8(_BT_AST),
  19671. 43: uint8(_BT_PLUS),
  19672. 44: uint8(_BT_COMMA),
  19673. 45: uint8(_BT_MINUS),
  19674. 46: uint8(_BT_NAME),
  19675. 47: uint8(_BT_SOL),
  19676. 48: uint8(_BT_DIGIT),
  19677. 49: uint8(_BT_DIGIT),
  19678. 50: uint8(_BT_DIGIT),
  19679. 51: uint8(_BT_DIGIT),
  19680. 52: uint8(_BT_DIGIT),
  19681. 53: uint8(_BT_DIGIT),
  19682. 54: uint8(_BT_DIGIT),
  19683. 55: uint8(_BT_DIGIT),
  19684. 56: uint8(_BT_DIGIT),
  19685. 57: uint8(_BT_DIGIT),
  19686. 58: uint8(_BT_COLON),
  19687. 59: uint8(_BT_SEMI),
  19688. 60: uint8(_BT_LT),
  19689. 61: uint8(_BT_EQUALS),
  19690. 62: uint8(_BT_GT),
  19691. 63: uint8(_BT_QUEST),
  19692. 64: uint8(_BT_OTHER),
  19693. 65: uint8(_BT_HEX),
  19694. 66: uint8(_BT_HEX),
  19695. 67: uint8(_BT_HEX),
  19696. 68: uint8(_BT_HEX),
  19697. 69: uint8(_BT_HEX),
  19698. 70: uint8(_BT_HEX),
  19699. 71: uint8(_BT_NMSTRT),
  19700. 72: uint8(_BT_NMSTRT),
  19701. 73: uint8(_BT_NMSTRT),
  19702. 74: uint8(_BT_NMSTRT),
  19703. 75: uint8(_BT_NMSTRT),
  19704. 76: uint8(_BT_NMSTRT),
  19705. 77: uint8(_BT_NMSTRT),
  19706. 78: uint8(_BT_NMSTRT),
  19707. 79: uint8(_BT_NMSTRT),
  19708. 80: uint8(_BT_NMSTRT),
  19709. 81: uint8(_BT_NMSTRT),
  19710. 82: uint8(_BT_NMSTRT),
  19711. 83: uint8(_BT_NMSTRT),
  19712. 84: uint8(_BT_NMSTRT),
  19713. 85: uint8(_BT_NMSTRT),
  19714. 86: uint8(_BT_NMSTRT),
  19715. 87: uint8(_BT_NMSTRT),
  19716. 88: uint8(_BT_NMSTRT),
  19717. 89: uint8(_BT_NMSTRT),
  19718. 90: uint8(_BT_NMSTRT),
  19719. 91: uint8(_BT_LSQB),
  19720. 92: uint8(_BT_OTHER),
  19721. 93: uint8(_BT_RSQB),
  19722. 94: uint8(_BT_OTHER),
  19723. 95: uint8(_BT_NMSTRT),
  19724. 96: uint8(_BT_OTHER),
  19725. 97: uint8(_BT_HEX),
  19726. 98: uint8(_BT_HEX),
  19727. 99: uint8(_BT_HEX),
  19728. 100: uint8(_BT_HEX),
  19729. 101: uint8(_BT_HEX),
  19730. 102: uint8(_BT_HEX),
  19731. 103: uint8(_BT_NMSTRT),
  19732. 104: uint8(_BT_NMSTRT),
  19733. 105: uint8(_BT_NMSTRT),
  19734. 106: uint8(_BT_NMSTRT),
  19735. 107: uint8(_BT_NMSTRT),
  19736. 108: uint8(_BT_NMSTRT),
  19737. 109: uint8(_BT_NMSTRT),
  19738. 110: uint8(_BT_NMSTRT),
  19739. 111: uint8(_BT_NMSTRT),
  19740. 112: uint8(_BT_NMSTRT),
  19741. 113: uint8(_BT_NMSTRT),
  19742. 114: uint8(_BT_NMSTRT),
  19743. 115: uint8(_BT_NMSTRT),
  19744. 116: uint8(_BT_NMSTRT),
  19745. 117: uint8(_BT_NMSTRT),
  19746. 118: uint8(_BT_NMSTRT),
  19747. 119: uint8(_BT_NMSTRT),
  19748. 120: uint8(_BT_NMSTRT),
  19749. 121: uint8(_BT_NMSTRT),
  19750. 122: uint8(_BT_NMSTRT),
  19751. 123: uint8(_BT_OTHER),
  19752. 124: uint8(_BT_VERBAR),
  19753. 125: uint8(_BT_OTHER),
  19754. 126: uint8(_BT_OTHER),
  19755. 127: uint8(_BT_OTHER),
  19756. },
  19757. }
  19758. func init() {
  19759. p := unsafe.Pointer(&_ascii_encoding_ns)
  19760. *(*uintptr)(unsafe.Add(p, 0)) = __ccgo_fp(_normal_prologTok)
  19761. *(*uintptr)(unsafe.Add(p, 8)) = __ccgo_fp(_normal_contentTok)
  19762. *(*uintptr)(unsafe.Add(p, 16)) = __ccgo_fp(_normal_cdataSectionTok)
  19763. *(*uintptr)(unsafe.Add(p, 24)) = __ccgo_fp(_normal_ignoreSectionTok)
  19764. *(*uintptr)(unsafe.Add(p, 32)) = __ccgo_fp(_normal_attributeValueTok)
  19765. *(*uintptr)(unsafe.Add(p, 40)) = __ccgo_fp(_normal_entityValueTok)
  19766. *(*uintptr)(unsafe.Add(p, 48)) = __ccgo_fp(_normal_nameMatchesAscii)
  19767. *(*uintptr)(unsafe.Add(p, 56)) = __ccgo_fp(_normal_nameLength)
  19768. *(*uintptr)(unsafe.Add(p, 64)) = __ccgo_fp(_normal_skipS)
  19769. *(*uintptr)(unsafe.Add(p, 72)) = __ccgo_fp(_normal_getAtts)
  19770. *(*uintptr)(unsafe.Add(p, 80)) = __ccgo_fp(_normal_charRefNumber)
  19771. *(*uintptr)(unsafe.Add(p, 88)) = __ccgo_fp(_normal_predefinedEntityName)
  19772. *(*uintptr)(unsafe.Add(p, 96)) = __ccgo_fp(_normal_updatePosition)
  19773. *(*uintptr)(unsafe.Add(p, 104)) = __ccgo_fp(_normal_isPublicId)
  19774. *(*uintptr)(unsafe.Add(p, 112)) = __ccgo_fp(_ascii_toUtf8)
  19775. *(*uintptr)(unsafe.Add(p, 120)) = __ccgo_fp(_latin1_toUtf16)
  19776. }
  19777. var _ascii_encoding = Tnormal_encoding{
  19778. Fenc: TENCODING{
  19779. Fscanners: [4]TSCANNER{},
  19780. FliteralScanners: [2]TSCANNER{},
  19781. FminBytesPerChar: int32(1),
  19782. FisUtf8: int8(1),
  19783. },
  19784. Ftype1: [256]uint8{
  19785. 9: uint8(_BT_S),
  19786. 10: uint8(_BT_LF),
  19787. 13: uint8(_BT_CR),
  19788. 32: uint8(_BT_S),
  19789. 33: uint8(_BT_EXCL),
  19790. 34: uint8(_BT_QUOT),
  19791. 35: uint8(_BT_NUM),
  19792. 36: uint8(_BT_OTHER),
  19793. 37: uint8(_BT_PERCNT),
  19794. 38: uint8(_BT_AMP),
  19795. 39: uint8(_BT_APOS),
  19796. 40: uint8(_BT_LPAR),
  19797. 41: uint8(_BT_RPAR),
  19798. 42: uint8(_BT_AST),
  19799. 43: uint8(_BT_PLUS),
  19800. 44: uint8(_BT_COMMA),
  19801. 45: uint8(_BT_MINUS),
  19802. 46: uint8(_BT_NAME),
  19803. 47: uint8(_BT_SOL),
  19804. 48: uint8(_BT_DIGIT),
  19805. 49: uint8(_BT_DIGIT),
  19806. 50: uint8(_BT_DIGIT),
  19807. 51: uint8(_BT_DIGIT),
  19808. 52: uint8(_BT_DIGIT),
  19809. 53: uint8(_BT_DIGIT),
  19810. 54: uint8(_BT_DIGIT),
  19811. 55: uint8(_BT_DIGIT),
  19812. 56: uint8(_BT_DIGIT),
  19813. 57: uint8(_BT_DIGIT),
  19814. 58: uint8(_BT_NMSTRT),
  19815. 59: uint8(_BT_SEMI),
  19816. 60: uint8(_BT_LT),
  19817. 61: uint8(_BT_EQUALS),
  19818. 62: uint8(_BT_GT),
  19819. 63: uint8(_BT_QUEST),
  19820. 64: uint8(_BT_OTHER),
  19821. 65: uint8(_BT_HEX),
  19822. 66: uint8(_BT_HEX),
  19823. 67: uint8(_BT_HEX),
  19824. 68: uint8(_BT_HEX),
  19825. 69: uint8(_BT_HEX),
  19826. 70: uint8(_BT_HEX),
  19827. 71: uint8(_BT_NMSTRT),
  19828. 72: uint8(_BT_NMSTRT),
  19829. 73: uint8(_BT_NMSTRT),
  19830. 74: uint8(_BT_NMSTRT),
  19831. 75: uint8(_BT_NMSTRT),
  19832. 76: uint8(_BT_NMSTRT),
  19833. 77: uint8(_BT_NMSTRT),
  19834. 78: uint8(_BT_NMSTRT),
  19835. 79: uint8(_BT_NMSTRT),
  19836. 80: uint8(_BT_NMSTRT),
  19837. 81: uint8(_BT_NMSTRT),
  19838. 82: uint8(_BT_NMSTRT),
  19839. 83: uint8(_BT_NMSTRT),
  19840. 84: uint8(_BT_NMSTRT),
  19841. 85: uint8(_BT_NMSTRT),
  19842. 86: uint8(_BT_NMSTRT),
  19843. 87: uint8(_BT_NMSTRT),
  19844. 88: uint8(_BT_NMSTRT),
  19845. 89: uint8(_BT_NMSTRT),
  19846. 90: uint8(_BT_NMSTRT),
  19847. 91: uint8(_BT_LSQB),
  19848. 92: uint8(_BT_OTHER),
  19849. 93: uint8(_BT_RSQB),
  19850. 94: uint8(_BT_OTHER),
  19851. 95: uint8(_BT_NMSTRT),
  19852. 96: uint8(_BT_OTHER),
  19853. 97: uint8(_BT_HEX),
  19854. 98: uint8(_BT_HEX),
  19855. 99: uint8(_BT_HEX),
  19856. 100: uint8(_BT_HEX),
  19857. 101: uint8(_BT_HEX),
  19858. 102: uint8(_BT_HEX),
  19859. 103: uint8(_BT_NMSTRT),
  19860. 104: uint8(_BT_NMSTRT),
  19861. 105: uint8(_BT_NMSTRT),
  19862. 106: uint8(_BT_NMSTRT),
  19863. 107: uint8(_BT_NMSTRT),
  19864. 108: uint8(_BT_NMSTRT),
  19865. 109: uint8(_BT_NMSTRT),
  19866. 110: uint8(_BT_NMSTRT),
  19867. 111: uint8(_BT_NMSTRT),
  19868. 112: uint8(_BT_NMSTRT),
  19869. 113: uint8(_BT_NMSTRT),
  19870. 114: uint8(_BT_NMSTRT),
  19871. 115: uint8(_BT_NMSTRT),
  19872. 116: uint8(_BT_NMSTRT),
  19873. 117: uint8(_BT_NMSTRT),
  19874. 118: uint8(_BT_NMSTRT),
  19875. 119: uint8(_BT_NMSTRT),
  19876. 120: uint8(_BT_NMSTRT),
  19877. 121: uint8(_BT_NMSTRT),
  19878. 122: uint8(_BT_NMSTRT),
  19879. 123: uint8(_BT_OTHER),
  19880. 124: uint8(_BT_VERBAR),
  19881. 125: uint8(_BT_OTHER),
  19882. 126: uint8(_BT_OTHER),
  19883. 127: uint8(_BT_OTHER),
  19884. },
  19885. }
  19886. func init() {
  19887. p := unsafe.Pointer(&_ascii_encoding)
  19888. *(*uintptr)(unsafe.Add(p, 0)) = __ccgo_fp(_normal_prologTok)
  19889. *(*uintptr)(unsafe.Add(p, 8)) = __ccgo_fp(_normal_contentTok)
  19890. *(*uintptr)(unsafe.Add(p, 16)) = __ccgo_fp(_normal_cdataSectionTok)
  19891. *(*uintptr)(unsafe.Add(p, 24)) = __ccgo_fp(_normal_ignoreSectionTok)
  19892. *(*uintptr)(unsafe.Add(p, 32)) = __ccgo_fp(_normal_attributeValueTok)
  19893. *(*uintptr)(unsafe.Add(p, 40)) = __ccgo_fp(_normal_entityValueTok)
  19894. *(*uintptr)(unsafe.Add(p, 48)) = __ccgo_fp(_normal_nameMatchesAscii)
  19895. *(*uintptr)(unsafe.Add(p, 56)) = __ccgo_fp(_normal_nameLength)
  19896. *(*uintptr)(unsafe.Add(p, 64)) = __ccgo_fp(_normal_skipS)
  19897. *(*uintptr)(unsafe.Add(p, 72)) = __ccgo_fp(_normal_getAtts)
  19898. *(*uintptr)(unsafe.Add(p, 80)) = __ccgo_fp(_normal_charRefNumber)
  19899. *(*uintptr)(unsafe.Add(p, 88)) = __ccgo_fp(_normal_predefinedEntityName)
  19900. *(*uintptr)(unsafe.Add(p, 96)) = __ccgo_fp(_normal_updatePosition)
  19901. *(*uintptr)(unsafe.Add(p, 104)) = __ccgo_fp(_normal_isPublicId)
  19902. *(*uintptr)(unsafe.Add(p, 112)) = __ccgo_fp(_ascii_toUtf8)
  19903. *(*uintptr)(unsafe.Add(p, 120)) = __ccgo_fp(_latin1_toUtf16)
  19904. }
  19905. func _unicode_byte_type(tls *libc.TLS, hi int8, lo int8) (r int32) {
  19906. switch libc.Int32FromUint8(libc.Uint8FromInt8(hi)) {
  19907. /* 0xD800-0xDBFF first 16-bit code unit or high surrogate (W1) */
  19908. case int32(0xD8):
  19909. fallthrough
  19910. case int32(0xD9):
  19911. fallthrough
  19912. case int32(0xDA):
  19913. fallthrough
  19914. case int32(0xDB):
  19915. return int32(_BT_LEAD4)
  19916. /* 0xDC00-0xDFFF second 16-bit code unit or low surrogate (W2) */
  19917. fallthrough
  19918. case int32(0xDC):
  19919. fallthrough
  19920. case int32(0xDD):
  19921. fallthrough
  19922. case int32(0xDE):
  19923. fallthrough
  19924. case int32(0xDF):
  19925. return int32(_BT_TRAIL)
  19926. case int32(0xFF):
  19927. switch libc.Int32FromUint8(libc.Uint8FromInt8(lo)) {
  19928. case int32(0xFF): /* noncharacter-FFFF */
  19929. fallthrough
  19930. case int32(0xFE): /* noncharacter-FFFE */
  19931. return int32(_BT_NONXML)
  19932. }
  19933. break
  19934. }
  19935. return int32(_BT_NONASCII)
  19936. }
  19937. func _little2_toUtf8(tls *libc.TLS, enc uintptr, fromP uintptr, fromLim uintptr, toP uintptr, toLim uintptr) (r _XML_Convert_Result) {
  19938. var from, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v2, v20, v21, v3, v4, v5, v6, v7, v8, v9 uintptr
  19939. var hi, lo, lo2 uint8
  19940. var plane int32
  19941. _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = from, hi, lo, lo2, plane, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v2, v20, v21, v3, v4, v5, v6, v7, v8, v9
  19942. from = *(*uintptr)(unsafe.Pointer(fromP))
  19943. _ = enc
  19944. fromLim = from + uintptr((int64(fromLim)-int64(from))>>libc.Int32FromInt32(1)<<libc.Int32FromInt32(1)) /* shrink to even */
  19945. for {
  19946. if !(from < fromLim) {
  19947. break
  19948. }
  19949. lo = libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(from)))
  19950. hi = libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(from + 1)))
  19951. switch libc.Int32FromUint8(hi) {
  19952. case 0:
  19953. if libc.Int32FromUint8(lo) < int32(0x80) {
  19954. if *(*uintptr)(unsafe.Pointer(toP)) == toLim {
  19955. *(*uintptr)(unsafe.Pointer(fromP)) = from
  19956. return int32(_XML_CONVERT_OUTPUT_EXHAUSTED)
  19957. }
  19958. v3 = toP
  19959. v2 = *(*uintptr)(unsafe.Pointer(v3))
  19960. *(*uintptr)(unsafe.Pointer(v3))++
  19961. *(*int8)(unsafe.Pointer(v2)) = libc.Int8FromUint8(lo)
  19962. break
  19963. } /* fall through */
  19964. fallthrough
  19965. case int32(0x1):
  19966. fallthrough
  19967. case int32(0x2):
  19968. fallthrough
  19969. case int32(0x3):
  19970. fallthrough
  19971. case int32(0x4):
  19972. fallthrough
  19973. case int32(0x5):
  19974. fallthrough
  19975. case int32(0x6):
  19976. fallthrough
  19977. case int32(0x7):
  19978. if int64(toLim)-int64(*(*uintptr)(unsafe.Pointer(toP))) < int64(2) {
  19979. *(*uintptr)(unsafe.Pointer(fromP)) = from
  19980. return int32(_XML_CONVERT_OUTPUT_EXHAUSTED)
  19981. }
  19982. v5 = toP
  19983. v4 = *(*uintptr)(unsafe.Pointer(v5))
  19984. *(*uintptr)(unsafe.Pointer(v5))++
  19985. *(*int8)(unsafe.Pointer(v4)) = int8(libc.Int32FromUint8(lo)>>libc.Int32FromInt32(6) | libc.Int32FromUint8(hi)<<libc.Int32FromInt32(2) | int32(_UTF8_cval2))
  19986. v7 = toP
  19987. v6 = *(*uintptr)(unsafe.Pointer(v7))
  19988. *(*uintptr)(unsafe.Pointer(v7))++
  19989. *(*int8)(unsafe.Pointer(v6)) = int8(libc.Int32FromUint8(lo)&libc.Int32FromInt32(0x3f) | libc.Int32FromInt32(0x80))
  19990. default:
  19991. if int64(toLim)-int64(*(*uintptr)(unsafe.Pointer(toP))) < int64(3) {
  19992. *(*uintptr)(unsafe.Pointer(fromP)) = from
  19993. return int32(_XML_CONVERT_OUTPUT_EXHAUSTED)
  19994. } /* 16 bits divided 4, 6, 6 amongst 3 bytes */
  19995. v9 = toP
  19996. v8 = *(*uintptr)(unsafe.Pointer(v9))
  19997. *(*uintptr)(unsafe.Pointer(v9))++
  19998. *(*int8)(unsafe.Pointer(v8)) = int8(libc.Int32FromUint8(hi)>>libc.Int32FromInt32(4) | int32(_UTF8_cval3))
  19999. v11 = toP
  20000. v10 = *(*uintptr)(unsafe.Pointer(v11))
  20001. *(*uintptr)(unsafe.Pointer(v11))++
  20002. *(*int8)(unsafe.Pointer(v10)) = int8(libc.Int32FromUint8(hi)&libc.Int32FromInt32(0xf)<<libc.Int32FromInt32(2) | libc.Int32FromUint8(lo)>>libc.Int32FromInt32(6) | libc.Int32FromInt32(0x80))
  20003. v13 = toP
  20004. v12 = *(*uintptr)(unsafe.Pointer(v13))
  20005. *(*uintptr)(unsafe.Pointer(v13))++
  20006. *(*int8)(unsafe.Pointer(v12)) = int8(libc.Int32FromUint8(lo)&libc.Int32FromInt32(0x3f) | libc.Int32FromInt32(0x80))
  20007. case int32(0xD8):
  20008. fallthrough
  20009. case int32(0xD9):
  20010. fallthrough
  20011. case int32(0xDA):
  20012. fallthrough
  20013. case int32(0xDB):
  20014. if int64(toLim)-int64(*(*uintptr)(unsafe.Pointer(toP))) < int64(4) {
  20015. *(*uintptr)(unsafe.Pointer(fromP)) = from
  20016. return int32(_XML_CONVERT_OUTPUT_EXHAUSTED)
  20017. }
  20018. if int64(fromLim)-int64(from) < int64(4) {
  20019. *(*uintptr)(unsafe.Pointer(fromP)) = from
  20020. return int32(_XML_CONVERT_INPUT_INCOMPLETE)
  20021. }
  20022. plane = libc.Int32FromUint8(hi)&int32(0x3)<<int32(2) | libc.Int32FromUint8(lo)>>int32(6)&int32(0x3) + int32(1)
  20023. v15 = toP
  20024. v14 = *(*uintptr)(unsafe.Pointer(v15))
  20025. *(*uintptr)(unsafe.Pointer(v15))++
  20026. *(*int8)(unsafe.Pointer(v14)) = int8(plane>>libc.Int32FromInt32(2) | int32(_UTF8_cval4))
  20027. v17 = toP
  20028. v16 = *(*uintptr)(unsafe.Pointer(v17))
  20029. *(*uintptr)(unsafe.Pointer(v17))++
  20030. *(*int8)(unsafe.Pointer(v16)) = int8(libc.Int32FromUint8(lo)>>libc.Int32FromInt32(2)&libc.Int32FromInt32(0xF) | plane&libc.Int32FromInt32(0x3)<<libc.Int32FromInt32(4) | libc.Int32FromInt32(0x80))
  20031. from += uintptr(2)
  20032. lo2 = libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(from)))
  20033. v19 = toP
  20034. v18 = *(*uintptr)(unsafe.Pointer(v19))
  20035. *(*uintptr)(unsafe.Pointer(v19))++
  20036. *(*int8)(unsafe.Pointer(v18)) = int8(libc.Int32FromUint8(lo)&libc.Int32FromInt32(0x3)<<libc.Int32FromInt32(4) | libc.Int32FromUint8(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(from + 1))))&libc.Int32FromInt32(0x3)<<libc.Int32FromInt32(2) | libc.Int32FromUint8(lo2)>>libc.Int32FromInt32(6) | libc.Int32FromInt32(0x80))
  20037. v21 = toP
  20038. v20 = *(*uintptr)(unsafe.Pointer(v21))
  20039. *(*uintptr)(unsafe.Pointer(v21))++
  20040. *(*int8)(unsafe.Pointer(v20)) = int8(libc.Int32FromUint8(lo2)&libc.Int32FromInt32(0x3f) | libc.Int32FromInt32(0x80))
  20041. break
  20042. }
  20043. goto _1
  20044. _1:
  20045. ;
  20046. from += uintptr(2)
  20047. }
  20048. *(*uintptr)(unsafe.Pointer(fromP)) = from
  20049. if from < fromLim {
  20050. return int32(_XML_CONVERT_INPUT_INCOMPLETE)
  20051. } else {
  20052. return int32(_XML_CONVERT_COMPLETED)
  20053. }
  20054. return r
  20055. }
  20056. func _little2_toUtf16(tls *libc.TLS, enc uintptr, fromP uintptr, fromLim uintptr, toP uintptr, toLim uintptr) (r _XML_Convert_Result) {
  20057. var res _XML_Convert_Result
  20058. var v2, v3 uintptr
  20059. _, _, _ = res, v2, v3
  20060. res = int32(_XML_CONVERT_COMPLETED)
  20061. _ = enc
  20062. fromLim = *(*uintptr)(unsafe.Pointer(fromP)) + uintptr((int64(fromLim)-int64(*(*uintptr)(unsafe.Pointer(fromP))))>>libc.Int32FromInt32(1)<<libc.Int32FromInt32(1)) /* shrink to even */ /* Avoid copying first half only of surrogate */
  20063. if int64(fromLim)-int64(*(*uintptr)(unsafe.Pointer(fromP))) > (int64(toLim)-int64(*(*uintptr)(unsafe.Pointer(toP))))/2<<libc.Int32FromInt32(1) && libc.Int32FromUint8(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(fromLim - libc.UintptrFromInt32(2) + 1))))&int32(0xF8) == int32(0xD8) {
  20064. fromLim -= uintptr(2)
  20065. res = int32(_XML_CONVERT_INPUT_INCOMPLETE)
  20066. }
  20067. for {
  20068. if !(*(*uintptr)(unsafe.Pointer(fromP)) < fromLim && *(*uintptr)(unsafe.Pointer(toP)) < toLim) {
  20069. break
  20070. }
  20071. v3 = toP
  20072. v2 = *(*uintptr)(unsafe.Pointer(v3))
  20073. *(*uintptr)(unsafe.Pointer(v3)) += 2
  20074. *(*uint16)(unsafe.Pointer(v2)) = libc.Uint16FromInt32(libc.Int32FromUint8(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(fromP)) + 1))))<<int32(8) | libc.Int32FromUint8(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(fromP)))))))
  20075. goto _1
  20076. _1:
  20077. ;
  20078. *(*uintptr)(unsafe.Pointer(fromP)) += uintptr(2)
  20079. }
  20080. if *(*uintptr)(unsafe.Pointer(toP)) == toLim && *(*uintptr)(unsafe.Pointer(fromP)) < fromLim {
  20081. return int32(_XML_CONVERT_OUTPUT_EXHAUSTED)
  20082. } else {
  20083. return res
  20084. }
  20085. return r
  20086. }
  20087. func _big2_toUtf8(tls *libc.TLS, enc uintptr, fromP uintptr, fromLim uintptr, toP uintptr, toLim uintptr) (r _XML_Convert_Result) {
  20088. var from, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v2, v20, v21, v3, v4, v5, v6, v7, v8, v9 uintptr
  20089. var hi, lo, lo2 uint8
  20090. var plane int32
  20091. _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = from, hi, lo, lo2, plane, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v2, v20, v21, v3, v4, v5, v6, v7, v8, v9
  20092. from = *(*uintptr)(unsafe.Pointer(fromP))
  20093. _ = enc
  20094. fromLim = from + uintptr((int64(fromLim)-int64(from))>>libc.Int32FromInt32(1)<<libc.Int32FromInt32(1)) /* shrink to even */
  20095. for {
  20096. if !(from < fromLim) {
  20097. break
  20098. }
  20099. lo = libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(from + 1)))
  20100. hi = libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(from)))
  20101. switch libc.Int32FromUint8(hi) {
  20102. case 0:
  20103. if libc.Int32FromUint8(lo) < int32(0x80) {
  20104. if *(*uintptr)(unsafe.Pointer(toP)) == toLim {
  20105. *(*uintptr)(unsafe.Pointer(fromP)) = from
  20106. return int32(_XML_CONVERT_OUTPUT_EXHAUSTED)
  20107. }
  20108. v3 = toP
  20109. v2 = *(*uintptr)(unsafe.Pointer(v3))
  20110. *(*uintptr)(unsafe.Pointer(v3))++
  20111. *(*int8)(unsafe.Pointer(v2)) = libc.Int8FromUint8(lo)
  20112. break
  20113. } /* fall through */
  20114. fallthrough
  20115. case int32(0x1):
  20116. fallthrough
  20117. case int32(0x2):
  20118. fallthrough
  20119. case int32(0x3):
  20120. fallthrough
  20121. case int32(0x4):
  20122. fallthrough
  20123. case int32(0x5):
  20124. fallthrough
  20125. case int32(0x6):
  20126. fallthrough
  20127. case int32(0x7):
  20128. if int64(toLim)-int64(*(*uintptr)(unsafe.Pointer(toP))) < int64(2) {
  20129. *(*uintptr)(unsafe.Pointer(fromP)) = from
  20130. return int32(_XML_CONVERT_OUTPUT_EXHAUSTED)
  20131. }
  20132. v5 = toP
  20133. v4 = *(*uintptr)(unsafe.Pointer(v5))
  20134. *(*uintptr)(unsafe.Pointer(v5))++
  20135. *(*int8)(unsafe.Pointer(v4)) = int8(libc.Int32FromUint8(lo)>>libc.Int32FromInt32(6) | libc.Int32FromUint8(hi)<<libc.Int32FromInt32(2) | int32(_UTF8_cval2))
  20136. v7 = toP
  20137. v6 = *(*uintptr)(unsafe.Pointer(v7))
  20138. *(*uintptr)(unsafe.Pointer(v7))++
  20139. *(*int8)(unsafe.Pointer(v6)) = int8(libc.Int32FromUint8(lo)&libc.Int32FromInt32(0x3f) | libc.Int32FromInt32(0x80))
  20140. default:
  20141. if int64(toLim)-int64(*(*uintptr)(unsafe.Pointer(toP))) < int64(3) {
  20142. *(*uintptr)(unsafe.Pointer(fromP)) = from
  20143. return int32(_XML_CONVERT_OUTPUT_EXHAUSTED)
  20144. } /* 16 bits divided 4, 6, 6 amongst 3 bytes */
  20145. v9 = toP
  20146. v8 = *(*uintptr)(unsafe.Pointer(v9))
  20147. *(*uintptr)(unsafe.Pointer(v9))++
  20148. *(*int8)(unsafe.Pointer(v8)) = int8(libc.Int32FromUint8(hi)>>libc.Int32FromInt32(4) | int32(_UTF8_cval3))
  20149. v11 = toP
  20150. v10 = *(*uintptr)(unsafe.Pointer(v11))
  20151. *(*uintptr)(unsafe.Pointer(v11))++
  20152. *(*int8)(unsafe.Pointer(v10)) = int8(libc.Int32FromUint8(hi)&libc.Int32FromInt32(0xf)<<libc.Int32FromInt32(2) | libc.Int32FromUint8(lo)>>libc.Int32FromInt32(6) | libc.Int32FromInt32(0x80))
  20153. v13 = toP
  20154. v12 = *(*uintptr)(unsafe.Pointer(v13))
  20155. *(*uintptr)(unsafe.Pointer(v13))++
  20156. *(*int8)(unsafe.Pointer(v12)) = int8(libc.Int32FromUint8(lo)&libc.Int32FromInt32(0x3f) | libc.Int32FromInt32(0x80))
  20157. case int32(0xD8):
  20158. fallthrough
  20159. case int32(0xD9):
  20160. fallthrough
  20161. case int32(0xDA):
  20162. fallthrough
  20163. case int32(0xDB):
  20164. if int64(toLim)-int64(*(*uintptr)(unsafe.Pointer(toP))) < int64(4) {
  20165. *(*uintptr)(unsafe.Pointer(fromP)) = from
  20166. return int32(_XML_CONVERT_OUTPUT_EXHAUSTED)
  20167. }
  20168. if int64(fromLim)-int64(from) < int64(4) {
  20169. *(*uintptr)(unsafe.Pointer(fromP)) = from
  20170. return int32(_XML_CONVERT_INPUT_INCOMPLETE)
  20171. }
  20172. plane = libc.Int32FromUint8(hi)&int32(0x3)<<int32(2) | libc.Int32FromUint8(lo)>>int32(6)&int32(0x3) + int32(1)
  20173. v15 = toP
  20174. v14 = *(*uintptr)(unsafe.Pointer(v15))
  20175. *(*uintptr)(unsafe.Pointer(v15))++
  20176. *(*int8)(unsafe.Pointer(v14)) = int8(plane>>libc.Int32FromInt32(2) | int32(_UTF8_cval4))
  20177. v17 = toP
  20178. v16 = *(*uintptr)(unsafe.Pointer(v17))
  20179. *(*uintptr)(unsafe.Pointer(v17))++
  20180. *(*int8)(unsafe.Pointer(v16)) = int8(libc.Int32FromUint8(lo)>>libc.Int32FromInt32(2)&libc.Int32FromInt32(0xF) | plane&libc.Int32FromInt32(0x3)<<libc.Int32FromInt32(4) | libc.Int32FromInt32(0x80))
  20181. from += uintptr(2)
  20182. lo2 = libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(from + 1)))
  20183. v19 = toP
  20184. v18 = *(*uintptr)(unsafe.Pointer(v19))
  20185. *(*uintptr)(unsafe.Pointer(v19))++
  20186. *(*int8)(unsafe.Pointer(v18)) = int8(libc.Int32FromUint8(lo)&libc.Int32FromInt32(0x3)<<libc.Int32FromInt32(4) | libc.Int32FromUint8(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(from))))&libc.Int32FromInt32(0x3)<<libc.Int32FromInt32(2) | libc.Int32FromUint8(lo2)>>libc.Int32FromInt32(6) | libc.Int32FromInt32(0x80))
  20187. v21 = toP
  20188. v20 = *(*uintptr)(unsafe.Pointer(v21))
  20189. *(*uintptr)(unsafe.Pointer(v21))++
  20190. *(*int8)(unsafe.Pointer(v20)) = int8(libc.Int32FromUint8(lo2)&libc.Int32FromInt32(0x3f) | libc.Int32FromInt32(0x80))
  20191. break
  20192. }
  20193. goto _1
  20194. _1:
  20195. ;
  20196. from += uintptr(2)
  20197. }
  20198. *(*uintptr)(unsafe.Pointer(fromP)) = from
  20199. if from < fromLim {
  20200. return int32(_XML_CONVERT_INPUT_INCOMPLETE)
  20201. } else {
  20202. return int32(_XML_CONVERT_COMPLETED)
  20203. }
  20204. return r
  20205. }
  20206. func _big2_toUtf16(tls *libc.TLS, enc uintptr, fromP uintptr, fromLim uintptr, toP uintptr, toLim uintptr) (r _XML_Convert_Result) {
  20207. var res _XML_Convert_Result
  20208. var v2, v3 uintptr
  20209. _, _, _ = res, v2, v3
  20210. res = int32(_XML_CONVERT_COMPLETED)
  20211. _ = enc
  20212. fromLim = *(*uintptr)(unsafe.Pointer(fromP)) + uintptr((int64(fromLim)-int64(*(*uintptr)(unsafe.Pointer(fromP))))>>libc.Int32FromInt32(1)<<libc.Int32FromInt32(1)) /* shrink to even */ /* Avoid copying first half only of surrogate */
  20213. if int64(fromLim)-int64(*(*uintptr)(unsafe.Pointer(fromP))) > (int64(toLim)-int64(*(*uintptr)(unsafe.Pointer(toP))))/2<<libc.Int32FromInt32(1) && libc.Int32FromUint8(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(fromLim - libc.UintptrFromInt32(2)))))&int32(0xF8) == int32(0xD8) {
  20214. fromLim -= uintptr(2)
  20215. res = int32(_XML_CONVERT_INPUT_INCOMPLETE)
  20216. }
  20217. for {
  20218. if !(*(*uintptr)(unsafe.Pointer(fromP)) < fromLim && *(*uintptr)(unsafe.Pointer(toP)) < toLim) {
  20219. break
  20220. }
  20221. v3 = toP
  20222. v2 = *(*uintptr)(unsafe.Pointer(v3))
  20223. *(*uintptr)(unsafe.Pointer(v3)) += 2
  20224. *(*uint16)(unsafe.Pointer(v2)) = libc.Uint16FromInt32(libc.Int32FromUint8(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(fromP))))))<<int32(8) | libc.Int32FromUint8(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(fromP)) + 1)))))
  20225. goto _1
  20226. _1:
  20227. ;
  20228. *(*uintptr)(unsafe.Pointer(fromP)) += uintptr(2)
  20229. }
  20230. if *(*uintptr)(unsafe.Pointer(toP)) == toLim && *(*uintptr)(unsafe.Pointer(fromP)) < fromLim {
  20231. return int32(_XML_CONVERT_OUTPUT_EXHAUSTED)
  20232. } else {
  20233. return res
  20234. }
  20235. return r
  20236. }
  20237. /* CHAR_MATCHES is guaranteed to have MINBPC bytes available. */
  20238. /* This file is included (from xmltok.c, 1-3 times depending on XML_MIN_SIZE)!
  20239. __ __ _
  20240. ___\ \/ /_ __ __ _| |_
  20241. / _ \\ /| '_ \ / _` | __|
  20242. | __// \| |_) | (_| | |_
  20243. \___/_/\_\ .__/ \__,_|\__|
  20244. |_| XML parser
  20245. Copyright (c) 1997-2000 Thai Open Source Software Center Ltd
  20246. Copyright (c) 2000 Clark Cooper <coopercc@users.sourceforge.net>
  20247. Copyright (c) 2002 Fred L. Drake, Jr. <fdrake@users.sourceforge.net>
  20248. Copyright (c) 2002-2016 Karl Waclawek <karl@waclawek.net>
  20249. Copyright (c) 2016-2022 Sebastian Pipping <sebastian@pipping.org>
  20250. Copyright (c) 2017 Rhodri James <rhodri@wildebeest.org.uk>
  20251. Copyright (c) 2018 Benjamin Peterson <benjamin@python.org>
  20252. Copyright (c) 2018 Anton Maklakov <antmak.pub@gmail.com>
  20253. Copyright (c) 2019 David Loffredo <loffredo@steptools.com>
  20254. Copyright (c) 2020 Boris Kolpackov <boris@codesynthesis.com>
  20255. Copyright (c) 2022 Martin Ettl <ettl.martin78@googlemail.com>
  20256. Licensed under the MIT license:
  20257. Permission is hereby granted, free of charge, to any person obtaining
  20258. a copy of this software and associated documentation files (the
  20259. "Software"), to deal in the Software without restriction, including
  20260. without limitation the rights to use, copy, modify, merge, publish,
  20261. distribute, sublicense, and/or sell copies of the Software, and to permit
  20262. persons to whom the Software is furnished to do so, subject to the
  20263. following conditions:
  20264. The above copyright notice and this permission notice shall be included
  20265. in all copies or substantial portions of the Software.
  20266. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  20267. EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  20268. MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
  20269. NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
  20270. DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  20271. OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
  20272. USE OR OTHER DEALINGS IN THE SOFTWARE.
  20273. */
  20274. /* ptr points to character following "<!-" */
  20275. func _little2_scanComment(tls *libc.TLS, enc uintptr, ptr uintptr, end uintptr, nextTokPtr uintptr) (r int32) {
  20276. var v1 int32
  20277. _ = v1
  20278. if int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2)) {
  20279. if !(int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 && int32(*(*int8)(unsafe.Pointer(ptr))) == int32(m_ASCII_MINUS1)) {
  20280. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  20281. return m_XML_TOK_INVALID
  20282. }
  20283. ptr += uintptr(2)
  20284. for int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2)) {
  20285. if int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 {
  20286. v1 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr)))))))
  20287. } else {
  20288. v1 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr + 1)), *(*int8)(unsafe.Pointer(ptr)))
  20289. }
  20290. switch v1 {
  20291. case int32(_BT_LEAD2):
  20292. if int64(end)-int64(ptr) < int64(2) {
  20293. return -int32(2)
  20294. }
  20295. if 0 != 0 {
  20296. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  20297. return m_XML_TOK_INVALID
  20298. }
  20299. ptr += uintptr(2)
  20300. case int32(_BT_LEAD3):
  20301. if int64(end)-int64(ptr) < int64(3) {
  20302. return -int32(2)
  20303. }
  20304. if 0 != 0 {
  20305. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  20306. return m_XML_TOK_INVALID
  20307. }
  20308. ptr += uintptr(3)
  20309. case int32(_BT_LEAD4):
  20310. if int64(end)-int64(ptr) < int64(4) {
  20311. return -int32(2)
  20312. }
  20313. if 0 != 0 {
  20314. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  20315. return m_XML_TOK_INVALID
  20316. }
  20317. ptr += uintptr(4)
  20318. case int32(_BT_NONXML):
  20319. fallthrough
  20320. case int32(_BT_MALFORM):
  20321. fallthrough
  20322. case int32(_BT_TRAIL):
  20323. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  20324. return m_XML_TOK_INVALID
  20325. case int32(_BT_MINUS):
  20326. ptr += uintptr(2)
  20327. if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
  20328. return -int32(1)
  20329. }
  20330. if int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 && int32(*(*int8)(unsafe.Pointer(ptr))) == int32(m_ASCII_MINUS1) {
  20331. ptr += uintptr(2)
  20332. if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
  20333. return -int32(1)
  20334. }
  20335. if !(int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 && int32(*(*int8)(unsafe.Pointer(ptr))) == int32(m_ASCII_GT1)) {
  20336. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  20337. return m_XML_TOK_INVALID
  20338. }
  20339. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(2)
  20340. return int32(m_XML_TOK_COMMENT)
  20341. }
  20342. default:
  20343. ptr += uintptr(2)
  20344. break
  20345. }
  20346. }
  20347. }
  20348. return -int32(1)
  20349. }
  20350. /* ptr points to character following "<!" */
  20351. func _little2_scanDecl(tls *libc.TLS, enc uintptr, ptr uintptr, end uintptr, nextTokPtr uintptr) (r int32) {
  20352. var v1, v2, v3 int32
  20353. _, _, _ = v1, v2, v3
  20354. if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
  20355. return -int32(1)
  20356. }
  20357. if int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 {
  20358. v1 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr)))))))
  20359. } else {
  20360. v1 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr + 1)), *(*int8)(unsafe.Pointer(ptr)))
  20361. }
  20362. switch v1 {
  20363. case int32(_BT_MINUS):
  20364. return _little2_scanComment(tls, enc, ptr+uintptr(2), end, nextTokPtr)
  20365. case int32(_BT_LSQB):
  20366. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(2)
  20367. return int32(m_XML_TOK_COND_SECT_OPEN)
  20368. case int32(_BT_NMSTRT):
  20369. fallthrough
  20370. case int32(_BT_HEX):
  20371. ptr += uintptr(2)
  20372. default:
  20373. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  20374. return m_XML_TOK_INVALID
  20375. }
  20376. for int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2)) {
  20377. if int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 {
  20378. v2 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr)))))))
  20379. } else {
  20380. v2 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr + 1)), *(*int8)(unsafe.Pointer(ptr)))
  20381. }
  20382. switch v2 {
  20383. case int32(_BT_PERCNT):
  20384. if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(2)*libc.Int32FromInt32(2))) {
  20385. return -int32(1)
  20386. }
  20387. /* don't allow <!ENTITY% foo "whatever"> */
  20388. if int32(*(*int8)(unsafe.Pointer(ptr + libc.UintptrFromInt32(2) + 1))) == 0 {
  20389. v3 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr + libc.UintptrFromInt32(2))))))))
  20390. } else {
  20391. v3 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr + libc.UintptrFromInt32(2) + 1)), *(*int8)(unsafe.Pointer(ptr + libc.UintptrFromInt32(2))))
  20392. }
  20393. switch v3 {
  20394. case int32(_BT_S):
  20395. fallthrough
  20396. case int32(_BT_CR):
  20397. fallthrough
  20398. case int32(_BT_LF):
  20399. fallthrough
  20400. case int32(_BT_PERCNT):
  20401. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  20402. return m_XML_TOK_INVALID
  20403. }
  20404. /* fall through */
  20405. fallthrough
  20406. case int32(_BT_S):
  20407. fallthrough
  20408. case int32(_BT_CR):
  20409. fallthrough
  20410. case int32(_BT_LF):
  20411. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  20412. return int32(m_XML_TOK_DECL_OPEN)
  20413. case int32(_BT_NMSTRT):
  20414. fallthrough
  20415. case int32(_BT_HEX):
  20416. ptr += uintptr(2)
  20417. default:
  20418. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  20419. return m_XML_TOK_INVALID
  20420. }
  20421. }
  20422. return -int32(1)
  20423. }
  20424. func _little2_checkPiTarget(tls *libc.TLS, enc uintptr, ptr uintptr, end uintptr, tokPtr uintptr) (r int32) {
  20425. var upper, v1, v2, v3 int32
  20426. _, _, _, _ = upper, v1, v2, v3
  20427. upper = 0
  20428. _ = enc
  20429. *(*int32)(unsafe.Pointer(tokPtr)) = int32(m_XML_TOK_PI)
  20430. if int64(end)-int64(ptr) != int64(libc.Int32FromInt32(2)*libc.Int32FromInt32(3)) {
  20431. return int32(1)
  20432. }
  20433. if int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 {
  20434. v1 = int32(*(*int8)(unsafe.Pointer(ptr)))
  20435. } else {
  20436. v1 = -int32(1)
  20437. }
  20438. switch v1 {
  20439. case int32(m_ASCII_x2):
  20440. case int32(m_ASCII_X):
  20441. upper = int32(1)
  20442. default:
  20443. return int32(1)
  20444. }
  20445. ptr += uintptr(2)
  20446. if int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 {
  20447. v2 = int32(*(*int8)(unsafe.Pointer(ptr)))
  20448. } else {
  20449. v2 = -int32(1)
  20450. }
  20451. switch v2 {
  20452. case int32(m_ASCII_m2):
  20453. case int32(m_ASCII_M):
  20454. upper = int32(1)
  20455. default:
  20456. return int32(1)
  20457. }
  20458. ptr += uintptr(2)
  20459. if int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 {
  20460. v3 = int32(*(*int8)(unsafe.Pointer(ptr)))
  20461. } else {
  20462. v3 = -int32(1)
  20463. }
  20464. switch v3 {
  20465. case int32(m_ASCII_l2):
  20466. case int32(m_ASCII_L):
  20467. upper = int32(1)
  20468. default:
  20469. return int32(1)
  20470. }
  20471. if upper != 0 {
  20472. return 0
  20473. }
  20474. *(*int32)(unsafe.Pointer(tokPtr)) = int32(m_XML_TOK_XML_DECL)
  20475. return int32(1)
  20476. }
  20477. /* ptr points to character following "<?" */
  20478. func _little2_scanPi(tls *libc.TLS, enc uintptr, ptr uintptr, end uintptr, nextTokPtr uintptr) (r int32) {
  20479. bp := tls.Alloc(16)
  20480. defer tls.Free(16)
  20481. var target uintptr
  20482. var v1, v2, v3 int32
  20483. var _ /* tok at bp+0 */ int32
  20484. _, _, _, _ = target, v1, v2, v3
  20485. target = ptr
  20486. if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
  20487. return -int32(1)
  20488. }
  20489. if int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 {
  20490. v1 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr)))))))
  20491. } else {
  20492. v1 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr + 1)), *(*int8)(unsafe.Pointer(ptr)))
  20493. }
  20494. switch v1 {
  20495. case int32(_BT_NONASCII):
  20496. if !(_namingBitmap[libc.Int32FromUint8(_nmstrtPages[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr + 1)))])<<int32(3)+libc.Int32FromUint8(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr))))>>int32(5)]&(libc.Uint32FromUint32(1)<<(libc.Int32FromUint8(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr))))&libc.Int32FromInt32(0x1F))) != 0) {
  20497. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  20498. return m_XML_TOK_INVALID
  20499. } /* fall through */
  20500. fallthrough
  20501. case int32(_BT_NMSTRT):
  20502. fallthrough
  20503. case int32(_BT_HEX):
  20504. ptr += uintptr(2)
  20505. case int32(_BT_LEAD2):
  20506. if int64(end)-int64(ptr) < int64(libc.Int32FromInt32(2)) {
  20507. return -int32(2)
  20508. }
  20509. if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
  20510. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  20511. return m_XML_TOK_INVALID
  20512. }
  20513. ptr += uintptr(2)
  20514. case int32(_BT_LEAD3):
  20515. if int64(end)-int64(ptr) < int64(libc.Int32FromInt32(3)) {
  20516. return -int32(2)
  20517. }
  20518. if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
  20519. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  20520. return m_XML_TOK_INVALID
  20521. }
  20522. ptr += uintptr(3)
  20523. case int32(_BT_LEAD4):
  20524. if int64(end)-int64(ptr) < int64(libc.Int32FromInt32(4)) {
  20525. return -int32(2)
  20526. }
  20527. if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
  20528. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  20529. return m_XML_TOK_INVALID
  20530. }
  20531. ptr += uintptr(4)
  20532. default:
  20533. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  20534. return m_XML_TOK_INVALID
  20535. }
  20536. for int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2)) {
  20537. if int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 {
  20538. v2 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr)))))))
  20539. } else {
  20540. v2 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr + 1)), *(*int8)(unsafe.Pointer(ptr)))
  20541. }
  20542. switch v2 {
  20543. case int32(_BT_NONASCII):
  20544. if !(_namingBitmap[libc.Int32FromUint8(_namePages[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr + 1)))])<<int32(3)+libc.Int32FromUint8(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr))))>>int32(5)]&(libc.Uint32FromUint32(1)<<(libc.Int32FromUint8(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr))))&libc.Int32FromInt32(0x1F))) != 0) {
  20545. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  20546. return m_XML_TOK_INVALID
  20547. } /* fall through */
  20548. fallthrough
  20549. case int32(_BT_NMSTRT):
  20550. fallthrough
  20551. case int32(_BT_HEX):
  20552. fallthrough
  20553. case int32(_BT_DIGIT):
  20554. fallthrough
  20555. case int32(_BT_NAME):
  20556. fallthrough
  20557. case int32(_BT_MINUS):
  20558. ptr += uintptr(2)
  20559. case int32(_BT_LEAD2):
  20560. if int64(end)-int64(ptr) < int64(2) {
  20561. return -int32(2)
  20562. }
  20563. if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
  20564. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  20565. return m_XML_TOK_INVALID
  20566. }
  20567. ptr += uintptr(2)
  20568. case int32(_BT_LEAD3):
  20569. if int64(end)-int64(ptr) < int64(3) {
  20570. return -int32(2)
  20571. }
  20572. if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
  20573. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  20574. return m_XML_TOK_INVALID
  20575. }
  20576. ptr += uintptr(3)
  20577. case int32(_BT_LEAD4):
  20578. if int64(end)-int64(ptr) < int64(4) {
  20579. return -int32(2)
  20580. }
  20581. if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
  20582. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  20583. return m_XML_TOK_INVALID
  20584. }
  20585. ptr += uintptr(4)
  20586. case int32(_BT_S):
  20587. fallthrough
  20588. case int32(_BT_CR):
  20589. fallthrough
  20590. case int32(_BT_LF):
  20591. if !(_little2_checkPiTarget(tls, enc, target, ptr, bp) != 0) {
  20592. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  20593. return m_XML_TOK_INVALID
  20594. }
  20595. ptr += uintptr(2)
  20596. for int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2)) {
  20597. if int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 {
  20598. v3 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr)))))))
  20599. } else {
  20600. v3 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr + 1)), *(*int8)(unsafe.Pointer(ptr)))
  20601. }
  20602. switch v3 {
  20603. case int32(_BT_LEAD2):
  20604. if int64(end)-int64(ptr) < int64(2) {
  20605. return -int32(2)
  20606. }
  20607. if 0 != 0 {
  20608. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  20609. return m_XML_TOK_INVALID
  20610. }
  20611. ptr += uintptr(2)
  20612. case int32(_BT_LEAD3):
  20613. if int64(end)-int64(ptr) < int64(3) {
  20614. return -int32(2)
  20615. }
  20616. if 0 != 0 {
  20617. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  20618. return m_XML_TOK_INVALID
  20619. }
  20620. ptr += uintptr(3)
  20621. case int32(_BT_LEAD4):
  20622. if int64(end)-int64(ptr) < int64(4) {
  20623. return -int32(2)
  20624. }
  20625. if 0 != 0 {
  20626. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  20627. return m_XML_TOK_INVALID
  20628. }
  20629. ptr += uintptr(4)
  20630. case int32(_BT_NONXML):
  20631. fallthrough
  20632. case int32(_BT_MALFORM):
  20633. fallthrough
  20634. case int32(_BT_TRAIL):
  20635. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  20636. return m_XML_TOK_INVALID
  20637. case int32(_BT_QUEST):
  20638. ptr += uintptr(2)
  20639. if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
  20640. return -int32(1)
  20641. }
  20642. if int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 && int32(*(*int8)(unsafe.Pointer(ptr))) == int32(m_ASCII_GT1) {
  20643. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(2)
  20644. return *(*int32)(unsafe.Pointer(bp))
  20645. }
  20646. default:
  20647. ptr += uintptr(2)
  20648. break
  20649. }
  20650. }
  20651. return -int32(1)
  20652. case int32(_BT_QUEST):
  20653. if !(_little2_checkPiTarget(tls, enc, target, ptr, bp) != 0) {
  20654. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  20655. return m_XML_TOK_INVALID
  20656. }
  20657. ptr += uintptr(2)
  20658. if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
  20659. return -int32(1)
  20660. }
  20661. if int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 && int32(*(*int8)(unsafe.Pointer(ptr))) == int32(m_ASCII_GT1) {
  20662. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(2)
  20663. return *(*int32)(unsafe.Pointer(bp))
  20664. }
  20665. /* fall through */
  20666. fallthrough
  20667. default:
  20668. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  20669. return m_XML_TOK_INVALID
  20670. }
  20671. }
  20672. return -int32(1)
  20673. }
  20674. func _little2_scanCdataSection(tls *libc.TLS, enc uintptr, ptr uintptr, end uintptr, nextTokPtr uintptr) (r int32) {
  20675. var i int32
  20676. _ = i
  20677. _ = enc
  20678. /* CDATA[ */
  20679. if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(6)*libc.Int32FromInt32(2))) {
  20680. return -int32(1)
  20681. }
  20682. i = 0
  20683. for {
  20684. if !(i < int32(6)) {
  20685. break
  20686. }
  20687. if !(int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 && int32(*(*int8)(unsafe.Pointer(ptr))) == int32(_CDATA_LSQB1[i])) {
  20688. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  20689. return m_XML_TOK_INVALID
  20690. }
  20691. goto _1
  20692. _1:
  20693. ;
  20694. i++
  20695. ptr += uintptr(2)
  20696. }
  20697. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  20698. return int32(m_XML_TOK_CDATA_SECT_OPEN)
  20699. }
  20700. var _CDATA_LSQB1 = [6]int8{
  20701. 0: int8(m_ASCII_C),
  20702. 1: int8(m_ASCII_D),
  20703. 2: int8(m_ASCII_A),
  20704. 3: int8(m_ASCII_T),
  20705. 4: int8(m_ASCII_A),
  20706. 5: int8(m_ASCII_LSQB1),
  20707. }
  20708. func _little2_cdataSectionTok(tls *libc.TLS, enc uintptr, ptr uintptr, end uintptr, nextTokPtr uintptr) (r int32) {
  20709. var n Tsize_t
  20710. var v1, v2, v3 int32
  20711. _, _, _, _ = n, v1, v2, v3
  20712. if ptr >= end {
  20713. return -int32(4)
  20714. }
  20715. if int32(2) > int32(1) {
  20716. n = libc.Uint64FromInt64(int64(end) - int64(ptr))
  20717. if n&libc.Uint64FromInt32(libc.Int32FromInt32(2)-libc.Int32FromInt32(1)) != 0 {
  20718. n &= libc.Uint64FromInt32(^(libc.Int32FromInt32(2) - libc.Int32FromInt32(1)))
  20719. if n == uint64(0) {
  20720. return -int32(1)
  20721. }
  20722. end = ptr + uintptr(n)
  20723. }
  20724. }
  20725. if int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 {
  20726. v1 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr)))))))
  20727. } else {
  20728. v1 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr + 1)), *(*int8)(unsafe.Pointer(ptr)))
  20729. }
  20730. switch v1 {
  20731. case int32(_BT_RSQB):
  20732. ptr += uintptr(2)
  20733. if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
  20734. return -int32(1)
  20735. }
  20736. if !(int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 && int32(*(*int8)(unsafe.Pointer(ptr))) == int32(m_ASCII_RSQB1)) {
  20737. break
  20738. }
  20739. ptr += uintptr(2)
  20740. if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
  20741. return -int32(1)
  20742. }
  20743. if !(int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 && int32(*(*int8)(unsafe.Pointer(ptr))) == int32(m_ASCII_GT1)) {
  20744. ptr -= uintptr(2)
  20745. break
  20746. }
  20747. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(2)
  20748. return int32(m_XML_TOK_CDATA_SECT_CLOSE)
  20749. case int32(_BT_CR):
  20750. ptr += uintptr(2)
  20751. if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
  20752. return -int32(1)
  20753. }
  20754. if int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 {
  20755. v2 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr)))))))
  20756. } else {
  20757. v2 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr + 1)), *(*int8)(unsafe.Pointer(ptr)))
  20758. }
  20759. if v2 == int32(_BT_LF) {
  20760. ptr += uintptr(2)
  20761. }
  20762. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  20763. return int32(m_XML_TOK_DATA_NEWLINE)
  20764. case int32(_BT_LF):
  20765. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(2)
  20766. return int32(m_XML_TOK_DATA_NEWLINE)
  20767. case int32(_BT_LEAD2):
  20768. if int64(end)-int64(ptr) < int64(2) {
  20769. return -int32(2)
  20770. }
  20771. if 0 != 0 {
  20772. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  20773. return m_XML_TOK_INVALID
  20774. }
  20775. ptr += uintptr(2)
  20776. case int32(_BT_LEAD3):
  20777. if int64(end)-int64(ptr) < int64(3) {
  20778. return -int32(2)
  20779. }
  20780. if 0 != 0 {
  20781. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  20782. return m_XML_TOK_INVALID
  20783. }
  20784. ptr += uintptr(3)
  20785. case int32(_BT_LEAD4):
  20786. if int64(end)-int64(ptr) < int64(4) {
  20787. return -int32(2)
  20788. }
  20789. if 0 != 0 {
  20790. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  20791. return m_XML_TOK_INVALID
  20792. }
  20793. ptr += uintptr(4)
  20794. case int32(_BT_NONXML):
  20795. fallthrough
  20796. case int32(_BT_MALFORM):
  20797. fallthrough
  20798. case int32(_BT_TRAIL):
  20799. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  20800. return m_XML_TOK_INVALID
  20801. default:
  20802. ptr += uintptr(2)
  20803. break
  20804. }
  20805. for int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2)) {
  20806. if int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 {
  20807. v3 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr)))))))
  20808. } else {
  20809. v3 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr + 1)), *(*int8)(unsafe.Pointer(ptr)))
  20810. }
  20811. switch v3 {
  20812. case int32(_BT_LEAD2):
  20813. if int64(end)-int64(ptr) < int64(2) || libc.Bool(0 != 0) {
  20814. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  20815. return int32(m_XML_TOK_DATA_CHARS)
  20816. }
  20817. ptr += uintptr(2)
  20818. case int32(_BT_LEAD3):
  20819. if int64(end)-int64(ptr) < int64(3) || libc.Bool(0 != 0) {
  20820. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  20821. return int32(m_XML_TOK_DATA_CHARS)
  20822. }
  20823. ptr += uintptr(3)
  20824. case int32(_BT_LEAD4):
  20825. if int64(end)-int64(ptr) < int64(4) || libc.Bool(0 != 0) {
  20826. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  20827. return int32(m_XML_TOK_DATA_CHARS)
  20828. }
  20829. ptr += uintptr(4)
  20830. case int32(_BT_NONXML):
  20831. fallthrough
  20832. case int32(_BT_MALFORM):
  20833. fallthrough
  20834. case int32(_BT_TRAIL):
  20835. fallthrough
  20836. case int32(_BT_CR):
  20837. fallthrough
  20838. case int32(_BT_LF):
  20839. fallthrough
  20840. case int32(_BT_RSQB):
  20841. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  20842. return int32(m_XML_TOK_DATA_CHARS)
  20843. default:
  20844. ptr += uintptr(2)
  20845. break
  20846. }
  20847. }
  20848. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  20849. return int32(m_XML_TOK_DATA_CHARS)
  20850. }
  20851. /* ptr points to character following "</" */
  20852. func _little2_scanEndTag(tls *libc.TLS, enc uintptr, ptr uintptr, end uintptr, nextTokPtr uintptr) (r int32) {
  20853. var v1, v2, v22 int32
  20854. _, _, _ = v1, v2, v22
  20855. if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
  20856. return -int32(1)
  20857. }
  20858. if int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 {
  20859. v1 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr)))))))
  20860. } else {
  20861. v1 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr + 1)), *(*int8)(unsafe.Pointer(ptr)))
  20862. }
  20863. switch v1 {
  20864. case int32(_BT_NONASCII):
  20865. if !(_namingBitmap[libc.Int32FromUint8(_nmstrtPages[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr + 1)))])<<int32(3)+libc.Int32FromUint8(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr))))>>int32(5)]&(libc.Uint32FromUint32(1)<<(libc.Int32FromUint8(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr))))&libc.Int32FromInt32(0x1F))) != 0) {
  20866. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  20867. return m_XML_TOK_INVALID
  20868. } /* fall through */
  20869. fallthrough
  20870. case int32(_BT_NMSTRT):
  20871. fallthrough
  20872. case int32(_BT_HEX):
  20873. ptr += uintptr(2)
  20874. case int32(_BT_LEAD2):
  20875. if int64(end)-int64(ptr) < int64(libc.Int32FromInt32(2)) {
  20876. return -int32(2)
  20877. }
  20878. if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
  20879. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  20880. return m_XML_TOK_INVALID
  20881. }
  20882. ptr += uintptr(2)
  20883. case int32(_BT_LEAD3):
  20884. if int64(end)-int64(ptr) < int64(libc.Int32FromInt32(3)) {
  20885. return -int32(2)
  20886. }
  20887. if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
  20888. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  20889. return m_XML_TOK_INVALID
  20890. }
  20891. ptr += uintptr(3)
  20892. case int32(_BT_LEAD4):
  20893. if int64(end)-int64(ptr) < int64(libc.Int32FromInt32(4)) {
  20894. return -int32(2)
  20895. }
  20896. if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
  20897. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  20898. return m_XML_TOK_INVALID
  20899. }
  20900. ptr += uintptr(4)
  20901. default:
  20902. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  20903. return m_XML_TOK_INVALID
  20904. }
  20905. for int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2)) {
  20906. if int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 {
  20907. v2 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr)))))))
  20908. } else {
  20909. v2 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr + 1)), *(*int8)(unsafe.Pointer(ptr)))
  20910. }
  20911. switch v2 {
  20912. case int32(_BT_NONASCII):
  20913. goto _3
  20914. case int32(_BT_MINUS):
  20915. goto _4
  20916. case int32(_BT_NAME):
  20917. goto _5
  20918. case int32(_BT_DIGIT):
  20919. goto _6
  20920. case int32(_BT_HEX):
  20921. goto _7
  20922. case int32(_BT_NMSTRT):
  20923. goto _8
  20924. case int32(_BT_LEAD2):
  20925. goto _9
  20926. case int32(_BT_LEAD3):
  20927. goto _10
  20928. case int32(_BT_LEAD4):
  20929. goto _11
  20930. case int32(_BT_LF):
  20931. goto _12
  20932. case int32(_BT_CR):
  20933. goto _13
  20934. case int32(_BT_S):
  20935. goto _14
  20936. case int32(_BT_COLON):
  20937. goto _15
  20938. case int32(_BT_GT):
  20939. goto _16
  20940. default:
  20941. goto _17
  20942. }
  20943. goto _18
  20944. _3:
  20945. ;
  20946. if !(_namingBitmap[libc.Int32FromUint8(_namePages[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr + 1)))])<<int32(3)+libc.Int32FromUint8(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr))))>>int32(5)]&(libc.Uint32FromUint32(1)<<(libc.Int32FromUint8(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr))))&libc.Int32FromInt32(0x1F))) != 0) {
  20947. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  20948. return m_XML_TOK_INVALID
  20949. } /* fall through */
  20950. _8:
  20951. ;
  20952. _7:
  20953. ;
  20954. _6:
  20955. ;
  20956. _5:
  20957. ;
  20958. _4:
  20959. ;
  20960. ptr += uintptr(2)
  20961. goto _18
  20962. _9:
  20963. ;
  20964. if int64(end)-int64(ptr) < int64(2) {
  20965. return -int32(2)
  20966. }
  20967. if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
  20968. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  20969. return m_XML_TOK_INVALID
  20970. }
  20971. ptr += uintptr(2)
  20972. goto _18
  20973. _10:
  20974. ;
  20975. if int64(end)-int64(ptr) < int64(3) {
  20976. return -int32(2)
  20977. }
  20978. if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
  20979. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  20980. return m_XML_TOK_INVALID
  20981. }
  20982. ptr += uintptr(3)
  20983. goto _18
  20984. _11:
  20985. ;
  20986. if int64(end)-int64(ptr) < int64(4) {
  20987. return -int32(2)
  20988. }
  20989. if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
  20990. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  20991. return m_XML_TOK_INVALID
  20992. }
  20993. ptr += uintptr(4)
  20994. goto _18
  20995. _14:
  20996. ;
  20997. _13:
  20998. ;
  20999. _12:
  21000. ;
  21001. ptr += uintptr(2)
  21002. _21:
  21003. ;
  21004. if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
  21005. goto _19
  21006. }
  21007. if int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 {
  21008. v22 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr)))))))
  21009. } else {
  21010. v22 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr + 1)), *(*int8)(unsafe.Pointer(ptr)))
  21011. }
  21012. switch v22 {
  21013. case int32(_BT_S):
  21014. fallthrough
  21015. case int32(_BT_CR):
  21016. fallthrough
  21017. case int32(_BT_LF):
  21018. case int32(_BT_GT):
  21019. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(2)
  21020. return int32(m_XML_TOK_END_TAG)
  21021. default:
  21022. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  21023. return m_XML_TOK_INVALID
  21024. }
  21025. goto _20
  21026. _20:
  21027. ;
  21028. ptr += uintptr(2)
  21029. goto _21
  21030. goto _19
  21031. _19:
  21032. ;
  21033. return -int32(1)
  21034. _15:
  21035. ;
  21036. /* no need to check qname syntax here,
  21037. since end-tag must match exactly */
  21038. ptr += uintptr(2)
  21039. goto _18
  21040. _16:
  21041. ;
  21042. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(2)
  21043. return int32(m_XML_TOK_END_TAG)
  21044. _17:
  21045. ;
  21046. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  21047. return m_XML_TOK_INVALID
  21048. _18:
  21049. }
  21050. return -int32(1)
  21051. }
  21052. /* ptr points to character following "&#X" */
  21053. func _little2_scanHexCharRef(tls *libc.TLS, enc uintptr, ptr uintptr, end uintptr, nextTokPtr uintptr) (r int32) {
  21054. var v1, v3 int32
  21055. _, _ = v1, v3
  21056. if int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2)) {
  21057. if int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 {
  21058. v1 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr)))))))
  21059. } else {
  21060. v1 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr + 1)), *(*int8)(unsafe.Pointer(ptr)))
  21061. }
  21062. switch v1 {
  21063. case int32(_BT_DIGIT):
  21064. fallthrough
  21065. case int32(_BT_HEX):
  21066. default:
  21067. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  21068. return m_XML_TOK_INVALID
  21069. }
  21070. ptr += uintptr(2)
  21071. for {
  21072. if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
  21073. break
  21074. }
  21075. if int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 {
  21076. v3 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr)))))))
  21077. } else {
  21078. v3 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr + 1)), *(*int8)(unsafe.Pointer(ptr)))
  21079. }
  21080. switch v3 {
  21081. case int32(_BT_DIGIT):
  21082. fallthrough
  21083. case int32(_BT_HEX):
  21084. case int32(_BT_SEMI):
  21085. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(2)
  21086. return int32(m_XML_TOK_CHAR_REF)
  21087. default:
  21088. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  21089. return m_XML_TOK_INVALID
  21090. }
  21091. goto _2
  21092. _2:
  21093. ;
  21094. ptr += uintptr(2)
  21095. }
  21096. }
  21097. return -int32(1)
  21098. }
  21099. /* ptr points to character following "&#" */
  21100. func _little2_scanCharRef(tls *libc.TLS, enc uintptr, ptr uintptr, end uintptr, nextTokPtr uintptr) (r int32) {
  21101. var v1, v3 int32
  21102. _, _ = v1, v3
  21103. if int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2)) {
  21104. if int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 && int32(*(*int8)(unsafe.Pointer(ptr))) == int32(m_ASCII_x2) {
  21105. return _little2_scanHexCharRef(tls, enc, ptr+uintptr(2), end, nextTokPtr)
  21106. }
  21107. if int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 {
  21108. v1 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr)))))))
  21109. } else {
  21110. v1 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr + 1)), *(*int8)(unsafe.Pointer(ptr)))
  21111. }
  21112. switch v1 {
  21113. case int32(_BT_DIGIT):
  21114. default:
  21115. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  21116. return m_XML_TOK_INVALID
  21117. }
  21118. ptr += uintptr(2)
  21119. for {
  21120. if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
  21121. break
  21122. }
  21123. if int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 {
  21124. v3 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr)))))))
  21125. } else {
  21126. v3 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr + 1)), *(*int8)(unsafe.Pointer(ptr)))
  21127. }
  21128. switch v3 {
  21129. case int32(_BT_DIGIT):
  21130. case int32(_BT_SEMI):
  21131. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(2)
  21132. return int32(m_XML_TOK_CHAR_REF)
  21133. default:
  21134. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  21135. return m_XML_TOK_INVALID
  21136. }
  21137. goto _2
  21138. _2:
  21139. ;
  21140. ptr += uintptr(2)
  21141. }
  21142. }
  21143. return -int32(1)
  21144. }
  21145. /* ptr points to character following "&" */
  21146. func _little2_scanRef(tls *libc.TLS, enc uintptr, ptr uintptr, end uintptr, nextTokPtr uintptr) (r int32) {
  21147. var v1, v2 int32
  21148. _, _ = v1, v2
  21149. if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
  21150. return -int32(1)
  21151. }
  21152. if int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 {
  21153. v1 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr)))))))
  21154. } else {
  21155. v1 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr + 1)), *(*int8)(unsafe.Pointer(ptr)))
  21156. }
  21157. switch v1 {
  21158. case int32(_BT_NONASCII):
  21159. if !(_namingBitmap[libc.Int32FromUint8(_nmstrtPages[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr + 1)))])<<int32(3)+libc.Int32FromUint8(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr))))>>int32(5)]&(libc.Uint32FromUint32(1)<<(libc.Int32FromUint8(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr))))&libc.Int32FromInt32(0x1F))) != 0) {
  21160. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  21161. return m_XML_TOK_INVALID
  21162. } /* fall through */
  21163. fallthrough
  21164. case int32(_BT_NMSTRT):
  21165. fallthrough
  21166. case int32(_BT_HEX):
  21167. ptr += uintptr(2)
  21168. case int32(_BT_LEAD2):
  21169. if int64(end)-int64(ptr) < int64(libc.Int32FromInt32(2)) {
  21170. return -int32(2)
  21171. }
  21172. if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
  21173. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  21174. return m_XML_TOK_INVALID
  21175. }
  21176. ptr += uintptr(2)
  21177. case int32(_BT_LEAD3):
  21178. if int64(end)-int64(ptr) < int64(libc.Int32FromInt32(3)) {
  21179. return -int32(2)
  21180. }
  21181. if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
  21182. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  21183. return m_XML_TOK_INVALID
  21184. }
  21185. ptr += uintptr(3)
  21186. case int32(_BT_LEAD4):
  21187. if int64(end)-int64(ptr) < int64(libc.Int32FromInt32(4)) {
  21188. return -int32(2)
  21189. }
  21190. if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
  21191. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  21192. return m_XML_TOK_INVALID
  21193. }
  21194. ptr += uintptr(4)
  21195. case int32(_BT_NUM):
  21196. return _little2_scanCharRef(tls, enc, ptr+uintptr(2), end, nextTokPtr)
  21197. default:
  21198. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  21199. return m_XML_TOK_INVALID
  21200. }
  21201. for int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2)) {
  21202. if int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 {
  21203. v2 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr)))))))
  21204. } else {
  21205. v2 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr + 1)), *(*int8)(unsafe.Pointer(ptr)))
  21206. }
  21207. switch v2 {
  21208. case int32(_BT_NONASCII):
  21209. if !(_namingBitmap[libc.Int32FromUint8(_namePages[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr + 1)))])<<int32(3)+libc.Int32FromUint8(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr))))>>int32(5)]&(libc.Uint32FromUint32(1)<<(libc.Int32FromUint8(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr))))&libc.Int32FromInt32(0x1F))) != 0) {
  21210. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  21211. return m_XML_TOK_INVALID
  21212. } /* fall through */
  21213. fallthrough
  21214. case int32(_BT_NMSTRT):
  21215. fallthrough
  21216. case int32(_BT_HEX):
  21217. fallthrough
  21218. case int32(_BT_DIGIT):
  21219. fallthrough
  21220. case int32(_BT_NAME):
  21221. fallthrough
  21222. case int32(_BT_MINUS):
  21223. ptr += uintptr(2)
  21224. case int32(_BT_LEAD2):
  21225. if int64(end)-int64(ptr) < int64(2) {
  21226. return -int32(2)
  21227. }
  21228. if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
  21229. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  21230. return m_XML_TOK_INVALID
  21231. }
  21232. ptr += uintptr(2)
  21233. case int32(_BT_LEAD3):
  21234. if int64(end)-int64(ptr) < int64(3) {
  21235. return -int32(2)
  21236. }
  21237. if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
  21238. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  21239. return m_XML_TOK_INVALID
  21240. }
  21241. ptr += uintptr(3)
  21242. case int32(_BT_LEAD4):
  21243. if int64(end)-int64(ptr) < int64(4) {
  21244. return -int32(2)
  21245. }
  21246. if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
  21247. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  21248. return m_XML_TOK_INVALID
  21249. }
  21250. ptr += uintptr(4)
  21251. case int32(_BT_SEMI):
  21252. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(2)
  21253. return int32(m_XML_TOK_ENTITY_REF)
  21254. default:
  21255. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  21256. return m_XML_TOK_INVALID
  21257. }
  21258. }
  21259. return -int32(1)
  21260. }
  21261. /* ptr points to character following first character of attribute name */
  21262. func _little2_scanAtts(tls *libc.TLS, enc uintptr, _ptr uintptr, end uintptr, nextTokPtr uintptr) (r int32) {
  21263. bp := tls.Alloc(16)
  21264. defer tls.Free(16)
  21265. *(*uintptr)(unsafe.Pointer(bp)) = _ptr
  21266. var hadColon, open, t, t1, tok, v1, v18, v22, v24, v26, v27, v31 int32
  21267. _, _, _, _, _, _, _, _, _, _, _, _ = hadColon, open, t, t1, tok, v1, v18, v22, v24, v26, v27, v31
  21268. hadColon = 0
  21269. for int64(end)-int64(*(*uintptr)(unsafe.Pointer(bp))) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2)) {
  21270. if int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 1))) == 0 {
  21271. v1 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))))))))
  21272. } else {
  21273. v1 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 1)), *(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))))
  21274. }
  21275. switch v1 {
  21276. case int32(_BT_NONASCII):
  21277. goto _2
  21278. case int32(_BT_MINUS):
  21279. goto _3
  21280. case int32(_BT_NAME):
  21281. goto _4
  21282. case int32(_BT_DIGIT):
  21283. goto _5
  21284. case int32(_BT_HEX):
  21285. goto _6
  21286. case int32(_BT_NMSTRT):
  21287. goto _7
  21288. case int32(_BT_LEAD2):
  21289. goto _8
  21290. case int32(_BT_LEAD3):
  21291. goto _9
  21292. case int32(_BT_LEAD4):
  21293. goto _10
  21294. case int32(_BT_COLON):
  21295. goto _11
  21296. case int32(_BT_LF):
  21297. goto _12
  21298. case int32(_BT_CR):
  21299. goto _13
  21300. case int32(_BT_S):
  21301. goto _14
  21302. case int32(_BT_EQUALS):
  21303. goto _15
  21304. default:
  21305. goto _16
  21306. }
  21307. goto _17
  21308. _2:
  21309. ;
  21310. if !(_namingBitmap[libc.Int32FromUint8(_namePages[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 1)))])<<int32(3)+libc.Int32FromUint8(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp))))))>>int32(5)]&(libc.Uint32FromUint32(1)<<(libc.Int32FromUint8(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp))))))&libc.Int32FromInt32(0x1F))) != 0) {
  21311. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = *(*uintptr)(unsafe.Pointer(bp))
  21312. return m_XML_TOK_INVALID
  21313. } /* fall through */
  21314. _7:
  21315. ;
  21316. _6:
  21317. ;
  21318. _5:
  21319. ;
  21320. _4:
  21321. ;
  21322. _3:
  21323. ;
  21324. *(*uintptr)(unsafe.Pointer(bp)) += uintptr(2)
  21325. goto _17
  21326. _8:
  21327. ;
  21328. if int64(end)-int64(*(*uintptr)(unsafe.Pointer(bp))) < int64(2) {
  21329. return -int32(2)
  21330. }
  21331. if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
  21332. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = *(*uintptr)(unsafe.Pointer(bp))
  21333. return m_XML_TOK_INVALID
  21334. }
  21335. *(*uintptr)(unsafe.Pointer(bp)) += uintptr(2)
  21336. goto _17
  21337. _9:
  21338. ;
  21339. if int64(end)-int64(*(*uintptr)(unsafe.Pointer(bp))) < int64(3) {
  21340. return -int32(2)
  21341. }
  21342. if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
  21343. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = *(*uintptr)(unsafe.Pointer(bp))
  21344. return m_XML_TOK_INVALID
  21345. }
  21346. *(*uintptr)(unsafe.Pointer(bp)) += uintptr(3)
  21347. goto _17
  21348. _10:
  21349. ;
  21350. if int64(end)-int64(*(*uintptr)(unsafe.Pointer(bp))) < int64(4) {
  21351. return -int32(2)
  21352. }
  21353. if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
  21354. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = *(*uintptr)(unsafe.Pointer(bp))
  21355. return m_XML_TOK_INVALID
  21356. }
  21357. *(*uintptr)(unsafe.Pointer(bp)) += uintptr(4)
  21358. goto _17
  21359. _11:
  21360. ;
  21361. if hadColon != 0 {
  21362. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = *(*uintptr)(unsafe.Pointer(bp))
  21363. return m_XML_TOK_INVALID
  21364. }
  21365. hadColon = int32(1)
  21366. *(*uintptr)(unsafe.Pointer(bp)) += uintptr(2)
  21367. if !(int64(end)-int64(*(*uintptr)(unsafe.Pointer(bp))) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
  21368. return -int32(1)
  21369. }
  21370. if int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 1))) == 0 {
  21371. v18 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))))))))
  21372. } else {
  21373. v18 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 1)), *(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))))
  21374. }
  21375. switch v18 {
  21376. case int32(_BT_NONASCII):
  21377. if !(_namingBitmap[libc.Int32FromUint8(_nmstrtPages[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 1)))])<<int32(3)+libc.Int32FromUint8(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp))))))>>int32(5)]&(libc.Uint32FromUint32(1)<<(libc.Int32FromUint8(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp))))))&libc.Int32FromInt32(0x1F))) != 0) {
  21378. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = *(*uintptr)(unsafe.Pointer(bp))
  21379. return m_XML_TOK_INVALID
  21380. } /* fall through */
  21381. fallthrough
  21382. case int32(_BT_NMSTRT):
  21383. fallthrough
  21384. case int32(_BT_HEX):
  21385. *(*uintptr)(unsafe.Pointer(bp)) += uintptr(2)
  21386. case int32(_BT_LEAD2):
  21387. if int64(end)-int64(*(*uintptr)(unsafe.Pointer(bp))) < int64(libc.Int32FromInt32(2)) {
  21388. return -int32(2)
  21389. }
  21390. if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
  21391. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = *(*uintptr)(unsafe.Pointer(bp))
  21392. return m_XML_TOK_INVALID
  21393. }
  21394. *(*uintptr)(unsafe.Pointer(bp)) += uintptr(2)
  21395. case int32(_BT_LEAD3):
  21396. if int64(end)-int64(*(*uintptr)(unsafe.Pointer(bp))) < int64(libc.Int32FromInt32(3)) {
  21397. return -int32(2)
  21398. }
  21399. if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
  21400. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = *(*uintptr)(unsafe.Pointer(bp))
  21401. return m_XML_TOK_INVALID
  21402. }
  21403. *(*uintptr)(unsafe.Pointer(bp)) += uintptr(3)
  21404. case int32(_BT_LEAD4):
  21405. if int64(end)-int64(*(*uintptr)(unsafe.Pointer(bp))) < int64(libc.Int32FromInt32(4)) {
  21406. return -int32(2)
  21407. }
  21408. if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
  21409. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = *(*uintptr)(unsafe.Pointer(bp))
  21410. return m_XML_TOK_INVALID
  21411. }
  21412. *(*uintptr)(unsafe.Pointer(bp)) += uintptr(4)
  21413. default:
  21414. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = *(*uintptr)(unsafe.Pointer(bp))
  21415. return m_XML_TOK_INVALID
  21416. }
  21417. goto _17
  21418. _14:
  21419. ;
  21420. _13:
  21421. ;
  21422. _12:
  21423. ;
  21424. _21:
  21425. ;
  21426. *(*uintptr)(unsafe.Pointer(bp)) += uintptr(2)
  21427. if !(int64(end)-int64(*(*uintptr)(unsafe.Pointer(bp))) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
  21428. return -int32(1)
  21429. }
  21430. if int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 1))) == 0 {
  21431. v22 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))))))))
  21432. } else {
  21433. v22 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 1)), *(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))))
  21434. }
  21435. t = v22
  21436. if t == int32(_BT_EQUALS) {
  21437. goto _19
  21438. }
  21439. switch t {
  21440. case int32(_BT_S):
  21441. fallthrough
  21442. case int32(_BT_LF):
  21443. fallthrough
  21444. case int32(_BT_CR):
  21445. default:
  21446. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = *(*uintptr)(unsafe.Pointer(bp))
  21447. return m_XML_TOK_INVALID
  21448. }
  21449. goto _20
  21450. _20:
  21451. ;
  21452. goto _21
  21453. goto _19
  21454. _19:
  21455. ;
  21456. /* fall through */
  21457. _15:
  21458. ;
  21459. hadColon = 0
  21460. for {
  21461. *(*uintptr)(unsafe.Pointer(bp)) += uintptr(2)
  21462. if !(int64(end)-int64(*(*uintptr)(unsafe.Pointer(bp))) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
  21463. return -int32(1)
  21464. }
  21465. if int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 1))) == 0 {
  21466. v24 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))))))))
  21467. } else {
  21468. v24 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 1)), *(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))))
  21469. }
  21470. open = v24
  21471. if open == int32(_BT_QUOT) || open == int32(_BT_APOS) {
  21472. break
  21473. }
  21474. switch open {
  21475. case int32(_BT_S):
  21476. fallthrough
  21477. case int32(_BT_LF):
  21478. fallthrough
  21479. case int32(_BT_CR):
  21480. default:
  21481. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = *(*uintptr)(unsafe.Pointer(bp))
  21482. return m_XML_TOK_INVALID
  21483. }
  21484. goto _23
  21485. _23:
  21486. }
  21487. *(*uintptr)(unsafe.Pointer(bp)) += uintptr(2)
  21488. /* in attribute value */
  21489. for {
  21490. if !(int64(end)-int64(*(*uintptr)(unsafe.Pointer(bp))) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
  21491. return -int32(1)
  21492. }
  21493. if int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 1))) == 0 {
  21494. v26 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))))))))
  21495. } else {
  21496. v26 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 1)), *(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))))
  21497. }
  21498. t1 = v26
  21499. if t1 == open {
  21500. break
  21501. }
  21502. switch t1 {
  21503. case int32(_BT_LEAD2):
  21504. if int64(end)-int64(*(*uintptr)(unsafe.Pointer(bp))) < int64(2) {
  21505. return -int32(2)
  21506. }
  21507. if 0 != 0 {
  21508. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = *(*uintptr)(unsafe.Pointer(bp))
  21509. return m_XML_TOK_INVALID
  21510. }
  21511. *(*uintptr)(unsafe.Pointer(bp)) += uintptr(2)
  21512. case int32(_BT_LEAD3):
  21513. if int64(end)-int64(*(*uintptr)(unsafe.Pointer(bp))) < int64(3) {
  21514. return -int32(2)
  21515. }
  21516. if 0 != 0 {
  21517. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = *(*uintptr)(unsafe.Pointer(bp))
  21518. return m_XML_TOK_INVALID
  21519. }
  21520. *(*uintptr)(unsafe.Pointer(bp)) += uintptr(3)
  21521. case int32(_BT_LEAD4):
  21522. if int64(end)-int64(*(*uintptr)(unsafe.Pointer(bp))) < int64(4) {
  21523. return -int32(2)
  21524. }
  21525. if 0 != 0 {
  21526. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = *(*uintptr)(unsafe.Pointer(bp))
  21527. return m_XML_TOK_INVALID
  21528. }
  21529. *(*uintptr)(unsafe.Pointer(bp)) += uintptr(4)
  21530. case int32(_BT_NONXML):
  21531. fallthrough
  21532. case int32(_BT_MALFORM):
  21533. fallthrough
  21534. case int32(_BT_TRAIL):
  21535. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = *(*uintptr)(unsafe.Pointer(bp))
  21536. return m_XML_TOK_INVALID
  21537. case int32(_BT_AMP):
  21538. tok = _little2_scanRef(tls, enc, *(*uintptr)(unsafe.Pointer(bp))+uintptr(2), end, bp)
  21539. if tok <= 0 {
  21540. if tok == m_XML_TOK_INVALID {
  21541. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = *(*uintptr)(unsafe.Pointer(bp))
  21542. }
  21543. return tok
  21544. }
  21545. case int32(_BT_LT):
  21546. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = *(*uintptr)(unsafe.Pointer(bp))
  21547. return m_XML_TOK_INVALID
  21548. default:
  21549. *(*uintptr)(unsafe.Pointer(bp)) += uintptr(2)
  21550. break
  21551. }
  21552. goto _25
  21553. _25:
  21554. }
  21555. *(*uintptr)(unsafe.Pointer(bp)) += uintptr(2)
  21556. if !(int64(end)-int64(*(*uintptr)(unsafe.Pointer(bp))) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
  21557. return -int32(1)
  21558. }
  21559. if int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 1))) == 0 {
  21560. v27 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))))))))
  21561. } else {
  21562. v27 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 1)), *(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))))
  21563. }
  21564. switch v27 {
  21565. case int32(_BT_S):
  21566. fallthrough
  21567. case int32(_BT_CR):
  21568. fallthrough
  21569. case int32(_BT_LF):
  21570. case int32(_BT_SOL):
  21571. goto sol
  21572. case int32(_BT_GT):
  21573. goto gt
  21574. default:
  21575. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = *(*uintptr)(unsafe.Pointer(bp))
  21576. return m_XML_TOK_INVALID
  21577. }
  21578. /* ptr points to closing quote */
  21579. _30:
  21580. ;
  21581. *(*uintptr)(unsafe.Pointer(bp)) += uintptr(2)
  21582. if !(int64(end)-int64(*(*uintptr)(unsafe.Pointer(bp))) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
  21583. return -int32(1)
  21584. }
  21585. if int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 1))) == 0 {
  21586. v31 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))))))))
  21587. } else {
  21588. v31 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 1)), *(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))))
  21589. }
  21590. switch v31 {
  21591. case int32(_BT_NONASCII):
  21592. goto _32
  21593. case int32(_BT_HEX):
  21594. goto _33
  21595. case int32(_BT_NMSTRT):
  21596. goto _34
  21597. case int32(_BT_LEAD2):
  21598. goto _35
  21599. case int32(_BT_LEAD3):
  21600. goto _36
  21601. case int32(_BT_LEAD4):
  21602. goto _37
  21603. case int32(_BT_LF):
  21604. goto _38
  21605. case int32(_BT_CR):
  21606. goto _39
  21607. case int32(_BT_S):
  21608. goto _40
  21609. case int32(_BT_GT):
  21610. goto _41
  21611. case int32(_BT_SOL):
  21612. goto _42
  21613. default:
  21614. goto _43
  21615. }
  21616. goto _44
  21617. _32:
  21618. ;
  21619. if !(_namingBitmap[libc.Int32FromUint8(_nmstrtPages[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 1)))])<<int32(3)+libc.Int32FromUint8(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp))))))>>int32(5)]&(libc.Uint32FromUint32(1)<<(libc.Int32FromUint8(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp))))))&libc.Int32FromInt32(0x1F))) != 0) {
  21620. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = *(*uintptr)(unsafe.Pointer(bp))
  21621. return m_XML_TOK_INVALID
  21622. } /* fall through */
  21623. _34:
  21624. ;
  21625. _33:
  21626. ;
  21627. *(*uintptr)(unsafe.Pointer(bp)) += uintptr(2)
  21628. goto _44
  21629. _35:
  21630. ;
  21631. if int64(end)-int64(*(*uintptr)(unsafe.Pointer(bp))) < int64(libc.Int32FromInt32(2)) {
  21632. return -int32(2)
  21633. }
  21634. if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
  21635. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = *(*uintptr)(unsafe.Pointer(bp))
  21636. return m_XML_TOK_INVALID
  21637. }
  21638. *(*uintptr)(unsafe.Pointer(bp)) += uintptr(2)
  21639. goto _44
  21640. _36:
  21641. ;
  21642. if int64(end)-int64(*(*uintptr)(unsafe.Pointer(bp))) < int64(libc.Int32FromInt32(3)) {
  21643. return -int32(2)
  21644. }
  21645. if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
  21646. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = *(*uintptr)(unsafe.Pointer(bp))
  21647. return m_XML_TOK_INVALID
  21648. }
  21649. *(*uintptr)(unsafe.Pointer(bp)) += uintptr(3)
  21650. goto _44
  21651. _37:
  21652. ;
  21653. if int64(end)-int64(*(*uintptr)(unsafe.Pointer(bp))) < int64(libc.Int32FromInt32(4)) {
  21654. return -int32(2)
  21655. }
  21656. if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
  21657. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = *(*uintptr)(unsafe.Pointer(bp))
  21658. return m_XML_TOK_INVALID
  21659. }
  21660. *(*uintptr)(unsafe.Pointer(bp)) += uintptr(4)
  21661. goto _44
  21662. _40:
  21663. ;
  21664. _39:
  21665. ;
  21666. _38:
  21667. ;
  21668. goto _29
  21669. _41:
  21670. ;
  21671. goto gt
  21672. gt:
  21673. ;
  21674. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = *(*uintptr)(unsafe.Pointer(bp)) + uintptr(2)
  21675. return int32(m_XML_TOK_START_TAG_WITH_ATTS)
  21676. _42:
  21677. ;
  21678. goto sol
  21679. sol:
  21680. ;
  21681. *(*uintptr)(unsafe.Pointer(bp)) += uintptr(2)
  21682. if !(int64(end)-int64(*(*uintptr)(unsafe.Pointer(bp))) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
  21683. return -int32(1)
  21684. }
  21685. if !(int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 1))) == 0 && int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp))))) == int32(m_ASCII_GT1)) {
  21686. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = *(*uintptr)(unsafe.Pointer(bp))
  21687. return m_XML_TOK_INVALID
  21688. }
  21689. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = *(*uintptr)(unsafe.Pointer(bp)) + uintptr(2)
  21690. return int32(m_XML_TOK_EMPTY_ELEMENT_WITH_ATTS)
  21691. _43:
  21692. ;
  21693. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = *(*uintptr)(unsafe.Pointer(bp))
  21694. return m_XML_TOK_INVALID
  21695. _44:
  21696. ;
  21697. goto _28
  21698. goto _29
  21699. _29:
  21700. ;
  21701. goto _30
  21702. goto _28
  21703. _28:
  21704. ;
  21705. goto _17
  21706. _16:
  21707. ;
  21708. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = *(*uintptr)(unsafe.Pointer(bp))
  21709. return m_XML_TOK_INVALID
  21710. _17:
  21711. }
  21712. return -int32(1)
  21713. }
  21714. /* ptr points to character following "<" */
  21715. func _little2_scanLt(tls *libc.TLS, enc uintptr, ptr uintptr, end uintptr, nextTokPtr uintptr) (r int32) {
  21716. var hadColon, v1, v2, v21, v22, v3 int32
  21717. _, _, _, _, _, _ = hadColon, v1, v2, v21, v22, v3
  21718. if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
  21719. return -int32(1)
  21720. }
  21721. if int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 {
  21722. v1 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr)))))))
  21723. } else {
  21724. v1 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr + 1)), *(*int8)(unsafe.Pointer(ptr)))
  21725. }
  21726. switch v1 {
  21727. case int32(_BT_NONASCII):
  21728. if !(_namingBitmap[libc.Int32FromUint8(_nmstrtPages[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr + 1)))])<<int32(3)+libc.Int32FromUint8(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr))))>>int32(5)]&(libc.Uint32FromUint32(1)<<(libc.Int32FromUint8(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr))))&libc.Int32FromInt32(0x1F))) != 0) {
  21729. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  21730. return m_XML_TOK_INVALID
  21731. } /* fall through */
  21732. fallthrough
  21733. case int32(_BT_NMSTRT):
  21734. fallthrough
  21735. case int32(_BT_HEX):
  21736. ptr += uintptr(2)
  21737. case int32(_BT_LEAD2):
  21738. if int64(end)-int64(ptr) < int64(libc.Int32FromInt32(2)) {
  21739. return -int32(2)
  21740. }
  21741. if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
  21742. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  21743. return m_XML_TOK_INVALID
  21744. }
  21745. ptr += uintptr(2)
  21746. case int32(_BT_LEAD3):
  21747. if int64(end)-int64(ptr) < int64(libc.Int32FromInt32(3)) {
  21748. return -int32(2)
  21749. }
  21750. if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
  21751. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  21752. return m_XML_TOK_INVALID
  21753. }
  21754. ptr += uintptr(3)
  21755. case int32(_BT_LEAD4):
  21756. if int64(end)-int64(ptr) < int64(libc.Int32FromInt32(4)) {
  21757. return -int32(2)
  21758. }
  21759. if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
  21760. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  21761. return m_XML_TOK_INVALID
  21762. }
  21763. ptr += uintptr(4)
  21764. case int32(_BT_EXCL):
  21765. ptr += uintptr(2)
  21766. if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
  21767. return -int32(1)
  21768. }
  21769. if int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 {
  21770. v2 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr)))))))
  21771. } else {
  21772. v2 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr + 1)), *(*int8)(unsafe.Pointer(ptr)))
  21773. }
  21774. switch v2 {
  21775. case int32(_BT_MINUS):
  21776. return _little2_scanComment(tls, enc, ptr+uintptr(2), end, nextTokPtr)
  21777. case int32(_BT_LSQB):
  21778. return _little2_scanCdataSection(tls, enc, ptr+uintptr(2), end, nextTokPtr)
  21779. }
  21780. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  21781. return m_XML_TOK_INVALID
  21782. case int32(_BT_QUEST):
  21783. return _little2_scanPi(tls, enc, ptr+uintptr(2), end, nextTokPtr)
  21784. case int32(_BT_SOL):
  21785. return _little2_scanEndTag(tls, enc, ptr+uintptr(2), end, nextTokPtr)
  21786. default:
  21787. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  21788. return m_XML_TOK_INVALID
  21789. }
  21790. hadColon = 0
  21791. /* we have a start-tag */
  21792. for int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2)) {
  21793. if int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 {
  21794. v3 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr)))))))
  21795. } else {
  21796. v3 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr + 1)), *(*int8)(unsafe.Pointer(ptr)))
  21797. }
  21798. switch v3 {
  21799. case int32(_BT_NONASCII):
  21800. goto _4
  21801. case int32(_BT_MINUS):
  21802. goto _5
  21803. case int32(_BT_NAME):
  21804. goto _6
  21805. case int32(_BT_DIGIT):
  21806. goto _7
  21807. case int32(_BT_HEX):
  21808. goto _8
  21809. case int32(_BT_NMSTRT):
  21810. goto _9
  21811. case int32(_BT_LEAD2):
  21812. goto _10
  21813. case int32(_BT_LEAD3):
  21814. goto _11
  21815. case int32(_BT_LEAD4):
  21816. goto _12
  21817. case int32(_BT_COLON):
  21818. goto _13
  21819. case int32(_BT_LF):
  21820. goto _14
  21821. case int32(_BT_CR):
  21822. goto _15
  21823. case int32(_BT_S):
  21824. goto _16
  21825. case int32(_BT_GT):
  21826. goto _17
  21827. case int32(_BT_SOL):
  21828. goto _18
  21829. default:
  21830. goto _19
  21831. }
  21832. goto _20
  21833. _4:
  21834. ;
  21835. if !(_namingBitmap[libc.Int32FromUint8(_namePages[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr + 1)))])<<int32(3)+libc.Int32FromUint8(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr))))>>int32(5)]&(libc.Uint32FromUint32(1)<<(libc.Int32FromUint8(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr))))&libc.Int32FromInt32(0x1F))) != 0) {
  21836. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  21837. return m_XML_TOK_INVALID
  21838. } /* fall through */
  21839. _9:
  21840. ;
  21841. _8:
  21842. ;
  21843. _7:
  21844. ;
  21845. _6:
  21846. ;
  21847. _5:
  21848. ;
  21849. ptr += uintptr(2)
  21850. goto _20
  21851. _10:
  21852. ;
  21853. if int64(end)-int64(ptr) < int64(2) {
  21854. return -int32(2)
  21855. }
  21856. if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
  21857. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  21858. return m_XML_TOK_INVALID
  21859. }
  21860. ptr += uintptr(2)
  21861. goto _20
  21862. _11:
  21863. ;
  21864. if int64(end)-int64(ptr) < int64(3) {
  21865. return -int32(2)
  21866. }
  21867. if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
  21868. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  21869. return m_XML_TOK_INVALID
  21870. }
  21871. ptr += uintptr(3)
  21872. goto _20
  21873. _12:
  21874. ;
  21875. if int64(end)-int64(ptr) < int64(4) {
  21876. return -int32(2)
  21877. }
  21878. if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
  21879. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  21880. return m_XML_TOK_INVALID
  21881. }
  21882. ptr += uintptr(4)
  21883. goto _20
  21884. _13:
  21885. ;
  21886. if hadColon != 0 {
  21887. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  21888. return m_XML_TOK_INVALID
  21889. }
  21890. hadColon = int32(1)
  21891. ptr += uintptr(2)
  21892. if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
  21893. return -int32(1)
  21894. }
  21895. if int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 {
  21896. v21 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr)))))))
  21897. } else {
  21898. v21 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr + 1)), *(*int8)(unsafe.Pointer(ptr)))
  21899. }
  21900. switch v21 {
  21901. case int32(_BT_NONASCII):
  21902. if !(_namingBitmap[libc.Int32FromUint8(_nmstrtPages[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr + 1)))])<<int32(3)+libc.Int32FromUint8(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr))))>>int32(5)]&(libc.Uint32FromUint32(1)<<(libc.Int32FromUint8(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr))))&libc.Int32FromInt32(0x1F))) != 0) {
  21903. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  21904. return m_XML_TOK_INVALID
  21905. } /* fall through */
  21906. fallthrough
  21907. case int32(_BT_NMSTRT):
  21908. fallthrough
  21909. case int32(_BT_HEX):
  21910. ptr += uintptr(2)
  21911. case int32(_BT_LEAD2):
  21912. if int64(end)-int64(ptr) < int64(libc.Int32FromInt32(2)) {
  21913. return -int32(2)
  21914. }
  21915. if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
  21916. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  21917. return m_XML_TOK_INVALID
  21918. }
  21919. ptr += uintptr(2)
  21920. case int32(_BT_LEAD3):
  21921. if int64(end)-int64(ptr) < int64(libc.Int32FromInt32(3)) {
  21922. return -int32(2)
  21923. }
  21924. if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
  21925. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  21926. return m_XML_TOK_INVALID
  21927. }
  21928. ptr += uintptr(3)
  21929. case int32(_BT_LEAD4):
  21930. if int64(end)-int64(ptr) < int64(libc.Int32FromInt32(4)) {
  21931. return -int32(2)
  21932. }
  21933. if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
  21934. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  21935. return m_XML_TOK_INVALID
  21936. }
  21937. ptr += uintptr(4)
  21938. default:
  21939. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  21940. return m_XML_TOK_INVALID
  21941. }
  21942. goto _20
  21943. _16:
  21944. ;
  21945. _15:
  21946. ;
  21947. _14:
  21948. ;
  21949. ptr += uintptr(2)
  21950. for int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2)) {
  21951. if int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 {
  21952. v22 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr)))))))
  21953. } else {
  21954. v22 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr + 1)), *(*int8)(unsafe.Pointer(ptr)))
  21955. }
  21956. switch v22 {
  21957. case int32(_BT_NONASCII):
  21958. if !(_namingBitmap[libc.Int32FromUint8(_nmstrtPages[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr + 1)))])<<int32(3)+libc.Int32FromUint8(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr))))>>int32(5)]&(libc.Uint32FromUint32(1)<<(libc.Int32FromUint8(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr))))&libc.Int32FromInt32(0x1F))) != 0) {
  21959. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  21960. return m_XML_TOK_INVALID
  21961. } /* fall through */
  21962. fallthrough
  21963. case int32(_BT_NMSTRT):
  21964. fallthrough
  21965. case int32(_BT_HEX):
  21966. ptr += uintptr(2)
  21967. case int32(_BT_LEAD2):
  21968. if int64(end)-int64(ptr) < int64(libc.Int32FromInt32(2)) {
  21969. return -int32(2)
  21970. }
  21971. if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
  21972. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  21973. return m_XML_TOK_INVALID
  21974. }
  21975. ptr += uintptr(2)
  21976. case int32(_BT_LEAD3):
  21977. if int64(end)-int64(ptr) < int64(libc.Int32FromInt32(3)) {
  21978. return -int32(2)
  21979. }
  21980. if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
  21981. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  21982. return m_XML_TOK_INVALID
  21983. }
  21984. ptr += uintptr(3)
  21985. case int32(_BT_LEAD4):
  21986. if int64(end)-int64(ptr) < int64(libc.Int32FromInt32(4)) {
  21987. return -int32(2)
  21988. }
  21989. if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
  21990. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  21991. return m_XML_TOK_INVALID
  21992. }
  21993. ptr += uintptr(4)
  21994. case int32(_BT_GT):
  21995. goto gt
  21996. case int32(_BT_SOL):
  21997. goto sol
  21998. case int32(_BT_S):
  21999. fallthrough
  22000. case int32(_BT_CR):
  22001. fallthrough
  22002. case int32(_BT_LF):
  22003. ptr += uintptr(2)
  22004. continue
  22005. default:
  22006. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  22007. return m_XML_TOK_INVALID
  22008. }
  22009. return _little2_scanAtts(tls, enc, ptr, end, nextTokPtr)
  22010. }
  22011. return -int32(1)
  22012. _17:
  22013. ;
  22014. goto gt
  22015. gt:
  22016. ;
  22017. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(2)
  22018. return int32(m_XML_TOK_START_TAG_NO_ATTS)
  22019. _18:
  22020. ;
  22021. goto sol
  22022. sol:
  22023. ;
  22024. ptr += uintptr(2)
  22025. if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
  22026. return -int32(1)
  22027. }
  22028. if !(int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 && int32(*(*int8)(unsafe.Pointer(ptr))) == int32(m_ASCII_GT1)) {
  22029. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  22030. return m_XML_TOK_INVALID
  22031. }
  22032. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(2)
  22033. return int32(m_XML_TOK_EMPTY_ELEMENT_NO_ATTS)
  22034. _19:
  22035. ;
  22036. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  22037. return m_XML_TOK_INVALID
  22038. _20:
  22039. }
  22040. return -int32(1)
  22041. }
  22042. func _little2_contentTok(tls *libc.TLS, enc uintptr, ptr uintptr, end uintptr, nextTokPtr uintptr) (r int32) {
  22043. var n Tsize_t
  22044. var v1, v2, v3 int32
  22045. _, _, _, _ = n, v1, v2, v3
  22046. if ptr >= end {
  22047. return -int32(4)
  22048. }
  22049. if int32(2) > int32(1) {
  22050. n = libc.Uint64FromInt64(int64(end) - int64(ptr))
  22051. if n&libc.Uint64FromInt32(libc.Int32FromInt32(2)-libc.Int32FromInt32(1)) != 0 {
  22052. n &= libc.Uint64FromInt32(^(libc.Int32FromInt32(2) - libc.Int32FromInt32(1)))
  22053. if n == uint64(0) {
  22054. return -int32(1)
  22055. }
  22056. end = ptr + uintptr(n)
  22057. }
  22058. }
  22059. if int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 {
  22060. v1 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr)))))))
  22061. } else {
  22062. v1 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr + 1)), *(*int8)(unsafe.Pointer(ptr)))
  22063. }
  22064. switch v1 {
  22065. case int32(_BT_LT):
  22066. return _little2_scanLt(tls, enc, ptr+uintptr(2), end, nextTokPtr)
  22067. case int32(_BT_AMP):
  22068. return _little2_scanRef(tls, enc, ptr+uintptr(2), end, nextTokPtr)
  22069. case int32(_BT_CR):
  22070. ptr += uintptr(2)
  22071. if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
  22072. return -int32(3)
  22073. }
  22074. if int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 {
  22075. v2 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr)))))))
  22076. } else {
  22077. v2 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr + 1)), *(*int8)(unsafe.Pointer(ptr)))
  22078. }
  22079. if v2 == int32(_BT_LF) {
  22080. ptr += uintptr(2)
  22081. }
  22082. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  22083. return int32(m_XML_TOK_DATA_NEWLINE)
  22084. case int32(_BT_LF):
  22085. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(2)
  22086. return int32(m_XML_TOK_DATA_NEWLINE)
  22087. case int32(_BT_RSQB):
  22088. ptr += uintptr(2)
  22089. if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
  22090. return -int32(5)
  22091. }
  22092. if !(int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 && int32(*(*int8)(unsafe.Pointer(ptr))) == int32(m_ASCII_RSQB1)) {
  22093. break
  22094. }
  22095. ptr += uintptr(2)
  22096. if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
  22097. return -int32(5)
  22098. }
  22099. if !(int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 && int32(*(*int8)(unsafe.Pointer(ptr))) == int32(m_ASCII_GT1)) {
  22100. ptr -= uintptr(2)
  22101. break
  22102. }
  22103. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  22104. return m_XML_TOK_INVALID
  22105. case int32(_BT_LEAD2):
  22106. if int64(end)-int64(ptr) < int64(2) {
  22107. return -int32(2)
  22108. }
  22109. if 0 != 0 {
  22110. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  22111. return m_XML_TOK_INVALID
  22112. }
  22113. ptr += uintptr(2)
  22114. case int32(_BT_LEAD3):
  22115. if int64(end)-int64(ptr) < int64(3) {
  22116. return -int32(2)
  22117. }
  22118. if 0 != 0 {
  22119. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  22120. return m_XML_TOK_INVALID
  22121. }
  22122. ptr += uintptr(3)
  22123. case int32(_BT_LEAD4):
  22124. if int64(end)-int64(ptr) < int64(4) {
  22125. return -int32(2)
  22126. }
  22127. if 0 != 0 {
  22128. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  22129. return m_XML_TOK_INVALID
  22130. }
  22131. ptr += uintptr(4)
  22132. case int32(_BT_NONXML):
  22133. fallthrough
  22134. case int32(_BT_MALFORM):
  22135. fallthrough
  22136. case int32(_BT_TRAIL):
  22137. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  22138. return m_XML_TOK_INVALID
  22139. default:
  22140. ptr += uintptr(2)
  22141. break
  22142. }
  22143. for int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2)) {
  22144. if int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 {
  22145. v3 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr)))))))
  22146. } else {
  22147. v3 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr + 1)), *(*int8)(unsafe.Pointer(ptr)))
  22148. }
  22149. switch v3 {
  22150. case int32(_BT_LEAD2):
  22151. if int64(end)-int64(ptr) < int64(2) || libc.Bool(0 != 0) {
  22152. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  22153. return int32(m_XML_TOK_DATA_CHARS)
  22154. }
  22155. ptr += uintptr(2)
  22156. case int32(_BT_LEAD3):
  22157. if int64(end)-int64(ptr) < int64(3) || libc.Bool(0 != 0) {
  22158. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  22159. return int32(m_XML_TOK_DATA_CHARS)
  22160. }
  22161. ptr += uintptr(3)
  22162. case int32(_BT_LEAD4):
  22163. if int64(end)-int64(ptr) < int64(4) || libc.Bool(0 != 0) {
  22164. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  22165. return int32(m_XML_TOK_DATA_CHARS)
  22166. }
  22167. ptr += uintptr(4)
  22168. case int32(_BT_RSQB):
  22169. if int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(2)*libc.Int32FromInt32(2)) {
  22170. if !(int32(*(*int8)(unsafe.Pointer(ptr + libc.UintptrFromInt32(2) + 1))) == 0 && int32(*(*int8)(unsafe.Pointer(ptr + libc.UintptrFromInt32(2)))) == int32(m_ASCII_RSQB1)) {
  22171. ptr += uintptr(2)
  22172. break
  22173. }
  22174. if int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(3)*libc.Int32FromInt32(2)) {
  22175. if !(int32(*(*int8)(unsafe.Pointer(ptr + uintptr(libc.Int32FromInt32(2)*libc.Int32FromInt32(2)) + 1))) == 0 && int32(*(*int8)(unsafe.Pointer(ptr + uintptr(libc.Int32FromInt32(2)*libc.Int32FromInt32(2))))) == int32(m_ASCII_GT1)) {
  22176. ptr += uintptr(2)
  22177. break
  22178. }
  22179. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(libc.Int32FromInt32(2)*libc.Int32FromInt32(2))
  22180. return m_XML_TOK_INVALID
  22181. }
  22182. }
  22183. /* fall through */
  22184. fallthrough
  22185. case int32(_BT_AMP):
  22186. fallthrough
  22187. case int32(_BT_LT):
  22188. fallthrough
  22189. case int32(_BT_NONXML):
  22190. fallthrough
  22191. case int32(_BT_MALFORM):
  22192. fallthrough
  22193. case int32(_BT_TRAIL):
  22194. fallthrough
  22195. case int32(_BT_CR):
  22196. fallthrough
  22197. case int32(_BT_LF):
  22198. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  22199. return int32(m_XML_TOK_DATA_CHARS)
  22200. default:
  22201. ptr += uintptr(2)
  22202. break
  22203. }
  22204. }
  22205. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  22206. return int32(m_XML_TOK_DATA_CHARS)
  22207. }
  22208. /* ptr points to character following "%" */
  22209. func _little2_scanPercent(tls *libc.TLS, enc uintptr, ptr uintptr, end uintptr, nextTokPtr uintptr) (r int32) {
  22210. var v1, v2 int32
  22211. _, _ = v1, v2
  22212. if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
  22213. return -int32(1)
  22214. }
  22215. if int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 {
  22216. v1 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr)))))))
  22217. } else {
  22218. v1 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr + 1)), *(*int8)(unsafe.Pointer(ptr)))
  22219. }
  22220. switch v1 {
  22221. case int32(_BT_NONASCII):
  22222. if !(_namingBitmap[libc.Int32FromUint8(_nmstrtPages[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr + 1)))])<<int32(3)+libc.Int32FromUint8(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr))))>>int32(5)]&(libc.Uint32FromUint32(1)<<(libc.Int32FromUint8(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr))))&libc.Int32FromInt32(0x1F))) != 0) {
  22223. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  22224. return m_XML_TOK_INVALID
  22225. } /* fall through */
  22226. fallthrough
  22227. case int32(_BT_NMSTRT):
  22228. fallthrough
  22229. case int32(_BT_HEX):
  22230. ptr += uintptr(2)
  22231. case int32(_BT_LEAD2):
  22232. if int64(end)-int64(ptr) < int64(libc.Int32FromInt32(2)) {
  22233. return -int32(2)
  22234. }
  22235. if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
  22236. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  22237. return m_XML_TOK_INVALID
  22238. }
  22239. ptr += uintptr(2)
  22240. case int32(_BT_LEAD3):
  22241. if int64(end)-int64(ptr) < int64(libc.Int32FromInt32(3)) {
  22242. return -int32(2)
  22243. }
  22244. if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
  22245. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  22246. return m_XML_TOK_INVALID
  22247. }
  22248. ptr += uintptr(3)
  22249. case int32(_BT_LEAD4):
  22250. if int64(end)-int64(ptr) < int64(libc.Int32FromInt32(4)) {
  22251. return -int32(2)
  22252. }
  22253. if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
  22254. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  22255. return m_XML_TOK_INVALID
  22256. }
  22257. ptr += uintptr(4)
  22258. case int32(_BT_S):
  22259. fallthrough
  22260. case int32(_BT_LF):
  22261. fallthrough
  22262. case int32(_BT_CR):
  22263. fallthrough
  22264. case int32(_BT_PERCNT):
  22265. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  22266. return int32(m_XML_TOK_PERCENT)
  22267. default:
  22268. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  22269. return m_XML_TOK_INVALID
  22270. }
  22271. for int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2)) {
  22272. if int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 {
  22273. v2 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr)))))))
  22274. } else {
  22275. v2 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr + 1)), *(*int8)(unsafe.Pointer(ptr)))
  22276. }
  22277. switch v2 {
  22278. case int32(_BT_NONASCII):
  22279. if !(_namingBitmap[libc.Int32FromUint8(_namePages[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr + 1)))])<<int32(3)+libc.Int32FromUint8(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr))))>>int32(5)]&(libc.Uint32FromUint32(1)<<(libc.Int32FromUint8(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr))))&libc.Int32FromInt32(0x1F))) != 0) {
  22280. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  22281. return m_XML_TOK_INVALID
  22282. } /* fall through */
  22283. fallthrough
  22284. case int32(_BT_NMSTRT):
  22285. fallthrough
  22286. case int32(_BT_HEX):
  22287. fallthrough
  22288. case int32(_BT_DIGIT):
  22289. fallthrough
  22290. case int32(_BT_NAME):
  22291. fallthrough
  22292. case int32(_BT_MINUS):
  22293. ptr += uintptr(2)
  22294. case int32(_BT_LEAD2):
  22295. if int64(end)-int64(ptr) < int64(2) {
  22296. return -int32(2)
  22297. }
  22298. if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
  22299. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  22300. return m_XML_TOK_INVALID
  22301. }
  22302. ptr += uintptr(2)
  22303. case int32(_BT_LEAD3):
  22304. if int64(end)-int64(ptr) < int64(3) {
  22305. return -int32(2)
  22306. }
  22307. if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
  22308. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  22309. return m_XML_TOK_INVALID
  22310. }
  22311. ptr += uintptr(3)
  22312. case int32(_BT_LEAD4):
  22313. if int64(end)-int64(ptr) < int64(4) {
  22314. return -int32(2)
  22315. }
  22316. if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
  22317. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  22318. return m_XML_TOK_INVALID
  22319. }
  22320. ptr += uintptr(4)
  22321. case int32(_BT_SEMI):
  22322. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(2)
  22323. return int32(m_XML_TOK_PARAM_ENTITY_REF)
  22324. default:
  22325. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  22326. return m_XML_TOK_INVALID
  22327. }
  22328. }
  22329. return -int32(1)
  22330. }
  22331. func _little2_scanPoundName(tls *libc.TLS, enc uintptr, ptr uintptr, end uintptr, nextTokPtr uintptr) (r int32) {
  22332. var v1, v2 int32
  22333. _, _ = v1, v2
  22334. if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
  22335. return -int32(1)
  22336. }
  22337. if int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 {
  22338. v1 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr)))))))
  22339. } else {
  22340. v1 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr + 1)), *(*int8)(unsafe.Pointer(ptr)))
  22341. }
  22342. switch v1 {
  22343. case int32(_BT_NONASCII):
  22344. if !(_namingBitmap[libc.Int32FromUint8(_nmstrtPages[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr + 1)))])<<int32(3)+libc.Int32FromUint8(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr))))>>int32(5)]&(libc.Uint32FromUint32(1)<<(libc.Int32FromUint8(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr))))&libc.Int32FromInt32(0x1F))) != 0) {
  22345. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  22346. return m_XML_TOK_INVALID
  22347. } /* fall through */
  22348. fallthrough
  22349. case int32(_BT_NMSTRT):
  22350. fallthrough
  22351. case int32(_BT_HEX):
  22352. ptr += uintptr(2)
  22353. case int32(_BT_LEAD2):
  22354. if int64(end)-int64(ptr) < int64(libc.Int32FromInt32(2)) {
  22355. return -int32(2)
  22356. }
  22357. if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
  22358. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  22359. return m_XML_TOK_INVALID
  22360. }
  22361. ptr += uintptr(2)
  22362. case int32(_BT_LEAD3):
  22363. if int64(end)-int64(ptr) < int64(libc.Int32FromInt32(3)) {
  22364. return -int32(2)
  22365. }
  22366. if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
  22367. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  22368. return m_XML_TOK_INVALID
  22369. }
  22370. ptr += uintptr(3)
  22371. case int32(_BT_LEAD4):
  22372. if int64(end)-int64(ptr) < int64(libc.Int32FromInt32(4)) {
  22373. return -int32(2)
  22374. }
  22375. if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
  22376. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  22377. return m_XML_TOK_INVALID
  22378. }
  22379. ptr += uintptr(4)
  22380. default:
  22381. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  22382. return m_XML_TOK_INVALID
  22383. }
  22384. for int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2)) {
  22385. if int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 {
  22386. v2 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr)))))))
  22387. } else {
  22388. v2 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr + 1)), *(*int8)(unsafe.Pointer(ptr)))
  22389. }
  22390. switch v2 {
  22391. case int32(_BT_NONASCII):
  22392. if !(_namingBitmap[libc.Int32FromUint8(_namePages[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr + 1)))])<<int32(3)+libc.Int32FromUint8(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr))))>>int32(5)]&(libc.Uint32FromUint32(1)<<(libc.Int32FromUint8(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr))))&libc.Int32FromInt32(0x1F))) != 0) {
  22393. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  22394. return m_XML_TOK_INVALID
  22395. } /* fall through */
  22396. fallthrough
  22397. case int32(_BT_NMSTRT):
  22398. fallthrough
  22399. case int32(_BT_HEX):
  22400. fallthrough
  22401. case int32(_BT_DIGIT):
  22402. fallthrough
  22403. case int32(_BT_NAME):
  22404. fallthrough
  22405. case int32(_BT_MINUS):
  22406. ptr += uintptr(2)
  22407. case int32(_BT_LEAD2):
  22408. if int64(end)-int64(ptr) < int64(2) {
  22409. return -int32(2)
  22410. }
  22411. if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
  22412. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  22413. return m_XML_TOK_INVALID
  22414. }
  22415. ptr += uintptr(2)
  22416. case int32(_BT_LEAD3):
  22417. if int64(end)-int64(ptr) < int64(3) {
  22418. return -int32(2)
  22419. }
  22420. if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
  22421. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  22422. return m_XML_TOK_INVALID
  22423. }
  22424. ptr += uintptr(3)
  22425. case int32(_BT_LEAD4):
  22426. if int64(end)-int64(ptr) < int64(4) {
  22427. return -int32(2)
  22428. }
  22429. if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
  22430. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  22431. return m_XML_TOK_INVALID
  22432. }
  22433. ptr += uintptr(4)
  22434. case int32(_BT_CR):
  22435. fallthrough
  22436. case int32(_BT_LF):
  22437. fallthrough
  22438. case int32(_BT_S):
  22439. fallthrough
  22440. case int32(_BT_RPAR):
  22441. fallthrough
  22442. case int32(_BT_GT):
  22443. fallthrough
  22444. case int32(_BT_PERCNT):
  22445. fallthrough
  22446. case int32(_BT_VERBAR):
  22447. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  22448. return int32(m_XML_TOK_POUND_NAME)
  22449. default:
  22450. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  22451. return m_XML_TOK_INVALID
  22452. }
  22453. }
  22454. return -int32(m_XML_TOK_POUND_NAME)
  22455. }
  22456. func _little2_scanLit(tls *libc.TLS, open int32, enc uintptr, ptr uintptr, end uintptr, nextTokPtr uintptr) (r int32) {
  22457. var t, v1, v2 int32
  22458. _, _, _ = t, v1, v2
  22459. for int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2)) {
  22460. if int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 {
  22461. v1 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr)))))))
  22462. } else {
  22463. v1 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr + 1)), *(*int8)(unsafe.Pointer(ptr)))
  22464. }
  22465. t = v1
  22466. switch t {
  22467. case int32(_BT_LEAD2):
  22468. if int64(end)-int64(ptr) < int64(2) {
  22469. return -int32(2)
  22470. }
  22471. if 0 != 0 {
  22472. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  22473. return m_XML_TOK_INVALID
  22474. }
  22475. ptr += uintptr(2)
  22476. case int32(_BT_LEAD3):
  22477. if int64(end)-int64(ptr) < int64(3) {
  22478. return -int32(2)
  22479. }
  22480. if 0 != 0 {
  22481. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  22482. return m_XML_TOK_INVALID
  22483. }
  22484. ptr += uintptr(3)
  22485. case int32(_BT_LEAD4):
  22486. if int64(end)-int64(ptr) < int64(4) {
  22487. return -int32(2)
  22488. }
  22489. if 0 != 0 {
  22490. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  22491. return m_XML_TOK_INVALID
  22492. }
  22493. ptr += uintptr(4)
  22494. case int32(_BT_NONXML):
  22495. fallthrough
  22496. case int32(_BT_MALFORM):
  22497. fallthrough
  22498. case int32(_BT_TRAIL):
  22499. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  22500. return m_XML_TOK_INVALID
  22501. case int32(_BT_QUOT):
  22502. fallthrough
  22503. case int32(_BT_APOS):
  22504. ptr += uintptr(2)
  22505. if t != open {
  22506. break
  22507. }
  22508. if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
  22509. return -int32(m_XML_TOK_LITERAL)
  22510. }
  22511. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  22512. if int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 {
  22513. v2 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr)))))))
  22514. } else {
  22515. v2 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr + 1)), *(*int8)(unsafe.Pointer(ptr)))
  22516. }
  22517. switch v2 {
  22518. case int32(_BT_S):
  22519. fallthrough
  22520. case int32(_BT_CR):
  22521. fallthrough
  22522. case int32(_BT_LF):
  22523. fallthrough
  22524. case int32(_BT_GT):
  22525. fallthrough
  22526. case int32(_BT_PERCNT):
  22527. fallthrough
  22528. case int32(_BT_LSQB):
  22529. return int32(m_XML_TOK_LITERAL)
  22530. default:
  22531. return m_XML_TOK_INVALID
  22532. }
  22533. fallthrough
  22534. default:
  22535. ptr += uintptr(2)
  22536. break
  22537. }
  22538. }
  22539. return -int32(1)
  22540. }
  22541. func _little2_prologTok(tls *libc.TLS, enc uintptr, ptr uintptr, end uintptr, nextTokPtr uintptr) (r int32) {
  22542. var n Tsize_t
  22543. var tok, v1, v29, v33, v34, v35, v36 int32
  22544. _, _, _, _, _, _, _, _ = n, tok, v1, v29, v33, v34, v35, v36
  22545. if ptr >= end {
  22546. return -int32(4)
  22547. }
  22548. if int32(2) > int32(1) {
  22549. n = libc.Uint64FromInt64(int64(end) - int64(ptr))
  22550. if n&libc.Uint64FromInt32(libc.Int32FromInt32(2)-libc.Int32FromInt32(1)) != 0 {
  22551. n &= libc.Uint64FromInt32(^(libc.Int32FromInt32(2) - libc.Int32FromInt32(1)))
  22552. if n == uint64(0) {
  22553. return -int32(1)
  22554. }
  22555. end = ptr + uintptr(n)
  22556. }
  22557. }
  22558. if int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 {
  22559. v1 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr)))))))
  22560. } else {
  22561. v1 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr + 1)), *(*int8)(unsafe.Pointer(ptr)))
  22562. }
  22563. switch v1 {
  22564. case int32(_BT_QUOT):
  22565. goto _2
  22566. case int32(_BT_APOS):
  22567. goto _3
  22568. case int32(_BT_LT):
  22569. goto _4
  22570. case int32(_BT_CR):
  22571. goto _5
  22572. case int32(_BT_LF):
  22573. goto _6
  22574. case int32(_BT_S):
  22575. goto _7
  22576. case int32(_BT_PERCNT):
  22577. goto _8
  22578. case int32(_BT_COMMA):
  22579. goto _9
  22580. case int32(_BT_LSQB):
  22581. goto _10
  22582. case int32(_BT_RSQB):
  22583. goto _11
  22584. case int32(_BT_LPAR):
  22585. goto _12
  22586. case int32(_BT_RPAR):
  22587. goto _13
  22588. case int32(_BT_VERBAR):
  22589. goto _14
  22590. case int32(_BT_GT):
  22591. goto _15
  22592. case int32(_BT_NUM):
  22593. goto _16
  22594. case int32(_BT_LEAD2):
  22595. goto _17
  22596. case int32(_BT_LEAD3):
  22597. goto _18
  22598. case int32(_BT_LEAD4):
  22599. goto _19
  22600. case int32(_BT_HEX):
  22601. goto _20
  22602. case int32(_BT_NMSTRT):
  22603. goto _21
  22604. case int32(_BT_COLON):
  22605. goto _22
  22606. case int32(_BT_MINUS):
  22607. goto _23
  22608. case int32(_BT_NAME):
  22609. goto _24
  22610. case int32(_BT_DIGIT):
  22611. goto _25
  22612. case int32(_BT_NONASCII):
  22613. goto _26
  22614. default:
  22615. goto _27
  22616. }
  22617. goto _28
  22618. _2:
  22619. ;
  22620. return _little2_scanLit(tls, int32(_BT_QUOT), enc, ptr+uintptr(2), end, nextTokPtr)
  22621. _3:
  22622. ;
  22623. return _little2_scanLit(tls, int32(_BT_APOS), enc, ptr+uintptr(2), end, nextTokPtr)
  22624. _4:
  22625. ;
  22626. ptr += uintptr(2)
  22627. if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
  22628. return -int32(1)
  22629. }
  22630. if int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 {
  22631. v29 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr)))))))
  22632. } else {
  22633. v29 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr + 1)), *(*int8)(unsafe.Pointer(ptr)))
  22634. }
  22635. switch v29 {
  22636. case int32(_BT_EXCL):
  22637. return _little2_scanDecl(tls, enc, ptr+uintptr(2), end, nextTokPtr)
  22638. case int32(_BT_QUEST):
  22639. return _little2_scanPi(tls, enc, ptr+uintptr(2), end, nextTokPtr)
  22640. case int32(_BT_NMSTRT):
  22641. fallthrough
  22642. case int32(_BT_HEX):
  22643. fallthrough
  22644. case int32(_BT_NONASCII):
  22645. fallthrough
  22646. case int32(_BT_LEAD2):
  22647. fallthrough
  22648. case int32(_BT_LEAD3):
  22649. fallthrough
  22650. case int32(_BT_LEAD4):
  22651. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr - uintptr(2)
  22652. return int32(m_XML_TOK_INSTANCE_START)
  22653. }
  22654. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  22655. return m_XML_TOK_INVALID
  22656. _5:
  22657. ;
  22658. if ptr+uintptr(2) == end {
  22659. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = end
  22660. /* indicate that this might be part of a CR/LF pair */
  22661. return -int32(m_XML_TOK_PROLOG_S)
  22662. }
  22663. /* fall through */
  22664. _7:
  22665. ;
  22666. _6:
  22667. ;
  22668. _32:
  22669. ;
  22670. ptr += uintptr(2)
  22671. if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
  22672. goto _30
  22673. }
  22674. if int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 {
  22675. v33 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr)))))))
  22676. } else {
  22677. v33 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr + 1)), *(*int8)(unsafe.Pointer(ptr)))
  22678. }
  22679. switch v33 {
  22680. case int32(_BT_S):
  22681. fallthrough
  22682. case int32(_BT_LF):
  22683. case int32(_BT_CR):
  22684. /* don't split CR/LF pair */
  22685. if ptr+uintptr(2) != end {
  22686. break
  22687. }
  22688. /* fall through */
  22689. fallthrough
  22690. default:
  22691. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  22692. return int32(m_XML_TOK_PROLOG_S)
  22693. }
  22694. goto _31
  22695. _31:
  22696. ;
  22697. goto _32
  22698. goto _30
  22699. _30:
  22700. ;
  22701. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  22702. return int32(m_XML_TOK_PROLOG_S)
  22703. _8:
  22704. ;
  22705. return _little2_scanPercent(tls, enc, ptr+uintptr(2), end, nextTokPtr)
  22706. _9:
  22707. ;
  22708. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(2)
  22709. return int32(m_XML_TOK_COMMA)
  22710. _10:
  22711. ;
  22712. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(2)
  22713. return int32(m_XML_TOK_OPEN_BRACKET)
  22714. _11:
  22715. ;
  22716. ptr += uintptr(2)
  22717. if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
  22718. return -int32(m_XML_TOK_CLOSE_BRACKET)
  22719. }
  22720. if int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 && int32(*(*int8)(unsafe.Pointer(ptr))) == int32(m_ASCII_RSQB1) {
  22721. if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(2)*libc.Int32FromInt32(2))) {
  22722. return -int32(1)
  22723. }
  22724. if int32(*(*int8)(unsafe.Pointer(ptr + libc.UintptrFromInt32(2) + 1))) == 0 && int32(*(*int8)(unsafe.Pointer(ptr + libc.UintptrFromInt32(2)))) == int32(m_ASCII_GT1) {
  22725. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(libc.Int32FromInt32(2)*libc.Int32FromInt32(2))
  22726. return int32(m_XML_TOK_COND_SECT_CLOSE)
  22727. }
  22728. }
  22729. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  22730. return int32(m_XML_TOK_CLOSE_BRACKET)
  22731. _12:
  22732. ;
  22733. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(2)
  22734. return int32(m_XML_TOK_OPEN_PAREN)
  22735. _13:
  22736. ;
  22737. ptr += uintptr(2)
  22738. if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
  22739. return -int32(m_XML_TOK_CLOSE_PAREN)
  22740. }
  22741. if int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 {
  22742. v34 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr)))))))
  22743. } else {
  22744. v34 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr + 1)), *(*int8)(unsafe.Pointer(ptr)))
  22745. }
  22746. switch v34 {
  22747. case int32(_BT_AST):
  22748. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(2)
  22749. return int32(m_XML_TOK_CLOSE_PAREN_ASTERISK)
  22750. case int32(_BT_QUEST):
  22751. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(2)
  22752. return int32(m_XML_TOK_CLOSE_PAREN_QUESTION)
  22753. case int32(_BT_PLUS):
  22754. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(2)
  22755. return int32(m_XML_TOK_CLOSE_PAREN_PLUS)
  22756. case int32(_BT_CR):
  22757. fallthrough
  22758. case int32(_BT_LF):
  22759. fallthrough
  22760. case int32(_BT_S):
  22761. fallthrough
  22762. case int32(_BT_GT):
  22763. fallthrough
  22764. case int32(_BT_COMMA):
  22765. fallthrough
  22766. case int32(_BT_VERBAR):
  22767. fallthrough
  22768. case int32(_BT_RPAR):
  22769. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  22770. return int32(m_XML_TOK_CLOSE_PAREN)
  22771. }
  22772. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  22773. return m_XML_TOK_INVALID
  22774. _14:
  22775. ;
  22776. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(2)
  22777. return int32(m_XML_TOK_OR)
  22778. _15:
  22779. ;
  22780. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(2)
  22781. return int32(m_XML_TOK_DECL_CLOSE)
  22782. _16:
  22783. ;
  22784. return _little2_scanPoundName(tls, enc, ptr+uintptr(2), end, nextTokPtr)
  22785. _17:
  22786. ;
  22787. if int64(end)-int64(ptr) < int64(2) {
  22788. return -int32(2)
  22789. }
  22790. if 0 != 0 {
  22791. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  22792. return m_XML_TOK_INVALID
  22793. }
  22794. if 0 != 0 {
  22795. ptr += uintptr(2)
  22796. tok = int32(m_XML_TOK_NAME)
  22797. goto _28
  22798. }
  22799. if 0 != 0 {
  22800. ptr += uintptr(2)
  22801. tok = int32(m_XML_TOK_NMTOKEN)
  22802. goto _28
  22803. }
  22804. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  22805. return m_XML_TOK_INVALID
  22806. _18:
  22807. ;
  22808. if int64(end)-int64(ptr) < int64(3) {
  22809. return -int32(2)
  22810. }
  22811. if 0 != 0 {
  22812. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  22813. return m_XML_TOK_INVALID
  22814. }
  22815. if 0 != 0 {
  22816. ptr += uintptr(3)
  22817. tok = int32(m_XML_TOK_NAME)
  22818. goto _28
  22819. }
  22820. if 0 != 0 {
  22821. ptr += uintptr(3)
  22822. tok = int32(m_XML_TOK_NMTOKEN)
  22823. goto _28
  22824. }
  22825. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  22826. return m_XML_TOK_INVALID
  22827. _19:
  22828. ;
  22829. if int64(end)-int64(ptr) < int64(4) {
  22830. return -int32(2)
  22831. }
  22832. if 0 != 0 {
  22833. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  22834. return m_XML_TOK_INVALID
  22835. }
  22836. if 0 != 0 {
  22837. ptr += uintptr(4)
  22838. tok = int32(m_XML_TOK_NAME)
  22839. goto _28
  22840. }
  22841. if 0 != 0 {
  22842. ptr += uintptr(4)
  22843. tok = int32(m_XML_TOK_NMTOKEN)
  22844. goto _28
  22845. }
  22846. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  22847. return m_XML_TOK_INVALID
  22848. _21:
  22849. ;
  22850. _20:
  22851. ;
  22852. tok = int32(m_XML_TOK_NAME)
  22853. ptr += uintptr(2)
  22854. goto _28
  22855. _25:
  22856. ;
  22857. _24:
  22858. ;
  22859. _23:
  22860. ;
  22861. _22:
  22862. ;
  22863. tok = int32(m_XML_TOK_NMTOKEN)
  22864. ptr += uintptr(2)
  22865. goto _28
  22866. _26:
  22867. ;
  22868. if _namingBitmap[libc.Int32FromUint8(_nmstrtPages[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr + 1)))])<<int32(3)+libc.Int32FromUint8(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr))))>>int32(5)]&(uint32(1)<<(libc.Int32FromUint8(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr))))&int32(0x1F))) != 0 {
  22869. ptr += uintptr(2)
  22870. tok = int32(m_XML_TOK_NAME)
  22871. goto _28
  22872. }
  22873. if _namingBitmap[libc.Int32FromUint8(_namePages[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr + 1)))])<<int32(3)+libc.Int32FromUint8(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr))))>>int32(5)]&(uint32(1)<<(libc.Int32FromUint8(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr))))&int32(0x1F))) != 0 {
  22874. ptr += uintptr(2)
  22875. tok = int32(m_XML_TOK_NMTOKEN)
  22876. goto _28
  22877. }
  22878. /* fall through */
  22879. _27:
  22880. ;
  22881. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  22882. return m_XML_TOK_INVALID
  22883. _28:
  22884. ;
  22885. for int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2)) {
  22886. if int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 {
  22887. v35 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr)))))))
  22888. } else {
  22889. v35 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr + 1)), *(*int8)(unsafe.Pointer(ptr)))
  22890. }
  22891. switch v35 {
  22892. case int32(_BT_NONASCII):
  22893. if !(_namingBitmap[libc.Int32FromUint8(_namePages[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr + 1)))])<<int32(3)+libc.Int32FromUint8(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr))))>>int32(5)]&(libc.Uint32FromUint32(1)<<(libc.Int32FromUint8(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr))))&libc.Int32FromInt32(0x1F))) != 0) {
  22894. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  22895. return m_XML_TOK_INVALID
  22896. } /* fall through */
  22897. fallthrough
  22898. case int32(_BT_NMSTRT):
  22899. fallthrough
  22900. case int32(_BT_HEX):
  22901. fallthrough
  22902. case int32(_BT_DIGIT):
  22903. fallthrough
  22904. case int32(_BT_NAME):
  22905. fallthrough
  22906. case int32(_BT_MINUS):
  22907. ptr += uintptr(2)
  22908. case int32(_BT_LEAD2):
  22909. if int64(end)-int64(ptr) < int64(2) {
  22910. return -int32(2)
  22911. }
  22912. if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
  22913. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  22914. return m_XML_TOK_INVALID
  22915. }
  22916. ptr += uintptr(2)
  22917. case int32(_BT_LEAD3):
  22918. if int64(end)-int64(ptr) < int64(3) {
  22919. return -int32(2)
  22920. }
  22921. if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
  22922. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  22923. return m_XML_TOK_INVALID
  22924. }
  22925. ptr += uintptr(3)
  22926. case int32(_BT_LEAD4):
  22927. if int64(end)-int64(ptr) < int64(4) {
  22928. return -int32(2)
  22929. }
  22930. if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
  22931. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  22932. return m_XML_TOK_INVALID
  22933. }
  22934. ptr += uintptr(4)
  22935. case int32(_BT_GT):
  22936. fallthrough
  22937. case int32(_BT_RPAR):
  22938. fallthrough
  22939. case int32(_BT_COMMA):
  22940. fallthrough
  22941. case int32(_BT_VERBAR):
  22942. fallthrough
  22943. case int32(_BT_LSQB):
  22944. fallthrough
  22945. case int32(_BT_PERCNT):
  22946. fallthrough
  22947. case int32(_BT_S):
  22948. fallthrough
  22949. case int32(_BT_CR):
  22950. fallthrough
  22951. case int32(_BT_LF):
  22952. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  22953. return tok
  22954. case int32(_BT_COLON):
  22955. ptr += uintptr(2)
  22956. switch tok {
  22957. case int32(m_XML_TOK_NAME):
  22958. if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
  22959. return -int32(1)
  22960. }
  22961. tok = int32(m_XML_TOK_PREFIXED_NAME)
  22962. if int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 {
  22963. v36 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr)))))))
  22964. } else {
  22965. v36 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr + 1)), *(*int8)(unsafe.Pointer(ptr)))
  22966. }
  22967. switch v36 {
  22968. case int32(_BT_NONASCII):
  22969. if !(_namingBitmap[libc.Int32FromUint8(_namePages[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr + 1)))])<<int32(3)+libc.Int32FromUint8(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr))))>>int32(5)]&(libc.Uint32FromUint32(1)<<(libc.Int32FromUint8(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr))))&libc.Int32FromInt32(0x1F))) != 0) {
  22970. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  22971. return m_XML_TOK_INVALID
  22972. } /* fall through */
  22973. fallthrough
  22974. case int32(_BT_NMSTRT):
  22975. fallthrough
  22976. case int32(_BT_HEX):
  22977. fallthrough
  22978. case int32(_BT_DIGIT):
  22979. fallthrough
  22980. case int32(_BT_NAME):
  22981. fallthrough
  22982. case int32(_BT_MINUS):
  22983. ptr += uintptr(2)
  22984. case int32(_BT_LEAD2):
  22985. if int64(end)-int64(ptr) < int64(2) {
  22986. return -int32(2)
  22987. }
  22988. if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
  22989. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  22990. return m_XML_TOK_INVALID
  22991. }
  22992. ptr += uintptr(2)
  22993. case int32(_BT_LEAD3):
  22994. if int64(end)-int64(ptr) < int64(3) {
  22995. return -int32(2)
  22996. }
  22997. if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
  22998. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  22999. return m_XML_TOK_INVALID
  23000. }
  23001. ptr += uintptr(3)
  23002. case int32(_BT_LEAD4):
  23003. if int64(end)-int64(ptr) < int64(4) {
  23004. return -int32(2)
  23005. }
  23006. if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
  23007. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  23008. return m_XML_TOK_INVALID
  23009. }
  23010. ptr += uintptr(4)
  23011. default:
  23012. tok = int32(m_XML_TOK_NMTOKEN)
  23013. break
  23014. }
  23015. case int32(m_XML_TOK_PREFIXED_NAME):
  23016. tok = int32(m_XML_TOK_NMTOKEN)
  23017. break
  23018. }
  23019. case int32(_BT_PLUS):
  23020. if tok == int32(m_XML_TOK_NMTOKEN) {
  23021. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  23022. return m_XML_TOK_INVALID
  23023. }
  23024. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(2)
  23025. return int32(m_XML_TOK_NAME_PLUS)
  23026. case int32(_BT_AST):
  23027. if tok == int32(m_XML_TOK_NMTOKEN) {
  23028. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  23029. return m_XML_TOK_INVALID
  23030. }
  23031. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(2)
  23032. return int32(m_XML_TOK_NAME_ASTERISK)
  23033. case int32(_BT_QUEST):
  23034. if tok == int32(m_XML_TOK_NMTOKEN) {
  23035. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  23036. return m_XML_TOK_INVALID
  23037. }
  23038. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(2)
  23039. return int32(m_XML_TOK_NAME_QUESTION)
  23040. default:
  23041. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  23042. return m_XML_TOK_INVALID
  23043. }
  23044. }
  23045. return -tok
  23046. }
  23047. func _little2_attributeValueTok(tls *libc.TLS, enc uintptr, ptr uintptr, end uintptr, nextTokPtr uintptr) (r int32) {
  23048. var start uintptr
  23049. var v1, v2 int32
  23050. _, _, _ = start, v1, v2
  23051. if ptr >= end {
  23052. return -int32(4)
  23053. } else {
  23054. if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
  23055. /* This line cannot be executed. The incoming data has already
  23056. * been tokenized once, so incomplete characters like this have
  23057. * already been eliminated from the input. Retaining the paranoia
  23058. * check is still valuable, however.
  23059. */
  23060. return -int32(1) /* LCOV_EXCL_LINE */
  23061. }
  23062. }
  23063. start = ptr
  23064. for int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2)) {
  23065. if int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 {
  23066. v1 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr)))))))
  23067. } else {
  23068. v1 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr + 1)), *(*int8)(unsafe.Pointer(ptr)))
  23069. }
  23070. switch v1 {
  23071. case int32(_BT_LEAD2):
  23072. ptr += uintptr(2) /* NOTE: The encoding has already been validated. */
  23073. case int32(_BT_LEAD3):
  23074. ptr += uintptr(3) /* NOTE: The encoding has already been validated. */
  23075. case int32(_BT_LEAD4):
  23076. ptr += uintptr(4) /* NOTE: The encoding has already been validated. */
  23077. case int32(_BT_AMP):
  23078. if ptr == start {
  23079. return _little2_scanRef(tls, enc, ptr+uintptr(2), end, nextTokPtr)
  23080. }
  23081. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  23082. return int32(m_XML_TOK_DATA_CHARS)
  23083. case int32(_BT_LT):
  23084. /* this is for inside entity references */
  23085. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  23086. return m_XML_TOK_INVALID
  23087. case int32(_BT_LF):
  23088. if ptr == start {
  23089. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(2)
  23090. return int32(m_XML_TOK_DATA_NEWLINE)
  23091. }
  23092. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  23093. return int32(m_XML_TOK_DATA_CHARS)
  23094. case int32(_BT_CR):
  23095. if ptr == start {
  23096. ptr += uintptr(2)
  23097. if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
  23098. return -int32(3)
  23099. }
  23100. if int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 {
  23101. v2 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr)))))))
  23102. } else {
  23103. v2 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr + 1)), *(*int8)(unsafe.Pointer(ptr)))
  23104. }
  23105. if v2 == int32(_BT_LF) {
  23106. ptr += uintptr(2)
  23107. }
  23108. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  23109. return int32(m_XML_TOK_DATA_NEWLINE)
  23110. }
  23111. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  23112. return int32(m_XML_TOK_DATA_CHARS)
  23113. case int32(_BT_S):
  23114. if ptr == start {
  23115. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(2)
  23116. return int32(m_XML_TOK_ATTRIBUTE_VALUE_S)
  23117. }
  23118. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  23119. return int32(m_XML_TOK_DATA_CHARS)
  23120. default:
  23121. ptr += uintptr(2)
  23122. break
  23123. }
  23124. }
  23125. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  23126. return int32(m_XML_TOK_DATA_CHARS)
  23127. }
  23128. func _little2_entityValueTok(tls *libc.TLS, enc uintptr, ptr uintptr, end uintptr, nextTokPtr uintptr) (r int32) {
  23129. var start uintptr
  23130. var tok, v1, v2, v3 int32
  23131. _, _, _, _, _ = start, tok, v1, v2, v3
  23132. if ptr >= end {
  23133. return -int32(4)
  23134. } else {
  23135. if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
  23136. /* This line cannot be executed. The incoming data has already
  23137. * been tokenized once, so incomplete characters like this have
  23138. * already been eliminated from the input. Retaining the paranoia
  23139. * check is still valuable, however.
  23140. */
  23141. return -int32(1) /* LCOV_EXCL_LINE */
  23142. }
  23143. }
  23144. start = ptr
  23145. for int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2)) {
  23146. if int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 {
  23147. v1 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr)))))))
  23148. } else {
  23149. v1 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr + 1)), *(*int8)(unsafe.Pointer(ptr)))
  23150. }
  23151. switch v1 {
  23152. case int32(_BT_LEAD2):
  23153. ptr += uintptr(2) /* NOTE: The encoding has already been validated. */
  23154. case int32(_BT_LEAD3):
  23155. ptr += uintptr(3) /* NOTE: The encoding has already been validated. */
  23156. case int32(_BT_LEAD4):
  23157. ptr += uintptr(4) /* NOTE: The encoding has already been validated. */
  23158. case int32(_BT_AMP):
  23159. if ptr == start {
  23160. return _little2_scanRef(tls, enc, ptr+uintptr(2), end, nextTokPtr)
  23161. }
  23162. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  23163. return int32(m_XML_TOK_DATA_CHARS)
  23164. case int32(_BT_PERCNT):
  23165. if ptr == start {
  23166. tok = _little2_scanPercent(tls, enc, ptr+uintptr(2), end, nextTokPtr)
  23167. if tok == int32(m_XML_TOK_PERCENT) {
  23168. v2 = m_XML_TOK_INVALID
  23169. } else {
  23170. v2 = tok
  23171. }
  23172. return v2
  23173. }
  23174. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  23175. return int32(m_XML_TOK_DATA_CHARS)
  23176. case int32(_BT_LF):
  23177. if ptr == start {
  23178. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(2)
  23179. return int32(m_XML_TOK_DATA_NEWLINE)
  23180. }
  23181. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  23182. return int32(m_XML_TOK_DATA_CHARS)
  23183. case int32(_BT_CR):
  23184. if ptr == start {
  23185. ptr += uintptr(2)
  23186. if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
  23187. return -int32(3)
  23188. }
  23189. if int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 {
  23190. v3 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr)))))))
  23191. } else {
  23192. v3 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr + 1)), *(*int8)(unsafe.Pointer(ptr)))
  23193. }
  23194. if v3 == int32(_BT_LF) {
  23195. ptr += uintptr(2)
  23196. }
  23197. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  23198. return int32(m_XML_TOK_DATA_NEWLINE)
  23199. }
  23200. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  23201. return int32(m_XML_TOK_DATA_CHARS)
  23202. default:
  23203. ptr += uintptr(2)
  23204. break
  23205. }
  23206. }
  23207. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  23208. return int32(m_XML_TOK_DATA_CHARS)
  23209. }
  23210. func _little2_ignoreSectionTok(tls *libc.TLS, enc uintptr, ptr uintptr, end uintptr, nextTokPtr uintptr) (r int32) {
  23211. var level, v1 int32
  23212. var n Tsize_t
  23213. _, _, _ = level, n, v1
  23214. level = 0
  23215. if int32(2) > int32(1) {
  23216. n = libc.Uint64FromInt64(int64(end) - int64(ptr))
  23217. if n&libc.Uint64FromInt32(libc.Int32FromInt32(2)-libc.Int32FromInt32(1)) != 0 {
  23218. n &= libc.Uint64FromInt32(^(libc.Int32FromInt32(2) - libc.Int32FromInt32(1)))
  23219. end = ptr + uintptr(n)
  23220. }
  23221. }
  23222. for int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2)) {
  23223. if int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 {
  23224. v1 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr)))))))
  23225. } else {
  23226. v1 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr + 1)), *(*int8)(unsafe.Pointer(ptr)))
  23227. }
  23228. switch v1 {
  23229. case int32(_BT_LEAD2):
  23230. if int64(end)-int64(ptr) < int64(2) {
  23231. return -int32(2)
  23232. }
  23233. if 0 != 0 {
  23234. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  23235. return m_XML_TOK_INVALID
  23236. }
  23237. ptr += uintptr(2)
  23238. case int32(_BT_LEAD3):
  23239. if int64(end)-int64(ptr) < int64(3) {
  23240. return -int32(2)
  23241. }
  23242. if 0 != 0 {
  23243. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  23244. return m_XML_TOK_INVALID
  23245. }
  23246. ptr += uintptr(3)
  23247. case int32(_BT_LEAD4):
  23248. if int64(end)-int64(ptr) < int64(4) {
  23249. return -int32(2)
  23250. }
  23251. if 0 != 0 {
  23252. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  23253. return m_XML_TOK_INVALID
  23254. }
  23255. ptr += uintptr(4)
  23256. case int32(_BT_NONXML):
  23257. fallthrough
  23258. case int32(_BT_MALFORM):
  23259. fallthrough
  23260. case int32(_BT_TRAIL):
  23261. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  23262. return m_XML_TOK_INVALID
  23263. case int32(_BT_LT):
  23264. ptr += uintptr(2)
  23265. if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
  23266. return -int32(1)
  23267. }
  23268. if int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 && int32(*(*int8)(unsafe.Pointer(ptr))) == int32(m_ASCII_EXCL2) {
  23269. ptr += uintptr(2)
  23270. if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
  23271. return -int32(1)
  23272. }
  23273. if int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 && int32(*(*int8)(unsafe.Pointer(ptr))) == int32(m_ASCII_LSQB1) {
  23274. level++
  23275. ptr += uintptr(2)
  23276. }
  23277. }
  23278. case int32(_BT_RSQB):
  23279. ptr += uintptr(2)
  23280. if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
  23281. return -int32(1)
  23282. }
  23283. if int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 && int32(*(*int8)(unsafe.Pointer(ptr))) == int32(m_ASCII_RSQB1) {
  23284. ptr += uintptr(2)
  23285. if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
  23286. return -int32(1)
  23287. }
  23288. if int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 && int32(*(*int8)(unsafe.Pointer(ptr))) == int32(m_ASCII_GT1) {
  23289. ptr += uintptr(2)
  23290. if level == 0 {
  23291. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  23292. return int32(m_XML_TOK_IGNORE_SECT)
  23293. }
  23294. level--
  23295. }
  23296. }
  23297. default:
  23298. ptr += uintptr(2)
  23299. break
  23300. }
  23301. }
  23302. return -int32(1)
  23303. }
  23304. func _little2_isPublicId(tls *libc.TLS, enc uintptr, ptr uintptr, end uintptr, badPtr uintptr) (r int32) {
  23305. var v2, v3, v4 int32
  23306. _, _, _ = v2, v3, v4
  23307. ptr += uintptr(2)
  23308. end -= uintptr(2)
  23309. for {
  23310. if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
  23311. break
  23312. }
  23313. if int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 {
  23314. v2 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr)))))))
  23315. } else {
  23316. v2 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr + 1)), *(*int8)(unsafe.Pointer(ptr)))
  23317. }
  23318. switch v2 {
  23319. case int32(_BT_DIGIT):
  23320. fallthrough
  23321. case int32(_BT_HEX):
  23322. fallthrough
  23323. case int32(_BT_MINUS):
  23324. fallthrough
  23325. case int32(_BT_APOS):
  23326. fallthrough
  23327. case int32(_BT_LPAR):
  23328. fallthrough
  23329. case int32(_BT_RPAR):
  23330. fallthrough
  23331. case int32(_BT_PLUS):
  23332. fallthrough
  23333. case int32(_BT_COMMA):
  23334. fallthrough
  23335. case int32(_BT_SOL):
  23336. fallthrough
  23337. case int32(_BT_EQUALS):
  23338. fallthrough
  23339. case int32(_BT_QUEST):
  23340. fallthrough
  23341. case int32(_BT_CR):
  23342. fallthrough
  23343. case int32(_BT_LF):
  23344. fallthrough
  23345. case int32(_BT_SEMI):
  23346. fallthrough
  23347. case int32(_BT_EXCL):
  23348. fallthrough
  23349. case int32(_BT_AST):
  23350. fallthrough
  23351. case int32(_BT_PERCNT):
  23352. fallthrough
  23353. case int32(_BT_NUM):
  23354. fallthrough
  23355. case int32(_BT_COLON):
  23356. case int32(_BT_S):
  23357. if int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 && int32(*(*int8)(unsafe.Pointer(ptr))) == int32(m_ASCII_TAB1) {
  23358. *(*uintptr)(unsafe.Pointer(badPtr)) = ptr
  23359. return 0
  23360. }
  23361. case int32(_BT_NAME):
  23362. fallthrough
  23363. case int32(_BT_NMSTRT):
  23364. if int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 {
  23365. v3 = int32(*(*int8)(unsafe.Pointer(ptr)))
  23366. } else {
  23367. v3 = -int32(1)
  23368. }
  23369. if !(v3 & ^libc.Int32FromInt32(0x7f) != 0) {
  23370. break
  23371. }
  23372. /* fall through */
  23373. fallthrough
  23374. default:
  23375. if int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 {
  23376. v4 = int32(*(*int8)(unsafe.Pointer(ptr)))
  23377. } else {
  23378. v4 = -int32(1)
  23379. }
  23380. switch v4 {
  23381. case int32(0x24): /* $ */
  23382. fallthrough
  23383. case int32(0x40): /* @ */
  23384. default:
  23385. *(*uintptr)(unsafe.Pointer(badPtr)) = ptr
  23386. return 0
  23387. }
  23388. break
  23389. }
  23390. goto _1
  23391. _1:
  23392. ;
  23393. ptr += uintptr(2)
  23394. }
  23395. return int32(1)
  23396. }
  23397. /* This must only be called for a well-formed start-tag or empty
  23398. element tag. Returns the number of attributes. Pointers to the
  23399. first attsMax attributes are stored in atts.
  23400. */
  23401. func _little2_getAtts(tls *libc.TLS, enc uintptr, ptr uintptr, attsMax int32, atts uintptr) (r int32) {
  23402. var nAtts, open, state, v2, v3, v5, v7 int32
  23403. var v4, v6, v8, v9 bool
  23404. _, _, _, _, _, _, _, _, _, _, _ = nAtts, open, state, v2, v3, v4, v5, v6, v7, v8, v9
  23405. state = 1
  23406. nAtts = 0
  23407. open = 0 /* defined when state == inValue;
  23408. initialization just to shut up compilers */
  23409. ptr += uintptr(2)
  23410. for {
  23411. if int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 {
  23412. v2 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr)))))))
  23413. } else {
  23414. v2 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr + 1)), *(*int8)(unsafe.Pointer(ptr)))
  23415. }
  23416. switch v2 {
  23417. case int32(_BT_LEAD2):
  23418. if state == 0 {
  23419. if nAtts < attsMax {
  23420. (*(*TATTRIBUTE)(unsafe.Pointer(atts + uintptr(nAtts)*32))).Fname = ptr
  23421. (*(*TATTRIBUTE)(unsafe.Pointer(atts + uintptr(nAtts)*32))).Fnormalized = int8(1)
  23422. }
  23423. state = 1
  23424. }
  23425. ptr += uintptr(libc.Int32FromInt32(2) - libc.Int32FromInt32(2))
  23426. case int32(_BT_LEAD3):
  23427. if state == 0 {
  23428. if nAtts < attsMax {
  23429. (*(*TATTRIBUTE)(unsafe.Pointer(atts + uintptr(nAtts)*32))).Fname = ptr
  23430. (*(*TATTRIBUTE)(unsafe.Pointer(atts + uintptr(nAtts)*32))).Fnormalized = int8(1)
  23431. }
  23432. state = 1
  23433. }
  23434. ptr += uintptr(libc.Int32FromInt32(3) - libc.Int32FromInt32(2))
  23435. case int32(_BT_LEAD4):
  23436. if state == 0 {
  23437. if nAtts < attsMax {
  23438. (*(*TATTRIBUTE)(unsafe.Pointer(atts + uintptr(nAtts)*32))).Fname = ptr
  23439. (*(*TATTRIBUTE)(unsafe.Pointer(atts + uintptr(nAtts)*32))).Fnormalized = int8(1)
  23440. }
  23441. state = 1
  23442. }
  23443. ptr += uintptr(libc.Int32FromInt32(4) - libc.Int32FromInt32(2))
  23444. case int32(_BT_NONASCII):
  23445. fallthrough
  23446. case int32(_BT_NMSTRT):
  23447. fallthrough
  23448. case int32(_BT_HEX):
  23449. if state == 0 {
  23450. if nAtts < attsMax {
  23451. (*(*TATTRIBUTE)(unsafe.Pointer(atts + uintptr(nAtts)*32))).Fname = ptr
  23452. (*(*TATTRIBUTE)(unsafe.Pointer(atts + uintptr(nAtts)*32))).Fnormalized = int8(1)
  23453. }
  23454. state = 1
  23455. }
  23456. case int32(_BT_QUOT):
  23457. if state != 2 {
  23458. if nAtts < attsMax {
  23459. (*(*TATTRIBUTE)(unsafe.Pointer(atts + uintptr(nAtts)*32))).FvaluePtr = ptr + uintptr(2)
  23460. }
  23461. state = 2
  23462. open = int32(_BT_QUOT)
  23463. } else {
  23464. if open == int32(_BT_QUOT) {
  23465. state = 0
  23466. if nAtts < attsMax {
  23467. (*(*TATTRIBUTE)(unsafe.Pointer(atts + uintptr(nAtts)*32))).FvalueEnd = ptr
  23468. }
  23469. nAtts++
  23470. }
  23471. }
  23472. case int32(_BT_APOS):
  23473. if state != 2 {
  23474. if nAtts < attsMax {
  23475. (*(*TATTRIBUTE)(unsafe.Pointer(atts + uintptr(nAtts)*32))).FvaluePtr = ptr + uintptr(2)
  23476. }
  23477. state = 2
  23478. open = int32(_BT_APOS)
  23479. } else {
  23480. if open == int32(_BT_APOS) {
  23481. state = 0
  23482. if nAtts < attsMax {
  23483. (*(*TATTRIBUTE)(unsafe.Pointer(atts + uintptr(nAtts)*32))).FvalueEnd = ptr
  23484. }
  23485. nAtts++
  23486. }
  23487. }
  23488. case int32(_BT_AMP):
  23489. if nAtts < attsMax {
  23490. (*(*TATTRIBUTE)(unsafe.Pointer(atts + uintptr(nAtts)*32))).Fnormalized = 0
  23491. }
  23492. case int32(_BT_S):
  23493. if state == 1 {
  23494. state = 0
  23495. } else {
  23496. if v9 = state == 2 && nAtts < attsMax && (*(*TATTRIBUTE)(unsafe.Pointer(atts + uintptr(nAtts)*32))).Fnormalized != 0; v9 {
  23497. if v4 = ptr == (*(*TATTRIBUTE)(unsafe.Pointer(atts + uintptr(nAtts)*32))).FvaluePtr; !v4 {
  23498. if int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 {
  23499. v3 = int32(*(*int8)(unsafe.Pointer(ptr)))
  23500. } else {
  23501. v3 = -int32(1)
  23502. }
  23503. }
  23504. if v6 = v4 || v3 != int32(m_ASCII_SPACE1); !v6 {
  23505. if int32(*(*int8)(unsafe.Pointer(ptr + libc.UintptrFromInt32(2) + 1))) == 0 {
  23506. v5 = int32(*(*int8)(unsafe.Pointer(ptr + libc.UintptrFromInt32(2))))
  23507. } else {
  23508. v5 = -int32(1)
  23509. }
  23510. }
  23511. if v8 = v6 || v5 == int32(m_ASCII_SPACE1); !v8 {
  23512. if int32(*(*int8)(unsafe.Pointer(ptr + libc.UintptrFromInt32(2) + 1))) == 0 {
  23513. v7 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr + libc.UintptrFromInt32(2))))))))
  23514. } else {
  23515. v7 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr + libc.UintptrFromInt32(2) + 1)), *(*int8)(unsafe.Pointer(ptr + libc.UintptrFromInt32(2))))
  23516. }
  23517. }
  23518. }
  23519. if v9 && (v8 || v7 == open) {
  23520. (*(*TATTRIBUTE)(unsafe.Pointer(atts + uintptr(nAtts)*32))).Fnormalized = 0
  23521. }
  23522. }
  23523. case int32(_BT_CR):
  23524. fallthrough
  23525. case int32(_BT_LF):
  23526. /* This case ensures that the first attribute name is counted
  23527. Apart from that we could just change state on the quote. */
  23528. if state == 1 {
  23529. state = 0
  23530. } else {
  23531. if state == 2 && nAtts < attsMax {
  23532. (*(*TATTRIBUTE)(unsafe.Pointer(atts + uintptr(nAtts)*32))).Fnormalized = 0
  23533. }
  23534. }
  23535. case int32(_BT_GT):
  23536. fallthrough
  23537. case int32(_BT_SOL):
  23538. if state != 2 {
  23539. return nAtts
  23540. }
  23541. default:
  23542. break
  23543. }
  23544. goto _1
  23545. _1:
  23546. ;
  23547. ptr += uintptr(2)
  23548. }
  23549. /* not reached */
  23550. return r
  23551. }
  23552. func _little2_charRefNumber(tls *libc.TLS, enc uintptr, ptr uintptr) (r int32) {
  23553. var c, c1, result, v2, v4 int32
  23554. _, _, _, _, _ = c, c1, result, v2, v4
  23555. result = 0
  23556. /* skip &# */
  23557. _ = enc
  23558. ptr += uintptr(libc.Int32FromInt32(2) * libc.Int32FromInt32(2))
  23559. if int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 && int32(*(*int8)(unsafe.Pointer(ptr))) == int32(m_ASCII_x2) {
  23560. ptr += uintptr(2)
  23561. for {
  23562. if !!(int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 && int32(*(*int8)(unsafe.Pointer(ptr))) == int32(m_ASCII_SEMI1)) {
  23563. break
  23564. }
  23565. if int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 {
  23566. v2 = int32(*(*int8)(unsafe.Pointer(ptr)))
  23567. } else {
  23568. v2 = -int32(1)
  23569. }
  23570. c = v2
  23571. switch c {
  23572. case int32(m_ASCII_02):
  23573. fallthrough
  23574. case int32(m_ASCII_12):
  23575. fallthrough
  23576. case int32(m_ASCII_22):
  23577. fallthrough
  23578. case int32(m_ASCII_32):
  23579. fallthrough
  23580. case int32(m_ASCII_41):
  23581. fallthrough
  23582. case int32(m_ASCII_51):
  23583. fallthrough
  23584. case int32(m_ASCII_61):
  23585. fallthrough
  23586. case int32(m_ASCII_71):
  23587. fallthrough
  23588. case int32(m_ASCII_82):
  23589. fallthrough
  23590. case int32(m_ASCII_92):
  23591. result <<= int32(4)
  23592. result |= c - int32(m_ASCII_02)
  23593. case int32(m_ASCII_A):
  23594. fallthrough
  23595. case int32(m_ASCII_B1):
  23596. fallthrough
  23597. case int32(m_ASCII_C):
  23598. fallthrough
  23599. case int32(m_ASCII_D):
  23600. fallthrough
  23601. case int32(m_ASCII_E):
  23602. fallthrough
  23603. case int32(m_ASCII_F):
  23604. result <<= int32(4)
  23605. result += int32(10) + (c - int32(m_ASCII_A))
  23606. case int32(m_ASCII_a2):
  23607. fallthrough
  23608. case int32(m_ASCII_b1):
  23609. fallthrough
  23610. case int32(m_ASCII_c2):
  23611. fallthrough
  23612. case int32(m_ASCII_d1):
  23613. fallthrough
  23614. case int32(m_ASCII_e2):
  23615. fallthrough
  23616. case int32(m_ASCII_f1):
  23617. result <<= int32(4)
  23618. result += int32(10) + (c - int32(m_ASCII_a2))
  23619. break
  23620. }
  23621. if result >= int32(0x110000) {
  23622. return -int32(1)
  23623. }
  23624. goto _1
  23625. _1:
  23626. ;
  23627. ptr += uintptr(2)
  23628. }
  23629. } else {
  23630. for {
  23631. if !!(int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 && int32(*(*int8)(unsafe.Pointer(ptr))) == int32(m_ASCII_SEMI1)) {
  23632. break
  23633. }
  23634. if int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 {
  23635. v4 = int32(*(*int8)(unsafe.Pointer(ptr)))
  23636. } else {
  23637. v4 = -int32(1)
  23638. }
  23639. c1 = v4
  23640. result *= int32(10)
  23641. result += c1 - int32(m_ASCII_02)
  23642. if result >= int32(0x110000) {
  23643. return -int32(1)
  23644. }
  23645. goto _3
  23646. _3:
  23647. ;
  23648. ptr += uintptr(2)
  23649. }
  23650. }
  23651. return _checkCharRefNumber(tls, result)
  23652. }
  23653. func _little2_predefinedEntityName(tls *libc.TLS, enc uintptr, ptr uintptr, end uintptr) (r int32) {
  23654. var v1, v2 int32
  23655. _, _ = v1, v2
  23656. _ = enc
  23657. switch (int64(end) - int64(ptr)) / libc.Int64FromInt32(2) {
  23658. case int64(2):
  23659. if int32(*(*int8)(unsafe.Pointer(ptr + libc.UintptrFromInt32(2) + 1))) == 0 && int32(*(*int8)(unsafe.Pointer(ptr + libc.UintptrFromInt32(2)))) == int32(m_ASCII_t2) {
  23660. if int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 {
  23661. v1 = int32(*(*int8)(unsafe.Pointer(ptr)))
  23662. } else {
  23663. v1 = -int32(1)
  23664. }
  23665. switch v1 {
  23666. case int32(m_ASCII_l2):
  23667. return int32(m_ASCII_LT1)
  23668. case int32(m_ASCII_g2):
  23669. return int32(m_ASCII_GT1)
  23670. }
  23671. }
  23672. case int64(3):
  23673. if int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 && int32(*(*int8)(unsafe.Pointer(ptr))) == int32(m_ASCII_a2) {
  23674. ptr += uintptr(2)
  23675. if int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 && int32(*(*int8)(unsafe.Pointer(ptr))) == int32(m_ASCII_m2) {
  23676. ptr += uintptr(2)
  23677. if int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 && int32(*(*int8)(unsafe.Pointer(ptr))) == int32(m_ASCII_p2) {
  23678. return int32(m_ASCII_AMP1)
  23679. }
  23680. }
  23681. }
  23682. case int64(4):
  23683. if int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 {
  23684. v2 = int32(*(*int8)(unsafe.Pointer(ptr)))
  23685. } else {
  23686. v2 = -int32(1)
  23687. }
  23688. switch v2 {
  23689. case int32(m_ASCII_q1):
  23690. ptr += uintptr(2)
  23691. if int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 && int32(*(*int8)(unsafe.Pointer(ptr))) == int32(m_ASCII_u1) {
  23692. ptr += uintptr(2)
  23693. if int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 && int32(*(*int8)(unsafe.Pointer(ptr))) == int32(m_ASCII_o2) {
  23694. ptr += uintptr(2)
  23695. if int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 && int32(*(*int8)(unsafe.Pointer(ptr))) == int32(m_ASCII_t2) {
  23696. return int32(m_ASCII_QUOT1)
  23697. }
  23698. }
  23699. }
  23700. case int32(m_ASCII_a2):
  23701. ptr += uintptr(2)
  23702. if int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 && int32(*(*int8)(unsafe.Pointer(ptr))) == int32(m_ASCII_p2) {
  23703. ptr += uintptr(2)
  23704. if int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 && int32(*(*int8)(unsafe.Pointer(ptr))) == int32(m_ASCII_o2) {
  23705. ptr += uintptr(2)
  23706. if int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 && int32(*(*int8)(unsafe.Pointer(ptr))) == int32(m_ASCII_s2) {
  23707. return int32(m_ASCII_APOS1)
  23708. }
  23709. }
  23710. }
  23711. break
  23712. }
  23713. }
  23714. return 0
  23715. }
  23716. func _little2_nameMatchesAscii(tls *libc.TLS, enc uintptr, ptr1 uintptr, end1 uintptr, ptr2 uintptr) (r int32) {
  23717. _ = enc
  23718. for {
  23719. if !(*(*int8)(unsafe.Pointer(ptr2)) != 0) {
  23720. break
  23721. }
  23722. if int64(end1)-int64(ptr1) < int64(2) {
  23723. /* This line cannot be executed. The incoming data has already
  23724. * been tokenized once, so incomplete characters like this have
  23725. * already been eliminated from the input. Retaining the
  23726. * paranoia check is still valuable, however.
  23727. */
  23728. return 0 /* LCOV_EXCL_LINE */
  23729. }
  23730. if !(int32(*(*int8)(unsafe.Pointer(ptr1 + 1))) == 0 && int32(*(*int8)(unsafe.Pointer(ptr1))) == int32(*(*int8)(unsafe.Pointer(ptr2)))) {
  23731. return 0
  23732. }
  23733. goto _1
  23734. _1:
  23735. ;
  23736. ptr1 += uintptr(2)
  23737. ptr2++
  23738. }
  23739. return libc.BoolInt32(ptr1 == end1)
  23740. }
  23741. func _little2_nameLength(tls *libc.TLS, enc uintptr, ptr uintptr) (r int32) {
  23742. var start uintptr
  23743. var v2 int32
  23744. _, _ = start, v2
  23745. start = ptr
  23746. for {
  23747. if int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 {
  23748. v2 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr)))))))
  23749. } else {
  23750. v2 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr + 1)), *(*int8)(unsafe.Pointer(ptr)))
  23751. }
  23752. switch v2 {
  23753. case int32(_BT_LEAD2):
  23754. ptr += uintptr(2) /* NOTE: The encoding has already been validated. */
  23755. case int32(_BT_LEAD3):
  23756. ptr += uintptr(3) /* NOTE: The encoding has already been validated. */
  23757. case int32(_BT_LEAD4):
  23758. ptr += uintptr(4) /* NOTE: The encoding has already been validated. */
  23759. case int32(_BT_NONASCII):
  23760. fallthrough
  23761. case int32(_BT_NMSTRT):
  23762. fallthrough
  23763. case int32(_BT_COLON):
  23764. fallthrough
  23765. case int32(_BT_HEX):
  23766. fallthrough
  23767. case int32(_BT_DIGIT):
  23768. fallthrough
  23769. case int32(_BT_NAME):
  23770. fallthrough
  23771. case int32(_BT_MINUS):
  23772. ptr += uintptr(2)
  23773. default:
  23774. return int32(int64(ptr) - int64(start))
  23775. }
  23776. goto _1
  23777. _1:
  23778. }
  23779. return r
  23780. }
  23781. func _little2_skipS(tls *libc.TLS, enc uintptr, ptr uintptr) (r uintptr) {
  23782. var v2 int32
  23783. _ = v2
  23784. for {
  23785. if int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 {
  23786. v2 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr)))))))
  23787. } else {
  23788. v2 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr + 1)), *(*int8)(unsafe.Pointer(ptr)))
  23789. }
  23790. switch v2 {
  23791. case int32(_BT_LF):
  23792. fallthrough
  23793. case int32(_BT_CR):
  23794. fallthrough
  23795. case int32(_BT_S):
  23796. ptr += uintptr(2)
  23797. default:
  23798. return ptr
  23799. }
  23800. goto _1
  23801. _1:
  23802. }
  23803. return r
  23804. }
  23805. func _little2_updatePosition(tls *libc.TLS, enc uintptr, ptr uintptr, end uintptr, pos uintptr) {
  23806. var v1, v2 int32
  23807. var v3 bool
  23808. _, _, _ = v1, v2, v3
  23809. for int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2)) {
  23810. if int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 {
  23811. v1 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr)))))))
  23812. } else {
  23813. v1 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr + 1)), *(*int8)(unsafe.Pointer(ptr)))
  23814. }
  23815. switch v1 {
  23816. case int32(_BT_LEAD2):
  23817. ptr += uintptr(2) /* NOTE: The encoding has already been validated. */
  23818. (*TPOSITION)(unsafe.Pointer(pos)).FcolumnNumber++
  23819. case int32(_BT_LEAD3):
  23820. ptr += uintptr(3) /* NOTE: The encoding has already been validated. */
  23821. (*TPOSITION)(unsafe.Pointer(pos)).FcolumnNumber++
  23822. case int32(_BT_LEAD4):
  23823. ptr += uintptr(4) /* NOTE: The encoding has already been validated. */
  23824. (*TPOSITION)(unsafe.Pointer(pos)).FcolumnNumber++
  23825. case int32(_BT_LF):
  23826. (*TPOSITION)(unsafe.Pointer(pos)).FcolumnNumber = uint64(0)
  23827. (*TPOSITION)(unsafe.Pointer(pos)).FlineNumber++
  23828. ptr += uintptr(2)
  23829. case int32(_BT_CR):
  23830. (*TPOSITION)(unsafe.Pointer(pos)).FlineNumber++
  23831. ptr += uintptr(2)
  23832. if v3 = int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2)); v3 {
  23833. if int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 {
  23834. v2 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr)))))))
  23835. } else {
  23836. v2 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr + 1)), *(*int8)(unsafe.Pointer(ptr)))
  23837. }
  23838. }
  23839. if v3 && v2 == int32(_BT_LF) {
  23840. ptr += uintptr(2)
  23841. }
  23842. (*TPOSITION)(unsafe.Pointer(pos)).FcolumnNumber = uint64(0)
  23843. default:
  23844. ptr += uintptr(2)
  23845. (*TPOSITION)(unsafe.Pointer(pos)).FcolumnNumber++
  23846. break
  23847. }
  23848. }
  23849. }
  23850. var _little2_encoding_ns = Tnormal_encoding{
  23851. Fenc: TENCODING{
  23852. Fscanners: [4]TSCANNER{},
  23853. FliteralScanners: [2]TSCANNER{},
  23854. FminBytesPerChar: int32(2),
  23855. FisUtf16: int8(1),
  23856. },
  23857. Ftype1: [256]uint8{
  23858. 9: uint8(_BT_S),
  23859. 10: uint8(_BT_LF),
  23860. 13: uint8(_BT_CR),
  23861. 32: uint8(_BT_S),
  23862. 33: uint8(_BT_EXCL),
  23863. 34: uint8(_BT_QUOT),
  23864. 35: uint8(_BT_NUM),
  23865. 36: uint8(_BT_OTHER),
  23866. 37: uint8(_BT_PERCNT),
  23867. 38: uint8(_BT_AMP),
  23868. 39: uint8(_BT_APOS),
  23869. 40: uint8(_BT_LPAR),
  23870. 41: uint8(_BT_RPAR),
  23871. 42: uint8(_BT_AST),
  23872. 43: uint8(_BT_PLUS),
  23873. 44: uint8(_BT_COMMA),
  23874. 45: uint8(_BT_MINUS),
  23875. 46: uint8(_BT_NAME),
  23876. 47: uint8(_BT_SOL),
  23877. 48: uint8(_BT_DIGIT),
  23878. 49: uint8(_BT_DIGIT),
  23879. 50: uint8(_BT_DIGIT),
  23880. 51: uint8(_BT_DIGIT),
  23881. 52: uint8(_BT_DIGIT),
  23882. 53: uint8(_BT_DIGIT),
  23883. 54: uint8(_BT_DIGIT),
  23884. 55: uint8(_BT_DIGIT),
  23885. 56: uint8(_BT_DIGIT),
  23886. 57: uint8(_BT_DIGIT),
  23887. 58: uint8(_BT_COLON),
  23888. 59: uint8(_BT_SEMI),
  23889. 60: uint8(_BT_LT),
  23890. 61: uint8(_BT_EQUALS),
  23891. 62: uint8(_BT_GT),
  23892. 63: uint8(_BT_QUEST),
  23893. 64: uint8(_BT_OTHER),
  23894. 65: uint8(_BT_HEX),
  23895. 66: uint8(_BT_HEX),
  23896. 67: uint8(_BT_HEX),
  23897. 68: uint8(_BT_HEX),
  23898. 69: uint8(_BT_HEX),
  23899. 70: uint8(_BT_HEX),
  23900. 71: uint8(_BT_NMSTRT),
  23901. 72: uint8(_BT_NMSTRT),
  23902. 73: uint8(_BT_NMSTRT),
  23903. 74: uint8(_BT_NMSTRT),
  23904. 75: uint8(_BT_NMSTRT),
  23905. 76: uint8(_BT_NMSTRT),
  23906. 77: uint8(_BT_NMSTRT),
  23907. 78: uint8(_BT_NMSTRT),
  23908. 79: uint8(_BT_NMSTRT),
  23909. 80: uint8(_BT_NMSTRT),
  23910. 81: uint8(_BT_NMSTRT),
  23911. 82: uint8(_BT_NMSTRT),
  23912. 83: uint8(_BT_NMSTRT),
  23913. 84: uint8(_BT_NMSTRT),
  23914. 85: uint8(_BT_NMSTRT),
  23915. 86: uint8(_BT_NMSTRT),
  23916. 87: uint8(_BT_NMSTRT),
  23917. 88: uint8(_BT_NMSTRT),
  23918. 89: uint8(_BT_NMSTRT),
  23919. 90: uint8(_BT_NMSTRT),
  23920. 91: uint8(_BT_LSQB),
  23921. 92: uint8(_BT_OTHER),
  23922. 93: uint8(_BT_RSQB),
  23923. 94: uint8(_BT_OTHER),
  23924. 95: uint8(_BT_NMSTRT),
  23925. 96: uint8(_BT_OTHER),
  23926. 97: uint8(_BT_HEX),
  23927. 98: uint8(_BT_HEX),
  23928. 99: uint8(_BT_HEX),
  23929. 100: uint8(_BT_HEX),
  23930. 101: uint8(_BT_HEX),
  23931. 102: uint8(_BT_HEX),
  23932. 103: uint8(_BT_NMSTRT),
  23933. 104: uint8(_BT_NMSTRT),
  23934. 105: uint8(_BT_NMSTRT),
  23935. 106: uint8(_BT_NMSTRT),
  23936. 107: uint8(_BT_NMSTRT),
  23937. 108: uint8(_BT_NMSTRT),
  23938. 109: uint8(_BT_NMSTRT),
  23939. 110: uint8(_BT_NMSTRT),
  23940. 111: uint8(_BT_NMSTRT),
  23941. 112: uint8(_BT_NMSTRT),
  23942. 113: uint8(_BT_NMSTRT),
  23943. 114: uint8(_BT_NMSTRT),
  23944. 115: uint8(_BT_NMSTRT),
  23945. 116: uint8(_BT_NMSTRT),
  23946. 117: uint8(_BT_NMSTRT),
  23947. 118: uint8(_BT_NMSTRT),
  23948. 119: uint8(_BT_NMSTRT),
  23949. 120: uint8(_BT_NMSTRT),
  23950. 121: uint8(_BT_NMSTRT),
  23951. 122: uint8(_BT_NMSTRT),
  23952. 123: uint8(_BT_OTHER),
  23953. 124: uint8(_BT_VERBAR),
  23954. 125: uint8(_BT_OTHER),
  23955. 126: uint8(_BT_OTHER),
  23956. 127: uint8(_BT_OTHER),
  23957. 128: uint8(_BT_OTHER),
  23958. 129: uint8(_BT_OTHER),
  23959. 130: uint8(_BT_OTHER),
  23960. 131: uint8(_BT_OTHER),
  23961. 132: uint8(_BT_OTHER),
  23962. 133: uint8(_BT_OTHER),
  23963. 134: uint8(_BT_OTHER),
  23964. 135: uint8(_BT_OTHER),
  23965. 136: uint8(_BT_OTHER),
  23966. 137: uint8(_BT_OTHER),
  23967. 138: uint8(_BT_OTHER),
  23968. 139: uint8(_BT_OTHER),
  23969. 140: uint8(_BT_OTHER),
  23970. 141: uint8(_BT_OTHER),
  23971. 142: uint8(_BT_OTHER),
  23972. 143: uint8(_BT_OTHER),
  23973. 144: uint8(_BT_OTHER),
  23974. 145: uint8(_BT_OTHER),
  23975. 146: uint8(_BT_OTHER),
  23976. 147: uint8(_BT_OTHER),
  23977. 148: uint8(_BT_OTHER),
  23978. 149: uint8(_BT_OTHER),
  23979. 150: uint8(_BT_OTHER),
  23980. 151: uint8(_BT_OTHER),
  23981. 152: uint8(_BT_OTHER),
  23982. 153: uint8(_BT_OTHER),
  23983. 154: uint8(_BT_OTHER),
  23984. 155: uint8(_BT_OTHER),
  23985. 156: uint8(_BT_OTHER),
  23986. 157: uint8(_BT_OTHER),
  23987. 158: uint8(_BT_OTHER),
  23988. 159: uint8(_BT_OTHER),
  23989. 160: uint8(_BT_OTHER),
  23990. 161: uint8(_BT_OTHER),
  23991. 162: uint8(_BT_OTHER),
  23992. 163: uint8(_BT_OTHER),
  23993. 164: uint8(_BT_OTHER),
  23994. 165: uint8(_BT_OTHER),
  23995. 166: uint8(_BT_OTHER),
  23996. 167: uint8(_BT_OTHER),
  23997. 168: uint8(_BT_OTHER),
  23998. 169: uint8(_BT_OTHER),
  23999. 170: uint8(_BT_NMSTRT),
  24000. 171: uint8(_BT_OTHER),
  24001. 172: uint8(_BT_OTHER),
  24002. 173: uint8(_BT_OTHER),
  24003. 174: uint8(_BT_OTHER),
  24004. 175: uint8(_BT_OTHER),
  24005. 176: uint8(_BT_OTHER),
  24006. 177: uint8(_BT_OTHER),
  24007. 178: uint8(_BT_OTHER),
  24008. 179: uint8(_BT_OTHER),
  24009. 180: uint8(_BT_OTHER),
  24010. 181: uint8(_BT_NMSTRT),
  24011. 182: uint8(_BT_OTHER),
  24012. 183: uint8(_BT_NAME),
  24013. 184: uint8(_BT_OTHER),
  24014. 185: uint8(_BT_OTHER),
  24015. 186: uint8(_BT_NMSTRT),
  24016. 187: uint8(_BT_OTHER),
  24017. 188: uint8(_BT_OTHER),
  24018. 189: uint8(_BT_OTHER),
  24019. 190: uint8(_BT_OTHER),
  24020. 191: uint8(_BT_OTHER),
  24021. 192: uint8(_BT_NMSTRT),
  24022. 193: uint8(_BT_NMSTRT),
  24023. 194: uint8(_BT_NMSTRT),
  24024. 195: uint8(_BT_NMSTRT),
  24025. 196: uint8(_BT_NMSTRT),
  24026. 197: uint8(_BT_NMSTRT),
  24027. 198: uint8(_BT_NMSTRT),
  24028. 199: uint8(_BT_NMSTRT),
  24029. 200: uint8(_BT_NMSTRT),
  24030. 201: uint8(_BT_NMSTRT),
  24031. 202: uint8(_BT_NMSTRT),
  24032. 203: uint8(_BT_NMSTRT),
  24033. 204: uint8(_BT_NMSTRT),
  24034. 205: uint8(_BT_NMSTRT),
  24035. 206: uint8(_BT_NMSTRT),
  24036. 207: uint8(_BT_NMSTRT),
  24037. 208: uint8(_BT_NMSTRT),
  24038. 209: uint8(_BT_NMSTRT),
  24039. 210: uint8(_BT_NMSTRT),
  24040. 211: uint8(_BT_NMSTRT),
  24041. 212: uint8(_BT_NMSTRT),
  24042. 213: uint8(_BT_NMSTRT),
  24043. 214: uint8(_BT_NMSTRT),
  24044. 215: uint8(_BT_OTHER),
  24045. 216: uint8(_BT_NMSTRT),
  24046. 217: uint8(_BT_NMSTRT),
  24047. 218: uint8(_BT_NMSTRT),
  24048. 219: uint8(_BT_NMSTRT),
  24049. 220: uint8(_BT_NMSTRT),
  24050. 221: uint8(_BT_NMSTRT),
  24051. 222: uint8(_BT_NMSTRT),
  24052. 223: uint8(_BT_NMSTRT),
  24053. 224: uint8(_BT_NMSTRT),
  24054. 225: uint8(_BT_NMSTRT),
  24055. 226: uint8(_BT_NMSTRT),
  24056. 227: uint8(_BT_NMSTRT),
  24057. 228: uint8(_BT_NMSTRT),
  24058. 229: uint8(_BT_NMSTRT),
  24059. 230: uint8(_BT_NMSTRT),
  24060. 231: uint8(_BT_NMSTRT),
  24061. 232: uint8(_BT_NMSTRT),
  24062. 233: uint8(_BT_NMSTRT),
  24063. 234: uint8(_BT_NMSTRT),
  24064. 235: uint8(_BT_NMSTRT),
  24065. 236: uint8(_BT_NMSTRT),
  24066. 237: uint8(_BT_NMSTRT),
  24067. 238: uint8(_BT_NMSTRT),
  24068. 239: uint8(_BT_NMSTRT),
  24069. 240: uint8(_BT_NMSTRT),
  24070. 241: uint8(_BT_NMSTRT),
  24071. 242: uint8(_BT_NMSTRT),
  24072. 243: uint8(_BT_NMSTRT),
  24073. 244: uint8(_BT_NMSTRT),
  24074. 245: uint8(_BT_NMSTRT),
  24075. 246: uint8(_BT_NMSTRT),
  24076. 247: uint8(_BT_OTHER),
  24077. 248: uint8(_BT_NMSTRT),
  24078. 249: uint8(_BT_NMSTRT),
  24079. 250: uint8(_BT_NMSTRT),
  24080. 251: uint8(_BT_NMSTRT),
  24081. 252: uint8(_BT_NMSTRT),
  24082. 253: uint8(_BT_NMSTRT),
  24083. 254: uint8(_BT_NMSTRT),
  24084. 255: uint8(_BT_NMSTRT),
  24085. },
  24086. }
  24087. func init() {
  24088. p := unsafe.Pointer(&_little2_encoding_ns)
  24089. *(*uintptr)(unsafe.Add(p, 0)) = __ccgo_fp(_little2_prologTok)
  24090. *(*uintptr)(unsafe.Add(p, 8)) = __ccgo_fp(_little2_contentTok)
  24091. *(*uintptr)(unsafe.Add(p, 16)) = __ccgo_fp(_little2_cdataSectionTok)
  24092. *(*uintptr)(unsafe.Add(p, 24)) = __ccgo_fp(_little2_ignoreSectionTok)
  24093. *(*uintptr)(unsafe.Add(p, 32)) = __ccgo_fp(_little2_attributeValueTok)
  24094. *(*uintptr)(unsafe.Add(p, 40)) = __ccgo_fp(_little2_entityValueTok)
  24095. *(*uintptr)(unsafe.Add(p, 48)) = __ccgo_fp(_little2_nameMatchesAscii)
  24096. *(*uintptr)(unsafe.Add(p, 56)) = __ccgo_fp(_little2_nameLength)
  24097. *(*uintptr)(unsafe.Add(p, 64)) = __ccgo_fp(_little2_skipS)
  24098. *(*uintptr)(unsafe.Add(p, 72)) = __ccgo_fp(_little2_getAtts)
  24099. *(*uintptr)(unsafe.Add(p, 80)) = __ccgo_fp(_little2_charRefNumber)
  24100. *(*uintptr)(unsafe.Add(p, 88)) = __ccgo_fp(_little2_predefinedEntityName)
  24101. *(*uintptr)(unsafe.Add(p, 96)) = __ccgo_fp(_little2_updatePosition)
  24102. *(*uintptr)(unsafe.Add(p, 104)) = __ccgo_fp(_little2_isPublicId)
  24103. *(*uintptr)(unsafe.Add(p, 112)) = __ccgo_fp(_little2_toUtf8)
  24104. *(*uintptr)(unsafe.Add(p, 120)) = __ccgo_fp(_little2_toUtf16)
  24105. }
  24106. var _little2_encoding = Tnormal_encoding{
  24107. Fenc: TENCODING{
  24108. Fscanners: [4]TSCANNER{},
  24109. FliteralScanners: [2]TSCANNER{},
  24110. FminBytesPerChar: int32(2),
  24111. FisUtf16: int8(1),
  24112. },
  24113. Ftype1: [256]uint8{
  24114. 9: uint8(_BT_S),
  24115. 10: uint8(_BT_LF),
  24116. 13: uint8(_BT_CR),
  24117. 32: uint8(_BT_S),
  24118. 33: uint8(_BT_EXCL),
  24119. 34: uint8(_BT_QUOT),
  24120. 35: uint8(_BT_NUM),
  24121. 36: uint8(_BT_OTHER),
  24122. 37: uint8(_BT_PERCNT),
  24123. 38: uint8(_BT_AMP),
  24124. 39: uint8(_BT_APOS),
  24125. 40: uint8(_BT_LPAR),
  24126. 41: uint8(_BT_RPAR),
  24127. 42: uint8(_BT_AST),
  24128. 43: uint8(_BT_PLUS),
  24129. 44: uint8(_BT_COMMA),
  24130. 45: uint8(_BT_MINUS),
  24131. 46: uint8(_BT_NAME),
  24132. 47: uint8(_BT_SOL),
  24133. 48: uint8(_BT_DIGIT),
  24134. 49: uint8(_BT_DIGIT),
  24135. 50: uint8(_BT_DIGIT),
  24136. 51: uint8(_BT_DIGIT),
  24137. 52: uint8(_BT_DIGIT),
  24138. 53: uint8(_BT_DIGIT),
  24139. 54: uint8(_BT_DIGIT),
  24140. 55: uint8(_BT_DIGIT),
  24141. 56: uint8(_BT_DIGIT),
  24142. 57: uint8(_BT_DIGIT),
  24143. 58: uint8(_BT_NMSTRT),
  24144. 59: uint8(_BT_SEMI),
  24145. 60: uint8(_BT_LT),
  24146. 61: uint8(_BT_EQUALS),
  24147. 62: uint8(_BT_GT),
  24148. 63: uint8(_BT_QUEST),
  24149. 64: uint8(_BT_OTHER),
  24150. 65: uint8(_BT_HEX),
  24151. 66: uint8(_BT_HEX),
  24152. 67: uint8(_BT_HEX),
  24153. 68: uint8(_BT_HEX),
  24154. 69: uint8(_BT_HEX),
  24155. 70: uint8(_BT_HEX),
  24156. 71: uint8(_BT_NMSTRT),
  24157. 72: uint8(_BT_NMSTRT),
  24158. 73: uint8(_BT_NMSTRT),
  24159. 74: uint8(_BT_NMSTRT),
  24160. 75: uint8(_BT_NMSTRT),
  24161. 76: uint8(_BT_NMSTRT),
  24162. 77: uint8(_BT_NMSTRT),
  24163. 78: uint8(_BT_NMSTRT),
  24164. 79: uint8(_BT_NMSTRT),
  24165. 80: uint8(_BT_NMSTRT),
  24166. 81: uint8(_BT_NMSTRT),
  24167. 82: uint8(_BT_NMSTRT),
  24168. 83: uint8(_BT_NMSTRT),
  24169. 84: uint8(_BT_NMSTRT),
  24170. 85: uint8(_BT_NMSTRT),
  24171. 86: uint8(_BT_NMSTRT),
  24172. 87: uint8(_BT_NMSTRT),
  24173. 88: uint8(_BT_NMSTRT),
  24174. 89: uint8(_BT_NMSTRT),
  24175. 90: uint8(_BT_NMSTRT),
  24176. 91: uint8(_BT_LSQB),
  24177. 92: uint8(_BT_OTHER),
  24178. 93: uint8(_BT_RSQB),
  24179. 94: uint8(_BT_OTHER),
  24180. 95: uint8(_BT_NMSTRT),
  24181. 96: uint8(_BT_OTHER),
  24182. 97: uint8(_BT_HEX),
  24183. 98: uint8(_BT_HEX),
  24184. 99: uint8(_BT_HEX),
  24185. 100: uint8(_BT_HEX),
  24186. 101: uint8(_BT_HEX),
  24187. 102: uint8(_BT_HEX),
  24188. 103: uint8(_BT_NMSTRT),
  24189. 104: uint8(_BT_NMSTRT),
  24190. 105: uint8(_BT_NMSTRT),
  24191. 106: uint8(_BT_NMSTRT),
  24192. 107: uint8(_BT_NMSTRT),
  24193. 108: uint8(_BT_NMSTRT),
  24194. 109: uint8(_BT_NMSTRT),
  24195. 110: uint8(_BT_NMSTRT),
  24196. 111: uint8(_BT_NMSTRT),
  24197. 112: uint8(_BT_NMSTRT),
  24198. 113: uint8(_BT_NMSTRT),
  24199. 114: uint8(_BT_NMSTRT),
  24200. 115: uint8(_BT_NMSTRT),
  24201. 116: uint8(_BT_NMSTRT),
  24202. 117: uint8(_BT_NMSTRT),
  24203. 118: uint8(_BT_NMSTRT),
  24204. 119: uint8(_BT_NMSTRT),
  24205. 120: uint8(_BT_NMSTRT),
  24206. 121: uint8(_BT_NMSTRT),
  24207. 122: uint8(_BT_NMSTRT),
  24208. 123: uint8(_BT_OTHER),
  24209. 124: uint8(_BT_VERBAR),
  24210. 125: uint8(_BT_OTHER),
  24211. 126: uint8(_BT_OTHER),
  24212. 127: uint8(_BT_OTHER),
  24213. 128: uint8(_BT_OTHER),
  24214. 129: uint8(_BT_OTHER),
  24215. 130: uint8(_BT_OTHER),
  24216. 131: uint8(_BT_OTHER),
  24217. 132: uint8(_BT_OTHER),
  24218. 133: uint8(_BT_OTHER),
  24219. 134: uint8(_BT_OTHER),
  24220. 135: uint8(_BT_OTHER),
  24221. 136: uint8(_BT_OTHER),
  24222. 137: uint8(_BT_OTHER),
  24223. 138: uint8(_BT_OTHER),
  24224. 139: uint8(_BT_OTHER),
  24225. 140: uint8(_BT_OTHER),
  24226. 141: uint8(_BT_OTHER),
  24227. 142: uint8(_BT_OTHER),
  24228. 143: uint8(_BT_OTHER),
  24229. 144: uint8(_BT_OTHER),
  24230. 145: uint8(_BT_OTHER),
  24231. 146: uint8(_BT_OTHER),
  24232. 147: uint8(_BT_OTHER),
  24233. 148: uint8(_BT_OTHER),
  24234. 149: uint8(_BT_OTHER),
  24235. 150: uint8(_BT_OTHER),
  24236. 151: uint8(_BT_OTHER),
  24237. 152: uint8(_BT_OTHER),
  24238. 153: uint8(_BT_OTHER),
  24239. 154: uint8(_BT_OTHER),
  24240. 155: uint8(_BT_OTHER),
  24241. 156: uint8(_BT_OTHER),
  24242. 157: uint8(_BT_OTHER),
  24243. 158: uint8(_BT_OTHER),
  24244. 159: uint8(_BT_OTHER),
  24245. 160: uint8(_BT_OTHER),
  24246. 161: uint8(_BT_OTHER),
  24247. 162: uint8(_BT_OTHER),
  24248. 163: uint8(_BT_OTHER),
  24249. 164: uint8(_BT_OTHER),
  24250. 165: uint8(_BT_OTHER),
  24251. 166: uint8(_BT_OTHER),
  24252. 167: uint8(_BT_OTHER),
  24253. 168: uint8(_BT_OTHER),
  24254. 169: uint8(_BT_OTHER),
  24255. 170: uint8(_BT_NMSTRT),
  24256. 171: uint8(_BT_OTHER),
  24257. 172: uint8(_BT_OTHER),
  24258. 173: uint8(_BT_OTHER),
  24259. 174: uint8(_BT_OTHER),
  24260. 175: uint8(_BT_OTHER),
  24261. 176: uint8(_BT_OTHER),
  24262. 177: uint8(_BT_OTHER),
  24263. 178: uint8(_BT_OTHER),
  24264. 179: uint8(_BT_OTHER),
  24265. 180: uint8(_BT_OTHER),
  24266. 181: uint8(_BT_NMSTRT),
  24267. 182: uint8(_BT_OTHER),
  24268. 183: uint8(_BT_NAME),
  24269. 184: uint8(_BT_OTHER),
  24270. 185: uint8(_BT_OTHER),
  24271. 186: uint8(_BT_NMSTRT),
  24272. 187: uint8(_BT_OTHER),
  24273. 188: uint8(_BT_OTHER),
  24274. 189: uint8(_BT_OTHER),
  24275. 190: uint8(_BT_OTHER),
  24276. 191: uint8(_BT_OTHER),
  24277. 192: uint8(_BT_NMSTRT),
  24278. 193: uint8(_BT_NMSTRT),
  24279. 194: uint8(_BT_NMSTRT),
  24280. 195: uint8(_BT_NMSTRT),
  24281. 196: uint8(_BT_NMSTRT),
  24282. 197: uint8(_BT_NMSTRT),
  24283. 198: uint8(_BT_NMSTRT),
  24284. 199: uint8(_BT_NMSTRT),
  24285. 200: uint8(_BT_NMSTRT),
  24286. 201: uint8(_BT_NMSTRT),
  24287. 202: uint8(_BT_NMSTRT),
  24288. 203: uint8(_BT_NMSTRT),
  24289. 204: uint8(_BT_NMSTRT),
  24290. 205: uint8(_BT_NMSTRT),
  24291. 206: uint8(_BT_NMSTRT),
  24292. 207: uint8(_BT_NMSTRT),
  24293. 208: uint8(_BT_NMSTRT),
  24294. 209: uint8(_BT_NMSTRT),
  24295. 210: uint8(_BT_NMSTRT),
  24296. 211: uint8(_BT_NMSTRT),
  24297. 212: uint8(_BT_NMSTRT),
  24298. 213: uint8(_BT_NMSTRT),
  24299. 214: uint8(_BT_NMSTRT),
  24300. 215: uint8(_BT_OTHER),
  24301. 216: uint8(_BT_NMSTRT),
  24302. 217: uint8(_BT_NMSTRT),
  24303. 218: uint8(_BT_NMSTRT),
  24304. 219: uint8(_BT_NMSTRT),
  24305. 220: uint8(_BT_NMSTRT),
  24306. 221: uint8(_BT_NMSTRT),
  24307. 222: uint8(_BT_NMSTRT),
  24308. 223: uint8(_BT_NMSTRT),
  24309. 224: uint8(_BT_NMSTRT),
  24310. 225: uint8(_BT_NMSTRT),
  24311. 226: uint8(_BT_NMSTRT),
  24312. 227: uint8(_BT_NMSTRT),
  24313. 228: uint8(_BT_NMSTRT),
  24314. 229: uint8(_BT_NMSTRT),
  24315. 230: uint8(_BT_NMSTRT),
  24316. 231: uint8(_BT_NMSTRT),
  24317. 232: uint8(_BT_NMSTRT),
  24318. 233: uint8(_BT_NMSTRT),
  24319. 234: uint8(_BT_NMSTRT),
  24320. 235: uint8(_BT_NMSTRT),
  24321. 236: uint8(_BT_NMSTRT),
  24322. 237: uint8(_BT_NMSTRT),
  24323. 238: uint8(_BT_NMSTRT),
  24324. 239: uint8(_BT_NMSTRT),
  24325. 240: uint8(_BT_NMSTRT),
  24326. 241: uint8(_BT_NMSTRT),
  24327. 242: uint8(_BT_NMSTRT),
  24328. 243: uint8(_BT_NMSTRT),
  24329. 244: uint8(_BT_NMSTRT),
  24330. 245: uint8(_BT_NMSTRT),
  24331. 246: uint8(_BT_NMSTRT),
  24332. 247: uint8(_BT_OTHER),
  24333. 248: uint8(_BT_NMSTRT),
  24334. 249: uint8(_BT_NMSTRT),
  24335. 250: uint8(_BT_NMSTRT),
  24336. 251: uint8(_BT_NMSTRT),
  24337. 252: uint8(_BT_NMSTRT),
  24338. 253: uint8(_BT_NMSTRT),
  24339. 254: uint8(_BT_NMSTRT),
  24340. 255: uint8(_BT_NMSTRT),
  24341. },
  24342. }
  24343. func init() {
  24344. p := unsafe.Pointer(&_little2_encoding)
  24345. *(*uintptr)(unsafe.Add(p, 0)) = __ccgo_fp(_little2_prologTok)
  24346. *(*uintptr)(unsafe.Add(p, 8)) = __ccgo_fp(_little2_contentTok)
  24347. *(*uintptr)(unsafe.Add(p, 16)) = __ccgo_fp(_little2_cdataSectionTok)
  24348. *(*uintptr)(unsafe.Add(p, 24)) = __ccgo_fp(_little2_ignoreSectionTok)
  24349. *(*uintptr)(unsafe.Add(p, 32)) = __ccgo_fp(_little2_attributeValueTok)
  24350. *(*uintptr)(unsafe.Add(p, 40)) = __ccgo_fp(_little2_entityValueTok)
  24351. *(*uintptr)(unsafe.Add(p, 48)) = __ccgo_fp(_little2_nameMatchesAscii)
  24352. *(*uintptr)(unsafe.Add(p, 56)) = __ccgo_fp(_little2_nameLength)
  24353. *(*uintptr)(unsafe.Add(p, 64)) = __ccgo_fp(_little2_skipS)
  24354. *(*uintptr)(unsafe.Add(p, 72)) = __ccgo_fp(_little2_getAtts)
  24355. *(*uintptr)(unsafe.Add(p, 80)) = __ccgo_fp(_little2_charRefNumber)
  24356. *(*uintptr)(unsafe.Add(p, 88)) = __ccgo_fp(_little2_predefinedEntityName)
  24357. *(*uintptr)(unsafe.Add(p, 96)) = __ccgo_fp(_little2_updatePosition)
  24358. *(*uintptr)(unsafe.Add(p, 104)) = __ccgo_fp(_little2_isPublicId)
  24359. *(*uintptr)(unsafe.Add(p, 112)) = __ccgo_fp(_little2_toUtf8)
  24360. *(*uintptr)(unsafe.Add(p, 120)) = __ccgo_fp(_little2_toUtf16)
  24361. }
  24362. var _internal_little2_encoding_ns = Tnormal_encoding{
  24363. Fenc: TENCODING{
  24364. Fscanners: [4]TSCANNER{},
  24365. FliteralScanners: [2]TSCANNER{},
  24366. FminBytesPerChar: int32(2),
  24367. FisUtf16: int8(1),
  24368. },
  24369. Ftype1: [256]uint8{
  24370. 9: uint8(_BT_S),
  24371. 10: uint8(_BT_LF),
  24372. 13: uint8(_BT_S),
  24373. 32: uint8(_BT_S),
  24374. 33: uint8(_BT_EXCL),
  24375. 34: uint8(_BT_QUOT),
  24376. 35: uint8(_BT_NUM),
  24377. 36: uint8(_BT_OTHER),
  24378. 37: uint8(_BT_PERCNT),
  24379. 38: uint8(_BT_AMP),
  24380. 39: uint8(_BT_APOS),
  24381. 40: uint8(_BT_LPAR),
  24382. 41: uint8(_BT_RPAR),
  24383. 42: uint8(_BT_AST),
  24384. 43: uint8(_BT_PLUS),
  24385. 44: uint8(_BT_COMMA),
  24386. 45: uint8(_BT_MINUS),
  24387. 46: uint8(_BT_NAME),
  24388. 47: uint8(_BT_SOL),
  24389. 48: uint8(_BT_DIGIT),
  24390. 49: uint8(_BT_DIGIT),
  24391. 50: uint8(_BT_DIGIT),
  24392. 51: uint8(_BT_DIGIT),
  24393. 52: uint8(_BT_DIGIT),
  24394. 53: uint8(_BT_DIGIT),
  24395. 54: uint8(_BT_DIGIT),
  24396. 55: uint8(_BT_DIGIT),
  24397. 56: uint8(_BT_DIGIT),
  24398. 57: uint8(_BT_DIGIT),
  24399. 58: uint8(_BT_COLON),
  24400. 59: uint8(_BT_SEMI),
  24401. 60: uint8(_BT_LT),
  24402. 61: uint8(_BT_EQUALS),
  24403. 62: uint8(_BT_GT),
  24404. 63: uint8(_BT_QUEST),
  24405. 64: uint8(_BT_OTHER),
  24406. 65: uint8(_BT_HEX),
  24407. 66: uint8(_BT_HEX),
  24408. 67: uint8(_BT_HEX),
  24409. 68: uint8(_BT_HEX),
  24410. 69: uint8(_BT_HEX),
  24411. 70: uint8(_BT_HEX),
  24412. 71: uint8(_BT_NMSTRT),
  24413. 72: uint8(_BT_NMSTRT),
  24414. 73: uint8(_BT_NMSTRT),
  24415. 74: uint8(_BT_NMSTRT),
  24416. 75: uint8(_BT_NMSTRT),
  24417. 76: uint8(_BT_NMSTRT),
  24418. 77: uint8(_BT_NMSTRT),
  24419. 78: uint8(_BT_NMSTRT),
  24420. 79: uint8(_BT_NMSTRT),
  24421. 80: uint8(_BT_NMSTRT),
  24422. 81: uint8(_BT_NMSTRT),
  24423. 82: uint8(_BT_NMSTRT),
  24424. 83: uint8(_BT_NMSTRT),
  24425. 84: uint8(_BT_NMSTRT),
  24426. 85: uint8(_BT_NMSTRT),
  24427. 86: uint8(_BT_NMSTRT),
  24428. 87: uint8(_BT_NMSTRT),
  24429. 88: uint8(_BT_NMSTRT),
  24430. 89: uint8(_BT_NMSTRT),
  24431. 90: uint8(_BT_NMSTRT),
  24432. 91: uint8(_BT_LSQB),
  24433. 92: uint8(_BT_OTHER),
  24434. 93: uint8(_BT_RSQB),
  24435. 94: uint8(_BT_OTHER),
  24436. 95: uint8(_BT_NMSTRT),
  24437. 96: uint8(_BT_OTHER),
  24438. 97: uint8(_BT_HEX),
  24439. 98: uint8(_BT_HEX),
  24440. 99: uint8(_BT_HEX),
  24441. 100: uint8(_BT_HEX),
  24442. 101: uint8(_BT_HEX),
  24443. 102: uint8(_BT_HEX),
  24444. 103: uint8(_BT_NMSTRT),
  24445. 104: uint8(_BT_NMSTRT),
  24446. 105: uint8(_BT_NMSTRT),
  24447. 106: uint8(_BT_NMSTRT),
  24448. 107: uint8(_BT_NMSTRT),
  24449. 108: uint8(_BT_NMSTRT),
  24450. 109: uint8(_BT_NMSTRT),
  24451. 110: uint8(_BT_NMSTRT),
  24452. 111: uint8(_BT_NMSTRT),
  24453. 112: uint8(_BT_NMSTRT),
  24454. 113: uint8(_BT_NMSTRT),
  24455. 114: uint8(_BT_NMSTRT),
  24456. 115: uint8(_BT_NMSTRT),
  24457. 116: uint8(_BT_NMSTRT),
  24458. 117: uint8(_BT_NMSTRT),
  24459. 118: uint8(_BT_NMSTRT),
  24460. 119: uint8(_BT_NMSTRT),
  24461. 120: uint8(_BT_NMSTRT),
  24462. 121: uint8(_BT_NMSTRT),
  24463. 122: uint8(_BT_NMSTRT),
  24464. 123: uint8(_BT_OTHER),
  24465. 124: uint8(_BT_VERBAR),
  24466. 125: uint8(_BT_OTHER),
  24467. 126: uint8(_BT_OTHER),
  24468. 127: uint8(_BT_OTHER),
  24469. 128: uint8(_BT_OTHER),
  24470. 129: uint8(_BT_OTHER),
  24471. 130: uint8(_BT_OTHER),
  24472. 131: uint8(_BT_OTHER),
  24473. 132: uint8(_BT_OTHER),
  24474. 133: uint8(_BT_OTHER),
  24475. 134: uint8(_BT_OTHER),
  24476. 135: uint8(_BT_OTHER),
  24477. 136: uint8(_BT_OTHER),
  24478. 137: uint8(_BT_OTHER),
  24479. 138: uint8(_BT_OTHER),
  24480. 139: uint8(_BT_OTHER),
  24481. 140: uint8(_BT_OTHER),
  24482. 141: uint8(_BT_OTHER),
  24483. 142: uint8(_BT_OTHER),
  24484. 143: uint8(_BT_OTHER),
  24485. 144: uint8(_BT_OTHER),
  24486. 145: uint8(_BT_OTHER),
  24487. 146: uint8(_BT_OTHER),
  24488. 147: uint8(_BT_OTHER),
  24489. 148: uint8(_BT_OTHER),
  24490. 149: uint8(_BT_OTHER),
  24491. 150: uint8(_BT_OTHER),
  24492. 151: uint8(_BT_OTHER),
  24493. 152: uint8(_BT_OTHER),
  24494. 153: uint8(_BT_OTHER),
  24495. 154: uint8(_BT_OTHER),
  24496. 155: uint8(_BT_OTHER),
  24497. 156: uint8(_BT_OTHER),
  24498. 157: uint8(_BT_OTHER),
  24499. 158: uint8(_BT_OTHER),
  24500. 159: uint8(_BT_OTHER),
  24501. 160: uint8(_BT_OTHER),
  24502. 161: uint8(_BT_OTHER),
  24503. 162: uint8(_BT_OTHER),
  24504. 163: uint8(_BT_OTHER),
  24505. 164: uint8(_BT_OTHER),
  24506. 165: uint8(_BT_OTHER),
  24507. 166: uint8(_BT_OTHER),
  24508. 167: uint8(_BT_OTHER),
  24509. 168: uint8(_BT_OTHER),
  24510. 169: uint8(_BT_OTHER),
  24511. 170: uint8(_BT_NMSTRT),
  24512. 171: uint8(_BT_OTHER),
  24513. 172: uint8(_BT_OTHER),
  24514. 173: uint8(_BT_OTHER),
  24515. 174: uint8(_BT_OTHER),
  24516. 175: uint8(_BT_OTHER),
  24517. 176: uint8(_BT_OTHER),
  24518. 177: uint8(_BT_OTHER),
  24519. 178: uint8(_BT_OTHER),
  24520. 179: uint8(_BT_OTHER),
  24521. 180: uint8(_BT_OTHER),
  24522. 181: uint8(_BT_NMSTRT),
  24523. 182: uint8(_BT_OTHER),
  24524. 183: uint8(_BT_NAME),
  24525. 184: uint8(_BT_OTHER),
  24526. 185: uint8(_BT_OTHER),
  24527. 186: uint8(_BT_NMSTRT),
  24528. 187: uint8(_BT_OTHER),
  24529. 188: uint8(_BT_OTHER),
  24530. 189: uint8(_BT_OTHER),
  24531. 190: uint8(_BT_OTHER),
  24532. 191: uint8(_BT_OTHER),
  24533. 192: uint8(_BT_NMSTRT),
  24534. 193: uint8(_BT_NMSTRT),
  24535. 194: uint8(_BT_NMSTRT),
  24536. 195: uint8(_BT_NMSTRT),
  24537. 196: uint8(_BT_NMSTRT),
  24538. 197: uint8(_BT_NMSTRT),
  24539. 198: uint8(_BT_NMSTRT),
  24540. 199: uint8(_BT_NMSTRT),
  24541. 200: uint8(_BT_NMSTRT),
  24542. 201: uint8(_BT_NMSTRT),
  24543. 202: uint8(_BT_NMSTRT),
  24544. 203: uint8(_BT_NMSTRT),
  24545. 204: uint8(_BT_NMSTRT),
  24546. 205: uint8(_BT_NMSTRT),
  24547. 206: uint8(_BT_NMSTRT),
  24548. 207: uint8(_BT_NMSTRT),
  24549. 208: uint8(_BT_NMSTRT),
  24550. 209: uint8(_BT_NMSTRT),
  24551. 210: uint8(_BT_NMSTRT),
  24552. 211: uint8(_BT_NMSTRT),
  24553. 212: uint8(_BT_NMSTRT),
  24554. 213: uint8(_BT_NMSTRT),
  24555. 214: uint8(_BT_NMSTRT),
  24556. 215: uint8(_BT_OTHER),
  24557. 216: uint8(_BT_NMSTRT),
  24558. 217: uint8(_BT_NMSTRT),
  24559. 218: uint8(_BT_NMSTRT),
  24560. 219: uint8(_BT_NMSTRT),
  24561. 220: uint8(_BT_NMSTRT),
  24562. 221: uint8(_BT_NMSTRT),
  24563. 222: uint8(_BT_NMSTRT),
  24564. 223: uint8(_BT_NMSTRT),
  24565. 224: uint8(_BT_NMSTRT),
  24566. 225: uint8(_BT_NMSTRT),
  24567. 226: uint8(_BT_NMSTRT),
  24568. 227: uint8(_BT_NMSTRT),
  24569. 228: uint8(_BT_NMSTRT),
  24570. 229: uint8(_BT_NMSTRT),
  24571. 230: uint8(_BT_NMSTRT),
  24572. 231: uint8(_BT_NMSTRT),
  24573. 232: uint8(_BT_NMSTRT),
  24574. 233: uint8(_BT_NMSTRT),
  24575. 234: uint8(_BT_NMSTRT),
  24576. 235: uint8(_BT_NMSTRT),
  24577. 236: uint8(_BT_NMSTRT),
  24578. 237: uint8(_BT_NMSTRT),
  24579. 238: uint8(_BT_NMSTRT),
  24580. 239: uint8(_BT_NMSTRT),
  24581. 240: uint8(_BT_NMSTRT),
  24582. 241: uint8(_BT_NMSTRT),
  24583. 242: uint8(_BT_NMSTRT),
  24584. 243: uint8(_BT_NMSTRT),
  24585. 244: uint8(_BT_NMSTRT),
  24586. 245: uint8(_BT_NMSTRT),
  24587. 246: uint8(_BT_NMSTRT),
  24588. 247: uint8(_BT_OTHER),
  24589. 248: uint8(_BT_NMSTRT),
  24590. 249: uint8(_BT_NMSTRT),
  24591. 250: uint8(_BT_NMSTRT),
  24592. 251: uint8(_BT_NMSTRT),
  24593. 252: uint8(_BT_NMSTRT),
  24594. 253: uint8(_BT_NMSTRT),
  24595. 254: uint8(_BT_NMSTRT),
  24596. 255: uint8(_BT_NMSTRT),
  24597. },
  24598. }
  24599. func init() {
  24600. p := unsafe.Pointer(&_internal_little2_encoding_ns)
  24601. *(*uintptr)(unsafe.Add(p, 0)) = __ccgo_fp(_little2_prologTok)
  24602. *(*uintptr)(unsafe.Add(p, 8)) = __ccgo_fp(_little2_contentTok)
  24603. *(*uintptr)(unsafe.Add(p, 16)) = __ccgo_fp(_little2_cdataSectionTok)
  24604. *(*uintptr)(unsafe.Add(p, 24)) = __ccgo_fp(_little2_ignoreSectionTok)
  24605. *(*uintptr)(unsafe.Add(p, 32)) = __ccgo_fp(_little2_attributeValueTok)
  24606. *(*uintptr)(unsafe.Add(p, 40)) = __ccgo_fp(_little2_entityValueTok)
  24607. *(*uintptr)(unsafe.Add(p, 48)) = __ccgo_fp(_little2_nameMatchesAscii)
  24608. *(*uintptr)(unsafe.Add(p, 56)) = __ccgo_fp(_little2_nameLength)
  24609. *(*uintptr)(unsafe.Add(p, 64)) = __ccgo_fp(_little2_skipS)
  24610. *(*uintptr)(unsafe.Add(p, 72)) = __ccgo_fp(_little2_getAtts)
  24611. *(*uintptr)(unsafe.Add(p, 80)) = __ccgo_fp(_little2_charRefNumber)
  24612. *(*uintptr)(unsafe.Add(p, 88)) = __ccgo_fp(_little2_predefinedEntityName)
  24613. *(*uintptr)(unsafe.Add(p, 96)) = __ccgo_fp(_little2_updatePosition)
  24614. *(*uintptr)(unsafe.Add(p, 104)) = __ccgo_fp(_little2_isPublicId)
  24615. *(*uintptr)(unsafe.Add(p, 112)) = __ccgo_fp(_little2_toUtf8)
  24616. *(*uintptr)(unsafe.Add(p, 120)) = __ccgo_fp(_little2_toUtf16)
  24617. }
  24618. var _internal_little2_encoding = Tnormal_encoding{
  24619. Fenc: TENCODING{
  24620. Fscanners: [4]TSCANNER{},
  24621. FliteralScanners: [2]TSCANNER{},
  24622. FminBytesPerChar: int32(2),
  24623. FisUtf16: int8(1),
  24624. },
  24625. Ftype1: [256]uint8{
  24626. 9: uint8(_BT_S),
  24627. 10: uint8(_BT_LF),
  24628. 13: uint8(_BT_S),
  24629. 32: uint8(_BT_S),
  24630. 33: uint8(_BT_EXCL),
  24631. 34: uint8(_BT_QUOT),
  24632. 35: uint8(_BT_NUM),
  24633. 36: uint8(_BT_OTHER),
  24634. 37: uint8(_BT_PERCNT),
  24635. 38: uint8(_BT_AMP),
  24636. 39: uint8(_BT_APOS),
  24637. 40: uint8(_BT_LPAR),
  24638. 41: uint8(_BT_RPAR),
  24639. 42: uint8(_BT_AST),
  24640. 43: uint8(_BT_PLUS),
  24641. 44: uint8(_BT_COMMA),
  24642. 45: uint8(_BT_MINUS),
  24643. 46: uint8(_BT_NAME),
  24644. 47: uint8(_BT_SOL),
  24645. 48: uint8(_BT_DIGIT),
  24646. 49: uint8(_BT_DIGIT),
  24647. 50: uint8(_BT_DIGIT),
  24648. 51: uint8(_BT_DIGIT),
  24649. 52: uint8(_BT_DIGIT),
  24650. 53: uint8(_BT_DIGIT),
  24651. 54: uint8(_BT_DIGIT),
  24652. 55: uint8(_BT_DIGIT),
  24653. 56: uint8(_BT_DIGIT),
  24654. 57: uint8(_BT_DIGIT),
  24655. 58: uint8(_BT_NMSTRT),
  24656. 59: uint8(_BT_SEMI),
  24657. 60: uint8(_BT_LT),
  24658. 61: uint8(_BT_EQUALS),
  24659. 62: uint8(_BT_GT),
  24660. 63: uint8(_BT_QUEST),
  24661. 64: uint8(_BT_OTHER),
  24662. 65: uint8(_BT_HEX),
  24663. 66: uint8(_BT_HEX),
  24664. 67: uint8(_BT_HEX),
  24665. 68: uint8(_BT_HEX),
  24666. 69: uint8(_BT_HEX),
  24667. 70: uint8(_BT_HEX),
  24668. 71: uint8(_BT_NMSTRT),
  24669. 72: uint8(_BT_NMSTRT),
  24670. 73: uint8(_BT_NMSTRT),
  24671. 74: uint8(_BT_NMSTRT),
  24672. 75: uint8(_BT_NMSTRT),
  24673. 76: uint8(_BT_NMSTRT),
  24674. 77: uint8(_BT_NMSTRT),
  24675. 78: uint8(_BT_NMSTRT),
  24676. 79: uint8(_BT_NMSTRT),
  24677. 80: uint8(_BT_NMSTRT),
  24678. 81: uint8(_BT_NMSTRT),
  24679. 82: uint8(_BT_NMSTRT),
  24680. 83: uint8(_BT_NMSTRT),
  24681. 84: uint8(_BT_NMSTRT),
  24682. 85: uint8(_BT_NMSTRT),
  24683. 86: uint8(_BT_NMSTRT),
  24684. 87: uint8(_BT_NMSTRT),
  24685. 88: uint8(_BT_NMSTRT),
  24686. 89: uint8(_BT_NMSTRT),
  24687. 90: uint8(_BT_NMSTRT),
  24688. 91: uint8(_BT_LSQB),
  24689. 92: uint8(_BT_OTHER),
  24690. 93: uint8(_BT_RSQB),
  24691. 94: uint8(_BT_OTHER),
  24692. 95: uint8(_BT_NMSTRT),
  24693. 96: uint8(_BT_OTHER),
  24694. 97: uint8(_BT_HEX),
  24695. 98: uint8(_BT_HEX),
  24696. 99: uint8(_BT_HEX),
  24697. 100: uint8(_BT_HEX),
  24698. 101: uint8(_BT_HEX),
  24699. 102: uint8(_BT_HEX),
  24700. 103: uint8(_BT_NMSTRT),
  24701. 104: uint8(_BT_NMSTRT),
  24702. 105: uint8(_BT_NMSTRT),
  24703. 106: uint8(_BT_NMSTRT),
  24704. 107: uint8(_BT_NMSTRT),
  24705. 108: uint8(_BT_NMSTRT),
  24706. 109: uint8(_BT_NMSTRT),
  24707. 110: uint8(_BT_NMSTRT),
  24708. 111: uint8(_BT_NMSTRT),
  24709. 112: uint8(_BT_NMSTRT),
  24710. 113: uint8(_BT_NMSTRT),
  24711. 114: uint8(_BT_NMSTRT),
  24712. 115: uint8(_BT_NMSTRT),
  24713. 116: uint8(_BT_NMSTRT),
  24714. 117: uint8(_BT_NMSTRT),
  24715. 118: uint8(_BT_NMSTRT),
  24716. 119: uint8(_BT_NMSTRT),
  24717. 120: uint8(_BT_NMSTRT),
  24718. 121: uint8(_BT_NMSTRT),
  24719. 122: uint8(_BT_NMSTRT),
  24720. 123: uint8(_BT_OTHER),
  24721. 124: uint8(_BT_VERBAR),
  24722. 125: uint8(_BT_OTHER),
  24723. 126: uint8(_BT_OTHER),
  24724. 127: uint8(_BT_OTHER),
  24725. 128: uint8(_BT_OTHER),
  24726. 129: uint8(_BT_OTHER),
  24727. 130: uint8(_BT_OTHER),
  24728. 131: uint8(_BT_OTHER),
  24729. 132: uint8(_BT_OTHER),
  24730. 133: uint8(_BT_OTHER),
  24731. 134: uint8(_BT_OTHER),
  24732. 135: uint8(_BT_OTHER),
  24733. 136: uint8(_BT_OTHER),
  24734. 137: uint8(_BT_OTHER),
  24735. 138: uint8(_BT_OTHER),
  24736. 139: uint8(_BT_OTHER),
  24737. 140: uint8(_BT_OTHER),
  24738. 141: uint8(_BT_OTHER),
  24739. 142: uint8(_BT_OTHER),
  24740. 143: uint8(_BT_OTHER),
  24741. 144: uint8(_BT_OTHER),
  24742. 145: uint8(_BT_OTHER),
  24743. 146: uint8(_BT_OTHER),
  24744. 147: uint8(_BT_OTHER),
  24745. 148: uint8(_BT_OTHER),
  24746. 149: uint8(_BT_OTHER),
  24747. 150: uint8(_BT_OTHER),
  24748. 151: uint8(_BT_OTHER),
  24749. 152: uint8(_BT_OTHER),
  24750. 153: uint8(_BT_OTHER),
  24751. 154: uint8(_BT_OTHER),
  24752. 155: uint8(_BT_OTHER),
  24753. 156: uint8(_BT_OTHER),
  24754. 157: uint8(_BT_OTHER),
  24755. 158: uint8(_BT_OTHER),
  24756. 159: uint8(_BT_OTHER),
  24757. 160: uint8(_BT_OTHER),
  24758. 161: uint8(_BT_OTHER),
  24759. 162: uint8(_BT_OTHER),
  24760. 163: uint8(_BT_OTHER),
  24761. 164: uint8(_BT_OTHER),
  24762. 165: uint8(_BT_OTHER),
  24763. 166: uint8(_BT_OTHER),
  24764. 167: uint8(_BT_OTHER),
  24765. 168: uint8(_BT_OTHER),
  24766. 169: uint8(_BT_OTHER),
  24767. 170: uint8(_BT_NMSTRT),
  24768. 171: uint8(_BT_OTHER),
  24769. 172: uint8(_BT_OTHER),
  24770. 173: uint8(_BT_OTHER),
  24771. 174: uint8(_BT_OTHER),
  24772. 175: uint8(_BT_OTHER),
  24773. 176: uint8(_BT_OTHER),
  24774. 177: uint8(_BT_OTHER),
  24775. 178: uint8(_BT_OTHER),
  24776. 179: uint8(_BT_OTHER),
  24777. 180: uint8(_BT_OTHER),
  24778. 181: uint8(_BT_NMSTRT),
  24779. 182: uint8(_BT_OTHER),
  24780. 183: uint8(_BT_NAME),
  24781. 184: uint8(_BT_OTHER),
  24782. 185: uint8(_BT_OTHER),
  24783. 186: uint8(_BT_NMSTRT),
  24784. 187: uint8(_BT_OTHER),
  24785. 188: uint8(_BT_OTHER),
  24786. 189: uint8(_BT_OTHER),
  24787. 190: uint8(_BT_OTHER),
  24788. 191: uint8(_BT_OTHER),
  24789. 192: uint8(_BT_NMSTRT),
  24790. 193: uint8(_BT_NMSTRT),
  24791. 194: uint8(_BT_NMSTRT),
  24792. 195: uint8(_BT_NMSTRT),
  24793. 196: uint8(_BT_NMSTRT),
  24794. 197: uint8(_BT_NMSTRT),
  24795. 198: uint8(_BT_NMSTRT),
  24796. 199: uint8(_BT_NMSTRT),
  24797. 200: uint8(_BT_NMSTRT),
  24798. 201: uint8(_BT_NMSTRT),
  24799. 202: uint8(_BT_NMSTRT),
  24800. 203: uint8(_BT_NMSTRT),
  24801. 204: uint8(_BT_NMSTRT),
  24802. 205: uint8(_BT_NMSTRT),
  24803. 206: uint8(_BT_NMSTRT),
  24804. 207: uint8(_BT_NMSTRT),
  24805. 208: uint8(_BT_NMSTRT),
  24806. 209: uint8(_BT_NMSTRT),
  24807. 210: uint8(_BT_NMSTRT),
  24808. 211: uint8(_BT_NMSTRT),
  24809. 212: uint8(_BT_NMSTRT),
  24810. 213: uint8(_BT_NMSTRT),
  24811. 214: uint8(_BT_NMSTRT),
  24812. 215: uint8(_BT_OTHER),
  24813. 216: uint8(_BT_NMSTRT),
  24814. 217: uint8(_BT_NMSTRT),
  24815. 218: uint8(_BT_NMSTRT),
  24816. 219: uint8(_BT_NMSTRT),
  24817. 220: uint8(_BT_NMSTRT),
  24818. 221: uint8(_BT_NMSTRT),
  24819. 222: uint8(_BT_NMSTRT),
  24820. 223: uint8(_BT_NMSTRT),
  24821. 224: uint8(_BT_NMSTRT),
  24822. 225: uint8(_BT_NMSTRT),
  24823. 226: uint8(_BT_NMSTRT),
  24824. 227: uint8(_BT_NMSTRT),
  24825. 228: uint8(_BT_NMSTRT),
  24826. 229: uint8(_BT_NMSTRT),
  24827. 230: uint8(_BT_NMSTRT),
  24828. 231: uint8(_BT_NMSTRT),
  24829. 232: uint8(_BT_NMSTRT),
  24830. 233: uint8(_BT_NMSTRT),
  24831. 234: uint8(_BT_NMSTRT),
  24832. 235: uint8(_BT_NMSTRT),
  24833. 236: uint8(_BT_NMSTRT),
  24834. 237: uint8(_BT_NMSTRT),
  24835. 238: uint8(_BT_NMSTRT),
  24836. 239: uint8(_BT_NMSTRT),
  24837. 240: uint8(_BT_NMSTRT),
  24838. 241: uint8(_BT_NMSTRT),
  24839. 242: uint8(_BT_NMSTRT),
  24840. 243: uint8(_BT_NMSTRT),
  24841. 244: uint8(_BT_NMSTRT),
  24842. 245: uint8(_BT_NMSTRT),
  24843. 246: uint8(_BT_NMSTRT),
  24844. 247: uint8(_BT_OTHER),
  24845. 248: uint8(_BT_NMSTRT),
  24846. 249: uint8(_BT_NMSTRT),
  24847. 250: uint8(_BT_NMSTRT),
  24848. 251: uint8(_BT_NMSTRT),
  24849. 252: uint8(_BT_NMSTRT),
  24850. 253: uint8(_BT_NMSTRT),
  24851. 254: uint8(_BT_NMSTRT),
  24852. 255: uint8(_BT_NMSTRT),
  24853. },
  24854. }
  24855. func init() {
  24856. p := unsafe.Pointer(&_internal_little2_encoding)
  24857. *(*uintptr)(unsafe.Add(p, 0)) = __ccgo_fp(_little2_prologTok)
  24858. *(*uintptr)(unsafe.Add(p, 8)) = __ccgo_fp(_little2_contentTok)
  24859. *(*uintptr)(unsafe.Add(p, 16)) = __ccgo_fp(_little2_cdataSectionTok)
  24860. *(*uintptr)(unsafe.Add(p, 24)) = __ccgo_fp(_little2_ignoreSectionTok)
  24861. *(*uintptr)(unsafe.Add(p, 32)) = __ccgo_fp(_little2_attributeValueTok)
  24862. *(*uintptr)(unsafe.Add(p, 40)) = __ccgo_fp(_little2_entityValueTok)
  24863. *(*uintptr)(unsafe.Add(p, 48)) = __ccgo_fp(_little2_nameMatchesAscii)
  24864. *(*uintptr)(unsafe.Add(p, 56)) = __ccgo_fp(_little2_nameLength)
  24865. *(*uintptr)(unsafe.Add(p, 64)) = __ccgo_fp(_little2_skipS)
  24866. *(*uintptr)(unsafe.Add(p, 72)) = __ccgo_fp(_little2_getAtts)
  24867. *(*uintptr)(unsafe.Add(p, 80)) = __ccgo_fp(_little2_charRefNumber)
  24868. *(*uintptr)(unsafe.Add(p, 88)) = __ccgo_fp(_little2_predefinedEntityName)
  24869. *(*uintptr)(unsafe.Add(p, 96)) = __ccgo_fp(_little2_updatePosition)
  24870. *(*uintptr)(unsafe.Add(p, 104)) = __ccgo_fp(_little2_isPublicId)
  24871. *(*uintptr)(unsafe.Add(p, 112)) = __ccgo_fp(_little2_toUtf8)
  24872. *(*uintptr)(unsafe.Add(p, 120)) = __ccgo_fp(_little2_toUtf16)
  24873. }
  24874. /* CHAR_MATCHES is guaranteed to have MINBPC bytes available. */
  24875. /* This file is included (from xmltok.c, 1-3 times depending on XML_MIN_SIZE)!
  24876. __ __ _
  24877. ___\ \/ /_ __ __ _| |_
  24878. / _ \\ /| '_ \ / _` | __|
  24879. | __// \| |_) | (_| | |_
  24880. \___/_/\_\ .__/ \__,_|\__|
  24881. |_| XML parser
  24882. Copyright (c) 1997-2000 Thai Open Source Software Center Ltd
  24883. Copyright (c) 2000 Clark Cooper <coopercc@users.sourceforge.net>
  24884. Copyright (c) 2002 Fred L. Drake, Jr. <fdrake@users.sourceforge.net>
  24885. Copyright (c) 2002-2016 Karl Waclawek <karl@waclawek.net>
  24886. Copyright (c) 2016-2022 Sebastian Pipping <sebastian@pipping.org>
  24887. Copyright (c) 2017 Rhodri James <rhodri@wildebeest.org.uk>
  24888. Copyright (c) 2018 Benjamin Peterson <benjamin@python.org>
  24889. Copyright (c) 2018 Anton Maklakov <antmak.pub@gmail.com>
  24890. Copyright (c) 2019 David Loffredo <loffredo@steptools.com>
  24891. Copyright (c) 2020 Boris Kolpackov <boris@codesynthesis.com>
  24892. Copyright (c) 2022 Martin Ettl <ettl.martin78@googlemail.com>
  24893. Licensed under the MIT license:
  24894. Permission is hereby granted, free of charge, to any person obtaining
  24895. a copy of this software and associated documentation files (the
  24896. "Software"), to deal in the Software without restriction, including
  24897. without limitation the rights to use, copy, modify, merge, publish,
  24898. distribute, sublicense, and/or sell copies of the Software, and to permit
  24899. persons to whom the Software is furnished to do so, subject to the
  24900. following conditions:
  24901. The above copyright notice and this permission notice shall be included
  24902. in all copies or substantial portions of the Software.
  24903. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  24904. EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  24905. MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
  24906. NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
  24907. DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  24908. OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
  24909. USE OR OTHER DEALINGS IN THE SOFTWARE.
  24910. */
  24911. /* ptr points to character following "<!-" */
  24912. func _big2_scanComment(tls *libc.TLS, enc uintptr, ptr uintptr, end uintptr, nextTokPtr uintptr) (r int32) {
  24913. var v1 int32
  24914. _ = v1
  24915. if int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2)) {
  24916. if !(int32(*(*int8)(unsafe.Pointer(ptr))) == 0 && int32(*(*int8)(unsafe.Pointer(ptr + 1))) == int32(m_ASCII_MINUS1)) {
  24917. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  24918. return m_XML_TOK_INVALID
  24919. }
  24920. ptr += uintptr(2)
  24921. for int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2)) {
  24922. if int32(*(*int8)(unsafe.Pointer(ptr))) == 0 {
  24923. v1 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr + 1)))))))
  24924. } else {
  24925. v1 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr)), *(*int8)(unsafe.Pointer(ptr + 1)))
  24926. }
  24927. switch v1 {
  24928. case int32(_BT_LEAD2):
  24929. if int64(end)-int64(ptr) < int64(2) {
  24930. return -int32(2)
  24931. }
  24932. if 0 != 0 {
  24933. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  24934. return m_XML_TOK_INVALID
  24935. }
  24936. ptr += uintptr(2)
  24937. case int32(_BT_LEAD3):
  24938. if int64(end)-int64(ptr) < int64(3) {
  24939. return -int32(2)
  24940. }
  24941. if 0 != 0 {
  24942. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  24943. return m_XML_TOK_INVALID
  24944. }
  24945. ptr += uintptr(3)
  24946. case int32(_BT_LEAD4):
  24947. if int64(end)-int64(ptr) < int64(4) {
  24948. return -int32(2)
  24949. }
  24950. if 0 != 0 {
  24951. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  24952. return m_XML_TOK_INVALID
  24953. }
  24954. ptr += uintptr(4)
  24955. case int32(_BT_NONXML):
  24956. fallthrough
  24957. case int32(_BT_MALFORM):
  24958. fallthrough
  24959. case int32(_BT_TRAIL):
  24960. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  24961. return m_XML_TOK_INVALID
  24962. case int32(_BT_MINUS):
  24963. ptr += uintptr(2)
  24964. if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
  24965. return -int32(1)
  24966. }
  24967. if int32(*(*int8)(unsafe.Pointer(ptr))) == 0 && int32(*(*int8)(unsafe.Pointer(ptr + 1))) == int32(m_ASCII_MINUS1) {
  24968. ptr += uintptr(2)
  24969. if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
  24970. return -int32(1)
  24971. }
  24972. if !(int32(*(*int8)(unsafe.Pointer(ptr))) == 0 && int32(*(*int8)(unsafe.Pointer(ptr + 1))) == int32(m_ASCII_GT1)) {
  24973. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  24974. return m_XML_TOK_INVALID
  24975. }
  24976. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(2)
  24977. return int32(m_XML_TOK_COMMENT)
  24978. }
  24979. default:
  24980. ptr += uintptr(2)
  24981. break
  24982. }
  24983. }
  24984. }
  24985. return -int32(1)
  24986. }
  24987. /* ptr points to character following "<!" */
  24988. func _big2_scanDecl(tls *libc.TLS, enc uintptr, ptr uintptr, end uintptr, nextTokPtr uintptr) (r int32) {
  24989. var v1, v2, v3 int32
  24990. _, _, _ = v1, v2, v3
  24991. if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
  24992. return -int32(1)
  24993. }
  24994. if int32(*(*int8)(unsafe.Pointer(ptr))) == 0 {
  24995. v1 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr + 1)))))))
  24996. } else {
  24997. v1 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr)), *(*int8)(unsafe.Pointer(ptr + 1)))
  24998. }
  24999. switch v1 {
  25000. case int32(_BT_MINUS):
  25001. return _big2_scanComment(tls, enc, ptr+uintptr(2), end, nextTokPtr)
  25002. case int32(_BT_LSQB):
  25003. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(2)
  25004. return int32(m_XML_TOK_COND_SECT_OPEN)
  25005. case int32(_BT_NMSTRT):
  25006. fallthrough
  25007. case int32(_BT_HEX):
  25008. ptr += uintptr(2)
  25009. default:
  25010. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  25011. return m_XML_TOK_INVALID
  25012. }
  25013. for int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2)) {
  25014. if int32(*(*int8)(unsafe.Pointer(ptr))) == 0 {
  25015. v2 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr + 1)))))))
  25016. } else {
  25017. v2 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr)), *(*int8)(unsafe.Pointer(ptr + 1)))
  25018. }
  25019. switch v2 {
  25020. case int32(_BT_PERCNT):
  25021. if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(2)*libc.Int32FromInt32(2))) {
  25022. return -int32(1)
  25023. }
  25024. /* don't allow <!ENTITY% foo "whatever"> */
  25025. if int32(*(*int8)(unsafe.Pointer(ptr + libc.UintptrFromInt32(2)))) == 0 {
  25026. v3 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr + libc.UintptrFromInt32(2) + 1)))))))
  25027. } else {
  25028. v3 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr + libc.UintptrFromInt32(2))), *(*int8)(unsafe.Pointer(ptr + libc.UintptrFromInt32(2) + 1)))
  25029. }
  25030. switch v3 {
  25031. case int32(_BT_S):
  25032. fallthrough
  25033. case int32(_BT_CR):
  25034. fallthrough
  25035. case int32(_BT_LF):
  25036. fallthrough
  25037. case int32(_BT_PERCNT):
  25038. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  25039. return m_XML_TOK_INVALID
  25040. }
  25041. /* fall through */
  25042. fallthrough
  25043. case int32(_BT_S):
  25044. fallthrough
  25045. case int32(_BT_CR):
  25046. fallthrough
  25047. case int32(_BT_LF):
  25048. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  25049. return int32(m_XML_TOK_DECL_OPEN)
  25050. case int32(_BT_NMSTRT):
  25051. fallthrough
  25052. case int32(_BT_HEX):
  25053. ptr += uintptr(2)
  25054. default:
  25055. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  25056. return m_XML_TOK_INVALID
  25057. }
  25058. }
  25059. return -int32(1)
  25060. }
  25061. func _big2_checkPiTarget(tls *libc.TLS, enc uintptr, ptr uintptr, end uintptr, tokPtr uintptr) (r int32) {
  25062. var upper, v1, v2, v3 int32
  25063. _, _, _, _ = upper, v1, v2, v3
  25064. upper = 0
  25065. _ = enc
  25066. *(*int32)(unsafe.Pointer(tokPtr)) = int32(m_XML_TOK_PI)
  25067. if int64(end)-int64(ptr) != int64(libc.Int32FromInt32(2)*libc.Int32FromInt32(3)) {
  25068. return int32(1)
  25069. }
  25070. if int32(*(*int8)(unsafe.Pointer(ptr))) == 0 {
  25071. v1 = int32(*(*int8)(unsafe.Pointer(ptr + 1)))
  25072. } else {
  25073. v1 = -int32(1)
  25074. }
  25075. switch v1 {
  25076. case int32(m_ASCII_x2):
  25077. case int32(m_ASCII_X):
  25078. upper = int32(1)
  25079. default:
  25080. return int32(1)
  25081. }
  25082. ptr += uintptr(2)
  25083. if int32(*(*int8)(unsafe.Pointer(ptr))) == 0 {
  25084. v2 = int32(*(*int8)(unsafe.Pointer(ptr + 1)))
  25085. } else {
  25086. v2 = -int32(1)
  25087. }
  25088. switch v2 {
  25089. case int32(m_ASCII_m2):
  25090. case int32(m_ASCII_M):
  25091. upper = int32(1)
  25092. default:
  25093. return int32(1)
  25094. }
  25095. ptr += uintptr(2)
  25096. if int32(*(*int8)(unsafe.Pointer(ptr))) == 0 {
  25097. v3 = int32(*(*int8)(unsafe.Pointer(ptr + 1)))
  25098. } else {
  25099. v3 = -int32(1)
  25100. }
  25101. switch v3 {
  25102. case int32(m_ASCII_l2):
  25103. case int32(m_ASCII_L):
  25104. upper = int32(1)
  25105. default:
  25106. return int32(1)
  25107. }
  25108. if upper != 0 {
  25109. return 0
  25110. }
  25111. *(*int32)(unsafe.Pointer(tokPtr)) = int32(m_XML_TOK_XML_DECL)
  25112. return int32(1)
  25113. }
  25114. /* ptr points to character following "<?" */
  25115. func _big2_scanPi(tls *libc.TLS, enc uintptr, ptr uintptr, end uintptr, nextTokPtr uintptr) (r int32) {
  25116. bp := tls.Alloc(16)
  25117. defer tls.Free(16)
  25118. var target uintptr
  25119. var v1, v2, v3 int32
  25120. var _ /* tok at bp+0 */ int32
  25121. _, _, _, _ = target, v1, v2, v3
  25122. target = ptr
  25123. if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
  25124. return -int32(1)
  25125. }
  25126. if int32(*(*int8)(unsafe.Pointer(ptr))) == 0 {
  25127. v1 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr + 1)))))))
  25128. } else {
  25129. v1 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr)), *(*int8)(unsafe.Pointer(ptr + 1)))
  25130. }
  25131. switch v1 {
  25132. case int32(_BT_NONASCII):
  25133. if !(_namingBitmap[libc.Int32FromUint8(_nmstrtPages[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr)))])<<int32(3)+libc.Int32FromUint8(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr + 1))))>>int32(5)]&(libc.Uint32FromUint32(1)<<(libc.Int32FromUint8(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr + 1))))&libc.Int32FromInt32(0x1F))) != 0) {
  25134. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  25135. return m_XML_TOK_INVALID
  25136. } /* fall through */
  25137. fallthrough
  25138. case int32(_BT_NMSTRT):
  25139. fallthrough
  25140. case int32(_BT_HEX):
  25141. ptr += uintptr(2)
  25142. case int32(_BT_LEAD2):
  25143. if int64(end)-int64(ptr) < int64(libc.Int32FromInt32(2)) {
  25144. return -int32(2)
  25145. }
  25146. if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
  25147. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  25148. return m_XML_TOK_INVALID
  25149. }
  25150. ptr += uintptr(2)
  25151. case int32(_BT_LEAD3):
  25152. if int64(end)-int64(ptr) < int64(libc.Int32FromInt32(3)) {
  25153. return -int32(2)
  25154. }
  25155. if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
  25156. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  25157. return m_XML_TOK_INVALID
  25158. }
  25159. ptr += uintptr(3)
  25160. case int32(_BT_LEAD4):
  25161. if int64(end)-int64(ptr) < int64(libc.Int32FromInt32(4)) {
  25162. return -int32(2)
  25163. }
  25164. if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
  25165. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  25166. return m_XML_TOK_INVALID
  25167. }
  25168. ptr += uintptr(4)
  25169. default:
  25170. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  25171. return m_XML_TOK_INVALID
  25172. }
  25173. for int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2)) {
  25174. if int32(*(*int8)(unsafe.Pointer(ptr))) == 0 {
  25175. v2 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr + 1)))))))
  25176. } else {
  25177. v2 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr)), *(*int8)(unsafe.Pointer(ptr + 1)))
  25178. }
  25179. switch v2 {
  25180. case int32(_BT_NONASCII):
  25181. if !(_namingBitmap[libc.Int32FromUint8(_namePages[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr)))])<<int32(3)+libc.Int32FromUint8(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr + 1))))>>int32(5)]&(libc.Uint32FromUint32(1)<<(libc.Int32FromUint8(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr + 1))))&libc.Int32FromInt32(0x1F))) != 0) {
  25182. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  25183. return m_XML_TOK_INVALID
  25184. } /* fall through */
  25185. fallthrough
  25186. case int32(_BT_NMSTRT):
  25187. fallthrough
  25188. case int32(_BT_HEX):
  25189. fallthrough
  25190. case int32(_BT_DIGIT):
  25191. fallthrough
  25192. case int32(_BT_NAME):
  25193. fallthrough
  25194. case int32(_BT_MINUS):
  25195. ptr += uintptr(2)
  25196. case int32(_BT_LEAD2):
  25197. if int64(end)-int64(ptr) < int64(2) {
  25198. return -int32(2)
  25199. }
  25200. if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
  25201. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  25202. return m_XML_TOK_INVALID
  25203. }
  25204. ptr += uintptr(2)
  25205. case int32(_BT_LEAD3):
  25206. if int64(end)-int64(ptr) < int64(3) {
  25207. return -int32(2)
  25208. }
  25209. if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
  25210. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  25211. return m_XML_TOK_INVALID
  25212. }
  25213. ptr += uintptr(3)
  25214. case int32(_BT_LEAD4):
  25215. if int64(end)-int64(ptr) < int64(4) {
  25216. return -int32(2)
  25217. }
  25218. if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
  25219. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  25220. return m_XML_TOK_INVALID
  25221. }
  25222. ptr += uintptr(4)
  25223. case int32(_BT_S):
  25224. fallthrough
  25225. case int32(_BT_CR):
  25226. fallthrough
  25227. case int32(_BT_LF):
  25228. if !(_big2_checkPiTarget(tls, enc, target, ptr, bp) != 0) {
  25229. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  25230. return m_XML_TOK_INVALID
  25231. }
  25232. ptr += uintptr(2)
  25233. for int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2)) {
  25234. if int32(*(*int8)(unsafe.Pointer(ptr))) == 0 {
  25235. v3 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr + 1)))))))
  25236. } else {
  25237. v3 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr)), *(*int8)(unsafe.Pointer(ptr + 1)))
  25238. }
  25239. switch v3 {
  25240. case int32(_BT_LEAD2):
  25241. if int64(end)-int64(ptr) < int64(2) {
  25242. return -int32(2)
  25243. }
  25244. if 0 != 0 {
  25245. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  25246. return m_XML_TOK_INVALID
  25247. }
  25248. ptr += uintptr(2)
  25249. case int32(_BT_LEAD3):
  25250. if int64(end)-int64(ptr) < int64(3) {
  25251. return -int32(2)
  25252. }
  25253. if 0 != 0 {
  25254. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  25255. return m_XML_TOK_INVALID
  25256. }
  25257. ptr += uintptr(3)
  25258. case int32(_BT_LEAD4):
  25259. if int64(end)-int64(ptr) < int64(4) {
  25260. return -int32(2)
  25261. }
  25262. if 0 != 0 {
  25263. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  25264. return m_XML_TOK_INVALID
  25265. }
  25266. ptr += uintptr(4)
  25267. case int32(_BT_NONXML):
  25268. fallthrough
  25269. case int32(_BT_MALFORM):
  25270. fallthrough
  25271. case int32(_BT_TRAIL):
  25272. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  25273. return m_XML_TOK_INVALID
  25274. case int32(_BT_QUEST):
  25275. ptr += uintptr(2)
  25276. if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
  25277. return -int32(1)
  25278. }
  25279. if int32(*(*int8)(unsafe.Pointer(ptr))) == 0 && int32(*(*int8)(unsafe.Pointer(ptr + 1))) == int32(m_ASCII_GT1) {
  25280. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(2)
  25281. return *(*int32)(unsafe.Pointer(bp))
  25282. }
  25283. default:
  25284. ptr += uintptr(2)
  25285. break
  25286. }
  25287. }
  25288. return -int32(1)
  25289. case int32(_BT_QUEST):
  25290. if !(_big2_checkPiTarget(tls, enc, target, ptr, bp) != 0) {
  25291. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  25292. return m_XML_TOK_INVALID
  25293. }
  25294. ptr += uintptr(2)
  25295. if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
  25296. return -int32(1)
  25297. }
  25298. if int32(*(*int8)(unsafe.Pointer(ptr))) == 0 && int32(*(*int8)(unsafe.Pointer(ptr + 1))) == int32(m_ASCII_GT1) {
  25299. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(2)
  25300. return *(*int32)(unsafe.Pointer(bp))
  25301. }
  25302. /* fall through */
  25303. fallthrough
  25304. default:
  25305. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  25306. return m_XML_TOK_INVALID
  25307. }
  25308. }
  25309. return -int32(1)
  25310. }
  25311. func _big2_scanCdataSection(tls *libc.TLS, enc uintptr, ptr uintptr, end uintptr, nextTokPtr uintptr) (r int32) {
  25312. var i int32
  25313. _ = i
  25314. _ = enc
  25315. /* CDATA[ */
  25316. if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(6)*libc.Int32FromInt32(2))) {
  25317. return -int32(1)
  25318. }
  25319. i = 0
  25320. for {
  25321. if !(i < int32(6)) {
  25322. break
  25323. }
  25324. if !(int32(*(*int8)(unsafe.Pointer(ptr))) == 0 && int32(*(*int8)(unsafe.Pointer(ptr + 1))) == int32(_CDATA_LSQB2[i])) {
  25325. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  25326. return m_XML_TOK_INVALID
  25327. }
  25328. goto _1
  25329. _1:
  25330. ;
  25331. i++
  25332. ptr += uintptr(2)
  25333. }
  25334. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  25335. return int32(m_XML_TOK_CDATA_SECT_OPEN)
  25336. }
  25337. var _CDATA_LSQB2 = [6]int8{
  25338. 0: int8(m_ASCII_C),
  25339. 1: int8(m_ASCII_D),
  25340. 2: int8(m_ASCII_A),
  25341. 3: int8(m_ASCII_T),
  25342. 4: int8(m_ASCII_A),
  25343. 5: int8(m_ASCII_LSQB1),
  25344. }
  25345. func _big2_cdataSectionTok(tls *libc.TLS, enc uintptr, ptr uintptr, end uintptr, nextTokPtr uintptr) (r int32) {
  25346. var n Tsize_t
  25347. var v1, v2, v3 int32
  25348. _, _, _, _ = n, v1, v2, v3
  25349. if ptr >= end {
  25350. return -int32(4)
  25351. }
  25352. if int32(2) > int32(1) {
  25353. n = libc.Uint64FromInt64(int64(end) - int64(ptr))
  25354. if n&libc.Uint64FromInt32(libc.Int32FromInt32(2)-libc.Int32FromInt32(1)) != 0 {
  25355. n &= libc.Uint64FromInt32(^(libc.Int32FromInt32(2) - libc.Int32FromInt32(1)))
  25356. if n == uint64(0) {
  25357. return -int32(1)
  25358. }
  25359. end = ptr + uintptr(n)
  25360. }
  25361. }
  25362. if int32(*(*int8)(unsafe.Pointer(ptr))) == 0 {
  25363. v1 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr + 1)))))))
  25364. } else {
  25365. v1 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr)), *(*int8)(unsafe.Pointer(ptr + 1)))
  25366. }
  25367. switch v1 {
  25368. case int32(_BT_RSQB):
  25369. ptr += uintptr(2)
  25370. if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
  25371. return -int32(1)
  25372. }
  25373. if !(int32(*(*int8)(unsafe.Pointer(ptr))) == 0 && int32(*(*int8)(unsafe.Pointer(ptr + 1))) == int32(m_ASCII_RSQB1)) {
  25374. break
  25375. }
  25376. ptr += uintptr(2)
  25377. if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
  25378. return -int32(1)
  25379. }
  25380. if !(int32(*(*int8)(unsafe.Pointer(ptr))) == 0 && int32(*(*int8)(unsafe.Pointer(ptr + 1))) == int32(m_ASCII_GT1)) {
  25381. ptr -= uintptr(2)
  25382. break
  25383. }
  25384. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(2)
  25385. return int32(m_XML_TOK_CDATA_SECT_CLOSE)
  25386. case int32(_BT_CR):
  25387. ptr += uintptr(2)
  25388. if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
  25389. return -int32(1)
  25390. }
  25391. if int32(*(*int8)(unsafe.Pointer(ptr))) == 0 {
  25392. v2 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr + 1)))))))
  25393. } else {
  25394. v2 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr)), *(*int8)(unsafe.Pointer(ptr + 1)))
  25395. }
  25396. if v2 == int32(_BT_LF) {
  25397. ptr += uintptr(2)
  25398. }
  25399. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  25400. return int32(m_XML_TOK_DATA_NEWLINE)
  25401. case int32(_BT_LF):
  25402. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(2)
  25403. return int32(m_XML_TOK_DATA_NEWLINE)
  25404. case int32(_BT_LEAD2):
  25405. if int64(end)-int64(ptr) < int64(2) {
  25406. return -int32(2)
  25407. }
  25408. if 0 != 0 {
  25409. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  25410. return m_XML_TOK_INVALID
  25411. }
  25412. ptr += uintptr(2)
  25413. case int32(_BT_LEAD3):
  25414. if int64(end)-int64(ptr) < int64(3) {
  25415. return -int32(2)
  25416. }
  25417. if 0 != 0 {
  25418. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  25419. return m_XML_TOK_INVALID
  25420. }
  25421. ptr += uintptr(3)
  25422. case int32(_BT_LEAD4):
  25423. if int64(end)-int64(ptr) < int64(4) {
  25424. return -int32(2)
  25425. }
  25426. if 0 != 0 {
  25427. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  25428. return m_XML_TOK_INVALID
  25429. }
  25430. ptr += uintptr(4)
  25431. case int32(_BT_NONXML):
  25432. fallthrough
  25433. case int32(_BT_MALFORM):
  25434. fallthrough
  25435. case int32(_BT_TRAIL):
  25436. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  25437. return m_XML_TOK_INVALID
  25438. default:
  25439. ptr += uintptr(2)
  25440. break
  25441. }
  25442. for int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2)) {
  25443. if int32(*(*int8)(unsafe.Pointer(ptr))) == 0 {
  25444. v3 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr + 1)))))))
  25445. } else {
  25446. v3 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr)), *(*int8)(unsafe.Pointer(ptr + 1)))
  25447. }
  25448. switch v3 {
  25449. case int32(_BT_LEAD2):
  25450. if int64(end)-int64(ptr) < int64(2) || libc.Bool(0 != 0) {
  25451. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  25452. return int32(m_XML_TOK_DATA_CHARS)
  25453. }
  25454. ptr += uintptr(2)
  25455. case int32(_BT_LEAD3):
  25456. if int64(end)-int64(ptr) < int64(3) || libc.Bool(0 != 0) {
  25457. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  25458. return int32(m_XML_TOK_DATA_CHARS)
  25459. }
  25460. ptr += uintptr(3)
  25461. case int32(_BT_LEAD4):
  25462. if int64(end)-int64(ptr) < int64(4) || libc.Bool(0 != 0) {
  25463. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  25464. return int32(m_XML_TOK_DATA_CHARS)
  25465. }
  25466. ptr += uintptr(4)
  25467. case int32(_BT_NONXML):
  25468. fallthrough
  25469. case int32(_BT_MALFORM):
  25470. fallthrough
  25471. case int32(_BT_TRAIL):
  25472. fallthrough
  25473. case int32(_BT_CR):
  25474. fallthrough
  25475. case int32(_BT_LF):
  25476. fallthrough
  25477. case int32(_BT_RSQB):
  25478. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  25479. return int32(m_XML_TOK_DATA_CHARS)
  25480. default:
  25481. ptr += uintptr(2)
  25482. break
  25483. }
  25484. }
  25485. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  25486. return int32(m_XML_TOK_DATA_CHARS)
  25487. }
  25488. /* ptr points to character following "</" */
  25489. func _big2_scanEndTag(tls *libc.TLS, enc uintptr, ptr uintptr, end uintptr, nextTokPtr uintptr) (r int32) {
  25490. var v1, v2, v22 int32
  25491. _, _, _ = v1, v2, v22
  25492. if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
  25493. return -int32(1)
  25494. }
  25495. if int32(*(*int8)(unsafe.Pointer(ptr))) == 0 {
  25496. v1 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr + 1)))))))
  25497. } else {
  25498. v1 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr)), *(*int8)(unsafe.Pointer(ptr + 1)))
  25499. }
  25500. switch v1 {
  25501. case int32(_BT_NONASCII):
  25502. if !(_namingBitmap[libc.Int32FromUint8(_nmstrtPages[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr)))])<<int32(3)+libc.Int32FromUint8(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr + 1))))>>int32(5)]&(libc.Uint32FromUint32(1)<<(libc.Int32FromUint8(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr + 1))))&libc.Int32FromInt32(0x1F))) != 0) {
  25503. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  25504. return m_XML_TOK_INVALID
  25505. } /* fall through */
  25506. fallthrough
  25507. case int32(_BT_NMSTRT):
  25508. fallthrough
  25509. case int32(_BT_HEX):
  25510. ptr += uintptr(2)
  25511. case int32(_BT_LEAD2):
  25512. if int64(end)-int64(ptr) < int64(libc.Int32FromInt32(2)) {
  25513. return -int32(2)
  25514. }
  25515. if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
  25516. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  25517. return m_XML_TOK_INVALID
  25518. }
  25519. ptr += uintptr(2)
  25520. case int32(_BT_LEAD3):
  25521. if int64(end)-int64(ptr) < int64(libc.Int32FromInt32(3)) {
  25522. return -int32(2)
  25523. }
  25524. if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
  25525. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  25526. return m_XML_TOK_INVALID
  25527. }
  25528. ptr += uintptr(3)
  25529. case int32(_BT_LEAD4):
  25530. if int64(end)-int64(ptr) < int64(libc.Int32FromInt32(4)) {
  25531. return -int32(2)
  25532. }
  25533. if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
  25534. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  25535. return m_XML_TOK_INVALID
  25536. }
  25537. ptr += uintptr(4)
  25538. default:
  25539. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  25540. return m_XML_TOK_INVALID
  25541. }
  25542. for int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2)) {
  25543. if int32(*(*int8)(unsafe.Pointer(ptr))) == 0 {
  25544. v2 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr + 1)))))))
  25545. } else {
  25546. v2 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr)), *(*int8)(unsafe.Pointer(ptr + 1)))
  25547. }
  25548. switch v2 {
  25549. case int32(_BT_NONASCII):
  25550. goto _3
  25551. case int32(_BT_MINUS):
  25552. goto _4
  25553. case int32(_BT_NAME):
  25554. goto _5
  25555. case int32(_BT_DIGIT):
  25556. goto _6
  25557. case int32(_BT_HEX):
  25558. goto _7
  25559. case int32(_BT_NMSTRT):
  25560. goto _8
  25561. case int32(_BT_LEAD2):
  25562. goto _9
  25563. case int32(_BT_LEAD3):
  25564. goto _10
  25565. case int32(_BT_LEAD4):
  25566. goto _11
  25567. case int32(_BT_LF):
  25568. goto _12
  25569. case int32(_BT_CR):
  25570. goto _13
  25571. case int32(_BT_S):
  25572. goto _14
  25573. case int32(_BT_COLON):
  25574. goto _15
  25575. case int32(_BT_GT):
  25576. goto _16
  25577. default:
  25578. goto _17
  25579. }
  25580. goto _18
  25581. _3:
  25582. ;
  25583. if !(_namingBitmap[libc.Int32FromUint8(_namePages[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr)))])<<int32(3)+libc.Int32FromUint8(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr + 1))))>>int32(5)]&(libc.Uint32FromUint32(1)<<(libc.Int32FromUint8(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr + 1))))&libc.Int32FromInt32(0x1F))) != 0) {
  25584. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  25585. return m_XML_TOK_INVALID
  25586. } /* fall through */
  25587. _8:
  25588. ;
  25589. _7:
  25590. ;
  25591. _6:
  25592. ;
  25593. _5:
  25594. ;
  25595. _4:
  25596. ;
  25597. ptr += uintptr(2)
  25598. goto _18
  25599. _9:
  25600. ;
  25601. if int64(end)-int64(ptr) < int64(2) {
  25602. return -int32(2)
  25603. }
  25604. if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
  25605. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  25606. return m_XML_TOK_INVALID
  25607. }
  25608. ptr += uintptr(2)
  25609. goto _18
  25610. _10:
  25611. ;
  25612. if int64(end)-int64(ptr) < int64(3) {
  25613. return -int32(2)
  25614. }
  25615. if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
  25616. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  25617. return m_XML_TOK_INVALID
  25618. }
  25619. ptr += uintptr(3)
  25620. goto _18
  25621. _11:
  25622. ;
  25623. if int64(end)-int64(ptr) < int64(4) {
  25624. return -int32(2)
  25625. }
  25626. if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
  25627. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  25628. return m_XML_TOK_INVALID
  25629. }
  25630. ptr += uintptr(4)
  25631. goto _18
  25632. _14:
  25633. ;
  25634. _13:
  25635. ;
  25636. _12:
  25637. ;
  25638. ptr += uintptr(2)
  25639. _21:
  25640. ;
  25641. if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
  25642. goto _19
  25643. }
  25644. if int32(*(*int8)(unsafe.Pointer(ptr))) == 0 {
  25645. v22 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr + 1)))))))
  25646. } else {
  25647. v22 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr)), *(*int8)(unsafe.Pointer(ptr + 1)))
  25648. }
  25649. switch v22 {
  25650. case int32(_BT_S):
  25651. fallthrough
  25652. case int32(_BT_CR):
  25653. fallthrough
  25654. case int32(_BT_LF):
  25655. case int32(_BT_GT):
  25656. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(2)
  25657. return int32(m_XML_TOK_END_TAG)
  25658. default:
  25659. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  25660. return m_XML_TOK_INVALID
  25661. }
  25662. goto _20
  25663. _20:
  25664. ;
  25665. ptr += uintptr(2)
  25666. goto _21
  25667. goto _19
  25668. _19:
  25669. ;
  25670. return -int32(1)
  25671. _15:
  25672. ;
  25673. /* no need to check qname syntax here,
  25674. since end-tag must match exactly */
  25675. ptr += uintptr(2)
  25676. goto _18
  25677. _16:
  25678. ;
  25679. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(2)
  25680. return int32(m_XML_TOK_END_TAG)
  25681. _17:
  25682. ;
  25683. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  25684. return m_XML_TOK_INVALID
  25685. _18:
  25686. }
  25687. return -int32(1)
  25688. }
  25689. /* ptr points to character following "&#X" */
  25690. func _big2_scanHexCharRef(tls *libc.TLS, enc uintptr, ptr uintptr, end uintptr, nextTokPtr uintptr) (r int32) {
  25691. var v1, v3 int32
  25692. _, _ = v1, v3
  25693. if int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2)) {
  25694. if int32(*(*int8)(unsafe.Pointer(ptr))) == 0 {
  25695. v1 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr + 1)))))))
  25696. } else {
  25697. v1 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr)), *(*int8)(unsafe.Pointer(ptr + 1)))
  25698. }
  25699. switch v1 {
  25700. case int32(_BT_DIGIT):
  25701. fallthrough
  25702. case int32(_BT_HEX):
  25703. default:
  25704. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  25705. return m_XML_TOK_INVALID
  25706. }
  25707. ptr += uintptr(2)
  25708. for {
  25709. if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
  25710. break
  25711. }
  25712. if int32(*(*int8)(unsafe.Pointer(ptr))) == 0 {
  25713. v3 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr + 1)))))))
  25714. } else {
  25715. v3 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr)), *(*int8)(unsafe.Pointer(ptr + 1)))
  25716. }
  25717. switch v3 {
  25718. case int32(_BT_DIGIT):
  25719. fallthrough
  25720. case int32(_BT_HEX):
  25721. case int32(_BT_SEMI):
  25722. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(2)
  25723. return int32(m_XML_TOK_CHAR_REF)
  25724. default:
  25725. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  25726. return m_XML_TOK_INVALID
  25727. }
  25728. goto _2
  25729. _2:
  25730. ;
  25731. ptr += uintptr(2)
  25732. }
  25733. }
  25734. return -int32(1)
  25735. }
  25736. /* ptr points to character following "&#" */
  25737. func _big2_scanCharRef(tls *libc.TLS, enc uintptr, ptr uintptr, end uintptr, nextTokPtr uintptr) (r int32) {
  25738. var v1, v3 int32
  25739. _, _ = v1, v3
  25740. if int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2)) {
  25741. if int32(*(*int8)(unsafe.Pointer(ptr))) == 0 && int32(*(*int8)(unsafe.Pointer(ptr + 1))) == int32(m_ASCII_x2) {
  25742. return _big2_scanHexCharRef(tls, enc, ptr+uintptr(2), end, nextTokPtr)
  25743. }
  25744. if int32(*(*int8)(unsafe.Pointer(ptr))) == 0 {
  25745. v1 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr + 1)))))))
  25746. } else {
  25747. v1 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr)), *(*int8)(unsafe.Pointer(ptr + 1)))
  25748. }
  25749. switch v1 {
  25750. case int32(_BT_DIGIT):
  25751. default:
  25752. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  25753. return m_XML_TOK_INVALID
  25754. }
  25755. ptr += uintptr(2)
  25756. for {
  25757. if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
  25758. break
  25759. }
  25760. if int32(*(*int8)(unsafe.Pointer(ptr))) == 0 {
  25761. v3 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr + 1)))))))
  25762. } else {
  25763. v3 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr)), *(*int8)(unsafe.Pointer(ptr + 1)))
  25764. }
  25765. switch v3 {
  25766. case int32(_BT_DIGIT):
  25767. case int32(_BT_SEMI):
  25768. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(2)
  25769. return int32(m_XML_TOK_CHAR_REF)
  25770. default:
  25771. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  25772. return m_XML_TOK_INVALID
  25773. }
  25774. goto _2
  25775. _2:
  25776. ;
  25777. ptr += uintptr(2)
  25778. }
  25779. }
  25780. return -int32(1)
  25781. }
  25782. /* ptr points to character following "&" */
  25783. func _big2_scanRef(tls *libc.TLS, enc uintptr, ptr uintptr, end uintptr, nextTokPtr uintptr) (r int32) {
  25784. var v1, v2 int32
  25785. _, _ = v1, v2
  25786. if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
  25787. return -int32(1)
  25788. }
  25789. if int32(*(*int8)(unsafe.Pointer(ptr))) == 0 {
  25790. v1 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr + 1)))))))
  25791. } else {
  25792. v1 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr)), *(*int8)(unsafe.Pointer(ptr + 1)))
  25793. }
  25794. switch v1 {
  25795. case int32(_BT_NONASCII):
  25796. if !(_namingBitmap[libc.Int32FromUint8(_nmstrtPages[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr)))])<<int32(3)+libc.Int32FromUint8(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr + 1))))>>int32(5)]&(libc.Uint32FromUint32(1)<<(libc.Int32FromUint8(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr + 1))))&libc.Int32FromInt32(0x1F))) != 0) {
  25797. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  25798. return m_XML_TOK_INVALID
  25799. } /* fall through */
  25800. fallthrough
  25801. case int32(_BT_NMSTRT):
  25802. fallthrough
  25803. case int32(_BT_HEX):
  25804. ptr += uintptr(2)
  25805. case int32(_BT_LEAD2):
  25806. if int64(end)-int64(ptr) < int64(libc.Int32FromInt32(2)) {
  25807. return -int32(2)
  25808. }
  25809. if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
  25810. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  25811. return m_XML_TOK_INVALID
  25812. }
  25813. ptr += uintptr(2)
  25814. case int32(_BT_LEAD3):
  25815. if int64(end)-int64(ptr) < int64(libc.Int32FromInt32(3)) {
  25816. return -int32(2)
  25817. }
  25818. if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
  25819. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  25820. return m_XML_TOK_INVALID
  25821. }
  25822. ptr += uintptr(3)
  25823. case int32(_BT_LEAD4):
  25824. if int64(end)-int64(ptr) < int64(libc.Int32FromInt32(4)) {
  25825. return -int32(2)
  25826. }
  25827. if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
  25828. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  25829. return m_XML_TOK_INVALID
  25830. }
  25831. ptr += uintptr(4)
  25832. case int32(_BT_NUM):
  25833. return _big2_scanCharRef(tls, enc, ptr+uintptr(2), end, nextTokPtr)
  25834. default:
  25835. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  25836. return m_XML_TOK_INVALID
  25837. }
  25838. for int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2)) {
  25839. if int32(*(*int8)(unsafe.Pointer(ptr))) == 0 {
  25840. v2 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr + 1)))))))
  25841. } else {
  25842. v2 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr)), *(*int8)(unsafe.Pointer(ptr + 1)))
  25843. }
  25844. switch v2 {
  25845. case int32(_BT_NONASCII):
  25846. if !(_namingBitmap[libc.Int32FromUint8(_namePages[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr)))])<<int32(3)+libc.Int32FromUint8(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr + 1))))>>int32(5)]&(libc.Uint32FromUint32(1)<<(libc.Int32FromUint8(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr + 1))))&libc.Int32FromInt32(0x1F))) != 0) {
  25847. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  25848. return m_XML_TOK_INVALID
  25849. } /* fall through */
  25850. fallthrough
  25851. case int32(_BT_NMSTRT):
  25852. fallthrough
  25853. case int32(_BT_HEX):
  25854. fallthrough
  25855. case int32(_BT_DIGIT):
  25856. fallthrough
  25857. case int32(_BT_NAME):
  25858. fallthrough
  25859. case int32(_BT_MINUS):
  25860. ptr += uintptr(2)
  25861. case int32(_BT_LEAD2):
  25862. if int64(end)-int64(ptr) < int64(2) {
  25863. return -int32(2)
  25864. }
  25865. if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
  25866. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  25867. return m_XML_TOK_INVALID
  25868. }
  25869. ptr += uintptr(2)
  25870. case int32(_BT_LEAD3):
  25871. if int64(end)-int64(ptr) < int64(3) {
  25872. return -int32(2)
  25873. }
  25874. if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
  25875. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  25876. return m_XML_TOK_INVALID
  25877. }
  25878. ptr += uintptr(3)
  25879. case int32(_BT_LEAD4):
  25880. if int64(end)-int64(ptr) < int64(4) {
  25881. return -int32(2)
  25882. }
  25883. if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
  25884. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  25885. return m_XML_TOK_INVALID
  25886. }
  25887. ptr += uintptr(4)
  25888. case int32(_BT_SEMI):
  25889. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(2)
  25890. return int32(m_XML_TOK_ENTITY_REF)
  25891. default:
  25892. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  25893. return m_XML_TOK_INVALID
  25894. }
  25895. }
  25896. return -int32(1)
  25897. }
  25898. /* ptr points to character following first character of attribute name */
  25899. func _big2_scanAtts(tls *libc.TLS, enc uintptr, _ptr uintptr, end uintptr, nextTokPtr uintptr) (r int32) {
  25900. bp := tls.Alloc(16)
  25901. defer tls.Free(16)
  25902. *(*uintptr)(unsafe.Pointer(bp)) = _ptr
  25903. var hadColon, open, t, t1, tok, v1, v18, v22, v24, v26, v27, v31 int32
  25904. _, _, _, _, _, _, _, _, _, _, _, _ = hadColon, open, t, t1, tok, v1, v18, v22, v24, v26, v27, v31
  25905. hadColon = 0
  25906. for int64(end)-int64(*(*uintptr)(unsafe.Pointer(bp))) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2)) {
  25907. if int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp))))) == 0 {
  25908. v1 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 1)))))))
  25909. } else {
  25910. v1 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))), *(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 1)))
  25911. }
  25912. switch v1 {
  25913. case int32(_BT_NONASCII):
  25914. goto _2
  25915. case int32(_BT_MINUS):
  25916. goto _3
  25917. case int32(_BT_NAME):
  25918. goto _4
  25919. case int32(_BT_DIGIT):
  25920. goto _5
  25921. case int32(_BT_HEX):
  25922. goto _6
  25923. case int32(_BT_NMSTRT):
  25924. goto _7
  25925. case int32(_BT_LEAD2):
  25926. goto _8
  25927. case int32(_BT_LEAD3):
  25928. goto _9
  25929. case int32(_BT_LEAD4):
  25930. goto _10
  25931. case int32(_BT_COLON):
  25932. goto _11
  25933. case int32(_BT_LF):
  25934. goto _12
  25935. case int32(_BT_CR):
  25936. goto _13
  25937. case int32(_BT_S):
  25938. goto _14
  25939. case int32(_BT_EQUALS):
  25940. goto _15
  25941. default:
  25942. goto _16
  25943. }
  25944. goto _17
  25945. _2:
  25946. ;
  25947. if !(_namingBitmap[libc.Int32FromUint8(_namePages[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))))])<<int32(3)+libc.Int32FromUint8(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 1))))>>int32(5)]&(libc.Uint32FromUint32(1)<<(libc.Int32FromUint8(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 1))))&libc.Int32FromInt32(0x1F))) != 0) {
  25948. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = *(*uintptr)(unsafe.Pointer(bp))
  25949. return m_XML_TOK_INVALID
  25950. } /* fall through */
  25951. _7:
  25952. ;
  25953. _6:
  25954. ;
  25955. _5:
  25956. ;
  25957. _4:
  25958. ;
  25959. _3:
  25960. ;
  25961. *(*uintptr)(unsafe.Pointer(bp)) += uintptr(2)
  25962. goto _17
  25963. _8:
  25964. ;
  25965. if int64(end)-int64(*(*uintptr)(unsafe.Pointer(bp))) < int64(2) {
  25966. return -int32(2)
  25967. }
  25968. if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
  25969. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = *(*uintptr)(unsafe.Pointer(bp))
  25970. return m_XML_TOK_INVALID
  25971. }
  25972. *(*uintptr)(unsafe.Pointer(bp)) += uintptr(2)
  25973. goto _17
  25974. _9:
  25975. ;
  25976. if int64(end)-int64(*(*uintptr)(unsafe.Pointer(bp))) < int64(3) {
  25977. return -int32(2)
  25978. }
  25979. if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
  25980. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = *(*uintptr)(unsafe.Pointer(bp))
  25981. return m_XML_TOK_INVALID
  25982. }
  25983. *(*uintptr)(unsafe.Pointer(bp)) += uintptr(3)
  25984. goto _17
  25985. _10:
  25986. ;
  25987. if int64(end)-int64(*(*uintptr)(unsafe.Pointer(bp))) < int64(4) {
  25988. return -int32(2)
  25989. }
  25990. if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
  25991. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = *(*uintptr)(unsafe.Pointer(bp))
  25992. return m_XML_TOK_INVALID
  25993. }
  25994. *(*uintptr)(unsafe.Pointer(bp)) += uintptr(4)
  25995. goto _17
  25996. _11:
  25997. ;
  25998. if hadColon != 0 {
  25999. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = *(*uintptr)(unsafe.Pointer(bp))
  26000. return m_XML_TOK_INVALID
  26001. }
  26002. hadColon = int32(1)
  26003. *(*uintptr)(unsafe.Pointer(bp)) += uintptr(2)
  26004. if !(int64(end)-int64(*(*uintptr)(unsafe.Pointer(bp))) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
  26005. return -int32(1)
  26006. }
  26007. if int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp))))) == 0 {
  26008. v18 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 1)))))))
  26009. } else {
  26010. v18 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))), *(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 1)))
  26011. }
  26012. switch v18 {
  26013. case int32(_BT_NONASCII):
  26014. if !(_namingBitmap[libc.Int32FromUint8(_nmstrtPages[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))))])<<int32(3)+libc.Int32FromUint8(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 1))))>>int32(5)]&(libc.Uint32FromUint32(1)<<(libc.Int32FromUint8(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 1))))&libc.Int32FromInt32(0x1F))) != 0) {
  26015. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = *(*uintptr)(unsafe.Pointer(bp))
  26016. return m_XML_TOK_INVALID
  26017. } /* fall through */
  26018. fallthrough
  26019. case int32(_BT_NMSTRT):
  26020. fallthrough
  26021. case int32(_BT_HEX):
  26022. *(*uintptr)(unsafe.Pointer(bp)) += uintptr(2)
  26023. case int32(_BT_LEAD2):
  26024. if int64(end)-int64(*(*uintptr)(unsafe.Pointer(bp))) < int64(libc.Int32FromInt32(2)) {
  26025. return -int32(2)
  26026. }
  26027. if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
  26028. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = *(*uintptr)(unsafe.Pointer(bp))
  26029. return m_XML_TOK_INVALID
  26030. }
  26031. *(*uintptr)(unsafe.Pointer(bp)) += uintptr(2)
  26032. case int32(_BT_LEAD3):
  26033. if int64(end)-int64(*(*uintptr)(unsafe.Pointer(bp))) < int64(libc.Int32FromInt32(3)) {
  26034. return -int32(2)
  26035. }
  26036. if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
  26037. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = *(*uintptr)(unsafe.Pointer(bp))
  26038. return m_XML_TOK_INVALID
  26039. }
  26040. *(*uintptr)(unsafe.Pointer(bp)) += uintptr(3)
  26041. case int32(_BT_LEAD4):
  26042. if int64(end)-int64(*(*uintptr)(unsafe.Pointer(bp))) < int64(libc.Int32FromInt32(4)) {
  26043. return -int32(2)
  26044. }
  26045. if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
  26046. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = *(*uintptr)(unsafe.Pointer(bp))
  26047. return m_XML_TOK_INVALID
  26048. }
  26049. *(*uintptr)(unsafe.Pointer(bp)) += uintptr(4)
  26050. default:
  26051. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = *(*uintptr)(unsafe.Pointer(bp))
  26052. return m_XML_TOK_INVALID
  26053. }
  26054. goto _17
  26055. _14:
  26056. ;
  26057. _13:
  26058. ;
  26059. _12:
  26060. ;
  26061. _21:
  26062. ;
  26063. *(*uintptr)(unsafe.Pointer(bp)) += uintptr(2)
  26064. if !(int64(end)-int64(*(*uintptr)(unsafe.Pointer(bp))) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
  26065. return -int32(1)
  26066. }
  26067. if int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp))))) == 0 {
  26068. v22 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 1)))))))
  26069. } else {
  26070. v22 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))), *(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 1)))
  26071. }
  26072. t = v22
  26073. if t == int32(_BT_EQUALS) {
  26074. goto _19
  26075. }
  26076. switch t {
  26077. case int32(_BT_S):
  26078. fallthrough
  26079. case int32(_BT_LF):
  26080. fallthrough
  26081. case int32(_BT_CR):
  26082. default:
  26083. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = *(*uintptr)(unsafe.Pointer(bp))
  26084. return m_XML_TOK_INVALID
  26085. }
  26086. goto _20
  26087. _20:
  26088. ;
  26089. goto _21
  26090. goto _19
  26091. _19:
  26092. ;
  26093. /* fall through */
  26094. _15:
  26095. ;
  26096. hadColon = 0
  26097. for {
  26098. *(*uintptr)(unsafe.Pointer(bp)) += uintptr(2)
  26099. if !(int64(end)-int64(*(*uintptr)(unsafe.Pointer(bp))) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
  26100. return -int32(1)
  26101. }
  26102. if int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp))))) == 0 {
  26103. v24 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 1)))))))
  26104. } else {
  26105. v24 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))), *(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 1)))
  26106. }
  26107. open = v24
  26108. if open == int32(_BT_QUOT) || open == int32(_BT_APOS) {
  26109. break
  26110. }
  26111. switch open {
  26112. case int32(_BT_S):
  26113. fallthrough
  26114. case int32(_BT_LF):
  26115. fallthrough
  26116. case int32(_BT_CR):
  26117. default:
  26118. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = *(*uintptr)(unsafe.Pointer(bp))
  26119. return m_XML_TOK_INVALID
  26120. }
  26121. goto _23
  26122. _23:
  26123. }
  26124. *(*uintptr)(unsafe.Pointer(bp)) += uintptr(2)
  26125. /* in attribute value */
  26126. for {
  26127. if !(int64(end)-int64(*(*uintptr)(unsafe.Pointer(bp))) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
  26128. return -int32(1)
  26129. }
  26130. if int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp))))) == 0 {
  26131. v26 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 1)))))))
  26132. } else {
  26133. v26 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))), *(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 1)))
  26134. }
  26135. t1 = v26
  26136. if t1 == open {
  26137. break
  26138. }
  26139. switch t1 {
  26140. case int32(_BT_LEAD2):
  26141. if int64(end)-int64(*(*uintptr)(unsafe.Pointer(bp))) < int64(2) {
  26142. return -int32(2)
  26143. }
  26144. if 0 != 0 {
  26145. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = *(*uintptr)(unsafe.Pointer(bp))
  26146. return m_XML_TOK_INVALID
  26147. }
  26148. *(*uintptr)(unsafe.Pointer(bp)) += uintptr(2)
  26149. case int32(_BT_LEAD3):
  26150. if int64(end)-int64(*(*uintptr)(unsafe.Pointer(bp))) < int64(3) {
  26151. return -int32(2)
  26152. }
  26153. if 0 != 0 {
  26154. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = *(*uintptr)(unsafe.Pointer(bp))
  26155. return m_XML_TOK_INVALID
  26156. }
  26157. *(*uintptr)(unsafe.Pointer(bp)) += uintptr(3)
  26158. case int32(_BT_LEAD4):
  26159. if int64(end)-int64(*(*uintptr)(unsafe.Pointer(bp))) < int64(4) {
  26160. return -int32(2)
  26161. }
  26162. if 0 != 0 {
  26163. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = *(*uintptr)(unsafe.Pointer(bp))
  26164. return m_XML_TOK_INVALID
  26165. }
  26166. *(*uintptr)(unsafe.Pointer(bp)) += uintptr(4)
  26167. case int32(_BT_NONXML):
  26168. fallthrough
  26169. case int32(_BT_MALFORM):
  26170. fallthrough
  26171. case int32(_BT_TRAIL):
  26172. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = *(*uintptr)(unsafe.Pointer(bp))
  26173. return m_XML_TOK_INVALID
  26174. case int32(_BT_AMP):
  26175. tok = _big2_scanRef(tls, enc, *(*uintptr)(unsafe.Pointer(bp))+uintptr(2), end, bp)
  26176. if tok <= 0 {
  26177. if tok == m_XML_TOK_INVALID {
  26178. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = *(*uintptr)(unsafe.Pointer(bp))
  26179. }
  26180. return tok
  26181. }
  26182. case int32(_BT_LT):
  26183. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = *(*uintptr)(unsafe.Pointer(bp))
  26184. return m_XML_TOK_INVALID
  26185. default:
  26186. *(*uintptr)(unsafe.Pointer(bp)) += uintptr(2)
  26187. break
  26188. }
  26189. goto _25
  26190. _25:
  26191. }
  26192. *(*uintptr)(unsafe.Pointer(bp)) += uintptr(2)
  26193. if !(int64(end)-int64(*(*uintptr)(unsafe.Pointer(bp))) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
  26194. return -int32(1)
  26195. }
  26196. if int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp))))) == 0 {
  26197. v27 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 1)))))))
  26198. } else {
  26199. v27 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))), *(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 1)))
  26200. }
  26201. switch v27 {
  26202. case int32(_BT_S):
  26203. fallthrough
  26204. case int32(_BT_CR):
  26205. fallthrough
  26206. case int32(_BT_LF):
  26207. case int32(_BT_SOL):
  26208. goto sol
  26209. case int32(_BT_GT):
  26210. goto gt
  26211. default:
  26212. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = *(*uintptr)(unsafe.Pointer(bp))
  26213. return m_XML_TOK_INVALID
  26214. }
  26215. /* ptr points to closing quote */
  26216. _30:
  26217. ;
  26218. *(*uintptr)(unsafe.Pointer(bp)) += uintptr(2)
  26219. if !(int64(end)-int64(*(*uintptr)(unsafe.Pointer(bp))) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
  26220. return -int32(1)
  26221. }
  26222. if int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp))))) == 0 {
  26223. v31 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 1)))))))
  26224. } else {
  26225. v31 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))), *(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 1)))
  26226. }
  26227. switch v31 {
  26228. case int32(_BT_NONASCII):
  26229. goto _32
  26230. case int32(_BT_HEX):
  26231. goto _33
  26232. case int32(_BT_NMSTRT):
  26233. goto _34
  26234. case int32(_BT_LEAD2):
  26235. goto _35
  26236. case int32(_BT_LEAD3):
  26237. goto _36
  26238. case int32(_BT_LEAD4):
  26239. goto _37
  26240. case int32(_BT_LF):
  26241. goto _38
  26242. case int32(_BT_CR):
  26243. goto _39
  26244. case int32(_BT_S):
  26245. goto _40
  26246. case int32(_BT_GT):
  26247. goto _41
  26248. case int32(_BT_SOL):
  26249. goto _42
  26250. default:
  26251. goto _43
  26252. }
  26253. goto _44
  26254. _32:
  26255. ;
  26256. if !(_namingBitmap[libc.Int32FromUint8(_nmstrtPages[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))))])<<int32(3)+libc.Int32FromUint8(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 1))))>>int32(5)]&(libc.Uint32FromUint32(1)<<(libc.Int32FromUint8(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 1))))&libc.Int32FromInt32(0x1F))) != 0) {
  26257. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = *(*uintptr)(unsafe.Pointer(bp))
  26258. return m_XML_TOK_INVALID
  26259. } /* fall through */
  26260. _34:
  26261. ;
  26262. _33:
  26263. ;
  26264. *(*uintptr)(unsafe.Pointer(bp)) += uintptr(2)
  26265. goto _44
  26266. _35:
  26267. ;
  26268. if int64(end)-int64(*(*uintptr)(unsafe.Pointer(bp))) < int64(libc.Int32FromInt32(2)) {
  26269. return -int32(2)
  26270. }
  26271. if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
  26272. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = *(*uintptr)(unsafe.Pointer(bp))
  26273. return m_XML_TOK_INVALID
  26274. }
  26275. *(*uintptr)(unsafe.Pointer(bp)) += uintptr(2)
  26276. goto _44
  26277. _36:
  26278. ;
  26279. if int64(end)-int64(*(*uintptr)(unsafe.Pointer(bp))) < int64(libc.Int32FromInt32(3)) {
  26280. return -int32(2)
  26281. }
  26282. if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
  26283. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = *(*uintptr)(unsafe.Pointer(bp))
  26284. return m_XML_TOK_INVALID
  26285. }
  26286. *(*uintptr)(unsafe.Pointer(bp)) += uintptr(3)
  26287. goto _44
  26288. _37:
  26289. ;
  26290. if int64(end)-int64(*(*uintptr)(unsafe.Pointer(bp))) < int64(libc.Int32FromInt32(4)) {
  26291. return -int32(2)
  26292. }
  26293. if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
  26294. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = *(*uintptr)(unsafe.Pointer(bp))
  26295. return m_XML_TOK_INVALID
  26296. }
  26297. *(*uintptr)(unsafe.Pointer(bp)) += uintptr(4)
  26298. goto _44
  26299. _40:
  26300. ;
  26301. _39:
  26302. ;
  26303. _38:
  26304. ;
  26305. goto _29
  26306. _41:
  26307. ;
  26308. goto gt
  26309. gt:
  26310. ;
  26311. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = *(*uintptr)(unsafe.Pointer(bp)) + uintptr(2)
  26312. return int32(m_XML_TOK_START_TAG_WITH_ATTS)
  26313. _42:
  26314. ;
  26315. goto sol
  26316. sol:
  26317. ;
  26318. *(*uintptr)(unsafe.Pointer(bp)) += uintptr(2)
  26319. if !(int64(end)-int64(*(*uintptr)(unsafe.Pointer(bp))) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
  26320. return -int32(1)
  26321. }
  26322. if !(int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp))))) == 0 && int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 1))) == int32(m_ASCII_GT1)) {
  26323. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = *(*uintptr)(unsafe.Pointer(bp))
  26324. return m_XML_TOK_INVALID
  26325. }
  26326. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = *(*uintptr)(unsafe.Pointer(bp)) + uintptr(2)
  26327. return int32(m_XML_TOK_EMPTY_ELEMENT_WITH_ATTS)
  26328. _43:
  26329. ;
  26330. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = *(*uintptr)(unsafe.Pointer(bp))
  26331. return m_XML_TOK_INVALID
  26332. _44:
  26333. ;
  26334. goto _28
  26335. goto _29
  26336. _29:
  26337. ;
  26338. goto _30
  26339. goto _28
  26340. _28:
  26341. ;
  26342. goto _17
  26343. _16:
  26344. ;
  26345. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = *(*uintptr)(unsafe.Pointer(bp))
  26346. return m_XML_TOK_INVALID
  26347. _17:
  26348. }
  26349. return -int32(1)
  26350. }
  26351. /* ptr points to character following "<" */
  26352. func _big2_scanLt(tls *libc.TLS, enc uintptr, ptr uintptr, end uintptr, nextTokPtr uintptr) (r int32) {
  26353. var hadColon, v1, v2, v21, v22, v3 int32
  26354. _, _, _, _, _, _ = hadColon, v1, v2, v21, v22, v3
  26355. if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
  26356. return -int32(1)
  26357. }
  26358. if int32(*(*int8)(unsafe.Pointer(ptr))) == 0 {
  26359. v1 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr + 1)))))))
  26360. } else {
  26361. v1 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr)), *(*int8)(unsafe.Pointer(ptr + 1)))
  26362. }
  26363. switch v1 {
  26364. case int32(_BT_NONASCII):
  26365. if !(_namingBitmap[libc.Int32FromUint8(_nmstrtPages[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr)))])<<int32(3)+libc.Int32FromUint8(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr + 1))))>>int32(5)]&(libc.Uint32FromUint32(1)<<(libc.Int32FromUint8(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr + 1))))&libc.Int32FromInt32(0x1F))) != 0) {
  26366. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  26367. return m_XML_TOK_INVALID
  26368. } /* fall through */
  26369. fallthrough
  26370. case int32(_BT_NMSTRT):
  26371. fallthrough
  26372. case int32(_BT_HEX):
  26373. ptr += uintptr(2)
  26374. case int32(_BT_LEAD2):
  26375. if int64(end)-int64(ptr) < int64(libc.Int32FromInt32(2)) {
  26376. return -int32(2)
  26377. }
  26378. if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
  26379. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  26380. return m_XML_TOK_INVALID
  26381. }
  26382. ptr += uintptr(2)
  26383. case int32(_BT_LEAD3):
  26384. if int64(end)-int64(ptr) < int64(libc.Int32FromInt32(3)) {
  26385. return -int32(2)
  26386. }
  26387. if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
  26388. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  26389. return m_XML_TOK_INVALID
  26390. }
  26391. ptr += uintptr(3)
  26392. case int32(_BT_LEAD4):
  26393. if int64(end)-int64(ptr) < int64(libc.Int32FromInt32(4)) {
  26394. return -int32(2)
  26395. }
  26396. if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
  26397. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  26398. return m_XML_TOK_INVALID
  26399. }
  26400. ptr += uintptr(4)
  26401. case int32(_BT_EXCL):
  26402. ptr += uintptr(2)
  26403. if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
  26404. return -int32(1)
  26405. }
  26406. if int32(*(*int8)(unsafe.Pointer(ptr))) == 0 {
  26407. v2 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr + 1)))))))
  26408. } else {
  26409. v2 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr)), *(*int8)(unsafe.Pointer(ptr + 1)))
  26410. }
  26411. switch v2 {
  26412. case int32(_BT_MINUS):
  26413. return _big2_scanComment(tls, enc, ptr+uintptr(2), end, nextTokPtr)
  26414. case int32(_BT_LSQB):
  26415. return _big2_scanCdataSection(tls, enc, ptr+uintptr(2), end, nextTokPtr)
  26416. }
  26417. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  26418. return m_XML_TOK_INVALID
  26419. case int32(_BT_QUEST):
  26420. return _big2_scanPi(tls, enc, ptr+uintptr(2), end, nextTokPtr)
  26421. case int32(_BT_SOL):
  26422. return _big2_scanEndTag(tls, enc, ptr+uintptr(2), end, nextTokPtr)
  26423. default:
  26424. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  26425. return m_XML_TOK_INVALID
  26426. }
  26427. hadColon = 0
  26428. /* we have a start-tag */
  26429. for int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2)) {
  26430. if int32(*(*int8)(unsafe.Pointer(ptr))) == 0 {
  26431. v3 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr + 1)))))))
  26432. } else {
  26433. v3 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr)), *(*int8)(unsafe.Pointer(ptr + 1)))
  26434. }
  26435. switch v3 {
  26436. case int32(_BT_NONASCII):
  26437. goto _4
  26438. case int32(_BT_MINUS):
  26439. goto _5
  26440. case int32(_BT_NAME):
  26441. goto _6
  26442. case int32(_BT_DIGIT):
  26443. goto _7
  26444. case int32(_BT_HEX):
  26445. goto _8
  26446. case int32(_BT_NMSTRT):
  26447. goto _9
  26448. case int32(_BT_LEAD2):
  26449. goto _10
  26450. case int32(_BT_LEAD3):
  26451. goto _11
  26452. case int32(_BT_LEAD4):
  26453. goto _12
  26454. case int32(_BT_COLON):
  26455. goto _13
  26456. case int32(_BT_LF):
  26457. goto _14
  26458. case int32(_BT_CR):
  26459. goto _15
  26460. case int32(_BT_S):
  26461. goto _16
  26462. case int32(_BT_GT):
  26463. goto _17
  26464. case int32(_BT_SOL):
  26465. goto _18
  26466. default:
  26467. goto _19
  26468. }
  26469. goto _20
  26470. _4:
  26471. ;
  26472. if !(_namingBitmap[libc.Int32FromUint8(_namePages[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr)))])<<int32(3)+libc.Int32FromUint8(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr + 1))))>>int32(5)]&(libc.Uint32FromUint32(1)<<(libc.Int32FromUint8(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr + 1))))&libc.Int32FromInt32(0x1F))) != 0) {
  26473. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  26474. return m_XML_TOK_INVALID
  26475. } /* fall through */
  26476. _9:
  26477. ;
  26478. _8:
  26479. ;
  26480. _7:
  26481. ;
  26482. _6:
  26483. ;
  26484. _5:
  26485. ;
  26486. ptr += uintptr(2)
  26487. goto _20
  26488. _10:
  26489. ;
  26490. if int64(end)-int64(ptr) < int64(2) {
  26491. return -int32(2)
  26492. }
  26493. if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
  26494. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  26495. return m_XML_TOK_INVALID
  26496. }
  26497. ptr += uintptr(2)
  26498. goto _20
  26499. _11:
  26500. ;
  26501. if int64(end)-int64(ptr) < int64(3) {
  26502. return -int32(2)
  26503. }
  26504. if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
  26505. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  26506. return m_XML_TOK_INVALID
  26507. }
  26508. ptr += uintptr(3)
  26509. goto _20
  26510. _12:
  26511. ;
  26512. if int64(end)-int64(ptr) < int64(4) {
  26513. return -int32(2)
  26514. }
  26515. if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
  26516. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  26517. return m_XML_TOK_INVALID
  26518. }
  26519. ptr += uintptr(4)
  26520. goto _20
  26521. _13:
  26522. ;
  26523. if hadColon != 0 {
  26524. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  26525. return m_XML_TOK_INVALID
  26526. }
  26527. hadColon = int32(1)
  26528. ptr += uintptr(2)
  26529. if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
  26530. return -int32(1)
  26531. }
  26532. if int32(*(*int8)(unsafe.Pointer(ptr))) == 0 {
  26533. v21 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr + 1)))))))
  26534. } else {
  26535. v21 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr)), *(*int8)(unsafe.Pointer(ptr + 1)))
  26536. }
  26537. switch v21 {
  26538. case int32(_BT_NONASCII):
  26539. if !(_namingBitmap[libc.Int32FromUint8(_nmstrtPages[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr)))])<<int32(3)+libc.Int32FromUint8(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr + 1))))>>int32(5)]&(libc.Uint32FromUint32(1)<<(libc.Int32FromUint8(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr + 1))))&libc.Int32FromInt32(0x1F))) != 0) {
  26540. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  26541. return m_XML_TOK_INVALID
  26542. } /* fall through */
  26543. fallthrough
  26544. case int32(_BT_NMSTRT):
  26545. fallthrough
  26546. case int32(_BT_HEX):
  26547. ptr += uintptr(2)
  26548. case int32(_BT_LEAD2):
  26549. if int64(end)-int64(ptr) < int64(libc.Int32FromInt32(2)) {
  26550. return -int32(2)
  26551. }
  26552. if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
  26553. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  26554. return m_XML_TOK_INVALID
  26555. }
  26556. ptr += uintptr(2)
  26557. case int32(_BT_LEAD3):
  26558. if int64(end)-int64(ptr) < int64(libc.Int32FromInt32(3)) {
  26559. return -int32(2)
  26560. }
  26561. if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
  26562. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  26563. return m_XML_TOK_INVALID
  26564. }
  26565. ptr += uintptr(3)
  26566. case int32(_BT_LEAD4):
  26567. if int64(end)-int64(ptr) < int64(libc.Int32FromInt32(4)) {
  26568. return -int32(2)
  26569. }
  26570. if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
  26571. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  26572. return m_XML_TOK_INVALID
  26573. }
  26574. ptr += uintptr(4)
  26575. default:
  26576. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  26577. return m_XML_TOK_INVALID
  26578. }
  26579. goto _20
  26580. _16:
  26581. ;
  26582. _15:
  26583. ;
  26584. _14:
  26585. ;
  26586. ptr += uintptr(2)
  26587. for int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2)) {
  26588. if int32(*(*int8)(unsafe.Pointer(ptr))) == 0 {
  26589. v22 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr + 1)))))))
  26590. } else {
  26591. v22 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr)), *(*int8)(unsafe.Pointer(ptr + 1)))
  26592. }
  26593. switch v22 {
  26594. case int32(_BT_NONASCII):
  26595. if !(_namingBitmap[libc.Int32FromUint8(_nmstrtPages[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr)))])<<int32(3)+libc.Int32FromUint8(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr + 1))))>>int32(5)]&(libc.Uint32FromUint32(1)<<(libc.Int32FromUint8(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr + 1))))&libc.Int32FromInt32(0x1F))) != 0) {
  26596. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  26597. return m_XML_TOK_INVALID
  26598. } /* fall through */
  26599. fallthrough
  26600. case int32(_BT_NMSTRT):
  26601. fallthrough
  26602. case int32(_BT_HEX):
  26603. ptr += uintptr(2)
  26604. case int32(_BT_LEAD2):
  26605. if int64(end)-int64(ptr) < int64(libc.Int32FromInt32(2)) {
  26606. return -int32(2)
  26607. }
  26608. if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
  26609. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  26610. return m_XML_TOK_INVALID
  26611. }
  26612. ptr += uintptr(2)
  26613. case int32(_BT_LEAD3):
  26614. if int64(end)-int64(ptr) < int64(libc.Int32FromInt32(3)) {
  26615. return -int32(2)
  26616. }
  26617. if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
  26618. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  26619. return m_XML_TOK_INVALID
  26620. }
  26621. ptr += uintptr(3)
  26622. case int32(_BT_LEAD4):
  26623. if int64(end)-int64(ptr) < int64(libc.Int32FromInt32(4)) {
  26624. return -int32(2)
  26625. }
  26626. if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
  26627. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  26628. return m_XML_TOK_INVALID
  26629. }
  26630. ptr += uintptr(4)
  26631. case int32(_BT_GT):
  26632. goto gt
  26633. case int32(_BT_SOL):
  26634. goto sol
  26635. case int32(_BT_S):
  26636. fallthrough
  26637. case int32(_BT_CR):
  26638. fallthrough
  26639. case int32(_BT_LF):
  26640. ptr += uintptr(2)
  26641. continue
  26642. default:
  26643. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  26644. return m_XML_TOK_INVALID
  26645. }
  26646. return _big2_scanAtts(tls, enc, ptr, end, nextTokPtr)
  26647. }
  26648. return -int32(1)
  26649. _17:
  26650. ;
  26651. goto gt
  26652. gt:
  26653. ;
  26654. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(2)
  26655. return int32(m_XML_TOK_START_TAG_NO_ATTS)
  26656. _18:
  26657. ;
  26658. goto sol
  26659. sol:
  26660. ;
  26661. ptr += uintptr(2)
  26662. if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
  26663. return -int32(1)
  26664. }
  26665. if !(int32(*(*int8)(unsafe.Pointer(ptr))) == 0 && int32(*(*int8)(unsafe.Pointer(ptr + 1))) == int32(m_ASCII_GT1)) {
  26666. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  26667. return m_XML_TOK_INVALID
  26668. }
  26669. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(2)
  26670. return int32(m_XML_TOK_EMPTY_ELEMENT_NO_ATTS)
  26671. _19:
  26672. ;
  26673. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  26674. return m_XML_TOK_INVALID
  26675. _20:
  26676. }
  26677. return -int32(1)
  26678. }
  26679. func _big2_contentTok(tls *libc.TLS, enc uintptr, ptr uintptr, end uintptr, nextTokPtr uintptr) (r int32) {
  26680. var n Tsize_t
  26681. var v1, v2, v3 int32
  26682. _, _, _, _ = n, v1, v2, v3
  26683. if ptr >= end {
  26684. return -int32(4)
  26685. }
  26686. if int32(2) > int32(1) {
  26687. n = libc.Uint64FromInt64(int64(end) - int64(ptr))
  26688. if n&libc.Uint64FromInt32(libc.Int32FromInt32(2)-libc.Int32FromInt32(1)) != 0 {
  26689. n &= libc.Uint64FromInt32(^(libc.Int32FromInt32(2) - libc.Int32FromInt32(1)))
  26690. if n == uint64(0) {
  26691. return -int32(1)
  26692. }
  26693. end = ptr + uintptr(n)
  26694. }
  26695. }
  26696. if int32(*(*int8)(unsafe.Pointer(ptr))) == 0 {
  26697. v1 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr + 1)))))))
  26698. } else {
  26699. v1 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr)), *(*int8)(unsafe.Pointer(ptr + 1)))
  26700. }
  26701. switch v1 {
  26702. case int32(_BT_LT):
  26703. return _big2_scanLt(tls, enc, ptr+uintptr(2), end, nextTokPtr)
  26704. case int32(_BT_AMP):
  26705. return _big2_scanRef(tls, enc, ptr+uintptr(2), end, nextTokPtr)
  26706. case int32(_BT_CR):
  26707. ptr += uintptr(2)
  26708. if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
  26709. return -int32(3)
  26710. }
  26711. if int32(*(*int8)(unsafe.Pointer(ptr))) == 0 {
  26712. v2 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr + 1)))))))
  26713. } else {
  26714. v2 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr)), *(*int8)(unsafe.Pointer(ptr + 1)))
  26715. }
  26716. if v2 == int32(_BT_LF) {
  26717. ptr += uintptr(2)
  26718. }
  26719. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  26720. return int32(m_XML_TOK_DATA_NEWLINE)
  26721. case int32(_BT_LF):
  26722. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(2)
  26723. return int32(m_XML_TOK_DATA_NEWLINE)
  26724. case int32(_BT_RSQB):
  26725. ptr += uintptr(2)
  26726. if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
  26727. return -int32(5)
  26728. }
  26729. if !(int32(*(*int8)(unsafe.Pointer(ptr))) == 0 && int32(*(*int8)(unsafe.Pointer(ptr + 1))) == int32(m_ASCII_RSQB1)) {
  26730. break
  26731. }
  26732. ptr += uintptr(2)
  26733. if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
  26734. return -int32(5)
  26735. }
  26736. if !(int32(*(*int8)(unsafe.Pointer(ptr))) == 0 && int32(*(*int8)(unsafe.Pointer(ptr + 1))) == int32(m_ASCII_GT1)) {
  26737. ptr -= uintptr(2)
  26738. break
  26739. }
  26740. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  26741. return m_XML_TOK_INVALID
  26742. case int32(_BT_LEAD2):
  26743. if int64(end)-int64(ptr) < int64(2) {
  26744. return -int32(2)
  26745. }
  26746. if 0 != 0 {
  26747. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  26748. return m_XML_TOK_INVALID
  26749. }
  26750. ptr += uintptr(2)
  26751. case int32(_BT_LEAD3):
  26752. if int64(end)-int64(ptr) < int64(3) {
  26753. return -int32(2)
  26754. }
  26755. if 0 != 0 {
  26756. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  26757. return m_XML_TOK_INVALID
  26758. }
  26759. ptr += uintptr(3)
  26760. case int32(_BT_LEAD4):
  26761. if int64(end)-int64(ptr) < int64(4) {
  26762. return -int32(2)
  26763. }
  26764. if 0 != 0 {
  26765. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  26766. return m_XML_TOK_INVALID
  26767. }
  26768. ptr += uintptr(4)
  26769. case int32(_BT_NONXML):
  26770. fallthrough
  26771. case int32(_BT_MALFORM):
  26772. fallthrough
  26773. case int32(_BT_TRAIL):
  26774. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  26775. return m_XML_TOK_INVALID
  26776. default:
  26777. ptr += uintptr(2)
  26778. break
  26779. }
  26780. for int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2)) {
  26781. if int32(*(*int8)(unsafe.Pointer(ptr))) == 0 {
  26782. v3 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr + 1)))))))
  26783. } else {
  26784. v3 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr)), *(*int8)(unsafe.Pointer(ptr + 1)))
  26785. }
  26786. switch v3 {
  26787. case int32(_BT_LEAD2):
  26788. if int64(end)-int64(ptr) < int64(2) || libc.Bool(0 != 0) {
  26789. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  26790. return int32(m_XML_TOK_DATA_CHARS)
  26791. }
  26792. ptr += uintptr(2)
  26793. case int32(_BT_LEAD3):
  26794. if int64(end)-int64(ptr) < int64(3) || libc.Bool(0 != 0) {
  26795. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  26796. return int32(m_XML_TOK_DATA_CHARS)
  26797. }
  26798. ptr += uintptr(3)
  26799. case int32(_BT_LEAD4):
  26800. if int64(end)-int64(ptr) < int64(4) || libc.Bool(0 != 0) {
  26801. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  26802. return int32(m_XML_TOK_DATA_CHARS)
  26803. }
  26804. ptr += uintptr(4)
  26805. case int32(_BT_RSQB):
  26806. if int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(2)*libc.Int32FromInt32(2)) {
  26807. if !(int32(*(*int8)(unsafe.Pointer(ptr + libc.UintptrFromInt32(2)))) == 0 && int32(*(*int8)(unsafe.Pointer(ptr + libc.UintptrFromInt32(2) + 1))) == int32(m_ASCII_RSQB1)) {
  26808. ptr += uintptr(2)
  26809. break
  26810. }
  26811. if int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(3)*libc.Int32FromInt32(2)) {
  26812. if !(int32(*(*int8)(unsafe.Pointer(ptr + uintptr(libc.Int32FromInt32(2)*libc.Int32FromInt32(2))))) == 0 && int32(*(*int8)(unsafe.Pointer(ptr + uintptr(libc.Int32FromInt32(2)*libc.Int32FromInt32(2)) + 1))) == int32(m_ASCII_GT1)) {
  26813. ptr += uintptr(2)
  26814. break
  26815. }
  26816. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(libc.Int32FromInt32(2)*libc.Int32FromInt32(2))
  26817. return m_XML_TOK_INVALID
  26818. }
  26819. }
  26820. /* fall through */
  26821. fallthrough
  26822. case int32(_BT_AMP):
  26823. fallthrough
  26824. case int32(_BT_LT):
  26825. fallthrough
  26826. case int32(_BT_NONXML):
  26827. fallthrough
  26828. case int32(_BT_MALFORM):
  26829. fallthrough
  26830. case int32(_BT_TRAIL):
  26831. fallthrough
  26832. case int32(_BT_CR):
  26833. fallthrough
  26834. case int32(_BT_LF):
  26835. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  26836. return int32(m_XML_TOK_DATA_CHARS)
  26837. default:
  26838. ptr += uintptr(2)
  26839. break
  26840. }
  26841. }
  26842. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  26843. return int32(m_XML_TOK_DATA_CHARS)
  26844. }
  26845. /* ptr points to character following "%" */
  26846. func _big2_scanPercent(tls *libc.TLS, enc uintptr, ptr uintptr, end uintptr, nextTokPtr uintptr) (r int32) {
  26847. var v1, v2 int32
  26848. _, _ = v1, v2
  26849. if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
  26850. return -int32(1)
  26851. }
  26852. if int32(*(*int8)(unsafe.Pointer(ptr))) == 0 {
  26853. v1 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr + 1)))))))
  26854. } else {
  26855. v1 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr)), *(*int8)(unsafe.Pointer(ptr + 1)))
  26856. }
  26857. switch v1 {
  26858. case int32(_BT_NONASCII):
  26859. if !(_namingBitmap[libc.Int32FromUint8(_nmstrtPages[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr)))])<<int32(3)+libc.Int32FromUint8(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr + 1))))>>int32(5)]&(libc.Uint32FromUint32(1)<<(libc.Int32FromUint8(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr + 1))))&libc.Int32FromInt32(0x1F))) != 0) {
  26860. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  26861. return m_XML_TOK_INVALID
  26862. } /* fall through */
  26863. fallthrough
  26864. case int32(_BT_NMSTRT):
  26865. fallthrough
  26866. case int32(_BT_HEX):
  26867. ptr += uintptr(2)
  26868. case int32(_BT_LEAD2):
  26869. if int64(end)-int64(ptr) < int64(libc.Int32FromInt32(2)) {
  26870. return -int32(2)
  26871. }
  26872. if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
  26873. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  26874. return m_XML_TOK_INVALID
  26875. }
  26876. ptr += uintptr(2)
  26877. case int32(_BT_LEAD3):
  26878. if int64(end)-int64(ptr) < int64(libc.Int32FromInt32(3)) {
  26879. return -int32(2)
  26880. }
  26881. if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
  26882. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  26883. return m_XML_TOK_INVALID
  26884. }
  26885. ptr += uintptr(3)
  26886. case int32(_BT_LEAD4):
  26887. if int64(end)-int64(ptr) < int64(libc.Int32FromInt32(4)) {
  26888. return -int32(2)
  26889. }
  26890. if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
  26891. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  26892. return m_XML_TOK_INVALID
  26893. }
  26894. ptr += uintptr(4)
  26895. case int32(_BT_S):
  26896. fallthrough
  26897. case int32(_BT_LF):
  26898. fallthrough
  26899. case int32(_BT_CR):
  26900. fallthrough
  26901. case int32(_BT_PERCNT):
  26902. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  26903. return int32(m_XML_TOK_PERCENT)
  26904. default:
  26905. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  26906. return m_XML_TOK_INVALID
  26907. }
  26908. for int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2)) {
  26909. if int32(*(*int8)(unsafe.Pointer(ptr))) == 0 {
  26910. v2 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr + 1)))))))
  26911. } else {
  26912. v2 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr)), *(*int8)(unsafe.Pointer(ptr + 1)))
  26913. }
  26914. switch v2 {
  26915. case int32(_BT_NONASCII):
  26916. if !(_namingBitmap[libc.Int32FromUint8(_namePages[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr)))])<<int32(3)+libc.Int32FromUint8(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr + 1))))>>int32(5)]&(libc.Uint32FromUint32(1)<<(libc.Int32FromUint8(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr + 1))))&libc.Int32FromInt32(0x1F))) != 0) {
  26917. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  26918. return m_XML_TOK_INVALID
  26919. } /* fall through */
  26920. fallthrough
  26921. case int32(_BT_NMSTRT):
  26922. fallthrough
  26923. case int32(_BT_HEX):
  26924. fallthrough
  26925. case int32(_BT_DIGIT):
  26926. fallthrough
  26927. case int32(_BT_NAME):
  26928. fallthrough
  26929. case int32(_BT_MINUS):
  26930. ptr += uintptr(2)
  26931. case int32(_BT_LEAD2):
  26932. if int64(end)-int64(ptr) < int64(2) {
  26933. return -int32(2)
  26934. }
  26935. if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
  26936. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  26937. return m_XML_TOK_INVALID
  26938. }
  26939. ptr += uintptr(2)
  26940. case int32(_BT_LEAD3):
  26941. if int64(end)-int64(ptr) < int64(3) {
  26942. return -int32(2)
  26943. }
  26944. if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
  26945. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  26946. return m_XML_TOK_INVALID
  26947. }
  26948. ptr += uintptr(3)
  26949. case int32(_BT_LEAD4):
  26950. if int64(end)-int64(ptr) < int64(4) {
  26951. return -int32(2)
  26952. }
  26953. if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
  26954. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  26955. return m_XML_TOK_INVALID
  26956. }
  26957. ptr += uintptr(4)
  26958. case int32(_BT_SEMI):
  26959. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(2)
  26960. return int32(m_XML_TOK_PARAM_ENTITY_REF)
  26961. default:
  26962. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  26963. return m_XML_TOK_INVALID
  26964. }
  26965. }
  26966. return -int32(1)
  26967. }
  26968. func _big2_scanPoundName(tls *libc.TLS, enc uintptr, ptr uintptr, end uintptr, nextTokPtr uintptr) (r int32) {
  26969. var v1, v2 int32
  26970. _, _ = v1, v2
  26971. if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
  26972. return -int32(1)
  26973. }
  26974. if int32(*(*int8)(unsafe.Pointer(ptr))) == 0 {
  26975. v1 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr + 1)))))))
  26976. } else {
  26977. v1 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr)), *(*int8)(unsafe.Pointer(ptr + 1)))
  26978. }
  26979. switch v1 {
  26980. case int32(_BT_NONASCII):
  26981. if !(_namingBitmap[libc.Int32FromUint8(_nmstrtPages[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr)))])<<int32(3)+libc.Int32FromUint8(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr + 1))))>>int32(5)]&(libc.Uint32FromUint32(1)<<(libc.Int32FromUint8(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr + 1))))&libc.Int32FromInt32(0x1F))) != 0) {
  26982. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  26983. return m_XML_TOK_INVALID
  26984. } /* fall through */
  26985. fallthrough
  26986. case int32(_BT_NMSTRT):
  26987. fallthrough
  26988. case int32(_BT_HEX):
  26989. ptr += uintptr(2)
  26990. case int32(_BT_LEAD2):
  26991. if int64(end)-int64(ptr) < int64(libc.Int32FromInt32(2)) {
  26992. return -int32(2)
  26993. }
  26994. if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
  26995. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  26996. return m_XML_TOK_INVALID
  26997. }
  26998. ptr += uintptr(2)
  26999. case int32(_BT_LEAD3):
  27000. if int64(end)-int64(ptr) < int64(libc.Int32FromInt32(3)) {
  27001. return -int32(2)
  27002. }
  27003. if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
  27004. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  27005. return m_XML_TOK_INVALID
  27006. }
  27007. ptr += uintptr(3)
  27008. case int32(_BT_LEAD4):
  27009. if int64(end)-int64(ptr) < int64(libc.Int32FromInt32(4)) {
  27010. return -int32(2)
  27011. }
  27012. if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
  27013. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  27014. return m_XML_TOK_INVALID
  27015. }
  27016. ptr += uintptr(4)
  27017. default:
  27018. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  27019. return m_XML_TOK_INVALID
  27020. }
  27021. for int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2)) {
  27022. if int32(*(*int8)(unsafe.Pointer(ptr))) == 0 {
  27023. v2 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr + 1)))))))
  27024. } else {
  27025. v2 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr)), *(*int8)(unsafe.Pointer(ptr + 1)))
  27026. }
  27027. switch v2 {
  27028. case int32(_BT_NONASCII):
  27029. if !(_namingBitmap[libc.Int32FromUint8(_namePages[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr)))])<<int32(3)+libc.Int32FromUint8(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr + 1))))>>int32(5)]&(libc.Uint32FromUint32(1)<<(libc.Int32FromUint8(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr + 1))))&libc.Int32FromInt32(0x1F))) != 0) {
  27030. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  27031. return m_XML_TOK_INVALID
  27032. } /* fall through */
  27033. fallthrough
  27034. case int32(_BT_NMSTRT):
  27035. fallthrough
  27036. case int32(_BT_HEX):
  27037. fallthrough
  27038. case int32(_BT_DIGIT):
  27039. fallthrough
  27040. case int32(_BT_NAME):
  27041. fallthrough
  27042. case int32(_BT_MINUS):
  27043. ptr += uintptr(2)
  27044. case int32(_BT_LEAD2):
  27045. if int64(end)-int64(ptr) < int64(2) {
  27046. return -int32(2)
  27047. }
  27048. if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
  27049. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  27050. return m_XML_TOK_INVALID
  27051. }
  27052. ptr += uintptr(2)
  27053. case int32(_BT_LEAD3):
  27054. if int64(end)-int64(ptr) < int64(3) {
  27055. return -int32(2)
  27056. }
  27057. if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
  27058. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  27059. return m_XML_TOK_INVALID
  27060. }
  27061. ptr += uintptr(3)
  27062. case int32(_BT_LEAD4):
  27063. if int64(end)-int64(ptr) < int64(4) {
  27064. return -int32(2)
  27065. }
  27066. if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
  27067. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  27068. return m_XML_TOK_INVALID
  27069. }
  27070. ptr += uintptr(4)
  27071. case int32(_BT_CR):
  27072. fallthrough
  27073. case int32(_BT_LF):
  27074. fallthrough
  27075. case int32(_BT_S):
  27076. fallthrough
  27077. case int32(_BT_RPAR):
  27078. fallthrough
  27079. case int32(_BT_GT):
  27080. fallthrough
  27081. case int32(_BT_PERCNT):
  27082. fallthrough
  27083. case int32(_BT_VERBAR):
  27084. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  27085. return int32(m_XML_TOK_POUND_NAME)
  27086. default:
  27087. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  27088. return m_XML_TOK_INVALID
  27089. }
  27090. }
  27091. return -int32(m_XML_TOK_POUND_NAME)
  27092. }
  27093. func _big2_scanLit(tls *libc.TLS, open int32, enc uintptr, ptr uintptr, end uintptr, nextTokPtr uintptr) (r int32) {
  27094. var t, v1, v2 int32
  27095. _, _, _ = t, v1, v2
  27096. for int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2)) {
  27097. if int32(*(*int8)(unsafe.Pointer(ptr))) == 0 {
  27098. v1 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr + 1)))))))
  27099. } else {
  27100. v1 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr)), *(*int8)(unsafe.Pointer(ptr + 1)))
  27101. }
  27102. t = v1
  27103. switch t {
  27104. case int32(_BT_LEAD2):
  27105. if int64(end)-int64(ptr) < int64(2) {
  27106. return -int32(2)
  27107. }
  27108. if 0 != 0 {
  27109. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  27110. return m_XML_TOK_INVALID
  27111. }
  27112. ptr += uintptr(2)
  27113. case int32(_BT_LEAD3):
  27114. if int64(end)-int64(ptr) < int64(3) {
  27115. return -int32(2)
  27116. }
  27117. if 0 != 0 {
  27118. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  27119. return m_XML_TOK_INVALID
  27120. }
  27121. ptr += uintptr(3)
  27122. case int32(_BT_LEAD4):
  27123. if int64(end)-int64(ptr) < int64(4) {
  27124. return -int32(2)
  27125. }
  27126. if 0 != 0 {
  27127. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  27128. return m_XML_TOK_INVALID
  27129. }
  27130. ptr += uintptr(4)
  27131. case int32(_BT_NONXML):
  27132. fallthrough
  27133. case int32(_BT_MALFORM):
  27134. fallthrough
  27135. case int32(_BT_TRAIL):
  27136. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  27137. return m_XML_TOK_INVALID
  27138. case int32(_BT_QUOT):
  27139. fallthrough
  27140. case int32(_BT_APOS):
  27141. ptr += uintptr(2)
  27142. if t != open {
  27143. break
  27144. }
  27145. if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
  27146. return -int32(m_XML_TOK_LITERAL)
  27147. }
  27148. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  27149. if int32(*(*int8)(unsafe.Pointer(ptr))) == 0 {
  27150. v2 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr + 1)))))))
  27151. } else {
  27152. v2 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr)), *(*int8)(unsafe.Pointer(ptr + 1)))
  27153. }
  27154. switch v2 {
  27155. case int32(_BT_S):
  27156. fallthrough
  27157. case int32(_BT_CR):
  27158. fallthrough
  27159. case int32(_BT_LF):
  27160. fallthrough
  27161. case int32(_BT_GT):
  27162. fallthrough
  27163. case int32(_BT_PERCNT):
  27164. fallthrough
  27165. case int32(_BT_LSQB):
  27166. return int32(m_XML_TOK_LITERAL)
  27167. default:
  27168. return m_XML_TOK_INVALID
  27169. }
  27170. fallthrough
  27171. default:
  27172. ptr += uintptr(2)
  27173. break
  27174. }
  27175. }
  27176. return -int32(1)
  27177. }
  27178. func _big2_prologTok(tls *libc.TLS, enc uintptr, ptr uintptr, end uintptr, nextTokPtr uintptr) (r int32) {
  27179. var n Tsize_t
  27180. var tok, v1, v29, v33, v34, v35, v36 int32
  27181. _, _, _, _, _, _, _, _ = n, tok, v1, v29, v33, v34, v35, v36
  27182. if ptr >= end {
  27183. return -int32(4)
  27184. }
  27185. if int32(2) > int32(1) {
  27186. n = libc.Uint64FromInt64(int64(end) - int64(ptr))
  27187. if n&libc.Uint64FromInt32(libc.Int32FromInt32(2)-libc.Int32FromInt32(1)) != 0 {
  27188. n &= libc.Uint64FromInt32(^(libc.Int32FromInt32(2) - libc.Int32FromInt32(1)))
  27189. if n == uint64(0) {
  27190. return -int32(1)
  27191. }
  27192. end = ptr + uintptr(n)
  27193. }
  27194. }
  27195. if int32(*(*int8)(unsafe.Pointer(ptr))) == 0 {
  27196. v1 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr + 1)))))))
  27197. } else {
  27198. v1 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr)), *(*int8)(unsafe.Pointer(ptr + 1)))
  27199. }
  27200. switch v1 {
  27201. case int32(_BT_QUOT):
  27202. goto _2
  27203. case int32(_BT_APOS):
  27204. goto _3
  27205. case int32(_BT_LT):
  27206. goto _4
  27207. case int32(_BT_CR):
  27208. goto _5
  27209. case int32(_BT_LF):
  27210. goto _6
  27211. case int32(_BT_S):
  27212. goto _7
  27213. case int32(_BT_PERCNT):
  27214. goto _8
  27215. case int32(_BT_COMMA):
  27216. goto _9
  27217. case int32(_BT_LSQB):
  27218. goto _10
  27219. case int32(_BT_RSQB):
  27220. goto _11
  27221. case int32(_BT_LPAR):
  27222. goto _12
  27223. case int32(_BT_RPAR):
  27224. goto _13
  27225. case int32(_BT_VERBAR):
  27226. goto _14
  27227. case int32(_BT_GT):
  27228. goto _15
  27229. case int32(_BT_NUM):
  27230. goto _16
  27231. case int32(_BT_LEAD2):
  27232. goto _17
  27233. case int32(_BT_LEAD3):
  27234. goto _18
  27235. case int32(_BT_LEAD4):
  27236. goto _19
  27237. case int32(_BT_HEX):
  27238. goto _20
  27239. case int32(_BT_NMSTRT):
  27240. goto _21
  27241. case int32(_BT_COLON):
  27242. goto _22
  27243. case int32(_BT_MINUS):
  27244. goto _23
  27245. case int32(_BT_NAME):
  27246. goto _24
  27247. case int32(_BT_DIGIT):
  27248. goto _25
  27249. case int32(_BT_NONASCII):
  27250. goto _26
  27251. default:
  27252. goto _27
  27253. }
  27254. goto _28
  27255. _2:
  27256. ;
  27257. return _big2_scanLit(tls, int32(_BT_QUOT), enc, ptr+uintptr(2), end, nextTokPtr)
  27258. _3:
  27259. ;
  27260. return _big2_scanLit(tls, int32(_BT_APOS), enc, ptr+uintptr(2), end, nextTokPtr)
  27261. _4:
  27262. ;
  27263. ptr += uintptr(2)
  27264. if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
  27265. return -int32(1)
  27266. }
  27267. if int32(*(*int8)(unsafe.Pointer(ptr))) == 0 {
  27268. v29 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr + 1)))))))
  27269. } else {
  27270. v29 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr)), *(*int8)(unsafe.Pointer(ptr + 1)))
  27271. }
  27272. switch v29 {
  27273. case int32(_BT_EXCL):
  27274. return _big2_scanDecl(tls, enc, ptr+uintptr(2), end, nextTokPtr)
  27275. case int32(_BT_QUEST):
  27276. return _big2_scanPi(tls, enc, ptr+uintptr(2), end, nextTokPtr)
  27277. case int32(_BT_NMSTRT):
  27278. fallthrough
  27279. case int32(_BT_HEX):
  27280. fallthrough
  27281. case int32(_BT_NONASCII):
  27282. fallthrough
  27283. case int32(_BT_LEAD2):
  27284. fallthrough
  27285. case int32(_BT_LEAD3):
  27286. fallthrough
  27287. case int32(_BT_LEAD4):
  27288. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr - uintptr(2)
  27289. return int32(m_XML_TOK_INSTANCE_START)
  27290. }
  27291. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  27292. return m_XML_TOK_INVALID
  27293. _5:
  27294. ;
  27295. if ptr+uintptr(2) == end {
  27296. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = end
  27297. /* indicate that this might be part of a CR/LF pair */
  27298. return -int32(m_XML_TOK_PROLOG_S)
  27299. }
  27300. /* fall through */
  27301. _7:
  27302. ;
  27303. _6:
  27304. ;
  27305. _32:
  27306. ;
  27307. ptr += uintptr(2)
  27308. if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
  27309. goto _30
  27310. }
  27311. if int32(*(*int8)(unsafe.Pointer(ptr))) == 0 {
  27312. v33 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr + 1)))))))
  27313. } else {
  27314. v33 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr)), *(*int8)(unsafe.Pointer(ptr + 1)))
  27315. }
  27316. switch v33 {
  27317. case int32(_BT_S):
  27318. fallthrough
  27319. case int32(_BT_LF):
  27320. case int32(_BT_CR):
  27321. /* don't split CR/LF pair */
  27322. if ptr+uintptr(2) != end {
  27323. break
  27324. }
  27325. /* fall through */
  27326. fallthrough
  27327. default:
  27328. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  27329. return int32(m_XML_TOK_PROLOG_S)
  27330. }
  27331. goto _31
  27332. _31:
  27333. ;
  27334. goto _32
  27335. goto _30
  27336. _30:
  27337. ;
  27338. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  27339. return int32(m_XML_TOK_PROLOG_S)
  27340. _8:
  27341. ;
  27342. return _big2_scanPercent(tls, enc, ptr+uintptr(2), end, nextTokPtr)
  27343. _9:
  27344. ;
  27345. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(2)
  27346. return int32(m_XML_TOK_COMMA)
  27347. _10:
  27348. ;
  27349. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(2)
  27350. return int32(m_XML_TOK_OPEN_BRACKET)
  27351. _11:
  27352. ;
  27353. ptr += uintptr(2)
  27354. if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
  27355. return -int32(m_XML_TOK_CLOSE_BRACKET)
  27356. }
  27357. if int32(*(*int8)(unsafe.Pointer(ptr))) == 0 && int32(*(*int8)(unsafe.Pointer(ptr + 1))) == int32(m_ASCII_RSQB1) {
  27358. if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(2)*libc.Int32FromInt32(2))) {
  27359. return -int32(1)
  27360. }
  27361. if int32(*(*int8)(unsafe.Pointer(ptr + libc.UintptrFromInt32(2)))) == 0 && int32(*(*int8)(unsafe.Pointer(ptr + libc.UintptrFromInt32(2) + 1))) == int32(m_ASCII_GT1) {
  27362. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(libc.Int32FromInt32(2)*libc.Int32FromInt32(2))
  27363. return int32(m_XML_TOK_COND_SECT_CLOSE)
  27364. }
  27365. }
  27366. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  27367. return int32(m_XML_TOK_CLOSE_BRACKET)
  27368. _12:
  27369. ;
  27370. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(2)
  27371. return int32(m_XML_TOK_OPEN_PAREN)
  27372. _13:
  27373. ;
  27374. ptr += uintptr(2)
  27375. if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
  27376. return -int32(m_XML_TOK_CLOSE_PAREN)
  27377. }
  27378. if int32(*(*int8)(unsafe.Pointer(ptr))) == 0 {
  27379. v34 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr + 1)))))))
  27380. } else {
  27381. v34 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr)), *(*int8)(unsafe.Pointer(ptr + 1)))
  27382. }
  27383. switch v34 {
  27384. case int32(_BT_AST):
  27385. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(2)
  27386. return int32(m_XML_TOK_CLOSE_PAREN_ASTERISK)
  27387. case int32(_BT_QUEST):
  27388. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(2)
  27389. return int32(m_XML_TOK_CLOSE_PAREN_QUESTION)
  27390. case int32(_BT_PLUS):
  27391. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(2)
  27392. return int32(m_XML_TOK_CLOSE_PAREN_PLUS)
  27393. case int32(_BT_CR):
  27394. fallthrough
  27395. case int32(_BT_LF):
  27396. fallthrough
  27397. case int32(_BT_S):
  27398. fallthrough
  27399. case int32(_BT_GT):
  27400. fallthrough
  27401. case int32(_BT_COMMA):
  27402. fallthrough
  27403. case int32(_BT_VERBAR):
  27404. fallthrough
  27405. case int32(_BT_RPAR):
  27406. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  27407. return int32(m_XML_TOK_CLOSE_PAREN)
  27408. }
  27409. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  27410. return m_XML_TOK_INVALID
  27411. _14:
  27412. ;
  27413. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(2)
  27414. return int32(m_XML_TOK_OR)
  27415. _15:
  27416. ;
  27417. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(2)
  27418. return int32(m_XML_TOK_DECL_CLOSE)
  27419. _16:
  27420. ;
  27421. return _big2_scanPoundName(tls, enc, ptr+uintptr(2), end, nextTokPtr)
  27422. _17:
  27423. ;
  27424. if int64(end)-int64(ptr) < int64(2) {
  27425. return -int32(2)
  27426. }
  27427. if 0 != 0 {
  27428. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  27429. return m_XML_TOK_INVALID
  27430. }
  27431. if 0 != 0 {
  27432. ptr += uintptr(2)
  27433. tok = int32(m_XML_TOK_NAME)
  27434. goto _28
  27435. }
  27436. if 0 != 0 {
  27437. ptr += uintptr(2)
  27438. tok = int32(m_XML_TOK_NMTOKEN)
  27439. goto _28
  27440. }
  27441. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  27442. return m_XML_TOK_INVALID
  27443. _18:
  27444. ;
  27445. if int64(end)-int64(ptr) < int64(3) {
  27446. return -int32(2)
  27447. }
  27448. if 0 != 0 {
  27449. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  27450. return m_XML_TOK_INVALID
  27451. }
  27452. if 0 != 0 {
  27453. ptr += uintptr(3)
  27454. tok = int32(m_XML_TOK_NAME)
  27455. goto _28
  27456. }
  27457. if 0 != 0 {
  27458. ptr += uintptr(3)
  27459. tok = int32(m_XML_TOK_NMTOKEN)
  27460. goto _28
  27461. }
  27462. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  27463. return m_XML_TOK_INVALID
  27464. _19:
  27465. ;
  27466. if int64(end)-int64(ptr) < int64(4) {
  27467. return -int32(2)
  27468. }
  27469. if 0 != 0 {
  27470. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  27471. return m_XML_TOK_INVALID
  27472. }
  27473. if 0 != 0 {
  27474. ptr += uintptr(4)
  27475. tok = int32(m_XML_TOK_NAME)
  27476. goto _28
  27477. }
  27478. if 0 != 0 {
  27479. ptr += uintptr(4)
  27480. tok = int32(m_XML_TOK_NMTOKEN)
  27481. goto _28
  27482. }
  27483. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  27484. return m_XML_TOK_INVALID
  27485. _21:
  27486. ;
  27487. _20:
  27488. ;
  27489. tok = int32(m_XML_TOK_NAME)
  27490. ptr += uintptr(2)
  27491. goto _28
  27492. _25:
  27493. ;
  27494. _24:
  27495. ;
  27496. _23:
  27497. ;
  27498. _22:
  27499. ;
  27500. tok = int32(m_XML_TOK_NMTOKEN)
  27501. ptr += uintptr(2)
  27502. goto _28
  27503. _26:
  27504. ;
  27505. if _namingBitmap[libc.Int32FromUint8(_nmstrtPages[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr)))])<<int32(3)+libc.Int32FromUint8(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr + 1))))>>int32(5)]&(uint32(1)<<(libc.Int32FromUint8(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr + 1))))&int32(0x1F))) != 0 {
  27506. ptr += uintptr(2)
  27507. tok = int32(m_XML_TOK_NAME)
  27508. goto _28
  27509. }
  27510. if _namingBitmap[libc.Int32FromUint8(_namePages[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr)))])<<int32(3)+libc.Int32FromUint8(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr + 1))))>>int32(5)]&(uint32(1)<<(libc.Int32FromUint8(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr + 1))))&int32(0x1F))) != 0 {
  27511. ptr += uintptr(2)
  27512. tok = int32(m_XML_TOK_NMTOKEN)
  27513. goto _28
  27514. }
  27515. /* fall through */
  27516. _27:
  27517. ;
  27518. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  27519. return m_XML_TOK_INVALID
  27520. _28:
  27521. ;
  27522. for int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2)) {
  27523. if int32(*(*int8)(unsafe.Pointer(ptr))) == 0 {
  27524. v35 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr + 1)))))))
  27525. } else {
  27526. v35 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr)), *(*int8)(unsafe.Pointer(ptr + 1)))
  27527. }
  27528. switch v35 {
  27529. case int32(_BT_NONASCII):
  27530. if !(_namingBitmap[libc.Int32FromUint8(_namePages[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr)))])<<int32(3)+libc.Int32FromUint8(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr + 1))))>>int32(5)]&(libc.Uint32FromUint32(1)<<(libc.Int32FromUint8(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr + 1))))&libc.Int32FromInt32(0x1F))) != 0) {
  27531. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  27532. return m_XML_TOK_INVALID
  27533. } /* fall through */
  27534. fallthrough
  27535. case int32(_BT_NMSTRT):
  27536. fallthrough
  27537. case int32(_BT_HEX):
  27538. fallthrough
  27539. case int32(_BT_DIGIT):
  27540. fallthrough
  27541. case int32(_BT_NAME):
  27542. fallthrough
  27543. case int32(_BT_MINUS):
  27544. ptr += uintptr(2)
  27545. case int32(_BT_LEAD2):
  27546. if int64(end)-int64(ptr) < int64(2) {
  27547. return -int32(2)
  27548. }
  27549. if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
  27550. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  27551. return m_XML_TOK_INVALID
  27552. }
  27553. ptr += uintptr(2)
  27554. case int32(_BT_LEAD3):
  27555. if int64(end)-int64(ptr) < int64(3) {
  27556. return -int32(2)
  27557. }
  27558. if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
  27559. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  27560. return m_XML_TOK_INVALID
  27561. }
  27562. ptr += uintptr(3)
  27563. case int32(_BT_LEAD4):
  27564. if int64(end)-int64(ptr) < int64(4) {
  27565. return -int32(2)
  27566. }
  27567. if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
  27568. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  27569. return m_XML_TOK_INVALID
  27570. }
  27571. ptr += uintptr(4)
  27572. case int32(_BT_GT):
  27573. fallthrough
  27574. case int32(_BT_RPAR):
  27575. fallthrough
  27576. case int32(_BT_COMMA):
  27577. fallthrough
  27578. case int32(_BT_VERBAR):
  27579. fallthrough
  27580. case int32(_BT_LSQB):
  27581. fallthrough
  27582. case int32(_BT_PERCNT):
  27583. fallthrough
  27584. case int32(_BT_S):
  27585. fallthrough
  27586. case int32(_BT_CR):
  27587. fallthrough
  27588. case int32(_BT_LF):
  27589. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  27590. return tok
  27591. case int32(_BT_COLON):
  27592. ptr += uintptr(2)
  27593. switch tok {
  27594. case int32(m_XML_TOK_NAME):
  27595. if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
  27596. return -int32(1)
  27597. }
  27598. tok = int32(m_XML_TOK_PREFIXED_NAME)
  27599. if int32(*(*int8)(unsafe.Pointer(ptr))) == 0 {
  27600. v36 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr + 1)))))))
  27601. } else {
  27602. v36 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr)), *(*int8)(unsafe.Pointer(ptr + 1)))
  27603. }
  27604. switch v36 {
  27605. case int32(_BT_NONASCII):
  27606. if !(_namingBitmap[libc.Int32FromUint8(_namePages[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr)))])<<int32(3)+libc.Int32FromUint8(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr + 1))))>>int32(5)]&(libc.Uint32FromUint32(1)<<(libc.Int32FromUint8(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr + 1))))&libc.Int32FromInt32(0x1F))) != 0) {
  27607. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  27608. return m_XML_TOK_INVALID
  27609. } /* fall through */
  27610. fallthrough
  27611. case int32(_BT_NMSTRT):
  27612. fallthrough
  27613. case int32(_BT_HEX):
  27614. fallthrough
  27615. case int32(_BT_DIGIT):
  27616. fallthrough
  27617. case int32(_BT_NAME):
  27618. fallthrough
  27619. case int32(_BT_MINUS):
  27620. ptr += uintptr(2)
  27621. case int32(_BT_LEAD2):
  27622. if int64(end)-int64(ptr) < int64(2) {
  27623. return -int32(2)
  27624. }
  27625. if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
  27626. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  27627. return m_XML_TOK_INVALID
  27628. }
  27629. ptr += uintptr(2)
  27630. case int32(_BT_LEAD3):
  27631. if int64(end)-int64(ptr) < int64(3) {
  27632. return -int32(2)
  27633. }
  27634. if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
  27635. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  27636. return m_XML_TOK_INVALID
  27637. }
  27638. ptr += uintptr(3)
  27639. case int32(_BT_LEAD4):
  27640. if int64(end)-int64(ptr) < int64(4) {
  27641. return -int32(2)
  27642. }
  27643. if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
  27644. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  27645. return m_XML_TOK_INVALID
  27646. }
  27647. ptr += uintptr(4)
  27648. default:
  27649. tok = int32(m_XML_TOK_NMTOKEN)
  27650. break
  27651. }
  27652. case int32(m_XML_TOK_PREFIXED_NAME):
  27653. tok = int32(m_XML_TOK_NMTOKEN)
  27654. break
  27655. }
  27656. case int32(_BT_PLUS):
  27657. if tok == int32(m_XML_TOK_NMTOKEN) {
  27658. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  27659. return m_XML_TOK_INVALID
  27660. }
  27661. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(2)
  27662. return int32(m_XML_TOK_NAME_PLUS)
  27663. case int32(_BT_AST):
  27664. if tok == int32(m_XML_TOK_NMTOKEN) {
  27665. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  27666. return m_XML_TOK_INVALID
  27667. }
  27668. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(2)
  27669. return int32(m_XML_TOK_NAME_ASTERISK)
  27670. case int32(_BT_QUEST):
  27671. if tok == int32(m_XML_TOK_NMTOKEN) {
  27672. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  27673. return m_XML_TOK_INVALID
  27674. }
  27675. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(2)
  27676. return int32(m_XML_TOK_NAME_QUESTION)
  27677. default:
  27678. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  27679. return m_XML_TOK_INVALID
  27680. }
  27681. }
  27682. return -tok
  27683. }
  27684. func _big2_attributeValueTok(tls *libc.TLS, enc uintptr, ptr uintptr, end uintptr, nextTokPtr uintptr) (r int32) {
  27685. var start uintptr
  27686. var v1, v2 int32
  27687. _, _, _ = start, v1, v2
  27688. if ptr >= end {
  27689. return -int32(4)
  27690. } else {
  27691. if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
  27692. /* This line cannot be executed. The incoming data has already
  27693. * been tokenized once, so incomplete characters like this have
  27694. * already been eliminated from the input. Retaining the paranoia
  27695. * check is still valuable, however.
  27696. */
  27697. return -int32(1) /* LCOV_EXCL_LINE */
  27698. }
  27699. }
  27700. start = ptr
  27701. for int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2)) {
  27702. if int32(*(*int8)(unsafe.Pointer(ptr))) == 0 {
  27703. v1 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr + 1)))))))
  27704. } else {
  27705. v1 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr)), *(*int8)(unsafe.Pointer(ptr + 1)))
  27706. }
  27707. switch v1 {
  27708. case int32(_BT_LEAD2):
  27709. ptr += uintptr(2) /* NOTE: The encoding has already been validated. */
  27710. case int32(_BT_LEAD3):
  27711. ptr += uintptr(3) /* NOTE: The encoding has already been validated. */
  27712. case int32(_BT_LEAD4):
  27713. ptr += uintptr(4) /* NOTE: The encoding has already been validated. */
  27714. case int32(_BT_AMP):
  27715. if ptr == start {
  27716. return _big2_scanRef(tls, enc, ptr+uintptr(2), end, nextTokPtr)
  27717. }
  27718. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  27719. return int32(m_XML_TOK_DATA_CHARS)
  27720. case int32(_BT_LT):
  27721. /* this is for inside entity references */
  27722. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  27723. return m_XML_TOK_INVALID
  27724. case int32(_BT_LF):
  27725. if ptr == start {
  27726. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(2)
  27727. return int32(m_XML_TOK_DATA_NEWLINE)
  27728. }
  27729. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  27730. return int32(m_XML_TOK_DATA_CHARS)
  27731. case int32(_BT_CR):
  27732. if ptr == start {
  27733. ptr += uintptr(2)
  27734. if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
  27735. return -int32(3)
  27736. }
  27737. if int32(*(*int8)(unsafe.Pointer(ptr))) == 0 {
  27738. v2 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr + 1)))))))
  27739. } else {
  27740. v2 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr)), *(*int8)(unsafe.Pointer(ptr + 1)))
  27741. }
  27742. if v2 == int32(_BT_LF) {
  27743. ptr += uintptr(2)
  27744. }
  27745. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  27746. return int32(m_XML_TOK_DATA_NEWLINE)
  27747. }
  27748. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  27749. return int32(m_XML_TOK_DATA_CHARS)
  27750. case int32(_BT_S):
  27751. if ptr == start {
  27752. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(2)
  27753. return int32(m_XML_TOK_ATTRIBUTE_VALUE_S)
  27754. }
  27755. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  27756. return int32(m_XML_TOK_DATA_CHARS)
  27757. default:
  27758. ptr += uintptr(2)
  27759. break
  27760. }
  27761. }
  27762. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  27763. return int32(m_XML_TOK_DATA_CHARS)
  27764. }
  27765. func _big2_entityValueTok(tls *libc.TLS, enc uintptr, ptr uintptr, end uintptr, nextTokPtr uintptr) (r int32) {
  27766. var start uintptr
  27767. var tok, v1, v2, v3 int32
  27768. _, _, _, _, _ = start, tok, v1, v2, v3
  27769. if ptr >= end {
  27770. return -int32(4)
  27771. } else {
  27772. if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
  27773. /* This line cannot be executed. The incoming data has already
  27774. * been tokenized once, so incomplete characters like this have
  27775. * already been eliminated from the input. Retaining the paranoia
  27776. * check is still valuable, however.
  27777. */
  27778. return -int32(1) /* LCOV_EXCL_LINE */
  27779. }
  27780. }
  27781. start = ptr
  27782. for int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2)) {
  27783. if int32(*(*int8)(unsafe.Pointer(ptr))) == 0 {
  27784. v1 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr + 1)))))))
  27785. } else {
  27786. v1 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr)), *(*int8)(unsafe.Pointer(ptr + 1)))
  27787. }
  27788. switch v1 {
  27789. case int32(_BT_LEAD2):
  27790. ptr += uintptr(2) /* NOTE: The encoding has already been validated. */
  27791. case int32(_BT_LEAD3):
  27792. ptr += uintptr(3) /* NOTE: The encoding has already been validated. */
  27793. case int32(_BT_LEAD4):
  27794. ptr += uintptr(4) /* NOTE: The encoding has already been validated. */
  27795. case int32(_BT_AMP):
  27796. if ptr == start {
  27797. return _big2_scanRef(tls, enc, ptr+uintptr(2), end, nextTokPtr)
  27798. }
  27799. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  27800. return int32(m_XML_TOK_DATA_CHARS)
  27801. case int32(_BT_PERCNT):
  27802. if ptr == start {
  27803. tok = _big2_scanPercent(tls, enc, ptr+uintptr(2), end, nextTokPtr)
  27804. if tok == int32(m_XML_TOK_PERCENT) {
  27805. v2 = m_XML_TOK_INVALID
  27806. } else {
  27807. v2 = tok
  27808. }
  27809. return v2
  27810. }
  27811. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  27812. return int32(m_XML_TOK_DATA_CHARS)
  27813. case int32(_BT_LF):
  27814. if ptr == start {
  27815. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(2)
  27816. return int32(m_XML_TOK_DATA_NEWLINE)
  27817. }
  27818. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  27819. return int32(m_XML_TOK_DATA_CHARS)
  27820. case int32(_BT_CR):
  27821. if ptr == start {
  27822. ptr += uintptr(2)
  27823. if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
  27824. return -int32(3)
  27825. }
  27826. if int32(*(*int8)(unsafe.Pointer(ptr))) == 0 {
  27827. v3 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr + 1)))))))
  27828. } else {
  27829. v3 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr)), *(*int8)(unsafe.Pointer(ptr + 1)))
  27830. }
  27831. if v3 == int32(_BT_LF) {
  27832. ptr += uintptr(2)
  27833. }
  27834. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  27835. return int32(m_XML_TOK_DATA_NEWLINE)
  27836. }
  27837. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  27838. return int32(m_XML_TOK_DATA_CHARS)
  27839. default:
  27840. ptr += uintptr(2)
  27841. break
  27842. }
  27843. }
  27844. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  27845. return int32(m_XML_TOK_DATA_CHARS)
  27846. }
  27847. func _big2_ignoreSectionTok(tls *libc.TLS, enc uintptr, ptr uintptr, end uintptr, nextTokPtr uintptr) (r int32) {
  27848. var level, v1 int32
  27849. var n Tsize_t
  27850. _, _, _ = level, n, v1
  27851. level = 0
  27852. if int32(2) > int32(1) {
  27853. n = libc.Uint64FromInt64(int64(end) - int64(ptr))
  27854. if n&libc.Uint64FromInt32(libc.Int32FromInt32(2)-libc.Int32FromInt32(1)) != 0 {
  27855. n &= libc.Uint64FromInt32(^(libc.Int32FromInt32(2) - libc.Int32FromInt32(1)))
  27856. end = ptr + uintptr(n)
  27857. }
  27858. }
  27859. for int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2)) {
  27860. if int32(*(*int8)(unsafe.Pointer(ptr))) == 0 {
  27861. v1 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr + 1)))))))
  27862. } else {
  27863. v1 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr)), *(*int8)(unsafe.Pointer(ptr + 1)))
  27864. }
  27865. switch v1 {
  27866. case int32(_BT_LEAD2):
  27867. if int64(end)-int64(ptr) < int64(2) {
  27868. return -int32(2)
  27869. }
  27870. if 0 != 0 {
  27871. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  27872. return m_XML_TOK_INVALID
  27873. }
  27874. ptr += uintptr(2)
  27875. case int32(_BT_LEAD3):
  27876. if int64(end)-int64(ptr) < int64(3) {
  27877. return -int32(2)
  27878. }
  27879. if 0 != 0 {
  27880. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  27881. return m_XML_TOK_INVALID
  27882. }
  27883. ptr += uintptr(3)
  27884. case int32(_BT_LEAD4):
  27885. if int64(end)-int64(ptr) < int64(4) {
  27886. return -int32(2)
  27887. }
  27888. if 0 != 0 {
  27889. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  27890. return m_XML_TOK_INVALID
  27891. }
  27892. ptr += uintptr(4)
  27893. case int32(_BT_NONXML):
  27894. fallthrough
  27895. case int32(_BT_MALFORM):
  27896. fallthrough
  27897. case int32(_BT_TRAIL):
  27898. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  27899. return m_XML_TOK_INVALID
  27900. case int32(_BT_LT):
  27901. ptr += uintptr(2)
  27902. if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
  27903. return -int32(1)
  27904. }
  27905. if int32(*(*int8)(unsafe.Pointer(ptr))) == 0 && int32(*(*int8)(unsafe.Pointer(ptr + 1))) == int32(m_ASCII_EXCL2) {
  27906. ptr += uintptr(2)
  27907. if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
  27908. return -int32(1)
  27909. }
  27910. if int32(*(*int8)(unsafe.Pointer(ptr))) == 0 && int32(*(*int8)(unsafe.Pointer(ptr + 1))) == int32(m_ASCII_LSQB1) {
  27911. level++
  27912. ptr += uintptr(2)
  27913. }
  27914. }
  27915. case int32(_BT_RSQB):
  27916. ptr += uintptr(2)
  27917. if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
  27918. return -int32(1)
  27919. }
  27920. if int32(*(*int8)(unsafe.Pointer(ptr))) == 0 && int32(*(*int8)(unsafe.Pointer(ptr + 1))) == int32(m_ASCII_RSQB1) {
  27921. ptr += uintptr(2)
  27922. if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
  27923. return -int32(1)
  27924. }
  27925. if int32(*(*int8)(unsafe.Pointer(ptr))) == 0 && int32(*(*int8)(unsafe.Pointer(ptr + 1))) == int32(m_ASCII_GT1) {
  27926. ptr += uintptr(2)
  27927. if level == 0 {
  27928. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  27929. return int32(m_XML_TOK_IGNORE_SECT)
  27930. }
  27931. level--
  27932. }
  27933. }
  27934. default:
  27935. ptr += uintptr(2)
  27936. break
  27937. }
  27938. }
  27939. return -int32(1)
  27940. }
  27941. func _big2_isPublicId(tls *libc.TLS, enc uintptr, ptr uintptr, end uintptr, badPtr uintptr) (r int32) {
  27942. var v2, v3, v4 int32
  27943. _, _, _ = v2, v3, v4
  27944. ptr += uintptr(2)
  27945. end -= uintptr(2)
  27946. for {
  27947. if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
  27948. break
  27949. }
  27950. if int32(*(*int8)(unsafe.Pointer(ptr))) == 0 {
  27951. v2 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr + 1)))))))
  27952. } else {
  27953. v2 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr)), *(*int8)(unsafe.Pointer(ptr + 1)))
  27954. }
  27955. switch v2 {
  27956. case int32(_BT_DIGIT):
  27957. fallthrough
  27958. case int32(_BT_HEX):
  27959. fallthrough
  27960. case int32(_BT_MINUS):
  27961. fallthrough
  27962. case int32(_BT_APOS):
  27963. fallthrough
  27964. case int32(_BT_LPAR):
  27965. fallthrough
  27966. case int32(_BT_RPAR):
  27967. fallthrough
  27968. case int32(_BT_PLUS):
  27969. fallthrough
  27970. case int32(_BT_COMMA):
  27971. fallthrough
  27972. case int32(_BT_SOL):
  27973. fallthrough
  27974. case int32(_BT_EQUALS):
  27975. fallthrough
  27976. case int32(_BT_QUEST):
  27977. fallthrough
  27978. case int32(_BT_CR):
  27979. fallthrough
  27980. case int32(_BT_LF):
  27981. fallthrough
  27982. case int32(_BT_SEMI):
  27983. fallthrough
  27984. case int32(_BT_EXCL):
  27985. fallthrough
  27986. case int32(_BT_AST):
  27987. fallthrough
  27988. case int32(_BT_PERCNT):
  27989. fallthrough
  27990. case int32(_BT_NUM):
  27991. fallthrough
  27992. case int32(_BT_COLON):
  27993. case int32(_BT_S):
  27994. if int32(*(*int8)(unsafe.Pointer(ptr))) == 0 && int32(*(*int8)(unsafe.Pointer(ptr + 1))) == int32(m_ASCII_TAB1) {
  27995. *(*uintptr)(unsafe.Pointer(badPtr)) = ptr
  27996. return 0
  27997. }
  27998. case int32(_BT_NAME):
  27999. fallthrough
  28000. case int32(_BT_NMSTRT):
  28001. if int32(*(*int8)(unsafe.Pointer(ptr))) == 0 {
  28002. v3 = int32(*(*int8)(unsafe.Pointer(ptr + 1)))
  28003. } else {
  28004. v3 = -int32(1)
  28005. }
  28006. if !(v3 & ^libc.Int32FromInt32(0x7f) != 0) {
  28007. break
  28008. }
  28009. /* fall through */
  28010. fallthrough
  28011. default:
  28012. if int32(*(*int8)(unsafe.Pointer(ptr))) == 0 {
  28013. v4 = int32(*(*int8)(unsafe.Pointer(ptr + 1)))
  28014. } else {
  28015. v4 = -int32(1)
  28016. }
  28017. switch v4 {
  28018. case int32(0x24): /* $ */
  28019. fallthrough
  28020. case int32(0x40): /* @ */
  28021. default:
  28022. *(*uintptr)(unsafe.Pointer(badPtr)) = ptr
  28023. return 0
  28024. }
  28025. break
  28026. }
  28027. goto _1
  28028. _1:
  28029. ;
  28030. ptr += uintptr(2)
  28031. }
  28032. return int32(1)
  28033. }
  28034. /* This must only be called for a well-formed start-tag or empty
  28035. element tag. Returns the number of attributes. Pointers to the
  28036. first attsMax attributes are stored in atts.
  28037. */
  28038. func _big2_getAtts(tls *libc.TLS, enc uintptr, ptr uintptr, attsMax int32, atts uintptr) (r int32) {
  28039. var nAtts, open, state, v2, v3, v5, v7 int32
  28040. var v4, v6, v8, v9 bool
  28041. _, _, _, _, _, _, _, _, _, _, _ = nAtts, open, state, v2, v3, v4, v5, v6, v7, v8, v9
  28042. state = 1
  28043. nAtts = 0
  28044. open = 0 /* defined when state == inValue;
  28045. initialization just to shut up compilers */
  28046. ptr += uintptr(2)
  28047. for {
  28048. if int32(*(*int8)(unsafe.Pointer(ptr))) == 0 {
  28049. v2 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr + 1)))))))
  28050. } else {
  28051. v2 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr)), *(*int8)(unsafe.Pointer(ptr + 1)))
  28052. }
  28053. switch v2 {
  28054. case int32(_BT_LEAD2):
  28055. if state == 0 {
  28056. if nAtts < attsMax {
  28057. (*(*TATTRIBUTE)(unsafe.Pointer(atts + uintptr(nAtts)*32))).Fname = ptr
  28058. (*(*TATTRIBUTE)(unsafe.Pointer(atts + uintptr(nAtts)*32))).Fnormalized = int8(1)
  28059. }
  28060. state = 1
  28061. }
  28062. ptr += uintptr(libc.Int32FromInt32(2) - libc.Int32FromInt32(2))
  28063. case int32(_BT_LEAD3):
  28064. if state == 0 {
  28065. if nAtts < attsMax {
  28066. (*(*TATTRIBUTE)(unsafe.Pointer(atts + uintptr(nAtts)*32))).Fname = ptr
  28067. (*(*TATTRIBUTE)(unsafe.Pointer(atts + uintptr(nAtts)*32))).Fnormalized = int8(1)
  28068. }
  28069. state = 1
  28070. }
  28071. ptr += uintptr(libc.Int32FromInt32(3) - libc.Int32FromInt32(2))
  28072. case int32(_BT_LEAD4):
  28073. if state == 0 {
  28074. if nAtts < attsMax {
  28075. (*(*TATTRIBUTE)(unsafe.Pointer(atts + uintptr(nAtts)*32))).Fname = ptr
  28076. (*(*TATTRIBUTE)(unsafe.Pointer(atts + uintptr(nAtts)*32))).Fnormalized = int8(1)
  28077. }
  28078. state = 1
  28079. }
  28080. ptr += uintptr(libc.Int32FromInt32(4) - libc.Int32FromInt32(2))
  28081. case int32(_BT_NONASCII):
  28082. fallthrough
  28083. case int32(_BT_NMSTRT):
  28084. fallthrough
  28085. case int32(_BT_HEX):
  28086. if state == 0 {
  28087. if nAtts < attsMax {
  28088. (*(*TATTRIBUTE)(unsafe.Pointer(atts + uintptr(nAtts)*32))).Fname = ptr
  28089. (*(*TATTRIBUTE)(unsafe.Pointer(atts + uintptr(nAtts)*32))).Fnormalized = int8(1)
  28090. }
  28091. state = 1
  28092. }
  28093. case int32(_BT_QUOT):
  28094. if state != 2 {
  28095. if nAtts < attsMax {
  28096. (*(*TATTRIBUTE)(unsafe.Pointer(atts + uintptr(nAtts)*32))).FvaluePtr = ptr + uintptr(2)
  28097. }
  28098. state = 2
  28099. open = int32(_BT_QUOT)
  28100. } else {
  28101. if open == int32(_BT_QUOT) {
  28102. state = 0
  28103. if nAtts < attsMax {
  28104. (*(*TATTRIBUTE)(unsafe.Pointer(atts + uintptr(nAtts)*32))).FvalueEnd = ptr
  28105. }
  28106. nAtts++
  28107. }
  28108. }
  28109. case int32(_BT_APOS):
  28110. if state != 2 {
  28111. if nAtts < attsMax {
  28112. (*(*TATTRIBUTE)(unsafe.Pointer(atts + uintptr(nAtts)*32))).FvaluePtr = ptr + uintptr(2)
  28113. }
  28114. state = 2
  28115. open = int32(_BT_APOS)
  28116. } else {
  28117. if open == int32(_BT_APOS) {
  28118. state = 0
  28119. if nAtts < attsMax {
  28120. (*(*TATTRIBUTE)(unsafe.Pointer(atts + uintptr(nAtts)*32))).FvalueEnd = ptr
  28121. }
  28122. nAtts++
  28123. }
  28124. }
  28125. case int32(_BT_AMP):
  28126. if nAtts < attsMax {
  28127. (*(*TATTRIBUTE)(unsafe.Pointer(atts + uintptr(nAtts)*32))).Fnormalized = 0
  28128. }
  28129. case int32(_BT_S):
  28130. if state == 1 {
  28131. state = 0
  28132. } else {
  28133. if v9 = state == 2 && nAtts < attsMax && (*(*TATTRIBUTE)(unsafe.Pointer(atts + uintptr(nAtts)*32))).Fnormalized != 0; v9 {
  28134. if v4 = ptr == (*(*TATTRIBUTE)(unsafe.Pointer(atts + uintptr(nAtts)*32))).FvaluePtr; !v4 {
  28135. if int32(*(*int8)(unsafe.Pointer(ptr))) == 0 {
  28136. v3 = int32(*(*int8)(unsafe.Pointer(ptr + 1)))
  28137. } else {
  28138. v3 = -int32(1)
  28139. }
  28140. }
  28141. if v6 = v4 || v3 != int32(m_ASCII_SPACE1); !v6 {
  28142. if int32(*(*int8)(unsafe.Pointer(ptr + libc.UintptrFromInt32(2)))) == 0 {
  28143. v5 = int32(*(*int8)(unsafe.Pointer(ptr + libc.UintptrFromInt32(2) + 1)))
  28144. } else {
  28145. v5 = -int32(1)
  28146. }
  28147. }
  28148. if v8 = v6 || v5 == int32(m_ASCII_SPACE1); !v8 {
  28149. if int32(*(*int8)(unsafe.Pointer(ptr + libc.UintptrFromInt32(2)))) == 0 {
  28150. v7 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr + libc.UintptrFromInt32(2) + 1)))))))
  28151. } else {
  28152. v7 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr + libc.UintptrFromInt32(2))), *(*int8)(unsafe.Pointer(ptr + libc.UintptrFromInt32(2) + 1)))
  28153. }
  28154. }
  28155. }
  28156. if v9 && (v8 || v7 == open) {
  28157. (*(*TATTRIBUTE)(unsafe.Pointer(atts + uintptr(nAtts)*32))).Fnormalized = 0
  28158. }
  28159. }
  28160. case int32(_BT_CR):
  28161. fallthrough
  28162. case int32(_BT_LF):
  28163. /* This case ensures that the first attribute name is counted
  28164. Apart from that we could just change state on the quote. */
  28165. if state == 1 {
  28166. state = 0
  28167. } else {
  28168. if state == 2 && nAtts < attsMax {
  28169. (*(*TATTRIBUTE)(unsafe.Pointer(atts + uintptr(nAtts)*32))).Fnormalized = 0
  28170. }
  28171. }
  28172. case int32(_BT_GT):
  28173. fallthrough
  28174. case int32(_BT_SOL):
  28175. if state != 2 {
  28176. return nAtts
  28177. }
  28178. default:
  28179. break
  28180. }
  28181. goto _1
  28182. _1:
  28183. ;
  28184. ptr += uintptr(2)
  28185. }
  28186. /* not reached */
  28187. return r
  28188. }
  28189. func _big2_charRefNumber(tls *libc.TLS, enc uintptr, ptr uintptr) (r int32) {
  28190. var c, c1, result, v2, v4 int32
  28191. _, _, _, _, _ = c, c1, result, v2, v4
  28192. result = 0
  28193. /* skip &# */
  28194. _ = enc
  28195. ptr += uintptr(libc.Int32FromInt32(2) * libc.Int32FromInt32(2))
  28196. if int32(*(*int8)(unsafe.Pointer(ptr))) == 0 && int32(*(*int8)(unsafe.Pointer(ptr + 1))) == int32(m_ASCII_x2) {
  28197. ptr += uintptr(2)
  28198. for {
  28199. if !!(int32(*(*int8)(unsafe.Pointer(ptr))) == 0 && int32(*(*int8)(unsafe.Pointer(ptr + 1))) == int32(m_ASCII_SEMI1)) {
  28200. break
  28201. }
  28202. if int32(*(*int8)(unsafe.Pointer(ptr))) == 0 {
  28203. v2 = int32(*(*int8)(unsafe.Pointer(ptr + 1)))
  28204. } else {
  28205. v2 = -int32(1)
  28206. }
  28207. c = v2
  28208. switch c {
  28209. case int32(m_ASCII_02):
  28210. fallthrough
  28211. case int32(m_ASCII_12):
  28212. fallthrough
  28213. case int32(m_ASCII_22):
  28214. fallthrough
  28215. case int32(m_ASCII_32):
  28216. fallthrough
  28217. case int32(m_ASCII_41):
  28218. fallthrough
  28219. case int32(m_ASCII_51):
  28220. fallthrough
  28221. case int32(m_ASCII_61):
  28222. fallthrough
  28223. case int32(m_ASCII_71):
  28224. fallthrough
  28225. case int32(m_ASCII_82):
  28226. fallthrough
  28227. case int32(m_ASCII_92):
  28228. result <<= int32(4)
  28229. result |= c - int32(m_ASCII_02)
  28230. case int32(m_ASCII_A):
  28231. fallthrough
  28232. case int32(m_ASCII_B1):
  28233. fallthrough
  28234. case int32(m_ASCII_C):
  28235. fallthrough
  28236. case int32(m_ASCII_D):
  28237. fallthrough
  28238. case int32(m_ASCII_E):
  28239. fallthrough
  28240. case int32(m_ASCII_F):
  28241. result <<= int32(4)
  28242. result += int32(10) + (c - int32(m_ASCII_A))
  28243. case int32(m_ASCII_a2):
  28244. fallthrough
  28245. case int32(m_ASCII_b1):
  28246. fallthrough
  28247. case int32(m_ASCII_c2):
  28248. fallthrough
  28249. case int32(m_ASCII_d1):
  28250. fallthrough
  28251. case int32(m_ASCII_e2):
  28252. fallthrough
  28253. case int32(m_ASCII_f1):
  28254. result <<= int32(4)
  28255. result += int32(10) + (c - int32(m_ASCII_a2))
  28256. break
  28257. }
  28258. if result >= int32(0x110000) {
  28259. return -int32(1)
  28260. }
  28261. goto _1
  28262. _1:
  28263. ;
  28264. ptr += uintptr(2)
  28265. }
  28266. } else {
  28267. for {
  28268. if !!(int32(*(*int8)(unsafe.Pointer(ptr))) == 0 && int32(*(*int8)(unsafe.Pointer(ptr + 1))) == int32(m_ASCII_SEMI1)) {
  28269. break
  28270. }
  28271. if int32(*(*int8)(unsafe.Pointer(ptr))) == 0 {
  28272. v4 = int32(*(*int8)(unsafe.Pointer(ptr + 1)))
  28273. } else {
  28274. v4 = -int32(1)
  28275. }
  28276. c1 = v4
  28277. result *= int32(10)
  28278. result += c1 - int32(m_ASCII_02)
  28279. if result >= int32(0x110000) {
  28280. return -int32(1)
  28281. }
  28282. goto _3
  28283. _3:
  28284. ;
  28285. ptr += uintptr(2)
  28286. }
  28287. }
  28288. return _checkCharRefNumber(tls, result)
  28289. }
  28290. func _big2_predefinedEntityName(tls *libc.TLS, enc uintptr, ptr uintptr, end uintptr) (r int32) {
  28291. var v1, v2 int32
  28292. _, _ = v1, v2
  28293. _ = enc
  28294. switch (int64(end) - int64(ptr)) / libc.Int64FromInt32(2) {
  28295. case int64(2):
  28296. if int32(*(*int8)(unsafe.Pointer(ptr + libc.UintptrFromInt32(2)))) == 0 && int32(*(*int8)(unsafe.Pointer(ptr + libc.UintptrFromInt32(2) + 1))) == int32(m_ASCII_t2) {
  28297. if int32(*(*int8)(unsafe.Pointer(ptr))) == 0 {
  28298. v1 = int32(*(*int8)(unsafe.Pointer(ptr + 1)))
  28299. } else {
  28300. v1 = -int32(1)
  28301. }
  28302. switch v1 {
  28303. case int32(m_ASCII_l2):
  28304. return int32(m_ASCII_LT1)
  28305. case int32(m_ASCII_g2):
  28306. return int32(m_ASCII_GT1)
  28307. }
  28308. }
  28309. case int64(3):
  28310. if int32(*(*int8)(unsafe.Pointer(ptr))) == 0 && int32(*(*int8)(unsafe.Pointer(ptr + 1))) == int32(m_ASCII_a2) {
  28311. ptr += uintptr(2)
  28312. if int32(*(*int8)(unsafe.Pointer(ptr))) == 0 && int32(*(*int8)(unsafe.Pointer(ptr + 1))) == int32(m_ASCII_m2) {
  28313. ptr += uintptr(2)
  28314. if int32(*(*int8)(unsafe.Pointer(ptr))) == 0 && int32(*(*int8)(unsafe.Pointer(ptr + 1))) == int32(m_ASCII_p2) {
  28315. return int32(m_ASCII_AMP1)
  28316. }
  28317. }
  28318. }
  28319. case int64(4):
  28320. if int32(*(*int8)(unsafe.Pointer(ptr))) == 0 {
  28321. v2 = int32(*(*int8)(unsafe.Pointer(ptr + 1)))
  28322. } else {
  28323. v2 = -int32(1)
  28324. }
  28325. switch v2 {
  28326. case int32(m_ASCII_q1):
  28327. ptr += uintptr(2)
  28328. if int32(*(*int8)(unsafe.Pointer(ptr))) == 0 && int32(*(*int8)(unsafe.Pointer(ptr + 1))) == int32(m_ASCII_u1) {
  28329. ptr += uintptr(2)
  28330. if int32(*(*int8)(unsafe.Pointer(ptr))) == 0 && int32(*(*int8)(unsafe.Pointer(ptr + 1))) == int32(m_ASCII_o2) {
  28331. ptr += uintptr(2)
  28332. if int32(*(*int8)(unsafe.Pointer(ptr))) == 0 && int32(*(*int8)(unsafe.Pointer(ptr + 1))) == int32(m_ASCII_t2) {
  28333. return int32(m_ASCII_QUOT1)
  28334. }
  28335. }
  28336. }
  28337. case int32(m_ASCII_a2):
  28338. ptr += uintptr(2)
  28339. if int32(*(*int8)(unsafe.Pointer(ptr))) == 0 && int32(*(*int8)(unsafe.Pointer(ptr + 1))) == int32(m_ASCII_p2) {
  28340. ptr += uintptr(2)
  28341. if int32(*(*int8)(unsafe.Pointer(ptr))) == 0 && int32(*(*int8)(unsafe.Pointer(ptr + 1))) == int32(m_ASCII_o2) {
  28342. ptr += uintptr(2)
  28343. if int32(*(*int8)(unsafe.Pointer(ptr))) == 0 && int32(*(*int8)(unsafe.Pointer(ptr + 1))) == int32(m_ASCII_s2) {
  28344. return int32(m_ASCII_APOS1)
  28345. }
  28346. }
  28347. }
  28348. break
  28349. }
  28350. }
  28351. return 0
  28352. }
  28353. func _big2_nameMatchesAscii(tls *libc.TLS, enc uintptr, ptr1 uintptr, end1 uintptr, ptr2 uintptr) (r int32) {
  28354. _ = enc
  28355. for {
  28356. if !(*(*int8)(unsafe.Pointer(ptr2)) != 0) {
  28357. break
  28358. }
  28359. if int64(end1)-int64(ptr1) < int64(2) {
  28360. /* This line cannot be executed. The incoming data has already
  28361. * been tokenized once, so incomplete characters like this have
  28362. * already been eliminated from the input. Retaining the
  28363. * paranoia check is still valuable, however.
  28364. */
  28365. return 0 /* LCOV_EXCL_LINE */
  28366. }
  28367. if !(int32(*(*int8)(unsafe.Pointer(ptr1))) == 0 && int32(*(*int8)(unsafe.Pointer(ptr1 + 1))) == int32(*(*int8)(unsafe.Pointer(ptr2)))) {
  28368. return 0
  28369. }
  28370. goto _1
  28371. _1:
  28372. ;
  28373. ptr1 += uintptr(2)
  28374. ptr2++
  28375. }
  28376. return libc.BoolInt32(ptr1 == end1)
  28377. }
  28378. func _big2_nameLength(tls *libc.TLS, enc uintptr, ptr uintptr) (r int32) {
  28379. var start uintptr
  28380. var v2 int32
  28381. _, _ = start, v2
  28382. start = ptr
  28383. for {
  28384. if int32(*(*int8)(unsafe.Pointer(ptr))) == 0 {
  28385. v2 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr + 1)))))))
  28386. } else {
  28387. v2 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr)), *(*int8)(unsafe.Pointer(ptr + 1)))
  28388. }
  28389. switch v2 {
  28390. case int32(_BT_LEAD2):
  28391. ptr += uintptr(2) /* NOTE: The encoding has already been validated. */
  28392. case int32(_BT_LEAD3):
  28393. ptr += uintptr(3) /* NOTE: The encoding has already been validated. */
  28394. case int32(_BT_LEAD4):
  28395. ptr += uintptr(4) /* NOTE: The encoding has already been validated. */
  28396. case int32(_BT_NONASCII):
  28397. fallthrough
  28398. case int32(_BT_NMSTRT):
  28399. fallthrough
  28400. case int32(_BT_COLON):
  28401. fallthrough
  28402. case int32(_BT_HEX):
  28403. fallthrough
  28404. case int32(_BT_DIGIT):
  28405. fallthrough
  28406. case int32(_BT_NAME):
  28407. fallthrough
  28408. case int32(_BT_MINUS):
  28409. ptr += uintptr(2)
  28410. default:
  28411. return int32(int64(ptr) - int64(start))
  28412. }
  28413. goto _1
  28414. _1:
  28415. }
  28416. return r
  28417. }
  28418. func _big2_skipS(tls *libc.TLS, enc uintptr, ptr uintptr) (r uintptr) {
  28419. var v2 int32
  28420. _ = v2
  28421. for {
  28422. if int32(*(*int8)(unsafe.Pointer(ptr))) == 0 {
  28423. v2 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr + 1)))))))
  28424. } else {
  28425. v2 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr)), *(*int8)(unsafe.Pointer(ptr + 1)))
  28426. }
  28427. switch v2 {
  28428. case int32(_BT_LF):
  28429. fallthrough
  28430. case int32(_BT_CR):
  28431. fallthrough
  28432. case int32(_BT_S):
  28433. ptr += uintptr(2)
  28434. default:
  28435. return ptr
  28436. }
  28437. goto _1
  28438. _1:
  28439. }
  28440. return r
  28441. }
  28442. func _big2_updatePosition(tls *libc.TLS, enc uintptr, ptr uintptr, end uintptr, pos uintptr) {
  28443. var v1, v2 int32
  28444. var v3 bool
  28445. _, _, _ = v1, v2, v3
  28446. for int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2)) {
  28447. if int32(*(*int8)(unsafe.Pointer(ptr))) == 0 {
  28448. v1 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr + 1)))))))
  28449. } else {
  28450. v1 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr)), *(*int8)(unsafe.Pointer(ptr + 1)))
  28451. }
  28452. switch v1 {
  28453. case int32(_BT_LEAD2):
  28454. ptr += uintptr(2) /* NOTE: The encoding has already been validated. */
  28455. (*TPOSITION)(unsafe.Pointer(pos)).FcolumnNumber++
  28456. case int32(_BT_LEAD3):
  28457. ptr += uintptr(3) /* NOTE: The encoding has already been validated. */
  28458. (*TPOSITION)(unsafe.Pointer(pos)).FcolumnNumber++
  28459. case int32(_BT_LEAD4):
  28460. ptr += uintptr(4) /* NOTE: The encoding has already been validated. */
  28461. (*TPOSITION)(unsafe.Pointer(pos)).FcolumnNumber++
  28462. case int32(_BT_LF):
  28463. (*TPOSITION)(unsafe.Pointer(pos)).FcolumnNumber = uint64(0)
  28464. (*TPOSITION)(unsafe.Pointer(pos)).FlineNumber++
  28465. ptr += uintptr(2)
  28466. case int32(_BT_CR):
  28467. (*TPOSITION)(unsafe.Pointer(pos)).FlineNumber++
  28468. ptr += uintptr(2)
  28469. if v3 = int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2)); v3 {
  28470. if int32(*(*int8)(unsafe.Pointer(ptr))) == 0 {
  28471. v2 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr + 1)))))))
  28472. } else {
  28473. v2 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr)), *(*int8)(unsafe.Pointer(ptr + 1)))
  28474. }
  28475. }
  28476. if v3 && v2 == int32(_BT_LF) {
  28477. ptr += uintptr(2)
  28478. }
  28479. (*TPOSITION)(unsafe.Pointer(pos)).FcolumnNumber = uint64(0)
  28480. default:
  28481. ptr += uintptr(2)
  28482. (*TPOSITION)(unsafe.Pointer(pos)).FcolumnNumber++
  28483. break
  28484. }
  28485. }
  28486. }
  28487. var _big2_encoding_ns = Tnormal_encoding{
  28488. Fenc: TENCODING{
  28489. Fscanners: [4]TSCANNER{},
  28490. FliteralScanners: [2]TSCANNER{},
  28491. FminBytesPerChar: int32(2),
  28492. },
  28493. Ftype1: [256]uint8{
  28494. 9: uint8(_BT_S),
  28495. 10: uint8(_BT_LF),
  28496. 13: uint8(_BT_CR),
  28497. 32: uint8(_BT_S),
  28498. 33: uint8(_BT_EXCL),
  28499. 34: uint8(_BT_QUOT),
  28500. 35: uint8(_BT_NUM),
  28501. 36: uint8(_BT_OTHER),
  28502. 37: uint8(_BT_PERCNT),
  28503. 38: uint8(_BT_AMP),
  28504. 39: uint8(_BT_APOS),
  28505. 40: uint8(_BT_LPAR),
  28506. 41: uint8(_BT_RPAR),
  28507. 42: uint8(_BT_AST),
  28508. 43: uint8(_BT_PLUS),
  28509. 44: uint8(_BT_COMMA),
  28510. 45: uint8(_BT_MINUS),
  28511. 46: uint8(_BT_NAME),
  28512. 47: uint8(_BT_SOL),
  28513. 48: uint8(_BT_DIGIT),
  28514. 49: uint8(_BT_DIGIT),
  28515. 50: uint8(_BT_DIGIT),
  28516. 51: uint8(_BT_DIGIT),
  28517. 52: uint8(_BT_DIGIT),
  28518. 53: uint8(_BT_DIGIT),
  28519. 54: uint8(_BT_DIGIT),
  28520. 55: uint8(_BT_DIGIT),
  28521. 56: uint8(_BT_DIGIT),
  28522. 57: uint8(_BT_DIGIT),
  28523. 58: uint8(_BT_COLON),
  28524. 59: uint8(_BT_SEMI),
  28525. 60: uint8(_BT_LT),
  28526. 61: uint8(_BT_EQUALS),
  28527. 62: uint8(_BT_GT),
  28528. 63: uint8(_BT_QUEST),
  28529. 64: uint8(_BT_OTHER),
  28530. 65: uint8(_BT_HEX),
  28531. 66: uint8(_BT_HEX),
  28532. 67: uint8(_BT_HEX),
  28533. 68: uint8(_BT_HEX),
  28534. 69: uint8(_BT_HEX),
  28535. 70: uint8(_BT_HEX),
  28536. 71: uint8(_BT_NMSTRT),
  28537. 72: uint8(_BT_NMSTRT),
  28538. 73: uint8(_BT_NMSTRT),
  28539. 74: uint8(_BT_NMSTRT),
  28540. 75: uint8(_BT_NMSTRT),
  28541. 76: uint8(_BT_NMSTRT),
  28542. 77: uint8(_BT_NMSTRT),
  28543. 78: uint8(_BT_NMSTRT),
  28544. 79: uint8(_BT_NMSTRT),
  28545. 80: uint8(_BT_NMSTRT),
  28546. 81: uint8(_BT_NMSTRT),
  28547. 82: uint8(_BT_NMSTRT),
  28548. 83: uint8(_BT_NMSTRT),
  28549. 84: uint8(_BT_NMSTRT),
  28550. 85: uint8(_BT_NMSTRT),
  28551. 86: uint8(_BT_NMSTRT),
  28552. 87: uint8(_BT_NMSTRT),
  28553. 88: uint8(_BT_NMSTRT),
  28554. 89: uint8(_BT_NMSTRT),
  28555. 90: uint8(_BT_NMSTRT),
  28556. 91: uint8(_BT_LSQB),
  28557. 92: uint8(_BT_OTHER),
  28558. 93: uint8(_BT_RSQB),
  28559. 94: uint8(_BT_OTHER),
  28560. 95: uint8(_BT_NMSTRT),
  28561. 96: uint8(_BT_OTHER),
  28562. 97: uint8(_BT_HEX),
  28563. 98: uint8(_BT_HEX),
  28564. 99: uint8(_BT_HEX),
  28565. 100: uint8(_BT_HEX),
  28566. 101: uint8(_BT_HEX),
  28567. 102: uint8(_BT_HEX),
  28568. 103: uint8(_BT_NMSTRT),
  28569. 104: uint8(_BT_NMSTRT),
  28570. 105: uint8(_BT_NMSTRT),
  28571. 106: uint8(_BT_NMSTRT),
  28572. 107: uint8(_BT_NMSTRT),
  28573. 108: uint8(_BT_NMSTRT),
  28574. 109: uint8(_BT_NMSTRT),
  28575. 110: uint8(_BT_NMSTRT),
  28576. 111: uint8(_BT_NMSTRT),
  28577. 112: uint8(_BT_NMSTRT),
  28578. 113: uint8(_BT_NMSTRT),
  28579. 114: uint8(_BT_NMSTRT),
  28580. 115: uint8(_BT_NMSTRT),
  28581. 116: uint8(_BT_NMSTRT),
  28582. 117: uint8(_BT_NMSTRT),
  28583. 118: uint8(_BT_NMSTRT),
  28584. 119: uint8(_BT_NMSTRT),
  28585. 120: uint8(_BT_NMSTRT),
  28586. 121: uint8(_BT_NMSTRT),
  28587. 122: uint8(_BT_NMSTRT),
  28588. 123: uint8(_BT_OTHER),
  28589. 124: uint8(_BT_VERBAR),
  28590. 125: uint8(_BT_OTHER),
  28591. 126: uint8(_BT_OTHER),
  28592. 127: uint8(_BT_OTHER),
  28593. 128: uint8(_BT_OTHER),
  28594. 129: uint8(_BT_OTHER),
  28595. 130: uint8(_BT_OTHER),
  28596. 131: uint8(_BT_OTHER),
  28597. 132: uint8(_BT_OTHER),
  28598. 133: uint8(_BT_OTHER),
  28599. 134: uint8(_BT_OTHER),
  28600. 135: uint8(_BT_OTHER),
  28601. 136: uint8(_BT_OTHER),
  28602. 137: uint8(_BT_OTHER),
  28603. 138: uint8(_BT_OTHER),
  28604. 139: uint8(_BT_OTHER),
  28605. 140: uint8(_BT_OTHER),
  28606. 141: uint8(_BT_OTHER),
  28607. 142: uint8(_BT_OTHER),
  28608. 143: uint8(_BT_OTHER),
  28609. 144: uint8(_BT_OTHER),
  28610. 145: uint8(_BT_OTHER),
  28611. 146: uint8(_BT_OTHER),
  28612. 147: uint8(_BT_OTHER),
  28613. 148: uint8(_BT_OTHER),
  28614. 149: uint8(_BT_OTHER),
  28615. 150: uint8(_BT_OTHER),
  28616. 151: uint8(_BT_OTHER),
  28617. 152: uint8(_BT_OTHER),
  28618. 153: uint8(_BT_OTHER),
  28619. 154: uint8(_BT_OTHER),
  28620. 155: uint8(_BT_OTHER),
  28621. 156: uint8(_BT_OTHER),
  28622. 157: uint8(_BT_OTHER),
  28623. 158: uint8(_BT_OTHER),
  28624. 159: uint8(_BT_OTHER),
  28625. 160: uint8(_BT_OTHER),
  28626. 161: uint8(_BT_OTHER),
  28627. 162: uint8(_BT_OTHER),
  28628. 163: uint8(_BT_OTHER),
  28629. 164: uint8(_BT_OTHER),
  28630. 165: uint8(_BT_OTHER),
  28631. 166: uint8(_BT_OTHER),
  28632. 167: uint8(_BT_OTHER),
  28633. 168: uint8(_BT_OTHER),
  28634. 169: uint8(_BT_OTHER),
  28635. 170: uint8(_BT_NMSTRT),
  28636. 171: uint8(_BT_OTHER),
  28637. 172: uint8(_BT_OTHER),
  28638. 173: uint8(_BT_OTHER),
  28639. 174: uint8(_BT_OTHER),
  28640. 175: uint8(_BT_OTHER),
  28641. 176: uint8(_BT_OTHER),
  28642. 177: uint8(_BT_OTHER),
  28643. 178: uint8(_BT_OTHER),
  28644. 179: uint8(_BT_OTHER),
  28645. 180: uint8(_BT_OTHER),
  28646. 181: uint8(_BT_NMSTRT),
  28647. 182: uint8(_BT_OTHER),
  28648. 183: uint8(_BT_NAME),
  28649. 184: uint8(_BT_OTHER),
  28650. 185: uint8(_BT_OTHER),
  28651. 186: uint8(_BT_NMSTRT),
  28652. 187: uint8(_BT_OTHER),
  28653. 188: uint8(_BT_OTHER),
  28654. 189: uint8(_BT_OTHER),
  28655. 190: uint8(_BT_OTHER),
  28656. 191: uint8(_BT_OTHER),
  28657. 192: uint8(_BT_NMSTRT),
  28658. 193: uint8(_BT_NMSTRT),
  28659. 194: uint8(_BT_NMSTRT),
  28660. 195: uint8(_BT_NMSTRT),
  28661. 196: uint8(_BT_NMSTRT),
  28662. 197: uint8(_BT_NMSTRT),
  28663. 198: uint8(_BT_NMSTRT),
  28664. 199: uint8(_BT_NMSTRT),
  28665. 200: uint8(_BT_NMSTRT),
  28666. 201: uint8(_BT_NMSTRT),
  28667. 202: uint8(_BT_NMSTRT),
  28668. 203: uint8(_BT_NMSTRT),
  28669. 204: uint8(_BT_NMSTRT),
  28670. 205: uint8(_BT_NMSTRT),
  28671. 206: uint8(_BT_NMSTRT),
  28672. 207: uint8(_BT_NMSTRT),
  28673. 208: uint8(_BT_NMSTRT),
  28674. 209: uint8(_BT_NMSTRT),
  28675. 210: uint8(_BT_NMSTRT),
  28676. 211: uint8(_BT_NMSTRT),
  28677. 212: uint8(_BT_NMSTRT),
  28678. 213: uint8(_BT_NMSTRT),
  28679. 214: uint8(_BT_NMSTRT),
  28680. 215: uint8(_BT_OTHER),
  28681. 216: uint8(_BT_NMSTRT),
  28682. 217: uint8(_BT_NMSTRT),
  28683. 218: uint8(_BT_NMSTRT),
  28684. 219: uint8(_BT_NMSTRT),
  28685. 220: uint8(_BT_NMSTRT),
  28686. 221: uint8(_BT_NMSTRT),
  28687. 222: uint8(_BT_NMSTRT),
  28688. 223: uint8(_BT_NMSTRT),
  28689. 224: uint8(_BT_NMSTRT),
  28690. 225: uint8(_BT_NMSTRT),
  28691. 226: uint8(_BT_NMSTRT),
  28692. 227: uint8(_BT_NMSTRT),
  28693. 228: uint8(_BT_NMSTRT),
  28694. 229: uint8(_BT_NMSTRT),
  28695. 230: uint8(_BT_NMSTRT),
  28696. 231: uint8(_BT_NMSTRT),
  28697. 232: uint8(_BT_NMSTRT),
  28698. 233: uint8(_BT_NMSTRT),
  28699. 234: uint8(_BT_NMSTRT),
  28700. 235: uint8(_BT_NMSTRT),
  28701. 236: uint8(_BT_NMSTRT),
  28702. 237: uint8(_BT_NMSTRT),
  28703. 238: uint8(_BT_NMSTRT),
  28704. 239: uint8(_BT_NMSTRT),
  28705. 240: uint8(_BT_NMSTRT),
  28706. 241: uint8(_BT_NMSTRT),
  28707. 242: uint8(_BT_NMSTRT),
  28708. 243: uint8(_BT_NMSTRT),
  28709. 244: uint8(_BT_NMSTRT),
  28710. 245: uint8(_BT_NMSTRT),
  28711. 246: uint8(_BT_NMSTRT),
  28712. 247: uint8(_BT_OTHER),
  28713. 248: uint8(_BT_NMSTRT),
  28714. 249: uint8(_BT_NMSTRT),
  28715. 250: uint8(_BT_NMSTRT),
  28716. 251: uint8(_BT_NMSTRT),
  28717. 252: uint8(_BT_NMSTRT),
  28718. 253: uint8(_BT_NMSTRT),
  28719. 254: uint8(_BT_NMSTRT),
  28720. 255: uint8(_BT_NMSTRT),
  28721. },
  28722. }
  28723. func init() {
  28724. p := unsafe.Pointer(&_big2_encoding_ns)
  28725. *(*uintptr)(unsafe.Add(p, 0)) = __ccgo_fp(_big2_prologTok)
  28726. *(*uintptr)(unsafe.Add(p, 8)) = __ccgo_fp(_big2_contentTok)
  28727. *(*uintptr)(unsafe.Add(p, 16)) = __ccgo_fp(_big2_cdataSectionTok)
  28728. *(*uintptr)(unsafe.Add(p, 24)) = __ccgo_fp(_big2_ignoreSectionTok)
  28729. *(*uintptr)(unsafe.Add(p, 32)) = __ccgo_fp(_big2_attributeValueTok)
  28730. *(*uintptr)(unsafe.Add(p, 40)) = __ccgo_fp(_big2_entityValueTok)
  28731. *(*uintptr)(unsafe.Add(p, 48)) = __ccgo_fp(_big2_nameMatchesAscii)
  28732. *(*uintptr)(unsafe.Add(p, 56)) = __ccgo_fp(_big2_nameLength)
  28733. *(*uintptr)(unsafe.Add(p, 64)) = __ccgo_fp(_big2_skipS)
  28734. *(*uintptr)(unsafe.Add(p, 72)) = __ccgo_fp(_big2_getAtts)
  28735. *(*uintptr)(unsafe.Add(p, 80)) = __ccgo_fp(_big2_charRefNumber)
  28736. *(*uintptr)(unsafe.Add(p, 88)) = __ccgo_fp(_big2_predefinedEntityName)
  28737. *(*uintptr)(unsafe.Add(p, 96)) = __ccgo_fp(_big2_updatePosition)
  28738. *(*uintptr)(unsafe.Add(p, 104)) = __ccgo_fp(_big2_isPublicId)
  28739. *(*uintptr)(unsafe.Add(p, 112)) = __ccgo_fp(_big2_toUtf8)
  28740. *(*uintptr)(unsafe.Add(p, 120)) = __ccgo_fp(_big2_toUtf16)
  28741. }
  28742. var _big2_encoding = Tnormal_encoding{
  28743. Fenc: TENCODING{
  28744. Fscanners: [4]TSCANNER{},
  28745. FliteralScanners: [2]TSCANNER{},
  28746. FminBytesPerChar: int32(2),
  28747. },
  28748. Ftype1: [256]uint8{
  28749. 9: uint8(_BT_S),
  28750. 10: uint8(_BT_LF),
  28751. 13: uint8(_BT_CR),
  28752. 32: uint8(_BT_S),
  28753. 33: uint8(_BT_EXCL),
  28754. 34: uint8(_BT_QUOT),
  28755. 35: uint8(_BT_NUM),
  28756. 36: uint8(_BT_OTHER),
  28757. 37: uint8(_BT_PERCNT),
  28758. 38: uint8(_BT_AMP),
  28759. 39: uint8(_BT_APOS),
  28760. 40: uint8(_BT_LPAR),
  28761. 41: uint8(_BT_RPAR),
  28762. 42: uint8(_BT_AST),
  28763. 43: uint8(_BT_PLUS),
  28764. 44: uint8(_BT_COMMA),
  28765. 45: uint8(_BT_MINUS),
  28766. 46: uint8(_BT_NAME),
  28767. 47: uint8(_BT_SOL),
  28768. 48: uint8(_BT_DIGIT),
  28769. 49: uint8(_BT_DIGIT),
  28770. 50: uint8(_BT_DIGIT),
  28771. 51: uint8(_BT_DIGIT),
  28772. 52: uint8(_BT_DIGIT),
  28773. 53: uint8(_BT_DIGIT),
  28774. 54: uint8(_BT_DIGIT),
  28775. 55: uint8(_BT_DIGIT),
  28776. 56: uint8(_BT_DIGIT),
  28777. 57: uint8(_BT_DIGIT),
  28778. 58: uint8(_BT_NMSTRT),
  28779. 59: uint8(_BT_SEMI),
  28780. 60: uint8(_BT_LT),
  28781. 61: uint8(_BT_EQUALS),
  28782. 62: uint8(_BT_GT),
  28783. 63: uint8(_BT_QUEST),
  28784. 64: uint8(_BT_OTHER),
  28785. 65: uint8(_BT_HEX),
  28786. 66: uint8(_BT_HEX),
  28787. 67: uint8(_BT_HEX),
  28788. 68: uint8(_BT_HEX),
  28789. 69: uint8(_BT_HEX),
  28790. 70: uint8(_BT_HEX),
  28791. 71: uint8(_BT_NMSTRT),
  28792. 72: uint8(_BT_NMSTRT),
  28793. 73: uint8(_BT_NMSTRT),
  28794. 74: uint8(_BT_NMSTRT),
  28795. 75: uint8(_BT_NMSTRT),
  28796. 76: uint8(_BT_NMSTRT),
  28797. 77: uint8(_BT_NMSTRT),
  28798. 78: uint8(_BT_NMSTRT),
  28799. 79: uint8(_BT_NMSTRT),
  28800. 80: uint8(_BT_NMSTRT),
  28801. 81: uint8(_BT_NMSTRT),
  28802. 82: uint8(_BT_NMSTRT),
  28803. 83: uint8(_BT_NMSTRT),
  28804. 84: uint8(_BT_NMSTRT),
  28805. 85: uint8(_BT_NMSTRT),
  28806. 86: uint8(_BT_NMSTRT),
  28807. 87: uint8(_BT_NMSTRT),
  28808. 88: uint8(_BT_NMSTRT),
  28809. 89: uint8(_BT_NMSTRT),
  28810. 90: uint8(_BT_NMSTRT),
  28811. 91: uint8(_BT_LSQB),
  28812. 92: uint8(_BT_OTHER),
  28813. 93: uint8(_BT_RSQB),
  28814. 94: uint8(_BT_OTHER),
  28815. 95: uint8(_BT_NMSTRT),
  28816. 96: uint8(_BT_OTHER),
  28817. 97: uint8(_BT_HEX),
  28818. 98: uint8(_BT_HEX),
  28819. 99: uint8(_BT_HEX),
  28820. 100: uint8(_BT_HEX),
  28821. 101: uint8(_BT_HEX),
  28822. 102: uint8(_BT_HEX),
  28823. 103: uint8(_BT_NMSTRT),
  28824. 104: uint8(_BT_NMSTRT),
  28825. 105: uint8(_BT_NMSTRT),
  28826. 106: uint8(_BT_NMSTRT),
  28827. 107: uint8(_BT_NMSTRT),
  28828. 108: uint8(_BT_NMSTRT),
  28829. 109: uint8(_BT_NMSTRT),
  28830. 110: uint8(_BT_NMSTRT),
  28831. 111: uint8(_BT_NMSTRT),
  28832. 112: uint8(_BT_NMSTRT),
  28833. 113: uint8(_BT_NMSTRT),
  28834. 114: uint8(_BT_NMSTRT),
  28835. 115: uint8(_BT_NMSTRT),
  28836. 116: uint8(_BT_NMSTRT),
  28837. 117: uint8(_BT_NMSTRT),
  28838. 118: uint8(_BT_NMSTRT),
  28839. 119: uint8(_BT_NMSTRT),
  28840. 120: uint8(_BT_NMSTRT),
  28841. 121: uint8(_BT_NMSTRT),
  28842. 122: uint8(_BT_NMSTRT),
  28843. 123: uint8(_BT_OTHER),
  28844. 124: uint8(_BT_VERBAR),
  28845. 125: uint8(_BT_OTHER),
  28846. 126: uint8(_BT_OTHER),
  28847. 127: uint8(_BT_OTHER),
  28848. 128: uint8(_BT_OTHER),
  28849. 129: uint8(_BT_OTHER),
  28850. 130: uint8(_BT_OTHER),
  28851. 131: uint8(_BT_OTHER),
  28852. 132: uint8(_BT_OTHER),
  28853. 133: uint8(_BT_OTHER),
  28854. 134: uint8(_BT_OTHER),
  28855. 135: uint8(_BT_OTHER),
  28856. 136: uint8(_BT_OTHER),
  28857. 137: uint8(_BT_OTHER),
  28858. 138: uint8(_BT_OTHER),
  28859. 139: uint8(_BT_OTHER),
  28860. 140: uint8(_BT_OTHER),
  28861. 141: uint8(_BT_OTHER),
  28862. 142: uint8(_BT_OTHER),
  28863. 143: uint8(_BT_OTHER),
  28864. 144: uint8(_BT_OTHER),
  28865. 145: uint8(_BT_OTHER),
  28866. 146: uint8(_BT_OTHER),
  28867. 147: uint8(_BT_OTHER),
  28868. 148: uint8(_BT_OTHER),
  28869. 149: uint8(_BT_OTHER),
  28870. 150: uint8(_BT_OTHER),
  28871. 151: uint8(_BT_OTHER),
  28872. 152: uint8(_BT_OTHER),
  28873. 153: uint8(_BT_OTHER),
  28874. 154: uint8(_BT_OTHER),
  28875. 155: uint8(_BT_OTHER),
  28876. 156: uint8(_BT_OTHER),
  28877. 157: uint8(_BT_OTHER),
  28878. 158: uint8(_BT_OTHER),
  28879. 159: uint8(_BT_OTHER),
  28880. 160: uint8(_BT_OTHER),
  28881. 161: uint8(_BT_OTHER),
  28882. 162: uint8(_BT_OTHER),
  28883. 163: uint8(_BT_OTHER),
  28884. 164: uint8(_BT_OTHER),
  28885. 165: uint8(_BT_OTHER),
  28886. 166: uint8(_BT_OTHER),
  28887. 167: uint8(_BT_OTHER),
  28888. 168: uint8(_BT_OTHER),
  28889. 169: uint8(_BT_OTHER),
  28890. 170: uint8(_BT_NMSTRT),
  28891. 171: uint8(_BT_OTHER),
  28892. 172: uint8(_BT_OTHER),
  28893. 173: uint8(_BT_OTHER),
  28894. 174: uint8(_BT_OTHER),
  28895. 175: uint8(_BT_OTHER),
  28896. 176: uint8(_BT_OTHER),
  28897. 177: uint8(_BT_OTHER),
  28898. 178: uint8(_BT_OTHER),
  28899. 179: uint8(_BT_OTHER),
  28900. 180: uint8(_BT_OTHER),
  28901. 181: uint8(_BT_NMSTRT),
  28902. 182: uint8(_BT_OTHER),
  28903. 183: uint8(_BT_NAME),
  28904. 184: uint8(_BT_OTHER),
  28905. 185: uint8(_BT_OTHER),
  28906. 186: uint8(_BT_NMSTRT),
  28907. 187: uint8(_BT_OTHER),
  28908. 188: uint8(_BT_OTHER),
  28909. 189: uint8(_BT_OTHER),
  28910. 190: uint8(_BT_OTHER),
  28911. 191: uint8(_BT_OTHER),
  28912. 192: uint8(_BT_NMSTRT),
  28913. 193: uint8(_BT_NMSTRT),
  28914. 194: uint8(_BT_NMSTRT),
  28915. 195: uint8(_BT_NMSTRT),
  28916. 196: uint8(_BT_NMSTRT),
  28917. 197: uint8(_BT_NMSTRT),
  28918. 198: uint8(_BT_NMSTRT),
  28919. 199: uint8(_BT_NMSTRT),
  28920. 200: uint8(_BT_NMSTRT),
  28921. 201: uint8(_BT_NMSTRT),
  28922. 202: uint8(_BT_NMSTRT),
  28923. 203: uint8(_BT_NMSTRT),
  28924. 204: uint8(_BT_NMSTRT),
  28925. 205: uint8(_BT_NMSTRT),
  28926. 206: uint8(_BT_NMSTRT),
  28927. 207: uint8(_BT_NMSTRT),
  28928. 208: uint8(_BT_NMSTRT),
  28929. 209: uint8(_BT_NMSTRT),
  28930. 210: uint8(_BT_NMSTRT),
  28931. 211: uint8(_BT_NMSTRT),
  28932. 212: uint8(_BT_NMSTRT),
  28933. 213: uint8(_BT_NMSTRT),
  28934. 214: uint8(_BT_NMSTRT),
  28935. 215: uint8(_BT_OTHER),
  28936. 216: uint8(_BT_NMSTRT),
  28937. 217: uint8(_BT_NMSTRT),
  28938. 218: uint8(_BT_NMSTRT),
  28939. 219: uint8(_BT_NMSTRT),
  28940. 220: uint8(_BT_NMSTRT),
  28941. 221: uint8(_BT_NMSTRT),
  28942. 222: uint8(_BT_NMSTRT),
  28943. 223: uint8(_BT_NMSTRT),
  28944. 224: uint8(_BT_NMSTRT),
  28945. 225: uint8(_BT_NMSTRT),
  28946. 226: uint8(_BT_NMSTRT),
  28947. 227: uint8(_BT_NMSTRT),
  28948. 228: uint8(_BT_NMSTRT),
  28949. 229: uint8(_BT_NMSTRT),
  28950. 230: uint8(_BT_NMSTRT),
  28951. 231: uint8(_BT_NMSTRT),
  28952. 232: uint8(_BT_NMSTRT),
  28953. 233: uint8(_BT_NMSTRT),
  28954. 234: uint8(_BT_NMSTRT),
  28955. 235: uint8(_BT_NMSTRT),
  28956. 236: uint8(_BT_NMSTRT),
  28957. 237: uint8(_BT_NMSTRT),
  28958. 238: uint8(_BT_NMSTRT),
  28959. 239: uint8(_BT_NMSTRT),
  28960. 240: uint8(_BT_NMSTRT),
  28961. 241: uint8(_BT_NMSTRT),
  28962. 242: uint8(_BT_NMSTRT),
  28963. 243: uint8(_BT_NMSTRT),
  28964. 244: uint8(_BT_NMSTRT),
  28965. 245: uint8(_BT_NMSTRT),
  28966. 246: uint8(_BT_NMSTRT),
  28967. 247: uint8(_BT_OTHER),
  28968. 248: uint8(_BT_NMSTRT),
  28969. 249: uint8(_BT_NMSTRT),
  28970. 250: uint8(_BT_NMSTRT),
  28971. 251: uint8(_BT_NMSTRT),
  28972. 252: uint8(_BT_NMSTRT),
  28973. 253: uint8(_BT_NMSTRT),
  28974. 254: uint8(_BT_NMSTRT),
  28975. 255: uint8(_BT_NMSTRT),
  28976. },
  28977. }
  28978. func init() {
  28979. p := unsafe.Pointer(&_big2_encoding)
  28980. *(*uintptr)(unsafe.Add(p, 0)) = __ccgo_fp(_big2_prologTok)
  28981. *(*uintptr)(unsafe.Add(p, 8)) = __ccgo_fp(_big2_contentTok)
  28982. *(*uintptr)(unsafe.Add(p, 16)) = __ccgo_fp(_big2_cdataSectionTok)
  28983. *(*uintptr)(unsafe.Add(p, 24)) = __ccgo_fp(_big2_ignoreSectionTok)
  28984. *(*uintptr)(unsafe.Add(p, 32)) = __ccgo_fp(_big2_attributeValueTok)
  28985. *(*uintptr)(unsafe.Add(p, 40)) = __ccgo_fp(_big2_entityValueTok)
  28986. *(*uintptr)(unsafe.Add(p, 48)) = __ccgo_fp(_big2_nameMatchesAscii)
  28987. *(*uintptr)(unsafe.Add(p, 56)) = __ccgo_fp(_big2_nameLength)
  28988. *(*uintptr)(unsafe.Add(p, 64)) = __ccgo_fp(_big2_skipS)
  28989. *(*uintptr)(unsafe.Add(p, 72)) = __ccgo_fp(_big2_getAtts)
  28990. *(*uintptr)(unsafe.Add(p, 80)) = __ccgo_fp(_big2_charRefNumber)
  28991. *(*uintptr)(unsafe.Add(p, 88)) = __ccgo_fp(_big2_predefinedEntityName)
  28992. *(*uintptr)(unsafe.Add(p, 96)) = __ccgo_fp(_big2_updatePosition)
  28993. *(*uintptr)(unsafe.Add(p, 104)) = __ccgo_fp(_big2_isPublicId)
  28994. *(*uintptr)(unsafe.Add(p, 112)) = __ccgo_fp(_big2_toUtf8)
  28995. *(*uintptr)(unsafe.Add(p, 120)) = __ccgo_fp(_big2_toUtf16)
  28996. }
  28997. func _streqci(tls *libc.TLS, s1 uintptr, s2 uintptr) (r int32) {
  28998. var c1, c2 int8
  28999. var v2, v3 uintptr
  29000. _, _, _, _ = c1, c2, v2, v3
  29001. for {
  29002. v2 = s1
  29003. s1++
  29004. c1 = *(*int8)(unsafe.Pointer(v2))
  29005. v3 = s2
  29006. s2++
  29007. c2 = *(*int8)(unsafe.Pointer(v3))
  29008. if int32(m_ASCII_a2) <= int32(c1) && int32(c1) <= int32(m_ASCII_z1) {
  29009. c1 = int8(int32(c1) + (libc.Int32FromInt32(m_ASCII_A) - libc.Int32FromInt32(m_ASCII_a2)))
  29010. }
  29011. if int32(m_ASCII_a2) <= int32(c2) && int32(c2) <= int32(m_ASCII_z1) {
  29012. /* The following line will never get executed. streqci() is
  29013. * only called from two places, both of which guarantee to put
  29014. * upper-case strings into s2.
  29015. */
  29016. c2 = int8(int32(c2) + (libc.Int32FromInt32(m_ASCII_A) - libc.Int32FromInt32(m_ASCII_a2)))
  29017. } /* LCOV_EXCL_LINE */
  29018. if int32(c1) != int32(c2) {
  29019. return 0
  29020. }
  29021. if !(c1 != 0) {
  29022. break
  29023. }
  29024. goto _1
  29025. _1:
  29026. }
  29027. return int32(1)
  29028. }
  29029. func _initUpdatePosition(tls *libc.TLS, enc uintptr, ptr uintptr, end uintptr, pos uintptr) {
  29030. _ = enc
  29031. _normal_updatePosition(tls, uintptr(unsafe.Pointer(&_utf8_encoding)), ptr, end, pos)
  29032. }
  29033. func _toAscii(tls *libc.TLS, enc uintptr, _ptr uintptr, end uintptr) (r int32) {
  29034. bp := tls.Alloc(32)
  29035. defer tls.Free(32)
  29036. *(*uintptr)(unsafe.Pointer(bp)) = _ptr
  29037. var _ /* buf at bp+8 */ [1]int8
  29038. var _ /* p at bp+16 */ uintptr
  29039. *(*uintptr)(unsafe.Pointer(bp + 16)) = bp + 8
  29040. (*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr, uintptr) _XML_Convert_Result)(unsafe.Pointer(&struct{ uintptr }{(*TENCODING)(unsafe.Pointer(enc)).Futf8Convert})))(tls, enc, bp, end, bp+16, *(*uintptr)(unsafe.Pointer(bp + 16))+uintptr(1))
  29041. if *(*uintptr)(unsafe.Pointer(bp + 16)) == bp+8 {
  29042. return -int32(1)
  29043. } else {
  29044. return int32((*(*[1]int8)(unsafe.Pointer(bp + 8)))[0])
  29045. }
  29046. return r
  29047. }
  29048. func _isSpace(tls *libc.TLS, c int32) (r int32) {
  29049. switch c {
  29050. case int32(0x20):
  29051. fallthrough
  29052. case int32(0xD):
  29053. fallthrough
  29054. case int32(0xA):
  29055. fallthrough
  29056. case int32(0x9):
  29057. return int32(1)
  29058. }
  29059. return 0
  29060. }
  29061. // C documentation
  29062. //
  29063. // /* Return 1 if there's just optional white space or there's an S
  29064. // followed by name=val.
  29065. // */
  29066. func _parsePseudoAttribute(tls *libc.TLS, enc uintptr, ptr uintptr, end uintptr, namePtr uintptr, nameEndPtr uintptr, valPtr uintptr, nextTokPtr uintptr) (r int32) {
  29067. var c, v2 int32
  29068. var open int8
  29069. _, _, _ = c, open, v2
  29070. if ptr == end {
  29071. *(*uintptr)(unsafe.Pointer(namePtr)) = libc.UintptrFromInt32(0)
  29072. return int32(1)
  29073. }
  29074. if !(_isSpace(tls, _toAscii(tls, enc, ptr, end)) != 0) {
  29075. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  29076. return 0
  29077. }
  29078. for cond := true; cond; cond = _isSpace(tls, _toAscii(tls, enc, ptr, end)) != 0 {
  29079. ptr += uintptr((*TENCODING)(unsafe.Pointer(enc)).FminBytesPerChar)
  29080. }
  29081. if ptr == end {
  29082. *(*uintptr)(unsafe.Pointer(namePtr)) = libc.UintptrFromInt32(0)
  29083. return int32(1)
  29084. }
  29085. *(*uintptr)(unsafe.Pointer(namePtr)) = ptr
  29086. for {
  29087. c = _toAscii(tls, enc, ptr, end)
  29088. if c == -int32(1) {
  29089. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  29090. return 0
  29091. }
  29092. if c == int32(m_ASCII_EQUALS2) {
  29093. *(*uintptr)(unsafe.Pointer(nameEndPtr)) = ptr
  29094. break
  29095. }
  29096. if _isSpace(tls, c) != 0 {
  29097. *(*uintptr)(unsafe.Pointer(nameEndPtr)) = ptr
  29098. for {
  29099. ptr += uintptr((*TENCODING)(unsafe.Pointer(enc)).FminBytesPerChar)
  29100. goto _3
  29101. _3:
  29102. ;
  29103. v2 = _toAscii(tls, enc, ptr, end)
  29104. c = v2
  29105. if !(_isSpace(tls, v2) != 0) {
  29106. break
  29107. }
  29108. }
  29109. if c != int32(m_ASCII_EQUALS2) {
  29110. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  29111. return 0
  29112. }
  29113. break
  29114. }
  29115. ptr += uintptr((*TENCODING)(unsafe.Pointer(enc)).FminBytesPerChar)
  29116. goto _1
  29117. _1:
  29118. }
  29119. if ptr == *(*uintptr)(unsafe.Pointer(namePtr)) {
  29120. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  29121. return 0
  29122. }
  29123. ptr += uintptr((*TENCODING)(unsafe.Pointer(enc)).FminBytesPerChar)
  29124. c = _toAscii(tls, enc, ptr, end)
  29125. for _isSpace(tls, c) != 0 {
  29126. ptr += uintptr((*TENCODING)(unsafe.Pointer(enc)).FminBytesPerChar)
  29127. c = _toAscii(tls, enc, ptr, end)
  29128. }
  29129. if c != int32(m_ASCII_QUOT1) && c != int32(m_ASCII_APOS1) {
  29130. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  29131. return 0
  29132. }
  29133. open = int8(c)
  29134. ptr += uintptr((*TENCODING)(unsafe.Pointer(enc)).FminBytesPerChar)
  29135. *(*uintptr)(unsafe.Pointer(valPtr)) = ptr
  29136. for {
  29137. c = _toAscii(tls, enc, ptr, end)
  29138. if c == int32(open) {
  29139. break
  29140. }
  29141. if !(int32(m_ASCII_a2) <= c && c <= int32(m_ASCII_z1)) && !(int32(m_ASCII_A) <= c && c <= int32(m_ASCII_Z1)) && !(int32(m_ASCII_02) <= c && c <= int32(m_ASCII_92)) && c != int32(m_ASCII_PERIOD2) && c != int32(m_ASCII_MINUS1) && c != int32(m_ASCII_UNDERSCORE1) {
  29142. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
  29143. return 0
  29144. }
  29145. goto _4
  29146. _4:
  29147. ;
  29148. ptr += uintptr((*TENCODING)(unsafe.Pointer(enc)).FminBytesPerChar)
  29149. }
  29150. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr((*TENCODING)(unsafe.Pointer(enc)).FminBytesPerChar)
  29151. return int32(1)
  29152. }
  29153. var _KW_version = [8]int8{
  29154. 0: int8(m_ASCII_v1),
  29155. 1: int8(m_ASCII_e2),
  29156. 2: int8(m_ASCII_r2),
  29157. 3: int8(m_ASCII_s2),
  29158. 4: int8(m_ASCII_i1),
  29159. 5: int8(m_ASCII_o2),
  29160. 6: int8(m_ASCII_n2),
  29161. }
  29162. var _KW_encoding = [9]int8{
  29163. 0: int8(m_ASCII_e2),
  29164. 1: int8(m_ASCII_n2),
  29165. 2: int8(m_ASCII_c2),
  29166. 3: int8(m_ASCII_o2),
  29167. 4: int8(m_ASCII_d1),
  29168. 5: int8(m_ASCII_i1),
  29169. 6: int8(m_ASCII_n2),
  29170. 7: int8(m_ASCII_g2),
  29171. }
  29172. var _KW_standalone = [11]int8{
  29173. 0: int8(m_ASCII_s2),
  29174. 1: int8(m_ASCII_t2),
  29175. 2: int8(m_ASCII_a2),
  29176. 3: int8(m_ASCII_n2),
  29177. 4: int8(m_ASCII_d1),
  29178. 5: int8(m_ASCII_a2),
  29179. 6: int8(m_ASCII_l2),
  29180. 7: int8(m_ASCII_o2),
  29181. 8: int8(m_ASCII_n2),
  29182. 9: int8(m_ASCII_e2),
  29183. }
  29184. var _KW_yes = [4]int8{
  29185. 0: int8(m_ASCII_y1),
  29186. 1: int8(m_ASCII_e2),
  29187. 2: int8(m_ASCII_s2),
  29188. }
  29189. var _KW_no = [3]int8{
  29190. 0: int8(m_ASCII_n2),
  29191. 1: int8(m_ASCII_o2),
  29192. }
  29193. func _doParseXmlDecl(tls *libc.TLS, encodingFinder uintptr, isGeneralTextEntity int32, enc uintptr, _ptr uintptr, end uintptr, badPtr uintptr, versionPtr uintptr, versionEndPtr uintptr, encodingName uintptr, encoding uintptr, standalone uintptr) (r int32) {
  29194. bp := tls.Alloc(32)
  29195. defer tls.Free(32)
  29196. *(*uintptr)(unsafe.Pointer(bp)) = _ptr
  29197. var c int32
  29198. var _ /* name at bp+16 */ uintptr
  29199. var _ /* nameEnd at bp+24 */ uintptr
  29200. var _ /* val at bp+8 */ uintptr
  29201. _ = c
  29202. *(*uintptr)(unsafe.Pointer(bp + 8)) = libc.UintptrFromInt32(0)
  29203. *(*uintptr)(unsafe.Pointer(bp + 16)) = libc.UintptrFromInt32(0)
  29204. *(*uintptr)(unsafe.Pointer(bp + 24)) = libc.UintptrFromInt32(0)
  29205. *(*uintptr)(unsafe.Pointer(bp)) += uintptr(int32(5) * (*TENCODING)(unsafe.Pointer(enc)).FminBytesPerChar)
  29206. end -= uintptr(int32(2) * (*TENCODING)(unsafe.Pointer(enc)).FminBytesPerChar)
  29207. if !(_parsePseudoAttribute(tls, enc, *(*uintptr)(unsafe.Pointer(bp)), end, bp+16, bp+24, bp+8, bp) != 0) || !(*(*uintptr)(unsafe.Pointer(bp + 16)) != 0) {
  29208. *(*uintptr)(unsafe.Pointer(badPtr)) = *(*uintptr)(unsafe.Pointer(bp))
  29209. return 0
  29210. }
  29211. if !((*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*TENCODING)(unsafe.Pointer(enc)).FnameMatchesAscii})))(tls, enc, *(*uintptr)(unsafe.Pointer(bp + 16)), *(*uintptr)(unsafe.Pointer(bp + 24)), uintptr(unsafe.Pointer(&_KW_version))) != 0) {
  29212. if !(isGeneralTextEntity != 0) {
  29213. *(*uintptr)(unsafe.Pointer(badPtr)) = *(*uintptr)(unsafe.Pointer(bp + 16))
  29214. return 0
  29215. }
  29216. } else {
  29217. if versionPtr != 0 {
  29218. *(*uintptr)(unsafe.Pointer(versionPtr)) = *(*uintptr)(unsafe.Pointer(bp + 8))
  29219. }
  29220. if versionEndPtr != 0 {
  29221. *(*uintptr)(unsafe.Pointer(versionEndPtr)) = *(*uintptr)(unsafe.Pointer(bp))
  29222. }
  29223. if !(_parsePseudoAttribute(tls, enc, *(*uintptr)(unsafe.Pointer(bp)), end, bp+16, bp+24, bp+8, bp) != 0) {
  29224. *(*uintptr)(unsafe.Pointer(badPtr)) = *(*uintptr)(unsafe.Pointer(bp))
  29225. return 0
  29226. }
  29227. if !(*(*uintptr)(unsafe.Pointer(bp + 16)) != 0) {
  29228. if isGeneralTextEntity != 0 {
  29229. /* a TextDecl must have an EncodingDecl */
  29230. *(*uintptr)(unsafe.Pointer(badPtr)) = *(*uintptr)(unsafe.Pointer(bp))
  29231. return 0
  29232. }
  29233. return int32(1)
  29234. }
  29235. }
  29236. if (*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*TENCODING)(unsafe.Pointer(enc)).FnameMatchesAscii})))(tls, enc, *(*uintptr)(unsafe.Pointer(bp + 16)), *(*uintptr)(unsafe.Pointer(bp + 24)), uintptr(unsafe.Pointer(&_KW_encoding))) != 0 {
  29237. c = _toAscii(tls, enc, *(*uintptr)(unsafe.Pointer(bp + 8)), end)
  29238. if !(int32(m_ASCII_a2) <= c && c <= int32(m_ASCII_z1)) && !(int32(m_ASCII_A) <= c && c <= int32(m_ASCII_Z1)) {
  29239. *(*uintptr)(unsafe.Pointer(badPtr)) = *(*uintptr)(unsafe.Pointer(bp + 8))
  29240. return 0
  29241. }
  29242. if encodingName != 0 {
  29243. *(*uintptr)(unsafe.Pointer(encodingName)) = *(*uintptr)(unsafe.Pointer(bp + 8))
  29244. }
  29245. if encoding != 0 {
  29246. *(*uintptr)(unsafe.Pointer(encoding)) = (*(*func(*libc.TLS, uintptr, uintptr, uintptr) uintptr)(unsafe.Pointer(&struct{ uintptr }{encodingFinder})))(tls, enc, *(*uintptr)(unsafe.Pointer(bp + 8)), *(*uintptr)(unsafe.Pointer(bp))-uintptr((*TENCODING)(unsafe.Pointer(enc)).FminBytesPerChar))
  29247. }
  29248. if !(_parsePseudoAttribute(tls, enc, *(*uintptr)(unsafe.Pointer(bp)), end, bp+16, bp+24, bp+8, bp) != 0) {
  29249. *(*uintptr)(unsafe.Pointer(badPtr)) = *(*uintptr)(unsafe.Pointer(bp))
  29250. return 0
  29251. }
  29252. if !(*(*uintptr)(unsafe.Pointer(bp + 16)) != 0) {
  29253. return int32(1)
  29254. }
  29255. }
  29256. if !((*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*TENCODING)(unsafe.Pointer(enc)).FnameMatchesAscii})))(tls, enc, *(*uintptr)(unsafe.Pointer(bp + 16)), *(*uintptr)(unsafe.Pointer(bp + 24)), uintptr(unsafe.Pointer(&_KW_standalone))) != 0) || isGeneralTextEntity != 0 {
  29257. *(*uintptr)(unsafe.Pointer(badPtr)) = *(*uintptr)(unsafe.Pointer(bp + 16))
  29258. return 0
  29259. }
  29260. if (*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*TENCODING)(unsafe.Pointer(enc)).FnameMatchesAscii})))(tls, enc, *(*uintptr)(unsafe.Pointer(bp + 8)), *(*uintptr)(unsafe.Pointer(bp))-uintptr((*TENCODING)(unsafe.Pointer(enc)).FminBytesPerChar), uintptr(unsafe.Pointer(&_KW_yes))) != 0 {
  29261. if standalone != 0 {
  29262. *(*int32)(unsafe.Pointer(standalone)) = int32(1)
  29263. }
  29264. } else {
  29265. if (*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*TENCODING)(unsafe.Pointer(enc)).FnameMatchesAscii})))(tls, enc, *(*uintptr)(unsafe.Pointer(bp + 8)), *(*uintptr)(unsafe.Pointer(bp))-uintptr((*TENCODING)(unsafe.Pointer(enc)).FminBytesPerChar), uintptr(unsafe.Pointer(&_KW_no))) != 0 {
  29266. if standalone != 0 {
  29267. *(*int32)(unsafe.Pointer(standalone)) = 0
  29268. }
  29269. } else {
  29270. *(*uintptr)(unsafe.Pointer(badPtr)) = *(*uintptr)(unsafe.Pointer(bp + 8))
  29271. return 0
  29272. }
  29273. }
  29274. for _isSpace(tls, _toAscii(tls, enc, *(*uintptr)(unsafe.Pointer(bp)), end)) != 0 {
  29275. *(*uintptr)(unsafe.Pointer(bp)) += uintptr((*TENCODING)(unsafe.Pointer(enc)).FminBytesPerChar)
  29276. }
  29277. if *(*uintptr)(unsafe.Pointer(bp)) != end {
  29278. *(*uintptr)(unsafe.Pointer(badPtr)) = *(*uintptr)(unsafe.Pointer(bp))
  29279. return 0
  29280. }
  29281. return int32(1)
  29282. }
  29283. func _checkCharRefNumber(tls *libc.TLS, result int32) (r int32) {
  29284. switch result >> libc.Int32FromInt32(8) {
  29285. case int32(0xD8):
  29286. fallthrough
  29287. case int32(0xD9):
  29288. fallthrough
  29289. case int32(0xDA):
  29290. fallthrough
  29291. case int32(0xDB):
  29292. fallthrough
  29293. case int32(0xDC):
  29294. fallthrough
  29295. case int32(0xDD):
  29296. fallthrough
  29297. case int32(0xDE):
  29298. fallthrough
  29299. case int32(0xDF):
  29300. return -int32(1)
  29301. case 0:
  29302. if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_latin1_encoding)) + 136 + uintptr(result)))) == int32(_BT_NONXML) {
  29303. return -int32(1)
  29304. }
  29305. case int32(0xFF):
  29306. if result == int32(0xFFFE) || result == int32(0xFFFF) {
  29307. return -int32(1)
  29308. }
  29309. break
  29310. }
  29311. return result
  29312. }
  29313. func XXmlUtf8Encode(tls *libc.TLS, c int32, buf uintptr) (r int32) {
  29314. if c < 0 {
  29315. return 0
  29316. } /* LCOV_EXCL_LINE: this case is always eliminated beforehand */
  29317. if c < 128 {
  29318. *(*int8)(unsafe.Pointer(buf)) = int8(c | int32(_UTF8_cval1))
  29319. return int32(1)
  29320. }
  29321. if c < 2048 {
  29322. *(*int8)(unsafe.Pointer(buf)) = int8(c>>libc.Int32FromInt32(6) | int32(_UTF8_cval2))
  29323. *(*int8)(unsafe.Pointer(buf + 1)) = int8(c&libc.Int32FromInt32(0x3f) | libc.Int32FromInt32(0x80))
  29324. return int32(2)
  29325. }
  29326. if c < 65536 {
  29327. *(*int8)(unsafe.Pointer(buf)) = int8(c>>libc.Int32FromInt32(12) | int32(_UTF8_cval3))
  29328. *(*int8)(unsafe.Pointer(buf + 1)) = int8(c>>libc.Int32FromInt32(6)&libc.Int32FromInt32(0x3f) | libc.Int32FromInt32(0x80))
  29329. *(*int8)(unsafe.Pointer(buf + 2)) = int8(c&libc.Int32FromInt32(0x3f) | libc.Int32FromInt32(0x80))
  29330. return int32(3)
  29331. }
  29332. if c < int32(0x110000) {
  29333. *(*int8)(unsafe.Pointer(buf)) = int8(c>>libc.Int32FromInt32(18) | int32(_UTF8_cval4))
  29334. *(*int8)(unsafe.Pointer(buf + 1)) = int8(c>>libc.Int32FromInt32(12)&libc.Int32FromInt32(0x3f) | libc.Int32FromInt32(0x80))
  29335. *(*int8)(unsafe.Pointer(buf + 2)) = int8(c>>libc.Int32FromInt32(6)&libc.Int32FromInt32(0x3f) | libc.Int32FromInt32(0x80))
  29336. *(*int8)(unsafe.Pointer(buf + 3)) = int8(c&libc.Int32FromInt32(0x3f) | libc.Int32FromInt32(0x80))
  29337. return int32(4)
  29338. }
  29339. return 0 /* LCOV_EXCL_LINE: this case too is eliminated before calling */
  29340. }
  29341. func XXmlUtf16Encode(tls *libc.TLS, charNum int32, buf uintptr) (r int32) {
  29342. if charNum < 0 {
  29343. return 0
  29344. }
  29345. if charNum < int32(0x10000) {
  29346. *(*uint16)(unsafe.Pointer(buf)) = libc.Uint16FromInt32(charNum)
  29347. return int32(1)
  29348. }
  29349. if charNum < int32(0x110000) {
  29350. charNum -= int32(0x10000)
  29351. *(*uint16)(unsafe.Pointer(buf)) = libc.Uint16FromInt32(charNum>>libc.Int32FromInt32(10) + libc.Int32FromInt32(0xD800))
  29352. *(*uint16)(unsafe.Pointer(buf + 1*2)) = libc.Uint16FromInt32(charNum&libc.Int32FromInt32(0x3FF) + libc.Int32FromInt32(0xDC00))
  29353. return int32(2)
  29354. }
  29355. return 0
  29356. }
  29357. type Tunknown_encoding = struct {
  29358. Fnormal Tnormal_encoding
  29359. Fconvert TCONVERTER
  29360. FuserData uintptr
  29361. Futf16 [256]uint16
  29362. Futf8 [256][4]int8
  29363. }
  29364. func XXmlSizeOfUnknownEncoding(tls *libc.TLS) (r int32) {
  29365. return int32(2016)
  29366. }
  29367. func _unknown_isName(tls *libc.TLS, enc uintptr, p uintptr) (r int32) {
  29368. var c int32
  29369. var uenc uintptr
  29370. _, _ = c, uenc
  29371. uenc = enc
  29372. c = (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tunknown_encoding)(unsafe.Pointer(uenc)).Fconvert})))(tls, (*Tunknown_encoding)(unsafe.Pointer(uenc)).FuserData, p)
  29373. if c & ^libc.Int32FromInt32(0xFFFF) != 0 {
  29374. return 0
  29375. }
  29376. return libc.Int32FromUint32(_namingBitmap[libc.Int32FromUint8(_namePages[c>>int32(8)])<<int32(3)+c&int32(0xFF)>>int32(5)] & (libc.Uint32FromUint32(1) << (c & libc.Int32FromInt32(0xFF) & libc.Int32FromInt32(0x1F))))
  29377. }
  29378. func _unknown_isNmstrt(tls *libc.TLS, enc uintptr, p uintptr) (r int32) {
  29379. var c int32
  29380. var uenc uintptr
  29381. _, _ = c, uenc
  29382. uenc = enc
  29383. c = (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tunknown_encoding)(unsafe.Pointer(uenc)).Fconvert})))(tls, (*Tunknown_encoding)(unsafe.Pointer(uenc)).FuserData, p)
  29384. if c & ^libc.Int32FromInt32(0xFFFF) != 0 {
  29385. return 0
  29386. }
  29387. return libc.Int32FromUint32(_namingBitmap[libc.Int32FromUint8(_nmstrtPages[c>>int32(8)])<<int32(3)+c&int32(0xFF)>>int32(5)] & (libc.Uint32FromUint32(1) << (c & libc.Int32FromInt32(0xFF) & libc.Int32FromInt32(0x1F))))
  29388. }
  29389. func _unknown_isInvalid(tls *libc.TLS, enc uintptr, p uintptr) (r int32) {
  29390. var c int32
  29391. var uenc uintptr
  29392. _, _ = c, uenc
  29393. uenc = enc
  29394. c = (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tunknown_encoding)(unsafe.Pointer(uenc)).Fconvert})))(tls, (*Tunknown_encoding)(unsafe.Pointer(uenc)).FuserData, p)
  29395. return libc.BoolInt32(c & ^libc.Int32FromInt32(0xFFFF) != 0 || _checkCharRefNumber(tls, c) < 0)
  29396. }
  29397. func _unknown_toUtf8(tls *libc.TLS, enc uintptr, fromP uintptr, fromLim uintptr, toP uintptr, toLim uintptr) (r _XML_Convert_Result) {
  29398. bp := tls.Alloc(16)
  29399. defer tls.Free(16)
  29400. var c, n int32
  29401. var uenc, utf8, v2 uintptr
  29402. var _ /* buf at bp+0 */ [4]int8
  29403. _, _, _, _, _ = c, n, uenc, utf8, v2
  29404. uenc = enc
  29405. for {
  29406. if *(*uintptr)(unsafe.Pointer(fromP)) == fromLim {
  29407. return int32(_XML_CONVERT_COMPLETED)
  29408. }
  29409. utf8 = uenc + 992 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(fromP))))))*4
  29410. v2 = utf8
  29411. utf8++
  29412. n = int32(*(*int8)(unsafe.Pointer(v2)))
  29413. if n == 0 {
  29414. c = (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tunknown_encoding)(unsafe.Pointer(uenc)).Fconvert})))(tls, (*Tunknown_encoding)(unsafe.Pointer(uenc)).FuserData, *(*uintptr)(unsafe.Pointer(fromP)))
  29415. n = XXmlUtf8Encode(tls, c, bp)
  29416. if int64(n) > int64(toLim)-int64(*(*uintptr)(unsafe.Pointer(toP))) {
  29417. return int32(_XML_CONVERT_OUTPUT_EXHAUSTED)
  29418. }
  29419. utf8 = bp
  29420. *(*uintptr)(unsafe.Pointer(fromP)) += uintptr(libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(fromP))))))))) - (int32(_BT_LEAD2) - libc.Int32FromInt32(2)))
  29421. } else {
  29422. if int64(n) > int64(toLim)-int64(*(*uintptr)(unsafe.Pointer(toP))) {
  29423. return int32(_XML_CONVERT_OUTPUT_EXHAUSTED)
  29424. }
  29425. *(*uintptr)(unsafe.Pointer(fromP))++
  29426. }
  29427. libc.X__builtin___memcpy_chk(tls, *(*uintptr)(unsafe.Pointer(toP)), utf8, libc.Uint64FromInt32(n), ^t__predefined_size_t(0))
  29428. *(*uintptr)(unsafe.Pointer(toP)) += uintptr(n)
  29429. goto _1
  29430. _1:
  29431. }
  29432. return r
  29433. }
  29434. func _unknown_toUtf16(tls *libc.TLS, enc uintptr, fromP uintptr, fromLim uintptr, toP uintptr, toLim uintptr) (r _XML_Convert_Result) {
  29435. var c uint16
  29436. var uenc, v1, v2 uintptr
  29437. _, _, _, _ = c, uenc, v1, v2
  29438. uenc = enc
  29439. for *(*uintptr)(unsafe.Pointer(fromP)) < fromLim && *(*uintptr)(unsafe.Pointer(toP)) < toLim {
  29440. c = *(*uint16)(unsafe.Pointer(uenc + 480 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(fromP))))))*2))
  29441. if libc.Int32FromUint16(c) == 0 {
  29442. c = libc.Uint16FromInt32((*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tunknown_encoding)(unsafe.Pointer(uenc)).Fconvert})))(tls, (*Tunknown_encoding)(unsafe.Pointer(uenc)).FuserData, *(*uintptr)(unsafe.Pointer(fromP))))
  29443. *(*uintptr)(unsafe.Pointer(fromP)) += uintptr(libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(fromP))))))))) - (int32(_BT_LEAD2) - libc.Int32FromInt32(2)))
  29444. } else {
  29445. *(*uintptr)(unsafe.Pointer(fromP))++
  29446. }
  29447. v2 = toP
  29448. v1 = *(*uintptr)(unsafe.Pointer(v2))
  29449. *(*uintptr)(unsafe.Pointer(v2)) += 2
  29450. *(*uint16)(unsafe.Pointer(v1)) = c
  29451. }
  29452. if *(*uintptr)(unsafe.Pointer(toP)) == toLim && *(*uintptr)(unsafe.Pointer(fromP)) < fromLim {
  29453. return int32(_XML_CONVERT_OUTPUT_EXHAUSTED)
  29454. } else {
  29455. return int32(_XML_CONVERT_COMPLETED)
  29456. }
  29457. return r
  29458. }
  29459. func XXmlInitUnknownEncoding(tls *libc.TLS, mem uintptr, table uintptr, convert TCONVERTER, userData uintptr) (r uintptr) {
  29460. var c, i, v3 int32
  29461. var e uintptr
  29462. _, _, _, _ = c, e, i, v3
  29463. e = mem
  29464. libc.X__builtin___memcpy_chk(tls, mem, uintptr(unsafe.Pointer(&_latin1_encoding)), uint64(464), ^t__predefined_size_t(0))
  29465. i = 0
  29466. for {
  29467. if !(i < int32(128)) {
  29468. break
  29469. }
  29470. if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_latin1_encoding)) + 136 + uintptr(i)))) != int32(_BT_OTHER) && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_latin1_encoding)) + 136 + uintptr(i)))) != int32(_BT_NONXML) && *(*int32)(unsafe.Pointer(table + uintptr(i)*4)) != i {
  29471. return uintptr(0)
  29472. }
  29473. goto _1
  29474. _1:
  29475. ;
  29476. i++
  29477. }
  29478. i = 0
  29479. for {
  29480. if !(i < int32(256)) {
  29481. break
  29482. }
  29483. c = *(*int32)(unsafe.Pointer(table + uintptr(i)*4))
  29484. if c == -int32(1) {
  29485. *(*uint8)(unsafe.Pointer(e + 136 + uintptr(i))) = uint8(_BT_MALFORM)
  29486. /* This shouldn't really get used. */
  29487. *(*uint16)(unsafe.Pointer(e + 480 + uintptr(i)*2)) = uint16(0xFFFF)
  29488. *(*int8)(unsafe.Pointer(e + 992 + uintptr(i)*4)) = int8(1)
  29489. *(*int8)(unsafe.Pointer(e + 992 + uintptr(i)*4 + 1)) = 0
  29490. } else {
  29491. if c < 0 {
  29492. if c < -int32(4) {
  29493. return uintptr(0)
  29494. }
  29495. /* Multi-byte sequences need a converter function */
  29496. if !(convert != 0) {
  29497. return uintptr(0)
  29498. }
  29499. *(*uint8)(unsafe.Pointer(e + 136 + uintptr(i))) = libc.Uint8FromInt32(int32(_BT_LEAD2) - (c + libc.Int32FromInt32(2)))
  29500. *(*int8)(unsafe.Pointer(e + 992 + uintptr(i)*4)) = 0
  29501. *(*uint16)(unsafe.Pointer(e + 480 + uintptr(i)*2)) = uint16(0)
  29502. } else {
  29503. if c < int32(0x80) {
  29504. if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_latin1_encoding)) + 136 + uintptr(c)))) != int32(_BT_OTHER) && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_latin1_encoding)) + 136 + uintptr(c)))) != int32(_BT_NONXML) && c != i {
  29505. return uintptr(0)
  29506. }
  29507. *(*uint8)(unsafe.Pointer(e + 136 + uintptr(i))) = *(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_latin1_encoding)) + 136 + uintptr(c)))
  29508. *(*int8)(unsafe.Pointer(e + 992 + uintptr(i)*4)) = int8(1)
  29509. *(*int8)(unsafe.Pointer(e + 992 + uintptr(i)*4 + 1)) = int8(c)
  29510. if c == 0 {
  29511. v3 = int32(0xFFFF)
  29512. } else {
  29513. v3 = c
  29514. }
  29515. *(*uint16)(unsafe.Pointer(e + 480 + uintptr(i)*2)) = libc.Uint16FromInt32(v3)
  29516. } else {
  29517. if _checkCharRefNumber(tls, c) < 0 {
  29518. *(*uint8)(unsafe.Pointer(e + 136 + uintptr(i))) = uint8(_BT_NONXML)
  29519. /* This shouldn't really get used. */
  29520. *(*uint16)(unsafe.Pointer(e + 480 + uintptr(i)*2)) = uint16(0xFFFF)
  29521. *(*int8)(unsafe.Pointer(e + 992 + uintptr(i)*4)) = int8(1)
  29522. *(*int8)(unsafe.Pointer(e + 992 + uintptr(i)*4 + 1)) = 0
  29523. } else {
  29524. if c > int32(0xFFFF) {
  29525. return uintptr(0)
  29526. }
  29527. if _namingBitmap[libc.Int32FromUint8(_nmstrtPages[c>>int32(8)])<<int32(3)+c&int32(0xff)>>int32(5)]&(uint32(1)<<(c&int32(0xff)&int32(0x1F))) != 0 {
  29528. *(*uint8)(unsafe.Pointer(e + 136 + uintptr(i))) = uint8(_BT_NMSTRT)
  29529. } else {
  29530. if _namingBitmap[libc.Int32FromUint8(_namePages[c>>int32(8)])<<int32(3)+c&int32(0xff)>>int32(5)]&(uint32(1)<<(c&int32(0xff)&int32(0x1F))) != 0 {
  29531. *(*uint8)(unsafe.Pointer(e + 136 + uintptr(i))) = uint8(_BT_NAME)
  29532. } else {
  29533. *(*uint8)(unsafe.Pointer(e + 136 + uintptr(i))) = uint8(_BT_OTHER)
  29534. }
  29535. }
  29536. *(*int8)(unsafe.Pointer(e + 992 + uintptr(i)*4)) = int8(XXmlUtf8Encode(tls, c, e+992+uintptr(i)*4+uintptr(1)))
  29537. *(*uint16)(unsafe.Pointer(e + 480 + uintptr(i)*2)) = libc.Uint16FromInt32(c)
  29538. }
  29539. }
  29540. }
  29541. }
  29542. goto _2
  29543. _2:
  29544. ;
  29545. i++
  29546. }
  29547. (*Tunknown_encoding)(unsafe.Pointer(e)).FuserData = userData
  29548. (*Tunknown_encoding)(unsafe.Pointer(e)).Fconvert = convert
  29549. if convert != 0 {
  29550. (*Tunknown_encoding)(unsafe.Pointer(e)).Fnormal.FisName2 = __ccgo_fp(_unknown_isName)
  29551. (*Tunknown_encoding)(unsafe.Pointer(e)).Fnormal.FisName3 = __ccgo_fp(_unknown_isName)
  29552. (*Tunknown_encoding)(unsafe.Pointer(e)).Fnormal.FisName4 = __ccgo_fp(_unknown_isName)
  29553. (*Tunknown_encoding)(unsafe.Pointer(e)).Fnormal.FisNmstrt2 = __ccgo_fp(_unknown_isNmstrt)
  29554. (*Tunknown_encoding)(unsafe.Pointer(e)).Fnormal.FisNmstrt3 = __ccgo_fp(_unknown_isNmstrt)
  29555. (*Tunknown_encoding)(unsafe.Pointer(e)).Fnormal.FisNmstrt4 = __ccgo_fp(_unknown_isNmstrt)
  29556. (*Tunknown_encoding)(unsafe.Pointer(e)).Fnormal.FisInvalid2 = __ccgo_fp(_unknown_isInvalid)
  29557. (*Tunknown_encoding)(unsafe.Pointer(e)).Fnormal.FisInvalid3 = __ccgo_fp(_unknown_isInvalid)
  29558. (*Tunknown_encoding)(unsafe.Pointer(e)).Fnormal.FisInvalid4 = __ccgo_fp(_unknown_isInvalid)
  29559. }
  29560. (*Tunknown_encoding)(unsafe.Pointer(e)).Fnormal.Fenc.Futf8Convert = __ccgo_fp(_unknown_toUtf8)
  29561. (*Tunknown_encoding)(unsafe.Pointer(e)).Fnormal.Fenc.Futf16Convert = __ccgo_fp(_unknown_toUtf16)
  29562. return e
  29563. }
  29564. const _UNKNOWN_ENC = -1
  29565. const _ISO_8859_1_ENC = 0
  29566. const _US_ASCII_ENC = 1
  29567. const _UTF_8_ENC = 2
  29568. const _UTF_16_ENC = 3
  29569. const _UTF_16BE_ENC = 4
  29570. const _UTF_16LE_ENC = 5
  29571. const
  29572. /* must match encodingNames up to here */
  29573. _NO_ENC = 6
  29574. var _KW_ISO_8859_1 = [11]int8{
  29575. 0: int8(m_ASCII_I),
  29576. 1: int8(m_ASCII_S),
  29577. 2: int8(m_ASCII_O),
  29578. 3: int8(m_ASCII_MINUS1),
  29579. 4: int8(m_ASCII_82),
  29580. 5: int8(m_ASCII_82),
  29581. 6: int8(m_ASCII_51),
  29582. 7: int8(m_ASCII_92),
  29583. 8: int8(m_ASCII_MINUS1),
  29584. 9: int8(m_ASCII_12),
  29585. }
  29586. var _KW_US_ASCII = [9]int8{
  29587. 0: int8(m_ASCII_U1),
  29588. 1: int8(m_ASCII_S),
  29589. 2: int8(m_ASCII_MINUS1),
  29590. 3: int8(m_ASCII_A),
  29591. 4: int8(m_ASCII_S),
  29592. 5: int8(m_ASCII_C),
  29593. 6: int8(m_ASCII_I),
  29594. 7: int8(m_ASCII_I),
  29595. }
  29596. var _KW_UTF_8 = [6]int8{
  29597. 0: int8(m_ASCII_U1),
  29598. 1: int8(m_ASCII_T),
  29599. 2: int8(m_ASCII_F),
  29600. 3: int8(m_ASCII_MINUS1),
  29601. 4: int8(m_ASCII_82),
  29602. }
  29603. var _KW_UTF_16 = [7]int8{
  29604. 0: int8(m_ASCII_U1),
  29605. 1: int8(m_ASCII_T),
  29606. 2: int8(m_ASCII_F),
  29607. 3: int8(m_ASCII_MINUS1),
  29608. 4: int8(m_ASCII_12),
  29609. 5: int8(m_ASCII_61),
  29610. }
  29611. var _KW_UTF_16BE = [9]int8{
  29612. 0: int8(m_ASCII_U1),
  29613. 1: int8(m_ASCII_T),
  29614. 2: int8(m_ASCII_F),
  29615. 3: int8(m_ASCII_MINUS1),
  29616. 4: int8(m_ASCII_12),
  29617. 5: int8(m_ASCII_61),
  29618. 6: int8(m_ASCII_B1),
  29619. 7: int8(m_ASCII_E),
  29620. }
  29621. var _KW_UTF_16LE = [9]int8{
  29622. 0: int8(m_ASCII_U1),
  29623. 1: int8(m_ASCII_T),
  29624. 2: int8(m_ASCII_F),
  29625. 3: int8(m_ASCII_MINUS1),
  29626. 4: int8(m_ASCII_12),
  29627. 5: int8(m_ASCII_61),
  29628. 6: int8(m_ASCII_L),
  29629. 7: int8(m_ASCII_E),
  29630. }
  29631. func _getEncodingIndex(tls *libc.TLS, name uintptr) (r int32) {
  29632. var i int32
  29633. _ = i
  29634. if name == libc.UintptrFromInt32(0) {
  29635. return int32(_NO_ENC)
  29636. }
  29637. i = 0
  29638. for {
  29639. if !(i < libc.Int32FromUint64(libc.Uint64FromInt64(48)/libc.Uint64FromInt64(8))) {
  29640. break
  29641. }
  29642. if _streqci(tls, name, _encodingNames[i]) != 0 {
  29643. return i
  29644. }
  29645. goto _1
  29646. _1:
  29647. ;
  29648. i++
  29649. }
  29650. return int32(_UNKNOWN_ENC)
  29651. }
  29652. var _encodingNames = [6]uintptr{
  29653. 0: uintptr(unsafe.Pointer(&_KW_ISO_8859_1)),
  29654. 1: uintptr(unsafe.Pointer(&_KW_US_ASCII)),
  29655. 2: uintptr(unsafe.Pointer(&_KW_UTF_8)),
  29656. 3: uintptr(unsafe.Pointer(&_KW_UTF_16)),
  29657. 4: uintptr(unsafe.Pointer(&_KW_UTF_16BE)),
  29658. 5: uintptr(unsafe.Pointer(&_KW_UTF_16LE)),
  29659. }
  29660. /* For binary compatibility, we store the index of the encoding
  29661. specified at initialization in the isUtf16 member.
  29662. */
  29663. /* This is what detects the encoding. encodingTable maps from
  29664. encoding indices to encodings; INIT_ENC_INDEX(enc) is the index of
  29665. the external (protocol) specified encoding; state is
  29666. XML_CONTENT_STATE if we're parsing an external text entity, and
  29667. XML_PROLOG_STATE otherwise.
  29668. */
  29669. func _initScan(tls *libc.TLS, encodingTable uintptr, enc uintptr, state int32, ptr uintptr, end uintptr, nextTokPtr uintptr) (r int32) {
  29670. var e int32
  29671. var encPtr uintptr
  29672. _, _ = e, encPtr
  29673. if ptr >= end {
  29674. return -int32(4)
  29675. }
  29676. encPtr = (*TINIT_ENCODING)(unsafe.Pointer(enc)).FencPtr
  29677. if ptr+uintptr(1) == end {
  29678. /* only a single byte available for auto-detection */
  29679. /* so we're parsing an external text entity... */
  29680. /* if UTF-16 was externally specified, then we need at least 2 bytes */
  29681. switch int32((*TINIT_ENCODING)(unsafe.Pointer(enc)).FinitEnc.FisUtf16) {
  29682. case int32(_UTF_16_ENC):
  29683. fallthrough
  29684. case int32(_UTF_16LE_ENC):
  29685. fallthrough
  29686. case int32(_UTF_16BE_ENC):
  29687. return -int32(1)
  29688. }
  29689. switch libc.Int32FromUint8(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr)))) {
  29690. case int32(0xFE):
  29691. fallthrough
  29692. case int32(0xFF):
  29693. fallthrough
  29694. case int32(0xEF): /* possibly first byte of UTF-8 BOM */
  29695. if int32((*TINIT_ENCODING)(unsafe.Pointer(enc)).FinitEnc.FisUtf16) == int32(_ISO_8859_1_ENC) && state == int32(m_XML_CONTENT_STATE) {
  29696. break
  29697. }
  29698. /* fall through */
  29699. fallthrough
  29700. case 0x00:
  29701. fallthrough
  29702. case int32(0x3C):
  29703. return -int32(1)
  29704. }
  29705. } else {
  29706. switch libc.Int32FromUint8(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr))))<<libc.Int32FromInt32(8) | libc.Int32FromUint8(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr + 1)))) {
  29707. case int32(0xFEFF):
  29708. if int32((*TINIT_ENCODING)(unsafe.Pointer(enc)).FinitEnc.FisUtf16) == int32(_ISO_8859_1_ENC) && state == int32(m_XML_CONTENT_STATE) {
  29709. break
  29710. }
  29711. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(2)
  29712. *(*uintptr)(unsafe.Pointer(encPtr)) = *(*uintptr)(unsafe.Pointer(encodingTable + uintptr(_UTF_16BE_ENC)*8))
  29713. return int32(m_XML_TOK_BOM)
  29714. /* 00 3C is handled in the default case */
  29715. fallthrough
  29716. case int32(0x3C00):
  29717. if (int32((*TINIT_ENCODING)(unsafe.Pointer(enc)).FinitEnc.FisUtf16) == int32(_UTF_16BE_ENC) || int32((*TINIT_ENCODING)(unsafe.Pointer(enc)).FinitEnc.FisUtf16) == int32(_UTF_16_ENC)) && state == int32(m_XML_CONTENT_STATE) {
  29718. break
  29719. }
  29720. *(*uintptr)(unsafe.Pointer(encPtr)) = *(*uintptr)(unsafe.Pointer(encodingTable + uintptr(_UTF_16LE_ENC)*8))
  29721. return (*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{*(*TSCANNER)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(encPtr)) + uintptr(state)*8))})))(tls, *(*uintptr)(unsafe.Pointer(encPtr)), ptr, end, nextTokPtr)
  29722. case int32(0xFFFE):
  29723. if int32((*TINIT_ENCODING)(unsafe.Pointer(enc)).FinitEnc.FisUtf16) == int32(_ISO_8859_1_ENC) && state == int32(m_XML_CONTENT_STATE) {
  29724. break
  29725. }
  29726. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(2)
  29727. *(*uintptr)(unsafe.Pointer(encPtr)) = *(*uintptr)(unsafe.Pointer(encodingTable + uintptr(_UTF_16LE_ENC)*8))
  29728. return int32(m_XML_TOK_BOM)
  29729. case int32(0xEFBB):
  29730. /* Maybe a UTF-8 BOM (EF BB BF) */
  29731. /* If there's an explicitly specified (external) encoding
  29732. of ISO-8859-1 or some flavour of UTF-16
  29733. and this is an external text entity,
  29734. don't look for the BOM,
  29735. because it might be a legal data.
  29736. */
  29737. if state == int32(m_XML_CONTENT_STATE) {
  29738. e = int32((*TINIT_ENCODING)(unsafe.Pointer(enc)).FinitEnc.FisUtf16)
  29739. if e == int32(_ISO_8859_1_ENC) || e == int32(_UTF_16BE_ENC) || e == int32(_UTF_16LE_ENC) || e == int32(_UTF_16_ENC) {
  29740. break
  29741. }
  29742. }
  29743. if ptr+uintptr(2) == end {
  29744. return -int32(1)
  29745. }
  29746. if libc.Int32FromUint8(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr + 2)))) == int32(0xBF) {
  29747. *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(3)
  29748. *(*uintptr)(unsafe.Pointer(encPtr)) = *(*uintptr)(unsafe.Pointer(encodingTable + uintptr(_UTF_8_ENC)*8))
  29749. return int32(m_XML_TOK_BOM)
  29750. }
  29751. default:
  29752. if int32(*(*int8)(unsafe.Pointer(ptr))) == int32('\000') {
  29753. /* 0 isn't a legal data character. Furthermore a document
  29754. entity can only start with ASCII characters. So the only
  29755. way this can fail to be big-endian UTF-16 if it it's an
  29756. external parsed general entity that's labelled as
  29757. UTF-16LE.
  29758. */
  29759. if state == int32(m_XML_CONTENT_STATE) && int32((*TINIT_ENCODING)(unsafe.Pointer(enc)).FinitEnc.FisUtf16) == int32(_UTF_16LE_ENC) {
  29760. break
  29761. }
  29762. *(*uintptr)(unsafe.Pointer(encPtr)) = *(*uintptr)(unsafe.Pointer(encodingTable + uintptr(_UTF_16BE_ENC)*8))
  29763. return (*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{*(*TSCANNER)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(encPtr)) + uintptr(state)*8))})))(tls, *(*uintptr)(unsafe.Pointer(encPtr)), ptr, end, nextTokPtr)
  29764. } else {
  29765. if int32(*(*int8)(unsafe.Pointer(ptr + 1))) == int32('\000') {
  29766. /* We could recover here in the case:
  29767. - parsing an external entity
  29768. - second byte is 0
  29769. - no externally specified encoding
  29770. - no encoding declaration
  29771. by assuming UTF-16LE. But we don't, because this would mean when
  29772. presented just with a single byte, we couldn't reliably determine
  29773. whether we needed further bytes.
  29774. */
  29775. if state == int32(m_XML_CONTENT_STATE) {
  29776. break
  29777. }
  29778. *(*uintptr)(unsafe.Pointer(encPtr)) = *(*uintptr)(unsafe.Pointer(encodingTable + uintptr(_UTF_16LE_ENC)*8))
  29779. return (*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{*(*TSCANNER)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(encPtr)) + uintptr(state)*8))})))(tls, *(*uintptr)(unsafe.Pointer(encPtr)), ptr, end, nextTokPtr)
  29780. }
  29781. }
  29782. break
  29783. }
  29784. }
  29785. *(*uintptr)(unsafe.Pointer(encPtr)) = *(*uintptr)(unsafe.Pointer(encodingTable + uintptr(int32((*TINIT_ENCODING)(unsafe.Pointer(enc)).FinitEnc.FisUtf16))*8))
  29786. return (*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{*(*TSCANNER)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(encPtr)) + uintptr(state)*8))})))(tls, *(*uintptr)(unsafe.Pointer(encPtr)), ptr, end, nextTokPtr)
  29787. }
  29788. /* This file is included!
  29789. __ __ _
  29790. ___\ \/ /_ __ __ _| |_
  29791. / _ \\ /| '_ \ / _` | __|
  29792. | __// \| |_) | (_| | |_
  29793. \___/_/\_\ .__/ \__,_|\__|
  29794. |_| XML parser
  29795. Copyright (c) 1997-2000 Thai Open Source Software Center Ltd
  29796. Copyright (c) 2000 Clark Cooper <coopercc@users.sourceforge.net>
  29797. Copyright (c) 2002 Greg Stein <gstein@users.sourceforge.net>
  29798. Copyright (c) 2002 Fred L. Drake, Jr. <fdrake@users.sourceforge.net>
  29799. Copyright (c) 2002-2006 Karl Waclawek <karl@waclawek.net>
  29800. Copyright (c) 2017-2021 Sebastian Pipping <sebastian@pipping.org>
  29801. Licensed under the MIT license:
  29802. Permission is hereby granted, free of charge, to any person obtaining
  29803. a copy of this software and associated documentation files (the
  29804. "Software"), to deal in the Software without restriction, including
  29805. without limitation the rights to use, copy, modify, merge, publish,
  29806. distribute, sublicense, and/or sell copies of the Software, and to permit
  29807. persons to whom the Software is furnished to do so, subject to the
  29808. following conditions:
  29809. The above copyright notice and this permission notice shall be included
  29810. in all copies or substantial portions of the Software.
  29811. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  29812. EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  29813. MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
  29814. NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
  29815. DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  29816. OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
  29817. USE OR OTHER DEALINGS IN THE SOFTWARE.
  29818. */
  29819. func XXmlGetUtf8InternalEncoding(tls *libc.TLS) (r uintptr) {
  29820. return uintptr(unsafe.Pointer(&_internal_utf8_encoding))
  29821. }
  29822. func XXmlGetUtf16InternalEncoding(tls *libc.TLS) (r uintptr) {
  29823. return uintptr(unsafe.Pointer(&_internal_little2_encoding))
  29824. }
  29825. var _encodings = [7]uintptr{
  29826. 0: uintptr(unsafe.Pointer(&_latin1_encoding)),
  29827. 1: uintptr(unsafe.Pointer(&_ascii_encoding)),
  29828. 2: uintptr(unsafe.Pointer(&_utf8_encoding)),
  29829. 3: uintptr(unsafe.Pointer(&_big2_encoding)),
  29830. 4: uintptr(unsafe.Pointer(&_big2_encoding)),
  29831. 5: uintptr(unsafe.Pointer(&_little2_encoding)),
  29832. 6: uintptr(unsafe.Pointer(&_utf8_encoding)),
  29833. }
  29834. func _initScanProlog(tls *libc.TLS, enc uintptr, ptr uintptr, end uintptr, nextTokPtr uintptr) (r int32) {
  29835. return _initScan(tls, uintptr(unsafe.Pointer(&_encodings)), enc, m_XML_PROLOG_STATE, ptr, end, nextTokPtr)
  29836. }
  29837. func _initScanContent(tls *libc.TLS, enc uintptr, ptr uintptr, end uintptr, nextTokPtr uintptr) (r int32) {
  29838. return _initScan(tls, uintptr(unsafe.Pointer(&_encodings)), enc, int32(m_XML_CONTENT_STATE), ptr, end, nextTokPtr)
  29839. }
  29840. func XXmlInitEncoding(tls *libc.TLS, p uintptr, encPtr uintptr, name uintptr) (r int32) {
  29841. var i int32
  29842. _ = i
  29843. i = _getEncodingIndex(tls, name)
  29844. if i == int32(_UNKNOWN_ENC) {
  29845. return 0
  29846. }
  29847. (*TINIT_ENCODING)(unsafe.Pointer(p)).FinitEnc.FisUtf16 = int8(i)
  29848. *(*TSCANNER)(unsafe.Pointer(p)) = __ccgo_fp(_initScanProlog)
  29849. *(*TSCANNER)(unsafe.Pointer(p + 1*8)) = __ccgo_fp(_initScanContent)
  29850. (*TINIT_ENCODING)(unsafe.Pointer(p)).FinitEnc.FupdatePosition = __ccgo_fp(_initUpdatePosition)
  29851. (*TINIT_ENCODING)(unsafe.Pointer(p)).FencPtr = encPtr
  29852. *(*uintptr)(unsafe.Pointer(encPtr)) = p
  29853. return int32(1)
  29854. }
  29855. func _findEncoding(tls *libc.TLS, enc uintptr, _ptr uintptr, end uintptr) (r uintptr) {
  29856. bp := tls.Alloc(144)
  29857. defer tls.Free(144)
  29858. *(*uintptr)(unsafe.Pointer(bp)) = _ptr
  29859. var i int32
  29860. var _ /* buf at bp+8 */ [128]int8
  29861. var _ /* p at bp+136 */ uintptr
  29862. _ = i
  29863. *(*[128]int8)(unsafe.Pointer(bp + 8)) = [128]int8{}
  29864. *(*uintptr)(unsafe.Pointer(bp + 136)) = bp + 8
  29865. (*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr, uintptr) _XML_Convert_Result)(unsafe.Pointer(&struct{ uintptr }{(*TENCODING)(unsafe.Pointer(enc)).Futf8Convert})))(tls, enc, bp, end, bp+136, *(*uintptr)(unsafe.Pointer(bp + 136))+uintptr(m_ENCODING_MAX)-uintptr(1))
  29866. if *(*uintptr)(unsafe.Pointer(bp)) != end {
  29867. return uintptr(0)
  29868. }
  29869. *(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 136)))) = 0
  29870. if _streqci(tls, bp+8, uintptr(unsafe.Pointer(&_KW_UTF_16))) != 0 && (*TENCODING)(unsafe.Pointer(enc)).FminBytesPerChar == int32(2) {
  29871. return enc
  29872. }
  29873. i = _getEncodingIndex(tls, bp+8)
  29874. if i == int32(_UNKNOWN_ENC) {
  29875. return uintptr(0)
  29876. }
  29877. return _encodings[i]
  29878. }
  29879. func XXmlParseXmlDecl(tls *libc.TLS, isGeneralTextEntity int32, enc uintptr, ptr uintptr, end uintptr, badPtr uintptr, versionPtr uintptr, versionEndPtr uintptr, encodingName uintptr, encoding uintptr, standalone uintptr) (r int32) {
  29880. return _doParseXmlDecl(tls, __ccgo_fp(_findEncoding), isGeneralTextEntity, enc, ptr, end, badPtr, versionPtr, versionEndPtr, encodingName, encoding, standalone)
  29881. }
  29882. /* This file is included!
  29883. __ __ _
  29884. ___\ \/ /_ __ __ _| |_
  29885. / _ \\ /| '_ \ / _` | __|
  29886. | __// \| |_) | (_| | |_
  29887. \___/_/\_\ .__/ \__,_|\__|
  29888. |_| XML parser
  29889. Copyright (c) 1997-2000 Thai Open Source Software Center Ltd
  29890. Copyright (c) 2000 Clark Cooper <coopercc@users.sourceforge.net>
  29891. Copyright (c) 2002 Greg Stein <gstein@users.sourceforge.net>
  29892. Copyright (c) 2002 Fred L. Drake, Jr. <fdrake@users.sourceforge.net>
  29893. Copyright (c) 2002-2006 Karl Waclawek <karl@waclawek.net>
  29894. Copyright (c) 2017-2021 Sebastian Pipping <sebastian@pipping.org>
  29895. Licensed under the MIT license:
  29896. Permission is hereby granted, free of charge, to any person obtaining
  29897. a copy of this software and associated documentation files (the
  29898. "Software"), to deal in the Software without restriction, including
  29899. without limitation the rights to use, copy, modify, merge, publish,
  29900. distribute, sublicense, and/or sell copies of the Software, and to permit
  29901. persons to whom the Software is furnished to do so, subject to the
  29902. following conditions:
  29903. The above copyright notice and this permission notice shall be included
  29904. in all copies or substantial portions of the Software.
  29905. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  29906. EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  29907. MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
  29908. NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
  29909. DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  29910. OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
  29911. USE OR OTHER DEALINGS IN THE SOFTWARE.
  29912. */
  29913. func XXmlGetUtf8InternalEncodingNS(tls *libc.TLS) (r uintptr) {
  29914. return uintptr(unsafe.Pointer(&_internal_utf8_encoding_ns))
  29915. }
  29916. func XXmlGetUtf16InternalEncodingNS(tls *libc.TLS) (r uintptr) {
  29917. return uintptr(unsafe.Pointer(&_internal_little2_encoding_ns))
  29918. }
  29919. var _encodingsNS = [7]uintptr{
  29920. 0: uintptr(unsafe.Pointer(&_latin1_encoding_ns)),
  29921. 1: uintptr(unsafe.Pointer(&_ascii_encoding_ns)),
  29922. 2: uintptr(unsafe.Pointer(&_utf8_encoding_ns)),
  29923. 3: uintptr(unsafe.Pointer(&_big2_encoding_ns)),
  29924. 4: uintptr(unsafe.Pointer(&_big2_encoding_ns)),
  29925. 5: uintptr(unsafe.Pointer(&_little2_encoding_ns)),
  29926. 6: uintptr(unsafe.Pointer(&_utf8_encoding_ns)),
  29927. }
  29928. func _initScanPrologNS(tls *libc.TLS, enc uintptr, ptr uintptr, end uintptr, nextTokPtr uintptr) (r int32) {
  29929. return _initScan(tls, uintptr(unsafe.Pointer(&_encodingsNS)), enc, m_XML_PROLOG_STATE, ptr, end, nextTokPtr)
  29930. }
  29931. func _initScanContentNS(tls *libc.TLS, enc uintptr, ptr uintptr, end uintptr, nextTokPtr uintptr) (r int32) {
  29932. return _initScan(tls, uintptr(unsafe.Pointer(&_encodingsNS)), enc, int32(m_XML_CONTENT_STATE), ptr, end, nextTokPtr)
  29933. }
  29934. func XXmlInitEncodingNS(tls *libc.TLS, p uintptr, encPtr uintptr, name uintptr) (r int32) {
  29935. var i int32
  29936. _ = i
  29937. i = _getEncodingIndex(tls, name)
  29938. if i == int32(_UNKNOWN_ENC) {
  29939. return 0
  29940. }
  29941. (*TINIT_ENCODING)(unsafe.Pointer(p)).FinitEnc.FisUtf16 = int8(i)
  29942. *(*TSCANNER)(unsafe.Pointer(p)) = __ccgo_fp(_initScanPrologNS)
  29943. *(*TSCANNER)(unsafe.Pointer(p + 1*8)) = __ccgo_fp(_initScanContentNS)
  29944. (*TINIT_ENCODING)(unsafe.Pointer(p)).FinitEnc.FupdatePosition = __ccgo_fp(_initUpdatePosition)
  29945. (*TINIT_ENCODING)(unsafe.Pointer(p)).FencPtr = encPtr
  29946. *(*uintptr)(unsafe.Pointer(encPtr)) = p
  29947. return int32(1)
  29948. }
  29949. func _findEncodingNS(tls *libc.TLS, enc uintptr, _ptr uintptr, end uintptr) (r uintptr) {
  29950. bp := tls.Alloc(144)
  29951. defer tls.Free(144)
  29952. *(*uintptr)(unsafe.Pointer(bp)) = _ptr
  29953. var i int32
  29954. var _ /* buf at bp+8 */ [128]int8
  29955. var _ /* p at bp+136 */ uintptr
  29956. _ = i
  29957. *(*[128]int8)(unsafe.Pointer(bp + 8)) = [128]int8{}
  29958. *(*uintptr)(unsafe.Pointer(bp + 136)) = bp + 8
  29959. (*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr, uintptr) _XML_Convert_Result)(unsafe.Pointer(&struct{ uintptr }{(*TENCODING)(unsafe.Pointer(enc)).Futf8Convert})))(tls, enc, bp, end, bp+136, *(*uintptr)(unsafe.Pointer(bp + 136))+uintptr(m_ENCODING_MAX)-uintptr(1))
  29960. if *(*uintptr)(unsafe.Pointer(bp)) != end {
  29961. return uintptr(0)
  29962. }
  29963. *(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 136)))) = 0
  29964. if _streqci(tls, bp+8, uintptr(unsafe.Pointer(&_KW_UTF_16))) != 0 && (*TENCODING)(unsafe.Pointer(enc)).FminBytesPerChar == int32(2) {
  29965. return enc
  29966. }
  29967. i = _getEncodingIndex(tls, bp+8)
  29968. if i == int32(_UNKNOWN_ENC) {
  29969. return uintptr(0)
  29970. }
  29971. return _encodingsNS[i]
  29972. }
  29973. func XXmlParseXmlDeclNS(tls *libc.TLS, isGeneralTextEntity int32, enc uintptr, ptr uintptr, end uintptr, badPtr uintptr, versionPtr uintptr, versionEndPtr uintptr, encodingName uintptr, encoding uintptr, standalone uintptr) (r int32) {
  29974. return _doParseXmlDecl(tls, __ccgo_fp(_findEncodingNS), isGeneralTextEntity, enc, ptr, end, badPtr, versionPtr, versionEndPtr, encodingName, encoding, standalone)
  29975. }
  29976. func XXmlInitUnknownEncodingNS(tls *libc.TLS, mem uintptr, table uintptr, convert TCONVERTER, userData uintptr) (r uintptr) {
  29977. var enc uintptr
  29978. _ = enc
  29979. enc = XXmlInitUnknownEncoding(tls, mem, table, convert, userData)
  29980. if enc != 0 {
  29981. *(*uint8)(unsafe.Pointer(enc + 136 + 58)) = uint8(_BT_COLON)
  29982. }
  29983. return enc
  29984. }
  29985. func __ccgo_fp(f interface{}) uintptr {
  29986. type iface [2]uintptr
  29987. return (*iface)(unsafe.Pointer(&f))[1]
  29988. }
  29989. var __ccgo_ts = (*reflect.StringHeader)(unsafe.Pointer(&__ccgo_ts1)).Data
  29990. var __ccgo_ts1 = "\x00\x01\x02\x03\x04\x05\x06\a\b\t\n\v\f\r\x0e\x0f\x00EXPAT_ENTROPY_DEBUG\x00expat: Entropy: %s --> 0x%0*lx (%lu bytes)\n\x00arc4random_buf\x00EXPAT_ACCOUNTING_DEBUG\x00EXPAT_ENTITY_DEBUG\x00out of memory\x00syntax error\x00no element found\x00not well-formed (invalid token)\x00unclosed token\x00partial character\x00mismatched tag\x00duplicate attribute\x00junk after document element\x00illegal parameter entity reference\x00undefined entity\x00recursive entity reference\x00asynchronous entity\x00reference to invalid character number\x00reference to binary entity\x00reference to external entity in attribute\x00XML or text declaration not at start of entity\x00unknown encoding\x00encoding specified in XML declaration is incorrect\x00unclosed CDATA section\x00error in processing external entity reference\x00document is not standalone\x00unexpected parser state - please send a bug report\x00entity declared in parameter entity\x00requested feature requires XML_DTD support in Expat\x00cannot change setting once parsing has begun\x00unbound prefix\x00must not undeclare prefix\x00incomplete markup in parameter entity\x00XML declaration not well-formed\x00text declaration not well-formed\x00illegal character(s) in public id\x00parser suspended\x00parser not suspended\x00parsing aborted\x00parsing finished\x00cannot suspend in external parameter entity\x00reserved prefix (xml) must not be undeclared or bound to another namespace name\x00reserved prefix (xmlns) must not be declared or undeclared\x00prefix must not be bound to one of the reserved namespace names\x00invalid argument\x00a successful prior call to function XML_GetBuffer is required\x00limit on input amplification factor (from DTD and entities) breached\x00expat_2.5.0\x00sizeof(XML_Char)\x00sizeof(XML_LChar)\x00XML_DTD\x00XML_CONTEXT_BYTES\x00XML_NS\x00XML_BLAP_MAX_AMP\x00XML_BLAP_ACT_THRES\x00expat: Accounting(%p): Direct %10llu, indirect %10llu, amplification %8.2f%s\x00 ABORTING\n\x00DIR\x00EXP\x00 (+%6ld bytes %s|%d, xmlparse.c:%d) %*s\"\x00\x00%s\x00\"\n\x00%\x00&\x00expat: Entities(%p): Count %9d, depth %2d/%2d %*s%s%s; %s length %d (xmlparse.c:%d)\n\x00OPEN \x00CLOSE\x00\\0\x00\\x1\x00\\x2\x00\\x3\x00\\x4\x00\\x5\x00\\x6\x00\\x7\x00\\x8\x00\\t\x00\\n\x00\\xB\x00\\xC\x00\\r\x00\\xE\x00\\xF\x00\\x10\x00\\x11\x00\\x12\x00\\x13\x00\\x14\x00\\x15\x00\\x16\x00\\x17\x00\\x18\x00\\x19\x00\\x1A\x00\\x1B\x00\\x1C\x00\\x1D\x00\\x1E\x00\\x1F\x00 \x00!\x00\\\"\x00#\x00$\x00'\x00(\x00)\x00*\x00+\x00,\x00-\x00.\x00/\x000\x001\x002\x003\x004\x005\x006\x007\x008\x009\x00:\x00;\x00<\x00=\x00>\x00?\x00@\x00A\x00B\x00C\x00D\x00E\x00F\x00G\x00H\x00I\x00J\x00K\x00L\x00M\x00N\x00O\x00P\x00Q\x00R\x00S\x00T\x00U\x00V\x00W\x00X\x00Y\x00Z\x00[\x00\\\\\x00]\x00^\x00_\x00`\x00a\x00b\x00c\x00d\x00e\x00f\x00g\x00h\x00i\x00j\x00k\x00l\x00m\x00n\x00o\x00p\x00q\x00r\x00s\x00t\x00u\x00v\x00w\x00x\x00y\x00z\x00{\x00|\x00}\x00~\x00\\x7F\x00\\x80\x00\\x81\x00\\x82\x00\\x83\x00\\x84\x00\\x85\x00\\x86\x00\\x87\x00\\x88\x00\\x89\x00\\x8A\x00\\x8B\x00\\x8C\x00\\x8D\x00\\x8E\x00\\x8F\x00\\x90\x00\\x91\x00\\x92\x00\\x93\x00\\x94\x00\\x95\x00\\x96\x00\\x97\x00\\x98\x00\\x99\x00\\x9A\x00\\x9B\x00\\x9C\x00\\x9D\x00\\x9E\x00\\x9F\x00\\xA0\x00\\xA1\x00\\xA2\x00\\xA3\x00\\xA4\x00\\xA5\x00\\xA6\x00\\xA7\x00\\xA8\x00\\xA9\x00\\xAA\x00\\xAB\x00\\xAC\x00\\xAD\x00\\xAE\x00\\xAF\x00\\xB0\x00\\xB1\x00\\xB2\x00\\xB3\x00\\xB4\x00\\xB5\x00\\xB6\x00\\xB7\x00\\xB8\x00\\xB9\x00\\xBA\x00\\xBB\x00\\xBC\x00\\xBD\x00\\xBE\x00\\xBF\x00\\xC0\x00\\xC1\x00\\xC2\x00\\xC3\x00\\xC4\x00\\xC5\x00\\xC6\x00\\xC7\x00\\xC8\x00\\xC9\x00\\xCA\x00\\xCB\x00\\xCC\x00\\xCD\x00\\xCE\x00\\xCF\x00\\xD0\x00\\xD1\x00\\xD2\x00\\xD3\x00\\xD4\x00\\xD5\x00\\xD6\x00\\xD7\x00\\xD8\x00\\xD9\x00\\xDA\x00\\xDB\x00\\xDC\x00\\xDD\x00\\xDE\x00\\xDF\x00\\xE0\x00\\xE1\x00\\xE2\x00\\xE3\x00\\xE4\x00\\xE5\x00\\xE6\x00\\xE7\x00\\xE8\x00\\xE9\x00\\xEA\x00\\xEB\x00\\xEC\x00\\xED\x00\\xEE\x00\\xEF\x00\\xF0\x00\\xF1\x00\\xF2\x00\\xF3\x00\\xF4\x00\\xF5\x00\\xF6\x00\\xF7\x00\\xF8\x00\\xF9\x00\\xFA\x00\\xFB\x00\\xFC\x00\\xFD\x00\\xFE\x00\\xFF\x00dead code\x00"