| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878188791888018881188821888318884188851888618887188881888918890188911889218893188941889518896188971889818899189001890118902189031890418905189061890718908189091891018911189121891318914189151891618917189181891918920189211892218923189241892518926189271892818929189301893118932189331893418935189361893718938189391894018941189421894318944189451894618947189481894918950189511895218953189541895518956189571895818959189601896118962189631896418965189661896718968189691897018971189721897318974189751897618977189781897918980189811898218983189841898518986189871898818989189901899118992189931899418995189961899718998189991900019001190021900319004190051900619007190081900919010190111901219013190141901519016190171901819019190201902119022190231902419025190261902719028190291903019031190321903319034190351903619037190381903919040190411904219043190441904519046190471904819049190501905119052190531905419055190561905719058190591906019061190621906319064190651906619067190681906919070190711907219073190741907519076190771907819079190801908119082190831908419085190861908719088190891909019091190921909319094190951909619097190981909919100191011910219103191041910519106191071910819109191101911119112191131911419115191161911719118191191912019121191221912319124191251912619127191281912919130191311913219133191341913519136191371913819139191401914119142191431914419145191461914719148191491915019151191521915319154191551915619157191581915919160191611916219163191641916519166191671916819169191701917119172191731917419175191761917719178191791918019181191821918319184191851918619187191881918919190191911919219193191941919519196191971919819199192001920119202192031920419205192061920719208192091921019211192121921319214192151921619217192181921919220192211922219223192241922519226192271922819229192301923119232192331923419235192361923719238192391924019241192421924319244192451924619247192481924919250192511925219253192541925519256192571925819259192601926119262192631926419265192661926719268192691927019271192721927319274192751927619277192781927919280192811928219283192841928519286192871928819289192901929119292192931929419295192961929719298192991930019301193021930319304193051930619307193081930919310193111931219313193141931519316193171931819319193201932119322193231932419325193261932719328193291933019331193321933319334193351933619337193381933919340193411934219343193441934519346193471934819349193501935119352193531935419355193561935719358193591936019361193621936319364193651936619367193681936919370193711937219373193741937519376193771937819379193801938119382193831938419385193861938719388193891939019391193921939319394193951939619397193981939919400194011940219403194041940519406194071940819409194101941119412194131941419415194161941719418194191942019421194221942319424194251942619427194281942919430194311943219433194341943519436194371943819439194401944119442194431944419445194461944719448194491945019451194521945319454194551945619457194581945919460194611946219463194641946519466194671946819469194701947119472194731947419475194761947719478194791948019481194821948319484194851948619487194881948919490194911949219493194941949519496194971949819499195001950119502195031950419505195061950719508195091951019511195121951319514195151951619517195181951919520195211952219523195241952519526195271952819529195301953119532195331953419535195361953719538195391954019541195421954319544195451954619547195481954919550195511955219553195541955519556195571955819559195601956119562195631956419565195661956719568195691957019571195721957319574195751957619577195781957919580195811958219583195841958519586195871958819589195901959119592195931959419595195961959719598195991960019601196021960319604196051960619607196081960919610196111961219613196141961519616196171961819619196201962119622196231962419625196261962719628196291963019631196321963319634196351963619637196381963919640196411964219643196441964519646196471964819649196501965119652196531965419655196561965719658196591966019661196621966319664196651966619667196681966919670196711967219673196741967519676196771967819679196801968119682196831968419685196861968719688196891969019691196921969319694196951969619697196981969919700197011970219703197041970519706197071970819709197101971119712197131971419715197161971719718197191972019721197221972319724197251972619727197281972919730197311973219733197341973519736197371973819739197401974119742197431974419745197461974719748197491975019751197521975319754197551975619757197581975919760197611976219763197641976519766197671976819769197701977119772197731977419775197761977719778197791978019781197821978319784197851978619787197881978919790197911979219793197941979519796197971979819799198001980119802198031980419805198061980719808198091981019811198121981319814198151981619817198181981919820198211982219823198241982519826198271982819829198301983119832198331983419835198361983719838198391984019841198421984319844198451984619847198481984919850198511985219853198541985519856198571985819859198601986119862198631986419865198661986719868198691987019871198721987319874198751987619877198781987919880198811988219883198841988519886198871988819889198901989119892198931989419895198961989719898198991990019901199021990319904199051990619907199081990919910199111991219913199141991519916199171991819919199201992119922199231992419925199261992719928199291993019931199321993319934199351993619937199381993919940199411994219943199441994519946199471994819949199501995119952199531995419955199561995719958199591996019961199621996319964199651996619967199681996919970199711997219973199741997519976199771997819979199801998119982199831998419985199861998719988199891999019991199921999319994199951999619997199981999920000200012000220003200042000520006200072000820009200102001120012200132001420015200162001720018200192002020021200222002320024200252002620027200282002920030200312003220033200342003520036200372003820039200402004120042200432004420045200462004720048200492005020051200522005320054200552005620057200582005920060200612006220063200642006520066200672006820069200702007120072200732007420075200762007720078200792008020081200822008320084200852008620087200882008920090200912009220093200942009520096200972009820099201002010120102201032010420105201062010720108201092011020111201122011320114201152011620117201182011920120201212012220123201242012520126201272012820129201302013120132201332013420135201362013720138201392014020141201422014320144201452014620147201482014920150201512015220153201542015520156201572015820159201602016120162201632016420165201662016720168201692017020171201722017320174201752017620177201782017920180201812018220183201842018520186201872018820189201902019120192201932019420195201962019720198201992020020201202022020320204202052020620207202082020920210202112021220213202142021520216202172021820219202202022120222202232022420225202262022720228202292023020231202322023320234202352023620237202382023920240202412024220243202442024520246202472024820249202502025120252202532025420255202562025720258202592026020261202622026320264202652026620267202682026920270202712027220273202742027520276202772027820279202802028120282202832028420285202862028720288202892029020291202922029320294202952029620297202982029920300203012030220303203042030520306203072030820309203102031120312203132031420315203162031720318203192032020321203222032320324203252032620327203282032920330203312033220333203342033520336203372033820339203402034120342203432034420345203462034720348203492035020351203522035320354203552035620357203582035920360203612036220363203642036520366203672036820369203702037120372203732037420375203762037720378203792038020381203822038320384203852038620387203882038920390203912039220393203942039520396203972039820399204002040120402204032040420405204062040720408204092041020411204122041320414204152041620417204182041920420204212042220423204242042520426204272042820429204302043120432204332043420435204362043720438204392044020441204422044320444204452044620447204482044920450204512045220453204542045520456204572045820459204602046120462204632046420465204662046720468204692047020471204722047320474204752047620477204782047920480204812048220483204842048520486204872048820489204902049120492204932049420495204962049720498204992050020501205022050320504205052050620507205082050920510205112051220513205142051520516205172051820519205202052120522205232052420525205262052720528205292053020531205322053320534205352053620537205382053920540205412054220543205442054520546205472054820549205502055120552205532055420555205562055720558205592056020561205622056320564205652056620567205682056920570205712057220573205742057520576205772057820579205802058120582205832058420585205862058720588205892059020591205922059320594205952059620597205982059920600206012060220603206042060520606206072060820609206102061120612206132061420615206162061720618206192062020621206222062320624206252062620627206282062920630206312063220633206342063520636206372063820639206402064120642206432064420645206462064720648206492065020651206522065320654206552065620657206582065920660206612066220663206642066520666206672066820669206702067120672206732067420675206762067720678206792068020681206822068320684206852068620687206882068920690206912069220693206942069520696206972069820699207002070120702207032070420705207062070720708207092071020711207122071320714207152071620717207182071920720207212072220723207242072520726207272072820729207302073120732207332073420735207362073720738207392074020741207422074320744207452074620747207482074920750207512075220753207542075520756207572075820759207602076120762207632076420765207662076720768207692077020771207722077320774207752077620777207782077920780207812078220783207842078520786207872078820789207902079120792207932079420795207962079720798207992080020801208022080320804208052080620807208082080920810208112081220813208142081520816208172081820819208202082120822208232082420825208262082720828208292083020831208322083320834208352083620837208382083920840208412084220843208442084520846208472084820849208502085120852208532085420855208562085720858208592086020861208622086320864208652086620867208682086920870208712087220873208742087520876208772087820879208802088120882208832088420885208862088720888208892089020891208922089320894208952089620897208982089920900209012090220903209042090520906209072090820909209102091120912209132091420915209162091720918209192092020921209222092320924209252092620927209282092920930209312093220933209342093520936209372093820939209402094120942209432094420945209462094720948209492095020951209522095320954209552095620957209582095920960209612096220963209642096520966209672096820969209702097120972209732097420975209762097720978209792098020981209822098320984209852098620987209882098920990209912099220993209942099520996209972099820999210002100121002210032100421005210062100721008210092101021011210122101321014210152101621017210182101921020210212102221023210242102521026210272102821029210302103121032210332103421035210362103721038210392104021041210422104321044210452104621047210482104921050210512105221053210542105521056210572105821059210602106121062210632106421065210662106721068210692107021071210722107321074210752107621077210782107921080210812108221083210842108521086210872108821089210902109121092210932109421095210962109721098210992110021101211022110321104211052110621107211082110921110211112111221113211142111521116211172111821119211202112121122211232112421125211262112721128211292113021131211322113321134211352113621137211382113921140211412114221143211442114521146211472114821149211502115121152211532115421155211562115721158211592116021161211622116321164211652116621167211682116921170211712117221173211742117521176211772117821179211802118121182211832118421185211862118721188211892119021191211922119321194211952119621197211982119921200212012120221203212042120521206212072120821209212102121121212212132121421215212162121721218212192122021221212222122321224212252122621227212282122921230212312123221233212342123521236212372123821239212402124121242212432124421245212462124721248212492125021251212522125321254212552125621257212582125921260212612126221263212642126521266212672126821269212702127121272212732127421275212762127721278212792128021281212822128321284212852128621287212882128921290212912129221293212942129521296212972129821299213002130121302213032130421305213062130721308213092131021311213122131321314213152131621317213182131921320213212132221323213242132521326213272132821329213302133121332213332133421335213362133721338213392134021341213422134321344213452134621347213482134921350213512135221353213542135521356213572135821359213602136121362213632136421365213662136721368213692137021371213722137321374213752137621377213782137921380213812138221383213842138521386213872138821389213902139121392213932139421395213962139721398213992140021401214022140321404214052140621407214082140921410214112141221413214142141521416214172141821419214202142121422214232142421425214262142721428214292143021431214322143321434214352143621437214382143921440214412144221443214442144521446214472144821449214502145121452214532145421455214562145721458214592146021461214622146321464214652146621467214682146921470214712147221473214742147521476214772147821479214802148121482214832148421485214862148721488214892149021491214922149321494214952149621497214982149921500215012150221503215042150521506215072150821509215102151121512215132151421515215162151721518215192152021521215222152321524215252152621527215282152921530215312153221533215342153521536215372153821539215402154121542215432154421545215462154721548215492155021551215522155321554215552155621557215582155921560215612156221563215642156521566215672156821569215702157121572215732157421575215762157721578215792158021581215822158321584215852158621587215882158921590215912159221593215942159521596215972159821599216002160121602216032160421605216062160721608216092161021611216122161321614216152161621617216182161921620216212162221623216242162521626216272162821629216302163121632216332163421635216362163721638216392164021641216422164321644216452164621647216482164921650216512165221653216542165521656216572165821659216602166121662216632166421665216662166721668216692167021671216722167321674216752167621677216782167921680216812168221683216842168521686216872168821689216902169121692216932169421695216962169721698216992170021701217022170321704217052170621707217082170921710217112171221713217142171521716217172171821719217202172121722217232172421725217262172721728217292173021731217322173321734217352173621737217382173921740217412174221743217442174521746217472174821749217502175121752217532175421755217562175721758217592176021761217622176321764217652176621767217682176921770217712177221773217742177521776217772177821779217802178121782217832178421785217862178721788217892179021791217922179321794217952179621797217982179921800218012180221803218042180521806218072180821809218102181121812218132181421815218162181721818218192182021821218222182321824218252182621827218282182921830218312183221833218342183521836218372183821839218402184121842218432184421845218462184721848218492185021851218522185321854218552185621857218582185921860218612186221863218642186521866218672186821869218702187121872218732187421875218762187721878218792188021881218822188321884218852188621887218882188921890218912189221893218942189521896218972189821899219002190121902219032190421905219062190721908219092191021911219122191321914219152191621917219182191921920219212192221923219242192521926219272192821929219302193121932219332193421935219362193721938219392194021941219422194321944219452194621947219482194921950219512195221953219542195521956219572195821959219602196121962219632196421965219662196721968219692197021971219722197321974219752197621977219782197921980219812198221983219842198521986219872198821989219902199121992219932199421995219962199721998219992200022001220022200322004220052200622007220082200922010220112201222013220142201522016220172201822019220202202122022220232202422025220262202722028220292203022031220322203322034220352203622037220382203922040220412204222043220442204522046220472204822049220502205122052220532205422055220562205722058220592206022061220622206322064220652206622067220682206922070220712207222073220742207522076220772207822079220802208122082220832208422085220862208722088220892209022091220922209322094220952209622097220982209922100221012210222103221042210522106221072210822109221102211122112221132211422115221162211722118221192212022121221222212322124221252212622127221282212922130221312213222133221342213522136221372213822139221402214122142221432214422145221462214722148221492215022151221522215322154221552215622157221582215922160221612216222163221642216522166221672216822169221702217122172221732217422175221762217722178221792218022181221822218322184221852218622187221882218922190221912219222193221942219522196221972219822199222002220122202222032220422205222062220722208222092221022211222122221322214222152221622217222182221922220222212222222223222242222522226222272222822229222302223122232222332223422235222362223722238222392224022241222422224322244222452224622247222482224922250222512225222253222542225522256222572225822259222602226122262222632226422265222662226722268222692227022271222722227322274222752227622277222782227922280222812228222283222842228522286222872228822289222902229122292222932229422295222962229722298222992230022301223022230322304223052230622307223082230922310223112231222313223142231522316223172231822319223202232122322223232232422325223262232722328223292233022331223322233322334223352233622337223382233922340223412234222343223442234522346223472234822349223502235122352223532235422355223562235722358223592236022361223622236322364223652236622367223682236922370223712237222373223742237522376223772237822379223802238122382223832238422385223862238722388223892239022391223922239322394223952239622397223982239922400224012240222403224042240522406224072240822409224102241122412224132241422415224162241722418224192242022421224222242322424224252242622427224282242922430224312243222433224342243522436224372243822439224402244122442224432244422445224462244722448224492245022451224522245322454224552245622457224582245922460224612246222463224642246522466224672246822469224702247122472224732247422475224762247722478224792248022481224822248322484224852248622487224882248922490224912249222493224942249522496224972249822499225002250122502225032250422505225062250722508225092251022511225122251322514225152251622517225182251922520225212252222523225242252522526225272252822529225302253122532225332253422535225362253722538225392254022541225422254322544225452254622547225482254922550225512255222553225542255522556225572255822559225602256122562225632256422565225662256722568225692257022571225722257322574225752257622577225782257922580225812258222583225842258522586225872258822589225902259122592225932259422595225962259722598225992260022601226022260322604226052260622607226082260922610226112261222613226142261522616226172261822619226202262122622226232262422625226262262722628226292263022631226322263322634226352263622637226382263922640226412264222643226442264522646226472264822649226502265122652226532265422655226562265722658226592266022661226622266322664226652266622667226682266922670226712267222673226742267522676226772267822679226802268122682226832268422685226862268722688226892269022691226922269322694226952269622697226982269922700227012270222703227042270522706227072270822709227102271122712227132271422715227162271722718227192272022721227222272322724227252272622727227282272922730227312273222733227342273522736227372273822739227402274122742227432274422745227462274722748227492275022751227522275322754227552275622757227582275922760227612276222763227642276522766227672276822769227702277122772227732277422775227762277722778227792278022781227822278322784227852278622787227882278922790227912279222793227942279522796227972279822799228002280122802228032280422805228062280722808228092281022811228122281322814228152281622817228182281922820228212282222823228242282522826228272282822829228302283122832228332283422835228362283722838228392284022841228422284322844228452284622847228482284922850228512285222853228542285522856228572285822859228602286122862228632286422865228662286722868228692287022871228722287322874228752287622877228782287922880228812288222883228842288522886228872288822889228902289122892228932289422895228962289722898228992290022901229022290322904229052290622907229082290922910229112291222913229142291522916229172291822919229202292122922229232292422925229262292722928229292293022931229322293322934229352293622937229382293922940229412294222943229442294522946229472294822949229502295122952229532295422955229562295722958229592296022961229622296322964229652296622967229682296922970229712297222973229742297522976229772297822979229802298122982229832298422985229862298722988229892299022991229922299322994229952299622997229982299923000230012300223003230042300523006230072300823009230102301123012230132301423015230162301723018230192302023021230222302323024230252302623027230282302923030230312303223033230342303523036230372303823039230402304123042230432304423045230462304723048230492305023051230522305323054230552305623057230582305923060230612306223063230642306523066230672306823069230702307123072230732307423075230762307723078230792308023081230822308323084230852308623087230882308923090230912309223093230942309523096230972309823099231002310123102231032310423105231062310723108231092311023111231122311323114231152311623117231182311923120231212312223123231242312523126231272312823129231302313123132231332313423135231362313723138231392314023141231422314323144231452314623147231482314923150231512315223153231542315523156231572315823159231602316123162231632316423165231662316723168231692317023171231722317323174231752317623177231782317923180231812318223183231842318523186231872318823189231902319123192231932319423195231962319723198231992320023201232022320323204232052320623207232082320923210232112321223213232142321523216232172321823219232202322123222232232322423225232262322723228232292323023231232322323323234232352323623237232382323923240232412324223243232442324523246232472324823249232502325123252232532325423255232562325723258232592326023261232622326323264232652326623267232682326923270232712327223273232742327523276232772327823279232802328123282232832328423285232862328723288232892329023291232922329323294232952329623297232982329923300233012330223303233042330523306233072330823309233102331123312233132331423315233162331723318233192332023321233222332323324233252332623327233282332923330233312333223333233342333523336233372333823339233402334123342233432334423345233462334723348233492335023351233522335323354233552335623357233582335923360233612336223363233642336523366233672336823369233702337123372233732337423375233762337723378233792338023381233822338323384233852338623387233882338923390233912339223393233942339523396233972339823399234002340123402234032340423405234062340723408234092341023411234122341323414234152341623417234182341923420234212342223423234242342523426234272342823429234302343123432234332343423435234362343723438234392344023441234422344323444234452344623447234482344923450234512345223453234542345523456234572345823459234602346123462234632346423465234662346723468234692347023471234722347323474234752347623477234782347923480234812348223483234842348523486234872348823489234902349123492234932349423495234962349723498234992350023501235022350323504235052350623507235082350923510235112351223513235142351523516235172351823519235202352123522235232352423525235262352723528235292353023531235322353323534235352353623537235382353923540235412354223543235442354523546235472354823549235502355123552235532355423555235562355723558235592356023561235622356323564235652356623567235682356923570235712357223573235742357523576235772357823579235802358123582235832358423585235862358723588235892359023591235922359323594235952359623597235982359923600236012360223603236042360523606236072360823609236102361123612236132361423615236162361723618236192362023621236222362323624236252362623627236282362923630236312363223633236342363523636236372363823639236402364123642236432364423645236462364723648236492365023651236522365323654236552365623657236582365923660236612366223663236642366523666236672366823669236702367123672236732367423675236762367723678236792368023681236822368323684236852368623687236882368923690236912369223693236942369523696236972369823699237002370123702237032370423705237062370723708237092371023711237122371323714237152371623717237182371923720237212372223723237242372523726237272372823729237302373123732237332373423735237362373723738237392374023741237422374323744237452374623747237482374923750237512375223753237542375523756237572375823759237602376123762237632376423765237662376723768237692377023771237722377323774237752377623777237782377923780237812378223783237842378523786237872378823789237902379123792237932379423795237962379723798237992380023801238022380323804238052380623807238082380923810238112381223813238142381523816238172381823819238202382123822238232382423825238262382723828238292383023831238322383323834238352383623837238382383923840238412384223843238442384523846238472384823849238502385123852238532385423855238562385723858238592386023861238622386323864238652386623867238682386923870238712387223873238742387523876238772387823879238802388123882238832388423885238862388723888238892389023891238922389323894238952389623897238982389923900239012390223903239042390523906239072390823909239102391123912239132391423915239162391723918239192392023921239222392323924239252392623927239282392923930239312393223933239342393523936239372393823939239402394123942239432394423945239462394723948239492395023951239522395323954239552395623957239582395923960239612396223963239642396523966239672396823969239702397123972239732397423975239762397723978239792398023981239822398323984239852398623987239882398923990239912399223993239942399523996239972399823999240002400124002240032400424005240062400724008240092401024011240122401324014240152401624017240182401924020240212402224023240242402524026240272402824029240302403124032240332403424035240362403724038240392404024041240422404324044240452404624047240482404924050240512405224053240542405524056240572405824059240602406124062240632406424065240662406724068240692407024071240722407324074240752407624077240782407924080240812408224083240842408524086240872408824089240902409124092240932409424095240962409724098240992410024101241022410324104241052410624107241082410924110241112411224113241142411524116241172411824119241202412124122241232412424125241262412724128241292413024131241322413324134241352413624137241382413924140241412414224143241442414524146241472414824149241502415124152241532415424155241562415724158241592416024161241622416324164241652416624167241682416924170241712417224173241742417524176241772417824179241802418124182241832418424185241862418724188241892419024191241922419324194241952419624197241982419924200242012420224203242042420524206242072420824209242102421124212242132421424215242162421724218242192422024221242222422324224242252422624227242282422924230242312423224233242342423524236242372423824239242402424124242242432424424245242462424724248242492425024251242522425324254242552425624257242582425924260242612426224263242642426524266242672426824269242702427124272242732427424275242762427724278242792428024281242822428324284242852428624287242882428924290242912429224293242942429524296242972429824299243002430124302243032430424305243062430724308243092431024311243122431324314243152431624317243182431924320243212432224323243242432524326243272432824329243302433124332243332433424335243362433724338243392434024341243422434324344243452434624347243482434924350243512435224353243542435524356243572435824359243602436124362243632436424365243662436724368243692437024371243722437324374243752437624377243782437924380243812438224383243842438524386243872438824389243902439124392243932439424395243962439724398243992440024401244022440324404244052440624407244082440924410244112441224413244142441524416244172441824419244202442124422244232442424425244262442724428244292443024431244322443324434244352443624437244382443924440244412444224443244442444524446244472444824449244502445124452244532445424455244562445724458244592446024461244622446324464244652446624467244682446924470244712447224473244742447524476244772447824479244802448124482244832448424485244862448724488244892449024491244922449324494244952449624497244982449924500245012450224503245042450524506245072450824509245102451124512245132451424515245162451724518245192452024521245222452324524245252452624527245282452924530245312453224533245342453524536245372453824539245402454124542245432454424545245462454724548245492455024551245522455324554245552455624557245582455924560245612456224563245642456524566245672456824569245702457124572245732457424575245762457724578245792458024581245822458324584245852458624587245882458924590245912459224593245942459524596245972459824599246002460124602246032460424605246062460724608246092461024611246122461324614246152461624617246182461924620246212462224623246242462524626246272462824629246302463124632246332463424635246362463724638246392464024641246422464324644246452464624647246482464924650246512465224653246542465524656246572465824659246602466124662246632466424665246662466724668246692467024671246722467324674246752467624677246782467924680246812468224683246842468524686246872468824689246902469124692246932469424695246962469724698246992470024701247022470324704247052470624707247082470924710247112471224713247142471524716247172471824719247202472124722247232472424725247262472724728247292473024731247322473324734247352473624737247382473924740247412474224743247442474524746247472474824749247502475124752247532475424755247562475724758247592476024761247622476324764247652476624767247682476924770247712477224773247742477524776247772477824779247802478124782247832478424785247862478724788247892479024791247922479324794247952479624797247982479924800248012480224803248042480524806248072480824809248102481124812248132481424815248162481724818248192482024821248222482324824248252482624827248282482924830248312483224833248342483524836248372483824839248402484124842248432484424845248462484724848248492485024851248522485324854248552485624857248582485924860248612486224863248642486524866248672486824869248702487124872248732487424875248762487724878248792488024881248822488324884248852488624887248882488924890248912489224893248942489524896248972489824899249002490124902249032490424905249062490724908249092491024911249122491324914249152491624917249182491924920249212492224923249242492524926249272492824929249302493124932249332493424935249362493724938249392494024941249422494324944249452494624947249482494924950249512495224953249542495524956249572495824959249602496124962249632496424965249662496724968249692497024971249722497324974249752497624977249782497924980249812498224983249842498524986249872498824989249902499124992249932499424995249962499724998249992500025001250022500325004250052500625007250082500925010250112501225013250142501525016250172501825019250202502125022250232502425025250262502725028250292503025031250322503325034250352503625037250382503925040250412504225043250442504525046250472504825049250502505125052250532505425055250562505725058250592506025061250622506325064250652506625067250682506925070250712507225073250742507525076250772507825079250802508125082250832508425085250862508725088250892509025091250922509325094250952509625097250982509925100251012510225103251042510525106251072510825109251102511125112251132511425115251162511725118251192512025121251222512325124251252512625127251282512925130251312513225133251342513525136251372513825139251402514125142251432514425145251462514725148251492515025151251522515325154251552515625157251582515925160251612516225163251642516525166251672516825169251702517125172251732517425175251762517725178251792518025181251822518325184251852518625187251882518925190251912519225193251942519525196251972519825199252002520125202252032520425205252062520725208252092521025211252122521325214252152521625217252182521925220252212522225223252242522525226252272522825229252302523125232252332523425235252362523725238252392524025241252422524325244252452524625247252482524925250252512525225253252542525525256252572525825259252602526125262252632526425265252662526725268252692527025271252722527325274252752527625277252782527925280252812528225283252842528525286252872528825289252902529125292252932529425295252962529725298252992530025301253022530325304253052530625307253082530925310253112531225313253142531525316253172531825319253202532125322253232532425325253262532725328253292533025331253322533325334253352533625337253382533925340253412534225343253442534525346253472534825349253502535125352253532535425355253562535725358253592536025361253622536325364253652536625367253682536925370253712537225373253742537525376253772537825379253802538125382253832538425385253862538725388253892539025391253922539325394253952539625397253982539925400254012540225403254042540525406254072540825409254102541125412254132541425415254162541725418254192542025421254222542325424254252542625427254282542925430254312543225433254342543525436254372543825439254402544125442254432544425445254462544725448254492545025451254522545325454254552545625457254582545925460254612546225463254642546525466254672546825469254702547125472254732547425475254762547725478254792548025481254822548325484254852548625487254882548925490254912549225493254942549525496254972549825499255002550125502255032550425505255062550725508255092551025511255122551325514255152551625517255182551925520255212552225523255242552525526255272552825529255302553125532255332553425535255362553725538255392554025541255422554325544255452554625547255482554925550255512555225553255542555525556255572555825559255602556125562255632556425565255662556725568255692557025571255722557325574255752557625577255782557925580255812558225583255842558525586255872558825589255902559125592255932559425595255962559725598255992560025601256022560325604256052560625607256082560925610256112561225613256142561525616256172561825619256202562125622256232562425625256262562725628256292563025631256322563325634256352563625637256382563925640256412564225643256442564525646256472564825649256502565125652256532565425655256562565725658256592566025661256622566325664256652566625667256682566925670256712567225673256742567525676256772567825679256802568125682256832568425685256862568725688256892569025691256922569325694256952569625697256982569925700257012570225703257042570525706257072570825709257102571125712257132571425715257162571725718257192572025721257222572325724257252572625727257282572925730257312573225733257342573525736257372573825739257402574125742257432574425745257462574725748257492575025751257522575325754257552575625757257582575925760257612576225763257642576525766257672576825769257702577125772257732577425775257762577725778257792578025781257822578325784257852578625787257882578925790257912579225793257942579525796257972579825799258002580125802258032580425805258062580725808258092581025811258122581325814258152581625817258182581925820258212582225823258242582525826258272582825829258302583125832258332583425835258362583725838258392584025841258422584325844258452584625847258482584925850258512585225853258542585525856258572585825859258602586125862258632586425865258662586725868258692587025871258722587325874258752587625877258782587925880258812588225883258842588525886258872588825889258902589125892258932589425895258962589725898258992590025901259022590325904259052590625907259082590925910259112591225913259142591525916259172591825919259202592125922259232592425925259262592725928259292593025931259322593325934259352593625937259382593925940259412594225943259442594525946259472594825949259502595125952259532595425955259562595725958259592596025961259622596325964259652596625967259682596925970259712597225973259742597525976259772597825979259802598125982259832598425985259862598725988259892599025991259922599325994259952599625997259982599926000260012600226003260042600526006260072600826009260102601126012260132601426015260162601726018260192602026021260222602326024260252602626027260282602926030260312603226033260342603526036260372603826039260402604126042260432604426045260462604726048260492605026051260522605326054260552605626057260582605926060260612606226063260642606526066260672606826069260702607126072260732607426075260762607726078260792608026081260822608326084260852608626087260882608926090260912609226093260942609526096260972609826099261002610126102261032610426105261062610726108261092611026111261122611326114261152611626117261182611926120261212612226123261242612526126261272612826129261302613126132261332613426135261362613726138261392614026141261422614326144261452614626147261482614926150261512615226153261542615526156261572615826159261602616126162261632616426165261662616726168261692617026171261722617326174261752617626177261782617926180261812618226183261842618526186261872618826189261902619126192261932619426195261962619726198261992620026201262022620326204262052620626207262082620926210262112621226213262142621526216262172621826219262202622126222262232622426225262262622726228262292623026231262322623326234262352623626237262382623926240262412624226243262442624526246262472624826249262502625126252262532625426255262562625726258262592626026261262622626326264262652626626267262682626926270262712627226273262742627526276262772627826279262802628126282262832628426285262862628726288262892629026291262922629326294262952629626297262982629926300263012630226303263042630526306263072630826309263102631126312263132631426315263162631726318263192632026321263222632326324263252632626327263282632926330263312633226333263342633526336263372633826339263402634126342263432634426345263462634726348263492635026351263522635326354263552635626357263582635926360263612636226363263642636526366263672636826369263702637126372263732637426375263762637726378263792638026381263822638326384263852638626387263882638926390263912639226393263942639526396263972639826399264002640126402264032640426405264062640726408264092641026411264122641326414264152641626417264182641926420264212642226423264242642526426264272642826429264302643126432264332643426435264362643726438264392644026441264422644326444264452644626447264482644926450264512645226453264542645526456264572645826459264602646126462264632646426465264662646726468264692647026471264722647326474264752647626477264782647926480264812648226483264842648526486264872648826489264902649126492264932649426495264962649726498264992650026501265022650326504265052650626507265082650926510265112651226513265142651526516265172651826519265202652126522265232652426525265262652726528265292653026531265322653326534265352653626537265382653926540265412654226543265442654526546265472654826549265502655126552265532655426555265562655726558265592656026561265622656326564265652656626567265682656926570265712657226573265742657526576265772657826579265802658126582265832658426585265862658726588265892659026591265922659326594265952659626597265982659926600266012660226603266042660526606266072660826609266102661126612266132661426615266162661726618266192662026621266222662326624266252662626627266282662926630266312663226633266342663526636266372663826639266402664126642266432664426645266462664726648266492665026651266522665326654266552665626657266582665926660266612666226663266642666526666266672666826669266702667126672266732667426675266762667726678266792668026681266822668326684266852668626687266882668926690266912669226693266942669526696266972669826699267002670126702267032670426705267062670726708267092671026711267122671326714267152671626717267182671926720267212672226723267242672526726267272672826729267302673126732267332673426735267362673726738267392674026741267422674326744267452674626747267482674926750267512675226753267542675526756267572675826759267602676126762267632676426765267662676726768267692677026771267722677326774267752677626777267782677926780267812678226783267842678526786267872678826789267902679126792267932679426795267962679726798267992680026801268022680326804268052680626807268082680926810268112681226813268142681526816268172681826819268202682126822268232682426825268262682726828268292683026831268322683326834268352683626837268382683926840268412684226843268442684526846268472684826849268502685126852268532685426855268562685726858268592686026861268622686326864268652686626867268682686926870268712687226873268742687526876268772687826879268802688126882268832688426885268862688726888268892689026891268922689326894268952689626897268982689926900269012690226903269042690526906269072690826909269102691126912269132691426915269162691726918269192692026921269222692326924269252692626927269282692926930269312693226933269342693526936269372693826939269402694126942269432694426945269462694726948269492695026951269522695326954269552695626957269582695926960269612696226963269642696526966269672696826969269702697126972269732697426975269762697726978269792698026981269822698326984269852698626987269882698926990269912699226993269942699526996269972699826999270002700127002270032700427005270062700727008270092701027011270122701327014270152701627017270182701927020270212702227023270242702527026270272702827029270302703127032270332703427035270362703727038270392704027041270422704327044270452704627047270482704927050270512705227053270542705527056270572705827059270602706127062270632706427065270662706727068270692707027071270722707327074270752707627077270782707927080270812708227083270842708527086270872708827089270902709127092270932709427095270962709727098270992710027101271022710327104271052710627107271082710927110271112711227113271142711527116271172711827119271202712127122271232712427125271262712727128271292713027131271322713327134271352713627137271382713927140271412714227143271442714527146271472714827149271502715127152271532715427155271562715727158271592716027161271622716327164271652716627167271682716927170271712717227173271742717527176271772717827179271802718127182271832718427185271862718727188271892719027191271922719327194271952719627197271982719927200272012720227203272042720527206272072720827209272102721127212272132721427215272162721727218272192722027221272222722327224272252722627227272282722927230272312723227233272342723527236272372723827239272402724127242272432724427245272462724727248272492725027251272522725327254272552725627257272582725927260272612726227263272642726527266272672726827269272702727127272272732727427275272762727727278272792728027281272822728327284272852728627287272882728927290272912729227293272942729527296272972729827299273002730127302273032730427305273062730727308273092731027311273122731327314273152731627317273182731927320273212732227323273242732527326273272732827329273302733127332273332733427335273362733727338273392734027341273422734327344273452734627347273482734927350273512735227353273542735527356273572735827359273602736127362273632736427365273662736727368273692737027371273722737327374273752737627377273782737927380273812738227383273842738527386273872738827389273902739127392273932739427395273962739727398273992740027401274022740327404274052740627407274082740927410274112741227413274142741527416274172741827419274202742127422274232742427425274262742727428274292743027431274322743327434274352743627437274382743927440274412744227443274442744527446274472744827449274502745127452274532745427455274562745727458274592746027461274622746327464274652746627467274682746927470274712747227473274742747527476274772747827479274802748127482274832748427485274862748727488274892749027491274922749327494274952749627497274982749927500275012750227503275042750527506275072750827509275102751127512275132751427515275162751727518275192752027521275222752327524275252752627527275282752927530275312753227533275342753527536275372753827539275402754127542275432754427545275462754727548275492755027551275522755327554275552755627557275582755927560275612756227563275642756527566275672756827569275702757127572275732757427575275762757727578275792758027581275822758327584275852758627587275882758927590275912759227593275942759527596275972759827599276002760127602276032760427605276062760727608276092761027611276122761327614276152761627617276182761927620276212762227623276242762527626276272762827629276302763127632276332763427635276362763727638276392764027641276422764327644276452764627647276482764927650276512765227653276542765527656276572765827659276602766127662276632766427665276662766727668276692767027671276722767327674276752767627677276782767927680276812768227683276842768527686276872768827689276902769127692276932769427695276962769727698276992770027701277022770327704277052770627707277082770927710277112771227713277142771527716277172771827719277202772127722277232772427725277262772727728277292773027731277322773327734277352773627737277382773927740277412774227743277442774527746277472774827749277502775127752277532775427755277562775727758277592776027761277622776327764277652776627767277682776927770277712777227773277742777527776277772777827779277802778127782277832778427785277862778727788277892779027791277922779327794277952779627797277982779927800278012780227803278042780527806278072780827809278102781127812278132781427815278162781727818278192782027821278222782327824278252782627827278282782927830278312783227833278342783527836278372783827839278402784127842278432784427845278462784727848278492785027851278522785327854278552785627857278582785927860278612786227863278642786527866278672786827869278702787127872278732787427875278762787727878278792788027881278822788327884278852788627887278882788927890278912789227893278942789527896278972789827899279002790127902279032790427905279062790727908279092791027911279122791327914279152791627917279182791927920279212792227923279242792527926279272792827929279302793127932279332793427935279362793727938279392794027941279422794327944279452794627947279482794927950279512795227953279542795527956279572795827959279602796127962279632796427965279662796727968279692797027971279722797327974279752797627977279782797927980279812798227983279842798527986279872798827989279902799127992279932799427995279962799727998279992800028001280022800328004280052800628007280082800928010280112801228013280142801528016280172801828019280202802128022280232802428025280262802728028280292803028031280322803328034280352803628037280382803928040280412804228043280442804528046280472804828049280502805128052280532805428055280562805728058280592806028061280622806328064280652806628067280682806928070280712807228073280742807528076280772807828079280802808128082280832808428085280862808728088280892809028091280922809328094280952809628097280982809928100281012810228103281042810528106281072810828109281102811128112281132811428115281162811728118281192812028121281222812328124281252812628127281282812928130281312813228133281342813528136281372813828139281402814128142281432814428145281462814728148281492815028151281522815328154281552815628157281582815928160281612816228163281642816528166281672816828169281702817128172281732817428175281762817728178281792818028181281822818328184281852818628187281882818928190281912819228193281942819528196281972819828199282002820128202282032820428205282062820728208282092821028211282122821328214282152821628217282182821928220282212822228223282242822528226282272822828229282302823128232282332823428235282362823728238282392824028241282422824328244282452824628247282482824928250282512825228253282542825528256282572825828259282602826128262282632826428265282662826728268282692827028271282722827328274282752827628277282782827928280282812828228283282842828528286282872828828289282902829128292282932829428295282962829728298282992830028301283022830328304283052830628307283082830928310283112831228313283142831528316283172831828319283202832128322283232832428325283262832728328283292833028331283322833328334283352833628337283382833928340283412834228343283442834528346283472834828349283502835128352283532835428355283562835728358283592836028361283622836328364283652836628367283682836928370283712837228373283742837528376283772837828379283802838128382283832838428385283862838728388283892839028391283922839328394283952839628397283982839928400284012840228403284042840528406284072840828409284102841128412284132841428415284162841728418284192842028421284222842328424284252842628427284282842928430284312843228433284342843528436284372843828439284402844128442284432844428445284462844728448284492845028451284522845328454284552845628457284582845928460284612846228463284642846528466284672846828469284702847128472284732847428475284762847728478284792848028481284822848328484284852848628487284882848928490284912849228493284942849528496284972849828499285002850128502285032850428505285062850728508285092851028511285122851328514285152851628517285182851928520285212852228523285242852528526285272852828529285302853128532285332853428535285362853728538285392854028541285422854328544285452854628547285482854928550285512855228553285542855528556285572855828559285602856128562285632856428565285662856728568285692857028571285722857328574285752857628577285782857928580285812858228583285842858528586285872858828589285902859128592285932859428595285962859728598285992860028601286022860328604286052860628607286082860928610286112861228613286142861528616286172861828619286202862128622286232862428625286262862728628286292863028631286322863328634286352863628637286382863928640286412864228643286442864528646286472864828649286502865128652286532865428655286562865728658286592866028661286622866328664286652866628667286682866928670286712867228673286742867528676286772867828679286802868128682286832868428685286862868728688286892869028691286922869328694286952869628697286982869928700287012870228703287042870528706287072870828709287102871128712287132871428715287162871728718287192872028721287222872328724287252872628727287282872928730287312873228733287342873528736287372873828739287402874128742287432874428745287462874728748287492875028751287522875328754287552875628757287582875928760287612876228763287642876528766287672876828769287702877128772287732877428775287762877728778287792878028781287822878328784287852878628787287882878928790287912879228793287942879528796287972879828799288002880128802288032880428805288062880728808288092881028811288122881328814288152881628817288182881928820288212882228823288242882528826288272882828829288302883128832288332883428835288362883728838288392884028841288422884328844288452884628847288482884928850288512885228853288542885528856288572885828859288602886128862288632886428865288662886728868288692887028871288722887328874288752887628877288782887928880288812888228883288842888528886288872888828889288902889128892288932889428895288962889728898288992890028901289022890328904289052890628907289082890928910289112891228913289142891528916289172891828919289202892128922289232892428925289262892728928289292893028931289322893328934289352893628937289382893928940289412894228943289442894528946289472894828949289502895128952289532895428955289562895728958289592896028961289622896328964289652896628967289682896928970289712897228973289742897528976289772897828979289802898128982289832898428985289862898728988289892899028991289922899328994289952899628997289982899929000290012900229003290042900529006290072900829009290102901129012290132901429015290162901729018290192902029021290222902329024290252902629027290282902929030290312903229033290342903529036290372903829039290402904129042290432904429045290462904729048290492905029051290522905329054290552905629057290582905929060290612906229063290642906529066290672906829069290702907129072290732907429075290762907729078290792908029081290822908329084290852908629087290882908929090290912909229093290942909529096290972909829099291002910129102291032910429105291062910729108291092911029111291122911329114291152911629117291182911929120291212912229123291242912529126291272912829129291302913129132291332913429135291362913729138291392914029141291422914329144291452914629147291482914929150291512915229153291542915529156 |
- // Code generated for linux/amd64 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 /home/jnml/src/modernc.org/builder/.exclude/modernc.org/libbsd/include/linux/amd64 -extended-errors -ignore-unsupported-alignment -ignore-link-errors -lbsd -o libexpat.go --package-name libexpat lib/.libs/libexpat.a', DO NOT EDIT.
- //go:build linux && amd64
- package libexpat
- import (
- "reflect"
- "unsafe"
- "modernc.org/libbsd"
- "modernc.org/libc"
- )
- var _ reflect.Type
- var _ unsafe.Pointer
- const m_ARG_MAX = 131072
- const m_ASCII_0 = 48
- const m_ASCII_1 = 49
- const m_ASCII_2 = 50
- const m_ASCII_3 = 51
- const m_ASCII_4 = 0x34
- const m_ASCII_5 = 0x35
- const m_ASCII_6 = 0x36
- const m_ASCII_7 = 0x37
- const m_ASCII_8 = 56
- const m_ASCII_9 = 57
- const m_ASCII_A = 65
- const m_ASCII_AMP = 0x26
- const m_ASCII_APOS = 0x27
- const m_ASCII_B = 0x42
- const m_ASCII_C = 67
- const m_ASCII_COLON = 58
- const m_ASCII_COMMA = 44
- const m_ASCII_D = 68
- const m_ASCII_E = 69
- const m_ASCII_EQUALS = 61
- const m_ASCII_EXCL = 33
- const m_ASCII_F = 70
- const m_ASCII_FF = 12
- const m_ASCII_G = 0x47
- const m_ASCII_GT = 0x3E
- const m_ASCII_H = 0x48
- const m_ASCII_HASH = 35
- const m_ASCII_I = 73
- const m_ASCII_J = 0x4A
- const m_ASCII_K = 75
- const m_ASCII_L = 76
- const m_ASCII_LPAREN = 40
- const m_ASCII_LSQB = 0x5B
- const m_ASCII_LT = 0x3C
- const m_ASCII_M = 77
- const m_ASCII_MINUS = 0x2D
- const m_ASCII_N = 78
- const m_ASCII_O = 79
- const m_ASCII_P = 0x50
- const m_ASCII_PERIOD = 46
- const m_ASCII_PIPE = 124
- const m_ASCII_Q = 0x51
- const m_ASCII_QUOT = 0x22
- const m_ASCII_R = 82
- const m_ASCII_RPAREN = 41
- const m_ASCII_RSQB = 0x5D
- const m_ASCII_S = 83
- const m_ASCII_SEMI = 0x3B
- const m_ASCII_SLASH = 47
- const m_ASCII_SPACE = 0x20
- const m_ASCII_T = 84
- const m_ASCII_TAB = 0x09
- const m_ASCII_U = 0x55
- const m_ASCII_UNDERSCORE = 0x5F
- const m_ASCII_V = 0x56
- const m_ASCII_W = 0x57
- const m_ASCII_X = 88
- const m_ASCII_Y = 89
- const m_ASCII_Z = 0x5A
- const m_ASCII_a = 97
- const m_ASCII_b = 0x62
- const m_ASCII_c = 99
- const m_ASCII_d = 0x64
- const m_ASCII_e = 101
- const m_ASCII_f = 0x66
- const m_ASCII_g = 103
- const m_ASCII_h = 104
- const m_ASCII_i = 0x69
- const m_ASCII_j = 0x6A
- const m_ASCII_k = 0x6B
- const m_ASCII_l = 108
- const m_ASCII_m = 109
- const m_ASCII_n = 110
- const m_ASCII_o = 111
- const m_ASCII_p = 112
- const m_ASCII_q = 0x71
- const m_ASCII_r = 114
- const m_ASCII_s = 115
- const m_ASCII_t = 116
- const m_ASCII_u = 0x75
- const m_ASCII_v = 0x76
- const m_ASCII_w = 119
- const m_ASCII_x = 120
- const m_ASCII_y = 0x79
- const m_ASCII_z = 0x7A
- const m_AT_EACCESS = 0x200
- const m_AT_EMPTY_PATH = 0x1000
- const m_AT_NO_AUTOMOUNT = 0x800
- const m_AT_RECURSIVE = 0x8000
- const m_AT_REMOVEDIR = 0x200
- const m_AT_STATX_DONT_SYNC = 0x4000
- const m_AT_STATX_FORCE_SYNC = 0x2000
- const m_AT_STATX_SYNC_AS_STAT = 0x0000
- const m_AT_STATX_SYNC_TYPE = 0x6000
- const m_AT_SYMLINK_FOLLOW = 0x400
- const m_AT_SYMLINK_NOFOLLOW = 0x100
- const m_BC_BASE_MAX = 99
- const m_BC_DIM_MAX = 2048
- const m_BC_SCALE_MAX = 99
- const m_BC_STRING_MAX = 1000
- const m_BIG_ENDIAN = "__BIG_ENDIAN"
- const m_BUFSIZ = 1024
- const m_BYTEORDER = 1234
- const m_BYTE_ORDER = "__BYTE_ORDER"
- const m_CHARCLASS_NAME_MAX = 14
- const m_CHAR_BIT = 8
- const m_CHAR_MAX = 255
- const m_CHAR_MIN = 0
- const m_COLL_WEIGHTS_MAX = 2
- const m_DELAYTIMER_MAX = 0x7fffffff
- const m_DN_ACCESS = 0x00000001
- const m_DN_ATTRIB = 0x00000020
- const m_DN_CREATE = 0x00000004
- const m_DN_DELETE = 0x00000008
- const m_DN_MODIFY = 0x00000002
- const m_DN_MULTISHOT = 0x80000000
- const m_DN_RENAME = 0x00000010
- const m_E2BIG = 7
- const m_EACCES = 13
- const m_EADDRINUSE = 98
- const m_EADDRNOTAVAIL = 99
- const m_EADV = 68
- const m_EAFNOSUPPORT = 97
- const m_EAGAIN = 11
- const m_EALREADY = 114
- const m_EBADE = 52
- const m_EBADF = 9
- const m_EBADFD = 77
- const m_EBADMSG = 74
- const m_EBADR = 53
- const m_EBADRQC = 56
- const m_EBADSLT = 57
- const m_EBFONT = 59
- const m_EBUSY = 16
- const m_ECANCELED = 125
- const m_ECHILD = 10
- const m_ECHRNG = 44
- const m_ECOMM = 70
- const m_ECONNABORTED = 103
- const m_ECONNREFUSED = 111
- const m_ECONNRESET = 104
- const m_EDEADLK = 35
- const m_EDEADLOCK = "EDEADLK"
- const m_EDESTADDRREQ = 89
- const m_EDOM = 33
- const m_EDOTDOT = 73
- const m_EDQUOT = 122
- const m_EEXIST = 17
- const m_EFAULT = 14
- const m_EFBIG = 27
- const m_EHOSTDOWN = 112
- const m_EHOSTUNREACH = 113
- const m_EHWPOISON = 133
- const m_EIDRM = 43
- const m_EILSEQ = 84
- const m_EINPROGRESS = 115
- const m_EINTR = 4
- const m_EINVAL = 22
- const m_EIO = 5
- const m_EISCONN = 106
- const m_EISDIR = 21
- const m_EISNAM = 120
- const m_EKEYEXPIRED = 127
- const m_EKEYREJECTED = 129
- const m_EKEYREVOKED = 128
- const m_EL2HLT = 51
- const m_EL2NSYNC = 45
- const m_EL3HLT = 46
- const m_EL3RST = 47
- const m_ELIBACC = 79
- const m_ELIBBAD = 80
- const m_ELIBEXEC = 83
- const m_ELIBMAX = 82
- const m_ELIBSCN = 81
- const m_ELNRNG = 48
- const m_ELOOP = 40
- const m_EMEDIUMTYPE = 124
- const m_EMFILE = 24
- const m_EMLINK = 31
- const m_EMSGSIZE = 90
- const m_EMULTIHOP = 72
- const m_ENAMETOOLONG = 36
- const m_ENAVAIL = 119
- const m_ENETDOWN = 100
- const m_ENETRESET = 102
- const m_ENETUNREACH = 101
- const m_ENFILE = 23
- const m_ENOANO = 55
- const m_ENOBUFS = 105
- const m_ENOCSI = 50
- const m_ENODATA = 61
- const m_ENODEV = 19
- const m_ENOENT = 2
- const m_ENOEXEC = 8
- const m_ENOKEY = 126
- const m_ENOLCK = 37
- const m_ENOLINK = 67
- const m_ENOMEDIUM = 123
- const m_ENOMEM = 12
- const m_ENOMSG = 42
- const m_ENONET = 64
- const m_ENOPKG = 65
- const m_ENOPROTOOPT = 92
- const m_ENOSPC = 28
- const m_ENOSR = 63
- const m_ENOSTR = 60
- const m_ENOSYS = 38
- const m_ENOTBLK = 15
- const m_ENOTCONN = 107
- const m_ENOTDIR = 20
- const m_ENOTEMPTY = 39
- const m_ENOTNAM = 118
- const m_ENOTRECOVERABLE = 131
- const m_ENOTSOCK = 88
- const m_ENOTSUP = "EOPNOTSUPP"
- const m_ENOTTY = 25
- const m_ENOTUNIQ = 76
- const m_ENXIO = 6
- const m_EOPNOTSUPP = 95
- const m_EOVERFLOW = 75
- const m_EOWNERDEAD = 130
- const m_EPERM = 1
- const m_EPFNOSUPPORT = 96
- const m_EPIPE = 32
- const m_EPROTO = 71
- const m_EPROTONOSUPPORT = 93
- const m_EPROTOTYPE = 91
- const m_ERANGE = 34
- const m_EREMCHG = 78
- const m_EREMOTE = 66
- const m_EREMOTEIO = 121
- const m_ERESTART = 85
- const m_ERFKILL = 132
- const m_EROFS = 30
- const m_ESHUTDOWN = 108
- const m_ESOCKTNOSUPPORT = 94
- const m_ESPIPE = 29
- const m_ESRCH = 3
- const m_ESRMNT = 69
- const m_ESTALE = 116
- const m_ESTRPIPE = 86
- const m_ETIME = 62
- const m_ETIMEDOUT = 110
- const m_ETOOMANYREFS = 109
- const m_ETXTBSY = 26
- const m_EUCLEAN = 117
- const m_EUNATCH = 49
- const m_EUSERS = 87
- const m_EWOULDBLOCK = "EAGAIN"
- const m_EXDEV = 18
- const m_EXFULL = 54
- const m_EXIT_FAILURE = 1
- const m_EXIT_SUCCESS = 0
- const m_EXPAND_SPARE = 24
- const m_EXPAT_BILLION_LAUGHS_ATTACK_PROTECTION_ACTIVATION_THRESHOLD_DEFAULT = 8388608
- const m_EXPAT_BILLION_LAUGHS_ATTACK_PROTECTION_MAXIMUM_AMPLIFICATION_DEFAULT = 100
- const m_EXPAT_CONFIG_H = 1
- const m_EXPR_NEST_MAX = 32
- const m_Expat_External_INCLUDED = 1
- const m_Expat_INCLUDED = 1
- const m_FALLOC_FL_KEEP_SIZE = 1
- const m_FALLOC_FL_PUNCH_HOLE = 2
- const m_FAPPEND = "O_APPEND"
- const m_FASYNC = "O_ASYNC"
- const m_FD_CLOEXEC = 1
- const m_FD_SETSIZE = 1024
- const m_FFSYNC = "O_SYNC"
- const m_FILENAME_MAX = 4096
- const m_FILESIZEBITS = 64
- const m_FNDELAY = "O_NDELAY"
- const m_FNONBLOCK = "O_NONBLOCK"
- const m_FOPEN_MAX = 1000
- const m_FP_ILOGB0 = "FP_ILOGBNAN"
- const m_FP_INFINITE = 1
- const m_FP_NAN = 0
- const m_FP_NORMAL = 4
- const m_FP_SUBNORMAL = 3
- const m_FP_ZERO = 2
- const m_F_ADD_SEALS = 1033
- const m_F_CANCELLK = 1029
- const m_F_DUPFD = 0
- const m_F_DUPFD_CLOEXEC = 1030
- const m_F_GETFD = 1
- const m_F_GETFL = 3
- const m_F_GETLEASE = 1025
- const m_F_GETLK = 5
- const m_F_GETOWN = 9
- const m_F_GETOWNER_UIDS = 17
- const m_F_GETOWN_EX = 16
- const m_F_GETPIPE_SZ = 1032
- const m_F_GETSIG = 11
- const m_F_GET_FILE_RW_HINT = 1037
- const m_F_GET_RW_HINT = 1035
- const m_F_GET_SEALS = 1034
- const m_F_LOCK = 1
- const m_F_NOTIFY = 1026
- const m_F_OFD_GETLK = 36
- const m_F_OFD_SETLK = 37
- const m_F_OFD_SETLKW = 38
- const m_F_OK = 0
- const m_F_OWNER_GID = 2
- const m_F_OWNER_PGRP = 2
- const m_F_OWNER_PID = 1
- const m_F_OWNER_TID = 0
- const m_F_RDLCK = 0
- const m_F_SEAL_FUTURE_WRITE = 0x0010
- const m_F_SEAL_GROW = 0x0004
- const m_F_SEAL_SEAL = 0x0001
- const m_F_SEAL_SHRINK = 0x0002
- const m_F_SEAL_WRITE = 0x0008
- const m_F_SETFD = 2
- const m_F_SETFL = 4
- const m_F_SETLEASE = 1024
- const m_F_SETLK = 6
- const m_F_SETLKW = 7
- const m_F_SETOWN = 8
- const m_F_SETOWN_EX = 15
- const m_F_SETPIPE_SZ = 1031
- const m_F_SETSIG = 10
- const m_F_SET_FILE_RW_HINT = 1038
- const m_F_SET_RW_HINT = 1036
- const m_F_TEST = 3
- const m_F_TLOCK = 2
- const m_F_ULOCK = 0
- const m_F_UNLCK = 2
- const m_F_WRLCK = 1
- const m_GRND_INSECURE = 0x0004
- const m_GRND_NONBLOCK = 0x0001
- const m_GRND_RANDOM = 0x0002
- const m_HAVE_ARC4RANDOM_BUF = 1
- const m_HAVE_CONFIG_H = 1
- const m_HAVE_DLFCN_H = 1
- const m_HAVE_FCNTL_H = 1
- const m_HAVE_GETPAGESIZE = 1
- const m_HAVE_GETRANDOM = 1
- const m_HAVE_INTTYPES_H = 1
- const m_HAVE_MMAP = 1
- const m_HAVE_STDINT_H = 1
- const m_HAVE_STDIO_H = 1
- const m_HAVE_STDLIB_H = 1
- const m_HAVE_STRINGS_H = 1
- const m_HAVE_STRING_H = 1
- const m_HAVE_SYSCALL_GETRANDOM = 1
- const m_HAVE_SYS_PARAM_H = 1
- const m_HAVE_SYS_STAT_H = 1
- const m_HAVE_SYS_TYPES_H = 1
- const m_HAVE_UNISTD_H = 1
- const m_HOST_NAME_MAX = 255
- const m_HUGE = 3.40282346638528859812e+38
- const m_HUGE_VALF = "INFINITY"
- const m_INIT_ATTS_SIZE = 16
- const m_INIT_ATTS_VERSION = 4294967295
- const m_INIT_BLOCK_SIZE = 1024
- const m_INIT_BUFFER_SIZE = 1024
- const m_INIT_DATA_BUF_SIZE = 1024
- const m_INIT_POWER = 6
- const m_INIT_SCAFFOLD_ELEMENTS = 32
- const m_INIT_TAG_BUF_SIZE = 32
- const m_INT16_MAX = 0x7fff
- const m_INT32_MAX = 0x7fffffff
- const m_INT64_MAX = 0x7fffffffffffffff
- const m_INT8_MAX = 0x7f
- const m_INTMAX_MAX = "INT64_MAX"
- const m_INTMAX_MIN = "INT64_MIN"
- const m_INTPTR_MAX = "INT64_MAX"
- const m_INTPTR_MIN = "INT64_MIN"
- const m_INT_FAST16_MAX = "INT32_MAX"
- const m_INT_FAST16_MIN = "INT32_MIN"
- const m_INT_FAST32_MAX = "INT32_MAX"
- const m_INT_FAST32_MIN = "INT32_MIN"
- const m_INT_FAST64_MAX = "INT64_MAX"
- const m_INT_FAST64_MIN = "INT64_MIN"
- const m_INT_FAST8_MAX = "INT8_MAX"
- const m_INT_FAST8_MIN = "INT8_MIN"
- const m_INT_LEAST16_MAX = "INT16_MAX"
- const m_INT_LEAST16_MIN = "INT16_MIN"
- const m_INT_LEAST32_MAX = "INT32_MAX"
- const m_INT_LEAST32_MIN = "INT32_MIN"
- const m_INT_LEAST64_MAX = "INT64_MAX"
- const m_INT_LEAST64_MIN = "INT64_MIN"
- const m_INT_LEAST8_MAX = "INT8_MAX"
- const m_INT_LEAST8_MIN = "INT8_MIN"
- const m_INT_MAX = 2147483647
- const m_IOV_MAX = 1024
- const m_ITIMER_PROF = 2
- const m_ITIMER_REAL = 0
- const m_ITIMER_VIRTUAL = 1
- const m_LINE_MAX = 4096
- const m_LITTLE_ENDIAN = "__LITTLE_ENDIAN"
- const m_LLONG_MAX = 0x7fffffffffffffff
- const m_LOGIN_NAME_MAX = 256
- const m_LONG_BIT = 64
- const m_LONG_MAX = "__LONG_MAX"
- const m_LT_OBJDIR = ".libs/"
- const m_L_INCR = 1
- const m_L_SET = 0
- const m_L_XTND = 2
- const m_L_ctermid = 20
- const m_L_cuserid = 20
- const m_L_tmpnam = 20
- const m_MATH_ERREXCEPT = 2
- const m_MATH_ERRNO = 1
- const m_MAX_HANDLE_SZ = 128
- const m_MB_LEN_MAX = 4
- const m_MQ_PRIO_MAX = 32768
- const m_M_1_PI = 0.31830988618379067154
- const m_M_2_PI = 0.63661977236758134308
- const m_M_2_SQRTPI = 1.12837916709551257390
- const m_M_E = 2.7182818284590452354
- const m_M_LN10 = 2.30258509299404568402
- const m_M_LN2 = 0.69314718055994530942
- const m_M_LOG10E = 0.43429448190325182765
- const m_M_LOG2E = 1.4426950408889634074
- const m_M_PI = 3.14159265358979323846
- const m_M_PI_2 = 1.57079632679489661923
- const m_M_PI_4 = 0.78539816339744830962
- const m_M_SQRT1_2 = 0.70710678118654752440
- const m_M_SQRT2 = 1.41421356237309504880
- const m_NAME_MAX = 255
- const m_NDEBUG = 1
- const m_NGROUPS_MAX = 32
- const m_NL_ARGMAX = 9
- const m_NL_LANGMAX = 32
- const m_NL_MSGMAX = 32767
- const m_NL_NMAX = 16
- const m_NL_SETMAX = 255
- const m_NL_TEXTMAX = 2048
- const m_NZERO = 20
- const m_O_APPEND = 02000
- const m_O_ASYNC = 020000
- const m_O_CLOEXEC = 02000000
- const m_O_CREAT = 0100
- const m_O_DIRECT = 040000
- const m_O_DIRECTORY = 0200000
- const m_O_DSYNC = 010000
- const m_O_EXCL = 0200
- const m_O_EXEC = "O_PATH"
- const m_O_LARGEFILE = 0100000
- const m_O_NDELAY = "O_NONBLOCK"
- const m_O_NOATIME = 01000000
- const m_O_NOCTTY = 0400
- const m_O_NOFOLLOW = 0400000
- const m_O_NONBLOCK = 04000
- const m_O_PATH = 010000000
- const m_O_RDONLY = 00
- const m_O_RDWR = 02
- const m_O_RSYNC = 04010000
- const m_O_SEARCH = "O_PATH"
- const m_O_SYNC = 04010000
- const m_O_TMPFILE = 020200000
- const m_O_TRUNC = 01000
- const m_O_TTY_INIT = 0
- const m_O_WRONLY = 01
- const m_PACKAGE = "expat"
- const m_PACKAGE_BUGREPORT = "expat-bugs@libexpat.org"
- const m_PACKAGE_NAME = "expat"
- const m_PACKAGE_STRING = "expat 2.5.0"
- const m_PACKAGE_TARNAME = "expat"
- const m_PACKAGE_URL = ""
- const m_PACKAGE_VERSION = "2.5.0"
- const m_PAGESIZE = 4096
- const m_PAGE_SIZE = "PAGESIZE"
- const m_PATH_MAX = 4096
- const m_PDP_ENDIAN = "__PDP_ENDIAN"
- const m_PIPE_BUF = 4096
- const m_POSIX_CLOSE_RESTART = 0
- const m_POSIX_FADV_DONTNEED = 4
- const m_POSIX_FADV_NOREUSE = 5
- const m_POSIX_FADV_NORMAL = 0
- const m_POSIX_FADV_RANDOM = 1
- const m_POSIX_FADV_SEQUENTIAL = 2
- const m_POSIX_FADV_WILLNEED = 3
- const m_PTHREAD_DESTRUCTOR_ITERATIONS = 4
- const m_PTHREAD_KEYS_MAX = 128
- const m_PTHREAD_STACK_MIN = 2048
- const m_PTRDIFF_MAX = "INT64_MAX"
- const m_PTRDIFF_MIN = "INT64_MIN"
- const m_P_tmpdir = "/tmp"
- const m_RAND_MAX = 0x7fffffff
- const m_RE_DUP_MAX = 255
- const m_RWF_WRITE_LIFE_NOT_SET = 0
- const m_RWH_WRITE_LIFE_EXTREME = 5
- const m_RWH_WRITE_LIFE_LONG = 4
- const m_RWH_WRITE_LIFE_MEDIUM = 3
- const m_RWH_WRITE_LIFE_NONE = 1
- const m_RWH_WRITE_LIFE_SHORT = 2
- const m_R_OK = 4
- const m_SCHAR_MAX = 127
- const m_SEEK_DATA = 3
- const m_SEEK_HOLE = 4
- const m_SEM_NSEMS_MAX = 256
- const m_SEM_VALUE_MAX = 0x7fffffff
- const m_SHRT_MAX = 0x7fff
- const m_SIG_ATOMIC_MAX = "INT32_MAX"
- const m_SIG_ATOMIC_MIN = "INT32_MIN"
- const m_SIP_KEYLEN = 16
- const m_SIZE_MAX = "UINT64_MAX"
- const m_SPLICE_F_GIFT = 8
- const m_SPLICE_F_MORE = 4
- const m_SPLICE_F_MOVE = 1
- const m_SPLICE_F_NONBLOCK = 2
- const m_SSIZE_MAX = "LONG_MAX"
- const m_STDC_HEADERS = 1
- const m_STDERR_FILENO = 2
- const m_STDIN_FILENO = 0
- const m_STDOUT_FILENO = 1
- const m_SYMLOOP_MAX = 40
- const m_SYNC_FILE_RANGE_WAIT_AFTER = 4
- const m_SYNC_FILE_RANGE_WAIT_BEFORE = 1
- const m_SYNC_FILE_RANGE_WRITE = 2
- const m_S_IRGRP = 0040
- const m_S_IROTH = 0004
- const m_S_IRUSR = 0400
- const m_S_IRWXG = 0070
- const m_S_IRWXO = 0007
- const m_S_IRWXU = 0700
- const m_S_ISGID = 02000
- const m_S_ISUID = 04000
- const m_S_ISVTX = 01000
- const m_S_IWGRP = 0020
- const m_S_IWOTH = 0002
- const m_S_IWUSR = 0200
- const m_S_IXGRP = 0010
- const m_S_IXOTH = 0001
- const m_S_IXUSR = 0100
- const m_TMP_MAX = 10000
- const m_TTY_NAME_MAX = 32
- const m_TZNAME_MAX = 6
- const m_UCHAR_MAX = 255
- const m_UINT16_MAX = 0xffff
- const m_UINT32_MAX = "0xffffffffu"
- const m_UINT64_MAX = "0xffffffffffffffffu"
- const m_UINT8_MAX = 0xff
- const m_UINTMAX_MAX = "UINT64_MAX"
- const m_UINTPTR_MAX = "UINT64_MAX"
- const m_UINT_FAST16_MAX = "UINT32_MAX"
- const m_UINT_FAST32_MAX = "UINT32_MAX"
- const m_UINT_FAST64_MAX = "UINT64_MAX"
- const m_UINT_FAST8_MAX = "UINT8_MAX"
- const m_UINT_LEAST16_MAX = "UINT16_MAX"
- const m_UINT_LEAST32_MAX = "UINT32_MAX"
- const m_UINT_LEAST64_MAX = "UINT64_MAX"
- const m_UINT_LEAST8_MAX = "UINT8_MAX"
- const m_UINT_MAX = 4294967295
- const m_USHRT_MAX = 0xffff
- const m_VERSION = "2.5.0"
- const m_WINT_MAX = "UINT32_MAX"
- const m_WINT_MIN = 0
- const m_WNOHANG = 1
- const m_WORD_BIT = 32
- const m_WUNTRACED = 2
- const m_W_OK = 2
- const m_XML_ATTRIBUTE_VALUE_LITERAL = 0
- const m_XML_BUILDING_EXPAT = 1
- const m_XML_CDATA_SECTION_STATE = 2
- const m_XML_CONTENT_STATE = 1
- const m_XML_CONTEXT_BYTES = 1024
- const m_XML_DEV_URANDOM = 1
- const m_XML_DTD = 1
- const m_XML_ENABLE_VISIBILITY = 0
- const m_XML_ENCODE_MAX = "XML_UTF8_ENCODE_MAX"
- const m_XML_ENTITY_VALUE_LITERAL = 1
- const m_XML_GetErrorByteIndex = "XML_GetCurrentByteIndex"
- const m_XML_GetErrorColumnNumber = "XML_GetCurrentColumnNumber"
- const m_XML_GetErrorLineNumber = "XML_GetCurrentLineNumber"
- const m_XML_IGNORE_SECTION_STATE = 3
- const m_XML_MAJOR_VERSION = 2
- const m_XML_MICRO_VERSION = 0
- const m_XML_MINOR_VERSION = 5
- const m_XML_NS = 1
- const m_XML_N_LITERAL_TYPES = 2
- const m_XML_N_STATES = 4
- const m_XML_PROLOG_STATE = 0
- const m_XML_TOK_ATTRIBUTE_VALUE_S = 39
- const m_XML_TOK_BOM = 14
- const m_XML_TOK_CDATA_SECT_CLOSE = 40
- const m_XML_TOK_CDATA_SECT_OPEN = 8
- const m_XML_TOK_CHAR_REF = 10
- const m_XML_TOK_CLOSE_BRACKET = 26
- const m_XML_TOK_CLOSE_PAREN = 24
- const m_XML_TOK_CLOSE_PAREN_ASTERISK = 36
- const m_XML_TOK_CLOSE_PAREN_PLUS = 37
- const m_XML_TOK_CLOSE_PAREN_QUESTION = 35
- const m_XML_TOK_COMMA = 38
- const m_XML_TOK_COMMENT = 13
- const m_XML_TOK_COND_SECT_CLOSE = 34
- const m_XML_TOK_COND_SECT_OPEN = 33
- const m_XML_TOK_DATA_CHARS = 6
- const m_XML_TOK_DATA_NEWLINE = 7
- const m_XML_TOK_DECL_CLOSE = 17
- const m_XML_TOK_DECL_OPEN = 16
- const m_XML_TOK_EMPTY_ELEMENT_NO_ATTS = 4
- const m_XML_TOK_EMPTY_ELEMENT_WITH_ATTS = 3
- const m_XML_TOK_END_TAG = 5
- const m_XML_TOK_ENTITY_REF = 9
- const m_XML_TOK_IGNORE_SECT = 42
- const m_XML_TOK_INSTANCE_START = 29
- const m_XML_TOK_INVALID = 0
- const m_XML_TOK_LITERAL = 27
- const m_XML_TOK_NAME = 18
- const m_XML_TOK_NAME_ASTERISK = 31
- const m_XML_TOK_NAME_PLUS = 32
- const m_XML_TOK_NAME_QUESTION = 30
- const m_XML_TOK_NMTOKEN = 19
- const m_XML_TOK_OPEN_BRACKET = 25
- const m_XML_TOK_OPEN_PAREN = 23
- const m_XML_TOK_OR = 21
- const m_XML_TOK_PARAM_ENTITY_REF = 28
- const m_XML_TOK_PERCENT = 22
- const m_XML_TOK_PI = 11
- const m_XML_TOK_POUND_NAME = 20
- const m_XML_TOK_PREFIXED_NAME = 41
- const m_XML_TOK_PROLOG_S = 15
- const m_XML_TOK_START_TAG_NO_ATTS = 2
- const m_XML_TOK_START_TAG_WITH_ATTS = 1
- const m_XML_TOK_XML_DECL = 12
- const m_XML_UTF16_ENCODE_MAX = 2
- const m_XML_UTF8_ENCODE_MAX = 4
- const m_X_OK = 1
- const m_XmlConvert = "XmlUtf8Convert"
- const m_XmlEncode = "XmlUtf8Encode"
- const m_XmlGetInternalEncoding = "XmlGetUtf8InternalEncoding"
- const m_XmlGetInternalEncodingNS = "XmlGetUtf8InternalEncodingNS"
- const m_XmlRole_INCLUDED = 1
- const m_XmlTok_INCLUDED = 1
- const m__CS_GNU_LIBC_VERSION = 2
- const m__CS_GNU_LIBPTHREAD_VERSION = 3
- const m__CS_PATH = 0
- const m__CS_POSIX_V5_WIDTH_RESTRICTED_ENVS = 4
- const m__CS_POSIX_V6_ILP32_OFF32_CFLAGS = 1116
- const m__CS_POSIX_V6_ILP32_OFF32_LDFLAGS = 1117
- const m__CS_POSIX_V6_ILP32_OFF32_LIBS = 1118
- const m__CS_POSIX_V6_ILP32_OFF32_LINTFLAGS = 1119
- const m__CS_POSIX_V6_ILP32_OFFBIG_CFLAGS = 1120
- const m__CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS = 1121
- const m__CS_POSIX_V6_ILP32_OFFBIG_LIBS = 1122
- const m__CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS = 1123
- const m__CS_POSIX_V6_LP64_OFF64_CFLAGS = 1124
- const m__CS_POSIX_V6_LP64_OFF64_LDFLAGS = 1125
- const m__CS_POSIX_V6_LP64_OFF64_LIBS = 1126
- const m__CS_POSIX_V6_LP64_OFF64_LINTFLAGS = 1127
- const m__CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS = 1128
- const m__CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS = 1129
- const m__CS_POSIX_V6_LPBIG_OFFBIG_LIBS = 1130
- const m__CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS = 1131
- const m__CS_POSIX_V6_WIDTH_RESTRICTED_ENVS = 1
- const m__CS_POSIX_V7_ILP32_OFF32_CFLAGS = 1132
- const m__CS_POSIX_V7_ILP32_OFF32_LDFLAGS = 1133
- const m__CS_POSIX_V7_ILP32_OFF32_LIBS = 1134
- const m__CS_POSIX_V7_ILP32_OFF32_LINTFLAGS = 1135
- const m__CS_POSIX_V7_ILP32_OFFBIG_CFLAGS = 1136
- const m__CS_POSIX_V7_ILP32_OFFBIG_LDFLAGS = 1137
- const m__CS_POSIX_V7_ILP32_OFFBIG_LIBS = 1138
- const m__CS_POSIX_V7_ILP32_OFFBIG_LINTFLAGS = 1139
- const m__CS_POSIX_V7_LP64_OFF64_CFLAGS = 1140
- const m__CS_POSIX_V7_LP64_OFF64_LDFLAGS = 1141
- const m__CS_POSIX_V7_LP64_OFF64_LIBS = 1142
- const m__CS_POSIX_V7_LP64_OFF64_LINTFLAGS = 1143
- const m__CS_POSIX_V7_LPBIG_OFFBIG_CFLAGS = 1144
- const m__CS_POSIX_V7_LPBIG_OFFBIG_LDFLAGS = 1145
- const m__CS_POSIX_V7_LPBIG_OFFBIG_LIBS = 1146
- const m__CS_POSIX_V7_LPBIG_OFFBIG_LINTFLAGS = 1147
- const m__CS_POSIX_V7_THREADS_CFLAGS = 1150
- const m__CS_POSIX_V7_THREADS_LDFLAGS = 1151
- const m__CS_POSIX_V7_WIDTH_RESTRICTED_ENVS = 5
- const m__CS_V6_ENV = 1148
- const m__CS_V7_ENV = 1149
- const m__GNU_SOURCE = 1
- const m__IOFBF = 0
- const m__IOLBF = 1
- const m__IONBF = 2
- const m__LP64 = 1
- const m__PC_2_SYMLINKS = 20
- const m__PC_ALLOC_SIZE_MIN = 18
- const m__PC_ASYNC_IO = 10
- const m__PC_CHOWN_RESTRICTED = 6
- const m__PC_FILESIZEBITS = 13
- const m__PC_LINK_MAX = 0
- const m__PC_MAX_CANON = 1
- const m__PC_MAX_INPUT = 2
- const m__PC_NAME_MAX = 3
- const m__PC_NO_TRUNC = 7
- const m__PC_PATH_MAX = 4
- const m__PC_PIPE_BUF = 5
- const m__PC_PRIO_IO = 11
- const m__PC_REC_INCR_XFER_SIZE = 14
- const m__PC_REC_MAX_XFER_SIZE = 15
- const m__PC_REC_MIN_XFER_SIZE = 16
- const m__PC_REC_XFER_ALIGN = 17
- const m__PC_SOCK_MAXBUF = 12
- const m__PC_SYMLINK_MAX = 19
- const m__PC_SYNC_IO = 9
- const m__PC_VDISABLE = 8
- const m__POSIX2_BC_BASE_MAX = 99
- const m__POSIX2_BC_DIM_MAX = 2048
- const m__POSIX2_BC_SCALE_MAX = 99
- const m__POSIX2_BC_STRING_MAX = 1000
- const m__POSIX2_CHARCLASS_NAME_MAX = 14
- const m__POSIX2_COLL_WEIGHTS_MAX = 2
- const m__POSIX2_C_BIND = "_POSIX_VERSION"
- const m__POSIX2_EXPR_NEST_MAX = 32
- const m__POSIX2_LINE_MAX = 2048
- const m__POSIX2_RE_DUP_MAX = 255
- const m__POSIX2_VERSION = "_POSIX_VERSION"
- const m__POSIX_ADVISORY_INFO = "_POSIX_VERSION"
- const m__POSIX_AIO_LISTIO_MAX = 2
- const m__POSIX_AIO_MAX = 1
- const m__POSIX_ARG_MAX = 4096
- const m__POSIX_ASYNCHRONOUS_IO = "_POSIX_VERSION"
- const m__POSIX_BARRIERS = "_POSIX_VERSION"
- const m__POSIX_CHILD_MAX = 25
- const m__POSIX_CHOWN_RESTRICTED = 1
- const m__POSIX_CLOCKRES_MIN = 20000000
- const m__POSIX_CLOCK_SELECTION = "_POSIX_VERSION"
- const m__POSIX_CPUTIME = "_POSIX_VERSION"
- const m__POSIX_DELAYTIMER_MAX = 32
- const m__POSIX_FSYNC = "_POSIX_VERSION"
- const m__POSIX_HOST_NAME_MAX = 255
- const m__POSIX_IPV6 = "_POSIX_VERSION"
- const m__POSIX_JOB_CONTROL = 1
- const m__POSIX_LINK_MAX = 8
- const m__POSIX_LOGIN_NAME_MAX = 9
- const m__POSIX_MAPPED_FILES = "_POSIX_VERSION"
- const m__POSIX_MAX_CANON = 255
- const m__POSIX_MAX_INPUT = 255
- const m__POSIX_MEMLOCK = "_POSIX_VERSION"
- const m__POSIX_MEMLOCK_RANGE = "_POSIX_VERSION"
- const m__POSIX_MEMORY_PROTECTION = "_POSIX_VERSION"
- const m__POSIX_MESSAGE_PASSING = "_POSIX_VERSION"
- const m__POSIX_MONOTONIC_CLOCK = "_POSIX_VERSION"
- const m__POSIX_MQ_OPEN_MAX = 8
- const m__POSIX_MQ_PRIO_MAX = 32
- const m__POSIX_NAME_MAX = 14
- const m__POSIX_NGROUPS_MAX = 8
- const m__POSIX_NO_TRUNC = 1
- const m__POSIX_OPEN_MAX = 20
- const m__POSIX_PATH_MAX = 256
- const m__POSIX_PIPE_BUF = 512
- const m__POSIX_RAW_SOCKETS = "_POSIX_VERSION"
- const m__POSIX_READER_WRITER_LOCKS = "_POSIX_VERSION"
- const m__POSIX_REALTIME_SIGNALS = "_POSIX_VERSION"
- const m__POSIX_REGEXP = 1
- const m__POSIX_RE_DUP_MAX = 255
- const m__POSIX_RTSIG_MAX = 8
- const m__POSIX_SAVED_IDS = 1
- const m__POSIX_SEMAPHORES = "_POSIX_VERSION"
- const m__POSIX_SEM_NSEMS_MAX = 256
- const m__POSIX_SEM_VALUE_MAX = 32767
- const m__POSIX_SHARED_MEMORY_OBJECTS = "_POSIX_VERSION"
- const m__POSIX_SHELL = 1
- const m__POSIX_SIGQUEUE_MAX = 32
- const m__POSIX_SPAWN = "_POSIX_VERSION"
- const m__POSIX_SPIN_LOCKS = "_POSIX_VERSION"
- const m__POSIX_SSIZE_MAX = 32767
- const m__POSIX_SS_REPL_MAX = 4
- const m__POSIX_STREAM_MAX = 8
- const m__POSIX_SYMLINK_MAX = 255
- const m__POSIX_SYMLOOP_MAX = 8
- const m__POSIX_THREADS = "_POSIX_VERSION"
- const m__POSIX_THREAD_ATTR_STACKADDR = "_POSIX_VERSION"
- const m__POSIX_THREAD_ATTR_STACKSIZE = "_POSIX_VERSION"
- const m__POSIX_THREAD_CPUTIME = "_POSIX_VERSION"
- const m__POSIX_THREAD_DESTRUCTOR_ITERATIONS = 4
- const m__POSIX_THREAD_KEYS_MAX = 128
- const m__POSIX_THREAD_PRIORITY_SCHEDULING = "_POSIX_VERSION"
- const m__POSIX_THREAD_PROCESS_SHARED = "_POSIX_VERSION"
- const m__POSIX_THREAD_SAFE_FUNCTIONS = "_POSIX_VERSION"
- const m__POSIX_THREAD_THREADS_MAX = 64
- const m__POSIX_TIMEOUTS = "_POSIX_VERSION"
- const m__POSIX_TIMERS = "_POSIX_VERSION"
- const m__POSIX_TIMER_MAX = 32
- const m__POSIX_TRACE_EVENT_NAME_MAX = 30
- const m__POSIX_TRACE_NAME_MAX = 8
- const m__POSIX_TRACE_SYS_MAX = 8
- const m__POSIX_TRACE_USER_EVENT_MAX = 32
- const m__POSIX_TTY_NAME_MAX = 9
- const m__POSIX_TZNAME_MAX = 6
- const m__POSIX_V6_LP64_OFF64 = 1
- const m__POSIX_V7_LP64_OFF64 = 1
- const m__POSIX_VDISABLE = 0
- const m__POSIX_VERSION = 200809
- const m__SC_2_CHAR_TERM = 95
- const m__SC_2_C_BIND = 47
- const m__SC_2_C_DEV = 48
- const m__SC_2_FORT_DEV = 49
- const m__SC_2_FORT_RUN = 50
- const m__SC_2_LOCALEDEF = 52
- const m__SC_2_PBS = 168
- const m__SC_2_PBS_ACCOUNTING = 169
- const m__SC_2_PBS_CHECKPOINT = 175
- const m__SC_2_PBS_LOCATE = 170
- const m__SC_2_PBS_MESSAGE = 171
- const m__SC_2_PBS_TRACK = 172
- const m__SC_2_SW_DEV = 51
- const m__SC_2_UPE = 97
- const m__SC_2_VERSION = 46
- const m__SC_ADVISORY_INFO = 132
- const m__SC_AIO_LISTIO_MAX = 23
- const m__SC_AIO_MAX = 24
- const m__SC_AIO_PRIO_DELTA_MAX = 25
- const m__SC_ARG_MAX = 0
- const m__SC_ASYNCHRONOUS_IO = 12
- const m__SC_ATEXIT_MAX = 87
- const m__SC_AVPHYS_PAGES = 86
- const m__SC_BARRIERS = 133
- const m__SC_BC_BASE_MAX = 36
- const m__SC_BC_DIM_MAX = 37
- const m__SC_BC_SCALE_MAX = 38
- const m__SC_BC_STRING_MAX = 39
- const m__SC_CHILD_MAX = 1
- const m__SC_CLK_TCK = 2
- const m__SC_CLOCK_SELECTION = 137
- const m__SC_COLL_WEIGHTS_MAX = 40
- const m__SC_CPUTIME = 138
- const m__SC_DELAYTIMER_MAX = 26
- const m__SC_EXPR_NEST_MAX = 42
- const m__SC_FSYNC = 15
- const m__SC_GETGR_R_SIZE_MAX = 69
- const m__SC_GETPW_R_SIZE_MAX = 70
- const m__SC_HOST_NAME_MAX = 180
- const m__SC_IOV_MAX = 60
- const m__SC_IPV6 = 235
- const m__SC_JOB_CONTROL = 7
- const m__SC_LINE_MAX = 43
- const m__SC_LOGIN_NAME_MAX = 71
- const m__SC_MAPPED_FILES = 16
- const m__SC_MEMLOCK = 17
- const m__SC_MEMLOCK_RANGE = 18
- const m__SC_MEMORY_PROTECTION = 19
- const m__SC_MESSAGE_PASSING = 20
- const m__SC_MINSIGSTKSZ = 249
- const m__SC_MONOTONIC_CLOCK = 149
- const m__SC_MQ_OPEN_MAX = 27
- const m__SC_MQ_PRIO_MAX = 28
- const m__SC_NGROUPS_MAX = 3
- const m__SC_NPROCESSORS_CONF = 83
- const m__SC_NPROCESSORS_ONLN = 84
- const m__SC_NZERO = 109
- const m__SC_OPEN_MAX = 4
- const m__SC_PAGESIZE = 30
- const m__SC_PAGE_SIZE = 30
- const m__SC_PASS_MAX = 88
- const m__SC_PHYS_PAGES = 85
- const m__SC_PRIORITIZED_IO = 13
- const m__SC_PRIORITY_SCHEDULING = 10
- const m__SC_RAW_SOCKETS = 236
- const m__SC_READER_WRITER_LOCKS = 153
- const m__SC_REALTIME_SIGNALS = 9
- const m__SC_REGEXP = 155
- const m__SC_RE_DUP_MAX = 44
- const m__SC_RTSIG_MAX = 31
- const m__SC_SAVED_IDS = 8
- const m__SC_SEMAPHORES = 21
- const m__SC_SEM_NSEMS_MAX = 32
- const m__SC_SEM_VALUE_MAX = 33
- const m__SC_SHARED_MEMORY_OBJECTS = 22
- const m__SC_SHELL = 157
- const m__SC_SIGQUEUE_MAX = 34
- const m__SC_SIGSTKSZ = 250
- const m__SC_SPAWN = 159
- const m__SC_SPIN_LOCKS = 154
- const m__SC_SPORADIC_SERVER = 160
- const m__SC_SS_REPL_MAX = 241
- const m__SC_STREAMS = 174
- const m__SC_STREAM_MAX = 5
- const m__SC_SYMLOOP_MAX = 173
- const m__SC_SYNCHRONIZED_IO = 14
- const m__SC_THREADS = 67
- const m__SC_THREAD_ATTR_STACKADDR = 77
- const m__SC_THREAD_ATTR_STACKSIZE = 78
- const m__SC_THREAD_CPUTIME = 139
- const m__SC_THREAD_DESTRUCTOR_ITERATIONS = 73
- const m__SC_THREAD_KEYS_MAX = 74
- const m__SC_THREAD_PRIORITY_SCHEDULING = 79
- const m__SC_THREAD_PRIO_INHERIT = 80
- const m__SC_THREAD_PRIO_PROTECT = 81
- const m__SC_THREAD_PROCESS_SHARED = 82
- const m__SC_THREAD_ROBUST_PRIO_INHERIT = 247
- const m__SC_THREAD_ROBUST_PRIO_PROTECT = 248
- const m__SC_THREAD_SAFE_FUNCTIONS = 68
- const m__SC_THREAD_SPORADIC_SERVER = 161
- const m__SC_THREAD_STACK_MIN = 75
- const m__SC_THREAD_THREADS_MAX = 76
- const m__SC_TIMEOUTS = 164
- const m__SC_TIMERS = 11
- const m__SC_TIMER_MAX = 35
- const m__SC_TRACE = 181
- const m__SC_TRACE_EVENT_FILTER = 182
- const m__SC_TRACE_EVENT_NAME_MAX = 242
- const m__SC_TRACE_INHERIT = 183
- const m__SC_TRACE_LOG = 184
- const m__SC_TRACE_NAME_MAX = 243
- const m__SC_TRACE_SYS_MAX = 244
- const m__SC_TRACE_USER_EVENT_MAX = 245
- const m__SC_TTY_NAME_MAX = 72
- const m__SC_TYPED_MEMORY_OBJECTS = 165
- const m__SC_TZNAME_MAX = 6
- const m__SC_UIO_MAXIOV = 60
- const m__SC_V6_ILP32_OFF32 = 176
- const m__SC_V6_ILP32_OFFBIG = 177
- const m__SC_V6_LP64_OFF64 = 178
- const m__SC_V6_LPBIG_OFFBIG = 179
- const m__SC_V7_ILP32_OFF32 = 237
- const m__SC_V7_ILP32_OFFBIG = 238
- const m__SC_V7_LP64_OFF64 = 239
- const m__SC_V7_LPBIG_OFFBIG = 240
- const m__SC_VERSION = 29
- const m__SC_XBS5_ILP32_OFF32 = 125
- const m__SC_XBS5_ILP32_OFFBIG = 126
- const m__SC_XBS5_LP64_OFF64 = 127
- const m__SC_XBS5_LPBIG_OFFBIG = 128
- const m__SC_XOPEN_CRYPT = 92
- const m__SC_XOPEN_ENH_I18N = 93
- const m__SC_XOPEN_LEGACY = 129
- const m__SC_XOPEN_REALTIME = 130
- const m__SC_XOPEN_REALTIME_THREADS = 131
- const m__SC_XOPEN_SHM = 94
- const m__SC_XOPEN_STREAMS = 246
- const m__SC_XOPEN_UNIX = 91
- const m__SC_XOPEN_VERSION = 89
- const m__SC_XOPEN_XCU_VERSION = 90
- const m__SC_XOPEN_XPG2 = 98
- const m__SC_XOPEN_XPG3 = 99
- const m__SC_XOPEN_XPG4 = 100
- const m__STDC_PREDEF_H = 1
- const m__XOPEN_ENH_I18N = 1
- const m__XOPEN_IOV_MAX = 16
- const m__XOPEN_NAME_MAX = 255
- const m__XOPEN_PATH_MAX = 1024
- const m__XOPEN_UNIX = 1
- const m__XOPEN_VERSION = 700
- const m___ATOMIC_ACQUIRE = 2
- const m___ATOMIC_ACQ_REL = 4
- const m___ATOMIC_CONSUME = 1
- const m___ATOMIC_HLE_ACQUIRE = 65536
- const m___ATOMIC_HLE_RELEASE = 131072
- const m___ATOMIC_RELAXED = 0
- const m___ATOMIC_RELEASE = 3
- const m___ATOMIC_SEQ_CST = 5
- const m___BIGGEST_ALIGNMENT__ = 16
- const m___BIG_ENDIAN = 4321
- const m___BYTE_ORDER = 1234
- const m___BYTE_ORDER__ = "__ORDER_LITTLE_ENDIAN__"
- const m___CCGO__ = 1
- const m___CHAR_BIT__ = 8
- const m___DBL_DECIMAL_DIG__ = 17
- const m___DBL_DIG__ = 15
- const m___DBL_HAS_DENORM__ = 1
- const m___DBL_HAS_INFINITY__ = 1
- const m___DBL_HAS_QUIET_NAN__ = 1
- const m___DBL_IS_IEC_60559__ = 2
- const m___DBL_MANT_DIG__ = 53
- const m___DBL_MAX_10_EXP__ = 308
- const m___DBL_MAX_EXP__ = 1024
- const m___DEC128_EPSILON__ = 1e-33
- const m___DEC128_MANT_DIG__ = 34
- const m___DEC128_MAX_EXP__ = 6145
- const m___DEC128_MAX__ = "9.999999999999999999999999999999999E6144"
- const m___DEC128_MIN__ = 1e-6143
- const m___DEC128_SUBNORMAL_MIN__ = 0.000000000000000000000000000000001e-6143
- const m___DEC32_EPSILON__ = 1e-6
- const m___DEC32_MANT_DIG__ = 7
- const m___DEC32_MAX_EXP__ = 97
- const m___DEC32_MAX__ = 9.999999e96
- const m___DEC32_MIN__ = 1e-95
- const m___DEC32_SUBNORMAL_MIN__ = 0.000001e-95
- const m___DEC64_EPSILON__ = 1e-15
- const m___DEC64_MANT_DIG__ = 16
- const m___DEC64_MAX_EXP__ = 385
- const m___DEC64_MAX__ = "9.999999999999999E384"
- const m___DEC64_MIN__ = 1e-383
- const m___DEC64_SUBNORMAL_MIN__ = 0.000000000000001e-383
- const m___DECIMAL_BID_FORMAT__ = 1
- const m___DECIMAL_DIG__ = 17
- const m___DEC_EVAL_METHOD__ = 2
- const m___ELF__ = 1
- const m___FINITE_MATH_ONLY__ = 0
- const m___FLOAT_WORD_ORDER__ = "__ORDER_LITTLE_ENDIAN__"
- const m___FLT128_DECIMAL_DIG__ = 36
- const m___FLT128_DENORM_MIN__ = 6.47517511943802511092443895822764655e-4966
- const m___FLT128_DIG__ = 33
- const m___FLT128_EPSILON__ = 1.92592994438723585305597794258492732e-34
- const m___FLT128_HAS_DENORM__ = 1
- const m___FLT128_HAS_INFINITY__ = 1
- const m___FLT128_HAS_QUIET_NAN__ = 1
- const m___FLT128_IS_IEC_60559__ = 2
- const m___FLT128_MANT_DIG__ = 113
- const m___FLT128_MAX_10_EXP__ = 4932
- const m___FLT128_MAX_EXP__ = 16384
- const m___FLT128_MAX__ = "1.18973149535723176508575932662800702e+4932"
- const m___FLT128_MIN__ = 3.36210314311209350626267781732175260e-4932
- const m___FLT128_NORM_MAX__ = "1.18973149535723176508575932662800702e+4932"
- const m___FLT16_DECIMAL_DIG__ = 5
- const m___FLT16_DENORM_MIN__ = 5.96046447753906250000000000000000000e-8
- const m___FLT16_DIG__ = 3
- const m___FLT16_EPSILON__ = 9.76562500000000000000000000000000000e-4
- const m___FLT16_HAS_DENORM__ = 1
- const m___FLT16_HAS_INFINITY__ = 1
- const m___FLT16_HAS_QUIET_NAN__ = 1
- const m___FLT16_IS_IEC_60559__ = 2
- const m___FLT16_MANT_DIG__ = 11
- const m___FLT16_MAX_10_EXP__ = 4
- const m___FLT16_MAX_EXP__ = 16
- const m___FLT16_MAX__ = 6.55040000000000000000000000000000000e+4
- const m___FLT16_MIN__ = 6.10351562500000000000000000000000000e-5
- const m___FLT16_NORM_MAX__ = 6.55040000000000000000000000000000000e+4
- const m___FLT32X_DECIMAL_DIG__ = 17
- const m___FLT32X_DENORM_MIN__ = 4.94065645841246544176568792868221372e-324
- const m___FLT32X_DIG__ = 15
- const m___FLT32X_EPSILON__ = 2.22044604925031308084726333618164062e-16
- const m___FLT32X_HAS_DENORM__ = 1
- const m___FLT32X_HAS_INFINITY__ = 1
- const m___FLT32X_HAS_QUIET_NAN__ = 1
- const m___FLT32X_IS_IEC_60559__ = 2
- const m___FLT32X_MANT_DIG__ = 53
- const m___FLT32X_MAX_10_EXP__ = 308
- const m___FLT32X_MAX_EXP__ = 1024
- const m___FLT32X_MAX__ = 1.79769313486231570814527423731704357e+308
- const m___FLT32X_MIN__ = 2.22507385850720138309023271733240406e-308
- const m___FLT32X_NORM_MAX__ = 1.79769313486231570814527423731704357e+308
- const m___FLT32_DECIMAL_DIG__ = 9
- const m___FLT32_DENORM_MIN__ = 1.40129846432481707092372958328991613e-45
- const m___FLT32_DIG__ = 6
- const m___FLT32_EPSILON__ = 1.19209289550781250000000000000000000e-7
- const m___FLT32_HAS_DENORM__ = 1
- const m___FLT32_HAS_INFINITY__ = 1
- const m___FLT32_HAS_QUIET_NAN__ = 1
- const m___FLT32_IS_IEC_60559__ = 2
- const m___FLT32_MANT_DIG__ = 24
- const m___FLT32_MAX_10_EXP__ = 38
- const m___FLT32_MAX_EXP__ = 128
- const m___FLT32_MAX__ = 3.40282346638528859811704183484516925e+38
- const m___FLT32_MIN__ = 1.17549435082228750796873653722224568e-38
- const m___FLT32_NORM_MAX__ = 3.40282346638528859811704183484516925e+38
- const m___FLT64X_DECIMAL_DIG__ = 36
- const m___FLT64X_DENORM_MIN__ = 6.47517511943802511092443895822764655e-4966
- const m___FLT64X_DIG__ = 33
- const m___FLT64X_EPSILON__ = 1.92592994438723585305597794258492732e-34
- const m___FLT64X_HAS_DENORM__ = 1
- const m___FLT64X_HAS_INFINITY__ = 1
- const m___FLT64X_HAS_QUIET_NAN__ = 1
- const m___FLT64X_IS_IEC_60559__ = 2
- const m___FLT64X_MANT_DIG__ = 113
- const m___FLT64X_MAX_10_EXP__ = 4932
- const m___FLT64X_MAX_EXP__ = 16384
- const m___FLT64X_MAX__ = "1.18973149535723176508575932662800702e+4932"
- const m___FLT64X_MIN__ = 3.36210314311209350626267781732175260e-4932
- const m___FLT64X_NORM_MAX__ = "1.18973149535723176508575932662800702e+4932"
- const m___FLT64_DECIMAL_DIG__ = 17
- const m___FLT64_DENORM_MIN__ = 4.94065645841246544176568792868221372e-324
- const m___FLT64_DIG__ = 15
- const m___FLT64_EPSILON__ = 2.22044604925031308084726333618164062e-16
- const m___FLT64_HAS_DENORM__ = 1
- const m___FLT64_HAS_INFINITY__ = 1
- const m___FLT64_HAS_QUIET_NAN__ = 1
- const m___FLT64_IS_IEC_60559__ = 2
- const m___FLT64_MANT_DIG__ = 53
- const m___FLT64_MAX_10_EXP__ = 308
- const m___FLT64_MAX_EXP__ = 1024
- const m___FLT64_MAX__ = 1.79769313486231570814527423731704357e+308
- const m___FLT64_MIN__ = 2.22507385850720138309023271733240406e-308
- const m___FLT64_NORM_MAX__ = 1.79769313486231570814527423731704357e+308
- const m___FLT_DECIMAL_DIG__ = 9
- const m___FLT_DENORM_MIN__ = 1.40129846432481707092372958328991613e-45
- const m___FLT_DIG__ = 6
- const m___FLT_EPSILON__ = 1.19209289550781250000000000000000000e-7
- const m___FLT_EVAL_METHOD_TS_18661_3__ = 0
- const m___FLT_EVAL_METHOD__ = 0
- const m___FLT_HAS_DENORM__ = 1
- const m___FLT_HAS_INFINITY__ = 1
- const m___FLT_HAS_QUIET_NAN__ = 1
- const m___FLT_IS_IEC_60559__ = 2
- const m___FLT_MANT_DIG__ = 24
- const m___FLT_MAX_10_EXP__ = 38
- const m___FLT_MAX_EXP__ = 128
- const m___FLT_MAX__ = 3.40282346638528859811704183484516925e+38
- const m___FLT_MIN__ = 1.17549435082228750796873653722224568e-38
- const m___FLT_NORM_MAX__ = 3.40282346638528859811704183484516925e+38
- const m___FLT_RADIX__ = 2
- const m___FUNCTION__ = "__func__"
- const m___FXSR__ = 1
- const m___GCC_ASM_FLAG_OUTPUTS__ = 1
- const m___GCC_ATOMIC_BOOL_LOCK_FREE = 2
- const m___GCC_ATOMIC_CHAR16_T_LOCK_FREE = 2
- const m___GCC_ATOMIC_CHAR32_T_LOCK_FREE = 2
- const m___GCC_ATOMIC_CHAR_LOCK_FREE = 2
- const m___GCC_ATOMIC_INT_LOCK_FREE = 2
- const m___GCC_ATOMIC_LLONG_LOCK_FREE = 2
- const m___GCC_ATOMIC_LONG_LOCK_FREE = 2
- const m___GCC_ATOMIC_POINTER_LOCK_FREE = 2
- const m___GCC_ATOMIC_SHORT_LOCK_FREE = 2
- const m___GCC_ATOMIC_TEST_AND_SET_TRUEVAL = 1
- const m___GCC_ATOMIC_WCHAR_T_LOCK_FREE = 2
- const m___GCC_CONSTRUCTIVE_SIZE = 64
- const m___GCC_DESTRUCTIVE_SIZE = 64
- const m___GCC_HAVE_DWARF2_CFI_ASM = 1
- const m___GCC_HAVE_SYNC_COMPARE_AND_SWAP_1 = 1
- const m___GCC_HAVE_SYNC_COMPARE_AND_SWAP_2 = 1
- const m___GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 = 1
- const m___GCC_HAVE_SYNC_COMPARE_AND_SWAP_8 = 1
- const m___GCC_IEC_559 = 2
- const m___GCC_IEC_559_COMPLEX = 2
- const m___GNUC_EXECUTION_CHARSET_NAME = "UTF-8"
- const m___GNUC_MINOR__ = 2
- const m___GNUC_PATCHLEVEL__ = 0
- const m___GNUC_STDC_INLINE__ = 1
- const m___GNUC_WIDE_EXECUTION_CHARSET_NAME = "UTF-32LE"
- const m___GNUC__ = 12
- const m___GXX_ABI_VERSION = 1017
- const m___HAVE_SPECULATION_SAFE_VALUE = 1
- const m___INT16_MAX__ = 0x7fff
- const m___INT32_MAX__ = 0x7fffffff
- const m___INT32_TYPE__ = "int"
- const m___INT64_MAX__ = 0x7fffffffffffffff
- const m___INT8_MAX__ = 0x7f
- const m___INTMAX_MAX__ = 0x7fffffffffffffff
- const m___INTMAX_WIDTH__ = 64
- const m___INTPTR_MAX__ = 0x7fffffffffffffff
- const m___INTPTR_WIDTH__ = 64
- const m___INT_FAST16_MAX__ = 0x7fffffffffffffff
- const m___INT_FAST16_WIDTH__ = 64
- const m___INT_FAST32_MAX__ = 0x7fffffffffffffff
- const m___INT_FAST32_WIDTH__ = 64
- const m___INT_FAST64_MAX__ = 0x7fffffffffffffff
- const m___INT_FAST64_WIDTH__ = 64
- const m___INT_FAST8_MAX__ = 0x7f
- const m___INT_FAST8_WIDTH__ = 8
- const m___INT_LEAST16_MAX__ = 0x7fff
- const m___INT_LEAST16_WIDTH__ = 16
- const m___INT_LEAST32_MAX__ = 0x7fffffff
- const m___INT_LEAST32_TYPE__ = "int"
- const m___INT_LEAST32_WIDTH__ = 32
- const m___INT_LEAST64_MAX__ = 0x7fffffffffffffff
- const m___INT_LEAST64_WIDTH__ = 64
- const m___INT_LEAST8_MAX__ = 0x7f
- const m___INT_LEAST8_WIDTH__ = 8
- const m___INT_MAX__ = 0x7fffffff
- const m___INT_WIDTH__ = 32
- const m___LDBL_DECIMAL_DIG__ = 17
- const m___LDBL_DENORM_MIN__ = 4.94065645841246544176568792868221372e-324
- const m___LDBL_DIG__ = 15
- const m___LDBL_EPSILON__ = 2.22044604925031308084726333618164062e-16
- const m___LDBL_HAS_DENORM__ = 1
- const m___LDBL_HAS_INFINITY__ = 1
- const m___LDBL_HAS_QUIET_NAN__ = 1
- const m___LDBL_IS_IEC_60559__ = 2
- const m___LDBL_MANT_DIG__ = 53
- const m___LDBL_MAX_10_EXP__ = 308
- const m___LDBL_MAX_EXP__ = 1024
- const m___LDBL_MAX__ = 1.79769313486231570814527423731704357e+308
- const m___LDBL_MIN__ = 2.22507385850720138309023271733240406e-308
- const m___LDBL_NORM_MAX__ = 1.79769313486231570814527423731704357e+308
- const m___LITTLE_ENDIAN = 1234
- const m___LONG_DOUBLE_64__ = 1
- const m___LONG_LONG_MAX__ = 0x7fffffffffffffff
- const m___LONG_LONG_WIDTH__ = 64
- const m___LONG_MAX = 0x7fffffffffffffff
- const m___LONG_MAX__ = 0x7fffffffffffffff
- const m___LONG_WIDTH__ = 64
- const m___LP64__ = 1
- const m___MMX_WITH_SSE__ = 1
- const m___MMX__ = 1
- const m___NO_INLINE__ = 1
- const m___ORDER_BIG_ENDIAN__ = 4321
- const m___ORDER_LITTLE_ENDIAN__ = 1234
- const m___ORDER_PDP_ENDIAN__ = 3412
- const m___PDP_ENDIAN = 3412
- const m___PIC__ = 2
- const m___PIE__ = 2
- const m___PRAGMA_REDEFINE_EXTNAME = 1
- const m___PRETTY_FUNCTION__ = "__func__"
- const m___PTRDIFF_MAX__ = 0x7fffffffffffffff
- const m___PTRDIFF_WIDTH__ = 64
- const m___SCHAR_MAX__ = 0x7f
- const m___SCHAR_WIDTH__ = 8
- const m___SEG_FS = 1
- const m___SEG_GS = 1
- const m___SHRT_MAX__ = 0x7fff
- const m___SHRT_WIDTH__ = 16
- const m___SIG_ATOMIC_MAX__ = 0x7fffffff
- const m___SIG_ATOMIC_TYPE__ = "int"
- const m___SIG_ATOMIC_WIDTH__ = 32
- const m___SIZEOF_DOUBLE__ = 8
- const m___SIZEOF_FLOAT128__ = 16
- const m___SIZEOF_FLOAT80__ = 16
- const m___SIZEOF_FLOAT__ = 4
- const m___SIZEOF_INT128__ = 16
- const m___SIZEOF_INT__ = 4
- const m___SIZEOF_LONG_DOUBLE__ = 8
- const m___SIZEOF_LONG_LONG__ = 8
- const m___SIZEOF_LONG__ = 8
- const m___SIZEOF_POINTER__ = 8
- const m___SIZEOF_PTRDIFF_T__ = 8
- const m___SIZEOF_SHORT__ = 2
- const m___SIZEOF_SIZE_T__ = 8
- const m___SIZEOF_WCHAR_T__ = 4
- const m___SIZEOF_WINT_T__ = 4
- const m___SIZE_MAX__ = 0xffffffffffffffff
- const m___SIZE_WIDTH__ = 64
- const m___SSE2_MATH__ = 1
- const m___SSE2__ = 1
- const m___SSE_MATH__ = 1
- const m___SSE__ = 1
- const m___STDC_HOSTED__ = 1
- const m___STDC_IEC_559_COMPLEX__ = 1
- const m___STDC_IEC_559__ = 1
- const m___STDC_IEC_60559_BFP__ = 201404
- const m___STDC_IEC_60559_COMPLEX__ = 201404
- const m___STDC_ISO_10646__ = 201706
- const m___STDC_UTF_16__ = 1
- const m___STDC_UTF_32__ = 1
- const m___STDC_VERSION__ = 201710
- const m___STDC__ = 1
- const m___UINT16_MAX__ = 0xffff
- const m___UINT32_MAX__ = 0xffffffff
- const m___UINT64_MAX__ = 0xffffffffffffffff
- const m___UINT8_MAX__ = 0xff
- const m___UINTMAX_MAX__ = 0xffffffffffffffff
- const m___UINTPTR_MAX__ = 0xffffffffffffffff
- const m___UINT_FAST16_MAX__ = 0xffffffffffffffff
- const m___UINT_FAST32_MAX__ = 0xffffffffffffffff
- const m___UINT_FAST64_MAX__ = 0xffffffffffffffff
- const m___UINT_FAST8_MAX__ = 0xff
- const m___UINT_LEAST16_MAX__ = 0xffff
- const m___UINT_LEAST32_MAX__ = 0xffffffff
- const m___UINT_LEAST64_MAX__ = 0xffffffffffffffff
- const m___UINT_LEAST8_MAX__ = 0xff
- const m___USE_TIME_BITS64 = 1
- const m___VERSION__ = "12.2.0"
- const m___WCHAR_MAX__ = 0x7fffffff
- const m___WCHAR_TYPE__ = "int"
- const m___WCHAR_WIDTH__ = 32
- const m___WINT_MAX__ = 0xffffffff
- const m___WINT_MIN__ = 0
- const m___WINT_WIDTH__ = 32
- const m___amd64 = 1
- const m___amd64__ = 1
- const m___code_model_small__ = 1
- const m___gnu_linux__ = 1
- const m___inline = "inline"
- const m___k8 = 1
- const m___k8__ = 1
- const m___linux = 1
- const m___linux__ = 1
- const m___pic__ = 2
- const m___pie__ = 2
- const m___restrict = "restrict"
- const m___restrict_arr = "restrict"
- const m___unix = 1
- const m___unix__ = 1
- const m___x86_64 = 1
- const m___x86_64__ = 1
- const m_alloca = "__builtin_alloca"
- const m_inline = "__inline"
- const m_linux = 1
- const m_loff_t = "off_t"
- const m_math_errhandling = 2
- const m_static_assert = "_Static_assert"
- const m_unix = 1
- type t__builtin_va_list = uintptr
- type t__predefined_size_t = uint64
- type t__predefined_wchar_t = int32
- type t__predefined_ptrdiff_t = int64
- type Twchar_t = int32
- type Tmax_align_t = struct {
- F__ll int64
- F__ld float64
- }
- type Tsize_t = uint64
- type Tptrdiff_t = int64
- type Tlocale_t = uintptr
- type Tssize_t = int64
- type Toff_t = int64
- type Tva_list = uintptr
- type t__isoc_va_list = uintptr
- type Tfpos_t = struct {
- F__lldata [0]int64
- F__align [0]float64
- F__opaque [16]int8
- }
- type T_G_fpos64_t = Tfpos_t
- type Tcookie_io_functions_t = struct {
- Fread uintptr
- Fwrite uintptr
- Fseek uintptr
- Fclose1 uintptr
- }
- type T_IO_cookie_io_functions_t = Tcookie_io_functions_t
- type Tdiv_t = struct {
- Fquot int32
- Frem int32
- }
- type Tldiv_t = struct {
- Fquot int64
- Frem int64
- }
- type Tlldiv_t = struct {
- Fquot int64
- Frem int64
- }
- type Tuintptr_t = uint64
- type Tintptr_t = int64
- type Tint8_t = int8
- type Tint16_t = int16
- type Tint32_t = int32
- type Tint64_t = int64
- type Tintmax_t = int64
- type Tuint8_t = uint8
- type Tuint16_t = uint16
- type Tuint32_t = uint32
- type Tuint64_t = uint64
- type Tuintmax_t = uint64
- type Tint_fast8_t = int8
- type Tint_fast64_t = int64
- type Tint_least8_t = int8
- type Tint_least16_t = int16
- type Tint_least32_t = int32
- type Tint_least64_t = int64
- type Tuint_fast8_t = uint8
- type Tuint_fast64_t = uint64
- type Tuint_least8_t = uint8
- type Tuint_least16_t = uint16
- type Tuint_least32_t = uint32
- type Tuint_least64_t = uint64
- type Tint_fast16_t = int32
- type Tint_fast32_t = int32
- type Tuint_fast16_t = uint32
- type Tuint_fast32_t = uint32
- type Tfloat_t = float32
- type Tdouble_t = float64
- type Ttime_t = int64
- type Tsuseconds_t = int64
- type Ttimeval = struct {
- Ftv_sec Ttime_t
- Ftv_usec Tsuseconds_t
- }
- type Ttimespec = struct {
- Ftv_sec Ttime_t
- Ftv_nsec int64
- }
- type Tsigset_t = struct {
- F__bits [16]uint64
- }
- type t__sigset_t = Tsigset_t
- type Tfd_mask = uint64
- type Tfd_set = struct {
- Ffds_bits [16]uint64
- }
- type Titimerval = struct {
- Fit_interval Ttimeval
- Fit_value Ttimeval
- }
- type Ttimezone = struct {
- Ftz_minuteswest int32
- Ftz_dsttime int32
- }
- type Tregister_t = int64
- type Tu_int64_t = uint64
- type Tmode_t = uint32
- type Tnlink_t = uint64
- type Tino_t = uint64
- type Tdev_t = uint64
- type Tblksize_t = int64
- type Tblkcnt_t = int64
- type Tfsblkcnt_t = uint64
- type Tfsfilcnt_t = uint64
- type Ttimer_t = uintptr
- type Tclockid_t = int32
- type Tclock_t = int64
- type Tpid_t = int32
- type Tid_t = uint32
- type Tuid_t = uint32
- type Tgid_t = uint32
- type Tkey_t = int32
- type Tuseconds_t = uint32
- type Tpthread_t = uintptr
- type Tpthread_once_t = int32
- type Tpthread_key_t = uint32
- type Tpthread_spinlock_t = int32
- type Tpthread_mutexattr_t = struct {
- F__attr uint32
- }
- type Tpthread_condattr_t = struct {
- F__attr uint32
- }
- type Tpthread_barrierattr_t = struct {
- F__attr uint32
- }
- type Tpthread_rwlockattr_t = struct {
- F__attr [2]uint32
- }
- type Tpthread_attr_t = struct {
- F__u struct {
- F__vi [0][14]int32
- F__s [0][7]uint64
- F__i [14]int32
- }
- }
- type Tpthread_mutex_t = struct {
- F__u struct {
- F__vi [0][10]int32
- F__p [0][5]uintptr
- F__i [10]int32
- }
- }
- type Tpthread_cond_t = struct {
- F__u struct {
- F__vi [0][12]int32
- F__p [0][6]uintptr
- F__i [12]int32
- }
- }
- type Tpthread_rwlock_t = struct {
- F__u struct {
- F__vi [0][14]int32
- F__p [0][7]uintptr
- F__i [14]int32
- }
- }
- type Tpthread_barrier_t = struct {
- F__u struct {
- F__vi [0][8]int32
- F__p [0][4]uintptr
- F__i [8]int32
- }
- }
- type Tu_int8_t = uint8
- type Tu_int16_t = uint16
- type Tu_int32_t = uint32
- type Tcaddr_t = uintptr
- type Tu_char = uint8
- type Tu_short = uint16
- type Tushort = uint16
- type Tu_int = uint32
- type Tuint = uint32
- type Tu_long = uint64
- type Tulong = uint64
- type Tquad_t = int64
- type Tu_quad_t = uint64
- type Tiovec = struct {
- Fiov_base uintptr
- Fiov_len Tsize_t
- }
- type Tflock = struct {
- Fl_type int16
- Fl_whence int16
- Fl_start Toff_t
- Fl_len Toff_t
- Fl_pid Tpid_t
- }
- type Tfile_handle = struct {
- Fhandle_bytes uint32
- Fhandle_type int32
- }
- type Tf_owner_ex = struct {
- Ftype1 int32
- Fpid Tpid_t
- }
- type TXML_Char = int8
- type TXML_LChar = int8
- type TXML_Index = int64
- type TXML_Size = uint64
- type TXML_ParserStruct = struct {
- Fm_userData uintptr
- Fm_handlerArg uintptr
- Fm_buffer uintptr
- Fm_mem TXML_Memory_Handling_Suite
- Fm_bufferPtr uintptr
- Fm_bufferEnd uintptr
- Fm_bufferLim uintptr
- Fm_parseEndByteIndex TXML_Index
- Fm_parseEndPtr uintptr
- Fm_dataBuf uintptr
- Fm_dataBufEnd uintptr
- Fm_startElementHandler TXML_StartElementHandler
- Fm_endElementHandler TXML_EndElementHandler
- Fm_characterDataHandler TXML_CharacterDataHandler
- Fm_processingInstructionHandler TXML_ProcessingInstructionHandler
- Fm_commentHandler TXML_CommentHandler
- Fm_startCdataSectionHandler TXML_StartCdataSectionHandler
- Fm_endCdataSectionHandler TXML_EndCdataSectionHandler
- Fm_defaultHandler TXML_DefaultHandler
- Fm_startDoctypeDeclHandler TXML_StartDoctypeDeclHandler
- Fm_endDoctypeDeclHandler TXML_EndDoctypeDeclHandler
- Fm_unparsedEntityDeclHandler TXML_UnparsedEntityDeclHandler
- Fm_notationDeclHandler TXML_NotationDeclHandler
- Fm_startNamespaceDeclHandler TXML_StartNamespaceDeclHandler
- Fm_endNamespaceDeclHandler TXML_EndNamespaceDeclHandler
- Fm_notStandaloneHandler TXML_NotStandaloneHandler
- Fm_externalEntityRefHandler TXML_ExternalEntityRefHandler
- Fm_externalEntityRefHandlerArg TXML_Parser
- Fm_skippedEntityHandler TXML_SkippedEntityHandler
- Fm_unknownEncodingHandler TXML_UnknownEncodingHandler
- Fm_elementDeclHandler TXML_ElementDeclHandler
- Fm_attlistDeclHandler TXML_AttlistDeclHandler
- Fm_entityDeclHandler TXML_EntityDeclHandler
- Fm_xmlDeclHandler TXML_XmlDeclHandler
- Fm_encoding uintptr
- Fm_initEncoding TINIT_ENCODING
- Fm_internalEncoding uintptr
- Fm_protocolEncodingName uintptr
- Fm_ns TXML_Bool
- Fm_ns_triplets TXML_Bool
- Fm_unknownEncodingMem uintptr
- Fm_unknownEncodingData uintptr
- Fm_unknownEncodingHandlerData uintptr
- Fm_unknownEncodingRelease uintptr
- Fm_prologState TPROLOG_STATE
- Fm_processor uintptr
- Fm_errorCode _XML_Error
- Fm_eventPtr uintptr
- Fm_eventEndPtr uintptr
- Fm_positionPtr uintptr
- Fm_openInternalEntities uintptr
- Fm_freeInternalEntities uintptr
- Fm_defaultExpandInternalEntities TXML_Bool
- Fm_tagLevel int32
- Fm_declEntity uintptr
- Fm_doctypeName uintptr
- Fm_doctypeSysid uintptr
- Fm_doctypePubid uintptr
- Fm_declAttributeType uintptr
- Fm_declNotationName uintptr
- Fm_declNotationPublicId uintptr
- Fm_declElementType uintptr
- Fm_declAttributeId uintptr
- Fm_declAttributeIsCdata TXML_Bool
- Fm_declAttributeIsId TXML_Bool
- Fm_dtd uintptr
- Fm_curBase uintptr
- Fm_tagStack uintptr
- Fm_freeTagList uintptr
- Fm_inheritedBindings uintptr
- Fm_freeBindingList uintptr
- Fm_attsSize int32
- Fm_nSpecifiedAtts int32
- Fm_idAttIndex int32
- Fm_atts uintptr
- Fm_nsAtts uintptr
- Fm_nsAttsVersion uint64
- Fm_nsAttsPower uint8
- Fm_position TPOSITION
- Fm_tempPool TSTRING_POOL
- Fm_temp2Pool TSTRING_POOL
- Fm_groupConnector uintptr
- Fm_groupSize uint32
- Fm_namespaceSeparator TXML_Char
- Fm_parentParser TXML_Parser
- Fm_parsingStatus TXML_ParsingStatus
- Fm_isParamEntity TXML_Bool
- Fm_useForeignDTD TXML_Bool
- Fm_paramEntityParsing _XML_ParamEntityParsing
- Fm_hash_secret_salt uint64
- Fm_accounting TACCOUNTING
- Fm_entity_stats TENTITY_STATS
- }
- type _XML_Error = int32
- const _XML_ERROR_NONE = 0
- const _XML_ERROR_NO_MEMORY = 1
- const _XML_ERROR_SYNTAX = 2
- const _XML_ERROR_NO_ELEMENTS = 3
- const _XML_ERROR_INVALID_TOKEN = 4
- const _XML_ERROR_UNCLOSED_TOKEN = 5
- const _XML_ERROR_PARTIAL_CHAR = 6
- const _XML_ERROR_TAG_MISMATCH = 7
- const _XML_ERROR_DUPLICATE_ATTRIBUTE = 8
- const _XML_ERROR_JUNK_AFTER_DOC_ELEMENT = 9
- const _XML_ERROR_PARAM_ENTITY_REF = 10
- const _XML_ERROR_UNDEFINED_ENTITY = 11
- const _XML_ERROR_RECURSIVE_ENTITY_REF = 12
- const _XML_ERROR_ASYNC_ENTITY = 13
- const _XML_ERROR_BAD_CHAR_REF = 14
- const _XML_ERROR_BINARY_ENTITY_REF = 15
- const _XML_ERROR_ATTRIBUTE_EXTERNAL_ENTITY_REF = 16
- const _XML_ERROR_MISPLACED_XML_PI = 17
- const _XML_ERROR_UNKNOWN_ENCODING = 18
- const _XML_ERROR_INCORRECT_ENCODING = 19
- const _XML_ERROR_UNCLOSED_CDATA_SECTION = 20
- const _XML_ERROR_EXTERNAL_ENTITY_HANDLING = 21
- const _XML_ERROR_NOT_STANDALONE = 22
- const _XML_ERROR_UNEXPECTED_STATE = 23
- const _XML_ERROR_ENTITY_DECLARED_IN_PE = 24
- const _XML_ERROR_FEATURE_REQUIRES_XML_DTD = 25
- const _XML_ERROR_CANT_CHANGE_FEATURE_ONCE_PARSING = 26
- const _XML_ERROR_UNBOUND_PREFIX = 27
- const _XML_ERROR_UNDECLARING_PREFIX = 28
- const _XML_ERROR_INCOMPLETE_PE = 29
- const _XML_ERROR_XML_DECL = 30
- const _XML_ERROR_TEXT_DECL = 31
- const _XML_ERROR_PUBLICID = 32
- const _XML_ERROR_SUSPENDED = 33
- const _XML_ERROR_NOT_SUSPENDED = 34
- const _XML_ERROR_ABORTED = 35
- const _XML_ERROR_FINISHED = 36
- const _XML_ERROR_SUSPEND_PE = 37
- const _XML_ERROR_RESERVED_PREFIX_XML = 38
- const _XML_ERROR_RESERVED_PREFIX_XMLNS = 39
- const _XML_ERROR_RESERVED_NAMESPACE_URI = 40
- const _XML_ERROR_INVALID_ARGUMENT = 41
- const _XML_ERROR_NO_BUFFER = 42
- const _XML_ERROR_AMPLIFICATION_LIMIT_BREACH = 43
- type _XML_ParamEntityParsing = int32
- const _XML_PARAM_ENTITY_PARSING_NEVER = 0
- const _XML_PARAM_ENTITY_PARSING_UNLESS_STANDALONE = 1
- const _XML_PARAM_ENTITY_PARSING_ALWAYS = 2
- type TXML_Parser = uintptr
- type TXML_Bool = uint8
- type _XML_Status = int32
- const _XML_STATUS_ERROR = 0
- const _XML_STATUS_OK = 1
- const _XML_STATUS_SUSPENDED = 2
- type _XML_Content_Type = int32
- const _XML_CTYPE_EMPTY = 1
- const _XML_CTYPE_ANY = 2
- const _XML_CTYPE_MIXED = 3
- const _XML_CTYPE_NAME = 4
- const _XML_CTYPE_CHOICE = 5
- const _XML_CTYPE_SEQ = 6
- type _XML_Content_Quant = int32
- const _XML_CQUANT_NONE = 0
- const _XML_CQUANT_OPT = 1
- const _XML_CQUANT_REP = 2
- const _XML_CQUANT_PLUS = 3
- type TXML_Content = struct {
- Ftype1 _XML_Content_Type
- Fquant _XML_Content_Quant
- Fname uintptr
- Fnumchildren uint32
- Fchildren uintptr
- }
- type TXML_cp = TXML_Content
- type TXML_ElementDeclHandler = uintptr
- type TXML_AttlistDeclHandler = uintptr
- type TXML_XmlDeclHandler = uintptr
- type TXML_Memory_Handling_Suite = struct {
- Fmalloc_fcn uintptr
- Frealloc_fcn uintptr
- Ffree_fcn uintptr
- }
- type TXML_StartElementHandler = uintptr
- type TXML_EndElementHandler = uintptr
- type TXML_CharacterDataHandler = uintptr
- type TXML_ProcessingInstructionHandler = uintptr
- type TXML_CommentHandler = uintptr
- type TXML_StartCdataSectionHandler = uintptr
- type TXML_EndCdataSectionHandler = uintptr
- type TXML_DefaultHandler = uintptr
- type TXML_StartDoctypeDeclHandler = uintptr
- type TXML_EndDoctypeDeclHandler = uintptr
- type TXML_EntityDeclHandler = uintptr
- type TXML_UnparsedEntityDeclHandler = uintptr
- type TXML_NotationDeclHandler = uintptr
- type TXML_StartNamespaceDeclHandler = uintptr
- type TXML_EndNamespaceDeclHandler = uintptr
- type TXML_NotStandaloneHandler = uintptr
- type TXML_ExternalEntityRefHandler = uintptr
- type TXML_SkippedEntityHandler = uintptr
- type TXML_Encoding = struct {
- Fmap1 [256]int32
- Fdata uintptr
- Fconvert uintptr
- Frelease uintptr
- }
- type TXML_UnknownEncodingHandler = uintptr
- type _XML_Parsing = int32
- const _XML_INITIALIZED = 0
- const _XML_PARSING = 1
- const _XML_FINISHED = 2
- const _XML_SUSPENDED = 3
- type TXML_ParsingStatus = struct {
- Fparsing _XML_Parsing
- FfinalBuffer TXML_Bool
- }
- type TXML_Expat_Version = struct {
- Fmajor int32
- Fminor int32
- Fmicro int32
- }
- type _XML_FeatureEnum = int32
- const _XML_FEATURE_END = 0
- const _XML_FEATURE_UNICODE = 1
- const _XML_FEATURE_UNICODE_WCHAR_T = 2
- const _XML_FEATURE_DTD = 3
- const _XML_FEATURE_CONTEXT_BYTES = 4
- const _XML_FEATURE_MIN_SIZE = 5
- const _XML_FEATURE_SIZEOF_XML_CHAR = 6
- const _XML_FEATURE_SIZEOF_XML_LCHAR = 7
- const _XML_FEATURE_NS = 8
- const _XML_FEATURE_LARGE_SIZE = 9
- const _XML_FEATURE_ATTR_INFO = 10
- const _XML_FEATURE_BILLION_LAUGHS_ATTACK_PROTECTION_MAXIMUM_AMPLIFICATION_DEFAULT = 11
- const _XML_FEATURE_BILLION_LAUGHS_ATTACK_PROTECTION_ACTIVATION_THRESHOLD_DEFAULT = 12
- type TXML_Feature = struct {
- Ffeature _XML_FeatureEnum
- Fname uintptr
- Fvalue int64
- }
- type Tsiphash = struct {
- Fv0 Tuint64_t
- Fv1 Tuint64_t
- Fv2 Tuint64_t
- Fv3 Tuint64_t
- Fbuf [8]uint8
- Fp uintptr
- Fc Tuint64_t
- }
- type Tsipkey = struct {
- Fk [2]Tuint64_t
- }
- func _sip_tokey(tls *libc.TLS, key uintptr, src uintptr) (r uintptr) {
- *(*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)
- *(*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)
- return key
- }
- func _sip_round(tls *libc.TLS, H uintptr, rounds int32) {
- var i int32
- _ = i
- i = 0
- for {
- if !(i < rounds) {
- break
- }
- *(*Tuint64_t)(unsafe.Pointer(H)) += (*Tsiphash)(unsafe.Pointer(H)).Fv1
- (*Tsiphash)(unsafe.Pointer(H)).Fv1 = (*Tsiphash)(unsafe.Pointer(H)).Fv1<<libc.Int32FromInt32(13) | (*Tsiphash)(unsafe.Pointer(H)).Fv1>>(libc.Int32FromInt32(64)-libc.Int32FromInt32(13))
- *(*Tuint64_t)(unsafe.Pointer(H + 8)) ^= (*Tsiphash)(unsafe.Pointer(H)).Fv0
- (*Tsiphash)(unsafe.Pointer(H)).Fv0 = (*Tsiphash)(unsafe.Pointer(H)).Fv0<<libc.Int32FromInt32(32) | (*Tsiphash)(unsafe.Pointer(H)).Fv0>>(libc.Int32FromInt32(64)-libc.Int32FromInt32(32))
- *(*Tuint64_t)(unsafe.Pointer(H + 16)) += (*Tsiphash)(unsafe.Pointer(H)).Fv3
- (*Tsiphash)(unsafe.Pointer(H)).Fv3 = (*Tsiphash)(unsafe.Pointer(H)).Fv3<<libc.Int32FromInt32(16) | (*Tsiphash)(unsafe.Pointer(H)).Fv3>>(libc.Int32FromInt32(64)-libc.Int32FromInt32(16))
- *(*Tuint64_t)(unsafe.Pointer(H + 24)) ^= (*Tsiphash)(unsafe.Pointer(H)).Fv2
- *(*Tuint64_t)(unsafe.Pointer(H)) += (*Tsiphash)(unsafe.Pointer(H)).Fv3
- (*Tsiphash)(unsafe.Pointer(H)).Fv3 = (*Tsiphash)(unsafe.Pointer(H)).Fv3<<libc.Int32FromInt32(21) | (*Tsiphash)(unsafe.Pointer(H)).Fv3>>(libc.Int32FromInt32(64)-libc.Int32FromInt32(21))
- *(*Tuint64_t)(unsafe.Pointer(H + 24)) ^= (*Tsiphash)(unsafe.Pointer(H)).Fv0
- *(*Tuint64_t)(unsafe.Pointer(H + 16)) += (*Tsiphash)(unsafe.Pointer(H)).Fv1
- (*Tsiphash)(unsafe.Pointer(H)).Fv1 = (*Tsiphash)(unsafe.Pointer(H)).Fv1<<libc.Int32FromInt32(17) | (*Tsiphash)(unsafe.Pointer(H)).Fv1>>(libc.Int32FromInt32(64)-libc.Int32FromInt32(17))
- *(*Tuint64_t)(unsafe.Pointer(H + 8)) ^= (*Tsiphash)(unsafe.Pointer(H)).Fv2
- (*Tsiphash)(unsafe.Pointer(H)).Fv2 = (*Tsiphash)(unsafe.Pointer(H)).Fv2<<libc.Int32FromInt32(32) | (*Tsiphash)(unsafe.Pointer(H)).Fv2>>(libc.Int32FromInt32(64)-libc.Int32FromInt32(32))
- goto _1
- _1:
- ;
- i++
- }
- }
- func _sip24_init(tls *libc.TLS, H uintptr, key uintptr) (r uintptr) {
- (*Tsiphash)(unsafe.Pointer(H)).Fv0 = libc.Uint64FromUint32(0x736f6d65)<<libc.Int32FromInt32(32) | uint64(libc.Uint32FromUint32(0x70736575)) ^ *(*Tuint64_t)(unsafe.Pointer(key))
- (*Tsiphash)(unsafe.Pointer(H)).Fv1 = libc.Uint64FromUint32(0x646f7261)<<libc.Int32FromInt32(32) | uint64(libc.Uint32FromUint32(0x6e646f6d)) ^ *(*Tuint64_t)(unsafe.Pointer(key + 1*8))
- (*Tsiphash)(unsafe.Pointer(H)).Fv2 = libc.Uint64FromUint32(0x6c796765)<<libc.Int32FromInt32(32) | uint64(libc.Uint32FromUint32(0x6e657261)) ^ *(*Tuint64_t)(unsafe.Pointer(key))
- (*Tsiphash)(unsafe.Pointer(H)).Fv3 = libc.Uint64FromUint32(0x74656462)<<libc.Int32FromInt32(32) | uint64(libc.Uint32FromUint32(0x79746573)) ^ *(*Tuint64_t)(unsafe.Pointer(key + 1*8))
- (*Tsiphash)(unsafe.Pointer(H)).Fp = H + 32
- (*Tsiphash)(unsafe.Pointer(H)).Fc = uint64(0)
- return H
- }
- func _sip24_update(tls *libc.TLS, H uintptr, src uintptr, len1 Tsize_t) (r uintptr) {
- var m Tuint64_t
- var p, pe, v1, v2, v3 uintptr
- _, _, _, _, _, _ = m, p, pe, v1, v2, v3
- p = src
- pe = p + uintptr(len1)
- for cond := true; cond; cond = p < pe {
- for p < pe && (*Tsiphash)(unsafe.Pointer(H)).Fp < H+32+uintptr(libc.Uint64FromInt64(8)/libc.Uint64FromInt64(1)) {
- v2 = H + 40
- v1 = *(*uintptr)(unsafe.Pointer(v2))
- *(*uintptr)(unsafe.Pointer(v2))++
- v3 = p
- p++
- *(*uint8)(unsafe.Pointer(v1)) = *(*uint8)(unsafe.Pointer(v3))
- }
- if (*Tsiphash)(unsafe.Pointer(H)).Fp < H+32+uintptr(libc.Uint64FromInt64(8)/libc.Uint64FromInt64(1)) {
- break
- }
- 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)
- *(*Tuint64_t)(unsafe.Pointer(H + 24)) ^= m
- _sip_round(tls, H, int32(2))
- *(*Tuint64_t)(unsafe.Pointer(H)) ^= m
- (*Tsiphash)(unsafe.Pointer(H)).Fp = H + 32
- *(*Tuint64_t)(unsafe.Pointer(H + 48)) += uint64(8)
- }
- return H
- }
- func _sip24_final(tls *libc.TLS, H uintptr) (r Tuint64_t) {
- var b Tuint64_t
- var left int8
- _, _ = b, left
- left = int8(int64((*Tsiphash)(unsafe.Pointer(H)).Fp) - t__predefined_ptrdiff_t(H+32))
- b = ((*Tsiphash)(unsafe.Pointer(H)).Fc + libc.Uint64FromInt8(left)) << int32(56)
- switch int32(left) {
- case int32(7):
- b |= uint64(*(*uint8)(unsafe.Pointer(H + 32 + 6))) << int32(48)
- fallthrough
- case int32(6):
- b |= uint64(*(*uint8)(unsafe.Pointer(H + 32 + 5))) << int32(40)
- fallthrough
- case int32(5):
- b |= uint64(*(*uint8)(unsafe.Pointer(H + 32 + 4))) << int32(32)
- fallthrough
- case int32(4):
- b |= uint64(*(*uint8)(unsafe.Pointer(H + 32 + 3))) << int32(24)
- fallthrough
- case int32(3):
- b |= uint64(*(*uint8)(unsafe.Pointer(H + 32 + 2))) << int32(16)
- fallthrough
- case int32(2):
- b |= uint64(*(*uint8)(unsafe.Pointer(H + 32 + 1))) << int32(8)
- fallthrough
- case int32(1):
- b |= uint64(*(*uint8)(unsafe.Pointer(H + 32))) << 0
- fallthrough
- case 0:
- break
- }
- *(*Tuint64_t)(unsafe.Pointer(H + 24)) ^= b
- _sip_round(tls, H, int32(2))
- *(*Tuint64_t)(unsafe.Pointer(H)) ^= b
- *(*Tuint64_t)(unsafe.Pointer(H + 16)) ^= uint64(0xff)
- _sip_round(tls, H, int32(4))
- return (*Tsiphash)(unsafe.Pointer(H)).Fv0 ^ (*Tsiphash)(unsafe.Pointer(H)).Fv1 ^ (*Tsiphash)(unsafe.Pointer(H)).Fv2 ^ (*Tsiphash)(unsafe.Pointer(H)).Fv3
- }
- func _siphash24(tls *libc.TLS, src uintptr, len1 Tsize_t, key uintptr) (r Tuint64_t) {
- bp := tls.Alloc(64)
- defer tls.Free(64)
- var _ /* state at bp+0 */ Tsiphash
- *(*Tsiphash)(unsafe.Pointer(bp)) = Tsiphash{}
- return _sip24_final(tls, _sip24_update(tls, _sip24_init(tls, bp, key), src, len1))
- }
- func _sip24_valid(tls *libc.TLS) (r int32) {
- bp := tls.Alloc(80)
- defer tls.Free(80)
- var i Tsize_t
- var _ /* in at bp+0 */ [64]uint8
- var _ /* k at bp+64 */ Tsipkey
- _ = i
- _sip_tokey(tls, bp+64, __ccgo_ts)
- i = uint64(0)
- for {
- if !(i < uint64(64)) {
- break
- }
- (*(*[64]uint8)(unsafe.Pointer(bp)))[i] = uint8(i)
- 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) {
- return 0
- }
- goto _1
- _1:
- ;
- i++
- }
- return int32(1)
- }
- var _vectors = [64][8]uint8{
- 0: {
- 0: uint8(0x31),
- 1: uint8(0x0e),
- 2: uint8(0x0e),
- 3: uint8(0xdd),
- 4: uint8(0x47),
- 5: uint8(0xdb),
- 6: uint8(0x6f),
- 7: uint8(0x72),
- },
- 1: {
- 0: uint8(0xfd),
- 1: uint8(0x67),
- 2: uint8(0xdc),
- 3: uint8(0x93),
- 4: uint8(0xc5),
- 5: uint8(0x39),
- 6: uint8(0xf8),
- 7: uint8(0x74),
- },
- 2: {
- 0: uint8(0x5a),
- 1: uint8(0x4f),
- 2: uint8(0xa9),
- 3: uint8(0xd9),
- 4: uint8(0x09),
- 5: uint8(0x80),
- 6: uint8(0x6c),
- 7: uint8(0x0d),
- },
- 3: {
- 0: uint8(0x2d),
- 1: uint8(0x7e),
- 2: uint8(0xfb),
- 3: uint8(0xd7),
- 4: uint8(0x96),
- 5: uint8(0x66),
- 6: uint8(0x67),
- 7: uint8(0x85),
- },
- 4: {
- 0: uint8(0xb7),
- 1: uint8(0x87),
- 2: uint8(0x71),
- 3: uint8(0x27),
- 4: uint8(0xe0),
- 5: uint8(0x94),
- 6: uint8(0x27),
- 7: uint8(0xcf),
- },
- 5: {
- 0: uint8(0x8d),
- 1: uint8(0xa6),
- 2: uint8(0x99),
- 3: uint8(0xcd),
- 4: uint8(0x64),
- 5: uint8(0x55),
- 6: uint8(0x76),
- 7: uint8(0x18),
- },
- 6: {
- 0: uint8(0xce),
- 1: uint8(0xe3),
- 2: uint8(0xfe),
- 3: uint8(0x58),
- 4: uint8(0x6e),
- 5: uint8(0x46),
- 6: uint8(0xc9),
- 7: uint8(0xcb),
- },
- 7: {
- 0: uint8(0x37),
- 1: uint8(0xd1),
- 2: uint8(0x01),
- 3: uint8(0x8b),
- 4: uint8(0xf5),
- 6: uint8(0x02),
- 7: uint8(0xab),
- },
- 8: {
- 0: uint8(0x62),
- 1: uint8(0x24),
- 2: uint8(0x93),
- 3: uint8(0x9a),
- 4: uint8(0x79),
- 5: uint8(0xf5),
- 6: uint8(0xf5),
- 7: uint8(0x93),
- },
- 9: {
- 0: uint8(0xb0),
- 1: uint8(0xe4),
- 2: uint8(0xa9),
- 3: uint8(0x0b),
- 4: uint8(0xdf),
- 5: uint8(0x82),
- 7: uint8(0x9e),
- },
- 10: {
- 0: uint8(0xf3),
- 1: uint8(0xb9),
- 2: uint8(0xdd),
- 3: uint8(0x94),
- 4: uint8(0xc5),
- 5: uint8(0xbb),
- 6: uint8(0x5d),
- 7: uint8(0x7a),
- },
- 11: {
- 0: uint8(0xa7),
- 1: uint8(0xad),
- 2: uint8(0x6b),
- 3: uint8(0x22),
- 4: uint8(0x46),
- 5: uint8(0x2f),
- 6: uint8(0xb3),
- 7: uint8(0xf4),
- },
- 12: {
- 0: uint8(0xfb),
- 1: uint8(0xe5),
- 2: uint8(0x0e),
- 3: uint8(0x86),
- 4: uint8(0xbc),
- 5: uint8(0x8f),
- 6: uint8(0x1e),
- 7: uint8(0x75),
- },
- 13: {
- 0: uint8(0x90),
- 1: uint8(0x3d),
- 2: uint8(0x84),
- 3: uint8(0xc0),
- 4: uint8(0x27),
- 5: uint8(0x56),
- 6: uint8(0xea),
- 7: uint8(0x14),
- },
- 14: {
- 0: uint8(0xee),
- 1: uint8(0xf2),
- 2: uint8(0x7a),
- 3: uint8(0x8e),
- 4: uint8(0x90),
- 5: uint8(0xca),
- 6: uint8(0x23),
- 7: uint8(0xf7),
- },
- 15: {
- 0: uint8(0xe5),
- 1: uint8(0x45),
- 2: uint8(0xbe),
- 3: uint8(0x49),
- 4: uint8(0x61),
- 5: uint8(0xca),
- 6: uint8(0x29),
- 7: uint8(0xa1),
- },
- 16: {
- 0: uint8(0xdb),
- 1: uint8(0x9b),
- 2: uint8(0xc2),
- 3: uint8(0x57),
- 4: uint8(0x7f),
- 5: uint8(0xcc),
- 6: uint8(0x2a),
- 7: uint8(0x3f),
- },
- 17: {
- 0: uint8(0x94),
- 1: uint8(0x47),
- 2: uint8(0xbe),
- 3: uint8(0x2c),
- 4: uint8(0xf5),
- 5: uint8(0xe9),
- 6: uint8(0x9a),
- 7: uint8(0x69),
- },
- 18: {
- 0: uint8(0x9c),
- 1: uint8(0xd3),
- 2: uint8(0x8d),
- 3: uint8(0x96),
- 4: uint8(0xf0),
- 5: uint8(0xb3),
- 6: uint8(0xc1),
- 7: uint8(0x4b),
- },
- 19: {
- 0: uint8(0xbd),
- 1: uint8(0x61),
- 2: uint8(0x79),
- 3: uint8(0xa7),
- 4: uint8(0x1d),
- 5: uint8(0xc9),
- 6: uint8(0x6d),
- 7: uint8(0xbb),
- },
- 20: {
- 0: uint8(0x98),
- 1: uint8(0xee),
- 2: uint8(0xa2),
- 3: uint8(0x1a),
- 4: uint8(0xf2),
- 5: uint8(0x5c),
- 6: uint8(0xd6),
- 7: uint8(0xbe),
- },
- 21: {
- 0: uint8(0xc7),
- 1: uint8(0x67),
- 2: uint8(0x3b),
- 3: uint8(0x2e),
- 4: uint8(0xb0),
- 5: uint8(0xcb),
- 6: uint8(0xf2),
- 7: uint8(0xd0),
- },
- 22: {
- 0: uint8(0x88),
- 1: uint8(0x3e),
- 2: uint8(0xa3),
- 3: uint8(0xe3),
- 4: uint8(0x95),
- 5: uint8(0x67),
- 6: uint8(0x53),
- 7: uint8(0x93),
- },
- 23: {
- 0: uint8(0xc8),
- 1: uint8(0xce),
- 2: uint8(0x5c),
- 3: uint8(0xcd),
- 4: uint8(0x8c),
- 5: uint8(0x03),
- 6: uint8(0x0c),
- 7: uint8(0xa8),
- },
- 24: {
- 0: uint8(0x94),
- 1: uint8(0xaf),
- 2: uint8(0x49),
- 3: uint8(0xf6),
- 4: uint8(0xc6),
- 5: uint8(0x50),
- 6: uint8(0xad),
- 7: uint8(0xb8),
- },
- 25: {
- 0: uint8(0xea),
- 1: uint8(0xb8),
- 2: uint8(0x85),
- 3: uint8(0x8a),
- 4: uint8(0xde),
- 5: uint8(0x92),
- 6: uint8(0xe1),
- 7: uint8(0xbc),
- },
- 26: {
- 0: uint8(0xf3),
- 1: uint8(0x15),
- 2: uint8(0xbb),
- 3: uint8(0x5b),
- 4: uint8(0xb8),
- 5: uint8(0x35),
- 6: uint8(0xd8),
- 7: uint8(0x17),
- },
- 27: {
- 0: uint8(0xad),
- 1: uint8(0xcf),
- 2: uint8(0x6b),
- 3: uint8(0x07),
- 4: uint8(0x63),
- 5: uint8(0x61),
- 6: uint8(0x2e),
- 7: uint8(0x2f),
- },
- 28: {
- 0: uint8(0xa5),
- 1: uint8(0xc9),
- 2: uint8(0x1d),
- 3: uint8(0xa7),
- 4: uint8(0xac),
- 5: uint8(0xaa),
- 6: uint8(0x4d),
- 7: uint8(0xde),
- },
- 29: {
- 0: uint8(0x71),
- 1: uint8(0x65),
- 2: uint8(0x95),
- 3: uint8(0x87),
- 4: uint8(0x66),
- 5: uint8(0x50),
- 6: uint8(0xa2),
- 7: uint8(0xa6),
- },
- 30: {
- 0: uint8(0x28),
- 1: uint8(0xef),
- 2: uint8(0x49),
- 3: uint8(0x5c),
- 4: uint8(0x53),
- 5: uint8(0xa3),
- 6: uint8(0x87),
- 7: uint8(0xad),
- },
- 31: {
- 0: uint8(0x42),
- 1: uint8(0xc3),
- 2: uint8(0x41),
- 3: uint8(0xd8),
- 4: uint8(0xfa),
- 5: uint8(0x92),
- 6: uint8(0xd8),
- 7: uint8(0x32),
- },
- 32: {
- 0: uint8(0xce),
- 1: uint8(0x7c),
- 2: uint8(0xf2),
- 3: uint8(0x72),
- 4: uint8(0x2f),
- 5: uint8(0x51),
- 6: uint8(0x27),
- 7: uint8(0x71),
- },
- 33: {
- 0: uint8(0xe3),
- 1: uint8(0x78),
- 2: uint8(0x59),
- 3: uint8(0xf9),
- 4: uint8(0x46),
- 5: uint8(0x23),
- 6: uint8(0xf3),
- 7: uint8(0xa7),
- },
- 34: {
- 0: uint8(0x38),
- 1: uint8(0x12),
- 2: uint8(0x05),
- 3: uint8(0xbb),
- 4: uint8(0x1a),
- 5: uint8(0xb0),
- 6: uint8(0xe0),
- 7: uint8(0x12),
- },
- 35: {
- 0: uint8(0xae),
- 1: uint8(0x97),
- 2: uint8(0xa1),
- 3: uint8(0x0f),
- 4: uint8(0xd4),
- 5: uint8(0x34),
- 6: uint8(0xe0),
- 7: uint8(0x15),
- },
- 36: {
- 0: uint8(0xb4),
- 1: uint8(0xa3),
- 2: uint8(0x15),
- 3: uint8(0x08),
- 4: uint8(0xbe),
- 5: uint8(0xff),
- 6: uint8(0x4d),
- 7: uint8(0x31),
- },
- 37: {
- 0: uint8(0x81),
- 1: uint8(0x39),
- 2: uint8(0x62),
- 3: uint8(0x29),
- 4: uint8(0xf0),
- 5: uint8(0x90),
- 6: uint8(0x79),
- 7: uint8(0x02),
- },
- 38: {
- 0: uint8(0x4d),
- 1: uint8(0x0c),
- 2: uint8(0xf4),
- 3: uint8(0x9e),
- 4: uint8(0xe5),
- 5: uint8(0xd4),
- 6: uint8(0xdc),
- 7: uint8(0xca),
- },
- 39: {
- 0: uint8(0x5c),
- 1: uint8(0x73),
- 2: uint8(0x33),
- 3: uint8(0x6a),
- 4: uint8(0x76),
- 5: uint8(0xd8),
- 6: uint8(0xbf),
- 7: uint8(0x9a),
- },
- 40: {
- 0: uint8(0xd0),
- 1: uint8(0xa7),
- 2: uint8(0x04),
- 3: uint8(0x53),
- 4: uint8(0x6b),
- 5: uint8(0xa9),
- 6: uint8(0x3e),
- 7: uint8(0x0e),
- },
- 41: {
- 0: uint8(0x92),
- 1: uint8(0x59),
- 2: uint8(0x58),
- 3: uint8(0xfc),
- 4: uint8(0xd6),
- 5: uint8(0x42),
- 6: uint8(0x0c),
- 7: uint8(0xad),
- },
- 42: {
- 0: uint8(0xa9),
- 1: uint8(0x15),
- 2: uint8(0xc2),
- 3: uint8(0x9b),
- 4: uint8(0xc8),
- 5: uint8(0x06),
- 6: uint8(0x73),
- 7: uint8(0x18),
- },
- 43: {
- 0: uint8(0x95),
- 1: uint8(0x2b),
- 2: uint8(0x79),
- 3: uint8(0xf3),
- 4: uint8(0xbc),
- 5: uint8(0x0a),
- 6: uint8(0xa6),
- 7: uint8(0xd4),
- },
- 44: {
- 0: uint8(0xf2),
- 1: uint8(0x1d),
- 2: uint8(0xf2),
- 3: uint8(0xe4),
- 4: uint8(0x1d),
- 5: uint8(0x45),
- 6: uint8(0x35),
- 7: uint8(0xf9),
- },
- 45: {
- 0: uint8(0x87),
- 1: uint8(0x57),
- 2: uint8(0x75),
- 3: uint8(0x19),
- 4: uint8(0x04),
- 5: uint8(0x8f),
- 6: uint8(0x53),
- 7: uint8(0xa9),
- },
- 46: {
- 0: uint8(0x10),
- 1: uint8(0xa5),
- 2: uint8(0x6c),
- 3: uint8(0xf5),
- 4: uint8(0xdf),
- 5: uint8(0xcd),
- 6: uint8(0x9a),
- 7: uint8(0xdb),
- },
- 47: {
- 0: uint8(0xeb),
- 1: uint8(0x75),
- 2: uint8(0x09),
- 3: uint8(0x5c),
- 4: uint8(0xcd),
- 5: uint8(0x98),
- 6: uint8(0x6c),
- 7: uint8(0xd0),
- },
- 48: {
- 0: uint8(0x51),
- 1: uint8(0xa9),
- 2: uint8(0xcb),
- 3: uint8(0x9e),
- 4: uint8(0xcb),
- 5: uint8(0xa3),
- 6: uint8(0x12),
- 7: uint8(0xe6),
- },
- 49: {
- 0: uint8(0x96),
- 1: uint8(0xaf),
- 2: uint8(0xad),
- 3: uint8(0xfc),
- 4: uint8(0x2c),
- 5: uint8(0xe6),
- 6: uint8(0x66),
- 7: uint8(0xc7),
- },
- 50: {
- 0: uint8(0x72),
- 1: uint8(0xfe),
- 2: uint8(0x52),
- 3: uint8(0x97),
- 4: uint8(0x5a),
- 5: uint8(0x43),
- 6: uint8(0x64),
- 7: uint8(0xee),
- },
- 51: {
- 0: uint8(0x5a),
- 1: uint8(0x16),
- 2: uint8(0x45),
- 3: uint8(0xb2),
- 4: uint8(0x76),
- 5: uint8(0xd5),
- 6: uint8(0x92),
- 7: uint8(0xa1),
- },
- 52: {
- 0: uint8(0xb2),
- 1: uint8(0x74),
- 2: uint8(0xcb),
- 3: uint8(0x8e),
- 4: uint8(0xbf),
- 5: uint8(0x87),
- 6: uint8(0x87),
- 7: uint8(0x0a),
- },
- 53: {
- 0: uint8(0x6f),
- 1: uint8(0x9b),
- 2: uint8(0xb4),
- 3: uint8(0x20),
- 4: uint8(0x3d),
- 5: uint8(0xe7),
- 6: uint8(0xb3),
- 7: uint8(0x81),
- },
- 54: {
- 0: uint8(0xea),
- 1: uint8(0xec),
- 2: uint8(0xb2),
- 3: uint8(0xa3),
- 4: uint8(0x0b),
- 5: uint8(0x22),
- 6: uint8(0xa8),
- 7: uint8(0x7f),
- },
- 55: {
- 0: uint8(0x99),
- 1: uint8(0x24),
- 2: uint8(0xa4),
- 3: uint8(0x3c),
- 4: uint8(0xc1),
- 5: uint8(0x31),
- 6: uint8(0x57),
- 7: uint8(0x24),
- },
- 56: {
- 0: uint8(0xbd),
- 1: uint8(0x83),
- 2: uint8(0x8d),
- 3: uint8(0x3a),
- 4: uint8(0xaf),
- 5: uint8(0xbf),
- 6: uint8(0x8d),
- 7: uint8(0xb7),
- },
- 57: {
- 0: uint8(0x0b),
- 1: uint8(0x1a),
- 2: uint8(0x2a),
- 3: uint8(0x32),
- 4: uint8(0x65),
- 5: uint8(0xd5),
- 6: uint8(0x1a),
- 7: uint8(0xea),
- },
- 58: {
- 0: uint8(0x13),
- 1: uint8(0x50),
- 2: uint8(0x79),
- 3: uint8(0xa3),
- 4: uint8(0x23),
- 5: uint8(0x1c),
- 6: uint8(0xe6),
- 7: uint8(0x60),
- },
- 59: {
- 0: uint8(0x93),
- 1: uint8(0x2b),
- 2: uint8(0x28),
- 3: uint8(0x46),
- 4: uint8(0xe4),
- 5: uint8(0xd7),
- 6: uint8(0x06),
- 7: uint8(0x66),
- },
- 60: {
- 0: uint8(0xe1),
- 1: uint8(0x91),
- 2: uint8(0x5f),
- 3: uint8(0x5c),
- 4: uint8(0xb1),
- 5: uint8(0xec),
- 6: uint8(0xa4),
- 7: uint8(0x6c),
- },
- 61: {
- 0: uint8(0xf3),
- 1: uint8(0x25),
- 2: uint8(0x96),
- 3: uint8(0x5c),
- 4: uint8(0xa1),
- 5: uint8(0x6d),
- 6: uint8(0x62),
- 7: uint8(0x9f),
- },
- 62: {
- 0: uint8(0x57),
- 1: uint8(0x5f),
- 2: uint8(0xf2),
- 3: uint8(0x8e),
- 4: uint8(0x60),
- 5: uint8(0x38),
- 6: uint8(0x1b),
- 7: uint8(0xe5),
- },
- 63: {
- 0: uint8(0x72),
- 1: uint8(0x45),
- 2: uint8(0x06),
- 3: uint8(0xeb),
- 4: uint8(0x4c),
- 5: uint8(0x32),
- 6: uint8(0x8a),
- 7: uint8(0x95),
- },
- }
- type TICHAR = int8
- type TPOSITION = struct {
- FlineNumber TXML_Size
- FcolumnNumber TXML_Size
- }
- type Tposition = TPOSITION
- type TATTRIBUTE = struct {
- Fname uintptr
- FvaluePtr uintptr
- FvalueEnd uintptr
- Fnormalized int8
- }
- type Tencoding = struct {
- Fscanners [4]TSCANNER
- FliteralScanners [2]TSCANNER
- FnameMatchesAscii uintptr
- FnameLength uintptr
- FskipS uintptr
- FgetAtts uintptr
- FcharRefNumber uintptr
- FpredefinedEntityName uintptr
- FupdatePosition uintptr
- FisPublicId uintptr
- Futf8Convert uintptr
- Futf16Convert uintptr
- FminBytesPerChar int32
- FisUtf8 int8
- FisUtf16 int8
- }
- type TENCODING = struct {
- Fscanners [4]TSCANNER
- FliteralScanners [2]TSCANNER
- FnameMatchesAscii uintptr
- FnameLength uintptr
- FskipS uintptr
- FgetAtts uintptr
- FcharRefNumber uintptr
- FpredefinedEntityName uintptr
- FupdatePosition uintptr
- FisPublicId uintptr
- Futf8Convert uintptr
- Futf16Convert uintptr
- FminBytesPerChar int32
- FisUtf8 int8
- FisUtf16 int8
- }
- type TSCANNER = uintptr
- type _XML_Convert_Result = int32
- const _XML_CONVERT_COMPLETED = 0
- const _XML_CONVERT_INPUT_INCOMPLETE = 1
- const _XML_CONVERT_OUTPUT_EXHAUSTED = 2
- type TINIT_ENCODING = struct {
- FinitEnc TENCODING
- FencPtr uintptr
- }
- type TCONVERTER = uintptr
- const _XML_ROLE_ERROR = -1
- const _XML_ROLE_NONE = 0
- const _XML_ROLE_XML_DECL = 1
- const _XML_ROLE_INSTANCE_START = 2
- const _XML_ROLE_DOCTYPE_NONE = 3
- const _XML_ROLE_DOCTYPE_NAME = 4
- const _XML_ROLE_DOCTYPE_SYSTEM_ID = 5
- const _XML_ROLE_DOCTYPE_PUBLIC_ID = 6
- const _XML_ROLE_DOCTYPE_INTERNAL_SUBSET = 7
- const _XML_ROLE_DOCTYPE_CLOSE = 8
- const _XML_ROLE_GENERAL_ENTITY_NAME = 9
- const _XML_ROLE_PARAM_ENTITY_NAME = 10
- const _XML_ROLE_ENTITY_NONE = 11
- const _XML_ROLE_ENTITY_VALUE = 12
- const _XML_ROLE_ENTITY_SYSTEM_ID = 13
- const _XML_ROLE_ENTITY_PUBLIC_ID = 14
- const _XML_ROLE_ENTITY_COMPLETE = 15
- const _XML_ROLE_ENTITY_NOTATION_NAME = 16
- const _XML_ROLE_NOTATION_NONE = 17
- const _XML_ROLE_NOTATION_NAME = 18
- const _XML_ROLE_NOTATION_SYSTEM_ID = 19
- const _XML_ROLE_NOTATION_NO_SYSTEM_ID = 20
- const _XML_ROLE_NOTATION_PUBLIC_ID = 21
- const _XML_ROLE_ATTRIBUTE_NAME = 22
- const _XML_ROLE_ATTRIBUTE_TYPE_CDATA = 23
- const _XML_ROLE_ATTRIBUTE_TYPE_ID = 24
- const _XML_ROLE_ATTRIBUTE_TYPE_IDREF = 25
- const _XML_ROLE_ATTRIBUTE_TYPE_IDREFS = 26
- const _XML_ROLE_ATTRIBUTE_TYPE_ENTITY = 27
- const _XML_ROLE_ATTRIBUTE_TYPE_ENTITIES = 28
- const _XML_ROLE_ATTRIBUTE_TYPE_NMTOKEN = 29
- const _XML_ROLE_ATTRIBUTE_TYPE_NMTOKENS = 30
- const _XML_ROLE_ATTRIBUTE_ENUM_VALUE = 31
- const _XML_ROLE_ATTRIBUTE_NOTATION_VALUE = 32
- const _XML_ROLE_ATTLIST_NONE = 33
- const _XML_ROLE_ATTLIST_ELEMENT_NAME = 34
- const _XML_ROLE_IMPLIED_ATTRIBUTE_VALUE = 35
- const _XML_ROLE_REQUIRED_ATTRIBUTE_VALUE = 36
- const _XML_ROLE_DEFAULT_ATTRIBUTE_VALUE = 37
- const _XML_ROLE_FIXED_ATTRIBUTE_VALUE = 38
- const _XML_ROLE_ELEMENT_NONE = 39
- const _XML_ROLE_ELEMENT_NAME = 40
- const _XML_ROLE_CONTENT_ANY = 41
- const _XML_ROLE_CONTENT_EMPTY = 42
- const _XML_ROLE_CONTENT_PCDATA = 43
- const _XML_ROLE_GROUP_OPEN = 44
- const _XML_ROLE_GROUP_CLOSE = 45
- const _XML_ROLE_GROUP_CLOSE_REP = 46
- const _XML_ROLE_GROUP_CLOSE_OPT = 47
- const _XML_ROLE_GROUP_CLOSE_PLUS = 48
- const _XML_ROLE_GROUP_CHOICE = 49
- const _XML_ROLE_GROUP_SEQUENCE = 50
- const _XML_ROLE_CONTENT_ELEMENT = 51
- const _XML_ROLE_CONTENT_ELEMENT_REP = 52
- const _XML_ROLE_CONTENT_ELEMENT_OPT = 53
- const _XML_ROLE_CONTENT_ELEMENT_PLUS = 54
- const _XML_ROLE_PI = 55
- const _XML_ROLE_COMMENT = 56
- const _XML_ROLE_TEXT_DECL = 57
- const _XML_ROLE_IGNORE_SECT = 58
- const _XML_ROLE_INNER_PARAM_ENTITY_REF = 59
- const _XML_ROLE_PARAM_ENTITY_REF = 60
- type TPROLOG_STATE = struct {
- Fhandler uintptr
- Flevel uint32
- Frole_none int32
- FincludeLevel uint32
- FdocumentEntity int32
- FinEntityValue int32
- }
- type Tprolog_state = TPROLOG_STATE
- type TKEY = uintptr
- type TNAMED = struct {
- Fname TKEY
- }
- type THASH_TABLE = struct {
- Fv uintptr
- Fpower uint8
- Fsize Tsize_t
- Fused Tsize_t
- Fmem uintptr
- }
- /* For probing (after a collision) we need a step size relative prime
- to the hash table size, which is a power of 2. We use double-hashing,
- since we can calculate a second hash value cheaply by taking those bits
- of the first hash value that were discarded (masked out) when the table
- index was calculated: index = hash & mask, where mask = table->size - 1.
- We limit the maximum step size to table->size / 4 (mask >> 2) and make
- it odd, since odd numbers are always relative prime to a power of 2.
- */
- type THASH_TABLE_ITER = struct {
- Fp uintptr
- Fend uintptr
- }
- type TBINDING = struct {
- Fprefix uintptr
- FnextTagBinding uintptr
- FprevPrefixBinding uintptr
- FattId uintptr
- Furi uintptr
- FuriLen int32
- FuriAlloc int32
- }
- type Tbinding = TBINDING
- type TPREFIX = struct {
- Fname uintptr
- Fbinding uintptr
- }
- type Tprefix = TPREFIX
- type TTAG_NAME = struct {
- Fstr uintptr
- FlocalPart uintptr
- Fprefix uintptr
- FstrLen int32
- FuriLen int32
- FprefixLen int32
- }
- // C documentation
- //
- // /* TAG represents an open element.
- // The name of the element is stored in both the document and API
- // encodings. The memory buffer 'buf' is a separately-allocated
- // memory area which stores the name. During the XML_Parse()/
- // XMLParseBuffer() when the element is open, the memory for the 'raw'
- // version of the name (in the document encoding) is shared with the
- // document buffer. If the element is open across calls to
- // XML_Parse()/XML_ParseBuffer(), the buffer is re-allocated to
- // contain the 'raw' name as well.
- //
- // A parser re-uses these structures, maintaining a list of allocated
- // TAG objects in a free list.
- // */
- type TTAG = struct {
- Fparent uintptr
- FrawName uintptr
- FrawNameLength int32
- Fname TTAG_NAME
- Fbuf uintptr
- FbufEnd uintptr
- Fbindings uintptr
- }
- // C documentation
- //
- // /* TAG represents an open element.
- // The name of the element is stored in both the document and API
- // encodings. The memory buffer 'buf' is a separately-allocated
- // memory area which stores the name. During the XML_Parse()/
- // XMLParseBuffer() when the element is open, the memory for the 'raw'
- // version of the name (in the document encoding) is shared with the
- // document buffer. If the element is open across calls to
- // XML_Parse()/XML_ParseBuffer(), the buffer is re-allocated to
- // contain the 'raw' name as well.
- //
- // A parser re-uses these structures, maintaining a list of allocated
- // TAG objects in a free list.
- // */
- type Ttag = TTAG
- type TENTITY = struct {
- Fname uintptr
- FtextPtr uintptr
- FtextLen int32
- Fprocessed int32
- FsystemId uintptr
- Fbase uintptr
- FpublicId uintptr
- Fnotation uintptr
- Fopen TXML_Bool
- Fis_param TXML_Bool
- Fis_internal TXML_Bool
- }
- type TCONTENT_SCAFFOLD = struct {
- Ftype1 _XML_Content_Type
- Fquant _XML_Content_Quant
- Fname uintptr
- Ffirstchild int32
- Flastchild int32
- Fchildcnt int32
- Fnextsib int32
- }
- type TBLOCK = struct {
- Fnext uintptr
- Fsize int32
- Fs [1]TXML_Char
- }
- type Tblock = TBLOCK
- type TSTRING_POOL = struct {
- Fblocks uintptr
- FfreeBlocks uintptr
- Fend uintptr
- Fptr uintptr
- Fstart uintptr
- Fmem uintptr
- }
- // C documentation
- //
- // /* The XML_Char before the name is used to determine whether
- // an attribute has been specified. */
- type TATTRIBUTE_ID = struct {
- Fname uintptr
- Fprefix uintptr
- FmaybeTokenized TXML_Bool
- Fxmlns TXML_Bool
- }
- // C documentation
- //
- // /* The XML_Char before the name is used to determine whether
- // an attribute has been specified. */
- type Tattribute_id = TATTRIBUTE_ID
- type TDEFAULT_ATTRIBUTE = struct {
- Fid uintptr
- FisCdata TXML_Bool
- Fvalue uintptr
- }
- type TNS_ATT = struct {
- Fversion uint64
- Fhash uint64
- FuriName uintptr
- }
- type TELEMENT_TYPE = struct {
- Fname uintptr
- Fprefix uintptr
- FidAtt uintptr
- FnDefaultAtts int32
- FallocDefaultAtts int32
- FdefaultAtts uintptr
- }
- type TDTD = struct {
- FgeneralEntities THASH_TABLE
- FelementTypes THASH_TABLE
- FattributeIds THASH_TABLE
- Fprefixes THASH_TABLE
- Fpool TSTRING_POOL
- FentityValuePool TSTRING_POOL
- FkeepProcessing TXML_Bool
- FhasParamEntityRefs TXML_Bool
- Fstandalone TXML_Bool
- FparamEntityRead TXML_Bool
- FparamEntities THASH_TABLE
- FdefaultPrefix TPREFIX
- Fin_eldecl TXML_Bool
- Fscaffold uintptr
- FcontentStringLen uint32
- FscaffSize uint32
- FscaffCount uint32
- FscaffLevel int32
- FscaffIndex uintptr
- }
- type TOPEN_INTERNAL_ENTITY = struct {
- FinternalEventPtr uintptr
- FinternalEventEndPtr uintptr
- Fnext uintptr
- Fentity uintptr
- FstartTagLevel int32
- FbetweenDecl TXML_Bool
- }
- type Topen_internal_entity = TOPEN_INTERNAL_ENTITY
- type _XML_Account = int32
- const _XML_ACCOUNT_DIRECT = 0
- const /* bytes directly passed to the Expat parser */
- _XML_ACCOUNT_ENTITY_EXPANSION = 1
- const /* intermediate bytes produced during entity
- expansion */
- _XML_ACCOUNT_NONE = 2
- type TXmlBigCount = uint64
- type TACCOUNTING = struct {
- FcountBytesDirect TXmlBigCount
- FcountBytesIndirect TXmlBigCount
- FdebugLevel int32
- FmaximumAmplificationFactor float32
- FactivationThresholdBytes uint64
- }
- type Taccounting = TACCOUNTING
- type TENTITY_STATS = struct {
- FcountEverOpened uint32
- FcurrentDepth uint32
- FmaximumDepthSeen uint32
- FdebugLevel int32
- }
- type Tentity_stats = TENTITY_STATS
- func XXML_ParserCreate(tls *libc.TLS, encodingName uintptr) (r TXML_Parser) {
- return XXML_ParserCreate_MM(tls, encodingName, libc.UintptrFromInt32(0), libc.UintptrFromInt32(0))
- }
- func XXML_ParserCreateNS(tls *libc.TLS, encodingName uintptr, nsSep TXML_Char) (r TXML_Parser) {
- bp := tls.Alloc(16)
- defer tls.Free(16)
- var _ /* tmp at bp+0 */ [2]TXML_Char
- *(*[2]TXML_Char)(unsafe.Pointer(bp)) = [2]TXML_Char{
- 0: nsSep,
- }
- return XXML_ParserCreate_MM(tls, encodingName, libc.UintptrFromInt32(0), bp)
- }
- // C documentation
- //
- // // "xml=http://www.w3.org/XML/1998/namespace"
- var _implicitContext = [41]TXML_Char{
- 0: int8(m_ASCII_x),
- 1: int8(m_ASCII_m),
- 2: int8(m_ASCII_l),
- 3: int8(m_ASCII_EQUALS),
- 4: int8(m_ASCII_h),
- 5: int8(m_ASCII_t),
- 6: int8(m_ASCII_t),
- 7: int8(m_ASCII_p),
- 8: int8(m_ASCII_COLON),
- 9: int8(m_ASCII_SLASH),
- 10: int8(m_ASCII_SLASH),
- 11: int8(m_ASCII_w),
- 12: int8(m_ASCII_w),
- 13: int8(m_ASCII_w),
- 14: int8(m_ASCII_PERIOD),
- 15: int8(m_ASCII_w),
- 16: int8(m_ASCII_3),
- 17: int8(m_ASCII_PERIOD),
- 18: int8(m_ASCII_o),
- 19: int8(m_ASCII_r),
- 20: int8(m_ASCII_g),
- 21: int8(m_ASCII_SLASH),
- 22: int8(m_ASCII_X),
- 23: int8(m_ASCII_M),
- 24: int8(m_ASCII_L),
- 25: int8(m_ASCII_SLASH),
- 26: int8(m_ASCII_1),
- 27: int8(m_ASCII_9),
- 28: int8(m_ASCII_9),
- 29: int8(m_ASCII_8),
- 30: int8(m_ASCII_SLASH),
- 31: int8(m_ASCII_n),
- 32: int8(m_ASCII_a),
- 33: int8(m_ASCII_m),
- 34: int8(m_ASCII_e),
- 35: int8(m_ASCII_s),
- 36: int8(m_ASCII_p),
- 37: int8(m_ASCII_a),
- 38: int8(m_ASCII_c),
- 39: int8(m_ASCII_e),
- }
- /* To avoid warnings about unused functions: */
- func _ENTROPY_DEBUG(tls *libc.TLS, label uintptr, entropy uint64) (r uint64) {
- bp := tls.Alloc(48)
- defer tls.Free(48)
- if _getDebugLevel(tls, __ccgo_ts+17, uint64(0)) >= uint64(1) {
- libc.Xfprintf(tls, libc.Xstderr, __ccgo_ts+37, libc.VaList(bp+8, label, libc.Int32FromInt64(8)*libc.Int32FromInt32(2), entropy, libc.Uint64FromInt64(8)))
- }
- return entropy
- }
- func _generate_hash_secret_salt(tls *libc.TLS, parser TXML_Parser) (r uint64) {
- bp := tls.Alloc(16)
- defer tls.Free(16)
- var _ /* entropy at bp+0 */ uint64
- _ = parser
- /* "Failproof" high quality providers: */
- libbsd.Xarc4random_buf(tls, bp, uint64(8))
- return _ENTROPY_DEBUG(tls, __ccgo_ts+81, *(*uint64)(unsafe.Pointer(bp)))
- }
- func _get_hash_secret_salt(tls *libc.TLS, parser TXML_Parser) (r uint64) {
- if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parentParser != libc.UintptrFromInt32(0) {
- return _get_hash_secret_salt(tls, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parentParser)
- }
- return (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_hash_secret_salt
- }
- func _startParsing(tls *libc.TLS, parser TXML_Parser) (r TXML_Bool) {
- /* hash functions must be initialized before setContext() is called */
- if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_hash_secret_salt == uint64(0) {
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_hash_secret_salt = _generate_hash_secret_salt(tls, parser)
- }
- if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_ns != 0 {
- /* implicit context only set for root parser, since child
- parsers (i.e. external entity parsers) will inherit it
- */
- return _setContext(tls, parser, uintptr(unsafe.Pointer(&_implicitContext)))
- }
- return libc.Uint8FromInt32(1)
- }
- func XXML_ParserCreate_MM(tls *libc.TLS, encodingName uintptr, memsuite uintptr, nameSep uintptr) (r TXML_Parser) {
- return _parserCreate(tls, encodingName, memsuite, nameSep, libc.UintptrFromInt32(0))
- }
- func _parserCreate(tls *libc.TLS, encodingName uintptr, memsuite uintptr, nameSep uintptr, dtd uintptr) (r TXML_Parser) {
- var mtemp, mtemp1 uintptr
- var parser TXML_Parser
- _, _, _ = mtemp, mtemp1, parser
- if memsuite != 0 {
- parser = (*(*func(*libc.TLS, Tsize_t) uintptr)(unsafe.Pointer(&struct{ uintptr }{(*TXML_Memory_Handling_Suite)(unsafe.Pointer(memsuite)).Fmalloc_fcn})))(tls, uint64(976))
- if parser != libc.UintptrFromInt32(0) {
- mtemp = parser + 24
- (*TXML_Memory_Handling_Suite)(unsafe.Pointer(mtemp)).Fmalloc_fcn = (*TXML_Memory_Handling_Suite)(unsafe.Pointer(memsuite)).Fmalloc_fcn
- (*TXML_Memory_Handling_Suite)(unsafe.Pointer(mtemp)).Frealloc_fcn = (*TXML_Memory_Handling_Suite)(unsafe.Pointer(memsuite)).Frealloc_fcn
- (*TXML_Memory_Handling_Suite)(unsafe.Pointer(mtemp)).Ffree_fcn = (*TXML_Memory_Handling_Suite)(unsafe.Pointer(memsuite)).Ffree_fcn
- }
- } else {
- parser = libc.Xmalloc(tls, uint64(976))
- if parser != libc.UintptrFromInt32(0) {
- mtemp1 = parser + 24
- (*TXML_Memory_Handling_Suite)(unsafe.Pointer(mtemp1)).Fmalloc_fcn = __ccgo_fp(libc.Xmalloc)
- (*TXML_Memory_Handling_Suite)(unsafe.Pointer(mtemp1)).Frealloc_fcn = __ccgo_fp(libc.Xrealloc)
- (*TXML_Memory_Handling_Suite)(unsafe.Pointer(mtemp1)).Ffree_fcn = __ccgo_fp(libc.Xfree)
- }
- }
- if !(parser != 0) {
- return parser
- }
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_buffer = libc.UintptrFromInt32(0)
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_bufferLim = libc.UintptrFromInt32(0)
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_attsSize = int32(m_INIT_ATTS_SIZE)
- (*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))
- if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_atts == libc.UintptrFromInt32(0) {
- (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_mem.Ffree_fcn})))(tls, parser)
- return libc.UintptrFromInt32(0)
- }
- (*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))
- if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_dataBuf == libc.UintptrFromInt32(0) {
- (*(*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)
- (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_mem.Ffree_fcn})))(tls, parser)
- return libc.UintptrFromInt32(0)
- }
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_dataBufEnd = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_dataBuf + uintptr(m_INIT_DATA_BUF_SIZE)
- if dtd != 0 {
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_dtd = dtd
- } else {
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_dtd = _dtdCreate(tls, parser+24)
- if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_dtd == libc.UintptrFromInt32(0) {
- (*(*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)
- (*(*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)
- (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_mem.Ffree_fcn})))(tls, parser)
- return libc.UintptrFromInt32(0)
- }
- }
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_freeBindingList = libc.UintptrFromInt32(0)
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_freeTagList = libc.UintptrFromInt32(0)
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_freeInternalEntities = libc.UintptrFromInt32(0)
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_groupSize = uint32(0)
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_groupConnector = libc.UintptrFromInt32(0)
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_unknownEncodingHandler = libc.UintptrFromInt32(0)
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_unknownEncodingHandlerData = libc.UintptrFromInt32(0)
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_namespaceSeparator = int8(m_ASCII_EXCL)
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_ns = libc.Uint8FromInt32(0)
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_ns_triplets = libc.Uint8FromInt32(0)
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_nsAtts = libc.UintptrFromInt32(0)
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_nsAttsVersion = uint64(0)
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_nsAttsPower = uint8(0)
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_protocolEncodingName = libc.UintptrFromInt32(0)
- _poolInit(tls, parser+784, parser+24)
- _poolInit(tls, parser+832, parser+24)
- _parserInit(tls, parser, encodingName)
- if encodingName != 0 && !((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_protocolEncodingName != 0) {
- if dtd != 0 {
- // We need to stop the upcoming call to XML_ParserFree from happily
- // destroying parser->m_dtd because the DTD is shared with the parent
- // parser and the only guard that keeps XML_ParserFree from destroying
- // parser->m_dtd is parser->m_isParamEntity but it will be set to
- // XML_TRUE only later in XML_ExternalEntityParserCreate (or not at all).
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_dtd = libc.UintptrFromInt32(0)
- }
- XXML_ParserFree(tls, parser)
- return libc.UintptrFromInt32(0)
- }
- if nameSep != 0 {
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_ns = libc.Uint8FromInt32(1)
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_internalEncoding = XXmlGetUtf8InternalEncodingNS(tls)
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_namespaceSeparator = *(*TXML_Char)(unsafe.Pointer(nameSep))
- } else {
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_internalEncoding = XXmlGetUtf8InternalEncoding(tls)
- }
- return parser
- }
- func _parserInit(tls *libc.TLS, parser TXML_Parser, encodingName uintptr) {
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_processor = __ccgo_fp(_prologInitProcessor)
- XXmlPrologStateInit(tls, parser+496)
- if encodingName != libc.UintptrFromInt32(0) {
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_protocolEncodingName = _copyString(tls, encodingName, parser+24)
- }
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_curBase = libc.UintptrFromInt32(0)
- XXmlInitEncoding(tls, parser+296, parser+288, uintptr(0))
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_userData = libc.UintptrFromInt32(0)
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_handlerArg = libc.UintptrFromInt32(0)
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_startElementHandler = libc.UintptrFromInt32(0)
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_endElementHandler = libc.UintptrFromInt32(0)
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_characterDataHandler = libc.UintptrFromInt32(0)
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_processingInstructionHandler = libc.UintptrFromInt32(0)
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_commentHandler = libc.UintptrFromInt32(0)
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_startCdataSectionHandler = libc.UintptrFromInt32(0)
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_endCdataSectionHandler = libc.UintptrFromInt32(0)
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_defaultHandler = libc.UintptrFromInt32(0)
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_startDoctypeDeclHandler = libc.UintptrFromInt32(0)
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_endDoctypeDeclHandler = libc.UintptrFromInt32(0)
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_unparsedEntityDeclHandler = libc.UintptrFromInt32(0)
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_notationDeclHandler = libc.UintptrFromInt32(0)
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_startNamespaceDeclHandler = libc.UintptrFromInt32(0)
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_endNamespaceDeclHandler = libc.UintptrFromInt32(0)
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_notStandaloneHandler = libc.UintptrFromInt32(0)
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_externalEntityRefHandler = libc.UintptrFromInt32(0)
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_externalEntityRefHandlerArg = parser
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_skippedEntityHandler = libc.UintptrFromInt32(0)
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_elementDeclHandler = libc.UintptrFromInt32(0)
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_attlistDeclHandler = libc.UintptrFromInt32(0)
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_entityDeclHandler = libc.UintptrFromInt32(0)
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_xmlDeclHandler = libc.UintptrFromInt32(0)
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_bufferPtr = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_buffer
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_bufferEnd = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_buffer
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parseEndByteIndex = 0
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parseEndPtr = libc.UintptrFromInt32(0)
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declElementType = libc.UintptrFromInt32(0)
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declAttributeId = libc.UintptrFromInt32(0)
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declEntity = libc.UintptrFromInt32(0)
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_doctypeName = libc.UintptrFromInt32(0)
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_doctypeSysid = libc.UintptrFromInt32(0)
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_doctypePubid = libc.UintptrFromInt32(0)
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declAttributeType = libc.UintptrFromInt32(0)
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declNotationName = libc.UintptrFromInt32(0)
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declNotationPublicId = libc.UintptrFromInt32(0)
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declAttributeIsCdata = libc.Uint8FromInt32(0)
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declAttributeIsId = libc.Uint8FromInt32(0)
- libc.Xmemset(tls, parser+768, 0, uint64(16))
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_errorCode = int32(_XML_ERROR_NONE)
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_eventPtr = libc.UintptrFromInt32(0)
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_eventEndPtr = libc.UintptrFromInt32(0)
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_positionPtr = libc.UintptrFromInt32(0)
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_openInternalEntities = libc.UintptrFromInt32(0)
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_defaultExpandInternalEntities = libc.Uint8FromInt32(1)
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_tagLevel = 0
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_tagStack = libc.UintptrFromInt32(0)
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_inheritedBindings = libc.UintptrFromInt32(0)
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_nSpecifiedAtts = 0
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_unknownEncodingMem = libc.UintptrFromInt32(0)
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_unknownEncodingRelease = libc.UintptrFromInt32(0)
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_unknownEncodingData = libc.UintptrFromInt32(0)
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parentParser = libc.UintptrFromInt32(0)
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parsingStatus.Fparsing = int32(_XML_INITIALIZED)
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_isParamEntity = libc.Uint8FromInt32(0)
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_useForeignDTD = libc.Uint8FromInt32(0)
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_paramEntityParsing = int32(_XML_PARAM_ENTITY_PARSING_NEVER)
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_hash_secret_salt = uint64(0)
- libc.Xmemset(tls, parser+928, 0, uint64(32))
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_accounting.FdebugLevel = libc.Int32FromUint64(_getDebugLevel(tls, __ccgo_ts+96, 0))
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_accounting.FmaximumAmplificationFactor = libc.Float32FromFloat32(100)
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_accounting.FactivationThresholdBytes = uint64(m_EXPAT_BILLION_LAUGHS_ATTACK_PROTECTION_ACTIVATION_THRESHOLD_DEFAULT)
- libc.Xmemset(tls, parser+960, 0, uint64(16))
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_entity_stats.FdebugLevel = libc.Int32FromUint64(_getDebugLevel(tls, __ccgo_ts+119, 0))
- }
- // C documentation
- //
- // /* moves list of bindings to m_freeBindingList */
- func _moveToFreeBindingList(tls *libc.TLS, parser TXML_Parser, bindings uintptr) {
- var b uintptr
- _ = b
- for bindings != 0 {
- b = bindings
- bindings = (*TBINDING)(unsafe.Pointer(bindings)).FnextTagBinding
- (*TBINDING)(unsafe.Pointer(b)).FnextTagBinding = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_freeBindingList
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_freeBindingList = b
- }
- }
- func XXML_ParserReset(tls *libc.TLS, parser TXML_Parser, encodingName uintptr) (r TXML_Bool) {
- var openEntity, openEntityList, tStk, tag uintptr
- _, _, _, _ = openEntity, openEntityList, tStk, tag
- if parser == libc.UintptrFromInt32(0) {
- return libc.Uint8FromInt32(0)
- }
- if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parentParser != 0 {
- return libc.Uint8FromInt32(0)
- }
- /* move m_tagStack to m_freeTagList */
- tStk = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_tagStack
- for tStk != 0 {
- tag = tStk
- tStk = (*TTAG)(unsafe.Pointer(tStk)).Fparent
- (*TTAG)(unsafe.Pointer(tag)).Fparent = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_freeTagList
- _moveToFreeBindingList(tls, parser, (*TTAG)(unsafe.Pointer(tag)).Fbindings)
- (*TTAG)(unsafe.Pointer(tag)).Fbindings = libc.UintptrFromInt32(0)
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_freeTagList = tag
- }
- /* move m_openInternalEntities to m_freeInternalEntities */
- openEntityList = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_openInternalEntities
- for openEntityList != 0 {
- openEntity = openEntityList
- openEntityList = (*TOPEN_INTERNAL_ENTITY)(unsafe.Pointer(openEntity)).Fnext
- (*TOPEN_INTERNAL_ENTITY)(unsafe.Pointer(openEntity)).Fnext = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_freeInternalEntities
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_freeInternalEntities = openEntity
- }
- _moveToFreeBindingList(tls, parser, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_inheritedBindings)
- (*(*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)
- if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_unknownEncodingRelease != 0 {
- (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_unknownEncodingRelease})))(tls, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_unknownEncodingData)
- }
- _poolClear(tls, parser+784)
- _poolClear(tls, parser+832)
- (*(*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)
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_protocolEncodingName = libc.UintptrFromInt32(0)
- _parserInit(tls, parser, encodingName)
- _dtdReset(tls, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_dtd, parser+24)
- return libc.Uint8FromInt32(1)
- }
- func XXML_SetEncoding(tls *libc.TLS, parser TXML_Parser, encodingName uintptr) (r _XML_Status) {
- if parser == libc.UintptrFromInt32(0) {
- return int32(_XML_STATUS_ERROR)
- }
- /* Block after XML_Parse()/XML_ParseBuffer() has been called.
- XXX There's no way for the caller to determine which of the
- XXX possible error cases caused the XML_STATUS_ERROR return.
- */
- if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parsingStatus.Fparsing == int32(_XML_PARSING) || (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parsingStatus.Fparsing == int32(_XML_SUSPENDED) {
- return int32(_XML_STATUS_ERROR)
- }
- /* Get rid of any previous encoding name */
- (*(*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)
- if encodingName == libc.UintptrFromInt32(0) {
- /* No new encoding name */
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_protocolEncodingName = libc.UintptrFromInt32(0)
- } else {
- /* Copy the new encoding name into allocated memory */
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_protocolEncodingName = _copyString(tls, encodingName, parser+24)
- if !((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_protocolEncodingName != 0) {
- return int32(_XML_STATUS_ERROR)
- }
- }
- return int32(_XML_STATUS_OK)
- }
- func XXML_ExternalEntityParserCreate(tls *libc.TLS, oldParser TXML_Parser, context uintptr, encodingName uintptr) (r TXML_Parser) {
- bp := tls.Alloc(16)
- defer tls.Free(16)
- var newDtd, oldDeclElementType, oldDtd, oldHandlerArg, oldUserData uintptr
- var oldAttlistDeclHandler TXML_AttlistDeclHandler
- var oldCharacterDataHandler TXML_CharacterDataHandler
- var oldCommentHandler TXML_CommentHandler
- var oldDefaultExpandInternalEntities, oldns_triplets TXML_Bool
- var oldDefaultHandler TXML_DefaultHandler
- var oldElementDeclHandler TXML_ElementDeclHandler
- var oldEndCdataSectionHandler TXML_EndCdataSectionHandler
- var oldEndElementHandler TXML_EndElementHandler
- var oldEndNamespaceDeclHandler TXML_EndNamespaceDeclHandler
- var oldEntityDeclHandler TXML_EntityDeclHandler
- var oldExternalEntityRefHandler TXML_ExternalEntityRefHandler
- var oldExternalEntityRefHandlerArg, parser TXML_Parser
- var oldInEntityValue int32
- var oldNotStandaloneHandler TXML_NotStandaloneHandler
- var oldNotationDeclHandler TXML_NotationDeclHandler
- var oldParamEntityParsing _XML_ParamEntityParsing
- var oldProcessingInstructionHandler TXML_ProcessingInstructionHandler
- var oldSkippedEntityHandler TXML_SkippedEntityHandler
- var oldStartCdataSectionHandler TXML_StartCdataSectionHandler
- var oldStartElementHandler TXML_StartElementHandler
- var oldStartNamespaceDeclHandler TXML_StartNamespaceDeclHandler
- var oldUnknownEncodingHandler TXML_UnknownEncodingHandler
- var oldUnparsedEntityDeclHandler TXML_UnparsedEntityDeclHandler
- var oldXmlDeclHandler TXML_XmlDeclHandler
- var oldhash_secret_salt uint64
- var _ /* tmp at bp+0 */ [2]TXML_Char
- _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = 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
- parser = oldParser
- newDtd = libc.UintptrFromInt32(0)
- /* Validate the oldParser parameter before we pull everything out of it */
- if oldParser == libc.UintptrFromInt32(0) {
- return libc.UintptrFromInt32(0)
- }
- /* Stash the original parser contents on the stack */
- oldDtd = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_dtd
- oldStartElementHandler = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_startElementHandler
- oldEndElementHandler = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_endElementHandler
- oldCharacterDataHandler = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_characterDataHandler
- oldProcessingInstructionHandler = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_processingInstructionHandler
- oldCommentHandler = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_commentHandler
- oldStartCdataSectionHandler = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_startCdataSectionHandler
- oldEndCdataSectionHandler = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_endCdataSectionHandler
- oldDefaultHandler = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_defaultHandler
- oldUnparsedEntityDeclHandler = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_unparsedEntityDeclHandler
- oldNotationDeclHandler = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_notationDeclHandler
- oldStartNamespaceDeclHandler = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_startNamespaceDeclHandler
- oldEndNamespaceDeclHandler = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_endNamespaceDeclHandler
- oldNotStandaloneHandler = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_notStandaloneHandler
- oldExternalEntityRefHandler = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_externalEntityRefHandler
- oldSkippedEntityHandler = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_skippedEntityHandler
- oldUnknownEncodingHandler = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_unknownEncodingHandler
- oldElementDeclHandler = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_elementDeclHandler
- oldAttlistDeclHandler = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_attlistDeclHandler
- oldEntityDeclHandler = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_entityDeclHandler
- oldXmlDeclHandler = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_xmlDeclHandler
- oldDeclElementType = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declElementType
- oldUserData = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_userData
- oldHandlerArg = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_handlerArg
- oldDefaultExpandInternalEntities = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_defaultExpandInternalEntities
- oldExternalEntityRefHandlerArg = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_externalEntityRefHandlerArg
- oldParamEntityParsing = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_paramEntityParsing
- oldInEntityValue = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_prologState.FinEntityValue
- oldns_triplets = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_ns_triplets
- /* Note that the new parser shares the same hash secret as the old
- parser, so that dtdCopy and copyEntityTable can lookup values
- from hash tables associated with either parser without us having
- to worry which hash secrets each table has.
- */
- oldhash_secret_salt = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_hash_secret_salt
- if !(context != 0) {
- newDtd = oldDtd
- }
- /* Note that the magical uses of the pre-processor to make field
- access look more like C++ require that `parser' be overwritten
- here. This makes this function more painful to follow than it
- would be otherwise.
- */
- if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_ns != 0 {
- *(*[2]TXML_Char)(unsafe.Pointer(bp)) = [2]TXML_Char{
- 0: (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_namespaceSeparator,
- }
- parser = _parserCreate(tls, encodingName, parser+24, bp, newDtd)
- } else {
- parser = _parserCreate(tls, encodingName, parser+24, libc.UintptrFromInt32(0), newDtd)
- }
- if !(parser != 0) {
- return libc.UintptrFromInt32(0)
- }
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_startElementHandler = oldStartElementHandler
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_endElementHandler = oldEndElementHandler
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_characterDataHandler = oldCharacterDataHandler
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_processingInstructionHandler = oldProcessingInstructionHandler
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_commentHandler = oldCommentHandler
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_startCdataSectionHandler = oldStartCdataSectionHandler
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_endCdataSectionHandler = oldEndCdataSectionHandler
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_defaultHandler = oldDefaultHandler
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_unparsedEntityDeclHandler = oldUnparsedEntityDeclHandler
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_notationDeclHandler = oldNotationDeclHandler
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_startNamespaceDeclHandler = oldStartNamespaceDeclHandler
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_endNamespaceDeclHandler = oldEndNamespaceDeclHandler
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_notStandaloneHandler = oldNotStandaloneHandler
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_externalEntityRefHandler = oldExternalEntityRefHandler
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_skippedEntityHandler = oldSkippedEntityHandler
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_unknownEncodingHandler = oldUnknownEncodingHandler
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_elementDeclHandler = oldElementDeclHandler
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_attlistDeclHandler = oldAttlistDeclHandler
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_entityDeclHandler = oldEntityDeclHandler
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_xmlDeclHandler = oldXmlDeclHandler
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declElementType = oldDeclElementType
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_userData = oldUserData
- if oldUserData == oldHandlerArg {
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_handlerArg = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_userData
- } else {
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_handlerArg = parser
- }
- if oldExternalEntityRefHandlerArg != oldParser {
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_externalEntityRefHandlerArg = oldExternalEntityRefHandlerArg
- }
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_defaultExpandInternalEntities = oldDefaultExpandInternalEntities
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_ns_triplets = oldns_triplets
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_hash_secret_salt = oldhash_secret_salt
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parentParser = oldParser
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_paramEntityParsing = oldParamEntityParsing
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_prologState.FinEntityValue = oldInEntityValue
- if context != 0 {
- if !(_dtdCopy(tls, oldParser, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_dtd, oldDtd, parser+24) != 0) || !(_setContext(tls, parser, context) != 0) {
- XXML_ParserFree(tls, parser)
- return libc.UintptrFromInt32(0)
- }
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_processor = __ccgo_fp(_externalEntityInitProcessor)
- } else {
- /* The DTD instance referenced by parser->m_dtd is shared between the
- document's root parser and external PE parsers, therefore one does not
- need to call setContext. In addition, one also *must* not call
- setContext, because this would overwrite existing prefix->binding
- pointers in parser->m_dtd with ones that get destroyed with the external
- PE parser. This would leave those prefixes with dangling pointers.
- */
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_isParamEntity = libc.Uint8FromInt32(1)
- XXmlPrologStateInitExternalEntity(tls, parser+496)
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_processor = __ccgo_fp(_externalParEntInitProcessor)
- }
- return parser
- }
- func _destroyBindings(tls *libc.TLS, bindings uintptr, parser TXML_Parser) {
- var b uintptr
- _ = b
- for {
- b = bindings
- if !(b != 0) {
- break
- }
- bindings = (*TBINDING)(unsafe.Pointer(b)).FnextTagBinding
- (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_mem.Ffree_fcn})))(tls, (*TBINDING)(unsafe.Pointer(b)).Furi)
- (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_mem.Ffree_fcn})))(tls, b)
- goto _1
- _1:
- }
- }
- func XXML_ParserFree(tls *libc.TLS, parser TXML_Parser) {
- var entityList, openEntity, p, tagList uintptr
- _, _, _, _ = entityList, openEntity, p, tagList
- if parser == libc.UintptrFromInt32(0) {
- return
- }
- /* free m_tagStack and m_freeTagList */
- tagList = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_tagStack
- for {
- if tagList == libc.UintptrFromInt32(0) {
- if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_freeTagList == libc.UintptrFromInt32(0) {
- break
- }
- tagList = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_freeTagList
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_freeTagList = libc.UintptrFromInt32(0)
- }
- p = tagList
- tagList = (*TTAG)(unsafe.Pointer(tagList)).Fparent
- (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_mem.Ffree_fcn})))(tls, (*TTAG)(unsafe.Pointer(p)).Fbuf)
- _destroyBindings(tls, (*TTAG)(unsafe.Pointer(p)).Fbindings, parser)
- (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_mem.Ffree_fcn})))(tls, p)
- goto _1
- _1:
- }
- /* free m_openInternalEntities and m_freeInternalEntities */
- entityList = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_openInternalEntities
- for {
- if entityList == libc.UintptrFromInt32(0) {
- if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_freeInternalEntities == libc.UintptrFromInt32(0) {
- break
- }
- entityList = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_freeInternalEntities
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_freeInternalEntities = libc.UintptrFromInt32(0)
- }
- openEntity = entityList
- entityList = (*TOPEN_INTERNAL_ENTITY)(unsafe.Pointer(entityList)).Fnext
- (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_mem.Ffree_fcn})))(tls, openEntity)
- goto _2
- _2:
- }
- _destroyBindings(tls, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_freeBindingList, parser)
- _destroyBindings(tls, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_inheritedBindings, parser)
- _poolDestroy(tls, parser+784)
- _poolDestroy(tls, parser+832)
- (*(*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)
- /* external parameter entity parsers share the DTD structure
- parser->m_dtd with the root parser, so we must not destroy it
- */
- if !((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_isParamEntity != 0) && (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_dtd != 0 {
- _dtdDestroy(tls, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_dtd, libc.BoolUint8(!((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parentParser != 0)), parser+24)
- }
- (*(*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)
- (*(*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)
- (*(*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)
- (*(*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)
- (*(*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)
- (*(*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)
- if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_unknownEncodingRelease != 0 {
- (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_unknownEncodingRelease})))(tls, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_unknownEncodingData)
- }
- (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_mem.Ffree_fcn})))(tls, parser)
- }
- func XXML_UseParserAsHandlerArg(tls *libc.TLS, parser TXML_Parser) {
- if parser != libc.UintptrFromInt32(0) {
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_handlerArg = parser
- }
- }
- func XXML_UseForeignDTD(tls *libc.TLS, parser TXML_Parser, useDTD TXML_Bool) (r _XML_Error) {
- if parser == libc.UintptrFromInt32(0) {
- return int32(_XML_ERROR_INVALID_ARGUMENT)
- }
- /* block after XML_Parse()/XML_ParseBuffer() has been called */
- if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parsingStatus.Fparsing == int32(_XML_PARSING) || (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parsingStatus.Fparsing == int32(_XML_SUSPENDED) {
- return int32(_XML_ERROR_CANT_CHANGE_FEATURE_ONCE_PARSING)
- }
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_useForeignDTD = useDTD
- return int32(_XML_ERROR_NONE)
- }
- func XXML_SetReturnNSTriplet(tls *libc.TLS, parser TXML_Parser, do_nst int32) {
- var v1 int32
- _ = v1
- if parser == libc.UintptrFromInt32(0) {
- return
- }
- /* block after XML_Parse()/XML_ParseBuffer() has been called */
- if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parsingStatus.Fparsing == int32(_XML_PARSING) || (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parsingStatus.Fparsing == int32(_XML_SUSPENDED) {
- return
- }
- if do_nst != 0 {
- v1 = libc.Int32FromUint8(libc.Uint8FromInt32(1))
- } else {
- v1 = libc.Int32FromUint8(libc.Uint8FromInt32(0))
- }
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_ns_triplets = libc.Uint8FromInt32(v1)
- }
- func XXML_SetUserData(tls *libc.TLS, parser TXML_Parser, p uintptr) {
- var v1 uintptr
- _ = v1
- if parser == libc.UintptrFromInt32(0) {
- return
- }
- if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_handlerArg == (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_userData {
- v1 = p
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_userData = v1
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_handlerArg = v1
- } else {
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_userData = p
- }
- }
- func XXML_SetBase(tls *libc.TLS, parser TXML_Parser, p uintptr) (r _XML_Status) {
- if parser == libc.UintptrFromInt32(0) {
- return int32(_XML_STATUS_ERROR)
- }
- if p != 0 {
- p = _poolCopyString(tls, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_dtd+160, p)
- if !(p != 0) {
- return int32(_XML_STATUS_ERROR)
- }
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_curBase = p
- } else {
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_curBase = libc.UintptrFromInt32(0)
- }
- return int32(_XML_STATUS_OK)
- }
- func XXML_GetBase(tls *libc.TLS, parser TXML_Parser) (r uintptr) {
- if parser == libc.UintptrFromInt32(0) {
- return libc.UintptrFromInt32(0)
- }
- return (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_curBase
- }
- func XXML_GetSpecifiedAttributeCount(tls *libc.TLS, parser TXML_Parser) (r int32) {
- if parser == libc.UintptrFromInt32(0) {
- return -int32(1)
- }
- return (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_nSpecifiedAtts
- }
- func XXML_GetIdAttributeIndex(tls *libc.TLS, parser TXML_Parser) (r int32) {
- if parser == libc.UintptrFromInt32(0) {
- return -int32(1)
- }
- return (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_idAttIndex
- }
- func XXML_SetElementHandler(tls *libc.TLS, parser TXML_Parser, start TXML_StartElementHandler, end TXML_EndElementHandler) {
- if parser == libc.UintptrFromInt32(0) {
- return
- }
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_startElementHandler = start
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_endElementHandler = end
- }
- func XXML_SetStartElementHandler(tls *libc.TLS, parser TXML_Parser, start TXML_StartElementHandler) {
- if parser != libc.UintptrFromInt32(0) {
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_startElementHandler = start
- }
- }
- func XXML_SetEndElementHandler(tls *libc.TLS, parser TXML_Parser, end TXML_EndElementHandler) {
- if parser != libc.UintptrFromInt32(0) {
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_endElementHandler = end
- }
- }
- func XXML_SetCharacterDataHandler(tls *libc.TLS, parser TXML_Parser, handler TXML_CharacterDataHandler) {
- if parser != libc.UintptrFromInt32(0) {
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_characterDataHandler = handler
- }
- }
- func XXML_SetProcessingInstructionHandler(tls *libc.TLS, parser TXML_Parser, handler TXML_ProcessingInstructionHandler) {
- if parser != libc.UintptrFromInt32(0) {
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_processingInstructionHandler = handler
- }
- }
- func XXML_SetCommentHandler(tls *libc.TLS, parser TXML_Parser, handler TXML_CommentHandler) {
- if parser != libc.UintptrFromInt32(0) {
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_commentHandler = handler
- }
- }
- func XXML_SetCdataSectionHandler(tls *libc.TLS, parser TXML_Parser, start TXML_StartCdataSectionHandler, end TXML_EndCdataSectionHandler) {
- if parser == libc.UintptrFromInt32(0) {
- return
- }
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_startCdataSectionHandler = start
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_endCdataSectionHandler = end
- }
- func XXML_SetStartCdataSectionHandler(tls *libc.TLS, parser TXML_Parser, start TXML_StartCdataSectionHandler) {
- if parser != libc.UintptrFromInt32(0) {
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_startCdataSectionHandler = start
- }
- }
- func XXML_SetEndCdataSectionHandler(tls *libc.TLS, parser TXML_Parser, end TXML_EndCdataSectionHandler) {
- if parser != libc.UintptrFromInt32(0) {
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_endCdataSectionHandler = end
- }
- }
- func XXML_SetDefaultHandler(tls *libc.TLS, parser TXML_Parser, handler TXML_DefaultHandler) {
- if parser == libc.UintptrFromInt32(0) {
- return
- }
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_defaultHandler = handler
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_defaultExpandInternalEntities = libc.Uint8FromInt32(0)
- }
- func XXML_SetDefaultHandlerExpand(tls *libc.TLS, parser TXML_Parser, handler TXML_DefaultHandler) {
- if parser == libc.UintptrFromInt32(0) {
- return
- }
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_defaultHandler = handler
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_defaultExpandInternalEntities = libc.Uint8FromInt32(1)
- }
- func XXML_SetDoctypeDeclHandler(tls *libc.TLS, parser TXML_Parser, start TXML_StartDoctypeDeclHandler, end TXML_EndDoctypeDeclHandler) {
- if parser == libc.UintptrFromInt32(0) {
- return
- }
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_startDoctypeDeclHandler = start
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_endDoctypeDeclHandler = end
- }
- func XXML_SetStartDoctypeDeclHandler(tls *libc.TLS, parser TXML_Parser, start TXML_StartDoctypeDeclHandler) {
- if parser != libc.UintptrFromInt32(0) {
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_startDoctypeDeclHandler = start
- }
- }
- func XXML_SetEndDoctypeDeclHandler(tls *libc.TLS, parser TXML_Parser, end TXML_EndDoctypeDeclHandler) {
- if parser != libc.UintptrFromInt32(0) {
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_endDoctypeDeclHandler = end
- }
- }
- func XXML_SetUnparsedEntityDeclHandler(tls *libc.TLS, parser TXML_Parser, handler TXML_UnparsedEntityDeclHandler) {
- if parser != libc.UintptrFromInt32(0) {
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_unparsedEntityDeclHandler = handler
- }
- }
- func XXML_SetNotationDeclHandler(tls *libc.TLS, parser TXML_Parser, handler TXML_NotationDeclHandler) {
- if parser != libc.UintptrFromInt32(0) {
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_notationDeclHandler = handler
- }
- }
- func XXML_SetNamespaceDeclHandler(tls *libc.TLS, parser TXML_Parser, start TXML_StartNamespaceDeclHandler, end TXML_EndNamespaceDeclHandler) {
- if parser == libc.UintptrFromInt32(0) {
- return
- }
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_startNamespaceDeclHandler = start
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_endNamespaceDeclHandler = end
- }
- func XXML_SetStartNamespaceDeclHandler(tls *libc.TLS, parser TXML_Parser, start TXML_StartNamespaceDeclHandler) {
- if parser != libc.UintptrFromInt32(0) {
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_startNamespaceDeclHandler = start
- }
- }
- func XXML_SetEndNamespaceDeclHandler(tls *libc.TLS, parser TXML_Parser, end TXML_EndNamespaceDeclHandler) {
- if parser != libc.UintptrFromInt32(0) {
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_endNamespaceDeclHandler = end
- }
- }
- func XXML_SetNotStandaloneHandler(tls *libc.TLS, parser TXML_Parser, handler TXML_NotStandaloneHandler) {
- if parser != libc.UintptrFromInt32(0) {
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_notStandaloneHandler = handler
- }
- }
- func XXML_SetExternalEntityRefHandler(tls *libc.TLS, parser TXML_Parser, handler TXML_ExternalEntityRefHandler) {
- if parser != libc.UintptrFromInt32(0) {
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_externalEntityRefHandler = handler
- }
- }
- func XXML_SetExternalEntityRefHandlerArg(tls *libc.TLS, parser TXML_Parser, arg uintptr) {
- if parser == libc.UintptrFromInt32(0) {
- return
- }
- if arg != 0 {
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_externalEntityRefHandlerArg = arg
- } else {
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_externalEntityRefHandlerArg = parser
- }
- }
- func XXML_SetSkippedEntityHandler(tls *libc.TLS, parser TXML_Parser, handler TXML_SkippedEntityHandler) {
- if parser != libc.UintptrFromInt32(0) {
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_skippedEntityHandler = handler
- }
- }
- func XXML_SetUnknownEncodingHandler(tls *libc.TLS, parser TXML_Parser, handler TXML_UnknownEncodingHandler, data uintptr) {
- if parser == libc.UintptrFromInt32(0) {
- return
- }
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_unknownEncodingHandler = handler
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_unknownEncodingHandlerData = data
- }
- func XXML_SetElementDeclHandler(tls *libc.TLS, parser TXML_Parser, eldecl TXML_ElementDeclHandler) {
- if parser != libc.UintptrFromInt32(0) {
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_elementDeclHandler = eldecl
- }
- }
- func XXML_SetAttlistDeclHandler(tls *libc.TLS, parser TXML_Parser, attdecl TXML_AttlistDeclHandler) {
- if parser != libc.UintptrFromInt32(0) {
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_attlistDeclHandler = attdecl
- }
- }
- func XXML_SetEntityDeclHandler(tls *libc.TLS, parser TXML_Parser, handler TXML_EntityDeclHandler) {
- if parser != libc.UintptrFromInt32(0) {
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_entityDeclHandler = handler
- }
- }
- func XXML_SetXmlDeclHandler(tls *libc.TLS, parser TXML_Parser, handler TXML_XmlDeclHandler) {
- if parser != libc.UintptrFromInt32(0) {
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_xmlDeclHandler = handler
- }
- }
- func XXML_SetParamEntityParsing(tls *libc.TLS, parser TXML_Parser, peParsing _XML_ParamEntityParsing) (r int32) {
- if parser == libc.UintptrFromInt32(0) {
- return 0
- }
- /* block after XML_Parse()/XML_ParseBuffer() has been called */
- if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parsingStatus.Fparsing == int32(_XML_PARSING) || (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parsingStatus.Fparsing == int32(_XML_SUSPENDED) {
- return 0
- }
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_paramEntityParsing = peParsing
- return int32(1)
- }
- func XXML_SetHashSalt(tls *libc.TLS, parser TXML_Parser, hash_salt uint64) (r int32) {
- if parser == libc.UintptrFromInt32(0) {
- return 0
- }
- if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parentParser != 0 {
- return XXML_SetHashSalt(tls, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parentParser, hash_salt)
- }
- /* block after XML_Parse()/XML_ParseBuffer() has been called */
- if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parsingStatus.Fparsing == int32(_XML_PARSING) || (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parsingStatus.Fparsing == int32(_XML_SUSPENDED) {
- return 0
- }
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_hash_secret_salt = hash_salt
- return int32(1)
- }
- func XXML_Parse(tls *libc.TLS, parser TXML_Parser, s uintptr, len1 int32, isFinal int32) (r _XML_Status) {
- var buff uintptr
- _ = buff
- if parser == libc.UintptrFromInt32(0) || len1 < 0 || s == libc.UintptrFromInt32(0) && len1 != 0 {
- if parser != libc.UintptrFromInt32(0) {
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_errorCode = int32(_XML_ERROR_INVALID_ARGUMENT)
- }
- return int32(_XML_STATUS_ERROR)
- }
- switch (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parsingStatus.Fparsing {
- case int32(_XML_SUSPENDED):
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_errorCode = int32(_XML_ERROR_SUSPENDED)
- return int32(_XML_STATUS_ERROR)
- case int32(_XML_FINISHED):
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_errorCode = int32(_XML_ERROR_FINISHED)
- return int32(_XML_STATUS_ERROR)
- case int32(_XML_INITIALIZED):
- if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parentParser == libc.UintptrFromInt32(0) && !(_startParsing(tls, parser) != 0) {
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_errorCode = int32(_XML_ERROR_NO_MEMORY)
- return int32(_XML_STATUS_ERROR)
- }
- /* fall through */
- fallthrough
- default:
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parsingStatus.Fparsing = int32(_XML_PARSING)
- }
- if len1 == 0 {
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parsingStatus.FfinalBuffer = libc.Uint8FromInt32(isFinal)
- if !(isFinal != 0) {
- return int32(_XML_STATUS_OK)
- }
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_positionPtr = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_bufferPtr
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parseEndPtr = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_bufferEnd
- /* If data are left over from last buffer, and we now know that these
- data are the final chunk of input, then we have to check them again
- to detect errors based on that fact.
- */
- (*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)
- if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_errorCode == int32(_XML_ERROR_NONE) {
- switch (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parsingStatus.Fparsing {
- case int32(_XML_SUSPENDED):
- /* It is hard to be certain, but it seems that this case
- * cannot occur. This code is cleaning up a previous parse
- * with no new data (since len == 0). Changing the parsing
- * state requires getting to execute a handler function, and
- * there doesn't seem to be an opportunity for that while in
- * this circumstance.
- *
- * Given the uncertainty, we retain the code but exclude it
- * from coverage tests.
- *
- * LCOV_EXCL_START
- */
- (*(*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)
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_positionPtr = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_bufferPtr
- return int32(_XML_STATUS_SUSPENDED)
- /* LCOV_EXCL_STOP */
- fallthrough
- case int32(_XML_INITIALIZED):
- fallthrough
- case int32(_XML_PARSING):
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parsingStatus.Fparsing = int32(_XML_FINISHED)
- /* fall through */
- fallthrough
- default:
- return int32(_XML_STATUS_OK)
- }
- }
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_eventEndPtr = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_eventPtr
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_processor = __ccgo_fp(_errorProcessor)
- return int32(_XML_STATUS_ERROR)
- } else {
- buff = XXML_GetBuffer(tls, parser, len1)
- if buff == libc.UintptrFromInt32(0) {
- return int32(_XML_STATUS_ERROR)
- } else {
- libc.Xmemcpy(tls, buff, s, libc.Uint64FromInt32(len1))
- return XXML_ParseBuffer(tls, parser, len1, isFinal)
- }
- }
- return r
- }
- func XXML_ParseBuffer(tls *libc.TLS, parser TXML_Parser, len1 int32, isFinal int32) (r _XML_Status) {
- var result _XML_Status
- var start uintptr
- _, _ = result, start
- result = int32(_XML_STATUS_OK)
- if parser == libc.UintptrFromInt32(0) {
- return int32(_XML_STATUS_ERROR)
- }
- switch (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parsingStatus.Fparsing {
- case int32(_XML_SUSPENDED):
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_errorCode = int32(_XML_ERROR_SUSPENDED)
- return int32(_XML_STATUS_ERROR)
- case int32(_XML_FINISHED):
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_errorCode = int32(_XML_ERROR_FINISHED)
- return int32(_XML_STATUS_ERROR)
- case int32(_XML_INITIALIZED):
- /* Has someone called XML_GetBuffer successfully before? */
- if !((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_bufferPtr != 0) {
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_errorCode = int32(_XML_ERROR_NO_BUFFER)
- return int32(_XML_STATUS_ERROR)
- }
- if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parentParser == libc.UintptrFromInt32(0) && !(_startParsing(tls, parser) != 0) {
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_errorCode = int32(_XML_ERROR_NO_MEMORY)
- return int32(_XML_STATUS_ERROR)
- }
- /* fall through */
- fallthrough
- default:
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parsingStatus.Fparsing = int32(_XML_PARSING)
- }
- start = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_bufferPtr
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_positionPtr = start
- *(*uintptr)(unsafe.Pointer(parser + 56)) += uintptr(len1)
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parseEndPtr = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_bufferEnd
- *(*TXML_Index)(unsafe.Pointer(parser + 72)) += int64(len1)
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parsingStatus.FfinalBuffer = libc.Uint8FromInt32(isFinal)
- (*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)
- if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_errorCode != int32(_XML_ERROR_NONE) {
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_eventEndPtr = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_eventPtr
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_processor = __ccgo_fp(_errorProcessor)
- return int32(_XML_STATUS_ERROR)
- } else {
- switch (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parsingStatus.Fparsing {
- case int32(_XML_SUSPENDED):
- result = int32(_XML_STATUS_SUSPENDED)
- case int32(_XML_INITIALIZED):
- fallthrough
- case int32(_XML_PARSING):
- if isFinal != 0 {
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parsingStatus.Fparsing = int32(_XML_FINISHED)
- return result
- }
- fallthrough
- default: /* should not happen */
- }
- }
- (*(*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)
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_positionPtr = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_bufferPtr
- return result
- }
- func XXML_GetBuffer(tls *libc.TLS, parser TXML_Parser, len1 int32) (r uintptr) {
- var bufferSize, keep, neededSize, offset int32
- var newBuf, v10, v11 uintptr
- var v1, v2, v3, v4, v5, v6, v7, v8, v9 int64
- _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = bufferSize, keep, neededSize, newBuf, offset, v1, v10, v11, v2, v3, v4, v5, v6, v7, v8, v9
- if parser == libc.UintptrFromInt32(0) {
- return libc.UintptrFromInt32(0)
- }
- if len1 < 0 {
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_errorCode = int32(_XML_ERROR_NO_MEMORY)
- return libc.UintptrFromInt32(0)
- }
- switch (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parsingStatus.Fparsing {
- case int32(_XML_SUSPENDED):
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_errorCode = int32(_XML_ERROR_SUSPENDED)
- return libc.UintptrFromInt32(0)
- case int32(_XML_FINISHED):
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_errorCode = int32(_XML_ERROR_FINISHED)
- return libc.UintptrFromInt32(0)
- default:
- }
- if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_bufferLim != 0 && (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_bufferEnd != 0 {
- v1 = int64((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_bufferLim) - int64((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_bufferEnd)
- } else {
- v1 = 0
- }
- if int64(len1) > v1 {
- if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_bufferEnd != 0 && (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_bufferPtr != 0 {
- v2 = int64((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_bufferEnd) - int64((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_bufferPtr)
- } else {
- v2 = 0
- }
- /* Do not invoke signed arithmetic overflow: */
- neededSize = libc.Int32FromUint32(libc.Uint32FromInt32(len1) + libc.Uint32FromInt64(v2))
- if neededSize < 0 {
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_errorCode = int32(_XML_ERROR_NO_MEMORY)
- return libc.UintptrFromInt32(0)
- }
- if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_bufferPtr != 0 && (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_buffer != 0 {
- v3 = int64((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_bufferPtr) - int64((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_buffer)
- } else {
- v3 = 0
- }
- keep = int32(v3)
- if keep > int32(m_XML_CONTEXT_BYTES) {
- keep = int32(m_XML_CONTEXT_BYTES)
- }
- /* Detect and prevent integer overflow */
- if keep > int32(m_INT_MAX)-neededSize {
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_errorCode = int32(_XML_ERROR_NO_MEMORY)
- return libc.UintptrFromInt32(0)
- }
- neededSize += keep
- if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_bufferLim != 0 && (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_buffer != 0 {
- v4 = int64((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_bufferLim) - int64((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_buffer)
- } else {
- v4 = 0
- }
- if int64(neededSize) <= v4 {
- if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_bufferPtr != 0 && (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_buffer != 0 {
- v5 = int64((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_bufferPtr) - int64((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_buffer)
- } else {
- v5 = 0
- }
- if int64(keep) < v5 {
- if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_bufferPtr != 0 && (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_buffer != 0 {
- v6 = int64((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_bufferPtr) - int64((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_buffer)
- } else {
- v6 = 0
- }
- offset = int32(v6) - keep
- /* The buffer pointers cannot be NULL here; we have at least some bytes
- * in the buffer */
- libc.Xmemmove(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)))
- *(*uintptr)(unsafe.Pointer(parser + 56)) -= uintptr(offset)
- *(*uintptr)(unsafe.Pointer(parser + 48)) -= uintptr(offset)
- }
- } else {
- if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_bufferLim != 0 && (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_bufferPtr != 0 {
- v7 = int64((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_bufferLim) - int64((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_bufferPtr)
- } else {
- v7 = 0
- }
- bufferSize = int32(v7)
- if bufferSize == 0 {
- bufferSize = int32(m_INIT_BUFFER_SIZE)
- }
- for cond := true; cond; cond = bufferSize < neededSize && bufferSize > 0 {
- /* Do not invoke signed arithmetic overflow: */
- bufferSize = libc.Int32FromUint32(libc.Uint32FromUint32(2) * libc.Uint32FromInt32(bufferSize))
- }
- if bufferSize <= 0 {
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_errorCode = int32(_XML_ERROR_NO_MEMORY)
- return libc.UintptrFromInt32(0)
- }
- newBuf = (*(*func(*libc.TLS, Tsize_t) uintptr)(unsafe.Pointer(&struct{ uintptr }{(*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_mem.Fmalloc_fcn})))(tls, libc.Uint64FromInt32(bufferSize))
- if newBuf == uintptr(0) {
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_errorCode = int32(_XML_ERROR_NO_MEMORY)
- return libc.UintptrFromInt32(0)
- }
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_bufferLim = newBuf + uintptr(bufferSize)
- if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_bufferPtr != 0 {
- if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_bufferEnd != 0 && (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_bufferPtr != 0 {
- v8 = int64((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_bufferEnd) - int64((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_bufferPtr)
- } else {
- v8 = 0
- }
- libc.Xmemcpy(tls, newBuf, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_bufferPtr+uintptr(-keep), libc.Uint64FromInt64(v8+int64(keep)))
- (*(*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)
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_buffer = newBuf
- if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_bufferEnd != 0 && (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_bufferPtr != 0 {
- v9 = int64((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_bufferEnd) - int64((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_bufferPtr)
- } else {
- v9 = 0
- }
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_bufferEnd = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_buffer + uintptr(v9) + uintptr(keep)
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_bufferPtr = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_buffer + uintptr(keep)
- } else {
- /* This must be a brand new buffer with no data in it yet */
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_bufferEnd = newBuf
- v10 = newBuf
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_buffer = v10
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_bufferPtr = v10
- }
- }
- v11 = libc.UintptrFromInt32(0)
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_eventEndPtr = v11
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_eventPtr = v11
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_positionPtr = libc.UintptrFromInt32(0)
- }
- return (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_bufferEnd
- }
- func XXML_StopParser(tls *libc.TLS, parser TXML_Parser, resumable TXML_Bool) (r _XML_Status) {
- if parser == libc.UintptrFromInt32(0) {
- return int32(_XML_STATUS_ERROR)
- }
- switch (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parsingStatus.Fparsing {
- case int32(_XML_SUSPENDED):
- if resumable != 0 {
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_errorCode = int32(_XML_ERROR_SUSPENDED)
- return int32(_XML_STATUS_ERROR)
- }
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parsingStatus.Fparsing = int32(_XML_FINISHED)
- case int32(_XML_FINISHED):
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_errorCode = int32(_XML_ERROR_FINISHED)
- return int32(_XML_STATUS_ERROR)
- default:
- if resumable != 0 {
- if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_isParamEntity != 0 {
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_errorCode = int32(_XML_ERROR_SUSPEND_PE)
- return int32(_XML_STATUS_ERROR)
- }
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parsingStatus.Fparsing = int32(_XML_SUSPENDED)
- } else {
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parsingStatus.Fparsing = int32(_XML_FINISHED)
- }
- }
- return int32(_XML_STATUS_OK)
- }
- func XXML_ResumeParser(tls *libc.TLS, parser TXML_Parser) (r _XML_Status) {
- var result _XML_Status
- _ = result
- result = int32(_XML_STATUS_OK)
- if parser == libc.UintptrFromInt32(0) {
- return int32(_XML_STATUS_ERROR)
- }
- if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parsingStatus.Fparsing != int32(_XML_SUSPENDED) {
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_errorCode = int32(_XML_ERROR_NOT_SUSPENDED)
- return int32(_XML_STATUS_ERROR)
- }
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parsingStatus.Fparsing = int32(_XML_PARSING)
- (*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)
- if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_errorCode != int32(_XML_ERROR_NONE) {
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_eventEndPtr = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_eventPtr
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_processor = __ccgo_fp(_errorProcessor)
- return int32(_XML_STATUS_ERROR)
- } else {
- switch (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parsingStatus.Fparsing {
- case int32(_XML_SUSPENDED):
- result = int32(_XML_STATUS_SUSPENDED)
- case int32(_XML_INITIALIZED):
- fallthrough
- case int32(_XML_PARSING):
- if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parsingStatus.FfinalBuffer != 0 {
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parsingStatus.Fparsing = int32(_XML_FINISHED)
- return result
- }
- fallthrough
- default:
- }
- }
- (*(*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)
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_positionPtr = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_bufferPtr
- return result
- }
- func XXML_GetParsingStatus(tls *libc.TLS, parser TXML_Parser, status uintptr) {
- if parser == libc.UintptrFromInt32(0) {
- return
- }
- *(*TXML_ParsingStatus)(unsafe.Pointer(status)) = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parsingStatus
- }
- func XXML_GetErrorCode(tls *libc.TLS, parser TXML_Parser) (r _XML_Error) {
- if parser == libc.UintptrFromInt32(0) {
- return int32(_XML_ERROR_INVALID_ARGUMENT)
- }
- return (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_errorCode
- }
- func XXML_GetCurrentByteIndex(tls *libc.TLS, parser TXML_Parser) (r TXML_Index) {
- if parser == libc.UintptrFromInt32(0) {
- return int64(-int32(1))
- }
- if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_eventPtr != 0 {
- return (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parseEndByteIndex - (int64((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parseEndPtr) - int64((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_eventPtr))
- }
- return int64(-int32(1))
- }
- func XXML_GetCurrentByteCount(tls *libc.TLS, parser TXML_Parser) (r int32) {
- if parser == libc.UintptrFromInt32(0) {
- return 0
- }
- if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_eventEndPtr != 0 && (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_eventPtr != 0 {
- return int32(int64((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_eventEndPtr) - int64((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_eventPtr))
- }
- return 0
- }
- func XXML_GetInputContext(tls *libc.TLS, parser TXML_Parser, offset uintptr, size uintptr) (r uintptr) {
- if parser == libc.UintptrFromInt32(0) {
- return libc.UintptrFromInt32(0)
- }
- if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_eventPtr != 0 && (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_buffer != 0 {
- if offset != libc.UintptrFromInt32(0) {
- *(*int32)(unsafe.Pointer(offset)) = int32(int64((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_eventPtr) - int64((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_buffer))
- }
- if size != libc.UintptrFromInt32(0) {
- *(*int32)(unsafe.Pointer(size)) = int32(int64((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_bufferEnd) - int64((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_buffer))
- }
- return (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_buffer
- }
- return libc.UintptrFromInt32(0)
- }
- func XXML_GetCurrentLineNumber(tls *libc.TLS, parser TXML_Parser) (r TXML_Size) {
- if parser == libc.UintptrFromInt32(0) {
- return uint64(0)
- }
- if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_eventPtr != 0 && (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_eventPtr >= (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_positionPtr {
- (*(*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)
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_positionPtr = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_eventPtr
- }
- return (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_position.FlineNumber + uint64(1)
- }
- func XXML_GetCurrentColumnNumber(tls *libc.TLS, parser TXML_Parser) (r TXML_Size) {
- if parser == libc.UintptrFromInt32(0) {
- return uint64(0)
- }
- if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_eventPtr != 0 && (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_eventPtr >= (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_positionPtr {
- (*(*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)
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_positionPtr = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_eventPtr
- }
- return (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_position.FcolumnNumber
- }
- func XXML_FreeContentModel(tls *libc.TLS, parser TXML_Parser, model uintptr) {
- if parser != libc.UintptrFromInt32(0) {
- (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_mem.Ffree_fcn})))(tls, model)
- }
- }
- func XXML_MemMalloc(tls *libc.TLS, parser TXML_Parser, size Tsize_t) (r uintptr) {
- if parser == libc.UintptrFromInt32(0) {
- return libc.UintptrFromInt32(0)
- }
- return (*(*func(*libc.TLS, Tsize_t) uintptr)(unsafe.Pointer(&struct{ uintptr }{(*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_mem.Fmalloc_fcn})))(tls, size)
- }
- func XXML_MemRealloc(tls *libc.TLS, parser TXML_Parser, ptr uintptr, size Tsize_t) (r uintptr) {
- if parser == libc.UintptrFromInt32(0) {
- return libc.UintptrFromInt32(0)
- }
- return (*(*func(*libc.TLS, uintptr, Tsize_t) uintptr)(unsafe.Pointer(&struct{ uintptr }{(*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_mem.Frealloc_fcn})))(tls, ptr, size)
- }
- func XXML_MemFree(tls *libc.TLS, parser TXML_Parser, ptr uintptr) {
- if parser != libc.UintptrFromInt32(0) {
- (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_mem.Ffree_fcn})))(tls, ptr)
- }
- }
- func XXML_DefaultCurrent(tls *libc.TLS, parser TXML_Parser) {
- if parser == libc.UintptrFromInt32(0) {
- return
- }
- if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_defaultHandler != 0 {
- if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_openInternalEntities != 0 {
- _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)
- } else {
- _reportDefault(tls, parser, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_encoding, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_eventPtr, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_eventEndPtr)
- }
- }
- }
- func XXML_ErrorString(tls *libc.TLS, code _XML_Error) (r uintptr) {
- switch code {
- case int32(_XML_ERROR_NONE):
- return libc.UintptrFromInt32(0)
- case int32(_XML_ERROR_NO_MEMORY):
- return __ccgo_ts + 138
- case int32(_XML_ERROR_SYNTAX):
- return __ccgo_ts + 152
- case int32(_XML_ERROR_NO_ELEMENTS):
- return __ccgo_ts + 165
- case int32(_XML_ERROR_INVALID_TOKEN):
- return __ccgo_ts + 182
- case int32(_XML_ERROR_UNCLOSED_TOKEN):
- return __ccgo_ts + 214
- case int32(_XML_ERROR_PARTIAL_CHAR):
- return __ccgo_ts + 229
- case int32(_XML_ERROR_TAG_MISMATCH):
- return __ccgo_ts + 247
- case int32(_XML_ERROR_DUPLICATE_ATTRIBUTE):
- return __ccgo_ts + 262
- case int32(_XML_ERROR_JUNK_AFTER_DOC_ELEMENT):
- return __ccgo_ts + 282
- case int32(_XML_ERROR_PARAM_ENTITY_REF):
- return __ccgo_ts + 310
- case int32(_XML_ERROR_UNDEFINED_ENTITY):
- return __ccgo_ts + 345
- case int32(_XML_ERROR_RECURSIVE_ENTITY_REF):
- return __ccgo_ts + 362
- case int32(_XML_ERROR_ASYNC_ENTITY):
- return __ccgo_ts + 389
- case int32(_XML_ERROR_BAD_CHAR_REF):
- return __ccgo_ts + 409
- case int32(_XML_ERROR_BINARY_ENTITY_REF):
- return __ccgo_ts + 447
- case int32(_XML_ERROR_ATTRIBUTE_EXTERNAL_ENTITY_REF):
- return __ccgo_ts + 474
- case int32(_XML_ERROR_MISPLACED_XML_PI):
- return __ccgo_ts + 516
- case int32(_XML_ERROR_UNKNOWN_ENCODING):
- return __ccgo_ts + 563
- case int32(_XML_ERROR_INCORRECT_ENCODING):
- return __ccgo_ts + 580
- case int32(_XML_ERROR_UNCLOSED_CDATA_SECTION):
- return __ccgo_ts + 631
- case int32(_XML_ERROR_EXTERNAL_ENTITY_HANDLING):
- return __ccgo_ts + 654
- case int32(_XML_ERROR_NOT_STANDALONE):
- return __ccgo_ts + 700
- case int32(_XML_ERROR_UNEXPECTED_STATE):
- return __ccgo_ts + 727
- case int32(_XML_ERROR_ENTITY_DECLARED_IN_PE):
- return __ccgo_ts + 778
- case int32(_XML_ERROR_FEATURE_REQUIRES_XML_DTD):
- return __ccgo_ts + 814
- case int32(_XML_ERROR_CANT_CHANGE_FEATURE_ONCE_PARSING):
- return __ccgo_ts + 866
- /* Added in 1.95.7. */
- fallthrough
- case int32(_XML_ERROR_UNBOUND_PREFIX):
- return __ccgo_ts + 911
- /* Added in 1.95.8. */
- fallthrough
- case int32(_XML_ERROR_UNDECLARING_PREFIX):
- return __ccgo_ts + 926
- case int32(_XML_ERROR_INCOMPLETE_PE):
- return __ccgo_ts + 952
- case int32(_XML_ERROR_XML_DECL):
- return __ccgo_ts + 990
- case int32(_XML_ERROR_TEXT_DECL):
- return __ccgo_ts + 1022
- case int32(_XML_ERROR_PUBLICID):
- return __ccgo_ts + 1055
- case int32(_XML_ERROR_SUSPENDED):
- return __ccgo_ts + 1089
- case int32(_XML_ERROR_NOT_SUSPENDED):
- return __ccgo_ts + 1106
- case int32(_XML_ERROR_ABORTED):
- return __ccgo_ts + 1127
- case int32(_XML_ERROR_FINISHED):
- return __ccgo_ts + 1143
- case int32(_XML_ERROR_SUSPEND_PE):
- return __ccgo_ts + 1160
- /* Added in 2.0.0. */
- fallthrough
- case int32(_XML_ERROR_RESERVED_PREFIX_XML):
- return __ccgo_ts + 1204
- case int32(_XML_ERROR_RESERVED_PREFIX_XMLNS):
- return __ccgo_ts + 1284
- case int32(_XML_ERROR_RESERVED_NAMESPACE_URI):
- return __ccgo_ts + 1343
- /* Added in 2.2.5. */
- fallthrough
- case int32(_XML_ERROR_INVALID_ARGUMENT): /* Constant added in 2.2.1, already */
- return __ccgo_ts + 1407
- /* Added in 2.3.0. */
- fallthrough
- case int32(_XML_ERROR_NO_BUFFER):
- return __ccgo_ts + 1424
- /* Added in 2.4.0. */
- fallthrough
- case int32(_XML_ERROR_AMPLIFICATION_LIMIT_BREACH):
- return __ccgo_ts + 1486
- }
- return libc.UintptrFromInt32(0)
- }
- func XXML_ExpatVersion(tls *libc.TLS) (r uintptr) {
- /* V1 is used to string-ize the version number. However, it would
- string-ize the actual version macro *names* unless we get them
- substituted before being passed to V1. CPP is defined to expand
- a macro, then rescan for more expansions. Thus, we use V2 to expand
- the version macros, then CPP will expand the resulting V1() macro
- with the correct numerals. */
- /* ### I'm assuming cpp is portable in this respect... */
- return __ccgo_ts + 1555
- }
- func XXML_ExpatVersionInfo(tls *libc.TLS) (r TXML_Expat_Version) {
- var version TXML_Expat_Version
- _ = version
- version.Fmajor = int32(m_XML_MAJOR_VERSION)
- version.Fminor = int32(m_XML_MINOR_VERSION)
- version.Fmicro = m_XML_MICRO_VERSION
- return version
- }
- func XXML_GetFeatureList(tls *libc.TLS) (r uintptr) {
- return uintptr(unsafe.Pointer(&_features))
- }
- var _features = [8]TXML_Feature{
- 0: {
- Ffeature: int32(_XML_FEATURE_SIZEOF_XML_CHAR),
- Fname: __ccgo_ts + 1567,
- Fvalue: int64(1),
- },
- 1: {
- Ffeature: int32(_XML_FEATURE_SIZEOF_XML_LCHAR),
- Fname: __ccgo_ts + 1584,
- Fvalue: int64(1),
- },
- 2: {
- Ffeature: int32(_XML_FEATURE_DTD),
- Fname: __ccgo_ts + 1602,
- },
- 3: {
- Ffeature: int32(_XML_FEATURE_CONTEXT_BYTES),
- Fname: __ccgo_ts + 1610,
- Fvalue: int64(m_XML_CONTEXT_BYTES),
- },
- 4: {
- Ffeature: int32(_XML_FEATURE_NS),
- Fname: __ccgo_ts + 1628,
- },
- 5: {
- Ffeature: int32(_XML_FEATURE_BILLION_LAUGHS_ATTACK_PROTECTION_MAXIMUM_AMPLIFICATION_DEFAULT),
- Fname: __ccgo_ts + 1635,
- Fvalue: libc.Int64FromFloat32(100),
- },
- 6: {
- Ffeature: int32(_XML_FEATURE_BILLION_LAUGHS_ATTACK_PROTECTION_ACTIVATION_THRESHOLD_DEFAULT),
- Fname: __ccgo_ts + 1652,
- Fvalue: int64(m_EXPAT_BILLION_LAUGHS_ATTACK_PROTECTION_ACTIVATION_THRESHOLD_DEFAULT),
- },
- 7: {},
- }
- func XXML_SetBillionLaughsAttackProtectionMaximumAmplification(tls *libc.TLS, parser TXML_Parser, maximumAmplificationFactor float32) (r TXML_Bool) {
- bp := tls.Alloc(16)
- defer tls.Free(16)
- var v1 uint32
- var v3 bool
- var _ /* __u at bp+0 */ struct {
- F__i [0]uint32
- F__f float32
- }
- _, _ = v1, v3
- if v3 = parser == libc.UintptrFromInt32(0) || (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parentParser != libc.UintptrFromInt32(0); !v3 {
- *(*float32)(unsafe.Pointer(bp)) = maximumAmplificationFactor
- v1 = *(*uint32)(unsafe.Pointer(bp))
- goto _2
- _2:
- }
- if v3 || libc.BoolInt32(v1&uint32(0x7fffffff) > uint32(0x7f800000)) != 0 || maximumAmplificationFactor < libc.Float32FromFloat32(1) {
- return libc.Uint8FromInt32(0)
- }
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_accounting.FmaximumAmplificationFactor = maximumAmplificationFactor
- return libc.Uint8FromInt32(1)
- }
- func XXML_SetBillionLaughsAttackProtectionActivationThreshold(tls *libc.TLS, parser TXML_Parser, activationThresholdBytes uint64) (r TXML_Bool) {
- if parser == libc.UintptrFromInt32(0) || (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parentParser != libc.UintptrFromInt32(0) {
- return libc.Uint8FromInt32(0)
- }
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_accounting.FactivationThresholdBytes = activationThresholdBytes
- return libc.Uint8FromInt32(1)
- }
- // C documentation
- //
- // /* Initially tag->rawName always points into the parse buffer;
- // for those TAG instances opened while the current parse buffer was
- // processed, and not yet closed, we need to store tag->rawName in a more
- // permanent location, since the parse buffer is about to be discarded.
- // */
- func _storeRawNames(tls *libc.TLS, parser TXML_Parser) (r TXML_Bool) {
- var bufSize, nameLen int32
- var rawNameBuf, tag, temp uintptr
- var rawNameLen Tsize_t
- _, _, _, _, _, _ = bufSize, nameLen, rawNameBuf, rawNameLen, tag, temp
- tag = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_tagStack
- for tag != 0 {
- nameLen = libc.Int32FromUint64(uint64(1) * libc.Uint64FromInt32((*TTAG)(unsafe.Pointer(tag)).Fname.FstrLen+libc.Int32FromInt32(1)))
- rawNameBuf = (*TTAG)(unsafe.Pointer(tag)).Fbuf + uintptr(nameLen)
- /* Stop if already stored. Since m_tagStack is a stack, we can stop
- at the first entry that has already been copied; everything
- below it in the stack is already been accounted for in a
- previous call to this function.
- */
- if (*TTAG)(unsafe.Pointer(tag)).FrawName == rawNameBuf {
- break
- }
- /* For re-use purposes we need to ensure that the
- size of tag->buf is a multiple of sizeof(XML_Char).
- */
- rawNameLen = (libc.Uint64FromInt32((*TTAG)(unsafe.Pointer(tag)).FrawNameLength) + (libc.Uint64FromInt64(1) - libc.Uint64FromInt32(1))) & ^(libc.Uint64FromInt64(1) - libc.Uint64FromInt32(1))
- /* Detect and prevent integer overflow. */
- if rawNameLen > libc.Uint64FromInt32(m_INT_MAX)-libc.Uint64FromInt32(nameLen) {
- return libc.Uint8FromInt32(0)
- }
- bufSize = nameLen + libc.Int32FromUint64(rawNameLen)
- if int64(bufSize) > int64((*TTAG)(unsafe.Pointer(tag)).FbufEnd)-int64((*TTAG)(unsafe.Pointer(tag)).Fbuf) {
- 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))
- if temp == libc.UintptrFromInt32(0) {
- return libc.Uint8FromInt32(0)
- }
- /* if tag->name.str points to tag->buf (only when namespace
- processing is off) then we have to update it
- */
- if (*TTAG)(unsafe.Pointer(tag)).Fname.Fstr == (*TTAG)(unsafe.Pointer(tag)).Fbuf {
- (*TTAG)(unsafe.Pointer(tag)).Fname.Fstr = temp
- }
- /* if tag->name.localPart is set (when namespace processing is on)
- then update it as well, since it will always point into tag->buf
- */
- if (*TTAG)(unsafe.Pointer(tag)).Fname.FlocalPart != 0 {
- (*TTAG)(unsafe.Pointer(tag)).Fname.FlocalPart = temp + uintptr(int64((*TTAG)(unsafe.Pointer(tag)).Fname.FlocalPart)-int64((*TTAG)(unsafe.Pointer(tag)).Fbuf))
- }
- (*TTAG)(unsafe.Pointer(tag)).Fbuf = temp
- (*TTAG)(unsafe.Pointer(tag)).FbufEnd = temp + uintptr(bufSize)
- rawNameBuf = temp + uintptr(nameLen)
- }
- libc.Xmemcpy(tls, rawNameBuf, (*TTAG)(unsafe.Pointer(tag)).FrawName, libc.Uint64FromInt32((*TTAG)(unsafe.Pointer(tag)).FrawNameLength))
- (*TTAG)(unsafe.Pointer(tag)).FrawName = rawNameBuf
- tag = (*TTAG)(unsafe.Pointer(tag)).Fparent
- }
- return libc.Uint8FromInt32(1)
- }
- func _contentProcessor(tls *libc.TLS, parser TXML_Parser, start uintptr, end uintptr, endPtr uintptr) (r _XML_Error) {
- var result _XML_Error
- _ = result
- 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))
- if result == int32(_XML_ERROR_NONE) {
- if !(_storeRawNames(tls, parser) != 0) {
- return int32(_XML_ERROR_NO_MEMORY)
- }
- }
- return result
- }
- func _externalEntityInitProcessor(tls *libc.TLS, parser TXML_Parser, start uintptr, end uintptr, endPtr uintptr) (r _XML_Error) {
- var result _XML_Error
- _ = result
- result = _initializeEncoding(tls, parser)
- if result != int32(_XML_ERROR_NONE) {
- return result
- }
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_processor = __ccgo_fp(_externalEntityInitProcessor2)
- return _externalEntityInitProcessor2(tls, parser, start, end, endPtr)
- }
- func _externalEntityInitProcessor2(tls *libc.TLS, parser TXML_Parser, start uintptr, end uintptr, endPtr uintptr) (r _XML_Error) {
- bp := tls.Alloc(16)
- defer tls.Free(16)
- var tok int32
- var _ /* next at bp+0 */ uintptr
- _ = tok
- *(*uintptr)(unsafe.Pointer(bp)) = start /* XmlContentTok doesn't always set the last arg */
- 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)
- switch tok {
- case int32(m_XML_TOK_BOM):
- if !(_accountingDiffTolerated(tls, parser, tok, start, *(*uintptr)(unsafe.Pointer(bp)), int32(2649), int32(_XML_ACCOUNT_DIRECT)) != 0) {
- _accountingOnAbort(tls, parser)
- return int32(_XML_ERROR_AMPLIFICATION_LIMIT_BREACH)
- }
- /* If we are at the end of the buffer, this would cause the next stage,
- i.e. externalEntityInitProcessor3, to pass control directly to
- doContent (by detecting XML_TOK_NONE) without processing any xml text
- declaration - causing the error XML_ERROR_MISPLACED_XML_PI in doContent.
- */
- if *(*uintptr)(unsafe.Pointer(bp)) == end && !((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parsingStatus.FfinalBuffer != 0) {
- *(*uintptr)(unsafe.Pointer(endPtr)) = *(*uintptr)(unsafe.Pointer(bp))
- return int32(_XML_ERROR_NONE)
- }
- start = *(*uintptr)(unsafe.Pointer(bp))
- case -int32(1):
- if !((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parsingStatus.FfinalBuffer != 0) {
- *(*uintptr)(unsafe.Pointer(endPtr)) = start
- return int32(_XML_ERROR_NONE)
- }
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_eventPtr = start
- return int32(_XML_ERROR_UNCLOSED_TOKEN)
- case -int32(2):
- if !((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parsingStatus.FfinalBuffer != 0) {
- *(*uintptr)(unsafe.Pointer(endPtr)) = start
- return int32(_XML_ERROR_NONE)
- }
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_eventPtr = start
- return int32(_XML_ERROR_PARTIAL_CHAR)
- }
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_processor = __ccgo_fp(_externalEntityInitProcessor3)
- return _externalEntityInitProcessor3(tls, parser, start, end, endPtr)
- }
- func _externalEntityInitProcessor3(tls *libc.TLS, parser TXML_Parser, start uintptr, end uintptr, endPtr uintptr) (r _XML_Error) {
- bp := tls.Alloc(16)
- defer tls.Free(16)
- var result _XML_Error
- var tok int32
- var _ /* next at bp+0 */ uintptr
- _, _ = result, tok
- *(*uintptr)(unsafe.Pointer(bp)) = start /* XmlContentTok doesn't always set the last arg */
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_eventPtr = start
- 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)
- /* Note: These bytes are accounted later in:
- - processXmlDecl
- - externalEntityContentProcessor
- */
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_eventEndPtr = *(*uintptr)(unsafe.Pointer(bp))
- switch tok {
- case int32(m_XML_TOK_XML_DECL):
- result = _processXmlDecl(tls, parser, int32(1), start, *(*uintptr)(unsafe.Pointer(bp)))
- if result != int32(_XML_ERROR_NONE) {
- return result
- }
- switch (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parsingStatus.Fparsing {
- case int32(_XML_SUSPENDED):
- *(*uintptr)(unsafe.Pointer(endPtr)) = *(*uintptr)(unsafe.Pointer(bp))
- return int32(_XML_ERROR_NONE)
- case int32(_XML_FINISHED):
- return int32(_XML_ERROR_ABORTED)
- default:
- start = *(*uintptr)(unsafe.Pointer(bp))
- }
- case -int32(1):
- if !((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parsingStatus.FfinalBuffer != 0) {
- *(*uintptr)(unsafe.Pointer(endPtr)) = start
- return int32(_XML_ERROR_NONE)
- }
- return int32(_XML_ERROR_UNCLOSED_TOKEN)
- case -int32(2):
- if !((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parsingStatus.FfinalBuffer != 0) {
- *(*uintptr)(unsafe.Pointer(endPtr)) = start
- return int32(_XML_ERROR_NONE)
- }
- return int32(_XML_ERROR_PARTIAL_CHAR)
- }
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_processor = __ccgo_fp(_externalEntityContentProcessor)
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_tagLevel = int32(1)
- return _externalEntityContentProcessor(tls, parser, start, end, endPtr)
- }
- func _externalEntityContentProcessor(tls *libc.TLS, parser TXML_Parser, start uintptr, end uintptr, endPtr uintptr) (r _XML_Error) {
- var result _XML_Error
- _ = result
- 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))
- if result == int32(_XML_ERROR_NONE) {
- if !(_storeRawNames(tls, parser) != 0) {
- return int32(_XML_ERROR_NO_MEMORY)
- }
- }
- return result
- }
- 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) {
- bp := tls.Alloc(112)
- defer tls.Free(112)
- *(*uintptr)(unsafe.Pointer(bp)) = _s
- 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
- var bufSize, convLen, len1, n, tok int32
- var charDataHandler TXML_CharacterDataHandler
- var convert_res, convert_res1 _XML_Convert_Result
- var noElmHandlers TXML_Bool
- var result, result1, result2, result3 _XML_Error
- var _ /* bindings at bp+40 */ uintptr
- var _ /* buf at bp+88 */ [4]TXML_Char
- var _ /* c at bp+16 */ TXML_Char
- var _ /* c at bp+92 */ TXML_Char
- var _ /* ch at bp+17 */ TXML_Char
- var _ /* dataPtr at bp+104 */ uintptr
- var _ /* dataPtr at bp+96 */ uintptr
- var _ /* fromPtr at bp+32 */ uintptr
- var _ /* name at bp+48 */ TTAG_NAME
- var _ /* next at bp+8 */ uintptr
- var _ /* toPtr at bp+24 */ uintptr
- _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = 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
- /* save one level of indirection */
- dtd = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_dtd
- if enc == (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_encoding {
- eventPP = parser + 544
- eventEndPP = parser + 552
- } else {
- eventPP = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_openInternalEntities
- eventEndPP = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_openInternalEntities + 8
- }
- *(*uintptr)(unsafe.Pointer(eventPP)) = *(*uintptr)(unsafe.Pointer(bp))
- for {
- *(*uintptr)(unsafe.Pointer(bp + 8)) = *(*uintptr)(unsafe.Pointer(bp)) /* XmlContentTok doesn't always set the last arg */
- 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)
- if tok == -int32(5) || tok == -int32(3) {
- if haveMore != 0 {
- v3 = *(*uintptr)(unsafe.Pointer(bp))
- } else {
- v3 = end
- }
- v2 = v3
- } else {
- v2 = *(*uintptr)(unsafe.Pointer(bp + 8))
- }
- accountAfter = v2
- if !(_accountingDiffTolerated(tls, parser, tok, *(*uintptr)(unsafe.Pointer(bp)), accountAfter, int32(2773), account) != 0) {
- _accountingOnAbort(tls, parser)
- return int32(_XML_ERROR_AMPLIFICATION_LIMIT_BREACH)
- }
- *(*uintptr)(unsafe.Pointer(eventEndPP)) = *(*uintptr)(unsafe.Pointer(bp + 8))
- switch tok {
- case -int32(3):
- if haveMore != 0 {
- *(*uintptr)(unsafe.Pointer(nextPtr)) = *(*uintptr)(unsafe.Pointer(bp))
- return int32(_XML_ERROR_NONE)
- }
- *(*uintptr)(unsafe.Pointer(eventEndPP)) = end
- if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_characterDataHandler != 0 {
- *(*TXML_Char)(unsafe.Pointer(bp + 16)) = int8(0xA)
- (*(*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))
- } else {
- if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_defaultHandler != 0 {
- _reportDefault(tls, parser, enc, *(*uintptr)(unsafe.Pointer(bp)), end)
- }
- }
- /* We are at the end of the final buffer, should we check for
- XML_SUSPENDED, XML_FINISHED?
- */
- if startTagLevel == 0 {
- return int32(_XML_ERROR_NO_ELEMENTS)
- }
- if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_tagLevel != startTagLevel {
- return int32(_XML_ERROR_ASYNC_ENTITY)
- }
- *(*uintptr)(unsafe.Pointer(nextPtr)) = end
- return int32(_XML_ERROR_NONE)
- case -int32(4):
- if haveMore != 0 {
- *(*uintptr)(unsafe.Pointer(nextPtr)) = *(*uintptr)(unsafe.Pointer(bp))
- return int32(_XML_ERROR_NONE)
- }
- if startTagLevel > 0 {
- if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_tagLevel != startTagLevel {
- return int32(_XML_ERROR_ASYNC_ENTITY)
- }
- *(*uintptr)(unsafe.Pointer(nextPtr)) = *(*uintptr)(unsafe.Pointer(bp))
- return int32(_XML_ERROR_NONE)
- }
- return int32(_XML_ERROR_NO_ELEMENTS)
- case m_XML_TOK_INVALID:
- *(*uintptr)(unsafe.Pointer(eventPP)) = *(*uintptr)(unsafe.Pointer(bp + 8))
- return int32(_XML_ERROR_INVALID_TOKEN)
- case -int32(1):
- if haveMore != 0 {
- *(*uintptr)(unsafe.Pointer(nextPtr)) = *(*uintptr)(unsafe.Pointer(bp))
- return int32(_XML_ERROR_NONE)
- }
- return int32(_XML_ERROR_UNCLOSED_TOKEN)
- case -int32(2):
- if haveMore != 0 {
- *(*uintptr)(unsafe.Pointer(nextPtr)) = *(*uintptr)(unsafe.Pointer(bp))
- return int32(_XML_ERROR_NONE)
- }
- return int32(_XML_ERROR_PARTIAL_CHAR)
- case int32(m_XML_TOK_ENTITY_REF):
- *(*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)))
- if *(*TXML_Char)(unsafe.Pointer(bp + 17)) != 0 {
- /* NOTE: We are replacing 4-6 characters original input for 1 character
- * so there is no amplification and hence recording without
- * protection. */
- _accountingDiffTolerated(tls, parser, tok, bp+17, bp+17+uintptr(1), int32(2839), int32(_XML_ACCOUNT_ENTITY_EXPANSION))
- if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_characterDataHandler != 0 {
- (*(*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))
- } else {
- if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_defaultHandler != 0 {
- _reportDefault(tls, parser, enc, *(*uintptr)(unsafe.Pointer(bp)), *(*uintptr)(unsafe.Pointer(bp + 8)))
- }
- }
- break
- }
- 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))
- if !(name != 0) {
- return int32(_XML_ERROR_NO_MEMORY)
- }
- entity = _lookup(tls, parser, dtd, name, uint64(0))
- (*TSTRING_POOL)(unsafe.Pointer(dtd + 160)).Fptr = (*TSTRING_POOL)(unsafe.Pointer(dtd + 160)).Fstart
- /* First, determine if a check for an existing declaration is needed;
- if yes, check that the entity exists, and that it is internal,
- otherwise call the skipped entity or default handler.
- */
- if !((*TDTD)(unsafe.Pointer(dtd)).FhasParamEntityRefs != 0) || (*TDTD)(unsafe.Pointer(dtd)).Fstandalone != 0 {
- if !(entity != 0) {
- return int32(_XML_ERROR_UNDEFINED_ENTITY)
- } else {
- if !((*TENTITY)(unsafe.Pointer(entity)).Fis_internal != 0) {
- return int32(_XML_ERROR_ENTITY_DECLARED_IN_PE)
- }
- }
- } else {
- if !(entity != 0) {
- if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_skippedEntityHandler != 0 {
- (*(*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)
- } else {
- if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_defaultHandler != 0 {
- _reportDefault(tls, parser, enc, *(*uintptr)(unsafe.Pointer(bp)), *(*uintptr)(unsafe.Pointer(bp + 8)))
- }
- }
- break
- }
- }
- if (*TENTITY)(unsafe.Pointer(entity)).Fopen != 0 {
- return int32(_XML_ERROR_RECURSIVE_ENTITY_REF)
- }
- if (*TENTITY)(unsafe.Pointer(entity)).Fnotation != 0 {
- return int32(_XML_ERROR_BINARY_ENTITY_REF)
- }
- if (*TENTITY)(unsafe.Pointer(entity)).FtextPtr != 0 {
- if !((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_defaultExpandInternalEntities != 0) {
- if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_skippedEntityHandler != 0 {
- (*(*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)
- } else {
- if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_defaultHandler != 0 {
- _reportDefault(tls, parser, enc, *(*uintptr)(unsafe.Pointer(bp)), *(*uintptr)(unsafe.Pointer(bp + 8)))
- }
- }
- break
- }
- result = _processInternalEntity(tls, parser, entity, libc.Uint8FromInt32(0))
- if result != int32(_XML_ERROR_NONE) {
- return result
- }
- } else {
- if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_externalEntityRefHandler != 0 {
- (*TENTITY)(unsafe.Pointer(entity)).Fopen = libc.Uint8FromInt32(1)
- context = _getContext(tls, parser)
- (*TENTITY)(unsafe.Pointer(entity)).Fopen = libc.Uint8FromInt32(0)
- if !(context != 0) {
- return int32(_XML_ERROR_NO_MEMORY)
- }
- 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) {
- return int32(_XML_ERROR_EXTERNAL_ENTITY_HANDLING)
- }
- (*TSTRING_POOL)(unsafe.Pointer(parser + 784)).Fptr = (*TSTRING_POOL)(unsafe.Pointer(parser + 784)).Fstart
- } else {
- if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_defaultHandler != 0 {
- _reportDefault(tls, parser, enc, *(*uintptr)(unsafe.Pointer(bp)), *(*uintptr)(unsafe.Pointer(bp + 8)))
- }
- }
- }
- case int32(m_XML_TOK_START_TAG_NO_ATTS):
- /* fall through */
- fallthrough
- case int32(m_XML_TOK_START_TAG_WITH_ATTS):
- if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_freeTagList != 0 {
- tag = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_freeTagList
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_freeTagList = (*TTAG)(unsafe.Pointer((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_freeTagList)).Fparent
- } else {
- tag = (*(*func(*libc.TLS, Tsize_t) uintptr)(unsafe.Pointer(&struct{ uintptr }{(*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_mem.Fmalloc_fcn})))(tls, libc.Uint64FromInt64(88))
- if !(tag != 0) {
- return int32(_XML_ERROR_NO_MEMORY)
- }
- (*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)))
- if !((*TTAG)(unsafe.Pointer(tag)).Fbuf != 0) {
- (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_mem.Ffree_fcn})))(tls, tag)
- return int32(_XML_ERROR_NO_MEMORY)
- }
- (*TTAG)(unsafe.Pointer(tag)).FbufEnd = (*TTAG)(unsafe.Pointer(tag)).Fbuf + uintptr(m_INIT_TAG_BUF_SIZE)
- }
- (*TTAG)(unsafe.Pointer(tag)).Fbindings = libc.UintptrFromInt32(0)
- (*TTAG)(unsafe.Pointer(tag)).Fparent = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_tagStack
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_tagStack = tag
- (*TTAG)(unsafe.Pointer(tag)).Fname.FlocalPart = libc.UintptrFromInt32(0)
- (*TTAG)(unsafe.Pointer(tag)).Fname.Fprefix = libc.UintptrFromInt32(0)
- (*TTAG)(unsafe.Pointer(tag)).FrawName = *(*uintptr)(unsafe.Pointer(bp)) + uintptr((*TENCODING)(unsafe.Pointer(enc)).FminBytesPerChar)
- (*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)
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_tagLevel++
- rawNameEnd = (*TTAG)(unsafe.Pointer(tag)).FrawName + uintptr((*TTAG)(unsafe.Pointer(tag)).FrawNameLength)
- *(*uintptr)(unsafe.Pointer(bp + 32)) = (*TTAG)(unsafe.Pointer(tag)).FrawName
- *(*uintptr)(unsafe.Pointer(bp + 24)) = (*TTAG)(unsafe.Pointer(tag)).Fbuf
- for {
- 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))
- convLen = int32(int64(*(*uintptr)(unsafe.Pointer(bp + 24))) - int64((*TTAG)(unsafe.Pointer(tag)).Fbuf))
- if *(*uintptr)(unsafe.Pointer(bp + 32)) >= rawNameEnd || convert_res == int32(_XML_CONVERT_INPUT_INCOMPLETE) {
- (*TTAG)(unsafe.Pointer(tag)).Fname.FstrLen = convLen
- break
- }
- bufSize = int32(int64((*TTAG)(unsafe.Pointer(tag)).FbufEnd)-int64((*TTAG)(unsafe.Pointer(tag)).Fbuf)) << int32(1)
- 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))
- if temp == libc.UintptrFromInt32(0) {
- return int32(_XML_ERROR_NO_MEMORY)
- }
- (*TTAG)(unsafe.Pointer(tag)).Fbuf = temp
- (*TTAG)(unsafe.Pointer(tag)).FbufEnd = temp + uintptr(bufSize)
- *(*uintptr)(unsafe.Pointer(bp + 24)) = temp + uintptr(convLen)
- goto _4
- _4:
- }
- (*TTAG)(unsafe.Pointer(tag)).Fname.Fstr = (*TTAG)(unsafe.Pointer(tag)).Fbuf
- *(*TXML_Char)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 24)))) = int8('\000')
- result1 = _storeAtts(tls, parser, enc, *(*uintptr)(unsafe.Pointer(bp)), tag+24, tag+80, account)
- if result1 != 0 {
- return result1
- }
- if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_startElementHandler != 0 {
- (*(*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)
- } else {
- if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_defaultHandler != 0 {
- _reportDefault(tls, parser, enc, *(*uintptr)(unsafe.Pointer(bp)), *(*uintptr)(unsafe.Pointer(bp + 8)))
- }
- }
- _poolClear(tls, parser+784)
- case int32(m_XML_TOK_EMPTY_ELEMENT_NO_ATTS):
- /* fall through */
- fallthrough
- case int32(m_XML_TOK_EMPTY_ELEMENT_WITH_ATTS):
- rawName = *(*uintptr)(unsafe.Pointer(bp)) + uintptr((*TENCODING)(unsafe.Pointer(enc)).FminBytesPerChar)
- *(*uintptr)(unsafe.Pointer(bp + 40)) = libc.UintptrFromInt32(0)
- noElmHandlers = libc.Uint8FromInt32(1)
- (*(*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)))
- if !((*(*TTAG_NAME)(unsafe.Pointer(bp + 48))).Fstr != 0) {
- return int32(_XML_ERROR_NO_MEMORY)
- }
- (*TSTRING_POOL)(unsafe.Pointer(parser + 784)).Fstart = (*TSTRING_POOL)(unsafe.Pointer(parser + 784)).Fptr
- result2 = _storeAtts(tls, parser, enc, *(*uintptr)(unsafe.Pointer(bp)), bp+48, bp+40, int32(_XML_ACCOUNT_NONE))
- if result2 != int32(_XML_ERROR_NONE) {
- _freeBindings(tls, parser, *(*uintptr)(unsafe.Pointer(bp + 40)))
- return result2
- }
- (*TSTRING_POOL)(unsafe.Pointer(parser + 784)).Fstart = (*TSTRING_POOL)(unsafe.Pointer(parser + 784)).Fptr
- if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_startElementHandler != 0 {
- (*(*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)
- noElmHandlers = libc.Uint8FromInt32(0)
- }
- if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_endElementHandler != 0 {
- if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_startElementHandler != 0 {
- *(*uintptr)(unsafe.Pointer(eventPP)) = *(*uintptr)(unsafe.Pointer(eventEndPP))
- }
- (*(*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)
- noElmHandlers = libc.Uint8FromInt32(0)
- }
- if noElmHandlers != 0 && (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_defaultHandler != 0 {
- _reportDefault(tls, parser, enc, *(*uintptr)(unsafe.Pointer(bp)), *(*uintptr)(unsafe.Pointer(bp + 8)))
- }
- _poolClear(tls, parser+784)
- _freeBindings(tls, parser, *(*uintptr)(unsafe.Pointer(bp + 40)))
- if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_tagLevel == 0 && (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parsingStatus.Fparsing != int32(_XML_FINISHED) {
- if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parsingStatus.Fparsing == int32(_XML_SUSPENDED) {
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_processor = __ccgo_fp(_epilogProcessor)
- } else {
- return _epilogProcessor(tls, parser, *(*uintptr)(unsafe.Pointer(bp + 8)), end, nextPtr)
- }
- }
- case int32(m_XML_TOK_END_TAG):
- if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_tagLevel == startTagLevel {
- return int32(_XML_ERROR_ASYNC_ENTITY)
- } else {
- tag1 = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_tagStack
- rawName1 = *(*uintptr)(unsafe.Pointer(bp)) + uintptr((*TENCODING)(unsafe.Pointer(enc)).FminBytesPerChar*int32(2))
- len1 = (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*TENCODING)(unsafe.Pointer(enc)).FnameLength})))(tls, enc, rawName1)
- if len1 != (*TTAG)(unsafe.Pointer(tag1)).FrawNameLength || libc.Xmemcmp(tls, (*TTAG)(unsafe.Pointer(tag1)).FrawName, rawName1, libc.Uint64FromInt32(len1)) != 0 {
- *(*uintptr)(unsafe.Pointer(eventPP)) = rawName1
- return int32(_XML_ERROR_TAG_MISMATCH)
- }
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_tagStack = (*TTAG)(unsafe.Pointer(tag1)).Fparent
- (*TTAG)(unsafe.Pointer(tag1)).Fparent = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_freeTagList
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_freeTagList = tag1
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_tagLevel--
- if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_endElementHandler != 0 {
- localPart = (*TTAG)(unsafe.Pointer(tag1)).Fname.FlocalPart
- if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_ns != 0 && localPart != 0 {
- /* localPart and prefix may have been overwritten in
- tag->name.str, since this points to the binding->uri
- buffer which gets re-used; so we have to add them again
- */
- uri = (*TTAG)(unsafe.Pointer(tag1)).Fname.Fstr + uintptr((*TTAG)(unsafe.Pointer(tag1)).Fname.FuriLen)
- /* don't need to check for space - already done in storeAtts() */
- for *(*TXML_Char)(unsafe.Pointer(localPart)) != 0 {
- v5 = uri
- uri++
- v6 = localPart
- localPart++
- *(*TXML_Char)(unsafe.Pointer(v5)) = *(*TXML_Char)(unsafe.Pointer(v6))
- }
- prefix = (*TTAG)(unsafe.Pointer(tag1)).Fname.Fprefix
- if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_ns_triplets != 0 && prefix != 0 {
- v7 = uri
- uri++
- *(*TXML_Char)(unsafe.Pointer(v7)) = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_namespaceSeparator
- for *(*TXML_Char)(unsafe.Pointer(prefix)) != 0 {
- v8 = uri
- uri++
- v9 = prefix
- prefix++
- *(*TXML_Char)(unsafe.Pointer(v8)) = *(*TXML_Char)(unsafe.Pointer(v9))
- }
- }
- *(*TXML_Char)(unsafe.Pointer(uri)) = int8('\000')
- }
- (*(*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)
- } else {
- if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_defaultHandler != 0 {
- _reportDefault(tls, parser, enc, *(*uintptr)(unsafe.Pointer(bp)), *(*uintptr)(unsafe.Pointer(bp + 8)))
- }
- }
- for (*TTAG)(unsafe.Pointer(tag1)).Fbindings != 0 {
- b = (*TTAG)(unsafe.Pointer(tag1)).Fbindings
- if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_endNamespaceDeclHandler != 0 {
- (*(*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)
- }
- (*TTAG)(unsafe.Pointer(tag1)).Fbindings = (*TBINDING)(unsafe.Pointer((*TTAG)(unsafe.Pointer(tag1)).Fbindings)).FnextTagBinding
- (*TBINDING)(unsafe.Pointer(b)).FnextTagBinding = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_freeBindingList
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_freeBindingList = b
- (*Tprefix)(unsafe.Pointer((*TBINDING)(unsafe.Pointer(b)).Fprefix)).Fbinding = (*TBINDING)(unsafe.Pointer(b)).FprevPrefixBinding
- }
- if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_tagLevel == 0 && (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parsingStatus.Fparsing != int32(_XML_FINISHED) {
- if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parsingStatus.Fparsing == int32(_XML_SUSPENDED) {
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_processor = __ccgo_fp(_epilogProcessor)
- } else {
- return _epilogProcessor(tls, parser, *(*uintptr)(unsafe.Pointer(bp + 8)), end, nextPtr)
- }
- }
- }
- case int32(m_XML_TOK_CHAR_REF):
- n = (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*TENCODING)(unsafe.Pointer(enc)).FcharRefNumber})))(tls, enc, *(*uintptr)(unsafe.Pointer(bp)))
- if n < 0 {
- return int32(_XML_ERROR_BAD_CHAR_REF)
- }
- if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_characterDataHandler != 0 {
- (*(*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))
- } else {
- if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_defaultHandler != 0 {
- _reportDefault(tls, parser, enc, *(*uintptr)(unsafe.Pointer(bp)), *(*uintptr)(unsafe.Pointer(bp + 8)))
- }
- }
- case int32(m_XML_TOK_XML_DECL):
- return int32(_XML_ERROR_MISPLACED_XML_PI)
- case int32(m_XML_TOK_DATA_NEWLINE):
- if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_characterDataHandler != 0 {
- *(*TXML_Char)(unsafe.Pointer(bp + 92)) = int8(0xA)
- (*(*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))
- } else {
- if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_defaultHandler != 0 {
- _reportDefault(tls, parser, enc, *(*uintptr)(unsafe.Pointer(bp)), *(*uintptr)(unsafe.Pointer(bp + 8)))
- }
- }
- case int32(m_XML_TOK_CDATA_SECT_OPEN):
- if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_startCdataSectionHandler != 0 {
- (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_startCdataSectionHandler})))(tls, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_handlerArg)
- } else {
- if libc.Bool(0 != 0) && (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_characterDataHandler != 0 {
- (*(*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)
- } else {
- if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_defaultHandler != 0 {
- _reportDefault(tls, parser, enc, *(*uintptr)(unsafe.Pointer(bp)), *(*uintptr)(unsafe.Pointer(bp + 8)))
- }
- }
- }
- result3 = _doCdataSection(tls, parser, enc, bp+8, end, nextPtr, haveMore, account)
- if result3 != int32(_XML_ERROR_NONE) {
- return result3
- } else {
- if !(*(*uintptr)(unsafe.Pointer(bp + 8)) != 0) {
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_processor = __ccgo_fp(_cdataSectionProcessor)
- return result3
- }
- }
- case -int32(5):
- if haveMore != 0 {
- *(*uintptr)(unsafe.Pointer(nextPtr)) = *(*uintptr)(unsafe.Pointer(bp))
- return int32(_XML_ERROR_NONE)
- }
- if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_characterDataHandler != 0 {
- if !((*TENCODING)(unsafe.Pointer(enc)).FisUtf8 != 0) {
- *(*uintptr)(unsafe.Pointer(bp + 96)) = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_dataBuf
- (*(*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)
- (*(*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)))
- } else {
- (*(*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)))))
- }
- } else {
- if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_defaultHandler != 0 {
- _reportDefault(tls, parser, enc, *(*uintptr)(unsafe.Pointer(bp)), end)
- }
- }
- /* We are at the end of the final buffer, should we check for
- XML_SUSPENDED, XML_FINISHED?
- */
- if startTagLevel == 0 {
- *(*uintptr)(unsafe.Pointer(eventPP)) = end
- return int32(_XML_ERROR_NO_ELEMENTS)
- }
- if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_tagLevel != startTagLevel {
- *(*uintptr)(unsafe.Pointer(eventPP)) = end
- return int32(_XML_ERROR_ASYNC_ENTITY)
- }
- *(*uintptr)(unsafe.Pointer(nextPtr)) = end
- return int32(_XML_ERROR_NONE)
- case int32(m_XML_TOK_DATA_CHARS):
- charDataHandler = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_characterDataHandler
- if charDataHandler != 0 {
- if !((*TENCODING)(unsafe.Pointer(enc)).FisUtf8 != 0) {
- for {
- *(*uintptr)(unsafe.Pointer(bp + 104)) = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_dataBuf
- 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)
- *(*uintptr)(unsafe.Pointer(eventEndPP)) = *(*uintptr)(unsafe.Pointer(bp))
- (*(*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)))
- if convert_res1 == int32(_XML_CONVERT_COMPLETED) || convert_res1 == int32(_XML_CONVERT_INPUT_INCOMPLETE) {
- break
- }
- *(*uintptr)(unsafe.Pointer(eventPP)) = *(*uintptr)(unsafe.Pointer(bp))
- goto _10
- _10:
- }
- } else {
- (*(*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)))))
- }
- } else {
- if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_defaultHandler != 0 {
- _reportDefault(tls, parser, enc, *(*uintptr)(unsafe.Pointer(bp)), *(*uintptr)(unsafe.Pointer(bp + 8)))
- }
- }
- case int32(m_XML_TOK_PI):
- if !(_reportProcessingInstruction(tls, parser, enc, *(*uintptr)(unsafe.Pointer(bp)), *(*uintptr)(unsafe.Pointer(bp + 8))) != 0) {
- return int32(_XML_ERROR_NO_MEMORY)
- }
- case int32(m_XML_TOK_COMMENT):
- if !(_reportComment(tls, parser, enc, *(*uintptr)(unsafe.Pointer(bp)), *(*uintptr)(unsafe.Pointer(bp + 8))) != 0) {
- return int32(_XML_ERROR_NO_MEMORY)
- }
- default:
- /* All of the tokens produced by XmlContentTok() have their own
- * explicit cases, so this default is not strictly necessary.
- * However it is a useful safety net, so we retain the code and
- * simply exclude it from the coverage tests.
- *
- * LCOV_EXCL_START
- */
- if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_defaultHandler != 0 {
- _reportDefault(tls, parser, enc, *(*uintptr)(unsafe.Pointer(bp)), *(*uintptr)(unsafe.Pointer(bp + 8)))
- }
- break
- /* LCOV_EXCL_STOP */
- }
- v11 = *(*uintptr)(unsafe.Pointer(bp + 8))
- *(*uintptr)(unsafe.Pointer(bp)) = v11
- *(*uintptr)(unsafe.Pointer(eventPP)) = v11
- switch (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parsingStatus.Fparsing {
- case int32(_XML_SUSPENDED):
- *(*uintptr)(unsafe.Pointer(nextPtr)) = *(*uintptr)(unsafe.Pointer(bp + 8))
- return int32(_XML_ERROR_NONE)
- case int32(_XML_FINISHED):
- return int32(_XML_ERROR_ABORTED)
- default:
- }
- goto _1
- _1:
- }
- /* not reached */
- return r
- }
- // C documentation
- //
- // /* This function does not call free() on the allocated memory, merely
- // * moving it to the parser's m_freeBindingList where it can be freed or
- // * reused as appropriate.
- // */
- func _freeBindings(tls *libc.TLS, parser TXML_Parser, bindings uintptr) {
- var b uintptr
- _ = b
- for bindings != 0 {
- b = bindings
- /* m_startNamespaceDeclHandler will have been called for this
- * binding in addBindings(), so call the end handler now.
- */
- if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_endNamespaceDeclHandler != 0 {
- (*(*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)
- }
- bindings = (*TBINDING)(unsafe.Pointer(bindings)).FnextTagBinding
- (*TBINDING)(unsafe.Pointer(b)).FnextTagBinding = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_freeBindingList
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_freeBindingList = b
- (*Tprefix)(unsafe.Pointer((*TBINDING)(unsafe.Pointer(b)).Fprefix)).Fbinding = (*TBINDING)(unsafe.Pointer(b)).FprevPrefixBinding
- }
- }
- // C documentation
- //
- // /* Precondition: all arguments must be non-NULL;
- // Purpose:
- // - normalize attributes
- // - check attributes for well-formedness
- // - generate namespace aware attribute names (URI, prefix)
- // - build list of attributes for startElementHandler
- // - default attributes
- // - process namespace declarations (check and report them)
- // - generate namespace aware element name (URI, prefix)
- // */
- func _storeAtts(tls *libc.TLS, parser TXML_Parser, enc uintptr, attStr uintptr, tagNamePtr uintptr, bindingsPtr uintptr, account _XML_Account) (r _XML_Error) {
- bp := tls.Alloc(80)
- defer tls.Free(80)
- 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
- var attIndex, i, j, j1, n, nDefaultAtts, nPrefixes, oldAttsSize, prefixLen, v13, v17, v2, v23, v30, v33, v38, v40, v6, v7, v8, v9 int32
- var c TXML_Char
- var isCdata TXML_Bool
- var mask, uriHash, version, v14 uint64
- var nsAttsSize uint32
- var oldNsAttsPower, step, v10 uint8
- var result, result1, result2 _XML_Error
- var _ /* sip_key at bp+56 */ Tsipkey
- var _ /* sip_state at bp+0 */ Tsiphash
- _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = 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
- dtd = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_dtd /* the attribute list for the application */
- attIndex = 0
- nPrefixes = 0
- /* lookup the element type name */
- elementType = _lookup(tls, parser, dtd+40, (*TTAG_NAME)(unsafe.Pointer(tagNamePtr)).Fstr, uint64(0))
- if !(elementType != 0) {
- name = _poolCopyString(tls, dtd+160, (*TTAG_NAME)(unsafe.Pointer(tagNamePtr)).Fstr)
- if !(name != 0) {
- return int32(_XML_ERROR_NO_MEMORY)
- }
- elementType = _lookup(tls, parser, dtd+40, name, uint64(40))
- if !(elementType != 0) {
- return int32(_XML_ERROR_NO_MEMORY)
- }
- if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_ns != 0 && !(_setElementTypePrefix(tls, parser, elementType) != 0) {
- return int32(_XML_ERROR_NO_MEMORY)
- }
- }
- nDefaultAtts = (*TELEMENT_TYPE)(unsafe.Pointer(elementType)).FnDefaultAtts
- /* get the attributes from the tokenizer */
- 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)
- /* Detect and prevent integer overflow */
- if n > int32(m_INT_MAX)-nDefaultAtts {
- return int32(_XML_ERROR_NO_MEMORY)
- }
- if n+nDefaultAtts > (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_attsSize {
- oldAttsSize = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_attsSize
- /* Detect and prevent integer overflow */
- if nDefaultAtts > libc.Int32FromInt32(m_INT_MAX)-libc.Int32FromInt32(m_INIT_ATTS_SIZE) || n > int32(m_INT_MAX)-(nDefaultAtts+int32(m_INIT_ATTS_SIZE)) {
- return int32(_XML_ERROR_NO_MEMORY)
- }
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_attsSize = n + nDefaultAtts + int32(m_INIT_ATTS_SIZE)
- /* Detect and prevent integer overflow.
- * The preprocessor guard addresses the "always false" warning
- * from -Wtype-limits on platforms where
- * sizeof(unsigned int) < sizeof(size_t), e.g. on x86_64. */
- 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))
- if temp == libc.UintptrFromInt32(0) {
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_attsSize = oldAttsSize
- return int32(_XML_ERROR_NO_MEMORY)
- }
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_atts = temp
- if n > oldAttsSize {
- (*(*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)
- }
- }
- appAtts = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_atts
- i = 0
- for {
- if !(i < n) {
- break
- }
- currAtt = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_atts + uintptr(i)*32
- /* add the name and value to the attribute list */
- 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)))
- if !(attId != 0) {
- return int32(_XML_ERROR_NO_MEMORY)
- }
- /* Detect duplicate attributes by their QNames. This does not work when
- namespace processing is turned on and different prefixes for the same
- namespace are used. For this case we have a check further down.
- */
- if *(*TXML_Char)(unsafe.Pointer((*TATTRIBUTE_ID)(unsafe.Pointer(attId)).Fname + uintptr(-libc.Int32FromInt32(1)))) != 0 {
- if enc == (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_encoding {
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_eventPtr = (*(*TATTRIBUTE)(unsafe.Pointer((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_atts + uintptr(i)*32))).Fname
- }
- return int32(_XML_ERROR_DUPLICATE_ATTRIBUTE)
- }
- *(*TXML_Char)(unsafe.Pointer((*TATTRIBUTE_ID)(unsafe.Pointer(attId)).Fname + uintptr(-libc.Int32FromInt32(1)))) = int8(1)
- v2 = attIndex
- attIndex++
- *(*uintptr)(unsafe.Pointer(appAtts + uintptr(v2)*8)) = (*TATTRIBUTE_ID)(unsafe.Pointer(attId)).Fname
- if !((*(*TATTRIBUTE)(unsafe.Pointer((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_atts + uintptr(i)*32))).Fnormalized != 0) {
- isCdata = libc.Uint8FromInt32(1)
- /* figure out whether declared as other than CDATA */
- if (*TATTRIBUTE_ID)(unsafe.Pointer(attId)).FmaybeTokenized != 0 {
- j = 0
- for {
- if !(j < nDefaultAtts) {
- break
- }
- if attId == (*(*TDEFAULT_ATTRIBUTE)(unsafe.Pointer((*TELEMENT_TYPE)(unsafe.Pointer(elementType)).FdefaultAtts + uintptr(j)*24))).Fid {
- isCdata = (*(*TDEFAULT_ATTRIBUTE)(unsafe.Pointer((*TELEMENT_TYPE)(unsafe.Pointer(elementType)).FdefaultAtts + uintptr(j)*24))).FisCdata
- break
- }
- goto _3
- _3:
- ;
- j++
- }
- }
- /* normalize the attribute value */
- 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)
- if result != 0 {
- return result
- }
- *(*uintptr)(unsafe.Pointer(appAtts + uintptr(attIndex)*8)) = (*TSTRING_POOL)(unsafe.Pointer(parser + 784)).Fstart
- (*TSTRING_POOL)(unsafe.Pointer(parser + 784)).Fstart = (*TSTRING_POOL)(unsafe.Pointer(parser + 784)).Fptr
- } else {
- /* the value did not need normalizing */
- *(*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)
- if *(*uintptr)(unsafe.Pointer(appAtts + uintptr(attIndex)*8)) == uintptr(0) {
- return int32(_XML_ERROR_NO_MEMORY)
- }
- (*TSTRING_POOL)(unsafe.Pointer(parser + 784)).Fstart = (*TSTRING_POOL)(unsafe.Pointer(parser + 784)).Fptr
- }
- /* handle prefixed attribute names */
- if (*TATTRIBUTE_ID)(unsafe.Pointer(attId)).Fprefix != 0 {
- if (*TATTRIBUTE_ID)(unsafe.Pointer(attId)).Fxmlns != 0 {
- /* deal with namespace declarations here */
- result1 = _addBinding(tls, parser, (*TATTRIBUTE_ID)(unsafe.Pointer(attId)).Fprefix, attId, *(*uintptr)(unsafe.Pointer(appAtts + uintptr(attIndex)*8)), bindingsPtr)
- if result1 != 0 {
- return result1
- }
- attIndex--
- } else {
- /* deal with other prefixed names later */
- attIndex++
- nPrefixes++
- *(*TXML_Char)(unsafe.Pointer((*TATTRIBUTE_ID)(unsafe.Pointer(attId)).Fname + uintptr(-libc.Int32FromInt32(1)))) = int8(2)
- }
- } else {
- attIndex++
- }
- goto _1
- _1:
- ;
- i++
- }
- /* set-up for XML_GetSpecifiedAttributeCount and XML_GetIdAttributeIndex */
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_nSpecifiedAtts = attIndex
- 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 {
- i = 0
- for {
- if !(i < attIndex) {
- break
- }
- if *(*uintptr)(unsafe.Pointer(appAtts + uintptr(i)*8)) == (*TATTRIBUTE_ID)(unsafe.Pointer((*TELEMENT_TYPE)(unsafe.Pointer(elementType)).FidAtt)).Fname {
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_idAttIndex = i
- break
- }
- goto _4
- _4:
- ;
- i += int32(2)
- }
- } else {
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_idAttIndex = -int32(1)
- }
- /* do attribute defaulting */
- i = 0
- for {
- if !(i < nDefaultAtts) {
- break
- }
- da = (*TELEMENT_TYPE)(unsafe.Pointer(elementType)).FdefaultAtts + uintptr(i)*24
- 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 {
- if (*TATTRIBUTE_ID)(unsafe.Pointer((*TDEFAULT_ATTRIBUTE)(unsafe.Pointer(da)).Fid)).Fprefix != 0 {
- if (*TATTRIBUTE_ID)(unsafe.Pointer((*TDEFAULT_ATTRIBUTE)(unsafe.Pointer(da)).Fid)).Fxmlns != 0 {
- 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)
- if result2 != 0 {
- return result2
- }
- } else {
- *(*TXML_Char)(unsafe.Pointer((*TATTRIBUTE_ID)(unsafe.Pointer((*TDEFAULT_ATTRIBUTE)(unsafe.Pointer(da)).Fid)).Fname + uintptr(-libc.Int32FromInt32(1)))) = int8(2)
- nPrefixes++
- v6 = attIndex
- attIndex++
- *(*uintptr)(unsafe.Pointer(appAtts + uintptr(v6)*8)) = (*TATTRIBUTE_ID)(unsafe.Pointer((*TDEFAULT_ATTRIBUTE)(unsafe.Pointer(da)).Fid)).Fname
- v7 = attIndex
- attIndex++
- *(*uintptr)(unsafe.Pointer(appAtts + uintptr(v7)*8)) = (*TDEFAULT_ATTRIBUTE)(unsafe.Pointer(da)).Fvalue
- }
- } else {
- *(*TXML_Char)(unsafe.Pointer((*TATTRIBUTE_ID)(unsafe.Pointer((*TDEFAULT_ATTRIBUTE)(unsafe.Pointer(da)).Fid)).Fname + uintptr(-libc.Int32FromInt32(1)))) = int8(1)
- v8 = attIndex
- attIndex++
- *(*uintptr)(unsafe.Pointer(appAtts + uintptr(v8)*8)) = (*TATTRIBUTE_ID)(unsafe.Pointer((*TDEFAULT_ATTRIBUTE)(unsafe.Pointer(da)).Fid)).Fname
- v9 = attIndex
- attIndex++
- *(*uintptr)(unsafe.Pointer(appAtts + uintptr(v9)*8)) = (*TDEFAULT_ATTRIBUTE)(unsafe.Pointer(da)).Fvalue
- }
- }
- goto _5
- _5:
- ;
- i++
- }
- *(*uintptr)(unsafe.Pointer(appAtts + uintptr(attIndex)*8)) = uintptr(0)
- /* expand prefixed attribute names, check for duplicates,
- and clear flags that say whether attributes were specified */
- i = 0
- if nPrefixes != 0 { /* hash table index */
- version = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_nsAttsVersion
- /* Detect and prevent invalid shift */
- if uint64((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_nsAttsPower) >= libc.Uint64FromInt64(4)*libc.Uint64FromInt32(8) {
- return int32(_XML_ERROR_NO_MEMORY)
- }
- nsAttsSize = uint32(1) << (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_nsAttsPower
- oldNsAttsPower = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_nsAttsPower
- /* size of hash table must be at least 2 * (# of prefixed attributes) */
- if nPrefixes<<int32(1)>>(*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_nsAttsPower != 0 {
- /* hash table size must also be a power of 2 and >= 8 */
- for {
- v11 = parser + 760
- v10 = *(*uint8)(unsafe.Pointer(v11))
- *(*uint8)(unsafe.Pointer(v11))++
- if !(nPrefixes>>v10 != 0) {
- break
- }
- }
- if libc.Int32FromUint8((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_nsAttsPower) < int32(3) {
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_nsAttsPower = uint8(3)
- }
- /* Detect and prevent invalid shift */
- if uint64((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_nsAttsPower) >= libc.Uint64FromInt64(4)*libc.Uint64FromInt32(8) {
- /* Restore actual size of memory in m_nsAtts */
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_nsAttsPower = oldNsAttsPower
- return int32(_XML_ERROR_NO_MEMORY)
- }
- nsAttsSize = uint32(1) << (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_nsAttsPower
- /* Detect and prevent integer overflow.
- * The preprocessor guard addresses the "always false" warning
- * from -Wtype-limits on platforms where
- * sizeof(unsigned int) < sizeof(size_t), e.g. on x86_64. */
- 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))
- if !(temp1 != 0) {
- /* Restore actual size of memory in m_nsAtts */
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_nsAttsPower = oldNsAttsPower
- return int32(_XML_ERROR_NO_MEMORY)
- }
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_nsAtts = temp1
- version = uint64(0) /* force re-initialization of m_nsAtts hash table */
- }
- /* using a version flag saves us from initializing m_nsAtts every time */
- if !(version != 0) { /* initialize version flags when version wraps around */
- version = uint64(m_INIT_ATTS_VERSION)
- j1 = libc.Int32FromUint32(nsAttsSize)
- for {
- if !(j1 != 0) {
- break
- }
- j1--
- v13 = j1
- (*(*TNS_ATT)(unsafe.Pointer((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_nsAtts + uintptr(v13)*24))).Fversion = version
- goto _12
- _12:
- }
- }
- version--
- v14 = version
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_nsAttsVersion = v14
- /* expand prefixed names and check for duplicates */
- for {
- if !(i < attIndex) {
- break
- }
- s = *(*uintptr)(unsafe.Pointer(appAtts + uintptr(i)*8))
- if int32(*(*TXML_Char)(unsafe.Pointer(s + uintptr(-libc.Int32FromInt32(1))))) == int32(2) {
- _copy_salt_to_sipkey(tls, parser, bp+56)
- _sip24_init(tls, bp, bp+56)
- *(*TXML_Char)(unsafe.Pointer(s + uintptr(-libc.Int32FromInt32(1)))) = 0 /* clear flag */
- id = _lookup(tls, parser, dtd+80, s, uint64(0))
- if !(id != 0) || !((*TATTRIBUTE_ID)(unsafe.Pointer(id)).Fprefix != 0) {
- /* This code is walking through the appAtts array, dealing
- * with (in this case) a prefixed attribute name. To be in
- * the array, the attribute must have already been bound, so
- * has to have passed through the hash table lookup once
- * already. That implies that an entry for it already
- * exists, so the lookup above will return a pointer to
- * already allocated memory. There is no opportunaity for
- * the allocator to fail, so the condition above cannot be
- * fulfilled.
- *
- * Since it is difficult to be certain that the above
- * analysis is complete, we retain the test and merely
- * remove the code from coverage tests.
- */
- return int32(_XML_ERROR_NO_MEMORY) /* LCOV_EXCL_LINE */
- }
- b = (*TPREFIX)(unsafe.Pointer((*TATTRIBUTE_ID)(unsafe.Pointer(id)).Fprefix)).Fbinding
- if !(b != 0) {
- return int32(_XML_ERROR_UNBOUND_PREFIX)
- }
- j1 = 0
- for {
- if !(j1 < (*TBINDING)(unsafe.Pointer(b)).FuriLen) {
- break
- }
- c = *(*TXML_Char)(unsafe.Pointer((*TBINDING)(unsafe.Pointer(b)).Furi + uintptr(j1)))
- if (*TSTRING_POOL)(unsafe.Pointer(parser+784)).Fptr == (*TSTRING_POOL)(unsafe.Pointer(parser+784)).Fend && !(_poolGrow(tls, parser+784) != 0) {
- v17 = 0
- } else {
- v19 = parser + 784 + 24
- v18 = *(*uintptr)(unsafe.Pointer(v19))
- *(*uintptr)(unsafe.Pointer(v19))++
- *(*TXML_Char)(unsafe.Pointer(v18)) = c
- v17 = libc.Int32FromInt32(1)
- }
- if !(v17 != 0) {
- return int32(_XML_ERROR_NO_MEMORY)
- }
- goto _16
- _16:
- ;
- j1++
- }
- _sip24_update(tls, bp, (*TBINDING)(unsafe.Pointer(b)).Furi, libc.Uint64FromInt32((*TBINDING)(unsafe.Pointer(b)).FuriLen)*uint64(1))
- for {
- v20 = s
- s++
- if !(int32(*(*TXML_Char)(unsafe.Pointer(v20))) != int32(m_ASCII_COLON)) {
- break
- }
- }
- _sip24_update(tls, bp, s, _keylen(tls, s)*uint64(1))
- for { /* copies null terminator */
- if (*TSTRING_POOL)(unsafe.Pointer(parser+784)).Fptr == (*TSTRING_POOL)(unsafe.Pointer(parser+784)).Fend && !(_poolGrow(tls, parser+784) != 0) {
- v23 = 0
- } else {
- v25 = parser + 784 + 24
- v24 = *(*uintptr)(unsafe.Pointer(v25))
- *(*uintptr)(unsafe.Pointer(v25))++
- *(*TXML_Char)(unsafe.Pointer(v24)) = *(*TXML_Char)(unsafe.Pointer(s))
- v23 = libc.Int32FromInt32(1)
- }
- if !(v23 != 0) {
- return int32(_XML_ERROR_NO_MEMORY)
- }
- goto _22
- _22:
- ;
- v21 = s
- s++
- if !(*(*TXML_Char)(unsafe.Pointer(v21)) != 0) {
- break
- }
- }
- uriHash = _sip24_final(tls, bp)
- /* Check hash table for duplicate of expanded name (uriName).
- Derived from code in lookup(parser, HASH_TABLE *table, ...).
- */
- step = uint8(0)
- mask = uint64(nsAttsSize - uint32(1))
- j1 = libc.Int32FromUint64(uriHash & mask) /* index into hash table */
- for (*(*TNS_ATT)(unsafe.Pointer((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_nsAtts + uintptr(j1)*24))).Fversion == version {
- /* for speed we compare stored hash values first */
- if uriHash == (*(*TNS_ATT)(unsafe.Pointer((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_nsAtts + uintptr(j1)*24))).Fhash {
- s1 = (*TSTRING_POOL)(unsafe.Pointer(parser + 784)).Fstart
- s2 = (*(*TNS_ATT)(unsafe.Pointer((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_nsAtts + uintptr(j1)*24))).FuriName
- /* s1 is null terminated, but not s2 */
- for {
- if !(int32(*(*TXML_Char)(unsafe.Pointer(s1))) == int32(*(*TXML_Char)(unsafe.Pointer(s2))) && int32(*(*TXML_Char)(unsafe.Pointer(s1))) != 0) {
- break
- }
- goto _26
- _26:
- ;
- s1++
- s2++
- }
- if int32(*(*TXML_Char)(unsafe.Pointer(s1))) == 0 {
- return int32(_XML_ERROR_DUPLICATE_ATTRIBUTE)
- }
- }
- if !(step != 0) {
- step = uint8(uriHash & ^mask >> (libc.Int32FromUint8((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_nsAttsPower)-libc.Int32FromInt32(1)) & (mask>>libc.Int32FromInt32(2)) | libc.Uint64FromInt32(1))
- }
- if j1 < libc.Int32FromUint8(step) {
- j1 = int32(uint32(j1) + (nsAttsSize - uint32(step)))
- } else {
- j1 -= libc.Int32FromUint8(step)
- }
- }
- if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_ns_triplets != 0 { /* append namespace separator and prefix */
- *(*TXML_Char)(unsafe.Pointer((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_tempPool.Fptr + uintptr(-libc.Int32FromInt32(1)))) = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_namespaceSeparator
- s = (*Tprefix)(unsafe.Pointer((*TBINDING)(unsafe.Pointer(b)).Fprefix)).Fname
- for {
- if (*TSTRING_POOL)(unsafe.Pointer(parser+784)).Fptr == (*TSTRING_POOL)(unsafe.Pointer(parser+784)).Fend && !(_poolGrow(tls, parser+784) != 0) {
- v30 = 0
- } else {
- v32 = parser + 784 + 24
- v31 = *(*uintptr)(unsafe.Pointer(v32))
- *(*uintptr)(unsafe.Pointer(v32))++
- *(*TXML_Char)(unsafe.Pointer(v31)) = *(*TXML_Char)(unsafe.Pointer(s))
- v30 = libc.Int32FromInt32(1)
- }
- if !(v30 != 0) {
- return int32(_XML_ERROR_NO_MEMORY)
- }
- goto _29
- _29:
- ;
- v28 = s
- s++
- if !(*(*TXML_Char)(unsafe.Pointer(v28)) != 0) {
- break
- }
- }
- }
- /* store expanded name in attribute list */
- s = (*TSTRING_POOL)(unsafe.Pointer(parser + 784)).Fstart
- (*TSTRING_POOL)(unsafe.Pointer(parser + 784)).Fstart = (*TSTRING_POOL)(unsafe.Pointer(parser + 784)).Fptr
- *(*uintptr)(unsafe.Pointer(appAtts + uintptr(i)*8)) = s
- /* fill empty slot with new version, uriName and hash value */
- (*(*TNS_ATT)(unsafe.Pointer((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_nsAtts + uintptr(j1)*24))).Fversion = version
- (*(*TNS_ATT)(unsafe.Pointer((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_nsAtts + uintptr(j1)*24))).Fhash = uriHash
- (*(*TNS_ATT)(unsafe.Pointer((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_nsAtts + uintptr(j1)*24))).FuriName = s
- nPrefixes--
- v33 = nPrefixes
- if !(v33 != 0) {
- i += int32(2)
- break
- }
- } else { /* not prefixed */
- *(*TXML_Char)(unsafe.Pointer(s + uintptr(-libc.Int32FromInt32(1)))) = 0
- } /* clear flag */
- goto _15
- _15:
- ;
- i += int32(2)
- }
- }
- /* clear flags for the remaining attributes */
- for {
- if !(i < attIndex) {
- break
- }
- *(*TXML_Char)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(appAtts + uintptr(i)*8)) + uintptr(-libc.Int32FromInt32(1)))) = 0
- goto _34
- _34:
- ;
- i += int32(2)
- }
- binding = *(*uintptr)(unsafe.Pointer(bindingsPtr))
- for {
- if !(binding != 0) {
- break
- }
- *(*TXML_Char)(unsafe.Pointer((*Tattribute_id)(unsafe.Pointer((*TBINDING)(unsafe.Pointer(binding)).FattId)).Fname + uintptr(-libc.Int32FromInt32(1)))) = 0
- goto _35
- _35:
- ;
- binding = (*TBINDING)(unsafe.Pointer(binding)).FnextTagBinding
- }
- if !((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_ns != 0) {
- return int32(_XML_ERROR_NONE)
- }
- /* expand the element type name */
- if (*TELEMENT_TYPE)(unsafe.Pointer(elementType)).Fprefix != 0 {
- binding = (*TPREFIX)(unsafe.Pointer((*TELEMENT_TYPE)(unsafe.Pointer(elementType)).Fprefix)).Fbinding
- if !(binding != 0) {
- return int32(_XML_ERROR_UNBOUND_PREFIX)
- }
- localPart = (*TTAG_NAME)(unsafe.Pointer(tagNamePtr)).Fstr
- for {
- v36 = localPart
- localPart++
- if !(int32(*(*TXML_Char)(unsafe.Pointer(v36))) != int32(m_ASCII_COLON)) {
- break
- }
- }
- } else {
- if (*TDTD)(unsafe.Pointer(dtd)).FdefaultPrefix.Fbinding != 0 {
- binding = (*TDTD)(unsafe.Pointer(dtd)).FdefaultPrefix.Fbinding
- localPart = (*TTAG_NAME)(unsafe.Pointer(tagNamePtr)).Fstr
- } else {
- return int32(_XML_ERROR_NONE)
- }
- }
- prefixLen = 0
- if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_ns_triplets != 0 && (*Tprefix)(unsafe.Pointer((*TBINDING)(unsafe.Pointer(binding)).Fprefix)).Fname != 0 {
- for {
- v38 = prefixLen
- prefixLen++
- if !(*(*TXML_Char)(unsafe.Pointer((*Tprefix)(unsafe.Pointer((*TBINDING)(unsafe.Pointer(binding)).Fprefix)).Fname + uintptr(v38))) != 0) {
- break
- }
- goto _37
- _37:
- } /* prefixLen includes null terminator */
- }
- (*TTAG_NAME)(unsafe.Pointer(tagNamePtr)).FlocalPart = localPart
- (*TTAG_NAME)(unsafe.Pointer(tagNamePtr)).FuriLen = (*TBINDING)(unsafe.Pointer(binding)).FuriLen
- (*TTAG_NAME)(unsafe.Pointer(tagNamePtr)).Fprefix = (*Tprefix)(unsafe.Pointer((*TBINDING)(unsafe.Pointer(binding)).Fprefix)).Fname
- (*TTAG_NAME)(unsafe.Pointer(tagNamePtr)).FprefixLen = prefixLen
- i = 0
- for {
- v40 = i
- i++
- if !(*(*TXML_Char)(unsafe.Pointer(localPart + uintptr(v40))) != 0) {
- break
- }
- goto _39
- _39:
- } /* i includes null terminator */
- /* Detect and prevent integer overflow */
- if (*TBINDING)(unsafe.Pointer(binding)).FuriLen > int32(m_INT_MAX)-prefixLen || i > int32(m_INT_MAX)-((*TBINDING)(unsafe.Pointer(binding)).FuriLen+prefixLen) {
- return int32(_XML_ERROR_NO_MEMORY)
- }
- n = i + (*TBINDING)(unsafe.Pointer(binding)).FuriLen + prefixLen
- if n > (*TBINDING)(unsafe.Pointer(binding)).FuriAlloc {
- /* Detect and prevent integer overflow */
- if n > libc.Int32FromInt32(m_INT_MAX)-libc.Int32FromInt32(m_EXPAND_SPARE) {
- return int32(_XML_ERROR_NO_MEMORY)
- }
- /* Detect and prevent integer overflow.
- * The preprocessor guard addresses the "always false" warning
- * from -Wtype-limits on platforms where
- * sizeof(unsigned int) < sizeof(size_t), e.g. on x86_64. */
- 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))
- if !(uri != 0) {
- return int32(_XML_ERROR_NO_MEMORY)
- }
- (*TBINDING)(unsafe.Pointer(binding)).FuriAlloc = n + int32(m_EXPAND_SPARE)
- libc.Xmemcpy(tls, uri, (*TBINDING)(unsafe.Pointer(binding)).Furi, libc.Uint64FromInt32((*TBINDING)(unsafe.Pointer(binding)).FuriLen)*uint64(1))
- p = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_tagStack
- for {
- if !(p != 0) {
- break
- }
- if (*TTAG)(unsafe.Pointer(p)).Fname.Fstr == (*TBINDING)(unsafe.Pointer(binding)).Furi {
- (*TTAG)(unsafe.Pointer(p)).Fname.Fstr = uri
- }
- goto _41
- _41:
- ;
- p = (*TTAG)(unsafe.Pointer(p)).Fparent
- }
- (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_mem.Ffree_fcn})))(tls, (*TBINDING)(unsafe.Pointer(binding)).Furi)
- (*TBINDING)(unsafe.Pointer(binding)).Furi = uri
- }
- /* if m_namespaceSeparator != '\0' then uri includes it already */
- uri = (*TBINDING)(unsafe.Pointer(binding)).Furi + uintptr((*TBINDING)(unsafe.Pointer(binding)).FuriLen)
- libc.Xmemcpy(tls, uri, localPart, libc.Uint64FromInt32(i)*uint64(1))
- /* we always have a namespace separator between localPart and prefix */
- if prefixLen != 0 {
- uri += uintptr(i - int32(1))
- *(*TXML_Char)(unsafe.Pointer(uri)) = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_namespaceSeparator /* replace null terminator */
- libc.Xmemcpy(tls, uri+uintptr(1), (*Tprefix)(unsafe.Pointer((*TBINDING)(unsafe.Pointer(binding)).Fprefix)).Fname, libc.Uint64FromInt32(prefixLen)*uint64(1))
- }
- (*TTAG_NAME)(unsafe.Pointer(tagNamePtr)).Fstr = (*TBINDING)(unsafe.Pointer(binding)).Furi
- return int32(_XML_ERROR_NONE)
- }
- func _is_rfc3986_uri_char(tls *libc.TLS, candidate TXML_Char) (r TXML_Bool) {
- // For the RFC 3986 ANBF grammar see
- // https://datatracker.ietf.org/doc/html/rfc3986#appendix-A
- switch int32(candidate) {
- // From rule "ALPHA" (uppercase half)
- case int32('A'):
- fallthrough
- case int32('B'):
- fallthrough
- case int32('C'):
- fallthrough
- case int32('D'):
- fallthrough
- case int32('E'):
- fallthrough
- case int32('F'):
- fallthrough
- case int32('G'):
- fallthrough
- case int32('H'):
- fallthrough
- case int32('I'):
- fallthrough
- case int32('J'):
- fallthrough
- case int32('K'):
- fallthrough
- case int32('L'):
- fallthrough
- case int32('M'):
- fallthrough
- case int32('N'):
- fallthrough
- case int32('O'):
- fallthrough
- case int32('P'):
- fallthrough
- case int32('Q'):
- fallthrough
- case int32('R'):
- fallthrough
- case int32('S'):
- fallthrough
- case int32('T'):
- fallthrough
- case int32('U'):
- fallthrough
- case int32('V'):
- fallthrough
- case int32('W'):
- fallthrough
- case int32('X'):
- fallthrough
- case int32('Y'):
- fallthrough
- case int32('Z'):
- // From rule "ALPHA" (lowercase half)
- fallthrough
- case int32('a'):
- fallthrough
- case int32('b'):
- fallthrough
- case int32('c'):
- fallthrough
- case int32('d'):
- fallthrough
- case int32('e'):
- fallthrough
- case int32('f'):
- fallthrough
- case int32('g'):
- fallthrough
- case int32('h'):
- fallthrough
- case int32('i'):
- fallthrough
- case int32('j'):
- fallthrough
- case int32('k'):
- fallthrough
- case int32('l'):
- fallthrough
- case int32('m'):
- fallthrough
- case int32('n'):
- fallthrough
- case int32('o'):
- fallthrough
- case int32('p'):
- fallthrough
- case int32('q'):
- fallthrough
- case int32('r'):
- fallthrough
- case int32('s'):
- fallthrough
- case int32('t'):
- fallthrough
- case int32('u'):
- fallthrough
- case int32('v'):
- fallthrough
- case int32('w'):
- fallthrough
- case int32('x'):
- fallthrough
- case int32('y'):
- fallthrough
- case int32('z'):
- // From rule "DIGIT"
- fallthrough
- case int32('0'):
- fallthrough
- case int32('1'):
- fallthrough
- case int32('2'):
- fallthrough
- case int32('3'):
- fallthrough
- case int32('4'):
- fallthrough
- case int32('5'):
- fallthrough
- case int32('6'):
- fallthrough
- case int32('7'):
- fallthrough
- case int32('8'):
- fallthrough
- case int32('9'):
- // From rule "pct-encoded"
- fallthrough
- case int32('%'):
- // From rule "unreserved"
- fallthrough
- case int32('-'):
- fallthrough
- case int32('.'):
- fallthrough
- case int32('_'):
- fallthrough
- case int32('~'):
- // From rule "gen-delims"
- fallthrough
- case int32(':'):
- fallthrough
- case int32('/'):
- fallthrough
- case int32('?'):
- fallthrough
- case int32('#'):
- fallthrough
- case int32('['):
- fallthrough
- case int32(']'):
- fallthrough
- case int32('@'):
- // From rule "sub-delims"
- fallthrough
- case int32('!'):
- fallthrough
- case int32('$'):
- fallthrough
- case int32('&'):
- fallthrough
- case int32('\''):
- fallthrough
- case int32('('):
- fallthrough
- case int32(')'):
- fallthrough
- case int32('*'):
- fallthrough
- case int32('+'):
- fallthrough
- case int32(','):
- fallthrough
- case int32(';'):
- fallthrough
- case int32('='):
- return libc.Uint8FromInt32(1)
- default:
- return libc.Uint8FromInt32(0)
- }
- return r
- }
- // C documentation
- //
- // /* addBinding() overwrites the value of prefix->binding without checking.
- // Therefore one must keep track of the old value outside of addBinding().
- // */
- func _addBinding(tls *libc.TLS, parser TXML_Parser, prefix uintptr, attId uintptr, uri uintptr, bindingsPtr uintptr) (r _XML_Error) {
- var b, temp, v3 uintptr
- var isXML, isXMLNS, mustBeXML TXML_Bool
- var len1, v2 int32
- _, _, _, _, _, _, _, _ = b, isXML, isXMLNS, len1, mustBeXML, temp, v2, v3
- mustBeXML = libc.Uint8FromInt32(0)
- isXML = libc.Uint8FromInt32(1)
- isXMLNS = libc.Uint8FromInt32(1)
- /* empty URI is only valid for default namespace per XML NS 1.0 (not 1.1) */
- if int32(*(*TXML_Char)(unsafe.Pointer(uri))) == int32('\000') && (*TPREFIX)(unsafe.Pointer(prefix)).Fname != 0 {
- return int32(_XML_ERROR_UNDECLARING_PREFIX)
- }
- 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) {
- /* Not allowed to bind xmlns */
- 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') {
- return int32(_XML_ERROR_RESERVED_PREFIX_XMLNS)
- }
- if int32(*(*TXML_Char)(unsafe.Pointer((*TPREFIX)(unsafe.Pointer(prefix)).Fname + 3))) == int32('\000') {
- mustBeXML = libc.Uint8FromInt32(1)
- }
- }
- len1 = 0
- for {
- if !(*(*TXML_Char)(unsafe.Pointer(uri + uintptr(len1))) != 0) {
- break
- }
- if isXML != 0 && (len1 > _xmlLen || int32(*(*TXML_Char)(unsafe.Pointer(uri + uintptr(len1)))) != int32(_xmlNamespace[len1])) {
- isXML = libc.Uint8FromInt32(0)
- }
- if !(mustBeXML != 0) && isXMLNS != 0 && (len1 > _xmlnsLen || int32(*(*TXML_Char)(unsafe.Pointer(uri + uintptr(len1)))) != int32(_xmlnsNamespace[len1])) {
- isXMLNS = libc.Uint8FromInt32(0)
- }
- // NOTE: While Expat does not validate namespace URIs against RFC 3986
- // today (and is not REQUIRED to do so with regard to the XML 1.0
- // namespaces specification) we have to at least make sure, that
- // the application on top of Expat (that is likely splitting expanded
- // element names ("qualified names") of form
- // "[uri sep] local [sep prefix] '\0'" back into 1, 2 or 3 pieces
- // in its element handler code) cannot be confused by an attacker
- // putting additional namespace separator characters into namespace
- // declarations. That would be ambiguous and not to be expected.
- //
- // While the HTML API docs of function XML_ParserCreateNS have been
- // advising against use of a namespace separator character that can
- // appear in a URI for >20 years now, some widespread applications
- // are using URI characters (':' (colon) in particular) for a
- // namespace separator, in practice. To keep these applications
- // functional, we only reject namespaces URIs containing the
- // application-chosen namespace separator if the chosen separator
- // is a non-URI character with regard to RFC 3986.
- 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) {
- return int32(_XML_ERROR_SYNTAX)
- }
- goto _1
- _1:
- ;
- len1++
- }
- isXML = libc.BoolUint8(isXML != 0 && len1 == _xmlLen)
- isXMLNS = libc.BoolUint8(isXMLNS != 0 && len1 == _xmlnsLen)
- if libc.Int32FromUint8(mustBeXML) != libc.Int32FromUint8(isXML) {
- if mustBeXML != 0 {
- v2 = int32(_XML_ERROR_RESERVED_PREFIX_XML)
- } else {
- v2 = int32(_XML_ERROR_RESERVED_NAMESPACE_URI)
- }
- return v2
- }
- if isXMLNS != 0 {
- return int32(_XML_ERROR_RESERVED_NAMESPACE_URI)
- }
- if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_namespaceSeparator != 0 {
- len1++
- }
- if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_freeBindingList != 0 {
- b = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_freeBindingList
- if len1 > (*TBINDING)(unsafe.Pointer(b)).FuriAlloc {
- /* Detect and prevent integer overflow */
- if len1 > libc.Int32FromInt32(m_INT_MAX)-libc.Int32FromInt32(m_EXPAND_SPARE) {
- return int32(_XML_ERROR_NO_MEMORY)
- }
- /* Detect and prevent integer overflow.
- * The preprocessor guard addresses the "always false" warning
- * from -Wtype-limits on platforms where
- * sizeof(unsigned int) < sizeof(size_t), e.g. on x86_64. */
- 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)))
- if temp == libc.UintptrFromInt32(0) {
- return int32(_XML_ERROR_NO_MEMORY)
- }
- (*TBINDING)(unsafe.Pointer(b)).Furi = temp
- (*TBINDING)(unsafe.Pointer(b)).FuriAlloc = len1 + int32(m_EXPAND_SPARE)
- }
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_freeBindingList = (*TBINDING)(unsafe.Pointer(b)).FnextTagBinding
- } else {
- b = (*(*func(*libc.TLS, Tsize_t) uintptr)(unsafe.Pointer(&struct{ uintptr }{(*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_mem.Fmalloc_fcn})))(tls, libc.Uint64FromInt64(48))
- if !(b != 0) {
- return int32(_XML_ERROR_NO_MEMORY)
- }
- /* Detect and prevent integer overflow */
- if len1 > libc.Int32FromInt32(m_INT_MAX)-libc.Int32FromInt32(m_EXPAND_SPARE) {
- return int32(_XML_ERROR_NO_MEMORY)
- }
- /* Detect and prevent integer overflow.
- * The preprocessor guard addresses the "always false" warning
- * from -Wtype-limits on platforms where
- * sizeof(unsigned int) < sizeof(size_t), e.g. on x86_64. */
- (*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)))
- if !((*TBINDING)(unsafe.Pointer(b)).Furi != 0) {
- (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_mem.Ffree_fcn})))(tls, b)
- return int32(_XML_ERROR_NO_MEMORY)
- }
- (*TBINDING)(unsafe.Pointer(b)).FuriAlloc = len1 + int32(m_EXPAND_SPARE)
- }
- (*TBINDING)(unsafe.Pointer(b)).FuriLen = len1
- libc.Xmemcpy(tls, (*TBINDING)(unsafe.Pointer(b)).Furi, uri, libc.Uint64FromInt32(len1)*uint64(1))
- if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_namespaceSeparator != 0 {
- *(*TXML_Char)(unsafe.Pointer((*TBINDING)(unsafe.Pointer(b)).Furi + uintptr(len1-int32(1)))) = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_namespaceSeparator
- }
- (*TBINDING)(unsafe.Pointer(b)).Fprefix = prefix
- (*TBINDING)(unsafe.Pointer(b)).FattId = attId
- (*TBINDING)(unsafe.Pointer(b)).FprevPrefixBinding = (*TPREFIX)(unsafe.Pointer(prefix)).Fbinding
- /* NULL binding when default namespace undeclared */
- if int32(*(*TXML_Char)(unsafe.Pointer(uri))) == int32('\000') && prefix == (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_dtd+304 {
- (*TPREFIX)(unsafe.Pointer(prefix)).Fbinding = libc.UintptrFromInt32(0)
- } else {
- (*TPREFIX)(unsafe.Pointer(prefix)).Fbinding = b
- }
- (*TBINDING)(unsafe.Pointer(b)).FnextTagBinding = *(*uintptr)(unsafe.Pointer(bindingsPtr))
- *(*uintptr)(unsafe.Pointer(bindingsPtr)) = b
- /* if attId == NULL then we are not starting a namespace scope */
- if attId != 0 && (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_startNamespaceDeclHandler != 0 {
- if (*TPREFIX)(unsafe.Pointer(prefix)).Fbinding != 0 {
- v3 = uri
- } else {
- v3 = uintptr(0)
- }
- (*(*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)
- }
- return int32(_XML_ERROR_NONE)
- }
- // "http://www.w3.org/XML/1998/namespace"
- var _xmlNamespace = [37]TXML_Char{
- 0: int8(m_ASCII_h),
- 1: int8(m_ASCII_t),
- 2: int8(m_ASCII_t),
- 3: int8(m_ASCII_p),
- 4: int8(m_ASCII_COLON),
- 5: int8(m_ASCII_SLASH),
- 6: int8(m_ASCII_SLASH),
- 7: int8(m_ASCII_w),
- 8: int8(m_ASCII_w),
- 9: int8(m_ASCII_w),
- 10: int8(m_ASCII_PERIOD),
- 11: int8(m_ASCII_w),
- 12: int8(m_ASCII_3),
- 13: int8(m_ASCII_PERIOD),
- 14: int8(m_ASCII_o),
- 15: int8(m_ASCII_r),
- 16: int8(m_ASCII_g),
- 17: int8(m_ASCII_SLASH),
- 18: int8(m_ASCII_X),
- 19: int8(m_ASCII_M),
- 20: int8(m_ASCII_L),
- 21: int8(m_ASCII_SLASH),
- 22: int8(m_ASCII_1),
- 23: int8(m_ASCII_9),
- 24: int8(m_ASCII_9),
- 25: int8(m_ASCII_8),
- 26: int8(m_ASCII_SLASH),
- 27: int8(m_ASCII_n),
- 28: int8(m_ASCII_a),
- 29: int8(m_ASCII_m),
- 30: int8(m_ASCII_e),
- 31: int8(m_ASCII_s),
- 32: int8(m_ASCII_p),
- 33: int8(m_ASCII_a),
- 34: int8(m_ASCII_c),
- 35: int8(m_ASCII_e),
- }
- var _xmlLen = libc.Int32FromUint64(libc.Uint64FromInt32(libc.Int32FromInt64(37))/libc.Uint64FromInt64(1) - libc.Uint64FromInt32(1))
- // "http://www.w3.org/2000/xmlns/"
- var _xmlnsNamespace = [30]TXML_Char{
- 0: int8(m_ASCII_h),
- 1: int8(m_ASCII_t),
- 2: int8(m_ASCII_t),
- 3: int8(m_ASCII_p),
- 4: int8(m_ASCII_COLON),
- 5: int8(m_ASCII_SLASH),
- 6: int8(m_ASCII_SLASH),
- 7: int8(m_ASCII_w),
- 8: int8(m_ASCII_w),
- 9: int8(m_ASCII_w),
- 10: int8(m_ASCII_PERIOD),
- 11: int8(m_ASCII_w),
- 12: int8(m_ASCII_3),
- 13: int8(m_ASCII_PERIOD),
- 14: int8(m_ASCII_o),
- 15: int8(m_ASCII_r),
- 16: int8(m_ASCII_g),
- 17: int8(m_ASCII_SLASH),
- 18: int8(m_ASCII_2),
- 19: int8(m_ASCII_0),
- 20: int8(m_ASCII_0),
- 21: int8(m_ASCII_0),
- 22: int8(m_ASCII_SLASH),
- 23: int8(m_ASCII_x),
- 24: int8(m_ASCII_m),
- 25: int8(m_ASCII_l),
- 26: int8(m_ASCII_n),
- 27: int8(m_ASCII_s),
- 28: int8(m_ASCII_SLASH),
- }
- var _xmlnsLen = libc.Int32FromUint64(libc.Uint64FromInt32(libc.Int32FromInt64(30))/libc.Uint64FromInt64(1) - libc.Uint64FromInt32(1))
- // C documentation
- //
- // /* The idea here is to avoid using stack for each CDATA section when
- // the whole file is parsed with one call.
- // */
- func _cdataSectionProcessor(tls *libc.TLS, parser TXML_Parser, _start uintptr, end uintptr, endPtr uintptr) (r _XML_Error) {
- bp := tls.Alloc(16)
- defer tls.Free(16)
- *(*uintptr)(unsafe.Pointer(bp)) = _start
- var result _XML_Error
- _ = result
- 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))
- if result != int32(_XML_ERROR_NONE) {
- return result
- }
- if *(*uintptr)(unsafe.Pointer(bp)) != 0 {
- if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parentParser != 0 { /* we are parsing an external entity */
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_processor = __ccgo_fp(_externalEntityContentProcessor)
- return _externalEntityContentProcessor(tls, parser, *(*uintptr)(unsafe.Pointer(bp)), end, endPtr)
- } else {
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_processor = __ccgo_fp(_contentProcessor)
- return _contentProcessor(tls, parser, *(*uintptr)(unsafe.Pointer(bp)), end, endPtr)
- }
- }
- return result
- }
- // C documentation
- //
- // /* startPtr gets set to non-null if the section is closed, and to null if
- // the section is not yet closed.
- // */
- 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) {
- bp := tls.Alloc(32)
- defer tls.Free(32)
- var charDataHandler TXML_CharacterDataHandler
- var convert_res _XML_Convert_Result
- var eventEndPP, eventPP, v3 uintptr
- var tok int32
- var _ /* c at bp+16 */ TXML_Char
- var _ /* dataPtr at bp+24 */ uintptr
- var _ /* next at bp+8 */ uintptr
- var _ /* s at bp+0 */ uintptr
- _, _, _, _, _, _ = charDataHandler, convert_res, eventEndPP, eventPP, tok, v3
- *(*uintptr)(unsafe.Pointer(bp)) = *(*uintptr)(unsafe.Pointer(startPtr))
- if enc == (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_encoding {
- eventPP = parser + 544
- *(*uintptr)(unsafe.Pointer(eventPP)) = *(*uintptr)(unsafe.Pointer(bp))
- eventEndPP = parser + 552
- } else {
- eventPP = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_openInternalEntities
- eventEndPP = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_openInternalEntities + 8
- }
- *(*uintptr)(unsafe.Pointer(eventPP)) = *(*uintptr)(unsafe.Pointer(bp))
- *(*uintptr)(unsafe.Pointer(startPtr)) = libc.UintptrFromInt32(0)
- for {
- *(*uintptr)(unsafe.Pointer(bp + 8)) = *(*uintptr)(unsafe.Pointer(bp)) /* in case of XML_TOK_NONE or XML_TOK_PARTIAL */
- 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)
- if !(_accountingDiffTolerated(tls, parser, tok, *(*uintptr)(unsafe.Pointer(bp)), *(*uintptr)(unsafe.Pointer(bp + 8)), int32(4044), account) != 0) {
- _accountingOnAbort(tls, parser)
- return int32(_XML_ERROR_AMPLIFICATION_LIMIT_BREACH)
- }
- *(*uintptr)(unsafe.Pointer(eventEndPP)) = *(*uintptr)(unsafe.Pointer(bp + 8))
- switch tok {
- case int32(m_XML_TOK_CDATA_SECT_CLOSE):
- if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_endCdataSectionHandler != 0 {
- (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_endCdataSectionHandler})))(tls, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_handlerArg)
- } else {
- if libc.Bool(0 != 0) && (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_characterDataHandler != 0 {
- (*(*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)
- } else {
- if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_defaultHandler != 0 {
- _reportDefault(tls, parser, enc, *(*uintptr)(unsafe.Pointer(bp)), *(*uintptr)(unsafe.Pointer(bp + 8)))
- }
- }
- }
- *(*uintptr)(unsafe.Pointer(startPtr)) = *(*uintptr)(unsafe.Pointer(bp + 8))
- *(*uintptr)(unsafe.Pointer(nextPtr)) = *(*uintptr)(unsafe.Pointer(bp + 8))
- if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parsingStatus.Fparsing == int32(_XML_FINISHED) {
- return int32(_XML_ERROR_ABORTED)
- } else {
- return int32(_XML_ERROR_NONE)
- }
- fallthrough
- case int32(m_XML_TOK_DATA_NEWLINE):
- if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_characterDataHandler != 0 {
- *(*TXML_Char)(unsafe.Pointer(bp + 16)) = int8(0xA)
- (*(*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))
- } else {
- if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_defaultHandler != 0 {
- _reportDefault(tls, parser, enc, *(*uintptr)(unsafe.Pointer(bp)), *(*uintptr)(unsafe.Pointer(bp + 8)))
- }
- }
- case int32(m_XML_TOK_DATA_CHARS):
- charDataHandler = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_characterDataHandler
- if charDataHandler != 0 {
- if !((*TENCODING)(unsafe.Pointer(enc)).FisUtf8 != 0) {
- for {
- *(*uintptr)(unsafe.Pointer(bp + 24)) = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_dataBuf
- 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)
- *(*uintptr)(unsafe.Pointer(eventEndPP)) = *(*uintptr)(unsafe.Pointer(bp + 8))
- (*(*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)))
- if convert_res == int32(_XML_CONVERT_COMPLETED) || convert_res == int32(_XML_CONVERT_INPUT_INCOMPLETE) {
- break
- }
- *(*uintptr)(unsafe.Pointer(eventPP)) = *(*uintptr)(unsafe.Pointer(bp))
- goto _2
- _2:
- }
- } else {
- (*(*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)))))
- }
- } else {
- if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_defaultHandler != 0 {
- _reportDefault(tls, parser, enc, *(*uintptr)(unsafe.Pointer(bp)), *(*uintptr)(unsafe.Pointer(bp + 8)))
- }
- }
- case m_XML_TOK_INVALID:
- *(*uintptr)(unsafe.Pointer(eventPP)) = *(*uintptr)(unsafe.Pointer(bp + 8))
- return int32(_XML_ERROR_INVALID_TOKEN)
- case -int32(2):
- if haveMore != 0 {
- *(*uintptr)(unsafe.Pointer(nextPtr)) = *(*uintptr)(unsafe.Pointer(bp))
- return int32(_XML_ERROR_NONE)
- }
- return int32(_XML_ERROR_PARTIAL_CHAR)
- case -int32(1):
- fallthrough
- case -int32(4):
- if haveMore != 0 {
- *(*uintptr)(unsafe.Pointer(nextPtr)) = *(*uintptr)(unsafe.Pointer(bp))
- return int32(_XML_ERROR_NONE)
- }
- return int32(_XML_ERROR_UNCLOSED_CDATA_SECTION)
- default:
- /* Every token returned by XmlCdataSectionTok() has its own
- * explicit case, so this default case will never be executed.
- * We retain it as a safety net and exclude it from the coverage
- * statistics.
- *
- * LCOV_EXCL_START
- */
- *(*uintptr)(unsafe.Pointer(eventPP)) = *(*uintptr)(unsafe.Pointer(bp + 8))
- return int32(_XML_ERROR_UNEXPECTED_STATE)
- /* LCOV_EXCL_STOP */
- }
- v3 = *(*uintptr)(unsafe.Pointer(bp + 8))
- *(*uintptr)(unsafe.Pointer(bp)) = v3
- *(*uintptr)(unsafe.Pointer(eventPP)) = v3
- switch (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parsingStatus.Fparsing {
- case int32(_XML_SUSPENDED):
- *(*uintptr)(unsafe.Pointer(nextPtr)) = *(*uintptr)(unsafe.Pointer(bp + 8))
- return int32(_XML_ERROR_NONE)
- case int32(_XML_FINISHED):
- return int32(_XML_ERROR_ABORTED)
- default:
- }
- goto _1
- _1:
- }
- /* not reached */
- return r
- }
- // C documentation
- //
- // /* The idea here is to avoid using stack for each IGNORE section when
- // the whole file is parsed with one call.
- // */
- func _ignoreSectionProcessor(tls *libc.TLS, parser TXML_Parser, _start uintptr, end uintptr, endPtr uintptr) (r _XML_Error) {
- bp := tls.Alloc(16)
- defer tls.Free(16)
- *(*uintptr)(unsafe.Pointer(bp)) = _start
- var result _XML_Error
- _ = result
- 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)))
- if result != int32(_XML_ERROR_NONE) {
- return result
- }
- if *(*uintptr)(unsafe.Pointer(bp)) != 0 {
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_processor = __ccgo_fp(_prologProcessor)
- return _prologProcessor(tls, parser, *(*uintptr)(unsafe.Pointer(bp)), end, endPtr)
- }
- return result
- }
- // C documentation
- //
- // /* startPtr gets set to non-null is the section is closed, and to null
- // if the section is not yet closed.
- // */
- func _doIgnoreSection(tls *libc.TLS, parser TXML_Parser, enc uintptr, startPtr uintptr, end uintptr, nextPtr uintptr, haveMore TXML_Bool) (r _XML_Error) {
- bp := tls.Alloc(16)
- defer tls.Free(16)
- var eventEndPP, eventPP, s uintptr
- var tok int32
- var _ /* next at bp+0 */ uintptr
- _, _, _, _ = eventEndPP, eventPP, s, tok
- *(*uintptr)(unsafe.Pointer(bp)) = *(*uintptr)(unsafe.Pointer(startPtr))
- s = *(*uintptr)(unsafe.Pointer(startPtr))
- if enc == (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_encoding {
- eventPP = parser + 544
- *(*uintptr)(unsafe.Pointer(eventPP)) = s
- eventEndPP = parser + 552
- } else {
- /* It's not entirely clear, but it seems the following two lines
- * of code cannot be executed. The only occasions on which 'enc'
- * is not 'encoding' are when this function is called
- * from the internal entity processing, and IGNORE sections are an
- * error in internal entities.
- *
- * Since it really isn't clear that this is true, we keep the code
- * and just remove it from our coverage tests.
- *
- * LCOV_EXCL_START
- */
- eventPP = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_openInternalEntities
- eventEndPP = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_openInternalEntities + 8
- /* LCOV_EXCL_STOP */
- }
- *(*uintptr)(unsafe.Pointer(eventPP)) = s
- *(*uintptr)(unsafe.Pointer(startPtr)) = libc.UintptrFromInt32(0)
- tok = (*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{*(*TSCANNER)(unsafe.Pointer(enc + 3*8))})))(tls, enc, s, end, bp)
- if !(_accountingDiffTolerated(tls, parser, tok, s, *(*uintptr)(unsafe.Pointer(bp)), int32(4196), int32(_XML_ACCOUNT_DIRECT)) != 0) {
- _accountingOnAbort(tls, parser)
- return int32(_XML_ERROR_AMPLIFICATION_LIMIT_BREACH)
- }
- *(*uintptr)(unsafe.Pointer(eventEndPP)) = *(*uintptr)(unsafe.Pointer(bp))
- switch tok {
- case int32(m_XML_TOK_IGNORE_SECT):
- if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_defaultHandler != 0 {
- _reportDefault(tls, parser, enc, s, *(*uintptr)(unsafe.Pointer(bp)))
- }
- *(*uintptr)(unsafe.Pointer(startPtr)) = *(*uintptr)(unsafe.Pointer(bp))
- *(*uintptr)(unsafe.Pointer(nextPtr)) = *(*uintptr)(unsafe.Pointer(bp))
- if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parsingStatus.Fparsing == int32(_XML_FINISHED) {
- return int32(_XML_ERROR_ABORTED)
- } else {
- return int32(_XML_ERROR_NONE)
- }
- fallthrough
- case m_XML_TOK_INVALID:
- *(*uintptr)(unsafe.Pointer(eventPP)) = *(*uintptr)(unsafe.Pointer(bp))
- return int32(_XML_ERROR_INVALID_TOKEN)
- case -int32(2):
- if haveMore != 0 {
- *(*uintptr)(unsafe.Pointer(nextPtr)) = s
- return int32(_XML_ERROR_NONE)
- }
- return int32(_XML_ERROR_PARTIAL_CHAR)
- case -int32(1):
- fallthrough
- case -int32(4):
- if haveMore != 0 {
- *(*uintptr)(unsafe.Pointer(nextPtr)) = s
- return int32(_XML_ERROR_NONE)
- }
- return int32(_XML_ERROR_SYNTAX) /* XML_ERROR_UNCLOSED_IGNORE_SECTION */
- default:
- /* All of the tokens that XmlIgnoreSectionTok() returns have
- * explicit cases to handle them, so this default case is never
- * executed. We keep it as a safety net anyway, and remove it
- * from our test coverage statistics.
- *
- * LCOV_EXCL_START
- */
- *(*uintptr)(unsafe.Pointer(eventPP)) = *(*uintptr)(unsafe.Pointer(bp))
- return int32(_XML_ERROR_UNEXPECTED_STATE)
- /* LCOV_EXCL_STOP */
- }
- /* not reached */
- return r
- }
- func _initializeEncoding(tls *libc.TLS, parser TXML_Parser) (r _XML_Error) {
- var s uintptr
- var v1 func(*libc.TLS, uintptr, uintptr, uintptr) int32
- _, _ = s, v1
- s = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_protocolEncodingName
- if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_ns != 0 {
- v1 = XXmlInitEncodingNS
- } else {
- v1 = XXmlInitEncoding
- }
- if v1(tls, parser+296, parser+288, s) != 0 {
- return int32(_XML_ERROR_NONE)
- }
- return _handleUnknownEncoding(tls, parser, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_protocolEncodingName)
- }
- func _processXmlDecl(tls *libc.TLS, parser TXML_Parser, isGeneralTextEntity int32, s uintptr, next uintptr) (r _XML_Error) {
- bp := tls.Alloc(48)
- defer tls.Free(48)
- var result _XML_Error
- var storedEncName, storedversion uintptr
- var v1 func(*libc.TLS, int32, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr, uintptr) int32
- var _ /* encodingName at bp+0 */ uintptr
- var _ /* newEncoding at bp+8 */ uintptr
- var _ /* standalone at bp+32 */ int32
- var _ /* version at bp+16 */ uintptr
- var _ /* versionend at bp+24 */ uintptr
- _, _, _, _ = result, storedEncName, storedversion, v1
- *(*uintptr)(unsafe.Pointer(bp)) = libc.UintptrFromInt32(0)
- storedEncName = libc.UintptrFromInt32(0)
- *(*uintptr)(unsafe.Pointer(bp + 8)) = libc.UintptrFromInt32(0)
- *(*uintptr)(unsafe.Pointer(bp + 16)) = libc.UintptrFromInt32(0)
- *(*uintptr)(unsafe.Pointer(bp + 24)) = libc.UintptrFromInt32(0)
- storedversion = libc.UintptrFromInt32(0)
- *(*int32)(unsafe.Pointer(bp + 32)) = -int32(1)
- if !(_accountingDiffTolerated(tls, parser, int32(m_XML_TOK_XML_DECL), s, next, int32(4288), int32(_XML_ACCOUNT_DIRECT)) != 0) {
- _accountingOnAbort(tls, parser)
- return int32(_XML_ERROR_AMPLIFICATION_LIMIT_BREACH)
- }
- if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_ns != 0 {
- v1 = XXmlParseXmlDeclNS
- } else {
- v1 = XXmlParseXmlDecl
- }
- 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) {
- if isGeneralTextEntity != 0 {
- return int32(_XML_ERROR_TEXT_DECL)
- } else {
- return int32(_XML_ERROR_XML_DECL)
- }
- }
- if !(isGeneralTextEntity != 0) && *(*int32)(unsafe.Pointer(bp + 32)) == int32(1) {
- (*TDTD)(unsafe.Pointer((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_dtd)).Fstandalone = libc.Uint8FromInt32(1)
- if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_paramEntityParsing == int32(_XML_PARAM_ENTITY_PARSING_UNLESS_STANDALONE) {
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_paramEntityParsing = int32(_XML_PARAM_ENTITY_PARSING_NEVER)
- }
- }
- if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_xmlDeclHandler != 0 {
- if *(*uintptr)(unsafe.Pointer(bp)) != libc.UintptrFromInt32(0) {
- 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)))))
- if !(storedEncName != 0) {
- return int32(_XML_ERROR_NO_MEMORY)
- }
- (*TSTRING_POOL)(unsafe.Pointer(parser + 832)).Fstart = (*TSTRING_POOL)(unsafe.Pointer(parser + 832)).Fptr
- }
- if *(*uintptr)(unsafe.Pointer(bp + 16)) != 0 {
- 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))
- if !(storedversion != 0) {
- return int32(_XML_ERROR_NO_MEMORY)
- }
- }
- (*(*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)))
- } else {
- if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_defaultHandler != 0 {
- _reportDefault(tls, parser, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_encoding, s, next)
- }
- }
- if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_protocolEncodingName == libc.UintptrFromInt32(0) {
- if *(*uintptr)(unsafe.Pointer(bp + 8)) != 0 {
- /* Check that the specified encoding does not conflict with what
- * the parser has already deduced. Do we have the same number
- * of bytes in the smallest representation of a character? If
- * this is UTF-16, is it the same endianness?
- */
- 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 {
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_eventPtr = *(*uintptr)(unsafe.Pointer(bp))
- return int32(_XML_ERROR_INCORRECT_ENCODING)
- }
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_encoding = *(*uintptr)(unsafe.Pointer(bp + 8))
- } else {
- if *(*uintptr)(unsafe.Pointer(bp)) != 0 {
- if !(storedEncName != 0) {
- 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)))))
- if !(storedEncName != 0) {
- return int32(_XML_ERROR_NO_MEMORY)
- }
- }
- result = _handleUnknownEncoding(tls, parser, storedEncName)
- _poolClear(tls, parser+832)
- if result == int32(_XML_ERROR_UNKNOWN_ENCODING) {
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_eventPtr = *(*uintptr)(unsafe.Pointer(bp))
- }
- return result
- }
- }
- }
- if storedEncName != 0 || storedversion != 0 {
- _poolClear(tls, parser+832)
- }
- return int32(_XML_ERROR_NONE)
- }
- func _handleUnknownEncoding(tls *libc.TLS, parser TXML_Parser, encodingName uintptr) (r _XML_Error) {
- bp := tls.Alloc(1056)
- defer tls.Free(1056)
- var enc uintptr
- var i int32
- var v2 func(*libc.TLS, uintptr, uintptr, TCONVERTER, uintptr) uintptr
- var _ /* info at bp+0 */ TXML_Encoding
- _, _, _ = enc, i, v2
- if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_unknownEncodingHandler != 0 {
- i = 0
- for {
- if !(i < int32(256)) {
- break
- }
- *(*int32)(unsafe.Pointer(bp + uintptr(i)*4)) = -int32(1)
- goto _1
- _1:
- ;
- i++
- }
- (*(*TXML_Encoding)(unsafe.Pointer(bp))).Fconvert = libc.UintptrFromInt32(0)
- (*(*TXML_Encoding)(unsafe.Pointer(bp))).Fdata = libc.UintptrFromInt32(0)
- (*(*TXML_Encoding)(unsafe.Pointer(bp))).Frelease = libc.UintptrFromInt32(0)
- 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 {
- (*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)))
- if !((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_unknownEncodingMem != 0) {
- if (*(*TXML_Encoding)(unsafe.Pointer(bp))).Frelease != 0 {
- (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*(*TXML_Encoding)(unsafe.Pointer(bp))).Frelease})))(tls, (*(*TXML_Encoding)(unsafe.Pointer(bp))).Fdata)
- }
- return int32(_XML_ERROR_NO_MEMORY)
- }
- if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_ns != 0 {
- v2 = XXmlInitUnknownEncodingNS
- } else {
- v2 = XXmlInitUnknownEncoding
- }
- enc = v2(tls, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_unknownEncodingMem, bp, (*(*TXML_Encoding)(unsafe.Pointer(bp))).Fconvert, (*(*TXML_Encoding)(unsafe.Pointer(bp))).Fdata)
- if enc != 0 {
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_unknownEncodingData = (*(*TXML_Encoding)(unsafe.Pointer(bp))).Fdata
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_unknownEncodingRelease = (*(*TXML_Encoding)(unsafe.Pointer(bp))).Frelease
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_encoding = enc
- return int32(_XML_ERROR_NONE)
- }
- }
- if (*(*TXML_Encoding)(unsafe.Pointer(bp))).Frelease != libc.UintptrFromInt32(0) {
- (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*(*TXML_Encoding)(unsafe.Pointer(bp))).Frelease})))(tls, (*(*TXML_Encoding)(unsafe.Pointer(bp))).Fdata)
- }
- }
- return int32(_XML_ERROR_UNKNOWN_ENCODING)
- }
- func _prologInitProcessor(tls *libc.TLS, parser TXML_Parser, s uintptr, end uintptr, nextPtr uintptr) (r _XML_Error) {
- var result _XML_Error
- _ = result
- result = _initializeEncoding(tls, parser)
- if result != int32(_XML_ERROR_NONE) {
- return result
- }
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_processor = __ccgo_fp(_prologProcessor)
- return _prologProcessor(tls, parser, s, end, nextPtr)
- }
- func _externalParEntInitProcessor(tls *libc.TLS, parser TXML_Parser, s uintptr, end uintptr, nextPtr uintptr) (r _XML_Error) {
- var result _XML_Error
- _ = result
- result = _initializeEncoding(tls, parser)
- if result != int32(_XML_ERROR_NONE) {
- return result
- }
- /* we know now that XML_Parse(Buffer) has been called,
- so we consider the external parameter entity read */
- (*TDTD)(unsafe.Pointer((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_dtd)).FparamEntityRead = libc.Uint8FromInt32(1)
- if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_prologState.FinEntityValue != 0 {
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_processor = __ccgo_fp(_entityValueInitProcessor)
- return _entityValueInitProcessor(tls, parser, s, end, nextPtr)
- } else {
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_processor = __ccgo_fp(_externalParEntProcessor)
- return _externalParEntProcessor(tls, parser, s, end, nextPtr)
- }
- return r
- }
- func _entityValueInitProcessor(tls *libc.TLS, parser TXML_Parser, s uintptr, end uintptr, nextPtr uintptr) (r _XML_Error) {
- bp := tls.Alloc(16)
- defer tls.Free(16)
- var result _XML_Error
- var start uintptr
- var tok int32
- var _ /* next at bp+0 */ uintptr
- _, _, _ = result, start, tok
- start = s
- *(*uintptr)(unsafe.Pointer(bp)) = start
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_eventPtr = start
- for {
- 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)
- /* Note: Except for XML_TOK_BOM below, these bytes are accounted later in:
- - storeEntityValue
- - processXmlDecl
- */
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_eventEndPtr = *(*uintptr)(unsafe.Pointer(bp))
- if tok <= 0 {
- if !((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parsingStatus.FfinalBuffer != 0) && tok != m_XML_TOK_INVALID {
- *(*uintptr)(unsafe.Pointer(nextPtr)) = s
- return int32(_XML_ERROR_NONE)
- }
- switch tok {
- case m_XML_TOK_INVALID:
- return int32(_XML_ERROR_INVALID_TOKEN)
- case -int32(1):
- return int32(_XML_ERROR_UNCLOSED_TOKEN)
- case -int32(2):
- return int32(_XML_ERROR_PARTIAL_CHAR)
- case -int32(4): /* start == end */
- fallthrough
- default:
- break
- }
- /* found end of entity value - can store it now */
- return _storeEntityValue(tls, parser, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_encoding, s, end, int32(_XML_ACCOUNT_DIRECT))
- } else {
- if tok == int32(m_XML_TOK_XML_DECL) {
- result = _processXmlDecl(tls, parser, 0, start, *(*uintptr)(unsafe.Pointer(bp)))
- if result != int32(_XML_ERROR_NONE) {
- return result
- }
- /* At this point, m_parsingStatus.parsing cannot be XML_SUSPENDED. For
- * that to happen, a parameter entity parsing handler must have attempted
- * to suspend the parser, which fails and raises an error. The parser can
- * be aborted, but can't be suspended.
- */
- if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parsingStatus.Fparsing == int32(_XML_FINISHED) {
- return int32(_XML_ERROR_ABORTED)
- }
- *(*uintptr)(unsafe.Pointer(nextPtr)) = *(*uintptr)(unsafe.Pointer(bp))
- /* stop scanning for text declaration - we found one */
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_processor = __ccgo_fp(_entityValueProcessor)
- return _entityValueProcessor(tls, parser, *(*uintptr)(unsafe.Pointer(bp)), end, nextPtr)
- } else {
- if tok == int32(m_XML_TOK_BOM) && *(*uintptr)(unsafe.Pointer(bp)) == end && !((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parsingStatus.FfinalBuffer != 0) {
- if !(_accountingDiffTolerated(tls, parser, tok, s, *(*uintptr)(unsafe.Pointer(bp)), int32(4495), int32(_XML_ACCOUNT_DIRECT)) != 0) {
- _accountingOnAbort(tls, parser)
- return int32(_XML_ERROR_AMPLIFICATION_LIMIT_BREACH)
- }
- *(*uintptr)(unsafe.Pointer(nextPtr)) = *(*uintptr)(unsafe.Pointer(bp))
- return int32(_XML_ERROR_NONE)
- } else {
- if tok == int32(m_XML_TOK_INSTANCE_START) {
- *(*uintptr)(unsafe.Pointer(nextPtr)) = *(*uintptr)(unsafe.Pointer(bp))
- return int32(_XML_ERROR_SYNTAX)
- }
- }
- }
- }
- start = *(*uintptr)(unsafe.Pointer(bp))
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_eventPtr = start
- goto _1
- _1:
- }
- return r
- }
- func _externalParEntProcessor(tls *libc.TLS, parser TXML_Parser, s uintptr, end uintptr, nextPtr uintptr) (r _XML_Error) {
- bp := tls.Alloc(16)
- defer tls.Free(16)
- var tok int32
- var _ /* next at bp+0 */ uintptr
- _ = tok
- *(*uintptr)(unsafe.Pointer(bp)) = s
- 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)
- if tok <= 0 {
- if !((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parsingStatus.FfinalBuffer != 0) && tok != m_XML_TOK_INVALID {
- *(*uintptr)(unsafe.Pointer(nextPtr)) = s
- return int32(_XML_ERROR_NONE)
- }
- switch tok {
- case m_XML_TOK_INVALID:
- return int32(_XML_ERROR_INVALID_TOKEN)
- case -int32(1):
- return int32(_XML_ERROR_UNCLOSED_TOKEN)
- case -int32(2):
- return int32(_XML_ERROR_PARTIAL_CHAR)
- case -int32(4): /* start == end */
- fallthrough
- default:
- break
- }
- } else {
- if tok == int32(m_XML_TOK_BOM) {
- if !(_accountingDiffTolerated(tls, parser, tok, s, *(*uintptr)(unsafe.Pointer(bp)), int32(4548), int32(_XML_ACCOUNT_DIRECT)) != 0) {
- _accountingOnAbort(tls, parser)
- return int32(_XML_ERROR_AMPLIFICATION_LIMIT_BREACH)
- }
- s = *(*uintptr)(unsafe.Pointer(bp))
- 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)
- }
- }
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_processor = __ccgo_fp(_prologProcessor)
- 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))
- }
- func _entityValueProcessor(tls *libc.TLS, parser TXML_Parser, s uintptr, end uintptr, nextPtr uintptr) (r _XML_Error) {
- bp := tls.Alloc(16)
- defer tls.Free(16)
- var enc, start uintptr
- var tok int32
- var _ /* next at bp+0 */ uintptr
- _, _, _ = enc, start, tok
- start = s
- *(*uintptr)(unsafe.Pointer(bp)) = s
- enc = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_encoding
- for {
- tok = (*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{*(*TSCANNER)(unsafe.Pointer(enc))})))(tls, enc, start, end, bp)
- /* Note: These bytes are accounted later in:
- - storeEntityValue
- */
- if tok <= 0 {
- if !((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parsingStatus.FfinalBuffer != 0) && tok != m_XML_TOK_INVALID {
- *(*uintptr)(unsafe.Pointer(nextPtr)) = s
- return int32(_XML_ERROR_NONE)
- }
- switch tok {
- case m_XML_TOK_INVALID:
- return int32(_XML_ERROR_INVALID_TOKEN)
- case -int32(1):
- return int32(_XML_ERROR_UNCLOSED_TOKEN)
- case -int32(2):
- return int32(_XML_ERROR_PARTIAL_CHAR)
- case -int32(4): /* start == end */
- fallthrough
- default:
- break
- }
- /* found end of entity value - can store it now */
- return _storeEntityValue(tls, parser, enc, s, end, int32(_XML_ACCOUNT_DIRECT))
- }
- start = *(*uintptr)(unsafe.Pointer(bp))
- goto _1
- _1:
- }
- return r
- }
- func _prologProcessor(tls *libc.TLS, parser TXML_Parser, s uintptr, end uintptr, nextPtr uintptr) (r _XML_Error) {
- bp := tls.Alloc(16)
- defer tls.Free(16)
- var tok int32
- var _ /* next at bp+0 */ uintptr
- _ = tok
- *(*uintptr)(unsafe.Pointer(bp)) = s
- 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)
- 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))
- }
- 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) {
- bp := tls.Alloc(16)
- defer tls.Free(16)
- *(*uintptr)(unsafe.Pointer(bp)) = _next
- 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
- var betweenDecl, hadParamEntityRefs, hadParamEntityRefs1, handleDefault TXML_Bool
- var myindex, myindex1, role, v66, v69, v73, v76, v82, v84, v85 int32
- var nameLen, v88 Tsize_t
- var quant _XML_Content_Quant
- var result, result1, result2, result3, result4, result5 _XML_Error
- var v72, v79, v83 bool
- var v81 uint32
- _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = 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
- /* save one level of indirection */
- dtd = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_dtd
- if enc == (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_encoding {
- eventPP = parser + 544
- eventEndPP = parser + 552
- } else {
- eventPP = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_openInternalEntities
- eventEndPP = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_openInternalEntities + 8
- }
- for {
- handleDefault = libc.Uint8FromInt32(1)
- *(*uintptr)(unsafe.Pointer(eventPP)) = s
- *(*uintptr)(unsafe.Pointer(eventEndPP)) = *(*uintptr)(unsafe.Pointer(bp))
- if tok <= 0 {
- if haveMore != 0 && tok != m_XML_TOK_INVALID {
- *(*uintptr)(unsafe.Pointer(nextPtr)) = s
- return int32(_XML_ERROR_NONE)
- }
- switch tok {
- case m_XML_TOK_INVALID:
- *(*uintptr)(unsafe.Pointer(eventPP)) = *(*uintptr)(unsafe.Pointer(bp))
- return int32(_XML_ERROR_INVALID_TOKEN)
- case -int32(1):
- return int32(_XML_ERROR_UNCLOSED_TOKEN)
- case -int32(2):
- return int32(_XML_ERROR_PARTIAL_CHAR)
- case -int32(m_XML_TOK_PROLOG_S):
- tok = -tok
- case -int32(4):
- /* for internal PE NOT referenced between declarations */
- if enc != (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_encoding && !((*TOPEN_INTERNAL_ENTITY)(unsafe.Pointer((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_openInternalEntities)).FbetweenDecl != 0) {
- *(*uintptr)(unsafe.Pointer(nextPtr)) = s
- return int32(_XML_ERROR_NONE)
- }
- /* WFC: PE Between Declarations - must check that PE contains
- complete markup, not only for external PEs, but also for
- internal PEs if the reference occurs between declarations.
- */
- if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_isParamEntity != 0 || enc != (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_encoding {
- 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) {
- return int32(_XML_ERROR_INCOMPLETE_PE)
- }
- *(*uintptr)(unsafe.Pointer(nextPtr)) = s
- return int32(_XML_ERROR_NONE)
- }
- return int32(_XML_ERROR_NO_ELEMENTS)
- default:
- tok = -tok
- *(*uintptr)(unsafe.Pointer(bp)) = end
- break
- }
- }
- 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)
- switch role {
- case int32(_XML_ROLE_INSTANCE_START): // bytes accounted in contentProcessor
- fallthrough
- case int32(_XML_ROLE_XML_DECL): // bytes accounted in processXmlDecl
- fallthrough
- case int32(_XML_ROLE_TEXT_DECL): // bytes accounted in processXmlDecl
- default:
- if !(_accountingDiffTolerated(tls, parser, tok, s, *(*uintptr)(unsafe.Pointer(bp)), int32(4717), account) != 0) {
- _accountingOnAbort(tls, parser)
- return int32(_XML_ERROR_AMPLIFICATION_LIMIT_BREACH)
- }
- }
- switch role {
- case int32(_XML_ROLE_XML_DECL):
- goto _2
- case int32(_XML_ROLE_DOCTYPE_NAME):
- goto _3
- case int32(_XML_ROLE_DOCTYPE_INTERNAL_SUBSET):
- goto _4
- case int32(_XML_ROLE_TEXT_DECL):
- goto _5
- case int32(_XML_ROLE_DOCTYPE_PUBLIC_ID):
- goto _6
- case int32(_XML_ROLE_ENTITY_PUBLIC_ID):
- goto _7
- case int32(_XML_ROLE_DOCTYPE_CLOSE):
- goto _8
- case int32(_XML_ROLE_INSTANCE_START):
- goto _9
- case int32(_XML_ROLE_ATTLIST_ELEMENT_NAME):
- goto _10
- case int32(_XML_ROLE_ATTRIBUTE_NAME):
- goto _11
- case int32(_XML_ROLE_ATTRIBUTE_TYPE_CDATA):
- goto _12
- case int32(_XML_ROLE_ATTRIBUTE_TYPE_ID):
- goto _13
- case int32(_XML_ROLE_ATTRIBUTE_TYPE_IDREF):
- goto _14
- case int32(_XML_ROLE_ATTRIBUTE_TYPE_IDREFS):
- goto _15
- case int32(_XML_ROLE_ATTRIBUTE_TYPE_ENTITY):
- goto _16
- case int32(_XML_ROLE_ATTRIBUTE_TYPE_ENTITIES):
- goto _17
- case int32(_XML_ROLE_ATTRIBUTE_TYPE_NMTOKEN):
- goto _18
- case int32(_XML_ROLE_ATTRIBUTE_TYPE_NMTOKENS):
- goto _19
- case int32(_XML_ROLE_ATTRIBUTE_NOTATION_VALUE):
- goto _20
- case int32(_XML_ROLE_ATTRIBUTE_ENUM_VALUE):
- goto _21
- case int32(_XML_ROLE_REQUIRED_ATTRIBUTE_VALUE):
- goto _22
- case int32(_XML_ROLE_IMPLIED_ATTRIBUTE_VALUE):
- goto _23
- case int32(_XML_ROLE_FIXED_ATTRIBUTE_VALUE):
- goto _24
- case int32(_XML_ROLE_DEFAULT_ATTRIBUTE_VALUE):
- goto _25
- case int32(_XML_ROLE_ENTITY_VALUE):
- goto _26
- case int32(_XML_ROLE_DOCTYPE_SYSTEM_ID):
- goto _27
- case int32(_XML_ROLE_ENTITY_SYSTEM_ID):
- goto _28
- case int32(_XML_ROLE_ENTITY_COMPLETE):
- goto _29
- case int32(_XML_ROLE_ENTITY_NOTATION_NAME):
- goto _30
- case int32(_XML_ROLE_GENERAL_ENTITY_NAME):
- goto _31
- case int32(_XML_ROLE_PARAM_ENTITY_NAME):
- goto _32
- case int32(_XML_ROLE_NOTATION_NAME):
- goto _33
- case int32(_XML_ROLE_NOTATION_PUBLIC_ID):
- goto _34
- case int32(_XML_ROLE_NOTATION_SYSTEM_ID):
- goto _35
- case int32(_XML_ROLE_NOTATION_NO_SYSTEM_ID):
- goto _36
- case int32(_XML_ROLE_ERROR):
- goto _37
- case int32(_XML_ROLE_IGNORE_SECT):
- goto _38
- case int32(_XML_ROLE_GROUP_OPEN):
- goto _39
- case int32(_XML_ROLE_GROUP_SEQUENCE):
- goto _40
- case int32(_XML_ROLE_GROUP_CHOICE):
- goto _41
- case int32(_XML_ROLE_INNER_PARAM_ENTITY_REF):
- goto _42
- case int32(_XML_ROLE_PARAM_ENTITY_REF):
- goto _43
- case int32(_XML_ROLE_ELEMENT_NAME):
- goto _44
- case int32(_XML_ROLE_CONTENT_EMPTY):
- goto _45
- case int32(_XML_ROLE_CONTENT_ANY):
- goto _46
- case int32(_XML_ROLE_CONTENT_PCDATA):
- goto _47
- case int32(_XML_ROLE_CONTENT_ELEMENT):
- goto _48
- case int32(_XML_ROLE_CONTENT_ELEMENT_OPT):
- goto _49
- case int32(_XML_ROLE_CONTENT_ELEMENT_REP):
- goto _50
- case int32(_XML_ROLE_CONTENT_ELEMENT_PLUS):
- goto _51
- case int32(_XML_ROLE_GROUP_CLOSE):
- goto _52
- case int32(_XML_ROLE_GROUP_CLOSE_OPT):
- goto _53
- case int32(_XML_ROLE_GROUP_CLOSE_REP):
- goto _54
- case int32(_XML_ROLE_GROUP_CLOSE_PLUS):
- goto _55
- case int32(_XML_ROLE_PI):
- goto _56
- case int32(_XML_ROLE_COMMENT):
- goto _57
- case int32(_XML_ROLE_NONE):
- goto _58
- case int32(_XML_ROLE_DOCTYPE_NONE):
- goto _59
- case int32(_XML_ROLE_ENTITY_NONE):
- goto _60
- case int32(_XML_ROLE_NOTATION_NONE):
- goto _61
- case int32(_XML_ROLE_ATTLIST_NONE):
- goto _62
- case int32(_XML_ROLE_ELEMENT_NONE):
- goto _63
- }
- goto _64
- _2:
- ;
- result = _processXmlDecl(tls, parser, 0, s, *(*uintptr)(unsafe.Pointer(bp)))
- if result != int32(_XML_ERROR_NONE) {
- return result
- }
- enc = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_encoding
- handleDefault = libc.Uint8FromInt32(0)
- goto _64
- _3:
- ;
- if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_startDoctypeDeclHandler != 0 {
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_doctypeName = _poolStoreString(tls, parser+784, enc, s, *(*uintptr)(unsafe.Pointer(bp)))
- if !((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_doctypeName != 0) {
- return int32(_XML_ERROR_NO_MEMORY)
- }
- (*TSTRING_POOL)(unsafe.Pointer(parser + 784)).Fstart = (*TSTRING_POOL)(unsafe.Pointer(parser + 784)).Fptr
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_doctypePubid = libc.UintptrFromInt32(0)
- handleDefault = libc.Uint8FromInt32(0)
- }
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_doctypeSysid = libc.UintptrFromInt32(0) /* always initialize to NULL */
- goto _64
- _4:
- ;
- if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_startDoctypeDeclHandler != 0 {
- (*(*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))
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_doctypeName = libc.UintptrFromInt32(0)
- _poolClear(tls, parser+784)
- handleDefault = libc.Uint8FromInt32(0)
- }
- goto _64
- _5:
- ;
- result1 = _processXmlDecl(tls, parser, int32(1), s, *(*uintptr)(unsafe.Pointer(bp)))
- if result1 != int32(_XML_ERROR_NONE) {
- return result1
- }
- enc = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_encoding
- handleDefault = libc.Uint8FromInt32(0)
- goto _64
- _6:
- ;
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_useForeignDTD = libc.Uint8FromInt32(0)
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declEntity = _lookup(tls, parser, dtd+264, uintptr(unsafe.Pointer(&_externalSubsetName)), uint64(64))
- if !((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declEntity != 0) {
- return int32(_XML_ERROR_NO_MEMORY)
- }
- (*TDTD)(unsafe.Pointer(dtd)).FhasParamEntityRefs = libc.Uint8FromInt32(1)
- if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_startDoctypeDeclHandler != 0 {
- 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) {
- return int32(_XML_ERROR_PUBLICID)
- }
- pubId = _poolStoreString(tls, parser+784, enc, s+uintptr((*TENCODING)(unsafe.Pointer(enc)).FminBytesPerChar), *(*uintptr)(unsafe.Pointer(bp))-uintptr((*TENCODING)(unsafe.Pointer(enc)).FminBytesPerChar))
- if !(pubId != 0) {
- return int32(_XML_ERROR_NO_MEMORY)
- }
- _normalizePublicId(tls, pubId)
- (*TSTRING_POOL)(unsafe.Pointer(parser + 784)).Fstart = (*TSTRING_POOL)(unsafe.Pointer(parser + 784)).Fptr
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_doctypePubid = pubId
- handleDefault = libc.Uint8FromInt32(0)
- goto alreadyChecked
- }
- /* fall through */
- _7:
- ;
- 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) {
- return int32(_XML_ERROR_PUBLICID)
- }
- goto alreadyChecked
- alreadyChecked:
- ;
- if (*TDTD)(unsafe.Pointer(dtd)).FkeepProcessing != 0 && (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declEntity != 0 {
- tem = _poolStoreString(tls, dtd+160, enc, s+uintptr((*TENCODING)(unsafe.Pointer(enc)).FminBytesPerChar), *(*uintptr)(unsafe.Pointer(bp))-uintptr((*TENCODING)(unsafe.Pointer(enc)).FminBytesPerChar))
- if !(tem != 0) {
- return int32(_XML_ERROR_NO_MEMORY)
- }
- _normalizePublicId(tls, tem)
- (*TENTITY)(unsafe.Pointer((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declEntity)).FpublicId = tem
- (*TSTRING_POOL)(unsafe.Pointer(dtd + 160)).Fstart = (*TSTRING_POOL)(unsafe.Pointer(dtd + 160)).Fptr
- /* Don't suppress the default handler if we fell through from
- * the XML_ROLE_DOCTYPE_PUBLIC_ID case.
- */
- if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_entityDeclHandler != 0 && role == int32(_XML_ROLE_ENTITY_PUBLIC_ID) {
- handleDefault = libc.Uint8FromInt32(0)
- }
- }
- goto _64
- _8:
- ;
- if libc.Int32FromUint8(allowClosingDoctype) != libc.Int32FromUint8(libc.Uint8FromInt32(1)) {
- /* Must not close doctype from within expanded parameter entities */
- return int32(_XML_ERROR_INVALID_TOKEN)
- }
- if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_doctypeName != 0 {
- (*(*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)
- _poolClear(tls, parser+784)
- handleDefault = libc.Uint8FromInt32(0)
- }
- /* parser->m_doctypeSysid will be non-NULL in the case of a previous
- XML_ROLE_DOCTYPE_SYSTEM_ID, even if parser->m_startDoctypeDeclHandler
- was not set, indicating an external subset
- */
- if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_doctypeSysid != 0 || (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_useForeignDTD != 0 {
- hadParamEntityRefs = (*TDTD)(unsafe.Pointer(dtd)).FhasParamEntityRefs
- (*TDTD)(unsafe.Pointer(dtd)).FhasParamEntityRefs = libc.Uint8FromInt32(1)
- if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_paramEntityParsing != 0 && (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_externalEntityRefHandler != 0 {
- entity = _lookup(tls, parser, dtd+264, uintptr(unsafe.Pointer(&_externalSubsetName)), uint64(64))
- if !(entity != 0) {
- /* The external subset name "#" will have already been
- * inserted into the hash table at the start of the
- * external entity parsing, so no allocation will happen
- * and lookup() cannot fail.
- */
- return int32(_XML_ERROR_NO_MEMORY) /* LCOV_EXCL_LINE */
- }
- if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_useForeignDTD != 0 {
- (*TENTITY)(unsafe.Pointer(entity)).Fbase = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_curBase
- }
- (*TDTD)(unsafe.Pointer(dtd)).FparamEntityRead = libc.Uint8FromInt32(0)
- 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) {
- return int32(_XML_ERROR_EXTERNAL_ENTITY_HANDLING)
- }
- if (*TDTD)(unsafe.Pointer(dtd)).FparamEntityRead != 0 {
- 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) {
- return int32(_XML_ERROR_NOT_STANDALONE)
- }
- } else {
- if !((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_doctypeSysid != 0) {
- (*TDTD)(unsafe.Pointer(dtd)).FhasParamEntityRefs = hadParamEntityRefs
- }
- }
- /* end of DTD - no need to update dtd->keepProcessing */
- }
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_useForeignDTD = libc.Uint8FromInt32(0)
- }
- if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_endDoctypeDeclHandler != 0 {
- (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_endDoctypeDeclHandler})))(tls, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_handlerArg)
- handleDefault = libc.Uint8FromInt32(0)
- }
- goto _64
- _9:
- ;
- /* if there is no DOCTYPE declaration then now is the
- last chance to read the foreign DTD
- */
- if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_useForeignDTD != 0 {
- hadParamEntityRefs1 = (*TDTD)(unsafe.Pointer(dtd)).FhasParamEntityRefs
- (*TDTD)(unsafe.Pointer(dtd)).FhasParamEntityRefs = libc.Uint8FromInt32(1)
- if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_paramEntityParsing != 0 && (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_externalEntityRefHandler != 0 {
- entity1 = _lookup(tls, parser, dtd+264, uintptr(unsafe.Pointer(&_externalSubsetName)), uint64(64))
- if !(entity1 != 0) {
- return int32(_XML_ERROR_NO_MEMORY)
- }
- (*TENTITY)(unsafe.Pointer(entity1)).Fbase = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_curBase
- (*TDTD)(unsafe.Pointer(dtd)).FparamEntityRead = libc.Uint8FromInt32(0)
- 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) {
- return int32(_XML_ERROR_EXTERNAL_ENTITY_HANDLING)
- }
- if (*TDTD)(unsafe.Pointer(dtd)).FparamEntityRead != 0 {
- 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) {
- return int32(_XML_ERROR_NOT_STANDALONE)
- }
- } else {
- (*TDTD)(unsafe.Pointer(dtd)).FhasParamEntityRefs = hadParamEntityRefs1
- }
- /* end of DTD - no need to update dtd->keepProcessing */
- }
- }
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_processor = __ccgo_fp(_contentProcessor)
- return _contentProcessor(tls, parser, s, end, nextPtr)
- _10:
- ;
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declElementType = _getElementType(tls, parser, enc, s, *(*uintptr)(unsafe.Pointer(bp)))
- if !((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declElementType != 0) {
- return int32(_XML_ERROR_NO_MEMORY)
- }
- goto checkAttListDeclHandler
- _11:
- ;
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declAttributeId = _getAttributeId(tls, parser, enc, s, *(*uintptr)(unsafe.Pointer(bp)))
- if !((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declAttributeId != 0) {
- return int32(_XML_ERROR_NO_MEMORY)
- }
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declAttributeIsCdata = libc.Uint8FromInt32(0)
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declAttributeType = libc.UintptrFromInt32(0)
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declAttributeIsId = libc.Uint8FromInt32(0)
- goto checkAttListDeclHandler
- _12:
- ;
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declAttributeIsCdata = libc.Uint8FromInt32(1)
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declAttributeType = uintptr(unsafe.Pointer(&_atypeCDATA))
- goto checkAttListDeclHandler
- _13:
- ;
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declAttributeIsId = libc.Uint8FromInt32(1)
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declAttributeType = uintptr(unsafe.Pointer(&_atypeID))
- goto checkAttListDeclHandler
- _14:
- ;
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declAttributeType = uintptr(unsafe.Pointer(&_atypeIDREF))
- goto checkAttListDeclHandler
- _15:
- ;
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declAttributeType = uintptr(unsafe.Pointer(&_atypeIDREFS))
- goto checkAttListDeclHandler
- _16:
- ;
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declAttributeType = uintptr(unsafe.Pointer(&_atypeENTITY))
- goto checkAttListDeclHandler
- _17:
- ;
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declAttributeType = uintptr(unsafe.Pointer(&_atypeENTITIES))
- goto checkAttListDeclHandler
- _18:
- ;
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declAttributeType = uintptr(unsafe.Pointer(&_atypeNMTOKEN))
- goto checkAttListDeclHandler
- _19:
- ;
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declAttributeType = uintptr(unsafe.Pointer(&_atypeNMTOKENS))
- goto checkAttListDeclHandler
- checkAttListDeclHandler:
- ;
- if (*TDTD)(unsafe.Pointer(dtd)).FkeepProcessing != 0 && (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_attlistDeclHandler != 0 {
- handleDefault = libc.Uint8FromInt32(0)
- }
- goto _64
- _21:
- ;
- _20:
- ;
- if (*TDTD)(unsafe.Pointer(dtd)).FkeepProcessing != 0 && (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_attlistDeclHandler != 0 {
- if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declAttributeType != 0 {
- prefix = uintptr(unsafe.Pointer(&_enumValueSep))
- } else {
- if role == int32(_XML_ROLE_ATTRIBUTE_NOTATION_VALUE) {
- v65 = uintptr(unsafe.Pointer(&_notationPrefix))
- } else {
- v65 = uintptr(unsafe.Pointer(&_enumValueStart))
- }
- prefix = v65
- }
- if !(_poolAppendString(tls, parser+784, prefix) != 0) {
- return int32(_XML_ERROR_NO_MEMORY)
- }
- if !(_poolAppend(tls, parser+784, enc, s, *(*uintptr)(unsafe.Pointer(bp))) != 0) {
- return int32(_XML_ERROR_NO_MEMORY)
- }
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declAttributeType = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_tempPool.Fstart
- handleDefault = libc.Uint8FromInt32(0)
- }
- goto _64
- _23:
- ;
- _22:
- ;
- if (*TDTD)(unsafe.Pointer(dtd)).FkeepProcessing != 0 {
- 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) {
- return int32(_XML_ERROR_NO_MEMORY)
- }
- if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_attlistDeclHandler != 0 && (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declAttributeType != 0 {
- 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) {
- /* Enumerated or Notation type */
- if (*TSTRING_POOL)(unsafe.Pointer(parser+784)).Fptr == (*TSTRING_POOL)(unsafe.Pointer(parser+784)).Fend && !(_poolGrow(tls, parser+784) != 0) {
- v66 = 0
- } else {
- v68 = parser + 784 + 24
- v67 = *(*uintptr)(unsafe.Pointer(v68))
- *(*uintptr)(unsafe.Pointer(v68))++
- *(*TXML_Char)(unsafe.Pointer(v67)) = int8(m_ASCII_RPAREN)
- v66 = libc.Int32FromInt32(1)
- }
- if v72 = !(v66 != 0); !v72 {
- if (*TSTRING_POOL)(unsafe.Pointer(parser+784)).Fptr == (*TSTRING_POOL)(unsafe.Pointer(parser+784)).Fend && !(_poolGrow(tls, parser+784) != 0) {
- v69 = 0
- } else {
- v71 = parser + 784 + 24
- v70 = *(*uintptr)(unsafe.Pointer(v71))
- *(*uintptr)(unsafe.Pointer(v71))++
- *(*TXML_Char)(unsafe.Pointer(v70)) = int8('\000')
- v69 = libc.Int32FromInt32(1)
- }
- }
- if v72 || !(v69 != 0) {
- return int32(_XML_ERROR_NO_MEMORY)
- }
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declAttributeType = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_tempPool.Fstart
- (*TSTRING_POOL)(unsafe.Pointer(parser + 784)).Fstart = (*TSTRING_POOL)(unsafe.Pointer(parser + 784)).Fptr
- }
- *(*uintptr)(unsafe.Pointer(eventEndPP)) = s
- (*(*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)))
- handleDefault = libc.Uint8FromInt32(0)
- }
- }
- _poolClear(tls, parser+784)
- goto _64
- _25:
- ;
- _24:
- ;
- if (*TDTD)(unsafe.Pointer(dtd)).FkeepProcessing != 0 {
- 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))
- if result2 != 0 {
- return result2
- }
- attVal = (*TSTRING_POOL)(unsafe.Pointer(dtd + 160)).Fstart
- (*TSTRING_POOL)(unsafe.Pointer(dtd + 160)).Fstart = (*TSTRING_POOL)(unsafe.Pointer(dtd + 160)).Fptr
- /* ID attributes aren't allowed to have a default */
- 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) {
- return int32(_XML_ERROR_NO_MEMORY)
- }
- if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_attlistDeclHandler != 0 && (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declAttributeType != 0 {
- 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) {
- /* Enumerated or Notation type */
- if (*TSTRING_POOL)(unsafe.Pointer(parser+784)).Fptr == (*TSTRING_POOL)(unsafe.Pointer(parser+784)).Fend && !(_poolGrow(tls, parser+784) != 0) {
- v73 = 0
- } else {
- v75 = parser + 784 + 24
- v74 = *(*uintptr)(unsafe.Pointer(v75))
- *(*uintptr)(unsafe.Pointer(v75))++
- *(*TXML_Char)(unsafe.Pointer(v74)) = int8(m_ASCII_RPAREN)
- v73 = libc.Int32FromInt32(1)
- }
- if v79 = !(v73 != 0); !v79 {
- if (*TSTRING_POOL)(unsafe.Pointer(parser+784)).Fptr == (*TSTRING_POOL)(unsafe.Pointer(parser+784)).Fend && !(_poolGrow(tls, parser+784) != 0) {
- v76 = 0
- } else {
- v78 = parser + 784 + 24
- v77 = *(*uintptr)(unsafe.Pointer(v78))
- *(*uintptr)(unsafe.Pointer(v78))++
- *(*TXML_Char)(unsafe.Pointer(v77)) = int8('\000')
- v76 = libc.Int32FromInt32(1)
- }
- }
- if v79 || !(v76 != 0) {
- return int32(_XML_ERROR_NO_MEMORY)
- }
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declAttributeType = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_tempPool.Fstart
- (*TSTRING_POOL)(unsafe.Pointer(parser + 784)).Fstart = (*TSTRING_POOL)(unsafe.Pointer(parser + 784)).Fptr
- }
- *(*uintptr)(unsafe.Pointer(eventEndPP)) = s
- (*(*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)))
- _poolClear(tls, parser+784)
- handleDefault = libc.Uint8FromInt32(0)
- }
- }
- goto _64
- _26:
- ;
- if (*TDTD)(unsafe.Pointer(dtd)).FkeepProcessing != 0 {
- 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))
- if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declEntity != 0 {
- (*TENTITY)(unsafe.Pointer((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declEntity)).FtextPtr = (*TSTRING_POOL)(unsafe.Pointer(dtd + 208)).Fstart
- (*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))
- (*TSTRING_POOL)(unsafe.Pointer(dtd + 208)).Fstart = (*TSTRING_POOL)(unsafe.Pointer(dtd + 208)).Fptr
- if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_entityDeclHandler != 0 {
- *(*uintptr)(unsafe.Pointer(eventEndPP)) = s
- (*(*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))
- handleDefault = libc.Uint8FromInt32(0)
- }
- } else {
- (*TSTRING_POOL)(unsafe.Pointer(dtd + 208)).Fptr = (*TSTRING_POOL)(unsafe.Pointer(dtd + 208)).Fstart
- }
- if result3 != int32(_XML_ERROR_NONE) {
- return result3
- }
- }
- goto _64
- _27:
- ;
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_useForeignDTD = libc.Uint8FromInt32(0)
- (*TDTD)(unsafe.Pointer(dtd)).FhasParamEntityRefs = libc.Uint8FromInt32(1)
- if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_startDoctypeDeclHandler != 0 {
- (*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))
- if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_doctypeSysid == libc.UintptrFromInt32(0) {
- return int32(_XML_ERROR_NO_MEMORY)
- }
- (*TSTRING_POOL)(unsafe.Pointer(parser + 784)).Fstart = (*TSTRING_POOL)(unsafe.Pointer(parser + 784)).Fptr
- handleDefault = libc.Uint8FromInt32(0)
- } else {
- /* use externalSubsetName to make parser->m_doctypeSysid non-NULL
- for the case where no parser->m_startDoctypeDeclHandler is set */
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_doctypeSysid = uintptr(unsafe.Pointer(&_externalSubsetName))
- }
- 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) {
- return int32(_XML_ERROR_NOT_STANDALONE)
- }
- if !((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declEntity != 0) {
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declEntity = _lookup(tls, parser, dtd+264, uintptr(unsafe.Pointer(&_externalSubsetName)), uint64(64))
- if !((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declEntity != 0) {
- return int32(_XML_ERROR_NO_MEMORY)
- }
- (*TENTITY)(unsafe.Pointer((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declEntity)).FpublicId = libc.UintptrFromInt32(0)
- }
- /* fall through */
- _28:
- ;
- if (*TDTD)(unsafe.Pointer(dtd)).FkeepProcessing != 0 && (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declEntity != 0 {
- (*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))
- if !((*TENTITY)(unsafe.Pointer((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declEntity)).FsystemId != 0) {
- return int32(_XML_ERROR_NO_MEMORY)
- }
- (*TENTITY)(unsafe.Pointer((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declEntity)).Fbase = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_curBase
- (*TSTRING_POOL)(unsafe.Pointer(dtd + 160)).Fstart = (*TSTRING_POOL)(unsafe.Pointer(dtd + 160)).Fptr
- /* Don't suppress the default handler if we fell through from
- * the XML_ROLE_DOCTYPE_SYSTEM_ID case.
- */
- if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_entityDeclHandler != 0 && role == int32(_XML_ROLE_ENTITY_SYSTEM_ID) {
- handleDefault = libc.Uint8FromInt32(0)
- }
- }
- goto _64
- _29:
- ;
- if (*TDTD)(unsafe.Pointer(dtd)).FkeepProcessing != 0 && (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declEntity != 0 && (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_entityDeclHandler != 0 {
- *(*uintptr)(unsafe.Pointer(eventEndPP)) = s
- (*(*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))
- handleDefault = libc.Uint8FromInt32(0)
- }
- goto _64
- _30:
- ;
- if (*TDTD)(unsafe.Pointer(dtd)).FkeepProcessing != 0 && (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declEntity != 0 {
- (*TENTITY)(unsafe.Pointer((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declEntity)).Fnotation = _poolStoreString(tls, dtd+160, enc, s, *(*uintptr)(unsafe.Pointer(bp)))
- if !((*TENTITY)(unsafe.Pointer((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declEntity)).Fnotation != 0) {
- return int32(_XML_ERROR_NO_MEMORY)
- }
- (*TSTRING_POOL)(unsafe.Pointer(dtd + 160)).Fstart = (*TSTRING_POOL)(unsafe.Pointer(dtd + 160)).Fptr
- if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_unparsedEntityDeclHandler != 0 {
- *(*uintptr)(unsafe.Pointer(eventEndPP)) = s
- (*(*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)
- handleDefault = libc.Uint8FromInt32(0)
- } else {
- if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_entityDeclHandler != 0 {
- *(*uintptr)(unsafe.Pointer(eventEndPP)) = s
- (*(*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)
- handleDefault = libc.Uint8FromInt32(0)
- }
- }
- }
- goto _64
- _31:
- ;
- 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 {
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declEntity = libc.UintptrFromInt32(0)
- goto _64
- }
- if (*TDTD)(unsafe.Pointer(dtd)).FkeepProcessing != 0 {
- name = _poolStoreString(tls, dtd+160, enc, s, *(*uintptr)(unsafe.Pointer(bp)))
- if !(name != 0) {
- return int32(_XML_ERROR_NO_MEMORY)
- }
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declEntity = _lookup(tls, parser, dtd, name, uint64(64))
- if !((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declEntity != 0) {
- return int32(_XML_ERROR_NO_MEMORY)
- }
- if (*TENTITY)(unsafe.Pointer((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declEntity)).Fname != name {
- (*TSTRING_POOL)(unsafe.Pointer(dtd + 160)).Fptr = (*TSTRING_POOL)(unsafe.Pointer(dtd + 160)).Fstart
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declEntity = libc.UintptrFromInt32(0)
- } else {
- (*TSTRING_POOL)(unsafe.Pointer(dtd + 160)).Fstart = (*TSTRING_POOL)(unsafe.Pointer(dtd + 160)).Fptr
- (*TENTITY)(unsafe.Pointer((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declEntity)).FpublicId = libc.UintptrFromInt32(0)
- (*TENTITY)(unsafe.Pointer((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declEntity)).Fis_param = libc.Uint8FromInt32(0)
- /* if we have a parent parser or are reading an internal parameter
- entity, then the entity declaration is not considered "internal"
- */
- (*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))
- if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_entityDeclHandler != 0 {
- handleDefault = libc.Uint8FromInt32(0)
- }
- }
- } else {
- (*TSTRING_POOL)(unsafe.Pointer(dtd + 160)).Fptr = (*TSTRING_POOL)(unsafe.Pointer(dtd + 160)).Fstart
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declEntity = libc.UintptrFromInt32(0)
- }
- goto _64
- _32:
- ;
- if (*TDTD)(unsafe.Pointer(dtd)).FkeepProcessing != 0 {
- name1 = _poolStoreString(tls, dtd+160, enc, s, *(*uintptr)(unsafe.Pointer(bp)))
- if !(name1 != 0) {
- return int32(_XML_ERROR_NO_MEMORY)
- }
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declEntity = _lookup(tls, parser, dtd+264, name1, uint64(64))
- if !((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declEntity != 0) {
- return int32(_XML_ERROR_NO_MEMORY)
- }
- if (*TENTITY)(unsafe.Pointer((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declEntity)).Fname != name1 {
- (*TSTRING_POOL)(unsafe.Pointer(dtd + 160)).Fptr = (*TSTRING_POOL)(unsafe.Pointer(dtd + 160)).Fstart
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declEntity = libc.UintptrFromInt32(0)
- } else {
- (*TSTRING_POOL)(unsafe.Pointer(dtd + 160)).Fstart = (*TSTRING_POOL)(unsafe.Pointer(dtd + 160)).Fptr
- (*TENTITY)(unsafe.Pointer((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declEntity)).FpublicId = libc.UintptrFromInt32(0)
- (*TENTITY)(unsafe.Pointer((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declEntity)).Fis_param = libc.Uint8FromInt32(1)
- /* if we have a parent parser or are reading an internal parameter
- entity, then the entity declaration is not considered "internal"
- */
- (*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))
- if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_entityDeclHandler != 0 {
- handleDefault = libc.Uint8FromInt32(0)
- }
- }
- } else {
- (*TSTRING_POOL)(unsafe.Pointer(dtd + 160)).Fptr = (*TSTRING_POOL)(unsafe.Pointer(dtd + 160)).Fstart
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declEntity = libc.UintptrFromInt32(0)
- }
- goto _64
- _33:
- ;
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declNotationPublicId = libc.UintptrFromInt32(0)
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declNotationName = libc.UintptrFromInt32(0)
- if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_notationDeclHandler != 0 {
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declNotationName = _poolStoreString(tls, parser+784, enc, s, *(*uintptr)(unsafe.Pointer(bp)))
- if !((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declNotationName != 0) {
- return int32(_XML_ERROR_NO_MEMORY)
- }
- (*TSTRING_POOL)(unsafe.Pointer(parser + 784)).Fstart = (*TSTRING_POOL)(unsafe.Pointer(parser + 784)).Fptr
- handleDefault = libc.Uint8FromInt32(0)
- }
- goto _64
- _34:
- ;
- 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) {
- return int32(_XML_ERROR_PUBLICID)
- }
- if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declNotationName != 0 { /* means m_notationDeclHandler != NULL */
- tem1 = _poolStoreString(tls, parser+784, enc, s+uintptr((*TENCODING)(unsafe.Pointer(enc)).FminBytesPerChar), *(*uintptr)(unsafe.Pointer(bp))-uintptr((*TENCODING)(unsafe.Pointer(enc)).FminBytesPerChar))
- if !(tem1 != 0) {
- return int32(_XML_ERROR_NO_MEMORY)
- }
- _normalizePublicId(tls, tem1)
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declNotationPublicId = tem1
- (*TSTRING_POOL)(unsafe.Pointer(parser + 784)).Fstart = (*TSTRING_POOL)(unsafe.Pointer(parser + 784)).Fptr
- handleDefault = libc.Uint8FromInt32(0)
- }
- goto _64
- _35:
- ;
- if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declNotationName != 0 && (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_notationDeclHandler != 0 {
- systemId = _poolStoreString(tls, parser+784, enc, s+uintptr((*TENCODING)(unsafe.Pointer(enc)).FminBytesPerChar), *(*uintptr)(unsafe.Pointer(bp))-uintptr((*TENCODING)(unsafe.Pointer(enc)).FminBytesPerChar))
- if !(systemId != 0) {
- return int32(_XML_ERROR_NO_MEMORY)
- }
- *(*uintptr)(unsafe.Pointer(eventEndPP)) = s
- (*(*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)
- handleDefault = libc.Uint8FromInt32(0)
- }
- _poolClear(tls, parser+784)
- goto _64
- _36:
- ;
- if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declNotationPublicId != 0 && (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_notationDeclHandler != 0 {
- *(*uintptr)(unsafe.Pointer(eventEndPP)) = s
- (*(*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)
- handleDefault = libc.Uint8FromInt32(0)
- }
- _poolClear(tls, parser+784)
- goto _64
- _37:
- ;
- switch tok {
- case int32(m_XML_TOK_PARAM_ENTITY_REF):
- /* PE references in internal subset are
- not allowed within declarations. */
- return int32(_XML_ERROR_PARAM_ENTITY_REF)
- case int32(m_XML_TOK_XML_DECL):
- return int32(_XML_ERROR_MISPLACED_XML_PI)
- default:
- return int32(_XML_ERROR_SYNTAX)
- }
- _38:
- ;
- if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_defaultHandler != 0 {
- _reportDefault(tls, parser, enc, s, *(*uintptr)(unsafe.Pointer(bp)))
- }
- handleDefault = libc.Uint8FromInt32(0)
- result4 = _doIgnoreSection(tls, parser, enc, bp, end, nextPtr, haveMore)
- if result4 != int32(_XML_ERROR_NONE) {
- return result4
- } else {
- if !(*(*uintptr)(unsafe.Pointer(bp)) != 0) {
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_processor = __ccgo_fp(_ignoreSectionProcessor)
- return result4
- }
- }
- goto _64
- _39:
- ;
- if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_prologState.Flevel >= (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_groupSize {
- if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_groupSize != 0 {
- /* Detect and prevent integer overflow */
- if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_groupSize > libc.Uint32FromInt32(-libc.Int32FromInt32(1))/libc.Uint32FromUint32(2) {
- return int32(_XML_ERROR_NO_MEMORY)
- }
- p80 = parser + 888
- *(*uint32)(unsafe.Pointer(p80)) *= uint32(2)
- 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))))
- if new_connector == libc.UintptrFromInt32(0) {
- *(*uint32)(unsafe.Pointer(parser + 888)) /= uint32(2)
- return int32(_XML_ERROR_NO_MEMORY)
- }
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_groupConnector = new_connector
- if (*TDTD)(unsafe.Pointer(dtd)).FscaffIndex != 0 {
- /* Detect and prevent integer overflow.
- * The preprocessor guard addresses the "always false" warning
- * from -Wtype-limits on platforms where
- * sizeof(unsigned int) < sizeof(size_t), e.g. on x86_64. */
- 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))
- if new_scaff_index == libc.UintptrFromInt32(0) {
- return int32(_XML_ERROR_NO_MEMORY)
- }
- (*TDTD)(unsafe.Pointer(dtd)).FscaffIndex = new_scaff_index
- }
- } else {
- v81 = libc.Uint32FromInt32(32)
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_groupSize = v81
- (*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))
- if !((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_groupConnector != 0) {
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_groupSize = uint32(0)
- return int32(_XML_ERROR_NO_MEMORY)
- }
- }
- }
- *(*int8)(unsafe.Pointer((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_groupConnector + uintptr((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_prologState.Flevel))) = 0
- if (*TDTD)(unsafe.Pointer(dtd)).Fin_eldecl != 0 {
- myindex = _nextScaffoldPart(tls, parser)
- if myindex < 0 {
- return int32(_XML_ERROR_NO_MEMORY)
- }
- *(*int32)(unsafe.Pointer((*TDTD)(unsafe.Pointer(dtd)).FscaffIndex + uintptr((*TDTD)(unsafe.Pointer(dtd)).FscaffLevel)*4)) = myindex
- (*TDTD)(unsafe.Pointer(dtd)).FscaffLevel++
- (*(*TCONTENT_SCAFFOLD)(unsafe.Pointer((*TDTD)(unsafe.Pointer(dtd)).Fscaffold + uintptr(myindex)*32))).Ftype1 = int32(_XML_CTYPE_SEQ)
- if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_elementDeclHandler != 0 {
- handleDefault = libc.Uint8FromInt32(0)
- }
- }
- goto _64
- _40:
- ;
- 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) {
- return int32(_XML_ERROR_SYNTAX)
- }
- *(*int8)(unsafe.Pointer((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_groupConnector + uintptr((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_prologState.Flevel))) = int8(m_ASCII_COMMA)
- if (*TDTD)(unsafe.Pointer(dtd)).Fin_eldecl != 0 && (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_elementDeclHandler != 0 {
- handleDefault = libc.Uint8FromInt32(0)
- }
- goto _64
- _41:
- ;
- 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) {
- return int32(_XML_ERROR_SYNTAX)
- }
- 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) {
- (*(*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)
- if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_elementDeclHandler != 0 {
- handleDefault = libc.Uint8FromInt32(0)
- }
- }
- *(*int8)(unsafe.Pointer((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_groupConnector + uintptr((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_prologState.Flevel))) = int8(m_ASCII_PIPE)
- goto _64
- _43:
- ;
- _42:
- ;
- (*TDTD)(unsafe.Pointer(dtd)).FhasParamEntityRefs = libc.Uint8FromInt32(1)
- if !((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_paramEntityParsing != 0) {
- (*TDTD)(unsafe.Pointer(dtd)).FkeepProcessing = (*TDTD)(unsafe.Pointer(dtd)).Fstandalone
- } else {
- name2 = _poolStoreString(tls, dtd+160, enc, s+uintptr((*TENCODING)(unsafe.Pointer(enc)).FminBytesPerChar), *(*uintptr)(unsafe.Pointer(bp))-uintptr((*TENCODING)(unsafe.Pointer(enc)).FminBytesPerChar))
- if !(name2 != 0) {
- return int32(_XML_ERROR_NO_MEMORY)
- }
- entity2 = _lookup(tls, parser, dtd+264, name2, uint64(0))
- (*TSTRING_POOL)(unsafe.Pointer(dtd + 160)).Fptr = (*TSTRING_POOL)(unsafe.Pointer(dtd + 160)).Fstart
- /* first, determine if a check for an existing declaration is needed;
- if yes, check that the entity exists, and that it is internal,
- otherwise call the skipped entity handler
- */
- if v83 = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_prologState.FdocumentEntity != 0; v83 {
- if (*TDTD)(unsafe.Pointer(dtd)).Fstandalone != 0 {
- v82 = libc.BoolInt32(!((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_openInternalEntities != 0))
- } else {
- v82 = libc.BoolInt32(!((*TDTD)(unsafe.Pointer(dtd)).FhasParamEntityRefs != 0))
- }
- }
- if v83 && v82 != 0 {
- if !(entity2 != 0) {
- return int32(_XML_ERROR_UNDEFINED_ENTITY)
- } else {
- if !((*TENTITY)(unsafe.Pointer(entity2)).Fis_internal != 0) {
- /* It's hard to exhaustively search the code to be sure,
- * but there doesn't seem to be a way of executing the
- * following line. There are two cases:
- *
- * If 'standalone' is false, the DTD must have no
- * parameter entities or we wouldn't have passed the outer
- * 'if' statement. That means the only entity in the hash
- * table is the external subset name "#" which cannot be
- * given as a parameter entity name in XML syntax, so the
- * lookup must have returned NULL and we don't even reach
- * the test for an internal entity.
- *
- * If 'standalone' is true, it does not seem to be
- * possible to create entities taking this code path that
- * are not internal entities, so fail the test above.
- *
- * Because this analysis is very uncertain, the code is
- * being left in place and merely removed from the
- * coverage test statistics.
- */
- return int32(_XML_ERROR_ENTITY_DECLARED_IN_PE) /* LCOV_EXCL_LINE */
- }
- }
- } else {
- if !(entity2 != 0) {
- (*TDTD)(unsafe.Pointer(dtd)).FkeepProcessing = (*TDTD)(unsafe.Pointer(dtd)).Fstandalone
- /* cannot report skipped entities in declarations */
- if role == int32(_XML_ROLE_PARAM_ENTITY_REF) && (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_skippedEntityHandler != 0 {
- (*(*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))
- handleDefault = libc.Uint8FromInt32(0)
- }
- goto _64
- }
- }
- if (*TENTITY)(unsafe.Pointer(entity2)).Fopen != 0 {
- return int32(_XML_ERROR_RECURSIVE_ENTITY_REF)
- }
- if (*TENTITY)(unsafe.Pointer(entity2)).FtextPtr != 0 {
- if role == int32(_XML_ROLE_PARAM_ENTITY_REF) {
- v84 = libc.Int32FromUint8(libc.Uint8FromInt32(1))
- } else {
- v84 = libc.Int32FromUint8(libc.Uint8FromInt32(0))
- }
- betweenDecl = libc.Uint8FromInt32(v84)
- result5 = _processInternalEntity(tls, parser, entity2, betweenDecl)
- if result5 != int32(_XML_ERROR_NONE) {
- return result5
- }
- handleDefault = libc.Uint8FromInt32(0)
- goto _64
- }
- if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_externalEntityRefHandler != 0 {
- (*TDTD)(unsafe.Pointer(dtd)).FparamEntityRead = libc.Uint8FromInt32(0)
- (*TENTITY)(unsafe.Pointer(entity2)).Fopen = libc.Uint8FromInt32(1)
- _entityTrackingOnOpen(tls, parser, entity2, int32(5439))
- 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) {
- _entityTrackingOnClose(tls, parser, entity2, int32(5443))
- (*TENTITY)(unsafe.Pointer(entity2)).Fopen = libc.Uint8FromInt32(0)
- return int32(_XML_ERROR_EXTERNAL_ENTITY_HANDLING)
- }
- _entityTrackingOnClose(tls, parser, entity2, int32(5447))
- (*TENTITY)(unsafe.Pointer(entity2)).Fopen = libc.Uint8FromInt32(0)
- handleDefault = libc.Uint8FromInt32(0)
- if !((*TDTD)(unsafe.Pointer(dtd)).FparamEntityRead != 0) {
- (*TDTD)(unsafe.Pointer(dtd)).FkeepProcessing = (*TDTD)(unsafe.Pointer(dtd)).Fstandalone
- goto _64
- }
- } else {
- (*TDTD)(unsafe.Pointer(dtd)).FkeepProcessing = (*TDTD)(unsafe.Pointer(dtd)).Fstandalone
- goto _64
- }
- }
- 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) {
- return int32(_XML_ERROR_NOT_STANDALONE)
- }
- goto _64
- /* Element declaration stuff */
- _44:
- ;
- if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_elementDeclHandler != 0 {
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declElementType = _getElementType(tls, parser, enc, s, *(*uintptr)(unsafe.Pointer(bp)))
- if !((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_declElementType != 0) {
- return int32(_XML_ERROR_NO_MEMORY)
- }
- (*TDTD)(unsafe.Pointer(dtd)).FscaffLevel = 0
- (*TDTD)(unsafe.Pointer(dtd)).FscaffCount = uint32(0)
- (*TDTD)(unsafe.Pointer(dtd)).Fin_eldecl = libc.Uint8FromInt32(1)
- handleDefault = libc.Uint8FromInt32(0)
- }
- goto _64
- _46:
- ;
- _45:
- ;
- if (*TDTD)(unsafe.Pointer(dtd)).Fin_eldecl != 0 {
- if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_elementDeclHandler != 0 {
- content = (*(*func(*libc.TLS, Tsize_t) uintptr)(unsafe.Pointer(&struct{ uintptr }{(*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_mem.Fmalloc_fcn})))(tls, libc.Uint64FromInt64(32))
- if !(content != 0) {
- return int32(_XML_ERROR_NO_MEMORY)
- }
- (*TXML_Content)(unsafe.Pointer(content)).Fquant = int32(_XML_CQUANT_NONE)
- (*TXML_Content)(unsafe.Pointer(content)).Fname = libc.UintptrFromInt32(0)
- (*TXML_Content)(unsafe.Pointer(content)).Fnumchildren = uint32(0)
- (*TXML_Content)(unsafe.Pointer(content)).Fchildren = libc.UintptrFromInt32(0)
- if role == int32(_XML_ROLE_CONTENT_ANY) {
- v85 = int32(_XML_CTYPE_ANY)
- } else {
- v85 = int32(_XML_CTYPE_EMPTY)
- }
- (*TXML_Content)(unsafe.Pointer(content)).Ftype1 = v85
- *(*uintptr)(unsafe.Pointer(eventEndPP)) = s
- (*(*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)
- handleDefault = libc.Uint8FromInt32(0)
- }
- (*TDTD)(unsafe.Pointer(dtd)).Fin_eldecl = libc.Uint8FromInt32(0)
- }
- goto _64
- _47:
- ;
- if (*TDTD)(unsafe.Pointer(dtd)).Fin_eldecl != 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)
- if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_elementDeclHandler != 0 {
- handleDefault = libc.Uint8FromInt32(0)
- }
- }
- goto _64
- _48:
- ;
- quant = int32(_XML_CQUANT_NONE)
- goto elementContent
- _49:
- ;
- quant = int32(_XML_CQUANT_OPT)
- goto elementContent
- _50:
- ;
- quant = int32(_XML_CQUANT_REP)
- goto elementContent
- _51:
- ;
- quant = int32(_XML_CQUANT_PLUS)
- goto elementContent
- elementContent:
- ;
- if (*TDTD)(unsafe.Pointer(dtd)).Fin_eldecl != 0 {
- if quant == int32(_XML_CQUANT_NONE) {
- v86 = *(*uintptr)(unsafe.Pointer(bp))
- } else {
- v86 = *(*uintptr)(unsafe.Pointer(bp)) - uintptr((*TENCODING)(unsafe.Pointer(enc)).FminBytesPerChar)
- }
- nxt = v86
- myindex1 = _nextScaffoldPart(tls, parser)
- if myindex1 < 0 {
- return int32(_XML_ERROR_NO_MEMORY)
- }
- (*(*TCONTENT_SCAFFOLD)(unsafe.Pointer((*TDTD)(unsafe.Pointer(dtd)).Fscaffold + uintptr(myindex1)*32))).Ftype1 = int32(_XML_CTYPE_NAME)
- (*(*TCONTENT_SCAFFOLD)(unsafe.Pointer((*TDTD)(unsafe.Pointer(dtd)).Fscaffold + uintptr(myindex1)*32))).Fquant = quant
- el = _getElementType(tls, parser, enc, s, nxt)
- if !(el != 0) {
- return int32(_XML_ERROR_NO_MEMORY)
- }
- name3 = (*TELEMENT_TYPE)(unsafe.Pointer(el)).Fname
- (*(*TCONTENT_SCAFFOLD)(unsafe.Pointer((*TDTD)(unsafe.Pointer(dtd)).Fscaffold + uintptr(myindex1)*32))).Fname = name3
- nameLen = uint64(0)
- for {
- v88 = nameLen
- nameLen++
- if !(*(*TXML_Char)(unsafe.Pointer(name3 + uintptr(v88))) != 0) {
- break
- }
- goto _87
- _87:
- }
- /* Detect and prevent integer overflow */
- if nameLen > uint64(uint32(0xffffffff)-(*TDTD)(unsafe.Pointer(dtd)).FcontentStringLen) {
- return int32(_XML_ERROR_NO_MEMORY)
- }
- *(*uint32)(unsafe.Pointer(dtd + 336)) += uint32(nameLen)
- if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_elementDeclHandler != 0 {
- handleDefault = libc.Uint8FromInt32(0)
- }
- }
- goto _64
- _52:
- ;
- quant = int32(_XML_CQUANT_NONE)
- goto closeGroup
- _53:
- ;
- quant = int32(_XML_CQUANT_OPT)
- goto closeGroup
- _54:
- ;
- quant = int32(_XML_CQUANT_REP)
- goto closeGroup
- _55:
- ;
- quant = int32(_XML_CQUANT_PLUS)
- goto closeGroup
- closeGroup:
- ;
- if (*TDTD)(unsafe.Pointer(dtd)).Fin_eldecl != 0 {
- if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_elementDeclHandler != 0 {
- handleDefault = libc.Uint8FromInt32(0)
- }
- (*TDTD)(unsafe.Pointer(dtd)).FscaffLevel--
- (*(*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
- if (*TDTD)(unsafe.Pointer(dtd)).FscaffLevel == 0 {
- if !(handleDefault != 0) {
- model = _build_model(tls, parser)
- if !(model != 0) {
- return int32(_XML_ERROR_NO_MEMORY)
- }
- *(*uintptr)(unsafe.Pointer(eventEndPP)) = s
- (*(*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)
- }
- (*TDTD)(unsafe.Pointer(dtd)).Fin_eldecl = libc.Uint8FromInt32(0)
- (*TDTD)(unsafe.Pointer(dtd)).FcontentStringLen = uint32(0)
- }
- }
- goto _64
- /* End element declaration stuff */
- _56:
- ;
- if !(_reportProcessingInstruction(tls, parser, enc, s, *(*uintptr)(unsafe.Pointer(bp))) != 0) {
- return int32(_XML_ERROR_NO_MEMORY)
- }
- handleDefault = libc.Uint8FromInt32(0)
- goto _64
- _57:
- ;
- if !(_reportComment(tls, parser, enc, s, *(*uintptr)(unsafe.Pointer(bp))) != 0) {
- return int32(_XML_ERROR_NO_MEMORY)
- }
- handleDefault = libc.Uint8FromInt32(0)
- goto _64
- _58:
- ;
- switch tok {
- case int32(m_XML_TOK_BOM):
- handleDefault = libc.Uint8FromInt32(0)
- break
- }
- goto _64
- _59:
- ;
- if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_startDoctypeDeclHandler != 0 {
- handleDefault = libc.Uint8FromInt32(0)
- }
- goto _64
- _60:
- ;
- if (*TDTD)(unsafe.Pointer(dtd)).FkeepProcessing != 0 && (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_entityDeclHandler != 0 {
- handleDefault = libc.Uint8FromInt32(0)
- }
- goto _64
- _61:
- ;
- if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_notationDeclHandler != 0 {
- handleDefault = libc.Uint8FromInt32(0)
- }
- goto _64
- _62:
- ;
- if (*TDTD)(unsafe.Pointer(dtd)).FkeepProcessing != 0 && (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_attlistDeclHandler != 0 {
- handleDefault = libc.Uint8FromInt32(0)
- }
- goto _64
- _63:
- ;
- if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_elementDeclHandler != 0 {
- handleDefault = libc.Uint8FromInt32(0)
- }
- goto _64
- _64:
- ; /* end of big switch */
- if handleDefault != 0 && (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_defaultHandler != 0 {
- _reportDefault(tls, parser, enc, s, *(*uintptr)(unsafe.Pointer(bp)))
- }
- switch (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parsingStatus.Fparsing {
- case int32(_XML_SUSPENDED):
- *(*uintptr)(unsafe.Pointer(nextPtr)) = *(*uintptr)(unsafe.Pointer(bp))
- return int32(_XML_ERROR_NONE)
- case int32(_XML_FINISHED):
- return int32(_XML_ERROR_ABORTED)
- default:
- s = *(*uintptr)(unsafe.Pointer(bp))
- tok = (*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{*(*TSCANNER)(unsafe.Pointer(enc))})))(tls, enc, s, end, bp)
- }
- goto _1
- _1:
- }
- /* not reached */
- return r
- }
- var _externalSubsetName = [2]TXML_Char{
- 0: int8(m_ASCII_HASH),
- }
- var _atypeCDATA = [6]TXML_Char{
- 0: int8(m_ASCII_C),
- 1: int8(m_ASCII_D),
- 2: int8(m_ASCII_A),
- 3: int8(m_ASCII_T),
- 4: int8(m_ASCII_A),
- }
- var _atypeID = [3]TXML_Char{
- 0: int8(m_ASCII_I),
- 1: int8(m_ASCII_D),
- }
- var _atypeIDREF = [6]TXML_Char{
- 0: int8(m_ASCII_I),
- 1: int8(m_ASCII_D),
- 2: int8(m_ASCII_R),
- 3: int8(m_ASCII_E),
- 4: int8(m_ASCII_F),
- }
- var _atypeIDREFS = [7]TXML_Char{
- 0: int8(m_ASCII_I),
- 1: int8(m_ASCII_D),
- 2: int8(m_ASCII_R),
- 3: int8(m_ASCII_E),
- 4: int8(m_ASCII_F),
- 5: int8(m_ASCII_S),
- }
- var _atypeENTITY = [7]TXML_Char{
- 0: int8(m_ASCII_E),
- 1: int8(m_ASCII_N),
- 2: int8(m_ASCII_T),
- 3: int8(m_ASCII_I),
- 4: int8(m_ASCII_T),
- 5: int8(m_ASCII_Y),
- }
- var _atypeENTITIES = [9]TXML_Char{
- 0: int8(m_ASCII_E),
- 1: int8(m_ASCII_N),
- 2: int8(m_ASCII_T),
- 3: int8(m_ASCII_I),
- 4: int8(m_ASCII_T),
- 5: int8(m_ASCII_I),
- 6: int8(m_ASCII_E),
- 7: int8(m_ASCII_S),
- }
- var _atypeNMTOKEN = [8]TXML_Char{
- 0: int8(m_ASCII_N),
- 1: int8(m_ASCII_M),
- 2: int8(m_ASCII_T),
- 3: int8(m_ASCII_O),
- 4: int8(m_ASCII_K),
- 5: int8(m_ASCII_E),
- 6: int8(m_ASCII_N),
- }
- var _atypeNMTOKENS = [9]TXML_Char{
- 0: int8(m_ASCII_N),
- 1: int8(m_ASCII_M),
- 2: int8(m_ASCII_T),
- 3: int8(m_ASCII_O),
- 4: int8(m_ASCII_K),
- 5: int8(m_ASCII_E),
- 6: int8(m_ASCII_N),
- 7: int8(m_ASCII_S),
- }
- var _notationPrefix = [10]TXML_Char{
- 0: int8(m_ASCII_N),
- 1: int8(m_ASCII_O),
- 2: int8(m_ASCII_T),
- 3: int8(m_ASCII_A),
- 4: int8(m_ASCII_T),
- 5: int8(m_ASCII_I),
- 6: int8(m_ASCII_O),
- 7: int8(m_ASCII_N),
- 8: int8(m_ASCII_LPAREN),
- }
- var _enumValueSep = [2]TXML_Char{
- 0: int8(m_ASCII_PIPE),
- }
- var _enumValueStart = [2]TXML_Char{
- 0: int8(m_ASCII_LPAREN),
- }
- func _epilogProcessor(tls *libc.TLS, parser TXML_Parser, s uintptr, end uintptr, nextPtr uintptr) (r _XML_Error) {
- bp := tls.Alloc(16)
- defer tls.Free(16)
- var tok int32
- var v2 uintptr
- var _ /* next at bp+0 */ uintptr
- _, _ = tok, v2
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_processor = __ccgo_fp(_epilogProcessor)
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_eventPtr = s
- for {
- *(*uintptr)(unsafe.Pointer(bp)) = libc.UintptrFromInt32(0)
- 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)
- if !(_accountingDiffTolerated(tls, parser, tok, s, *(*uintptr)(unsafe.Pointer(bp)), int32(5652), int32(_XML_ACCOUNT_DIRECT)) != 0) {
- _accountingOnAbort(tls, parser)
- return int32(_XML_ERROR_AMPLIFICATION_LIMIT_BREACH)
- }
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_eventEndPtr = *(*uintptr)(unsafe.Pointer(bp))
- switch tok {
- /* report partial linebreak - it might be the last token */
- case -int32(m_XML_TOK_PROLOG_S):
- if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_defaultHandler != 0 {
- _reportDefault(tls, parser, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_encoding, s, *(*uintptr)(unsafe.Pointer(bp)))
- if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parsingStatus.Fparsing == int32(_XML_FINISHED) {
- return int32(_XML_ERROR_ABORTED)
- }
- }
- *(*uintptr)(unsafe.Pointer(nextPtr)) = *(*uintptr)(unsafe.Pointer(bp))
- return int32(_XML_ERROR_NONE)
- case -int32(4):
- *(*uintptr)(unsafe.Pointer(nextPtr)) = s
- return int32(_XML_ERROR_NONE)
- case int32(m_XML_TOK_PROLOG_S):
- if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_defaultHandler != 0 {
- _reportDefault(tls, parser, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_encoding, s, *(*uintptr)(unsafe.Pointer(bp)))
- }
- case int32(m_XML_TOK_PI):
- if !(_reportProcessingInstruction(tls, parser, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_encoding, s, *(*uintptr)(unsafe.Pointer(bp))) != 0) {
- return int32(_XML_ERROR_NO_MEMORY)
- }
- case int32(m_XML_TOK_COMMENT):
- if !(_reportComment(tls, parser, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_encoding, s, *(*uintptr)(unsafe.Pointer(bp))) != 0) {
- return int32(_XML_ERROR_NO_MEMORY)
- }
- case m_XML_TOK_INVALID:
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_eventPtr = *(*uintptr)(unsafe.Pointer(bp))
- return int32(_XML_ERROR_INVALID_TOKEN)
- case -int32(1):
- if !((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parsingStatus.FfinalBuffer != 0) {
- *(*uintptr)(unsafe.Pointer(nextPtr)) = s
- return int32(_XML_ERROR_NONE)
- }
- return int32(_XML_ERROR_UNCLOSED_TOKEN)
- case -int32(2):
- if !((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parsingStatus.FfinalBuffer != 0) {
- *(*uintptr)(unsafe.Pointer(nextPtr)) = s
- return int32(_XML_ERROR_NONE)
- }
- return int32(_XML_ERROR_PARTIAL_CHAR)
- default:
- return int32(_XML_ERROR_JUNK_AFTER_DOC_ELEMENT)
- }
- v2 = *(*uintptr)(unsafe.Pointer(bp))
- s = v2
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_eventPtr = v2
- switch (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parsingStatus.Fparsing {
- case int32(_XML_SUSPENDED):
- *(*uintptr)(unsafe.Pointer(nextPtr)) = *(*uintptr)(unsafe.Pointer(bp))
- return int32(_XML_ERROR_NONE)
- case int32(_XML_FINISHED):
- return int32(_XML_ERROR_ABORTED)
- default:
- }
- goto _1
- _1:
- }
- return r
- }
- func _processInternalEntity(tls *libc.TLS, parser TXML_Parser, entity uintptr, betweenDecl TXML_Bool) (r _XML_Error) {
- bp := tls.Alloc(16)
- defer tls.Free(16)
- var openEntity, textEnd, textStart uintptr
- var result _XML_Error
- var tok int32
- var _ /* next at bp+0 */ uintptr
- _, _, _, _, _ = openEntity, result, textEnd, textStart, tok
- if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_freeInternalEntities != 0 {
- openEntity = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_freeInternalEntities
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_freeInternalEntities = (*TOPEN_INTERNAL_ENTITY)(unsafe.Pointer(openEntity)).Fnext
- } else {
- openEntity = (*(*func(*libc.TLS, Tsize_t) uintptr)(unsafe.Pointer(&struct{ uintptr }{(*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_mem.Fmalloc_fcn})))(tls, libc.Uint64FromInt64(40))
- if !(openEntity != 0) {
- return int32(_XML_ERROR_NO_MEMORY)
- }
- }
- (*TENTITY)(unsafe.Pointer(entity)).Fopen = libc.Uint8FromInt32(1)
- _entityTrackingOnOpen(tls, parser, entity, int32(5732))
- (*TENTITY)(unsafe.Pointer(entity)).Fprocessed = 0
- (*TOPEN_INTERNAL_ENTITY)(unsafe.Pointer(openEntity)).Fnext = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_openInternalEntities
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_openInternalEntities = openEntity
- (*TOPEN_INTERNAL_ENTITY)(unsafe.Pointer(openEntity)).Fentity = entity
- (*TOPEN_INTERNAL_ENTITY)(unsafe.Pointer(openEntity)).FstartTagLevel = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_tagLevel
- (*TOPEN_INTERNAL_ENTITY)(unsafe.Pointer(openEntity)).FbetweenDecl = betweenDecl
- (*TOPEN_INTERNAL_ENTITY)(unsafe.Pointer(openEntity)).FinternalEventPtr = libc.UintptrFromInt32(0)
- (*TOPEN_INTERNAL_ENTITY)(unsafe.Pointer(openEntity)).FinternalEventEndPtr = libc.UintptrFromInt32(0)
- textStart = (*TENTITY)(unsafe.Pointer(entity)).FtextPtr
- textEnd = (*TENTITY)(unsafe.Pointer(entity)).FtextPtr + uintptr((*TENTITY)(unsafe.Pointer(entity)).FtextLen)
- /* Set a safe default value in case 'next' does not get set */
- *(*uintptr)(unsafe.Pointer(bp)) = textStart
- if (*TENTITY)(unsafe.Pointer(entity)).Fis_param != 0 {
- 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)
- 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))
- } else {
- 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))
- }
- if result == int32(_XML_ERROR_NONE) {
- if textEnd != *(*uintptr)(unsafe.Pointer(bp)) && (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parsingStatus.Fparsing == int32(_XML_SUSPENDED) {
- (*TENTITY)(unsafe.Pointer(entity)).Fprocessed = int32(int64(*(*uintptr)(unsafe.Pointer(bp))) - int64(textStart))
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_processor = __ccgo_fp(_internalEntityProcessor)
- } else {
- _entityTrackingOnClose(tls, parser, entity, int32(5766))
- (*TENTITY)(unsafe.Pointer(entity)).Fopen = libc.Uint8FromInt32(0)
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_openInternalEntities = (*TOPEN_INTERNAL_ENTITY)(unsafe.Pointer(openEntity)).Fnext
- /* put openEntity back in list of free instances */
- (*TOPEN_INTERNAL_ENTITY)(unsafe.Pointer(openEntity)).Fnext = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_freeInternalEntities
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_freeInternalEntities = openEntity
- }
- }
- return result
- }
- func _internalEntityProcessor(tls *libc.TLS, parser TXML_Parser, s uintptr, end uintptr, nextPtr uintptr) (r _XML_Error) {
- bp := tls.Alloc(16)
- defer tls.Free(16)
- var entity, openEntity, textEnd, textStart uintptr
- var result _XML_Error
- var tok, tok1, v1 int32
- var _ /* next at bp+0 */ uintptr
- _, _, _, _, _, _, _, _ = entity, openEntity, result, textEnd, textStart, tok, tok1, v1
- openEntity = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_openInternalEntities
- if !(openEntity != 0) {
- return int32(_XML_ERROR_UNEXPECTED_STATE)
- }
- entity = (*TOPEN_INTERNAL_ENTITY)(unsafe.Pointer(openEntity)).Fentity
- textStart = (*TENTITY)(unsafe.Pointer(entity)).FtextPtr + uintptr((*TENTITY)(unsafe.Pointer(entity)).Fprocessed)
- textEnd = (*TENTITY)(unsafe.Pointer(entity)).FtextPtr + uintptr((*TENTITY)(unsafe.Pointer(entity)).FtextLen)
- /* Set a safe default value in case 'next' does not get set */
- *(*uintptr)(unsafe.Pointer(bp)) = textStart
- if (*TENTITY)(unsafe.Pointer(entity)).Fis_param != 0 {
- 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)
- 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))
- } else {
- 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))
- }
- if result != int32(_XML_ERROR_NONE) {
- return result
- }
- if textEnd != *(*uintptr)(unsafe.Pointer(bp)) && (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parsingStatus.Fparsing == int32(_XML_SUSPENDED) {
- (*TENTITY)(unsafe.Pointer(entity)).Fprocessed = int32(int64(*(*uintptr)(unsafe.Pointer(bp))) - int64((*TENTITY)(unsafe.Pointer(entity)).FtextPtr))
- return result
- }
- _entityTrackingOnClose(tls, parser, entity, int32(5817))
- (*TENTITY)(unsafe.Pointer(entity)).Fopen = libc.Uint8FromInt32(0)
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_openInternalEntities = (*TOPEN_INTERNAL_ENTITY)(unsafe.Pointer(openEntity)).Fnext
- /* put openEntity back in list of free instances */
- (*TOPEN_INTERNAL_ENTITY)(unsafe.Pointer(openEntity)).Fnext = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_freeInternalEntities
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_freeInternalEntities = openEntity
- // If there are more open entities we want to stop right here and have the
- // upcoming call to XML_ResumeParser continue with entity content, or it would
- // be ignored altogether.
- if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_openInternalEntities != libc.UintptrFromInt32(0) && (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parsingStatus.Fparsing == int32(_XML_SUSPENDED) {
- return int32(_XML_ERROR_NONE)
- }
- if (*TENTITY)(unsafe.Pointer(entity)).Fis_param != 0 {
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_processor = __ccgo_fp(_prologProcessor)
- 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)
- 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))
- } else {
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_processor = __ccgo_fp(_contentProcessor)
- /* see externalEntityContentProcessor vs contentProcessor */
- if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_parentParser != 0 {
- v1 = int32(1)
- } else {
- v1 = 0
- }
- 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))
- if result == int32(_XML_ERROR_NONE) {
- if !(_storeRawNames(tls, parser) != 0) {
- return int32(_XML_ERROR_NO_MEMORY)
- }
- }
- return result
- }
- return r
- }
- func _errorProcessor(tls *libc.TLS, parser TXML_Parser, s uintptr, end uintptr, nextPtr uintptr) (r _XML_Error) {
- _ = s
- _ = end
- _ = nextPtr
- return (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_errorCode
- }
- 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) {
- var result _XML_Error
- var v1 int32
- var v2, v3 uintptr
- _, _, _, _ = result, v1, v2, v3
- result = _appendAttributeValue(tls, parser, enc, isCdata, ptr, end, pool, account)
- if result != 0 {
- return result
- }
- 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) {
- (*TSTRING_POOL)(unsafe.Pointer(pool)).Fptr--
- }
- if (*TSTRING_POOL)(unsafe.Pointer(pool)).Fptr == (*TSTRING_POOL)(unsafe.Pointer(pool)).Fend && !(_poolGrow(tls, pool) != 0) {
- v1 = 0
- } else {
- v3 = pool + 24
- v2 = *(*uintptr)(unsafe.Pointer(v3))
- *(*uintptr)(unsafe.Pointer(v3))++
- *(*TXML_Char)(unsafe.Pointer(v2)) = int8('\000')
- v1 = libc.Int32FromInt32(1)
- }
- if !(v1 != 0) {
- return int32(_XML_ERROR_NO_MEMORY)
- }
- return int32(_XML_ERROR_NONE)
- }
- 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) {
- bp := tls.Alloc(16)
- defer tls.Free(16)
- var checkEntityDecl int8
- var dtd, entity, name, textEnd, v10, v11, v4, v5, v7, v8 uintptr
- var i, n, tok, v12, v3, v6, v9 int32
- var result _XML_Error
- var v13 bool
- var _ /* buf at bp+8 */ [4]TXML_Char
- var _ /* ch at bp+12 */ TXML_Char
- var _ /* next at bp+0 */ uintptr
- _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = checkEntityDecl, dtd, entity, i, n, name, result, textEnd, tok, v10, v11, v12, v13, v3, v4, v5, v6, v7, v8, v9
- dtd = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_dtd /* save one level of indirection */
- for {
- *(*uintptr)(unsafe.Pointer(bp)) = ptr /* XmlAttributeValueTok doesn't always set the last arg */
- tok = (*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{*(*TSCANNER)(unsafe.Pointer(enc + 32))})))(tls, enc, ptr, end, bp)
- if !(_accountingDiffTolerated(tls, parser, tok, ptr, *(*uintptr)(unsafe.Pointer(bp)), int32(5896), account) != 0) {
- _accountingOnAbort(tls, parser)
- return int32(_XML_ERROR_AMPLIFICATION_LIMIT_BREACH)
- }
- switch tok {
- case -int32(4):
- return int32(_XML_ERROR_NONE)
- case m_XML_TOK_INVALID:
- if enc == (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_encoding {
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_eventPtr = *(*uintptr)(unsafe.Pointer(bp))
- }
- return int32(_XML_ERROR_INVALID_TOKEN)
- case -int32(1):
- if enc == (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_encoding {
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_eventPtr = ptr
- }
- return int32(_XML_ERROR_INVALID_TOKEN)
- case int32(m_XML_TOK_CHAR_REF):
- n = (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*TENCODING)(unsafe.Pointer(enc)).FcharRefNumber})))(tls, enc, ptr)
- if n < 0 {
- if enc == (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_encoding {
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_eventPtr = ptr
- }
- return int32(_XML_ERROR_BAD_CHAR_REF)
- }
- 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)) {
- break
- }
- n = XXmlUtf8Encode(tls, n, bp+8)
- /* The XmlEncode() functions can never return 0 here. That
- * error return happens if the code point passed in is either
- * negative or greater than or equal to 0x110000. The
- * XmlCharRefNumber() functions will all return a number
- * strictly less than 0x110000 or a negative value if an error
- * occurred. The negative value is intercepted above, so
- * XmlEncode() is never passed a value it might return an
- * error for.
- */
- i = 0
- for {
- if !(i < n) {
- break
- }
- if (*TSTRING_POOL)(unsafe.Pointer(pool)).Fptr == (*TSTRING_POOL)(unsafe.Pointer(pool)).Fend && !(_poolGrow(tls, pool) != 0) {
- v3 = 0
- } else {
- v5 = pool + 24
- v4 = *(*uintptr)(unsafe.Pointer(v5))
- *(*uintptr)(unsafe.Pointer(v5))++
- *(*TXML_Char)(unsafe.Pointer(v4)) = (*(*[4]TXML_Char)(unsafe.Pointer(bp + 8)))[i]
- v3 = libc.Int32FromInt32(1)
- }
- if !(v3 != 0) {
- return int32(_XML_ERROR_NO_MEMORY)
- }
- goto _2
- _2:
- ;
- i++
- }
- case int32(m_XML_TOK_DATA_CHARS):
- if !(_poolAppend(tls, pool, enc, ptr, *(*uintptr)(unsafe.Pointer(bp))) != 0) {
- return int32(_XML_ERROR_NO_MEMORY)
- }
- case -int32(3):
- *(*uintptr)(unsafe.Pointer(bp)) = ptr + uintptr((*TENCODING)(unsafe.Pointer(enc)).FminBytesPerChar)
- /* fall through */
- fallthrough
- case int32(m_XML_TOK_ATTRIBUTE_VALUE_S):
- fallthrough
- case int32(m_XML_TOK_DATA_NEWLINE):
- 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)) {
- break
- }
- if (*TSTRING_POOL)(unsafe.Pointer(pool)).Fptr == (*TSTRING_POOL)(unsafe.Pointer(pool)).Fend && !(_poolGrow(tls, pool) != 0) {
- v6 = 0
- } else {
- v8 = pool + 24
- v7 = *(*uintptr)(unsafe.Pointer(v8))
- *(*uintptr)(unsafe.Pointer(v8))++
- *(*TXML_Char)(unsafe.Pointer(v7)) = int8(0x20)
- v6 = libc.Int32FromInt32(1)
- }
- if !(v6 != 0) {
- return int32(_XML_ERROR_NO_MEMORY)
- }
- case int32(m_XML_TOK_ENTITY_REF):
- *(*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)))
- if *(*TXML_Char)(unsafe.Pointer(bp + 12)) != 0 {
- /* NOTE: We are replacing 4-6 characters original input for 1 character
- * so there is no amplification and hence recording without
- * protection. */
- _accountingDiffTolerated(tls, parser, tok, bp+12, bp+12+uintptr(1), int32(5965), int32(_XML_ACCOUNT_ENTITY_EXPANSION))
- if (*TSTRING_POOL)(unsafe.Pointer(pool)).Fptr == (*TSTRING_POOL)(unsafe.Pointer(pool)).Fend && !(_poolGrow(tls, pool) != 0) {
- v9 = 0
- } else {
- v11 = pool + 24
- v10 = *(*uintptr)(unsafe.Pointer(v11))
- *(*uintptr)(unsafe.Pointer(v11))++
- *(*TXML_Char)(unsafe.Pointer(v10)) = *(*TXML_Char)(unsafe.Pointer(bp + 12))
- v9 = libc.Int32FromInt32(1)
- }
- if !(v9 != 0) {
- return int32(_XML_ERROR_NO_MEMORY)
- }
- break
- }
- name = _poolStoreString(tls, parser+832, enc, ptr+uintptr((*TENCODING)(unsafe.Pointer(enc)).FminBytesPerChar), *(*uintptr)(unsafe.Pointer(bp))-uintptr((*TENCODING)(unsafe.Pointer(enc)).FminBytesPerChar))
- if !(name != 0) {
- return int32(_XML_ERROR_NO_MEMORY)
- }
- entity = _lookup(tls, parser, dtd, name, uint64(0))
- (*TSTRING_POOL)(unsafe.Pointer(parser + 832)).Fptr = (*TSTRING_POOL)(unsafe.Pointer(parser + 832)).Fstart
- /* First, determine if a check for an existing declaration is needed;
- if yes, check that the entity exists, and that it is internal.
- */
- if pool == dtd+160 { /* are we called from prolog? */
- if v13 = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_prologState.FdocumentEntity != 0; v13 {
- if (*TDTD)(unsafe.Pointer(dtd)).Fstandalone != 0 {
- v12 = libc.BoolInt32(!((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_openInternalEntities != 0))
- } else {
- v12 = libc.BoolInt32(!((*TDTD)(unsafe.Pointer(dtd)).FhasParamEntityRefs != 0))
- }
- }
- checkEntityDecl = libc.BoolInt8(v13 && v12 != 0)
- } else { /* if (pool == &parser->m_tempPool): we are called from content */
- checkEntityDecl = libc.BoolInt8(!((*TDTD)(unsafe.Pointer(dtd)).FhasParamEntityRefs != 0) || (*TDTD)(unsafe.Pointer(dtd)).Fstandalone != 0)
- }
- if checkEntityDecl != 0 {
- if !(entity != 0) {
- return int32(_XML_ERROR_UNDEFINED_ENTITY)
- } else {
- if !((*TENTITY)(unsafe.Pointer(entity)).Fis_internal != 0) {
- return int32(_XML_ERROR_ENTITY_DECLARED_IN_PE)
- }
- }
- } else {
- if !(entity != 0) {
- /* Cannot report skipped entity here - see comments on
- parser->m_skippedEntityHandler.
- if (parser->m_skippedEntityHandler)
- parser->m_skippedEntityHandler(parser->m_handlerArg, name, 0);
- */
- /* Cannot call the default handler because this would be
- out of sync with the call to the startElementHandler.
- if ((pool == &parser->m_tempPool) && parser->m_defaultHandler)
- reportDefault(parser, enc, ptr, next);
- */
- break
- }
- }
- if (*TENTITY)(unsafe.Pointer(entity)).Fopen != 0 {
- if enc == (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_encoding {
- /* It does not appear that this line can be executed.
- *
- * The "if (entity->open)" check catches recursive entity
- * definitions. In order to be called with an open
- * entity, it must have gone through this code before and
- * been through the recursive call to
- * appendAttributeValue() some lines below. That call
- * sets the local encoding ("enc") to the parser's
- * internal encoding (internal_utf8 or internal_utf16),
- * which can never be the same as the principle encoding.
- * It doesn't appear there is another code path that gets
- * here with entity->open being TRUE.
- *
- * Since it is not certain that this logic is watertight,
- * we keep the line and merely exclude it from coverage
- * tests.
- */
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_eventPtr = ptr /* LCOV_EXCL_LINE */
- }
- return int32(_XML_ERROR_RECURSIVE_ENTITY_REF)
- }
- if (*TENTITY)(unsafe.Pointer(entity)).Fnotation != 0 {
- if enc == (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_encoding {
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_eventPtr = ptr
- }
- return int32(_XML_ERROR_BINARY_ENTITY_REF)
- }
- if !((*TENTITY)(unsafe.Pointer(entity)).FtextPtr != 0) {
- if enc == (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_encoding {
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_eventPtr = ptr
- }
- return int32(_XML_ERROR_ATTRIBUTE_EXTERNAL_ENTITY_REF)
- } else {
- textEnd = (*TENTITY)(unsafe.Pointer(entity)).FtextPtr + uintptr((*TENTITY)(unsafe.Pointer(entity)).FtextLen)
- (*TENTITY)(unsafe.Pointer(entity)).Fopen = libc.Uint8FromInt32(1)
- _entityTrackingOnOpen(tls, parser, entity, int32(6046))
- result = _appendAttributeValue(tls, parser, (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_internalEncoding, isCdata, (*TENTITY)(unsafe.Pointer(entity)).FtextPtr, textEnd, pool, int32(_XML_ACCOUNT_ENTITY_EXPANSION))
- _entityTrackingOnClose(tls, parser, entity, int32(6053))
- (*TENTITY)(unsafe.Pointer(entity)).Fopen = libc.Uint8FromInt32(0)
- if result != 0 {
- return result
- }
- }
- default:
- /* The only token returned by XmlAttributeValueTok() that does
- * not have an explicit case here is XML_TOK_PARTIAL_CHAR.
- * Getting that would require an entity name to contain an
- * incomplete XML character (e.g. \xE2\x82); however previous
- * tokenisers will have already recognised and rejected such
- * names before XmlAttributeValueTok() gets a look-in. This
- * default case should be retained as a safety net, but the code
- * excluded from coverage tests.
- *
- * LCOV_EXCL_START
- */
- if enc == (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_encoding {
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_eventPtr = ptr
- }
- return int32(_XML_ERROR_UNEXPECTED_STATE)
- /* LCOV_EXCL_STOP */
- }
- ptr = *(*uintptr)(unsafe.Pointer(bp))
- goto _1
- _1:
- }
- /* not reached */
- return r
- }
- func _storeEntityValue(tls *libc.TLS, parser TXML_Parser, enc uintptr, entityTextPtr uintptr, entityTextEnd uintptr, account _XML_Account) (r _XML_Error) {
- bp := tls.Alloc(16)
- defer tls.Free(16)
- var dtd, entity, name, pool, v2, v3, v5, v6 uintptr
- var i, n, oldInEntityValue, tok int32
- var result _XML_Error
- var _ /* buf at bp+8 */ [4]TXML_Char
- var _ /* next at bp+0 */ uintptr
- _, _, _, _, _, _, _, _, _, _, _, _, _ = dtd, entity, i, n, name, oldInEntityValue, pool, result, tok, v2, v3, v5, v6
- dtd = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_dtd /* save one level of indirection */
- pool = dtd + 208
- result = int32(_XML_ERROR_NONE)
- oldInEntityValue = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_prologState.FinEntityValue
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_prologState.FinEntityValue = int32(1)
- /* never return Null for the value argument in EntityDeclHandler,
- since this would indicate an external entity; therefore we
- have to make sure that entityValuePool.start is not null */
- if !((*TSTRING_POOL)(unsafe.Pointer(pool)).Fblocks != 0) {
- if !(_poolGrow(tls, pool) != 0) {
- return int32(_XML_ERROR_NO_MEMORY)
- }
- }
- for {
- *(*uintptr)(unsafe.Pointer(bp)) = entityTextPtr /* XmlEntityValueTok doesn't always set the last arg */
- 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)
- if !(_accountingDiffTolerated(tls, parser, tok, entityTextPtr, *(*uintptr)(unsafe.Pointer(bp)), int32(6109), account) != 0) {
- _accountingOnAbort(tls, parser)
- result = int32(_XML_ERROR_AMPLIFICATION_LIMIT_BREACH)
- goto endEntityValue
- }
- switch tok {
- case int32(m_XML_TOK_PARAM_ENTITY_REF):
- if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_isParamEntity != 0 || enc != (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_encoding {
- name = _poolStoreString(tls, parser+784, enc, entityTextPtr+uintptr((*TENCODING)(unsafe.Pointer(enc)).FminBytesPerChar), *(*uintptr)(unsafe.Pointer(bp))-uintptr((*TENCODING)(unsafe.Pointer(enc)).FminBytesPerChar))
- if !(name != 0) {
- result = int32(_XML_ERROR_NO_MEMORY)
- goto endEntityValue
- }
- entity = _lookup(tls, parser, dtd+264, name, uint64(0))
- (*TSTRING_POOL)(unsafe.Pointer(parser + 784)).Fptr = (*TSTRING_POOL)(unsafe.Pointer(parser + 784)).Fstart
- if !(entity != 0) {
- /* not a well-formedness error - see XML 1.0: WFC Entity Declared */
- /* cannot report skipped entity here - see comments on
- parser->m_skippedEntityHandler
- if (parser->m_skippedEntityHandler)
- parser->m_skippedEntityHandler(parser->m_handlerArg, name, 0);
- */
- (*TDTD)(unsafe.Pointer(dtd)).FkeepProcessing = (*TDTD)(unsafe.Pointer(dtd)).Fstandalone
- goto endEntityValue
- }
- if (*TENTITY)(unsafe.Pointer(entity)).Fopen != 0 {
- if enc == (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_encoding {
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_eventPtr = entityTextPtr
- }
- result = int32(_XML_ERROR_RECURSIVE_ENTITY_REF)
- goto endEntityValue
- }
- if (*TENTITY)(unsafe.Pointer(entity)).FsystemId != 0 {
- if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_externalEntityRefHandler != 0 {
- (*TDTD)(unsafe.Pointer(dtd)).FparamEntityRead = libc.Uint8FromInt32(0)
- (*TENTITY)(unsafe.Pointer(entity)).Fopen = libc.Uint8FromInt32(1)
- _entityTrackingOnOpen(tls, parser, entity, int32(6152))
- 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) {
- _entityTrackingOnClose(tls, parser, entity, int32(6156))
- (*TENTITY)(unsafe.Pointer(entity)).Fopen = libc.Uint8FromInt32(0)
- result = int32(_XML_ERROR_EXTERNAL_ENTITY_HANDLING)
- goto endEntityValue
- }
- _entityTrackingOnClose(tls, parser, entity, int32(6161))
- (*TENTITY)(unsafe.Pointer(entity)).Fopen = libc.Uint8FromInt32(0)
- if !((*TDTD)(unsafe.Pointer(dtd)).FparamEntityRead != 0) {
- (*TDTD)(unsafe.Pointer(dtd)).FkeepProcessing = (*TDTD)(unsafe.Pointer(dtd)).Fstandalone
- }
- } else {
- (*TDTD)(unsafe.Pointer(dtd)).FkeepProcessing = (*TDTD)(unsafe.Pointer(dtd)).Fstandalone
- }
- } else {
- (*TENTITY)(unsafe.Pointer(entity)).Fopen = libc.Uint8FromInt32(1)
- _entityTrackingOnOpen(tls, parser, entity, int32(6169))
- 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))
- _entityTrackingOnClose(tls, parser, entity, int32(6174))
- (*TENTITY)(unsafe.Pointer(entity)).Fopen = libc.Uint8FromInt32(0)
- if result != 0 {
- goto endEntityValue
- }
- }
- break
- }
- /* In the internal subset, PE references are not legal
- within markup declarations, e.g entity values in this case. */
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_eventPtr = entityTextPtr
- result = int32(_XML_ERROR_PARAM_ENTITY_REF)
- goto endEntityValue
- case -int32(4):
- result = int32(_XML_ERROR_NONE)
- goto endEntityValue
- case int32(m_XML_TOK_ENTITY_REF):
- fallthrough
- case int32(m_XML_TOK_DATA_CHARS):
- if !(_poolAppend(tls, pool, enc, entityTextPtr, *(*uintptr)(unsafe.Pointer(bp))) != 0) {
- result = int32(_XML_ERROR_NO_MEMORY)
- goto endEntityValue
- }
- case -int32(3):
- *(*uintptr)(unsafe.Pointer(bp)) = entityTextPtr + uintptr((*TENCODING)(unsafe.Pointer(enc)).FminBytesPerChar)
- /* fall through */
- fallthrough
- case int32(m_XML_TOK_DATA_NEWLINE):
- if (*TSTRING_POOL)(unsafe.Pointer(pool)).Fend == (*TSTRING_POOL)(unsafe.Pointer(pool)).Fptr && !(_poolGrow(tls, pool) != 0) {
- result = int32(_XML_ERROR_NO_MEMORY)
- goto endEntityValue
- }
- v3 = pool + 24
- v2 = *(*uintptr)(unsafe.Pointer(v3))
- *(*uintptr)(unsafe.Pointer(v3))++
- *(*TXML_Char)(unsafe.Pointer(v2)) = int8(0xA)
- case int32(m_XML_TOK_CHAR_REF):
- n = (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*TENCODING)(unsafe.Pointer(enc)).FcharRefNumber})))(tls, enc, entityTextPtr)
- if n < 0 {
- if enc == (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_encoding {
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_eventPtr = entityTextPtr
- }
- result = int32(_XML_ERROR_BAD_CHAR_REF)
- goto endEntityValue
- }
- n = XXmlUtf8Encode(tls, n, bp+8)
- /* The XmlEncode() functions can never return 0 here. That
- * error return happens if the code point passed in is either
- * negative or greater than or equal to 0x110000. The
- * XmlCharRefNumber() functions will all return a number
- * strictly less than 0x110000 or a negative value if an error
- * occurred. The negative value is intercepted above, so
- * XmlEncode() is never passed a value it might return an
- * error for.
- */
- i = 0
- for {
- if !(i < n) {
- break
- }
- if (*TSTRING_POOL)(unsafe.Pointer(pool)).Fend == (*TSTRING_POOL)(unsafe.Pointer(pool)).Fptr && !(_poolGrow(tls, pool) != 0) {
- result = int32(_XML_ERROR_NO_MEMORY)
- goto endEntityValue
- }
- v6 = pool + 24
- v5 = *(*uintptr)(unsafe.Pointer(v6))
- *(*uintptr)(unsafe.Pointer(v6))++
- *(*TXML_Char)(unsafe.Pointer(v5)) = (*(*[4]TXML_Char)(unsafe.Pointer(bp + 8)))[i]
- goto _4
- _4:
- ;
- i++
- }
- case -int32(1):
- if enc == (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_encoding {
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_eventPtr = entityTextPtr
- }
- result = int32(_XML_ERROR_INVALID_TOKEN)
- goto endEntityValue
- case m_XML_TOK_INVALID:
- if enc == (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_encoding {
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_eventPtr = *(*uintptr)(unsafe.Pointer(bp))
- }
- result = int32(_XML_ERROR_INVALID_TOKEN)
- goto endEntityValue
- default:
- /* This default case should be unnecessary -- all the tokens
- * that XmlEntityValueTok() can return have their own explicit
- * cases -- but should be retained for safety. We do however
- * exclude it from the coverage statistics.
- *
- * LCOV_EXCL_START
- */
- if enc == (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_encoding {
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_eventPtr = entityTextPtr
- }
- result = int32(_XML_ERROR_UNEXPECTED_STATE)
- goto endEntityValue
- /* LCOV_EXCL_STOP */
- }
- entityTextPtr = *(*uintptr)(unsafe.Pointer(bp))
- goto _1
- _1:
- }
- goto endEntityValue
- endEntityValue:
- ;
- (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_prologState.FinEntityValue = oldInEntityValue
- return result
- }
- func _normalizeLines(tls *libc.TLS, s uintptr) {
- var p, v2, v3, v4, v5 uintptr
- _, _, _, _, _ = p, v2, v3, v4, v5
- for {
- if int32(*(*TXML_Char)(unsafe.Pointer(s))) == int32('\000') {
- return
- }
- if int32(*(*TXML_Char)(unsafe.Pointer(s))) == int32(0xD) {
- break
- }
- goto _1
- _1:
- ;
- s++
- }
- p = s
- for cond := true; cond; cond = *(*TXML_Char)(unsafe.Pointer(s)) != 0 {
- if int32(*(*TXML_Char)(unsafe.Pointer(s))) == int32(0xD) {
- v2 = p
- p++
- *(*TXML_Char)(unsafe.Pointer(v2)) = int8(0xA)
- s++
- v3 = s
- if int32(*(*TXML_Char)(unsafe.Pointer(v3))) == int32(0xA) {
- s++
- }
- } else {
- v4 = p
- p++
- v5 = s
- s++
- *(*TXML_Char)(unsafe.Pointer(v4)) = *(*TXML_Char)(unsafe.Pointer(v5))
- }
- }
- *(*TXML_Char)(unsafe.Pointer(p)) = int8('\000')
- }
- func _reportProcessingInstruction(tls *libc.TLS, parser TXML_Parser, enc uintptr, start uintptr, end uintptr) (r int32) {
- var data, target, tem uintptr
- _, _, _ = data, target, tem
- if !((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_processingInstructionHandler != 0) {
- if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_defaultHandler != 0 {
- _reportDefault(tls, parser, enc, start, end)
- }
- return int32(1)
- }
- start += uintptr((*TENCODING)(unsafe.Pointer(enc)).FminBytesPerChar * int32(2))
- tem = start + uintptr((*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*TENCODING)(unsafe.Pointer(enc)).FnameLength})))(tls, enc, start))
- target = _poolStoreString(tls, parser+784, enc, start, tem)
- if !(target != 0) {
- return 0
- }
- (*TSTRING_POOL)(unsafe.Pointer(parser + 784)).Fstart = (*TSTRING_POOL)(unsafe.Pointer(parser + 784)).Fptr
- 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)))
- if !(data != 0) {
- return 0
- }
- _normalizeLines(tls, data)
- (*(*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)
- _poolClear(tls, parser+784)
- return int32(1)
- }
- func _reportComment(tls *libc.TLS, parser TXML_Parser, enc uintptr, start uintptr, end uintptr) (r int32) {
- var data uintptr
- _ = data
- if !((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_commentHandler != 0) {
- if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_defaultHandler != 0 {
- _reportDefault(tls, parser, enc, start, end)
- }
- return int32(1)
- }
- data = _poolStoreString(tls, parser+784, enc, start+uintptr((*TENCODING)(unsafe.Pointer(enc)).FminBytesPerChar*int32(4)), end-uintptr((*TENCODING)(unsafe.Pointer(enc)).FminBytesPerChar*int32(3)))
- if !(data != 0) {
- return 0
- }
- _normalizeLines(tls, data)
- (*(*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)
- _poolClear(tls, parser+784)
- return int32(1)
- }
- func _reportDefault(tls *libc.TLS, parser TXML_Parser, enc uintptr, _s uintptr, end uintptr) {
- bp := tls.Alloc(16)
- defer tls.Free(16)
- *(*uintptr)(unsafe.Pointer(bp)) = _s
- var convert_res _XML_Convert_Result
- var eventEndPP, eventPP uintptr
- var _ /* dataPtr at bp+8 */ uintptr
- _, _, _ = convert_res, eventEndPP, eventPP
- if !((*TENCODING)(unsafe.Pointer(enc)).FisUtf8 != 0) {
- if enc == (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_encoding {
- eventPP = parser + 544
- eventEndPP = parser + 552
- } else {
- /* To get here, two things must be true; the parser must be
- * using a character encoding that is not the same as the
- * encoding passed in, and the encoding passed in must need
- * conversion to the internal format (UTF-8 unless XML_UNICODE
- * is defined). The only occasions on which the encoding passed
- * in is not the same as the parser's encoding are when it is
- * the internal encoding (e.g. a previously defined parameter
- * entity, already converted to internal format). This by
- * definition doesn't need conversion, so the whole branch never
- * gets executed.
- *
- * For safety's sake we don't delete these lines and merely
- * exclude them from coverage statistics.
- *
- * LCOV_EXCL_START
- */
- eventPP = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_openInternalEntities
- eventEndPP = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_openInternalEntities + 8
- /* LCOV_EXCL_STOP */
- }
- for cond := true; cond; cond = convert_res != int32(_XML_CONVERT_COMPLETED) && convert_res != int32(_XML_CONVERT_INPUT_INCOMPLETE) {
- *(*uintptr)(unsafe.Pointer(bp + 8)) = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_dataBuf
- 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)
- *(*uintptr)(unsafe.Pointer(eventEndPP)) = *(*uintptr)(unsafe.Pointer(bp))
- (*(*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)))
- *(*uintptr)(unsafe.Pointer(eventPP)) = *(*uintptr)(unsafe.Pointer(bp))
- }
- } else {
- (*(*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)))))
- }
- }
- func _defineAttribute(tls *libc.TLS, type1 uintptr, attId uintptr, isCdata TXML_Bool, isId TXML_Bool, value uintptr, parser TXML_Parser) (r int32) {
- var att, temp uintptr
- var count, i int32
- _, _, _, _ = att, count, i, temp
- if value != 0 || isId != 0 {
- i = 0
- for {
- if !(i < (*TELEMENT_TYPE)(unsafe.Pointer(type1)).FnDefaultAtts) {
- break
- }
- if attId == (*(*TDEFAULT_ATTRIBUTE)(unsafe.Pointer((*TELEMENT_TYPE)(unsafe.Pointer(type1)).FdefaultAtts + uintptr(i)*24))).Fid {
- return int32(1)
- }
- goto _1
- _1:
- ;
- i++
- }
- if isId != 0 && !((*TELEMENT_TYPE)(unsafe.Pointer(type1)).FidAtt != 0) && !((*TATTRIBUTE_ID)(unsafe.Pointer(attId)).Fxmlns != 0) {
- (*TELEMENT_TYPE)(unsafe.Pointer(type1)).FidAtt = attId
- }
- }
- if (*TELEMENT_TYPE)(unsafe.Pointer(type1)).FnDefaultAtts == (*TELEMENT_TYPE)(unsafe.Pointer(type1)).FallocDefaultAtts {
- if (*TELEMENT_TYPE)(unsafe.Pointer(type1)).FallocDefaultAtts == 0 {
- (*TELEMENT_TYPE)(unsafe.Pointer(type1)).FallocDefaultAtts = int32(8)
- (*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))
- if !((*TELEMENT_TYPE)(unsafe.Pointer(type1)).FdefaultAtts != 0) {
- (*TELEMENT_TYPE)(unsafe.Pointer(type1)).FallocDefaultAtts = 0
- return 0
- }
- } else {
- /* Detect and prevent integer overflow */
- if (*TELEMENT_TYPE)(unsafe.Pointer(type1)).FallocDefaultAtts > libc.Int32FromInt32(m_INT_MAX)/libc.Int32FromInt32(2) {
- return 0
- }
- count = (*TELEMENT_TYPE)(unsafe.Pointer(type1)).FallocDefaultAtts * int32(2)
- /* Detect and prevent integer overflow.
- * The preprocessor guard addresses the "always false" warning
- * from -Wtype-limits on platforms where
- * sizeof(unsigned int) < sizeof(size_t), e.g. on x86_64. */
- 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))
- if temp == libc.UintptrFromInt32(0) {
- return 0
- }
- (*TELEMENT_TYPE)(unsafe.Pointer(type1)).FallocDefaultAtts = count
- (*TELEMENT_TYPE)(unsafe.Pointer(type1)).FdefaultAtts = temp
- }
- }
- att = (*TELEMENT_TYPE)(unsafe.Pointer(type1)).FdefaultAtts + uintptr((*TELEMENT_TYPE)(unsafe.Pointer(type1)).FnDefaultAtts)*24
- (*TDEFAULT_ATTRIBUTE)(unsafe.Pointer(att)).Fid = attId
- (*TDEFAULT_ATTRIBUTE)(unsafe.Pointer(att)).Fvalue = value
- (*TDEFAULT_ATTRIBUTE)(unsafe.Pointer(att)).FisCdata = isCdata
- if !(isCdata != 0) {
- (*TATTRIBUTE_ID)(unsafe.Pointer(attId)).FmaybeTokenized = libc.Uint8FromInt32(1)
- }
- *(*int32)(unsafe.Pointer(type1 + 24)) += int32(1)
- return int32(1)
- }
- func _setElementTypePrefix(tls *libc.TLS, parser TXML_Parser, elementType uintptr) (r int32) {
- var dtd, name, prefix, s, v4, v5, v7, v8 uintptr
- var v3, v6 int32
- _, _, _, _, _, _, _, _, _, _ = dtd, name, prefix, s, v3, v4, v5, v6, v7, v8
- dtd = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_dtd
- name = (*TELEMENT_TYPE)(unsafe.Pointer(elementType)).Fname
- for {
- if !(*(*TXML_Char)(unsafe.Pointer(name)) != 0) {
- break
- }
- if int32(*(*TXML_Char)(unsafe.Pointer(name))) == int32(m_ASCII_COLON) {
- s = (*TELEMENT_TYPE)(unsafe.Pointer(elementType)).Fname
- for {
- if !(s != name) {
- break
- }
- if (*TSTRING_POOL)(unsafe.Pointer(dtd+160)).Fptr == (*TSTRING_POOL)(unsafe.Pointer(dtd+160)).Fend && !(_poolGrow(tls, dtd+160) != 0) {
- v3 = 0
- } else {
- v5 = dtd + 160 + 24
- v4 = *(*uintptr)(unsafe.Pointer(v5))
- *(*uintptr)(unsafe.Pointer(v5))++
- *(*TXML_Char)(unsafe.Pointer(v4)) = *(*TXML_Char)(unsafe.Pointer(s))
- v3 = libc.Int32FromInt32(1)
- }
- if !(v3 != 0) {
- return 0
- }
- goto _2
- _2:
- ;
- s++
- }
- if (*TSTRING_POOL)(unsafe.Pointer(dtd+160)).Fptr == (*TSTRING_POOL)(unsafe.Pointer(dtd+160)).Fend && !(_poolGrow(tls, dtd+160) != 0) {
- v6 = 0
- } else {
- v8 = dtd + 160 + 24
- v7 = *(*uintptr)(unsafe.Pointer(v8))
- *(*uintptr)(unsafe.Pointer(v8))++
- *(*TXML_Char)(unsafe.Pointer(v7)) = int8('\000')
- v6 = libc.Int32FromInt32(1)
- }
- if !(v6 != 0) {
- return 0
- }
- prefix = _lookup(tls, parser, dtd+120, (*TSTRING_POOL)(unsafe.Pointer(dtd+160)).Fstart, uint64(16))
- if !(prefix != 0) {
- return 0
- }
- if (*TPREFIX)(unsafe.Pointer(prefix)).Fname == (*TSTRING_POOL)(unsafe.Pointer(dtd+160)).Fstart {
- (*TSTRING_POOL)(unsafe.Pointer(dtd + 160)).Fstart = (*TSTRING_POOL)(unsafe.Pointer(dtd + 160)).Fptr
- } else {
- (*TSTRING_POOL)(unsafe.Pointer(dtd + 160)).Fptr = (*TSTRING_POOL)(unsafe.Pointer(dtd + 160)).Fstart
- }
- (*TELEMENT_TYPE)(unsafe.Pointer(elementType)).Fprefix = prefix
- break
- }
- goto _1
- _1:
- ;
- name++
- }
- return int32(1)
- }
- func _getAttributeId(tls *libc.TLS, parser TXML_Parser, enc uintptr, start uintptr, end uintptr) (r uintptr) {
- var dtd, id, name, v10, v11, v2, v3, v7, v8 uintptr
- var i, j, v1, v6, v9 int32
- _, _, _, _, _, _, _, _, _, _, _, _, _, _ = dtd, i, id, j, name, v1, v10, v11, v2, v3, v6, v7, v8, v9
- dtd = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_dtd
- if (*TSTRING_POOL)(unsafe.Pointer(dtd+160)).Fptr == (*TSTRING_POOL)(unsafe.Pointer(dtd+160)).Fend && !(_poolGrow(tls, dtd+160) != 0) {
- v1 = 0
- } else {
- v3 = dtd + 160 + 24
- v2 = *(*uintptr)(unsafe.Pointer(v3))
- *(*uintptr)(unsafe.Pointer(v3))++
- *(*TXML_Char)(unsafe.Pointer(v2)) = int8('\000')
- v1 = libc.Int32FromInt32(1)
- }
- if !(v1 != 0) {
- return libc.UintptrFromInt32(0)
- }
- name = _poolStoreString(tls, dtd+160, enc, start, end)
- if !(name != 0) {
- return libc.UintptrFromInt32(0)
- }
- /* skip quotation mark - its storage will be re-used (like in name[-1]) */
- name++
- id = _lookup(tls, parser, dtd+80, name, uint64(24))
- if !(id != 0) {
- return libc.UintptrFromInt32(0)
- }
- if (*TATTRIBUTE_ID)(unsafe.Pointer(id)).Fname != name {
- (*TSTRING_POOL)(unsafe.Pointer(dtd + 160)).Fptr = (*TSTRING_POOL)(unsafe.Pointer(dtd + 160)).Fstart
- } else {
- (*TSTRING_POOL)(unsafe.Pointer(dtd + 160)).Fstart = (*TSTRING_POOL)(unsafe.Pointer(dtd + 160)).Fptr
- if !!((*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_ns != 0) {
- 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)) {
- if int32(*(*TXML_Char)(unsafe.Pointer(name + 5))) == int32('\000') {
- (*TATTRIBUTE_ID)(unsafe.Pointer(id)).Fprefix = dtd + 304
- } else {
- (*TATTRIBUTE_ID)(unsafe.Pointer(id)).Fprefix = _lookup(tls, parser, dtd+120, name+uintptr(6), uint64(16))
- }
- (*TATTRIBUTE_ID)(unsafe.Pointer(id)).Fxmlns = libc.Uint8FromInt32(1)
- } else {
- i = 0
- for {
- if !(*(*TXML_Char)(unsafe.Pointer(name + uintptr(i))) != 0) {
- break
- }
- /* attributes without prefix are *not* in the default namespace */
- if int32(*(*TXML_Char)(unsafe.Pointer(name + uintptr(i)))) == int32(m_ASCII_COLON) {
- j = 0
- for {
- if !(j < i) {
- break
- }
- if (*TSTRING_POOL)(unsafe.Pointer(dtd+160)).Fptr == (*TSTRING_POOL)(unsafe.Pointer(dtd+160)).Fend && !(_poolGrow(tls, dtd+160) != 0) {
- v6 = 0
- } else {
- v8 = dtd + 160 + 24
- v7 = *(*uintptr)(unsafe.Pointer(v8))
- *(*uintptr)(unsafe.Pointer(v8))++
- *(*TXML_Char)(unsafe.Pointer(v7)) = *(*TXML_Char)(unsafe.Pointer(name + uintptr(j)))
- v6 = libc.Int32FromInt32(1)
- }
- if !(v6 != 0) {
- return libc.UintptrFromInt32(0)
- }
- goto _5
- _5:
- ;
- j++
- }
- if (*TSTRING_POOL)(unsafe.Pointer(dtd+160)).Fptr == (*TSTRING_POOL)(unsafe.Pointer(dtd+160)).Fend && !(_poolGrow(tls, dtd+160) != 0) {
- v9 = 0
- } else {
- v11 = dtd + 160 + 24
- v10 = *(*uintptr)(unsafe.Pointer(v11))
- *(*uintptr)(unsafe.Pointer(v11))++
- *(*TXML_Char)(unsafe.Pointer(v10)) = int8('\000')
- v9 = libc.Int32FromInt32(1)
- }
- if !(v9 != 0) {
- return libc.UintptrFromInt32(0)
- }
- (*TATTRIBUTE_ID)(unsafe.Pointer(id)).Fprefix = _lookup(tls, parser, dtd+120, (*TSTRING_POOL)(unsafe.Pointer(dtd+160)).Fstart, uint64(16))
- if !((*TATTRIBUTE_ID)(unsafe.Pointer(id)).Fprefix != 0) {
- return libc.UintptrFromInt32(0)
- }
- if (*TPREFIX)(unsafe.Pointer((*TATTRIBUTE_ID)(unsafe.Pointer(id)).Fprefix)).Fname == (*TSTRING_POOL)(unsafe.Pointer(dtd+160)).Fstart {
- (*TSTRING_POOL)(unsafe.Pointer(dtd + 160)).Fstart = (*TSTRING_POOL)(unsafe.Pointer(dtd + 160)).Fptr
- } else {
- (*TSTRING_POOL)(unsafe.Pointer(dtd + 160)).Fptr = (*TSTRING_POOL)(unsafe.Pointer(dtd + 160)).Fstart
- }
- break
- }
- goto _4
- _4:
- ;
- i++
- }
- }
- }
- }
- return id
- }
- func _getContext(tls *libc.TLS, parser TXML_Parser) (r uintptr) {
- bp := tls.Alloc(16)
- defer tls.Free(16)
- 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
- var i, i1, len1, len11, v1, v14, v17, v21, v25, v30, v33, v5, v9 int32
- var needSep TXML_Bool
- var v12, v28 bool
- var _ /* iter at bp+0 */ THASH_TABLE_ITER
- _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = 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
- dtd = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_dtd
- needSep = libc.Uint8FromInt32(0)
- if (*TDTD)(unsafe.Pointer(dtd)).FdefaultPrefix.Fbinding != 0 {
- if (*TSTRING_POOL)(unsafe.Pointer(parser+784)).Fptr == (*TSTRING_POOL)(unsafe.Pointer(parser+784)).Fend && !(_poolGrow(tls, parser+784) != 0) {
- v1 = 0
- } else {
- v3 = parser + 784 + 24
- v2 = *(*uintptr)(unsafe.Pointer(v3))
- *(*uintptr)(unsafe.Pointer(v3))++
- *(*TXML_Char)(unsafe.Pointer(v2)) = int8(m_ASCII_EQUALS)
- v1 = libc.Int32FromInt32(1)
- }
- if !(v1 != 0) {
- return libc.UintptrFromInt32(0)
- }
- len1 = (*TBINDING)(unsafe.Pointer((*TDTD)(unsafe.Pointer(dtd)).FdefaultPrefix.Fbinding)).FuriLen
- if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_namespaceSeparator != 0 {
- len1--
- }
- i = 0
- for {
- if !(i < len1) {
- break
- }
- if (*TSTRING_POOL)(unsafe.Pointer(parser+784)).Fptr == (*TSTRING_POOL)(unsafe.Pointer(parser+784)).Fend && !(_poolGrow(tls, parser+784) != 0) {
- v5 = 0
- } else {
- v7 = parser + 784 + 24
- v6 = *(*uintptr)(unsafe.Pointer(v7))
- *(*uintptr)(unsafe.Pointer(v7))++
- *(*TXML_Char)(unsafe.Pointer(v6)) = *(*TXML_Char)(unsafe.Pointer((*TBINDING)(unsafe.Pointer((*TDTD)(unsafe.Pointer(dtd)).FdefaultPrefix.Fbinding)).Furi + uintptr(i)))
- v5 = libc.Int32FromInt32(1)
- }
- if !(v5 != 0) {
- /* Because of memory caching, I don't believe this line can be
- * executed.
- *
- * This is part of a loop copying the default prefix binding
- * URI into the parser's temporary string pool. Previously,
- * that URI was copied into the same string pool, with a
- * terminating NUL character, as part of setContext(). When
- * the pool was cleared, that leaves a block definitely big
- * enough to hold the URI on the free block list of the pool.
- * The URI copy in getContext() therefore cannot run out of
- * memory.
- *
- * If the pool is used between the setContext() and
- * getContext() calls, the worst it can do is leave a bigger
- * block on the front of the free list. Given that this is
- * all somewhat inobvious and program logic can be changed, we
- * don't delete the line but we do exclude it from the test
- * coverage statistics.
- */
- return libc.UintptrFromInt32(0) /* LCOV_EXCL_LINE */
- }
- goto _4
- _4:
- ;
- i++
- }
- needSep = libc.Uint8FromInt32(1)
- }
- _hashTableIterInit(tls, bp, dtd+120)
- for {
- prefix = _hashTableIterNext(tls, bp)
- if !(prefix != 0) {
- break
- }
- if !((*TPREFIX)(unsafe.Pointer(prefix)).Fbinding != 0) {
- /* This test appears to be (justifiable) paranoia. There does
- * not seem to be a way of injecting a prefix without a binding
- * that doesn't get errored long before this function is called.
- * The test should remain for safety's sake, so we instead
- * exclude the following line from the coverage statistics.
- */
- goto _8 /* LCOV_EXCL_LINE */
- }
- if v12 = needSep != 0; v12 {
- if (*TSTRING_POOL)(unsafe.Pointer(parser+784)).Fptr == (*TSTRING_POOL)(unsafe.Pointer(parser+784)).Fend && !(_poolGrow(tls, parser+784) != 0) {
- v9 = 0
- } else {
- v11 = parser + 784 + 24
- v10 = *(*uintptr)(unsafe.Pointer(v11))
- *(*uintptr)(unsafe.Pointer(v11))++
- *(*TXML_Char)(unsafe.Pointer(v10)) = int8(m_ASCII_FF)
- v9 = libc.Int32FromInt32(1)
- }
- }
- if v12 && !(v9 != 0) {
- return libc.UintptrFromInt32(0)
- }
- s = (*TPREFIX)(unsafe.Pointer(prefix)).Fname
- for {
- if !(*(*TXML_Char)(unsafe.Pointer(s)) != 0) {
- break
- }
- if (*TSTRING_POOL)(unsafe.Pointer(parser+784)).Fptr == (*TSTRING_POOL)(unsafe.Pointer(parser+784)).Fend && !(_poolGrow(tls, parser+784) != 0) {
- v14 = 0
- } else {
- v16 = parser + 784 + 24
- v15 = *(*uintptr)(unsafe.Pointer(v16))
- *(*uintptr)(unsafe.Pointer(v16))++
- *(*TXML_Char)(unsafe.Pointer(v15)) = *(*TXML_Char)(unsafe.Pointer(s))
- v14 = libc.Int32FromInt32(1)
- }
- if !(v14 != 0) {
- return libc.UintptrFromInt32(0)
- }
- goto _13
- _13:
- ;
- s++
- }
- if (*TSTRING_POOL)(unsafe.Pointer(parser+784)).Fptr == (*TSTRING_POOL)(unsafe.Pointer(parser+784)).Fend && !(_poolGrow(tls, parser+784) != 0) {
- v17 = 0
- } else {
- v19 = parser + 784 + 24
- v18 = *(*uintptr)(unsafe.Pointer(v19))
- *(*uintptr)(unsafe.Pointer(v19))++
- *(*TXML_Char)(unsafe.Pointer(v18)) = int8(m_ASCII_EQUALS)
- v17 = libc.Int32FromInt32(1)
- }
- if !(v17 != 0) {
- return libc.UintptrFromInt32(0)
- }
- len11 = (*TBINDING)(unsafe.Pointer((*TPREFIX)(unsafe.Pointer(prefix)).Fbinding)).FuriLen
- if (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_namespaceSeparator != 0 {
- len11--
- }
- i1 = 0
- for {
- if !(i1 < len11) {
- break
- }
- if (*TSTRING_POOL)(unsafe.Pointer(parser+784)).Fptr == (*TSTRING_POOL)(unsafe.Pointer(parser+784)).Fend && !(_poolGrow(tls, parser+784) != 0) {
- v21 = 0
- } else {
- v23 = parser + 784 + 24
- v22 = *(*uintptr)(unsafe.Pointer(v23))
- *(*uintptr)(unsafe.Pointer(v23))++
- *(*TXML_Char)(unsafe.Pointer(v22)) = *(*TXML_Char)(unsafe.Pointer((*TBINDING)(unsafe.Pointer((*TPREFIX)(unsafe.Pointer(prefix)).Fbinding)).Furi + uintptr(i1)))
- v21 = libc.Int32FromInt32(1)
- }
- if !(v21 != 0) {
- return libc.UintptrFromInt32(0)
- }
- goto _20
- _20:
- ;
- i1++
- }
- needSep = libc.Uint8FromInt32(1)
- goto _8
- _8:
- }
- _hashTableIterInit(tls, bp, dtd)
- for {
- e = _hashTableIterNext(tls, bp)
- if !(e != 0) {
- break
- }
- if !((*TENTITY)(unsafe.Pointer(e)).Fopen != 0) {
- goto _24
- }
- if v28 = needSep != 0; v28 {
- if (*TSTRING_POOL)(unsafe.Pointer(parser+784)).Fptr == (*TSTRING_POOL)(unsafe.Pointer(parser+784)).Fend && !(_poolGrow(tls, parser+784) != 0) {
- v25 = 0
- } else {
- v27 = parser + 784 + 24
- v26 = *(*uintptr)(unsafe.Pointer(v27))
- *(*uintptr)(unsafe.Pointer(v27))++
- *(*TXML_Char)(unsafe.Pointer(v26)) = int8(m_ASCII_FF)
- v25 = libc.Int32FromInt32(1)
- }
- }
- if v28 && !(v25 != 0) {
- return libc.UintptrFromInt32(0)
- }
- s1 = (*TENTITY)(unsafe.Pointer(e)).Fname
- for {
- if !(*(*TXML_Char)(unsafe.Pointer(s1)) != 0) {
- break
- }
- if (*TSTRING_POOL)(unsafe.Pointer(parser+784)).Fptr == (*TSTRING_POOL)(unsafe.Pointer(parser+784)).Fend && !(_poolGrow(tls, parser+784) != 0) {
- v30 = 0
- } else {
- v32 = parser + 784 + 24
- v31 = *(*uintptr)(unsafe.Pointer(v32))
- *(*uintptr)(unsafe.Pointer(v32))++
- *(*TXML_Char)(unsafe.Pointer(v31)) = *(*TXML_Char)(unsafe.Pointer(s1))
- v30 = libc.Int32FromInt32(1)
- }
- if !(v30 != 0) {
- return uintptr(0)
- }
- goto _29
- _29:
- ;
- s1++
- }
- needSep = libc.Uint8FromInt32(1)
- goto _24
- _24:
- }
- if (*TSTRING_POOL)(unsafe.Pointer(parser+784)).Fptr == (*TSTRING_POOL)(unsafe.Pointer(parser+784)).Fend && !(_poolGrow(tls, parser+784) != 0) {
- v33 = 0
- } else {
- v35 = parser + 784 + 24
- v34 = *(*uintptr)(unsafe.Pointer(v35))
- *(*uintptr)(unsafe.Pointer(v35))++
- *(*TXML_Char)(unsafe.Pointer(v34)) = int8('\000')
- v33 = libc.Int32FromInt32(1)
- }
- if !(v33 != 0) {
- return libc.UintptrFromInt32(0)
- }
- return (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_tempPool.Fstart
- }
- func _setContext(tls *libc.TLS, parser TXML_Parser, context uintptr) (r TXML_Bool) {
- var dtd, e, prefix, s, v10, v12, v13, v15, v16, v2, v3, v5, v6, v9 uintptr
- var v1, v11, v14, v4, v8 int32
- _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = dtd, e, prefix, s, v1, v10, v11, v12, v13, v14, v15, v16, v2, v3, v4, v5, v6, v8, v9
- dtd = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_dtd /* save one level of indirection */
- s = context
- for int32(*(*TXML_Char)(unsafe.Pointer(context))) != int32('\000') {
- if int32(*(*TXML_Char)(unsafe.Pointer(s))) == int32(m_ASCII_FF) || int32(*(*TXML_Char)(unsafe.Pointer(s))) == int32('\000') {
- if (*TSTRING_POOL)(unsafe.Pointer(parser+784)).Fptr == (*TSTRING_POOL)(unsafe.Pointer(parser+784)).Fend && !(_poolGrow(tls, parser+784) != 0) {
- v1 = 0
- } else {
- v3 = parser + 784 + 24
- v2 = *(*uintptr)(unsafe.Pointer(v3))
- *(*uintptr)(unsafe.Pointer(v3))++
- *(*TXML_Char)(unsafe.Pointer(v2)) = int8('\000')
- v1 = libc.Int32FromInt32(1)
- }
- if !(v1 != 0) {
- return libc.Uint8FromInt32(0)
- }
- e = _lookup(tls, parser, dtd, (*TSTRING_POOL)(unsafe.Pointer(parser+784)).Fstart, uint64(0))
- if e != 0 {
- (*TENTITY)(unsafe.Pointer(e)).Fopen = libc.Uint8FromInt32(1)
- }
- if int32(*(*TXML_Char)(unsafe.Pointer(s))) != int32('\000') {
- s++
- }
- context = s
- (*TSTRING_POOL)(unsafe.Pointer(parser + 784)).Fptr = (*TSTRING_POOL)(unsafe.Pointer(parser + 784)).Fstart
- } else {
- if int32(*(*TXML_Char)(unsafe.Pointer(s))) == int32(m_ASCII_EQUALS) {
- if int64((*TSTRING_POOL)(unsafe.Pointer(parser+784)).Fptr)-int64((*TSTRING_POOL)(unsafe.Pointer(parser+784)).Fstart) == 0 {
- prefix = dtd + 304
- } else {
- if (*TSTRING_POOL)(unsafe.Pointer(parser+784)).Fptr == (*TSTRING_POOL)(unsafe.Pointer(parser+784)).Fend && !(_poolGrow(tls, parser+784) != 0) {
- v4 = 0
- } else {
- v6 = parser + 784 + 24
- v5 = *(*uintptr)(unsafe.Pointer(v6))
- *(*uintptr)(unsafe.Pointer(v6))++
- *(*TXML_Char)(unsafe.Pointer(v5)) = int8('\000')
- v4 = libc.Int32FromInt32(1)
- }
- if !(v4 != 0) {
- return libc.Uint8FromInt32(0)
- }
- prefix = _lookup(tls, parser, dtd+120, (*TSTRING_POOL)(unsafe.Pointer(parser+784)).Fstart, uint64(16))
- if !(prefix != 0) {
- return libc.Uint8FromInt32(0)
- }
- if (*TPREFIX)(unsafe.Pointer(prefix)).Fname == (*TSTRING_POOL)(unsafe.Pointer(parser+784)).Fstart {
- (*TPREFIX)(unsafe.Pointer(prefix)).Fname = _poolCopyString(tls, dtd+160, (*TPREFIX)(unsafe.Pointer(prefix)).Fname)
- if !((*TPREFIX)(unsafe.Pointer(prefix)).Fname != 0) {
- return libc.Uint8FromInt32(0)
- }
- }
- (*TSTRING_POOL)(unsafe.Pointer(parser + 784)).Fptr = (*TSTRING_POOL)(unsafe.Pointer(parser + 784)).Fstart
- }
- context = s + uintptr(1)
- for {
- if !(int32(*(*TXML_Char)(unsafe.Pointer(context))) != int32(m_ASCII_FF) && int32(*(*TXML_Char)(unsafe.Pointer(context))) != int32('\000')) {
- break
- }
- if (*TSTRING_POOL)(unsafe.Pointer(parser+784)).Fptr == (*TSTRING_POOL)(unsafe.Pointer(parser+784)).Fend && !(_poolGrow(tls, parser+784) != 0) {
- v8 = 0
- } else {
- v10 = parser + 784 + 24
- v9 = *(*uintptr)(unsafe.Pointer(v10))
- *(*uintptr)(unsafe.Pointer(v10))++
- *(*TXML_Char)(unsafe.Pointer(v9)) = *(*TXML_Char)(unsafe.Pointer(context))
- v8 = libc.Int32FromInt32(1)
- }
- if !(v8 != 0) {
- return libc.Uint8FromInt32(0)
- }
- goto _7
- _7:
- ;
- context++
- }
- if (*TSTRING_POOL)(unsafe.Pointer(parser+784)).Fptr == (*TSTRING_POOL)(unsafe.Pointer(parser+784)).Fend && !(_poolGrow(tls, parser+784) != 0) {
- v11 = 0
- } else {
- v13 = parser + 784 + 24
- v12 = *(*uintptr)(unsafe.Pointer(v13))
- *(*uintptr)(unsafe.Pointer(v13))++
- *(*TXML_Char)(unsafe.Pointer(v12)) = int8('\000')
- v11 = libc.Int32FromInt32(1)
- }
- if !(v11 != 0) {
- return libc.Uint8FromInt32(0)
- }
- if _addBinding(tls, parser, prefix, libc.UintptrFromInt32(0), (*TSTRING_POOL)(unsafe.Pointer(parser+784)).Fstart, parser+704) != int32(_XML_ERROR_NONE) {
- return libc.Uint8FromInt32(0)
- }
- (*TSTRING_POOL)(unsafe.Pointer(parser + 784)).Fptr = (*TSTRING_POOL)(unsafe.Pointer(parser + 784)).Fstart
- if int32(*(*TXML_Char)(unsafe.Pointer(context))) != int32('\000') {
- context++
- }
- s = context
- } else {
- if (*TSTRING_POOL)(unsafe.Pointer(parser+784)).Fptr == (*TSTRING_POOL)(unsafe.Pointer(parser+784)).Fend && !(_poolGrow(tls, parser+784) != 0) {
- v14 = 0
- } else {
- v16 = parser + 784 + 24
- v15 = *(*uintptr)(unsafe.Pointer(v16))
- *(*uintptr)(unsafe.Pointer(v16))++
- *(*TXML_Char)(unsafe.Pointer(v15)) = *(*TXML_Char)(unsafe.Pointer(s))
- v14 = libc.Int32FromInt32(1)
- }
- if !(v14 != 0) {
- return libc.Uint8FromInt32(0)
- }
- s++
- }
- }
- }
- return libc.Uint8FromInt32(1)
- }
- func _normalizePublicId(tls *libc.TLS, publicId uintptr) {
- var p, s, v2, v3 uintptr
- _, _, _, _ = p, s, v2, v3
- p = publicId
- s = publicId
- for {
- if !(*(*TXML_Char)(unsafe.Pointer(s)) != 0) {
- break
- }
- switch int32(*(*TXML_Char)(unsafe.Pointer(s))) {
- case int32(0x20):
- fallthrough
- case int32(0xD):
- fallthrough
- case int32(0xA):
- if p != publicId && int32(*(*TXML_Char)(unsafe.Pointer(p + uintptr(-libc.Int32FromInt32(1))))) != int32(0x20) {
- v2 = p
- p++
- *(*TXML_Char)(unsafe.Pointer(v2)) = int8(0x20)
- }
- default:
- v3 = p
- p++
- *(*TXML_Char)(unsafe.Pointer(v3)) = *(*TXML_Char)(unsafe.Pointer(s))
- }
- goto _1
- _1:
- ;
- s++
- }
- if p != publicId && int32(*(*TXML_Char)(unsafe.Pointer(p + uintptr(-libc.Int32FromInt32(1))))) == int32(0x20) {
- p--
- }
- *(*TXML_Char)(unsafe.Pointer(p)) = int8('\000')
- }
- func _dtdCreate(tls *libc.TLS, ms uintptr) (r uintptr) {
- var p uintptr
- _ = p
- p = (*(*func(*libc.TLS, Tsize_t) uintptr)(unsafe.Pointer(&struct{ uintptr }{(*TXML_Memory_Handling_Suite)(unsafe.Pointer(ms)).Fmalloc_fcn})))(tls, uint64(360))
- if p == libc.UintptrFromInt32(0) {
- return p
- }
- _poolInit(tls, p+160, ms)
- _poolInit(tls, p+208, ms)
- _hashTableInit(tls, p, ms)
- _hashTableInit(tls, p+40, ms)
- _hashTableInit(tls, p+80, ms)
- _hashTableInit(tls, p+120, ms)
- (*TDTD)(unsafe.Pointer(p)).FparamEntityRead = libc.Uint8FromInt32(0)
- _hashTableInit(tls, p+264, ms)
- (*TDTD)(unsafe.Pointer(p)).FdefaultPrefix.Fname = libc.UintptrFromInt32(0)
- (*TDTD)(unsafe.Pointer(p)).FdefaultPrefix.Fbinding = libc.UintptrFromInt32(0)
- (*TDTD)(unsafe.Pointer(p)).Fin_eldecl = libc.Uint8FromInt32(0)
- (*TDTD)(unsafe.Pointer(p)).FscaffIndex = libc.UintptrFromInt32(0)
- (*TDTD)(unsafe.Pointer(p)).Fscaffold = libc.UintptrFromInt32(0)
- (*TDTD)(unsafe.Pointer(p)).FscaffLevel = 0
- (*TDTD)(unsafe.Pointer(p)).FscaffSize = uint32(0)
- (*TDTD)(unsafe.Pointer(p)).FscaffCount = uint32(0)
- (*TDTD)(unsafe.Pointer(p)).FcontentStringLen = uint32(0)
- (*TDTD)(unsafe.Pointer(p)).FkeepProcessing = libc.Uint8FromInt32(1)
- (*TDTD)(unsafe.Pointer(p)).FhasParamEntityRefs = libc.Uint8FromInt32(0)
- (*TDTD)(unsafe.Pointer(p)).Fstandalone = libc.Uint8FromInt32(0)
- return p
- }
- func _dtdReset(tls *libc.TLS, p uintptr, ms uintptr) {
- bp := tls.Alloc(16)
- defer tls.Free(16)
- var e uintptr
- var _ /* iter at bp+0 */ THASH_TABLE_ITER
- _ = e
- _hashTableIterInit(tls, bp, p+40)
- for {
- e = _hashTableIterNext(tls, bp)
- if !(e != 0) {
- break
- }
- if (*TELEMENT_TYPE)(unsafe.Pointer(e)).FallocDefaultAtts != 0 {
- (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TXML_Memory_Handling_Suite)(unsafe.Pointer(ms)).Ffree_fcn})))(tls, (*TELEMENT_TYPE)(unsafe.Pointer(e)).FdefaultAtts)
- }
- goto _1
- _1:
- }
- _hashTableClear(tls, p)
- (*TDTD)(unsafe.Pointer(p)).FparamEntityRead = libc.Uint8FromInt32(0)
- _hashTableClear(tls, p+264)
- _hashTableClear(tls, p+40)
- _hashTableClear(tls, p+80)
- _hashTableClear(tls, p+120)
- _poolClear(tls, p+160)
- _poolClear(tls, p+208)
- (*TDTD)(unsafe.Pointer(p)).FdefaultPrefix.Fname = libc.UintptrFromInt32(0)
- (*TDTD)(unsafe.Pointer(p)).FdefaultPrefix.Fbinding = libc.UintptrFromInt32(0)
- (*TDTD)(unsafe.Pointer(p)).Fin_eldecl = libc.Uint8FromInt32(0)
- (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TXML_Memory_Handling_Suite)(unsafe.Pointer(ms)).Ffree_fcn})))(tls, (*TDTD)(unsafe.Pointer(p)).FscaffIndex)
- (*TDTD)(unsafe.Pointer(p)).FscaffIndex = libc.UintptrFromInt32(0)
- (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TXML_Memory_Handling_Suite)(unsafe.Pointer(ms)).Ffree_fcn})))(tls, (*TDTD)(unsafe.Pointer(p)).Fscaffold)
- (*TDTD)(unsafe.Pointer(p)).Fscaffold = libc.UintptrFromInt32(0)
- (*TDTD)(unsafe.Pointer(p)).FscaffLevel = 0
- (*TDTD)(unsafe.Pointer(p)).FscaffSize = uint32(0)
- (*TDTD)(unsafe.Pointer(p)).FscaffCount = uint32(0)
- (*TDTD)(unsafe.Pointer(p)).FcontentStringLen = uint32(0)
- (*TDTD)(unsafe.Pointer(p)).FkeepProcessing = libc.Uint8FromInt32(1)
- (*TDTD)(unsafe.Pointer(p)).FhasParamEntityRefs = libc.Uint8FromInt32(0)
- (*TDTD)(unsafe.Pointer(p)).Fstandalone = libc.Uint8FromInt32(0)
- }
- func _dtdDestroy(tls *libc.TLS, p uintptr, isDocEntity TXML_Bool, ms uintptr) {
- bp := tls.Alloc(16)
- defer tls.Free(16)
- var e uintptr
- var _ /* iter at bp+0 */ THASH_TABLE_ITER
- _ = e
- _hashTableIterInit(tls, bp, p+40)
- for {
- e = _hashTableIterNext(tls, bp)
- if !(e != 0) {
- break
- }
- if (*TELEMENT_TYPE)(unsafe.Pointer(e)).FallocDefaultAtts != 0 {
- (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TXML_Memory_Handling_Suite)(unsafe.Pointer(ms)).Ffree_fcn})))(tls, (*TELEMENT_TYPE)(unsafe.Pointer(e)).FdefaultAtts)
- }
- goto _1
- _1:
- }
- _hashTableDestroy(tls, p)
- _hashTableDestroy(tls, p+264)
- _hashTableDestroy(tls, p+40)
- _hashTableDestroy(tls, p+80)
- _hashTableDestroy(tls, p+120)
- _poolDestroy(tls, p+160)
- _poolDestroy(tls, p+208)
- if isDocEntity != 0 {
- (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TXML_Memory_Handling_Suite)(unsafe.Pointer(ms)).Ffree_fcn})))(tls, (*TDTD)(unsafe.Pointer(p)).FscaffIndex)
- (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TXML_Memory_Handling_Suite)(unsafe.Pointer(ms)).Ffree_fcn})))(tls, (*TDTD)(unsafe.Pointer(p)).Fscaffold)
- }
- (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TXML_Memory_Handling_Suite)(unsafe.Pointer(ms)).Ffree_fcn})))(tls, p)
- }
- // C documentation
- //
- // /* Do a deep copy of the DTD. Return 0 for out of memory, non-zero otherwise.
- // The new DTD has already been initialized.
- // */
- func _dtdCopy(tls *libc.TLS, oldParser TXML_Parser, newDtd uintptr, oldDtd uintptr, ms uintptr) (r int32) {
- bp := tls.Alloc(16)
- defer tls.Free(16)
- var i, v3, v7 int32
- var name, name1, name2, newA, newE, oldA, oldE, oldP, v4, v5 uintptr
- var _ /* iter at bp+0 */ THASH_TABLE_ITER
- _, _, _, _, _, _, _, _, _, _, _, _, _ = i, name, name1, name2, newA, newE, oldA, oldE, oldP, v3, v4, v5, v7
- /* Copy the prefix table. */
- _hashTableIterInit(tls, bp, oldDtd+120)
- for {
- oldP = _hashTableIterNext(tls, bp)
- if !(oldP != 0) {
- break
- }
- name = _poolCopyString(tls, newDtd+160, (*TPREFIX)(unsafe.Pointer(oldP)).Fname)
- if !(name != 0) {
- return 0
- }
- if !(_lookup(tls, oldParser, newDtd+120, name, uint64(16)) != 0) {
- return 0
- }
- goto _1
- _1:
- }
- _hashTableIterInit(tls, bp, oldDtd+80)
- /* Copy the attribute id table. */
- for {
- oldA = _hashTableIterNext(tls, bp)
- if !(oldA != 0) {
- break
- }
- /* Remember to allocate the scratch byte before the name. */
- if (*TSTRING_POOL)(unsafe.Pointer(newDtd+160)).Fptr == (*TSTRING_POOL)(unsafe.Pointer(newDtd+160)).Fend && !(_poolGrow(tls, newDtd+160) != 0) {
- v3 = 0
- } else {
- v5 = newDtd + 160 + 24
- v4 = *(*uintptr)(unsafe.Pointer(v5))
- *(*uintptr)(unsafe.Pointer(v5))++
- *(*TXML_Char)(unsafe.Pointer(v4)) = int8('\000')
- v3 = libc.Int32FromInt32(1)
- }
- if !(v3 != 0) {
- return 0
- }
- name1 = _poolCopyString(tls, newDtd+160, (*TATTRIBUTE_ID)(unsafe.Pointer(oldA)).Fname)
- if !(name1 != 0) {
- return 0
- }
- name1++
- newA = _lookup(tls, oldParser, newDtd+80, name1, uint64(24))
- if !(newA != 0) {
- return 0
- }
- (*TATTRIBUTE_ID)(unsafe.Pointer(newA)).FmaybeTokenized = (*TATTRIBUTE_ID)(unsafe.Pointer(oldA)).FmaybeTokenized
- if (*TATTRIBUTE_ID)(unsafe.Pointer(oldA)).Fprefix != 0 {
- (*TATTRIBUTE_ID)(unsafe.Pointer(newA)).Fxmlns = (*TATTRIBUTE_ID)(unsafe.Pointer(oldA)).Fxmlns
- if (*TATTRIBUTE_ID)(unsafe.Pointer(oldA)).Fprefix == oldDtd+304 {
- (*TATTRIBUTE_ID)(unsafe.Pointer(newA)).Fprefix = newDtd + 304
- } else {
- (*TATTRIBUTE_ID)(unsafe.Pointer(newA)).Fprefix = _lookup(tls, oldParser, newDtd+120, (*TPREFIX)(unsafe.Pointer((*TATTRIBUTE_ID)(unsafe.Pointer(oldA)).Fprefix)).Fname, uint64(0))
- }
- }
- goto _2
- _2:
- }
- /* Copy the element type table. */
- _hashTableIterInit(tls, bp, oldDtd+40)
- for {
- oldE = _hashTableIterNext(tls, bp)
- if !(oldE != 0) {
- break
- }
- name2 = _poolCopyString(tls, newDtd+160, (*TELEMENT_TYPE)(unsafe.Pointer(oldE)).Fname)
- if !(name2 != 0) {
- return 0
- }
- newE = _lookup(tls, oldParser, newDtd+40, name2, uint64(40))
- if !(newE != 0) {
- return 0
- }
- if (*TELEMENT_TYPE)(unsafe.Pointer(oldE)).FnDefaultAtts != 0 {
- (*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))
- if !((*TELEMENT_TYPE)(unsafe.Pointer(newE)).FdefaultAtts != 0) {
- return 0
- }
- }
- if (*TELEMENT_TYPE)(unsafe.Pointer(oldE)).FidAtt != 0 {
- (*TELEMENT_TYPE)(unsafe.Pointer(newE)).FidAtt = _lookup(tls, oldParser, newDtd+80, (*TATTRIBUTE_ID)(unsafe.Pointer((*TELEMENT_TYPE)(unsafe.Pointer(oldE)).FidAtt)).Fname, uint64(0))
- }
- v7 = (*TELEMENT_TYPE)(unsafe.Pointer(oldE)).FnDefaultAtts
- (*TELEMENT_TYPE)(unsafe.Pointer(newE)).FnDefaultAtts = v7
- (*TELEMENT_TYPE)(unsafe.Pointer(newE)).FallocDefaultAtts = v7
- if (*TELEMENT_TYPE)(unsafe.Pointer(oldE)).Fprefix != 0 {
- (*TELEMENT_TYPE)(unsafe.Pointer(newE)).Fprefix = _lookup(tls, oldParser, newDtd+120, (*TPREFIX)(unsafe.Pointer((*TELEMENT_TYPE)(unsafe.Pointer(oldE)).Fprefix)).Fname, uint64(0))
- }
- i = 0
- for {
- if !(i < (*TELEMENT_TYPE)(unsafe.Pointer(newE)).FnDefaultAtts) {
- break
- }
- (*(*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))
- (*(*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
- if (*(*TDEFAULT_ATTRIBUTE)(unsafe.Pointer((*TELEMENT_TYPE)(unsafe.Pointer(oldE)).FdefaultAtts + uintptr(i)*24))).Fvalue != 0 {
- (*(*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)
- if !((*(*TDEFAULT_ATTRIBUTE)(unsafe.Pointer((*TELEMENT_TYPE)(unsafe.Pointer(newE)).FdefaultAtts + uintptr(i)*24))).Fvalue != 0) {
- return 0
- }
- } else {
- (*(*TDEFAULT_ATTRIBUTE)(unsafe.Pointer((*TELEMENT_TYPE)(unsafe.Pointer(newE)).FdefaultAtts + uintptr(i)*24))).Fvalue = libc.UintptrFromInt32(0)
- }
- goto _8
- _8:
- ;
- i++
- }
- goto _6
- _6:
- }
- /* Copy the entity tables. */
- if !(_copyEntityTable(tls, oldParser, newDtd, newDtd+160, oldDtd) != 0) {
- return 0
- }
- if !(_copyEntityTable(tls, oldParser, newDtd+264, newDtd+160, oldDtd+264) != 0) {
- return 0
- }
- (*TDTD)(unsafe.Pointer(newDtd)).FparamEntityRead = (*TDTD)(unsafe.Pointer(oldDtd)).FparamEntityRead
- (*TDTD)(unsafe.Pointer(newDtd)).FkeepProcessing = (*TDTD)(unsafe.Pointer(oldDtd)).FkeepProcessing
- (*TDTD)(unsafe.Pointer(newDtd)).FhasParamEntityRefs = (*TDTD)(unsafe.Pointer(oldDtd)).FhasParamEntityRefs
- (*TDTD)(unsafe.Pointer(newDtd)).Fstandalone = (*TDTD)(unsafe.Pointer(oldDtd)).Fstandalone
- /* Don't want deep copying for scaffolding */
- (*TDTD)(unsafe.Pointer(newDtd)).Fin_eldecl = (*TDTD)(unsafe.Pointer(oldDtd)).Fin_eldecl
- (*TDTD)(unsafe.Pointer(newDtd)).Fscaffold = (*TDTD)(unsafe.Pointer(oldDtd)).Fscaffold
- (*TDTD)(unsafe.Pointer(newDtd)).FcontentStringLen = (*TDTD)(unsafe.Pointer(oldDtd)).FcontentStringLen
- (*TDTD)(unsafe.Pointer(newDtd)).FscaffSize = (*TDTD)(unsafe.Pointer(oldDtd)).FscaffSize
- (*TDTD)(unsafe.Pointer(newDtd)).FscaffLevel = (*TDTD)(unsafe.Pointer(oldDtd)).FscaffLevel
- (*TDTD)(unsafe.Pointer(newDtd)).FscaffIndex = (*TDTD)(unsafe.Pointer(oldDtd)).FscaffIndex
- return int32(1)
- }
- /* End dtdCopy */
- func _copyEntityTable(tls *libc.TLS, oldParser TXML_Parser, newTable uintptr, newPool uintptr, oldTable uintptr) (r int32) {
- bp := tls.Alloc(16)
- defer tls.Free(16)
- var cachedNewBase, cachedOldBase, name, newE, oldE, tem, tem1, tem2, v2 uintptr
- var _ /* iter at bp+0 */ THASH_TABLE_ITER
- _, _, _, _, _, _, _, _, _ = cachedNewBase, cachedOldBase, name, newE, oldE, tem, tem1, tem2, v2
- cachedOldBase = libc.UintptrFromInt32(0)
- cachedNewBase = libc.UintptrFromInt32(0)
- _hashTableIterInit(tls, bp, oldTable)
- for {
- oldE = _hashTableIterNext(tls, bp)
- if !(oldE != 0) {
- break
- }
- name = _poolCopyString(tls, newPool, (*TENTITY)(unsafe.Pointer(oldE)).Fname)
- if !(name != 0) {
- return 0
- }
- newE = _lookup(tls, oldParser, newTable, name, uint64(64))
- if !(newE != 0) {
- return 0
- }
- if (*TENTITY)(unsafe.Pointer(oldE)).FsystemId != 0 {
- tem = _poolCopyString(tls, newPool, (*TENTITY)(unsafe.Pointer(oldE)).FsystemId)
- if !(tem != 0) {
- return 0
- }
- (*TENTITY)(unsafe.Pointer(newE)).FsystemId = tem
- if (*TENTITY)(unsafe.Pointer(oldE)).Fbase != 0 {
- if (*TENTITY)(unsafe.Pointer(oldE)).Fbase == cachedOldBase {
- (*TENTITY)(unsafe.Pointer(newE)).Fbase = cachedNewBase
- } else {
- cachedOldBase = (*TENTITY)(unsafe.Pointer(oldE)).Fbase
- tem = _poolCopyString(tls, newPool, cachedOldBase)
- if !(tem != 0) {
- return 0
- }
- v2 = tem
- (*TENTITY)(unsafe.Pointer(newE)).Fbase = v2
- cachedNewBase = v2
- }
- }
- if (*TENTITY)(unsafe.Pointer(oldE)).FpublicId != 0 {
- tem = _poolCopyString(tls, newPool, (*TENTITY)(unsafe.Pointer(oldE)).FpublicId)
- if !(tem != 0) {
- return 0
- }
- (*TENTITY)(unsafe.Pointer(newE)).FpublicId = tem
- }
- } else {
- tem1 = _poolCopyStringN(tls, newPool, (*TENTITY)(unsafe.Pointer(oldE)).FtextPtr, (*TENTITY)(unsafe.Pointer(oldE)).FtextLen)
- if !(tem1 != 0) {
- return 0
- }
- (*TENTITY)(unsafe.Pointer(newE)).FtextPtr = tem1
- (*TENTITY)(unsafe.Pointer(newE)).FtextLen = (*TENTITY)(unsafe.Pointer(oldE)).FtextLen
- }
- if (*TENTITY)(unsafe.Pointer(oldE)).Fnotation != 0 {
- tem2 = _poolCopyString(tls, newPool, (*TENTITY)(unsafe.Pointer(oldE)).Fnotation)
- if !(tem2 != 0) {
- return 0
- }
- (*TENTITY)(unsafe.Pointer(newE)).Fnotation = tem2
- }
- (*TENTITY)(unsafe.Pointer(newE)).Fis_param = (*TENTITY)(unsafe.Pointer(oldE)).Fis_param
- (*TENTITY)(unsafe.Pointer(newE)).Fis_internal = (*TENTITY)(unsafe.Pointer(oldE)).Fis_internal
- goto _1
- _1:
- }
- return int32(1)
- }
- func _keyeq(tls *libc.TLS, s1 TKEY, s2 TKEY) (r TXML_Bool) {
- for {
- if !(int32(*(*TXML_Char)(unsafe.Pointer(s1))) == int32(*(*TXML_Char)(unsafe.Pointer(s2)))) {
- break
- }
- if int32(*(*TXML_Char)(unsafe.Pointer(s1))) == 0 {
- return libc.Uint8FromInt32(1)
- }
- goto _1
- _1:
- ;
- s1++
- s2++
- }
- return libc.Uint8FromInt32(0)
- }
- func _keylen(tls *libc.TLS, s TKEY) (r Tsize_t) {
- var len1 Tsize_t
- _ = len1
- len1 = uint64(0)
- for {
- if !(*(*TXML_Char)(unsafe.Pointer(s)) != 0) {
- break
- }
- goto _1
- _1:
- ;
- s++
- len1++
- }
- return len1
- }
- func _copy_salt_to_sipkey(tls *libc.TLS, parser TXML_Parser, key uintptr) {
- *(*Tuint64_t)(unsafe.Pointer(key)) = uint64(0)
- *(*Tuint64_t)(unsafe.Pointer(key + 1*8)) = _get_hash_secret_salt(tls, parser)
- }
- func _hash(tls *libc.TLS, parser TXML_Parser, s TKEY) (r uint64) {
- bp := tls.Alloc(80)
- defer tls.Free(80)
- var _ /* key at bp+56 */ Tsipkey
- var _ /* state at bp+0 */ Tsiphash
- _ = __ccgo_fp(_sip24_valid)
- _copy_salt_to_sipkey(tls, parser, bp+56)
- _sip24_init(tls, bp, bp+56)
- _sip24_update(tls, bp, s, _keylen(tls, s)*uint64(1))
- return _sip24_final(tls, bp)
- }
- func _lookup(tls *libc.TLS, parser TXML_Parser, table uintptr, name TKEY, createSize Tsize_t) (r uintptr) {
- var h, mask, newHash, newMask uint64
- var i, j, newSize, tsize, tsize1 Tsize_t
- var newPower, step uint8
- var newV uintptr
- _, _, _, _, _, _, _, _, _, _, _, _ = h, i, j, mask, newHash, newMask, newPower, newSize, newV, step, tsize, tsize1
- if (*THASH_TABLE)(unsafe.Pointer(table)).Fsize == uint64(0) {
- if !(createSize != 0) {
- return libc.UintptrFromInt32(0)
- }
- (*THASH_TABLE)(unsafe.Pointer(table)).Fpower = uint8(m_INIT_POWER)
- /* table->size is a power of 2 */
- (*THASH_TABLE)(unsafe.Pointer(table)).Fsize = libc.Uint64FromInt32(1) << libc.Int32FromInt32(m_INIT_POWER)
- tsize = (*THASH_TABLE)(unsafe.Pointer(table)).Fsize * uint64(8)
- (*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)
- if !((*THASH_TABLE)(unsafe.Pointer(table)).Fv != 0) {
- (*THASH_TABLE)(unsafe.Pointer(table)).Fsize = uint64(0)
- return libc.UintptrFromInt32(0)
- }
- libc.Xmemset(tls, (*THASH_TABLE)(unsafe.Pointer(table)).Fv, 0, tsize)
- i = _hash(tls, parser, name) & ((*THASH_TABLE)(unsafe.Pointer(table)).Fsize - uint64(1))
- } else {
- h = _hash(tls, parser, name)
- mask = (*THASH_TABLE)(unsafe.Pointer(table)).Fsize - uint64(1)
- step = uint8(0)
- i = h & mask
- for *(*uintptr)(unsafe.Pointer((*THASH_TABLE)(unsafe.Pointer(table)).Fv + uintptr(i)*8)) != 0 {
- if _keyeq(tls, name, (*TNAMED)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*THASH_TABLE)(unsafe.Pointer(table)).Fv + uintptr(i)*8)))).Fname) != 0 {
- return *(*uintptr)(unsafe.Pointer((*THASH_TABLE)(unsafe.Pointer(table)).Fv + uintptr(i)*8))
- }
- if !(step != 0) {
- step = uint8(h & ^mask >> (libc.Int32FromUint8((*THASH_TABLE)(unsafe.Pointer(table)).Fpower)-libc.Int32FromInt32(1)) & (mask>>libc.Int32FromInt32(2)) | libc.Uint64FromInt32(1))
- }
- if i < uint64(step) {
- i += (*THASH_TABLE)(unsafe.Pointer(table)).Fsize - uint64(step)
- } else {
- i -= uint64(step)
- }
- }
- if !(createSize != 0) {
- return libc.UintptrFromInt32(0)
- }
- /* check for overflow (table is half full) */
- if (*THASH_TABLE)(unsafe.Pointer(table)).Fused>>(libc.Int32FromUint8((*THASH_TABLE)(unsafe.Pointer(table)).Fpower)-int32(1)) != 0 {
- newPower = libc.Uint8FromInt32(libc.Int32FromUint8((*THASH_TABLE)(unsafe.Pointer(table)).Fpower) + int32(1))
- /* Detect and prevent invalid shift */
- if uint64(newPower) >= libc.Uint64FromInt64(8)*libc.Uint64FromInt32(8) {
- return libc.UintptrFromInt32(0)
- }
- newSize = libc.Uint64FromInt32(1) << newPower
- newMask = newSize - uint64(1)
- /* Detect and prevent integer overflow */
- if newSize > libc.Uint64FromInt32(-libc.Int32FromInt32(1))/libc.Uint64FromInt64(8) {
- return libc.UintptrFromInt32(0)
- }
- tsize1 = newSize * uint64(8)
- 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)
- if !(newV != 0) {
- return libc.UintptrFromInt32(0)
- }
- libc.Xmemset(tls, newV, 0, tsize1)
- i = uint64(0)
- for {
- if !(i < (*THASH_TABLE)(unsafe.Pointer(table)).Fsize) {
- break
- }
- if *(*uintptr)(unsafe.Pointer((*THASH_TABLE)(unsafe.Pointer(table)).Fv + uintptr(i)*8)) != 0 {
- newHash = _hash(tls, parser, (*TNAMED)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*THASH_TABLE)(unsafe.Pointer(table)).Fv + uintptr(i)*8)))).Fname)
- j = newHash & newMask
- step = uint8(0)
- for *(*uintptr)(unsafe.Pointer(newV + uintptr(j)*8)) != 0 {
- if !(step != 0) {
- step = uint8(newHash & ^newMask >> (libc.Int32FromUint8(newPower)-libc.Int32FromInt32(1)) & (newMask>>libc.Int32FromInt32(2)) | libc.Uint64FromInt32(1))
- }
- if j < uint64(step) {
- j += newSize - uint64(step)
- } else {
- j -= uint64(step)
- }
- }
- *(*uintptr)(unsafe.Pointer(newV + uintptr(j)*8)) = *(*uintptr)(unsafe.Pointer((*THASH_TABLE)(unsafe.Pointer(table)).Fv + uintptr(i)*8))
- }
- goto _2
- _2:
- ;
- i++
- }
- (*(*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)
- (*THASH_TABLE)(unsafe.Pointer(table)).Fv = newV
- (*THASH_TABLE)(unsafe.Pointer(table)).Fpower = newPower
- (*THASH_TABLE)(unsafe.Pointer(table)).Fsize = newSize
- i = h & newMask
- step = uint8(0)
- for *(*uintptr)(unsafe.Pointer((*THASH_TABLE)(unsafe.Pointer(table)).Fv + uintptr(i)*8)) != 0 {
- if !(step != 0) {
- step = uint8(h & ^newMask >> (libc.Int32FromUint8(newPower)-libc.Int32FromInt32(1)) & (newMask>>libc.Int32FromInt32(2)) | libc.Uint64FromInt32(1))
- }
- if i < uint64(step) {
- i += newSize - uint64(step)
- } else {
- i -= uint64(step)
- }
- }
- }
- }
- *(*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)
- if !(*(*uintptr)(unsafe.Pointer((*THASH_TABLE)(unsafe.Pointer(table)).Fv + uintptr(i)*8)) != 0) {
- return libc.UintptrFromInt32(0)
- }
- libc.Xmemset(tls, *(*uintptr)(unsafe.Pointer((*THASH_TABLE)(unsafe.Pointer(table)).Fv + uintptr(i)*8)), 0, createSize)
- (*TNAMED)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*THASH_TABLE)(unsafe.Pointer(table)).Fv + uintptr(i)*8)))).Fname = name
- (*THASH_TABLE)(unsafe.Pointer(table)).Fused++
- return *(*uintptr)(unsafe.Pointer((*THASH_TABLE)(unsafe.Pointer(table)).Fv + uintptr(i)*8))
- }
- func _hashTableClear(tls *libc.TLS, table uintptr) {
- var i Tsize_t
- _ = i
- i = uint64(0)
- for {
- if !(i < (*THASH_TABLE)(unsafe.Pointer(table)).Fsize) {
- break
- }
- (*(*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)))
- *(*uintptr)(unsafe.Pointer((*THASH_TABLE)(unsafe.Pointer(table)).Fv + uintptr(i)*8)) = libc.UintptrFromInt32(0)
- goto _1
- _1:
- ;
- i++
- }
- (*THASH_TABLE)(unsafe.Pointer(table)).Fused = uint64(0)
- }
- func _hashTableDestroy(tls *libc.TLS, table uintptr) {
- var i Tsize_t
- _ = i
- i = uint64(0)
- for {
- if !(i < (*THASH_TABLE)(unsafe.Pointer(table)).Fsize) {
- break
- }
- (*(*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)))
- goto _1
- _1:
- ;
- i++
- }
- (*(*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)
- }
- func _hashTableInit(tls *libc.TLS, p uintptr, ms uintptr) {
- (*THASH_TABLE)(unsafe.Pointer(p)).Fpower = uint8(0)
- (*THASH_TABLE)(unsafe.Pointer(p)).Fsize = uint64(0)
- (*THASH_TABLE)(unsafe.Pointer(p)).Fused = uint64(0)
- (*THASH_TABLE)(unsafe.Pointer(p)).Fv = libc.UintptrFromInt32(0)
- (*THASH_TABLE)(unsafe.Pointer(p)).Fmem = ms
- }
- func _hashTableIterInit(tls *libc.TLS, iter uintptr, table uintptr) {
- var v1 uintptr
- _ = v1
- (*THASH_TABLE_ITER)(unsafe.Pointer(iter)).Fp = (*THASH_TABLE)(unsafe.Pointer(table)).Fv
- if (*THASH_TABLE_ITER)(unsafe.Pointer(iter)).Fp != 0 {
- v1 = (*THASH_TABLE_ITER)(unsafe.Pointer(iter)).Fp + uintptr((*THASH_TABLE)(unsafe.Pointer(table)).Fsize)*8
- } else {
- v1 = libc.UintptrFromInt32(0)
- }
- (*THASH_TABLE_ITER)(unsafe.Pointer(iter)).Fend = v1
- }
- func _hashTableIterNext(tls *libc.TLS, iter uintptr) (r uintptr) {
- var tem, v1, v2 uintptr
- _, _, _ = tem, v1, v2
- for (*THASH_TABLE_ITER)(unsafe.Pointer(iter)).Fp != (*THASH_TABLE_ITER)(unsafe.Pointer(iter)).Fend {
- v2 = iter
- v1 = *(*uintptr)(unsafe.Pointer(v2))
- *(*uintptr)(unsafe.Pointer(v2)) += 8
- tem = *(*uintptr)(unsafe.Pointer(v1))
- if tem != 0 {
- return tem
- }
- }
- return libc.UintptrFromInt32(0)
- }
- func _poolInit(tls *libc.TLS, pool uintptr, ms uintptr) {
- (*TSTRING_POOL)(unsafe.Pointer(pool)).Fblocks = libc.UintptrFromInt32(0)
- (*TSTRING_POOL)(unsafe.Pointer(pool)).FfreeBlocks = libc.UintptrFromInt32(0)
- (*TSTRING_POOL)(unsafe.Pointer(pool)).Fstart = libc.UintptrFromInt32(0)
- (*TSTRING_POOL)(unsafe.Pointer(pool)).Fptr = libc.UintptrFromInt32(0)
- (*TSTRING_POOL)(unsafe.Pointer(pool)).Fend = libc.UintptrFromInt32(0)
- (*TSTRING_POOL)(unsafe.Pointer(pool)).Fmem = ms
- }
- func _poolClear(tls *libc.TLS, pool uintptr) {
- var p, tem uintptr
- _, _ = p, tem
- if !((*TSTRING_POOL)(unsafe.Pointer(pool)).FfreeBlocks != 0) {
- (*TSTRING_POOL)(unsafe.Pointer(pool)).FfreeBlocks = (*TSTRING_POOL)(unsafe.Pointer(pool)).Fblocks
- } else {
- p = (*TSTRING_POOL)(unsafe.Pointer(pool)).Fblocks
- for p != 0 {
- tem = (*TBLOCK)(unsafe.Pointer(p)).Fnext
- (*TBLOCK)(unsafe.Pointer(p)).Fnext = (*TSTRING_POOL)(unsafe.Pointer(pool)).FfreeBlocks
- (*TSTRING_POOL)(unsafe.Pointer(pool)).FfreeBlocks = p
- p = tem
- }
- }
- (*TSTRING_POOL)(unsafe.Pointer(pool)).Fblocks = libc.UintptrFromInt32(0)
- (*TSTRING_POOL)(unsafe.Pointer(pool)).Fstart = libc.UintptrFromInt32(0)
- (*TSTRING_POOL)(unsafe.Pointer(pool)).Fptr = libc.UintptrFromInt32(0)
- (*TSTRING_POOL)(unsafe.Pointer(pool)).Fend = libc.UintptrFromInt32(0)
- }
- func _poolDestroy(tls *libc.TLS, pool uintptr) {
- var p, tem, tem1 uintptr
- _, _, _ = p, tem, tem1
- p = (*TSTRING_POOL)(unsafe.Pointer(pool)).Fblocks
- for p != 0 {
- tem = (*TBLOCK)(unsafe.Pointer(p)).Fnext
- (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TXML_Memory_Handling_Suite)(unsafe.Pointer((*TSTRING_POOL)(unsafe.Pointer(pool)).Fmem)).Ffree_fcn})))(tls, p)
- p = tem
- }
- p = (*TSTRING_POOL)(unsafe.Pointer(pool)).FfreeBlocks
- for p != 0 {
- tem1 = (*TBLOCK)(unsafe.Pointer(p)).Fnext
- (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TXML_Memory_Handling_Suite)(unsafe.Pointer((*TSTRING_POOL)(unsafe.Pointer(pool)).Fmem)).Ffree_fcn})))(tls, p)
- p = tem1
- }
- }
- func _poolAppend(tls *libc.TLS, pool uintptr, enc uintptr, _ptr uintptr, end uintptr) (r uintptr) {
- bp := tls.Alloc(16)
- defer tls.Free(16)
- *(*uintptr)(unsafe.Pointer(bp)) = _ptr
- var convert_res _XML_Convert_Result
- _ = convert_res
- if !((*TSTRING_POOL)(unsafe.Pointer(pool)).Fptr != 0) && !(_poolGrow(tls, pool) != 0) {
- return libc.UintptrFromInt32(0)
- }
- for {
- 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)
- if convert_res == int32(_XML_CONVERT_COMPLETED) || convert_res == int32(_XML_CONVERT_INPUT_INCOMPLETE) {
- break
- }
- if !(_poolGrow(tls, pool) != 0) {
- return libc.UintptrFromInt32(0)
- }
- goto _1
- _1:
- }
- return (*TSTRING_POOL)(unsafe.Pointer(pool)).Fstart
- }
- func _poolCopyString(tls *libc.TLS, pool uintptr, s uintptr) (r uintptr) {
- var v1, v4, v5 uintptr
- var v3 int32
- _, _, _, _ = v1, v3, v4, v5
- for {
- if (*TSTRING_POOL)(unsafe.Pointer(pool)).Fptr == (*TSTRING_POOL)(unsafe.Pointer(pool)).Fend && !(_poolGrow(tls, pool) != 0) {
- v3 = 0
- } else {
- v5 = pool + 24
- v4 = *(*uintptr)(unsafe.Pointer(v5))
- *(*uintptr)(unsafe.Pointer(v5))++
- *(*TXML_Char)(unsafe.Pointer(v4)) = *(*TXML_Char)(unsafe.Pointer(s))
- v3 = libc.Int32FromInt32(1)
- }
- if !(v3 != 0) {
- return libc.UintptrFromInt32(0)
- }
- goto _2
- _2:
- ;
- v1 = s
- s++
- if !(*(*TXML_Char)(unsafe.Pointer(v1)) != 0) {
- break
- }
- }
- s = (*TSTRING_POOL)(unsafe.Pointer(pool)).Fstart
- (*TSTRING_POOL)(unsafe.Pointer(pool)).Fstart = (*TSTRING_POOL)(unsafe.Pointer(pool)).Fptr
- return s
- }
- func _poolCopyStringN(tls *libc.TLS, pool uintptr, s uintptr, n int32) (r uintptr) {
- var v2 int32
- var v3, v4 uintptr
- _, _, _ = v2, v3, v4
- if !((*TSTRING_POOL)(unsafe.Pointer(pool)).Fptr != 0) && !(_poolGrow(tls, pool) != 0) {
- /* The following line is unreachable given the current usage of
- * poolCopyStringN(). Currently it is called from exactly one
- * place to copy the text of a simple general entity. By that
- * point, the name of the entity is already stored in the pool, so
- * pool->ptr cannot be NULL.
- *
- * If poolCopyStringN() is used elsewhere as it well might be,
- * this line may well become executable again. Regardless, this
- * sort of check shouldn't be removed lightly, so we just exclude
- * it from the coverage statistics.
- */
- return libc.UintptrFromInt32(0) /* LCOV_EXCL_LINE */
- }
- for {
- if !(n > 0) {
- break
- }
- if (*TSTRING_POOL)(unsafe.Pointer(pool)).Fptr == (*TSTRING_POOL)(unsafe.Pointer(pool)).Fend && !(_poolGrow(tls, pool) != 0) {
- v2 = 0
- } else {
- v4 = pool + 24
- v3 = *(*uintptr)(unsafe.Pointer(v4))
- *(*uintptr)(unsafe.Pointer(v4))++
- *(*TXML_Char)(unsafe.Pointer(v3)) = *(*TXML_Char)(unsafe.Pointer(s))
- v2 = libc.Int32FromInt32(1)
- }
- if !(v2 != 0) {
- return libc.UintptrFromInt32(0)
- }
- goto _1
- _1:
- ;
- n--
- s++
- }
- s = (*TSTRING_POOL)(unsafe.Pointer(pool)).Fstart
- (*TSTRING_POOL)(unsafe.Pointer(pool)).Fstart = (*TSTRING_POOL)(unsafe.Pointer(pool)).Fptr
- return s
- }
- func _poolAppendString(tls *libc.TLS, pool uintptr, s uintptr) (r uintptr) {
- var v1 int32
- var v2, v3 uintptr
- _, _, _ = v1, v2, v3
- for *(*TXML_Char)(unsafe.Pointer(s)) != 0 {
- if (*TSTRING_POOL)(unsafe.Pointer(pool)).Fptr == (*TSTRING_POOL)(unsafe.Pointer(pool)).Fend && !(_poolGrow(tls, pool) != 0) {
- v1 = 0
- } else {
- v3 = pool + 24
- v2 = *(*uintptr)(unsafe.Pointer(v3))
- *(*uintptr)(unsafe.Pointer(v3))++
- *(*TXML_Char)(unsafe.Pointer(v2)) = *(*TXML_Char)(unsafe.Pointer(s))
- v1 = libc.Int32FromInt32(1)
- }
- if !(v1 != 0) {
- return libc.UintptrFromInt32(0)
- }
- s++
- }
- return (*TSTRING_POOL)(unsafe.Pointer(pool)).Fstart
- }
- func _poolStoreString(tls *libc.TLS, pool uintptr, enc uintptr, ptr uintptr, end uintptr) (r uintptr) {
- var v1, v2 uintptr
- _, _ = v1, v2
- if !(_poolAppend(tls, pool, enc, ptr, end) != 0) {
- return libc.UintptrFromInt32(0)
- }
- if (*TSTRING_POOL)(unsafe.Pointer(pool)).Fptr == (*TSTRING_POOL)(unsafe.Pointer(pool)).Fend && !(_poolGrow(tls, pool) != 0) {
- return libc.UintptrFromInt32(0)
- }
- v2 = pool + 24
- v1 = *(*uintptr)(unsafe.Pointer(v2))
- *(*uintptr)(unsafe.Pointer(v2))++
- *(*TXML_Char)(unsafe.Pointer(v1)) = 0
- return (*TSTRING_POOL)(unsafe.Pointer(pool)).Fstart
- }
- func _poolBytesToAllocateFor(tls *libc.TLS, blockSize int32) (r Tsize_t) {
- var bytesToAllocate, stretchedBlockSize int32
- var stretch Tsize_t
- _, _, _ = bytesToAllocate, stretch, stretchedBlockSize
- /* Unprotected math would be:
- ** return offsetof(BLOCK, s) + blockSize * sizeof(XML_Char);
- **
- ** Detect overflow, avoiding _signed_ overflow undefined behavior
- ** For a + b * c we check b * c in isolation first, so that addition of a
- ** on top has no chance of making us accept a small non-negative number
- */
- stretch = uint64(1) /* can be 4 bytes */
- if blockSize <= 0 {
- return uint64(0)
- }
- if blockSize > libc.Int32FromUint64(libc.Uint64FromInt32(m_INT_MAX)/stretch) {
- return uint64(0)
- }
- stretchedBlockSize = blockSize * libc.Int32FromUint64(stretch)
- bytesToAllocate = libc.Int32FromUint64(uint64(libc.UintptrFromInt32(0)+12) + uint64(libc.Uint32FromInt32(stretchedBlockSize)))
- if bytesToAllocate < 0 {
- return uint64(0)
- }
- return libc.Uint64FromInt32(bytesToAllocate)
- return r
- }
- func _poolGrow(tls *libc.TLS, pool uintptr) (r TXML_Bool) {
- var blockSize, blockSize1 int32
- var bytesToAllocate, bytesToAllocate1 Tsize_t
- var offsetInsideBlock Tptrdiff_t
- var tem, tem1, temp uintptr
- _, _, _, _, _, _, _, _ = blockSize, blockSize1, bytesToAllocate, bytesToAllocate1, offsetInsideBlock, tem, tem1, temp
- if (*TSTRING_POOL)(unsafe.Pointer(pool)).FfreeBlocks != 0 {
- if (*TSTRING_POOL)(unsafe.Pointer(pool)).Fstart == uintptr(0) {
- (*TSTRING_POOL)(unsafe.Pointer(pool)).Fblocks = (*TSTRING_POOL)(unsafe.Pointer(pool)).FfreeBlocks
- (*TSTRING_POOL)(unsafe.Pointer(pool)).FfreeBlocks = (*TBLOCK)(unsafe.Pointer((*TSTRING_POOL)(unsafe.Pointer(pool)).FfreeBlocks)).Fnext
- (*TBLOCK)(unsafe.Pointer((*TSTRING_POOL)(unsafe.Pointer(pool)).Fblocks)).Fnext = libc.UintptrFromInt32(0)
- (*TSTRING_POOL)(unsafe.Pointer(pool)).Fstart = (*TSTRING_POOL)(unsafe.Pointer(pool)).Fblocks + 12
- (*TSTRING_POOL)(unsafe.Pointer(pool)).Fend = (*TSTRING_POOL)(unsafe.Pointer(pool)).Fstart + uintptr((*TBLOCK)(unsafe.Pointer((*TSTRING_POOL)(unsafe.Pointer(pool)).Fblocks)).Fsize)
- (*TSTRING_POOL)(unsafe.Pointer(pool)).Fptr = (*TSTRING_POOL)(unsafe.Pointer(pool)).Fstart
- return libc.Uint8FromInt32(1)
- }
- 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) {
- tem = (*TBLOCK)(unsafe.Pointer((*TSTRING_POOL)(unsafe.Pointer(pool)).FfreeBlocks)).Fnext
- (*TBLOCK)(unsafe.Pointer((*TSTRING_POOL)(unsafe.Pointer(pool)).FfreeBlocks)).Fnext = (*TSTRING_POOL)(unsafe.Pointer(pool)).Fblocks
- (*TSTRING_POOL)(unsafe.Pointer(pool)).Fblocks = (*TSTRING_POOL)(unsafe.Pointer(pool)).FfreeBlocks
- (*TSTRING_POOL)(unsafe.Pointer(pool)).FfreeBlocks = tem
- libc.Xmemcpy(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))
- (*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))
- (*TSTRING_POOL)(unsafe.Pointer(pool)).Fstart = (*TSTRING_POOL)(unsafe.Pointer(pool)).Fblocks + 12
- (*TSTRING_POOL)(unsafe.Pointer(pool)).Fend = (*TSTRING_POOL)(unsafe.Pointer(pool)).Fstart + uintptr((*TBLOCK)(unsafe.Pointer((*TSTRING_POOL)(unsafe.Pointer(pool)).Fblocks)).Fsize)
- return libc.Uint8FromInt32(1)
- }
- }
- if (*TSTRING_POOL)(unsafe.Pointer(pool)).Fblocks != 0 && (*TSTRING_POOL)(unsafe.Pointer(pool)).Fstart == (*TSTRING_POOL)(unsafe.Pointer(pool)).Fblocks+12 {
- blockSize = libc.Int32FromUint32(libc.Uint32FromInt64(int64((*TSTRING_POOL)(unsafe.Pointer(pool)).Fend)-int64((*TSTRING_POOL)(unsafe.Pointer(pool)).Fstart)) * libc.Uint32FromUint32(2))
- /* NOTE: Needs to be calculated prior to calling `realloc`
- to avoid dangling pointers: */
- offsetInsideBlock = int64((*TSTRING_POOL)(unsafe.Pointer(pool)).Fptr) - int64((*TSTRING_POOL)(unsafe.Pointer(pool)).Fstart)
- if blockSize < 0 {
- /* This condition traps a situation where either more than
- * INT_MAX/2 bytes have already been allocated. This isn't
- * readily testable, since it is unlikely that an average
- * machine will have that much memory, so we exclude it from the
- * coverage statistics.
- */
- return libc.Uint8FromInt32(0) /* LCOV_EXCL_LINE */
- }
- bytesToAllocate = _poolBytesToAllocateFor(tls, blockSize)
- if bytesToAllocate == uint64(0) {
- return libc.Uint8FromInt32(0)
- }
- 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)))
- if temp == libc.UintptrFromInt32(0) {
- return libc.Uint8FromInt32(0)
- }
- (*TSTRING_POOL)(unsafe.Pointer(pool)).Fblocks = temp
- (*TBLOCK)(unsafe.Pointer((*TSTRING_POOL)(unsafe.Pointer(pool)).Fblocks)).Fsize = blockSize
- (*TSTRING_POOL)(unsafe.Pointer(pool)).Fptr = (*TSTRING_POOL)(unsafe.Pointer(pool)).Fblocks + 12 + uintptr(offsetInsideBlock)
- (*TSTRING_POOL)(unsafe.Pointer(pool)).Fstart = (*TSTRING_POOL)(unsafe.Pointer(pool)).Fblocks + 12
- (*TSTRING_POOL)(unsafe.Pointer(pool)).Fend = (*TSTRING_POOL)(unsafe.Pointer(pool)).Fstart + uintptr(blockSize)
- } else {
- blockSize1 = int32(int64((*TSTRING_POOL)(unsafe.Pointer(pool)).Fend) - int64((*TSTRING_POOL)(unsafe.Pointer(pool)).Fstart))
- if blockSize1 < 0 {
- /* This condition traps a situation where either more than
- * INT_MAX bytes have already been allocated (which is prevented
- * by various pieces of program logic, not least this one, never
- * mind the unlikelihood of actually having that much memory) or
- * the pool control fields have been corrupted (which could
- * conceivably happen in an extremely buggy user handler
- * function). Either way it isn't readily testable, so we
- * exclude it from the coverage statistics.
- */
- return libc.Uint8FromInt32(0) /* LCOV_EXCL_LINE */
- }
- if blockSize1 < int32(m_INIT_BLOCK_SIZE) {
- blockSize1 = int32(m_INIT_BLOCK_SIZE)
- } else {
- /* Detect overflow, avoiding _signed_ overflow undefined behavior */
- if libc.Int32FromUint32(libc.Uint32FromInt32(blockSize1)*libc.Uint32FromUint32(2)) < 0 {
- return libc.Uint8FromInt32(0)
- }
- blockSize1 *= int32(2)
- }
- bytesToAllocate1 = _poolBytesToAllocateFor(tls, blockSize1)
- if bytesToAllocate1 == uint64(0) {
- return libc.Uint8FromInt32(0)
- }
- 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)
- if !(tem1 != 0) {
- return libc.Uint8FromInt32(0)
- }
- (*TBLOCK)(unsafe.Pointer(tem1)).Fsize = blockSize1
- (*TBLOCK)(unsafe.Pointer(tem1)).Fnext = (*TSTRING_POOL)(unsafe.Pointer(pool)).Fblocks
- (*TSTRING_POOL)(unsafe.Pointer(pool)).Fblocks = tem1
- if (*TSTRING_POOL)(unsafe.Pointer(pool)).Fptr != (*TSTRING_POOL)(unsafe.Pointer(pool)).Fstart {
- libc.Xmemcpy(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))
- }
- (*TSTRING_POOL)(unsafe.Pointer(pool)).Fptr = tem1 + 12 + uintptr(int64((*TSTRING_POOL)(unsafe.Pointer(pool)).Fptr)-int64((*TSTRING_POOL)(unsafe.Pointer(pool)).Fstart))
- (*TSTRING_POOL)(unsafe.Pointer(pool)).Fstart = tem1 + 12
- (*TSTRING_POOL)(unsafe.Pointer(pool)).Fend = tem1 + 12 + uintptr(blockSize1)
- }
- return libc.Uint8FromInt32(1)
- }
- func _nextScaffoldPart(tls *libc.TLS, parser TXML_Parser) (r int32) {
- var dtd, me, parent, temp, v2 uintptr
- var next, v3, v4, v5 int32
- var v1 uint32
- _, _, _, _, _, _, _, _, _, _ = dtd, me, next, parent, temp, v1, v2, v3, v4, v5
- dtd = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_dtd
- if !((*TDTD)(unsafe.Pointer(dtd)).FscaffIndex != 0) {
- (*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))
- if !((*TDTD)(unsafe.Pointer(dtd)).FscaffIndex != 0) {
- return -int32(1)
- }
- *(*int32)(unsafe.Pointer((*TDTD)(unsafe.Pointer(dtd)).FscaffIndex)) = 0
- }
- if (*TDTD)(unsafe.Pointer(dtd)).FscaffCount >= (*TDTD)(unsafe.Pointer(dtd)).FscaffSize {
- if (*TDTD)(unsafe.Pointer(dtd)).Fscaffold != 0 {
- /* Detect and prevent integer overflow */
- if (*TDTD)(unsafe.Pointer(dtd)).FscaffSize > libc.Uint32FromUint32(0xffffffff)/libc.Uint32FromUint32(2) {
- return -int32(1)
- }
- /* Detect and prevent integer overflow.
- * The preprocessor guard addresses the "always false" warning
- * from -Wtype-limits on platforms where
- * sizeof(unsigned int) < sizeof(size_t), e.g. on x86_64. */
- 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))
- if temp == libc.UintptrFromInt32(0) {
- return -int32(1)
- }
- *(*uint32)(unsafe.Pointer(dtd + 340)) *= uint32(2)
- } else {
- 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))
- if temp == libc.UintptrFromInt32(0) {
- return -int32(1)
- }
- (*TDTD)(unsafe.Pointer(dtd)).FscaffSize = uint32(m_INIT_SCAFFOLD_ELEMENTS)
- }
- (*TDTD)(unsafe.Pointer(dtd)).Fscaffold = temp
- }
- v2 = dtd + 344
- v1 = *(*uint32)(unsafe.Pointer(v2))
- *(*uint32)(unsafe.Pointer(v2))++
- next = libc.Int32FromUint32(v1)
- me = (*TDTD)(unsafe.Pointer(dtd)).Fscaffold + uintptr(next)*32
- if (*TDTD)(unsafe.Pointer(dtd)).FscaffLevel != 0 {
- 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
- if (*TCONTENT_SCAFFOLD)(unsafe.Pointer(parent)).Flastchild != 0 {
- (*(*TCONTENT_SCAFFOLD)(unsafe.Pointer((*TDTD)(unsafe.Pointer(dtd)).Fscaffold + uintptr((*TCONTENT_SCAFFOLD)(unsafe.Pointer(parent)).Flastchild)*32))).Fnextsib = next
- }
- if !((*TCONTENT_SCAFFOLD)(unsafe.Pointer(parent)).Fchildcnt != 0) {
- (*TCONTENT_SCAFFOLD)(unsafe.Pointer(parent)).Ffirstchild = next
- }
- (*TCONTENT_SCAFFOLD)(unsafe.Pointer(parent)).Flastchild = next
- (*TCONTENT_SCAFFOLD)(unsafe.Pointer(parent)).Fchildcnt++
- }
- v5 = libc.Int32FromInt32(0)
- (*TCONTENT_SCAFFOLD)(unsafe.Pointer(me)).Fnextsib = v5
- v4 = v5
- (*TCONTENT_SCAFFOLD)(unsafe.Pointer(me)).Fchildcnt = v4
- v3 = v4
- (*TCONTENT_SCAFFOLD)(unsafe.Pointer(me)).Flastchild = v3
- (*TCONTENT_SCAFFOLD)(unsafe.Pointer(me)).Ffirstchild = v3
- return next
- }
- func _build_model(tls *libc.TLS, parser TXML_Parser) (r uintptr) {
- var allocsize Tsize_t
- var cn, src_node int32
- var dest, destLimit, dtd, jobDest, ret, src, str, v1, v4, v6 uintptr
- var i uint32
- _, _, _, _, _, _, _, _, _, _, _, _, _, _ = allocsize, cn, dest, destLimit, dtd, i, jobDest, ret, src, src_node, str, v1, v4, v6
- /* Function build_model transforms the existing parser->m_dtd->scaffold
- * array of CONTENT_SCAFFOLD tree nodes into a new array of
- * XML_Content tree nodes followed by a gapless list of zero-terminated
- * strings. */
- dtd = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_dtd /* the current string writing location */
- /* Detect and prevent integer overflow.
- * The preprocessor guard addresses the "always false" warning
- * from -Wtype-limits on platforms where
- * sizeof(unsigned int) < sizeof(size_t), e.g. on x86_64. */
- if uint64((*TDTD)(unsafe.Pointer(dtd)).FscaffCount)*uint64(32) > libc.Uint64FromInt32(-libc.Int32FromInt32(1))-uint64((*TDTD)(unsafe.Pointer(dtd)).FcontentStringLen)*uint64(1) {
- return libc.UintptrFromInt32(0)
- }
- allocsize = uint64((*TDTD)(unsafe.Pointer(dtd)).FscaffCount)*libc.Uint64FromInt64(32) + uint64((*TDTD)(unsafe.Pointer(dtd)).FcontentStringLen)*libc.Uint64FromInt64(1)
- ret = (*(*func(*libc.TLS, Tsize_t) uintptr)(unsafe.Pointer(&struct{ uintptr }{(*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_mem.Fmalloc_fcn})))(tls, allocsize)
- if !(ret != 0) {
- return libc.UintptrFromInt32(0)
- }
- /* What follows is an iterative implementation (of what was previously done
- * recursively in a dedicated function called "build_node". The old recursive
- * build_node could be forced into stack exhaustion from input as small as a
- * few megabyte, and so that was a security issue. Hence, a function call
- * stack is avoided now by resolving recursion.)
- *
- * The iterative approach works as follows:
- *
- * - We have two writing pointers, both walking up the result array; one does
- * the work, the other creates "jobs" for its colleague to do, and leads
- * the way:
- *
- * - The faster one, pointer jobDest, always leads and writes "what job
- * to do" by the other, once they reach that place in the
- * array: leader "jobDest" stores the source node array index (relative
- * to array dtd->scaffold) in field "numchildren".
- *
- * - The slower one, pointer dest, looks at the value stored in the
- * "numchildren" field (which actually holds a source node array index
- * at that time) and puts the real data from dtd->scaffold in.
- *
- * - Before the loop starts, jobDest writes source array index 0
- * (where the root node is located) so that dest will have something to do
- * when it starts operation.
- *
- * - Whenever nodes with children are encountered, jobDest appends
- * them as new jobs, in order. As a result, tree node siblings are
- * adjacent in the resulting array, for example:
- *
- * [0] root, has two children
- * [1] first child of 0, has three children
- * [3] first child of 1, does not have children
- * [4] second child of 1, does not have children
- * [5] third child of 1, does not have children
- * [2] second child of 0, does not have children
- *
- * Or (the same data) presented in flat array view:
- *
- * [0] root, has two children
- *
- * [1] first child of 0, has three children
- * [2] second child of 0, does not have children
- *
- * [3] first child of 1, does not have children
- * [4] second child of 1, does not have children
- * [5] third child of 1, does not have children
- *
- * - The algorithm repeats until all target array indices have been processed.
- */
- dest = ret /* tree node writing location, moves upwards */
- destLimit = ret + uintptr((*TDTD)(unsafe.Pointer(dtd)).FscaffCount)*32
- jobDest = ret /* next free writing location in target array */
- str = ret + uintptr((*TDTD)(unsafe.Pointer(dtd)).FscaffCount)*32
- /* Add the starting job, the root node (index 0) of the source tree */
- v1 = jobDest
- jobDest += 32
- (*TXML_Content)(unsafe.Pointer(v1)).Fnumchildren = uint32(0)
- for {
- if !(dest < destLimit) {
- break
- }
- /* Retrieve source tree array index from job storage */
- src_node = libc.Int32FromUint32((*TXML_Content)(unsafe.Pointer(dest)).Fnumchildren)
- /* Convert item */
- (*TXML_Content)(unsafe.Pointer(dest)).Ftype1 = (*(*TCONTENT_SCAFFOLD)(unsafe.Pointer((*TDTD)(unsafe.Pointer(dtd)).Fscaffold + uintptr(src_node)*32))).Ftype1
- (*TXML_Content)(unsafe.Pointer(dest)).Fquant = (*(*TCONTENT_SCAFFOLD)(unsafe.Pointer((*TDTD)(unsafe.Pointer(dtd)).Fscaffold + uintptr(src_node)*32))).Fquant
- if (*TXML_Content)(unsafe.Pointer(dest)).Ftype1 == int32(_XML_CTYPE_NAME) {
- (*TXML_Content)(unsafe.Pointer(dest)).Fname = str
- src = (*(*TCONTENT_SCAFFOLD)(unsafe.Pointer((*TDTD)(unsafe.Pointer(dtd)).Fscaffold + uintptr(src_node)*32))).Fname
- for {
- v4 = str
- str++
- *(*TXML_Char)(unsafe.Pointer(v4)) = *(*TXML_Char)(unsafe.Pointer(src))
- if !(*(*TXML_Char)(unsafe.Pointer(src)) != 0) {
- break
- }
- src++
- goto _3
- _3:
- }
- (*TXML_Content)(unsafe.Pointer(dest)).Fnumchildren = uint32(0)
- (*TXML_Content)(unsafe.Pointer(dest)).Fchildren = libc.UintptrFromInt32(0)
- } else {
- (*TXML_Content)(unsafe.Pointer(dest)).Fname = libc.UintptrFromInt32(0)
- (*TXML_Content)(unsafe.Pointer(dest)).Fnumchildren = libc.Uint32FromInt32((*(*TCONTENT_SCAFFOLD)(unsafe.Pointer((*TDTD)(unsafe.Pointer(dtd)).Fscaffold + uintptr(src_node)*32))).Fchildcnt)
- (*TXML_Content)(unsafe.Pointer(dest)).Fchildren = jobDest
- /* Append scaffold indices of children to array */
- i = uint32(0)
- cn = (*(*TCONTENT_SCAFFOLD)(unsafe.Pointer((*TDTD)(unsafe.Pointer(dtd)).Fscaffold + uintptr(src_node)*32))).Ffirstchild
- for {
- if !(i < (*TXML_Content)(unsafe.Pointer(dest)).Fnumchildren) {
- break
- }
- v6 = jobDest
- jobDest += 32
- (*TXML_Content)(unsafe.Pointer(v6)).Fnumchildren = libc.Uint32FromInt32(cn)
- goto _5
- _5:
- ;
- i++
- cn = (*(*TCONTENT_SCAFFOLD)(unsafe.Pointer((*TDTD)(unsafe.Pointer(dtd)).Fscaffold + uintptr(cn)*32))).Fnextsib
- }
- }
- goto _2
- _2:
- ;
- dest += 32
- }
- return ret
- }
- func _getElementType(tls *libc.TLS, parser TXML_Parser, enc uintptr, ptr uintptr, end uintptr) (r uintptr) {
- var dtd, name, ret uintptr
- _, _, _ = dtd, name, ret
- dtd = (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_dtd /* save one level of indirection */
- name = _poolStoreString(tls, dtd+160, enc, ptr, end)
- if !(name != 0) {
- return libc.UintptrFromInt32(0)
- }
- ret = _lookup(tls, parser, dtd+40, name, uint64(40))
- if !(ret != 0) {
- return libc.UintptrFromInt32(0)
- }
- if (*TELEMENT_TYPE)(unsafe.Pointer(ret)).Fname != name {
- (*TSTRING_POOL)(unsafe.Pointer(dtd + 160)).Fptr = (*TSTRING_POOL)(unsafe.Pointer(dtd + 160)).Fstart
- } else {
- (*TSTRING_POOL)(unsafe.Pointer(dtd + 160)).Fstart = (*TSTRING_POOL)(unsafe.Pointer(dtd + 160)).Fptr
- if !(_setElementTypePrefix(tls, parser, ret) != 0) {
- return libc.UintptrFromInt32(0)
- }
- }
- return ret
- }
- func _copyString(tls *libc.TLS, s uintptr, memsuite uintptr) (r uintptr) {
- var charsRequired Tsize_t
- var result uintptr
- _, _ = charsRequired, result
- charsRequired = uint64(0)
- /* First determine how long the string is */
- for int32(*(*TXML_Char)(unsafe.Pointer(s + uintptr(charsRequired)))) != 0 {
- charsRequired++
- }
- /* Include the terminator */
- charsRequired++
- /* Now allocate space for the copy */
- result = (*(*func(*libc.TLS, Tsize_t) uintptr)(unsafe.Pointer(&struct{ uintptr }{(*TXML_Memory_Handling_Suite)(unsafe.Pointer(memsuite)).Fmalloc_fcn})))(tls, charsRequired*uint64(1))
- if result == libc.UintptrFromInt32(0) {
- return libc.UintptrFromInt32(0)
- }
- /* Copy the original into place */
- libc.Xmemcpy(tls, result, s, charsRequired*uint64(1))
- return result
- }
- func _accountingGetCurrentAmplification(tls *libc.TLS, rootParser TXML_Parser) (r float32) {
- var amplificationFactor, v1 float32
- var countBytesOutput TXmlBigCount
- _, _, _ = amplificationFactor, countBytesOutput, v1
- countBytesOutput = (*TXML_ParserStruct)(unsafe.Pointer(rootParser)).Fm_accounting.FcountBytesDirect + (*TXML_ParserStruct)(unsafe.Pointer(rootParser)).Fm_accounting.FcountBytesIndirect
- if (*TXML_ParserStruct)(unsafe.Pointer(rootParser)).Fm_accounting.FcountBytesDirect != 0 {
- v1 = float32(countBytesOutput) / float32((*TXML_ParserStruct)(unsafe.Pointer(rootParser)).Fm_accounting.FcountBytesDirect)
- } else {
- v1 = libc.Float32FromFloat32(1)
- }
- amplificationFactor = v1
- return amplificationFactor
- }
- func _accountingReportStats(tls *libc.TLS, originParser TXML_Parser, epilog uintptr) {
- bp := tls.Alloc(48)
- defer tls.Free(48)
- var amplificationFactor float32
- var rootParser TXML_Parser
- _, _ = amplificationFactor, rootParser
- rootParser = _getRootParserOf(tls, originParser, libc.UintptrFromInt32(0))
- if (*TXML_ParserStruct)(unsafe.Pointer(rootParser)).Fm_accounting.FdebugLevel < int32(1) {
- return
- }
- amplificationFactor = _accountingGetCurrentAmplification(tls, rootParser)
- libc.Xfprintf(tls, libc.Xstderr, __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))
- }
- func _accountingOnAbort(tls *libc.TLS, originParser TXML_Parser) {
- _accountingReportStats(tls, originParser, __ccgo_ts+1748)
- }
- func _accountingReportDiff(tls *libc.TLS, rootParser TXML_Parser, levelsAwayFromRootParser uint32, before uintptr, after uintptr, bytesMore Tptrdiff_t, source_line int32, account _XML_Account) {
- bp := tls.Alloc(64)
- defer tls.Free(64)
- var contextLength uint32
- var ellipsisLength Tsize_t
- var walker, v1 uintptr
- var _ /* ellipis at bp+0 */ [5]int8
- _, _, _, _ = contextLength, ellipsisLength, walker, v1
- if account == int32(_XML_ACCOUNT_DIRECT) {
- v1 = __ccgo_ts + 1759
- } else {
- v1 = __ccgo_ts + 1763
- }
- libc.Xfprintf(tls, libc.Xstderr, __ccgo_ts+1767, libc.VaList(bp+16, bytesMore, v1, levelsAwayFromRootParser, source_line, int32(10), __ccgo_ts+1808))
- *(*[5]int8)(unsafe.Pointer(bp)) = [5]int8{'[', '.', '.', ']'}
- ellipsisLength = libc.Uint64FromInt64(5) - libc.Uint64FromInt32(1)
- contextLength = uint32(10)
- /* Note: Performance is of no concern here */
- walker = before
- if (*TXML_ParserStruct)(unsafe.Pointer(rootParser)).Fm_accounting.FdebugLevel >= int32(3) || int64(after)-int64(before) <= libc.Int64FromUint64(uint64(contextLength)+ellipsisLength+uint64(contextLength)) {
- for {
- if !(walker < after) {
- break
- }
- libc.Xfprintf(tls, libc.Xstderr, __ccgo_ts+1809, libc.VaList(bp+16, XunsignedCharToPrintable(tls, libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(walker))))))
- goto _2
- _2:
- ;
- walker++
- }
- } else {
- for {
- if !(walker < before+uintptr(contextLength)) {
- break
- }
- libc.Xfprintf(tls, libc.Xstderr, __ccgo_ts+1809, libc.VaList(bp+16, XunsignedCharToPrintable(tls, libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(walker))))))
- goto _3
- _3:
- ;
- walker++
- }
- libc.Xfprintf(tls, libc.Xstderr, bp, 0)
- walker = after - uintptr(contextLength)
- for {
- if !(walker < after) {
- break
- }
- libc.Xfprintf(tls, libc.Xstderr, __ccgo_ts+1809, libc.VaList(bp+16, XunsignedCharToPrintable(tls, libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(walker))))))
- goto _4
- _4:
- ;
- walker++
- }
- }
- libc.Xfprintf(tls, libc.Xstderr, __ccgo_ts+1812, 0)
- }
- func _accountingDiffTolerated(tls *libc.TLS, originParser TXML_Parser, tok int32, before uintptr, after uintptr, source_line int32, account _XML_Account) (r TXML_Bool) {
- bp := tls.Alloc(16)
- defer tls.Free(16)
- var additionTarget, v1 uintptr
- var amplificationFactor float32
- var bytesMore Tptrdiff_t
- var countBytesOutput TXmlBigCount
- var isDirect int32
- var rootParser TXML_Parser
- var tolerated TXML_Bool
- var _ /* levelsAwayFromRootParser at bp+0 */ uint32
- _, _, _, _, _, _, _, _ = additionTarget, amplificationFactor, bytesMore, countBytesOutput, isDirect, rootParser, tolerated, v1
- /* Note: We need to check the token type *first* to be sure that
- * we can even access variable <after>, safely.
- * E.g. for XML_TOK_NONE <after> may hold an invalid pointer. */
- switch tok {
- case m_XML_TOK_INVALID:
- fallthrough
- case -int32(1):
- fallthrough
- case -int32(2):
- fallthrough
- case -int32(4):
- return libc.Uint8FromInt32(1)
- }
- if account == int32(_XML_ACCOUNT_NONE) {
- return libc.Uint8FromInt32(1)
- }
- rootParser = _getRootParserOf(tls, originParser, bp)
- isDirect = libc.BoolInt32(account == int32(_XML_ACCOUNT_DIRECT) && originParser == rootParser)
- bytesMore = int64(after) - int64(before)
- if isDirect != 0 {
- v1 = rootParser + 928
- } else {
- v1 = rootParser + 928 + 8
- }
- additionTarget = v1
- /* Detect and avoid integer overflow */
- if *(*TXmlBigCount)(unsafe.Pointer(additionTarget)) > libc.Uint64FromInt32(-libc.Int32FromInt32(1))-libc.Uint64FromInt64(bytesMore) {
- return libc.Uint8FromInt32(0)
- }
- *(*TXmlBigCount)(unsafe.Pointer(additionTarget)) += libc.Uint64FromInt64(bytesMore)
- countBytesOutput = (*TXML_ParserStruct)(unsafe.Pointer(rootParser)).Fm_accounting.FcountBytesDirect + (*TXML_ParserStruct)(unsafe.Pointer(rootParser)).Fm_accounting.FcountBytesIndirect
- amplificationFactor = _accountingGetCurrentAmplification(tls, rootParser)
- tolerated = libc.BoolUint8(countBytesOutput < (*TXML_ParserStruct)(unsafe.Pointer(rootParser)).Fm_accounting.FactivationThresholdBytes || amplificationFactor <= (*TXML_ParserStruct)(unsafe.Pointer(rootParser)).Fm_accounting.FmaximumAmplificationFactor)
- if (*TXML_ParserStruct)(unsafe.Pointer(rootParser)).Fm_accounting.FdebugLevel >= int32(2) {
- _accountingReportStats(tls, rootParser, __ccgo_ts+1808)
- _accountingReportDiff(tls, rootParser, *(*uint32)(unsafe.Pointer(bp)), before, after, bytesMore, source_line, account)
- }
- return tolerated
- }
- func XtestingAccountingGetCountBytesDirect(tls *libc.TLS, parser TXML_Parser) (r uint64) {
- if !(parser != 0) {
- return uint64(0)
- }
- return (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_accounting.FcountBytesDirect
- }
- func XtestingAccountingGetCountBytesIndirect(tls *libc.TLS, parser TXML_Parser) (r uint64) {
- if !(parser != 0) {
- return uint64(0)
- }
- return (*TXML_ParserStruct)(unsafe.Pointer(parser)).Fm_accounting.FcountBytesIndirect
- }
- func _entityTrackingReportStats(tls *libc.TLS, rootParser TXML_Parser, entity uintptr, action uintptr, sourceLine int32) {
- bp := tls.Alloc(96)
- defer tls.Free(96)
- var entityName, v1 uintptr
- _, _ = entityName, v1
- if (*TXML_ParserStruct)(unsafe.Pointer(rootParser)).Fm_entity_stats.FdebugLevel < int32(1) {
- return
- }
- entityName = (*TENTITY)(unsafe.Pointer(entity)).Fname
- if (*TENTITY)(unsafe.Pointer(entity)).Fis_param != 0 {
- v1 = __ccgo_ts + 1815
- } else {
- v1 = __ccgo_ts + 1817
- }
- libc.Xfprintf(tls, libc.Xstderr, __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))
- }
- func _entityTrackingOnOpen(tls *libc.TLS, originParser TXML_Parser, entity uintptr, sourceLine int32) {
- var rootParser TXML_Parser
- _ = rootParser
- rootParser = _getRootParserOf(tls, originParser, libc.UintptrFromInt32(0))
- (*TXML_ParserStruct)(unsafe.Pointer(rootParser)).Fm_entity_stats.FcountEverOpened++
- (*TXML_ParserStruct)(unsafe.Pointer(rootParser)).Fm_entity_stats.FcurrentDepth++
- if (*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.FmaximumDepthSeen++
- }
- _entityTrackingReportStats(tls, rootParser, entity, __ccgo_ts+1904, sourceLine)
- }
- func _entityTrackingOnClose(tls *libc.TLS, originParser TXML_Parser, entity uintptr, sourceLine int32) {
- var rootParser TXML_Parser
- _ = rootParser
- rootParser = _getRootParserOf(tls, originParser, libc.UintptrFromInt32(0))
- _entityTrackingReportStats(tls, rootParser, entity, __ccgo_ts+1910, sourceLine)
- (*TXML_ParserStruct)(unsafe.Pointer(rootParser)).Fm_entity_stats.FcurrentDepth--
- }
- func _getRootParserOf(tls *libc.TLS, parser TXML_Parser, outLevelDiff uintptr) (r TXML_Parser) {
- var rootParser TXML_Parser
- var stepsTakenUpwards uint32
- _, _ = rootParser, stepsTakenUpwards
- rootParser = parser
- stepsTakenUpwards = uint32(0)
- for (*TXML_ParserStruct)(unsafe.Pointer(rootParser)).Fm_parentParser != 0 {
- rootParser = (*TXML_ParserStruct)(unsafe.Pointer(rootParser)).Fm_parentParser
- stepsTakenUpwards++
- }
- if outLevelDiff != libc.UintptrFromInt32(0) {
- *(*uint32)(unsafe.Pointer(outLevelDiff)) = stepsTakenUpwards
- }
- return rootParser
- }
- func XunsignedCharToPrintable(tls *libc.TLS, c uint8) (r uintptr) {
- switch libc.Int32FromUint8(c) {
- case 0:
- return __ccgo_ts + 1916
- case int32(1):
- return __ccgo_ts + 1919
- case int32(2):
- return __ccgo_ts + 1923
- case int32(3):
- return __ccgo_ts + 1927
- case int32(4):
- return __ccgo_ts + 1931
- case int32(5):
- return __ccgo_ts + 1935
- case int32(6):
- return __ccgo_ts + 1939
- case int32(7):
- return __ccgo_ts + 1943
- case int32(8):
- return __ccgo_ts + 1947
- case int32(9):
- return __ccgo_ts + 1951
- case int32(10):
- return __ccgo_ts + 1954
- case int32(11):
- return __ccgo_ts + 1957
- case int32(12):
- return __ccgo_ts + 1961
- case int32(13):
- return __ccgo_ts + 1965
- case int32(14):
- return __ccgo_ts + 1968
- case int32(15):
- return __ccgo_ts + 1972
- case int32(16):
- return __ccgo_ts + 1976
- case int32(17):
- return __ccgo_ts + 1981
- case int32(18):
- return __ccgo_ts + 1986
- case int32(19):
- return __ccgo_ts + 1991
- case int32(20):
- return __ccgo_ts + 1996
- case int32(21):
- return __ccgo_ts + 2001
- case int32(22):
- return __ccgo_ts + 2006
- case int32(23):
- return __ccgo_ts + 2011
- case int32(24):
- return __ccgo_ts + 2016
- case int32(25):
- return __ccgo_ts + 2021
- case int32(26):
- return __ccgo_ts + 2026
- case int32(27):
- return __ccgo_ts + 2031
- case int32(28):
- return __ccgo_ts + 2036
- case int32(29):
- return __ccgo_ts + 2041
- case int32(30):
- return __ccgo_ts + 2046
- case int32(31):
- return __ccgo_ts + 2051
- case int32(32):
- return __ccgo_ts + 2056
- case int32(33):
- return __ccgo_ts + 2058
- case int32(34):
- return __ccgo_ts + 2060
- case int32(35):
- return __ccgo_ts + 2063
- case int32(36):
- return __ccgo_ts + 2065
- case int32(37):
- return __ccgo_ts + 1815
- case int32(38):
- return __ccgo_ts + 1817
- case int32(39):
- return __ccgo_ts + 2067
- case int32(40):
- return __ccgo_ts + 2069
- case int32(41):
- return __ccgo_ts + 2071
- case int32(42):
- return __ccgo_ts + 2073
- case int32(43):
- return __ccgo_ts + 2075
- case int32(44):
- return __ccgo_ts + 2077
- case int32(45):
- return __ccgo_ts + 2079
- case int32(46):
- return __ccgo_ts + 2081
- case int32(47):
- return __ccgo_ts + 2083
- case int32(48):
- return __ccgo_ts + 2085
- case int32(49):
- return __ccgo_ts + 2087
- case int32(50):
- return __ccgo_ts + 2089
- case int32(51):
- return __ccgo_ts + 2091
- case int32(52):
- return __ccgo_ts + 2093
- case int32(53):
- return __ccgo_ts + 2095
- case int32(54):
- return __ccgo_ts + 2097
- case int32(55):
- return __ccgo_ts + 2099
- case int32(56):
- return __ccgo_ts + 2101
- case int32(57):
- return __ccgo_ts + 2103
- case int32(58):
- return __ccgo_ts + 2105
- case int32(59):
- return __ccgo_ts + 2107
- case int32(60):
- return __ccgo_ts + 2109
- case int32(61):
- return __ccgo_ts + 2111
- case int32(62):
- return __ccgo_ts + 2113
- case int32(63):
- return __ccgo_ts + 2115
- case int32(64):
- return __ccgo_ts + 2117
- case int32(65):
- return __ccgo_ts + 2119
- case int32(66):
- return __ccgo_ts + 2121
- case int32(67):
- return __ccgo_ts + 2123
- case int32(68):
- return __ccgo_ts + 2125
- case int32(69):
- return __ccgo_ts + 2127
- case int32(70):
- return __ccgo_ts + 2129
- case int32(71):
- return __ccgo_ts + 2131
- case int32(72):
- return __ccgo_ts + 2133
- case int32(73):
- return __ccgo_ts + 2135
- case int32(74):
- return __ccgo_ts + 2137
- case int32(75):
- return __ccgo_ts + 2139
- case int32(76):
- return __ccgo_ts + 2141
- case int32(77):
- return __ccgo_ts + 2143
- case int32(78):
- return __ccgo_ts + 2145
- case int32(79):
- return __ccgo_ts + 2147
- case int32(80):
- return __ccgo_ts + 2149
- case int32(81):
- return __ccgo_ts + 2151
- case int32(82):
- return __ccgo_ts + 2153
- case int32(83):
- return __ccgo_ts + 2155
- case int32(84):
- return __ccgo_ts + 2157
- case int32(85):
- return __ccgo_ts + 2159
- case int32(86):
- return __ccgo_ts + 2161
- case int32(87):
- return __ccgo_ts + 2163
- case int32(88):
- return __ccgo_ts + 2165
- case int32(89):
- return __ccgo_ts + 2167
- case int32(90):
- return __ccgo_ts + 2169
- case int32(91):
- return __ccgo_ts + 2171
- case int32(92):
- return __ccgo_ts + 2173
- case int32(93):
- return __ccgo_ts + 2176
- case int32(94):
- return __ccgo_ts + 2178
- case int32(95):
- return __ccgo_ts + 2180
- case int32(96):
- return __ccgo_ts + 2182
- case int32(97):
- return __ccgo_ts + 2184
- case int32(98):
- return __ccgo_ts + 2186
- case int32(99):
- return __ccgo_ts + 2188
- case int32(100):
- return __ccgo_ts + 2190
- case int32(101):
- return __ccgo_ts + 2192
- case int32(102):
- return __ccgo_ts + 2194
- case int32(103):
- return __ccgo_ts + 2196
- case int32(104):
- return __ccgo_ts + 2198
- case int32(105):
- return __ccgo_ts + 2200
- case int32(106):
- return __ccgo_ts + 2202
- case int32(107):
- return __ccgo_ts + 2204
- case int32(108):
- return __ccgo_ts + 2206
- case int32(109):
- return __ccgo_ts + 2208
- case int32(110):
- return __ccgo_ts + 2210
- case int32(111):
- return __ccgo_ts + 2212
- case int32(112):
- return __ccgo_ts + 2214
- case int32(113):
- return __ccgo_ts + 2216
- case int32(114):
- return __ccgo_ts + 2218
- case int32(115):
- return __ccgo_ts + 2220
- case int32(116):
- return __ccgo_ts + 2222
- case int32(117):
- return __ccgo_ts + 2224
- case int32(118):
- return __ccgo_ts + 2226
- case int32(119):
- return __ccgo_ts + 2228
- case int32(120):
- return __ccgo_ts + 2230
- case int32(121):
- return __ccgo_ts + 2232
- case int32(122):
- return __ccgo_ts + 2234
- case int32(123):
- return __ccgo_ts + 2236
- case int32(124):
- return __ccgo_ts + 2238
- case int32(125):
- return __ccgo_ts + 2240
- case int32(126):
- return __ccgo_ts + 2242
- case int32(127):
- return __ccgo_ts + 2244
- case int32(128):
- return __ccgo_ts + 2249
- case int32(129):
- return __ccgo_ts + 2254
- case int32(130):
- return __ccgo_ts + 2259
- case int32(131):
- return __ccgo_ts + 2264
- case int32(132):
- return __ccgo_ts + 2269
- case int32(133):
- return __ccgo_ts + 2274
- case int32(134):
- return __ccgo_ts + 2279
- case int32(135):
- return __ccgo_ts + 2284
- case int32(136):
- return __ccgo_ts + 2289
- case int32(137):
- return __ccgo_ts + 2294
- case int32(138):
- return __ccgo_ts + 2299
- case int32(139):
- return __ccgo_ts + 2304
- case int32(140):
- return __ccgo_ts + 2309
- case int32(141):
- return __ccgo_ts + 2314
- case int32(142):
- return __ccgo_ts + 2319
- case int32(143):
- return __ccgo_ts + 2324
- case int32(144):
- return __ccgo_ts + 2329
- case int32(145):
- return __ccgo_ts + 2334
- case int32(146):
- return __ccgo_ts + 2339
- case int32(147):
- return __ccgo_ts + 2344
- case int32(148):
- return __ccgo_ts + 2349
- case int32(149):
- return __ccgo_ts + 2354
- case int32(150):
- return __ccgo_ts + 2359
- case int32(151):
- return __ccgo_ts + 2364
- case int32(152):
- return __ccgo_ts + 2369
- case int32(153):
- return __ccgo_ts + 2374
- case int32(154):
- return __ccgo_ts + 2379
- case int32(155):
- return __ccgo_ts + 2384
- case int32(156):
- return __ccgo_ts + 2389
- case int32(157):
- return __ccgo_ts + 2394
- case int32(158):
- return __ccgo_ts + 2399
- case int32(159):
- return __ccgo_ts + 2404
- case int32(160):
- return __ccgo_ts + 2409
- case int32(161):
- return __ccgo_ts + 2414
- case int32(162):
- return __ccgo_ts + 2419
- case int32(163):
- return __ccgo_ts + 2424
- case int32(164):
- return __ccgo_ts + 2429
- case int32(165):
- return __ccgo_ts + 2434
- case int32(166):
- return __ccgo_ts + 2439
- case int32(167):
- return __ccgo_ts + 2444
- case int32(168):
- return __ccgo_ts + 2449
- case int32(169):
- return __ccgo_ts + 2454
- case int32(170):
- return __ccgo_ts + 2459
- case int32(171):
- return __ccgo_ts + 2464
- case int32(172):
- return __ccgo_ts + 2469
- case int32(173):
- return __ccgo_ts + 2474
- case int32(174):
- return __ccgo_ts + 2479
- case int32(175):
- return __ccgo_ts + 2484
- case int32(176):
- return __ccgo_ts + 2489
- case int32(177):
- return __ccgo_ts + 2494
- case int32(178):
- return __ccgo_ts + 2499
- case int32(179):
- return __ccgo_ts + 2504
- case int32(180):
- return __ccgo_ts + 2509
- case int32(181):
- return __ccgo_ts + 2514
- case int32(182):
- return __ccgo_ts + 2519
- case int32(183):
- return __ccgo_ts + 2524
- case int32(184):
- return __ccgo_ts + 2529
- case int32(185):
- return __ccgo_ts + 2534
- case int32(186):
- return __ccgo_ts + 2539
- case int32(187):
- return __ccgo_ts + 2544
- case int32(188):
- return __ccgo_ts + 2549
- case int32(189):
- return __ccgo_ts + 2554
- case int32(190):
- return __ccgo_ts + 2559
- case int32(191):
- return __ccgo_ts + 2564
- case int32(192):
- return __ccgo_ts + 2569
- case int32(193):
- return __ccgo_ts + 2574
- case int32(194):
- return __ccgo_ts + 2579
- case int32(195):
- return __ccgo_ts + 2584
- case int32(196):
- return __ccgo_ts + 2589
- case int32(197):
- return __ccgo_ts + 2594
- case int32(198):
- return __ccgo_ts + 2599
- case int32(199):
- return __ccgo_ts + 2604
- case int32(200):
- return __ccgo_ts + 2609
- case int32(201):
- return __ccgo_ts + 2614
- case int32(202):
- return __ccgo_ts + 2619
- case int32(203):
- return __ccgo_ts + 2624
- case int32(204):
- return __ccgo_ts + 2629
- case int32(205):
- return __ccgo_ts + 2634
- case int32(206):
- return __ccgo_ts + 2639
- case int32(207):
- return __ccgo_ts + 2644
- case int32(208):
- return __ccgo_ts + 2649
- case int32(209):
- return __ccgo_ts + 2654
- case int32(210):
- return __ccgo_ts + 2659
- case int32(211):
- return __ccgo_ts + 2664
- case int32(212):
- return __ccgo_ts + 2669
- case int32(213):
- return __ccgo_ts + 2674
- case int32(214):
- return __ccgo_ts + 2679
- case int32(215):
- return __ccgo_ts + 2684
- case int32(216):
- return __ccgo_ts + 2689
- case int32(217):
- return __ccgo_ts + 2694
- case int32(218):
- return __ccgo_ts + 2699
- case int32(219):
- return __ccgo_ts + 2704
- case int32(220):
- return __ccgo_ts + 2709
- case int32(221):
- return __ccgo_ts + 2714
- case int32(222):
- return __ccgo_ts + 2719
- case int32(223):
- return __ccgo_ts + 2724
- case int32(224):
- return __ccgo_ts + 2729
- case int32(225):
- return __ccgo_ts + 2734
- case int32(226):
- return __ccgo_ts + 2739
- case int32(227):
- return __ccgo_ts + 2744
- case int32(228):
- return __ccgo_ts + 2749
- case int32(229):
- return __ccgo_ts + 2754
- case int32(230):
- return __ccgo_ts + 2759
- case int32(231):
- return __ccgo_ts + 2764
- case int32(232):
- return __ccgo_ts + 2769
- case int32(233):
- return __ccgo_ts + 2774
- case int32(234):
- return __ccgo_ts + 2779
- case int32(235):
- return __ccgo_ts + 2784
- case int32(236):
- return __ccgo_ts + 2789
- case int32(237):
- return __ccgo_ts + 2794
- case int32(238):
- return __ccgo_ts + 2799
- case int32(239):
- return __ccgo_ts + 2804
- case int32(240):
- return __ccgo_ts + 2809
- case int32(241):
- return __ccgo_ts + 2814
- case int32(242):
- return __ccgo_ts + 2819
- case int32(243):
- return __ccgo_ts + 2824
- case int32(244):
- return __ccgo_ts + 2829
- case int32(245):
- return __ccgo_ts + 2834
- case int32(246):
- return __ccgo_ts + 2839
- case int32(247):
- return __ccgo_ts + 2844
- case int32(248):
- return __ccgo_ts + 2849
- case int32(249):
- return __ccgo_ts + 2854
- case int32(250):
- return __ccgo_ts + 2859
- case int32(251):
- return __ccgo_ts + 2864
- case int32(252):
- return __ccgo_ts + 2869
- case int32(253):
- return __ccgo_ts + 2874
- case int32(254):
- return __ccgo_ts + 2879
- case int32(255):
- return __ccgo_ts + 2884
- default:
- /* never gets here */
- return __ccgo_ts + 2889
- }
- /* never gets here */
- return r
- }
- func _getDebugLevel(tls *libc.TLS, variableName uintptr, defaultDebugLevel uint64) (r uint64) {
- bp := tls.Alloc(16)
- defer tls.Free(16)
- var debugLevel uint64
- var value, valueOrNull uintptr
- var _ /* afterValue at bp+0 */ uintptr
- _, _, _ = debugLevel, value, valueOrNull
- valueOrNull = libc.Xgetenv(tls, variableName)
- if valueOrNull == libc.UintptrFromInt32(0) {
- return defaultDebugLevel
- }
- value = valueOrNull
- *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = 0
- *(*uintptr)(unsafe.Pointer(bp)) = value
- debugLevel = libc.Xstrtoul(tls, value, bp, int32(10))
- if *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) != 0 || int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp))))) != int32('\000') {
- *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) = 0
- return defaultDebugLevel
- }
- return debugLevel
- }
- const m_ASCII_01 = 0x30
- const m_ASCII_11 = 0x31
- const m_ASCII_21 = 0x32
- const m_ASCII_31 = 0x33
- const m_ASCII_81 = 0x38
- const m_ASCII_91 = 0x39
- const m_ASCII_B1 = 66
- const m_ASCII_COLON1 = 0x3A
- const m_ASCII_COMMA1 = 0x2C
- const m_ASCII_EQUALS1 = 0x3D
- const m_ASCII_EXCL1 = 0x21
- const m_ASCII_FF1 = 0x0C
- const m_ASCII_G1 = 71
- const m_ASCII_HASH1 = 0x23
- const m_ASCII_LPAREN1 = 0x28
- const m_ASCII_P1 = 80
- const m_ASCII_PERIOD1 = 0x2E
- const m_ASCII_PIPE1 = 0x7C
- const m_ASCII_Q1 = 81
- const m_ASCII_RPAREN1 = 0x29
- const m_ASCII_SLASH1 = 0x2F
- const m_ASCII_U1 = 85
- const m_ASCII_a1 = 0x61
- const m_ASCII_c1 = 0x63
- const m_ASCII_e1 = 0x65
- const m_ASCII_g1 = 0x67
- const m_ASCII_h1 = 0x68
- const m_ASCII_l1 = 0x6C
- const m_ASCII_m1 = 0x6D
- const m_ASCII_n1 = 0x6E
- const m_ASCII_o1 = 0x6F
- const m_ASCII_p1 = 0x70
- const m_ASCII_r1 = 0x72
- const m_ASCII_s1 = 0x73
- const m_ASCII_t1 = 0x74
- const m_ASCII_w1 = 0x77
- const m_ASCII_x1 = 0x78
- const m_EXPAT_BILLION_LAUGHS_ATTACK_PROTECTION_MAXIMUM_AMPLIFICATION_DEFAULT1 = "100.0f"
- const m_INT_MAX1 = 0x7fffffff
- const m_UINT_MAX1 = 0xffffffff
- /*
- __ __ _
- ___\ \/ /_ __ __ _| |_
- / _ \\ /| '_ \ / _` | __|
- | __// \| |_) | (_| | |_
- \___/_/\_\ .__/ \__,_|\__|
- |_| XML parser
- Copyright (c) 1999-2000 Thai Open Source Software Center Ltd
- Copyright (c) 2000 Clark Cooper <coopercc@users.sourceforge.net>
- Copyright (c) 2002 Fred L. Drake, Jr. <fdrake@users.sourceforge.net>
- Copyright (c) 2007 Karl Waclawek <karl@waclawek.net>
- Copyright (c) 2017 Sebastian Pipping <sebastian@pipping.org>
- Licensed under the MIT license:
- Permission is hereby granted, free of charge, to any person obtaining
- a copy of this software and associated documentation files (the
- "Software"), to deal in the Software without restriction, including
- without limitation the rights to use, copy, modify, merge, publish,
- distribute, sublicense, and/or sell copies of the Software, and to permit
- persons to whom the Software is furnished to do so, subject to the
- following conditions:
- The above copyright notice and this permission notice shall be included
- in all copies or substantial portions of the Software.
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
- NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
- USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
- /* Doesn't check:
- that ,| are not mixed in a model group
- content of literals
- */
- var _KW_ANY = [4]int8{
- 0: int8(m_ASCII_A),
- 1: int8(m_ASCII_N),
- 2: int8(m_ASCII_Y),
- }
- var _KW_ATTLIST = [8]int8{
- 0: int8(m_ASCII_A),
- 1: int8(m_ASCII_T),
- 2: int8(m_ASCII_T),
- 3: int8(m_ASCII_L),
- 4: int8(m_ASCII_I),
- 5: int8(m_ASCII_S),
- 6: int8(m_ASCII_T),
- }
- var _KW_CDATA = [6]int8{
- 0: int8(m_ASCII_C),
- 1: int8(m_ASCII_D),
- 2: int8(m_ASCII_A),
- 3: int8(m_ASCII_T),
- 4: int8(m_ASCII_A),
- }
- var _KW_DOCTYPE = [8]int8{
- 0: int8(m_ASCII_D),
- 1: int8(m_ASCII_O),
- 2: int8(m_ASCII_C),
- 3: int8(m_ASCII_T),
- 4: int8(m_ASCII_Y),
- 5: int8(m_ASCII_P1),
- 6: int8(m_ASCII_E),
- }
- var _KW_ELEMENT = [8]int8{
- 0: int8(m_ASCII_E),
- 1: int8(m_ASCII_L),
- 2: int8(m_ASCII_E),
- 3: int8(m_ASCII_M),
- 4: int8(m_ASCII_E),
- 5: int8(m_ASCII_N),
- 6: int8(m_ASCII_T),
- }
- var _KW_EMPTY = [6]int8{
- 0: int8(m_ASCII_E),
- 1: int8(m_ASCII_M),
- 2: int8(m_ASCII_P1),
- 3: int8(m_ASCII_T),
- 4: int8(m_ASCII_Y),
- }
- var _KW_ENTITIES = [9]int8{
- 0: int8(m_ASCII_E),
- 1: int8(m_ASCII_N),
- 2: int8(m_ASCII_T),
- 3: int8(m_ASCII_I),
- 4: int8(m_ASCII_T),
- 5: int8(m_ASCII_I),
- 6: int8(m_ASCII_E),
- 7: int8(m_ASCII_S),
- }
- var _KW_ENTITY = [7]int8{
- 0: int8(m_ASCII_E),
- 1: int8(m_ASCII_N),
- 2: int8(m_ASCII_T),
- 3: int8(m_ASCII_I),
- 4: int8(m_ASCII_T),
- 5: int8(m_ASCII_Y),
- }
- var _KW_FIXED = [6]int8{
- 0: int8(m_ASCII_F),
- 1: int8(m_ASCII_I),
- 2: int8(m_ASCII_X),
- 3: int8(m_ASCII_E),
- 4: int8(m_ASCII_D),
- }
- var _KW_ID = [3]int8{
- 0: int8(m_ASCII_I),
- 1: int8(m_ASCII_D),
- }
- var _KW_IDREF = [6]int8{
- 0: int8(m_ASCII_I),
- 1: int8(m_ASCII_D),
- 2: int8(m_ASCII_R),
- 3: int8(m_ASCII_E),
- 4: int8(m_ASCII_F),
- }
- var _KW_IDREFS = [7]int8{
- 0: int8(m_ASCII_I),
- 1: int8(m_ASCII_D),
- 2: int8(m_ASCII_R),
- 3: int8(m_ASCII_E),
- 4: int8(m_ASCII_F),
- 5: int8(m_ASCII_S),
- }
- var _KW_IGNORE = [7]int8{
- 0: int8(m_ASCII_I),
- 1: int8(m_ASCII_G1),
- 2: int8(m_ASCII_N),
- 3: int8(m_ASCII_O),
- 4: int8(m_ASCII_R),
- 5: int8(m_ASCII_E),
- }
- var _KW_IMPLIED = [8]int8{
- 0: int8(m_ASCII_I),
- 1: int8(m_ASCII_M),
- 2: int8(m_ASCII_P1),
- 3: int8(m_ASCII_L),
- 4: int8(m_ASCII_I),
- 5: int8(m_ASCII_E),
- 6: int8(m_ASCII_D),
- }
- var _KW_INCLUDE = [8]int8{
- 0: int8(m_ASCII_I),
- 1: int8(m_ASCII_N),
- 2: int8(m_ASCII_C),
- 3: int8(m_ASCII_L),
- 4: int8(m_ASCII_U1),
- 5: int8(m_ASCII_D),
- 6: int8(m_ASCII_E),
- }
- var _KW_NDATA = [6]int8{
- 0: int8(m_ASCII_N),
- 1: int8(m_ASCII_D),
- 2: int8(m_ASCII_A),
- 3: int8(m_ASCII_T),
- 4: int8(m_ASCII_A),
- }
- var _KW_NMTOKEN = [8]int8{
- 0: int8(m_ASCII_N),
- 1: int8(m_ASCII_M),
- 2: int8(m_ASCII_T),
- 3: int8(m_ASCII_O),
- 4: int8(m_ASCII_K),
- 5: int8(m_ASCII_E),
- 6: int8(m_ASCII_N),
- }
- var _KW_NMTOKENS = [9]int8{
- 0: int8(m_ASCII_N),
- 1: int8(m_ASCII_M),
- 2: int8(m_ASCII_T),
- 3: int8(m_ASCII_O),
- 4: int8(m_ASCII_K),
- 5: int8(m_ASCII_E),
- 6: int8(m_ASCII_N),
- 7: int8(m_ASCII_S),
- }
- var _KW_NOTATION = [9]int8{
- 0: int8(m_ASCII_N),
- 1: int8(m_ASCII_O),
- 2: int8(m_ASCII_T),
- 3: int8(m_ASCII_A),
- 4: int8(m_ASCII_T),
- 5: int8(m_ASCII_I),
- 6: int8(m_ASCII_O),
- 7: int8(m_ASCII_N),
- }
- var _KW_PCDATA = [7]int8{
- 0: int8(m_ASCII_P1),
- 1: int8(m_ASCII_C),
- 2: int8(m_ASCII_D),
- 3: int8(m_ASCII_A),
- 4: int8(m_ASCII_T),
- 5: int8(m_ASCII_A),
- }
- var _KW_PUBLIC = [7]int8{
- 0: int8(m_ASCII_P1),
- 1: int8(m_ASCII_U1),
- 2: int8(m_ASCII_B1),
- 3: int8(m_ASCII_L),
- 4: int8(m_ASCII_I),
- 5: int8(m_ASCII_C),
- }
- var _KW_REQUIRED = [9]int8{
- 0: int8(m_ASCII_R),
- 1: int8(m_ASCII_E),
- 2: int8(m_ASCII_Q1),
- 3: int8(m_ASCII_U1),
- 4: int8(m_ASCII_I),
- 5: int8(m_ASCII_R),
- 6: int8(m_ASCII_E),
- 7: int8(m_ASCII_D),
- }
- var _KW_SYSTEM = [7]int8{
- 0: int8(m_ASCII_S),
- 1: int8(m_ASCII_Y),
- 2: int8(m_ASCII_S),
- 3: int8(m_ASCII_T),
- 4: int8(m_ASCII_E),
- 5: int8(m_ASCII_M),
- }
- func _prolog0(tls *libc.TLS, state uintptr, tok int32, ptr uintptr, end uintptr, enc uintptr) (r int32) {
- switch tok {
- case int32(m_XML_TOK_PROLOG_S):
- (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_prolog1)
- return int32(_XML_ROLE_NONE)
- case int32(m_XML_TOK_XML_DECL):
- (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_prolog1)
- return int32(_XML_ROLE_XML_DECL)
- case int32(m_XML_TOK_PI):
- (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_prolog1)
- return int32(_XML_ROLE_PI)
- case int32(m_XML_TOK_COMMENT):
- (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_prolog1)
- return int32(_XML_ROLE_COMMENT)
- case int32(m_XML_TOK_BOM):
- return int32(_XML_ROLE_NONE)
- case int32(m_XML_TOK_DECL_OPEN):
- 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) {
- break
- }
- (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_doctype0)
- return int32(_XML_ROLE_DOCTYPE_NONE)
- case int32(m_XML_TOK_INSTANCE_START):
- (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_error)
- return int32(_XML_ROLE_INSTANCE_START)
- }
- return _common(tls, state, tok)
- }
- func _prolog1(tls *libc.TLS, state uintptr, tok int32, ptr uintptr, end uintptr, enc uintptr) (r int32) {
- switch tok {
- case int32(m_XML_TOK_PROLOG_S):
- return int32(_XML_ROLE_NONE)
- case int32(m_XML_TOK_PI):
- return int32(_XML_ROLE_PI)
- case int32(m_XML_TOK_COMMENT):
- return int32(_XML_ROLE_COMMENT)
- case int32(m_XML_TOK_BOM):
- /* This case can never arise. To reach this role function, the
- * parse must have passed through prolog0 and therefore have had
- * some form of input, even if only a space. At that point, a
- * byte order mark is no longer a valid character (though
- * technically it should be interpreted as a non-breaking space),
- * so will be rejected by the tokenizing stages.
- */
- return int32(_XML_ROLE_NONE) /* LCOV_EXCL_LINE */
- case int32(m_XML_TOK_DECL_OPEN):
- 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) {
- break
- }
- (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_doctype0)
- return int32(_XML_ROLE_DOCTYPE_NONE)
- case int32(m_XML_TOK_INSTANCE_START):
- (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_error)
- return int32(_XML_ROLE_INSTANCE_START)
- }
- return _common(tls, state, tok)
- }
- func _prolog2(tls *libc.TLS, state uintptr, tok int32, ptr uintptr, end uintptr, enc uintptr) (r int32) {
- _ = ptr
- _ = end
- _ = enc
- switch tok {
- case int32(m_XML_TOK_PROLOG_S):
- return int32(_XML_ROLE_NONE)
- case int32(m_XML_TOK_PI):
- return int32(_XML_ROLE_PI)
- case int32(m_XML_TOK_COMMENT):
- return int32(_XML_ROLE_COMMENT)
- case int32(m_XML_TOK_INSTANCE_START):
- (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_error)
- return int32(_XML_ROLE_INSTANCE_START)
- }
- return _common(tls, state, tok)
- }
- func _doctype0(tls *libc.TLS, state uintptr, tok int32, ptr uintptr, end uintptr, enc uintptr) (r int32) {
- _ = ptr
- _ = end
- _ = enc
- switch tok {
- case int32(m_XML_TOK_PROLOG_S):
- return int32(_XML_ROLE_DOCTYPE_NONE)
- case int32(m_XML_TOK_NAME):
- fallthrough
- case int32(m_XML_TOK_PREFIXED_NAME):
- (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_doctype1)
- return int32(_XML_ROLE_DOCTYPE_NAME)
- }
- return _common(tls, state, tok)
- }
- func _doctype1(tls *libc.TLS, state uintptr, tok int32, ptr uintptr, end uintptr, enc uintptr) (r int32) {
- switch tok {
- case int32(m_XML_TOK_PROLOG_S):
- return int32(_XML_ROLE_DOCTYPE_NONE)
- case int32(m_XML_TOK_OPEN_BRACKET):
- (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_internalSubset)
- return int32(_XML_ROLE_DOCTYPE_INTERNAL_SUBSET)
- case int32(m_XML_TOK_DECL_CLOSE):
- (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_prolog2)
- return int32(_XML_ROLE_DOCTYPE_CLOSE)
- case int32(m_XML_TOK_NAME):
- 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 {
- (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_doctype3)
- return int32(_XML_ROLE_DOCTYPE_NONE)
- }
- 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 {
- (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_doctype2)
- return int32(_XML_ROLE_DOCTYPE_NONE)
- }
- break
- }
- return _common(tls, state, tok)
- }
- func _doctype2(tls *libc.TLS, state uintptr, tok int32, ptr uintptr, end uintptr, enc uintptr) (r int32) {
- _ = ptr
- _ = end
- _ = enc
- switch tok {
- case int32(m_XML_TOK_PROLOG_S):
- return int32(_XML_ROLE_DOCTYPE_NONE)
- case int32(m_XML_TOK_LITERAL):
- (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_doctype3)
- return int32(_XML_ROLE_DOCTYPE_PUBLIC_ID)
- }
- return _common(tls, state, tok)
- }
- func _doctype3(tls *libc.TLS, state uintptr, tok int32, ptr uintptr, end uintptr, enc uintptr) (r int32) {
- _ = ptr
- _ = end
- _ = enc
- switch tok {
- case int32(m_XML_TOK_PROLOG_S):
- return int32(_XML_ROLE_DOCTYPE_NONE)
- case int32(m_XML_TOK_LITERAL):
- (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_doctype4)
- return int32(_XML_ROLE_DOCTYPE_SYSTEM_ID)
- }
- return _common(tls, state, tok)
- }
- func _doctype4(tls *libc.TLS, state uintptr, tok int32, ptr uintptr, end uintptr, enc uintptr) (r int32) {
- _ = ptr
- _ = end
- _ = enc
- switch tok {
- case int32(m_XML_TOK_PROLOG_S):
- return int32(_XML_ROLE_DOCTYPE_NONE)
- case int32(m_XML_TOK_OPEN_BRACKET):
- (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_internalSubset)
- return int32(_XML_ROLE_DOCTYPE_INTERNAL_SUBSET)
- case int32(m_XML_TOK_DECL_CLOSE):
- (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_prolog2)
- return int32(_XML_ROLE_DOCTYPE_CLOSE)
- }
- return _common(tls, state, tok)
- }
- func _doctype5(tls *libc.TLS, state uintptr, tok int32, ptr uintptr, end uintptr, enc uintptr) (r int32) {
- _ = ptr
- _ = end
- _ = enc
- switch tok {
- case int32(m_XML_TOK_PROLOG_S):
- return int32(_XML_ROLE_DOCTYPE_NONE)
- case int32(m_XML_TOK_DECL_CLOSE):
- (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_prolog2)
- return int32(_XML_ROLE_DOCTYPE_CLOSE)
- }
- return _common(tls, state, tok)
- }
- func _internalSubset(tls *libc.TLS, state uintptr, tok int32, ptr uintptr, end uintptr, enc uintptr) (r int32) {
- switch tok {
- case int32(m_XML_TOK_PROLOG_S):
- return int32(_XML_ROLE_NONE)
- case int32(m_XML_TOK_DECL_OPEN):
- 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 {
- (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_entity0)
- return int32(_XML_ROLE_ENTITY_NONE)
- }
- 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 {
- (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_attlist0)
- return int32(_XML_ROLE_ATTLIST_NONE)
- }
- 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 {
- (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_element0)
- return int32(_XML_ROLE_ELEMENT_NONE)
- }
- 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 {
- (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_notation0)
- return int32(_XML_ROLE_NOTATION_NONE)
- }
- case int32(m_XML_TOK_PI):
- return int32(_XML_ROLE_PI)
- case int32(m_XML_TOK_COMMENT):
- return int32(_XML_ROLE_COMMENT)
- case int32(m_XML_TOK_PARAM_ENTITY_REF):
- return int32(_XML_ROLE_PARAM_ENTITY_REF)
- case int32(m_XML_TOK_CLOSE_BRACKET):
- (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_doctype5)
- return int32(_XML_ROLE_DOCTYPE_NONE)
- case -int32(4):
- return int32(_XML_ROLE_NONE)
- }
- return _common(tls, state, tok)
- }
- func _externalSubset0(tls *libc.TLS, state uintptr, tok int32, ptr uintptr, end uintptr, enc uintptr) (r int32) {
- (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_externalSubset1)
- if tok == int32(m_XML_TOK_XML_DECL) {
- return int32(_XML_ROLE_TEXT_DECL)
- }
- return _externalSubset1(tls, state, tok, ptr, end, enc)
- }
- func _externalSubset1(tls *libc.TLS, state uintptr, tok int32, ptr uintptr, end uintptr, enc uintptr) (r int32) {
- switch tok {
- case int32(m_XML_TOK_COND_SECT_OPEN):
- (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_condSect0)
- return int32(_XML_ROLE_NONE)
- case int32(m_XML_TOK_COND_SECT_CLOSE):
- if (*TPROLOG_STATE)(unsafe.Pointer(state)).FincludeLevel == uint32(0) {
- break
- }
- *(*uint32)(unsafe.Pointer(state + 16)) -= uint32(1)
- return int32(_XML_ROLE_NONE)
- case int32(m_XML_TOK_PROLOG_S):
- return int32(_XML_ROLE_NONE)
- case int32(m_XML_TOK_CLOSE_BRACKET):
- case -int32(4):
- if (*TPROLOG_STATE)(unsafe.Pointer(state)).FincludeLevel != 0 {
- break
- }
- return int32(_XML_ROLE_NONE)
- default:
- return _internalSubset(tls, state, tok, ptr, end, enc)
- }
- return _common(tls, state, tok)
- }
- func _entity0(tls *libc.TLS, state uintptr, tok int32, ptr uintptr, end uintptr, enc uintptr) (r int32) {
- _ = ptr
- _ = end
- _ = enc
- switch tok {
- case int32(m_XML_TOK_PROLOG_S):
- return int32(_XML_ROLE_ENTITY_NONE)
- case int32(m_XML_TOK_PERCENT):
- (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_entity1)
- return int32(_XML_ROLE_ENTITY_NONE)
- case int32(m_XML_TOK_NAME):
- (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_entity2)
- return int32(_XML_ROLE_GENERAL_ENTITY_NAME)
- }
- return _common(tls, state, tok)
- }
- func _entity1(tls *libc.TLS, state uintptr, tok int32, ptr uintptr, end uintptr, enc uintptr) (r int32) {
- _ = ptr
- _ = end
- _ = enc
- switch tok {
- case int32(m_XML_TOK_PROLOG_S):
- return int32(_XML_ROLE_ENTITY_NONE)
- case int32(m_XML_TOK_NAME):
- (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_entity7)
- return int32(_XML_ROLE_PARAM_ENTITY_NAME)
- }
- return _common(tls, state, tok)
- }
- func _entity2(tls *libc.TLS, state uintptr, tok int32, ptr uintptr, end uintptr, enc uintptr) (r int32) {
- switch tok {
- case int32(m_XML_TOK_PROLOG_S):
- return int32(_XML_ROLE_ENTITY_NONE)
- case int32(m_XML_TOK_NAME):
- 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 {
- (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_entity4)
- return int32(_XML_ROLE_ENTITY_NONE)
- }
- 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 {
- (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_entity3)
- return int32(_XML_ROLE_ENTITY_NONE)
- }
- case int32(m_XML_TOK_LITERAL):
- (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_declClose)
- (*TPROLOG_STATE)(unsafe.Pointer(state)).Frole_none = int32(_XML_ROLE_ENTITY_NONE)
- return int32(_XML_ROLE_ENTITY_VALUE)
- }
- return _common(tls, state, tok)
- }
- func _entity3(tls *libc.TLS, state uintptr, tok int32, ptr uintptr, end uintptr, enc uintptr) (r int32) {
- _ = ptr
- _ = end
- _ = enc
- switch tok {
- case int32(m_XML_TOK_PROLOG_S):
- return int32(_XML_ROLE_ENTITY_NONE)
- case int32(m_XML_TOK_LITERAL):
- (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_entity4)
- return int32(_XML_ROLE_ENTITY_PUBLIC_ID)
- }
- return _common(tls, state, tok)
- }
- func _entity4(tls *libc.TLS, state uintptr, tok int32, ptr uintptr, end uintptr, enc uintptr) (r int32) {
- _ = ptr
- _ = end
- _ = enc
- switch tok {
- case int32(m_XML_TOK_PROLOG_S):
- return int32(_XML_ROLE_ENTITY_NONE)
- case int32(m_XML_TOK_LITERAL):
- (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_entity5)
- return int32(_XML_ROLE_ENTITY_SYSTEM_ID)
- }
- return _common(tls, state, tok)
- }
- func _entity5(tls *libc.TLS, state uintptr, tok int32, ptr uintptr, end uintptr, enc uintptr) (r int32) {
- var v1 uintptr
- _ = v1
- switch tok {
- case int32(m_XML_TOK_PROLOG_S):
- return int32(_XML_ROLE_ENTITY_NONE)
- case int32(m_XML_TOK_DECL_CLOSE):
- if (*TPROLOG_STATE)(unsafe.Pointer(state)).FdocumentEntity != 0 {
- v1 = __ccgo_fp(_internalSubset)
- } else {
- v1 = __ccgo_fp(_externalSubset1)
- }
- (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = v1
- return int32(_XML_ROLE_ENTITY_COMPLETE)
- case int32(m_XML_TOK_NAME):
- 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 {
- (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_entity6)
- return int32(_XML_ROLE_ENTITY_NONE)
- }
- break
- }
- return _common(tls, state, tok)
- }
- func _entity6(tls *libc.TLS, state uintptr, tok int32, ptr uintptr, end uintptr, enc uintptr) (r int32) {
- _ = ptr
- _ = end
- _ = enc
- switch tok {
- case int32(m_XML_TOK_PROLOG_S):
- return int32(_XML_ROLE_ENTITY_NONE)
- case int32(m_XML_TOK_NAME):
- (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_declClose)
- (*TPROLOG_STATE)(unsafe.Pointer(state)).Frole_none = int32(_XML_ROLE_ENTITY_NONE)
- return int32(_XML_ROLE_ENTITY_NOTATION_NAME)
- }
- return _common(tls, state, tok)
- }
- func _entity7(tls *libc.TLS, state uintptr, tok int32, ptr uintptr, end uintptr, enc uintptr) (r int32) {
- switch tok {
- case int32(m_XML_TOK_PROLOG_S):
- return int32(_XML_ROLE_ENTITY_NONE)
- case int32(m_XML_TOK_NAME):
- 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 {
- (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_entity9)
- return int32(_XML_ROLE_ENTITY_NONE)
- }
- 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 {
- (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_entity8)
- return int32(_XML_ROLE_ENTITY_NONE)
- }
- case int32(m_XML_TOK_LITERAL):
- (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_declClose)
- (*TPROLOG_STATE)(unsafe.Pointer(state)).Frole_none = int32(_XML_ROLE_ENTITY_NONE)
- return int32(_XML_ROLE_ENTITY_VALUE)
- }
- return _common(tls, state, tok)
- }
- func _entity8(tls *libc.TLS, state uintptr, tok int32, ptr uintptr, end uintptr, enc uintptr) (r int32) {
- _ = ptr
- _ = end
- _ = enc
- switch tok {
- case int32(m_XML_TOK_PROLOG_S):
- return int32(_XML_ROLE_ENTITY_NONE)
- case int32(m_XML_TOK_LITERAL):
- (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_entity9)
- return int32(_XML_ROLE_ENTITY_PUBLIC_ID)
- }
- return _common(tls, state, tok)
- }
- func _entity9(tls *libc.TLS, state uintptr, tok int32, ptr uintptr, end uintptr, enc uintptr) (r int32) {
- _ = ptr
- _ = end
- _ = enc
- switch tok {
- case int32(m_XML_TOK_PROLOG_S):
- return int32(_XML_ROLE_ENTITY_NONE)
- case int32(m_XML_TOK_LITERAL):
- (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_entity10)
- return int32(_XML_ROLE_ENTITY_SYSTEM_ID)
- }
- return _common(tls, state, tok)
- }
- func _entity10(tls *libc.TLS, state uintptr, tok int32, ptr uintptr, end uintptr, enc uintptr) (r int32) {
- var v1 uintptr
- _ = v1
- _ = ptr
- _ = end
- _ = enc
- switch tok {
- case int32(m_XML_TOK_PROLOG_S):
- return int32(_XML_ROLE_ENTITY_NONE)
- case int32(m_XML_TOK_DECL_CLOSE):
- if (*TPROLOG_STATE)(unsafe.Pointer(state)).FdocumentEntity != 0 {
- v1 = __ccgo_fp(_internalSubset)
- } else {
- v1 = __ccgo_fp(_externalSubset1)
- }
- (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = v1
- return int32(_XML_ROLE_ENTITY_COMPLETE)
- }
- return _common(tls, state, tok)
- }
- func _notation0(tls *libc.TLS, state uintptr, tok int32, ptr uintptr, end uintptr, enc uintptr) (r int32) {
- _ = ptr
- _ = end
- _ = enc
- switch tok {
- case int32(m_XML_TOK_PROLOG_S):
- return int32(_XML_ROLE_NOTATION_NONE)
- case int32(m_XML_TOK_NAME):
- (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_notation1)
- return int32(_XML_ROLE_NOTATION_NAME)
- }
- return _common(tls, state, tok)
- }
- func _notation1(tls *libc.TLS, state uintptr, tok int32, ptr uintptr, end uintptr, enc uintptr) (r int32) {
- switch tok {
- case int32(m_XML_TOK_PROLOG_S):
- return int32(_XML_ROLE_NOTATION_NONE)
- case int32(m_XML_TOK_NAME):
- 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 {
- (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_notation3)
- return int32(_XML_ROLE_NOTATION_NONE)
- }
- 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 {
- (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_notation2)
- return int32(_XML_ROLE_NOTATION_NONE)
- }
- break
- }
- return _common(tls, state, tok)
- }
- func _notation2(tls *libc.TLS, state uintptr, tok int32, ptr uintptr, end uintptr, enc uintptr) (r int32) {
- _ = ptr
- _ = end
- _ = enc
- switch tok {
- case int32(m_XML_TOK_PROLOG_S):
- return int32(_XML_ROLE_NOTATION_NONE)
- case int32(m_XML_TOK_LITERAL):
- (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_notation4)
- return int32(_XML_ROLE_NOTATION_PUBLIC_ID)
- }
- return _common(tls, state, tok)
- }
- func _notation3(tls *libc.TLS, state uintptr, tok int32, ptr uintptr, end uintptr, enc uintptr) (r int32) {
- _ = ptr
- _ = end
- _ = enc
- switch tok {
- case int32(m_XML_TOK_PROLOG_S):
- return int32(_XML_ROLE_NOTATION_NONE)
- case int32(m_XML_TOK_LITERAL):
- (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_declClose)
- (*TPROLOG_STATE)(unsafe.Pointer(state)).Frole_none = int32(_XML_ROLE_NOTATION_NONE)
- return int32(_XML_ROLE_NOTATION_SYSTEM_ID)
- }
- return _common(tls, state, tok)
- }
- func _notation4(tls *libc.TLS, state uintptr, tok int32, ptr uintptr, end uintptr, enc uintptr) (r int32) {
- var v1 uintptr
- _ = v1
- _ = ptr
- _ = end
- _ = enc
- switch tok {
- case int32(m_XML_TOK_PROLOG_S):
- return int32(_XML_ROLE_NOTATION_NONE)
- case int32(m_XML_TOK_LITERAL):
- (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_declClose)
- (*TPROLOG_STATE)(unsafe.Pointer(state)).Frole_none = int32(_XML_ROLE_NOTATION_NONE)
- return int32(_XML_ROLE_NOTATION_SYSTEM_ID)
- case int32(m_XML_TOK_DECL_CLOSE):
- if (*TPROLOG_STATE)(unsafe.Pointer(state)).FdocumentEntity != 0 {
- v1 = __ccgo_fp(_internalSubset)
- } else {
- v1 = __ccgo_fp(_externalSubset1)
- }
- (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = v1
- return int32(_XML_ROLE_NOTATION_NO_SYSTEM_ID)
- }
- return _common(tls, state, tok)
- }
- func _attlist0(tls *libc.TLS, state uintptr, tok int32, ptr uintptr, end uintptr, enc uintptr) (r int32) {
- _ = ptr
- _ = end
- _ = enc
- switch tok {
- case int32(m_XML_TOK_PROLOG_S):
- return int32(_XML_ROLE_ATTLIST_NONE)
- case int32(m_XML_TOK_NAME):
- fallthrough
- case int32(m_XML_TOK_PREFIXED_NAME):
- (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_attlist1)
- return int32(_XML_ROLE_ATTLIST_ELEMENT_NAME)
- }
- return _common(tls, state, tok)
- }
- func _attlist1(tls *libc.TLS, state uintptr, tok int32, ptr uintptr, end uintptr, enc uintptr) (r int32) {
- var v1 uintptr
- _ = v1
- _ = ptr
- _ = end
- _ = enc
- switch tok {
- case int32(m_XML_TOK_PROLOG_S):
- return int32(_XML_ROLE_ATTLIST_NONE)
- case int32(m_XML_TOK_DECL_CLOSE):
- if (*TPROLOG_STATE)(unsafe.Pointer(state)).FdocumentEntity != 0 {
- v1 = __ccgo_fp(_internalSubset)
- } else {
- v1 = __ccgo_fp(_externalSubset1)
- }
- (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = v1
- return int32(_XML_ROLE_ATTLIST_NONE)
- case int32(m_XML_TOK_NAME):
- fallthrough
- case int32(m_XML_TOK_PREFIXED_NAME):
- (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_attlist2)
- return int32(_XML_ROLE_ATTRIBUTE_NAME)
- }
- return _common(tls, state, tok)
- }
- func _attlist2(tls *libc.TLS, state uintptr, tok int32, ptr uintptr, end uintptr, enc uintptr) (r int32) {
- var i int32
- _ = i
- switch tok {
- case int32(m_XML_TOK_PROLOG_S):
- return int32(_XML_ROLE_ATTLIST_NONE)
- case int32(m_XML_TOK_NAME):
- i = 0
- for {
- if !(i < libc.Int32FromUint64(libc.Uint64FromInt64(64)/libc.Uint64FromInt64(8))) {
- break
- }
- 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 {
- (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_attlist8)
- return int32(_XML_ROLE_ATTRIBUTE_TYPE_CDATA) + i
- }
- goto _1
- _1:
- ;
- i++
- }
- 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 {
- (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_attlist5)
- return int32(_XML_ROLE_ATTLIST_NONE)
- }
- case int32(m_XML_TOK_OPEN_PAREN):
- (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_attlist3)
- return int32(_XML_ROLE_ATTLIST_NONE)
- }
- return _common(tls, state, tok)
- }
- var _types = [8]uintptr{
- 0: uintptr(unsafe.Pointer(&_KW_CDATA)),
- 1: uintptr(unsafe.Pointer(&_KW_ID)),
- 2: uintptr(unsafe.Pointer(&_KW_IDREF)),
- 3: uintptr(unsafe.Pointer(&_KW_IDREFS)),
- 4: uintptr(unsafe.Pointer(&_KW_ENTITY)),
- 5: uintptr(unsafe.Pointer(&_KW_ENTITIES)),
- 6: uintptr(unsafe.Pointer(&_KW_NMTOKEN)),
- 7: uintptr(unsafe.Pointer(&_KW_NMTOKENS)),
- }
- func _attlist3(tls *libc.TLS, state uintptr, tok int32, ptr uintptr, end uintptr, enc uintptr) (r int32) {
- _ = ptr
- _ = end
- _ = enc
- switch tok {
- case int32(m_XML_TOK_PROLOG_S):
- return int32(_XML_ROLE_ATTLIST_NONE)
- case int32(m_XML_TOK_NMTOKEN):
- fallthrough
- case int32(m_XML_TOK_NAME):
- fallthrough
- case int32(m_XML_TOK_PREFIXED_NAME):
- (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_attlist4)
- return int32(_XML_ROLE_ATTRIBUTE_ENUM_VALUE)
- }
- return _common(tls, state, tok)
- }
- func _attlist4(tls *libc.TLS, state uintptr, tok int32, ptr uintptr, end uintptr, enc uintptr) (r int32) {
- _ = ptr
- _ = end
- _ = enc
- switch tok {
- case int32(m_XML_TOK_PROLOG_S):
- return int32(_XML_ROLE_ATTLIST_NONE)
- case int32(m_XML_TOK_CLOSE_PAREN):
- (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_attlist8)
- return int32(_XML_ROLE_ATTLIST_NONE)
- case int32(m_XML_TOK_OR):
- (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_attlist3)
- return int32(_XML_ROLE_ATTLIST_NONE)
- }
- return _common(tls, state, tok)
- }
- func _attlist5(tls *libc.TLS, state uintptr, tok int32, ptr uintptr, end uintptr, enc uintptr) (r int32) {
- _ = ptr
- _ = end
- _ = enc
- switch tok {
- case int32(m_XML_TOK_PROLOG_S):
- return int32(_XML_ROLE_ATTLIST_NONE)
- case int32(m_XML_TOK_OPEN_PAREN):
- (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_attlist6)
- return int32(_XML_ROLE_ATTLIST_NONE)
- }
- return _common(tls, state, tok)
- }
- func _attlist6(tls *libc.TLS, state uintptr, tok int32, ptr uintptr, end uintptr, enc uintptr) (r int32) {
- _ = ptr
- _ = end
- _ = enc
- switch tok {
- case int32(m_XML_TOK_PROLOG_S):
- return int32(_XML_ROLE_ATTLIST_NONE)
- case int32(m_XML_TOK_NAME):
- (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_attlist7)
- return int32(_XML_ROLE_ATTRIBUTE_NOTATION_VALUE)
- }
- return _common(tls, state, tok)
- }
- func _attlist7(tls *libc.TLS, state uintptr, tok int32, ptr uintptr, end uintptr, enc uintptr) (r int32) {
- _ = ptr
- _ = end
- _ = enc
- switch tok {
- case int32(m_XML_TOK_PROLOG_S):
- return int32(_XML_ROLE_ATTLIST_NONE)
- case int32(m_XML_TOK_CLOSE_PAREN):
- (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_attlist8)
- return int32(_XML_ROLE_ATTLIST_NONE)
- case int32(m_XML_TOK_OR):
- (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_attlist6)
- return int32(_XML_ROLE_ATTLIST_NONE)
- }
- return _common(tls, state, tok)
- }
- // C documentation
- //
- // /* default value */
- func _attlist8(tls *libc.TLS, state uintptr, tok int32, ptr uintptr, end uintptr, enc uintptr) (r int32) {
- switch tok {
- case int32(m_XML_TOK_PROLOG_S):
- return int32(_XML_ROLE_ATTLIST_NONE)
- case int32(m_XML_TOK_POUND_NAME):
- 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 {
- (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_attlist1)
- return int32(_XML_ROLE_IMPLIED_ATTRIBUTE_VALUE)
- }
- 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 {
- (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_attlist1)
- return int32(_XML_ROLE_REQUIRED_ATTRIBUTE_VALUE)
- }
- 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 {
- (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_attlist9)
- return int32(_XML_ROLE_ATTLIST_NONE)
- }
- case int32(m_XML_TOK_LITERAL):
- (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_attlist1)
- return int32(_XML_ROLE_DEFAULT_ATTRIBUTE_VALUE)
- }
- return _common(tls, state, tok)
- }
- func _attlist9(tls *libc.TLS, state uintptr, tok int32, ptr uintptr, end uintptr, enc uintptr) (r int32) {
- _ = ptr
- _ = end
- _ = enc
- switch tok {
- case int32(m_XML_TOK_PROLOG_S):
- return int32(_XML_ROLE_ATTLIST_NONE)
- case int32(m_XML_TOK_LITERAL):
- (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_attlist1)
- return int32(_XML_ROLE_FIXED_ATTRIBUTE_VALUE)
- }
- return _common(tls, state, tok)
- }
- func _element0(tls *libc.TLS, state uintptr, tok int32, ptr uintptr, end uintptr, enc uintptr) (r int32) {
- _ = ptr
- _ = end
- _ = enc
- switch tok {
- case int32(m_XML_TOK_PROLOG_S):
- return int32(_XML_ROLE_ELEMENT_NONE)
- case int32(m_XML_TOK_NAME):
- fallthrough
- case int32(m_XML_TOK_PREFIXED_NAME):
- (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_element1)
- return int32(_XML_ROLE_ELEMENT_NAME)
- }
- return _common(tls, state, tok)
- }
- func _element1(tls *libc.TLS, state uintptr, tok int32, ptr uintptr, end uintptr, enc uintptr) (r int32) {
- switch tok {
- case int32(m_XML_TOK_PROLOG_S):
- return int32(_XML_ROLE_ELEMENT_NONE)
- case int32(m_XML_TOK_NAME):
- 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 {
- (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_declClose)
- (*TPROLOG_STATE)(unsafe.Pointer(state)).Frole_none = int32(_XML_ROLE_ELEMENT_NONE)
- return int32(_XML_ROLE_CONTENT_EMPTY)
- }
- 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 {
- (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_declClose)
- (*TPROLOG_STATE)(unsafe.Pointer(state)).Frole_none = int32(_XML_ROLE_ELEMENT_NONE)
- return int32(_XML_ROLE_CONTENT_ANY)
- }
- case int32(m_XML_TOK_OPEN_PAREN):
- (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_element2)
- (*TPROLOG_STATE)(unsafe.Pointer(state)).Flevel = uint32(1)
- return int32(_XML_ROLE_GROUP_OPEN)
- }
- return _common(tls, state, tok)
- }
- func _element2(tls *libc.TLS, state uintptr, tok int32, ptr uintptr, end uintptr, enc uintptr) (r int32) {
- switch tok {
- case int32(m_XML_TOK_PROLOG_S):
- return int32(_XML_ROLE_ELEMENT_NONE)
- case int32(m_XML_TOK_POUND_NAME):
- 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 {
- (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_element3)
- return int32(_XML_ROLE_CONTENT_PCDATA)
- }
- case int32(m_XML_TOK_OPEN_PAREN):
- (*TPROLOG_STATE)(unsafe.Pointer(state)).Flevel = uint32(2)
- (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_element6)
- return int32(_XML_ROLE_GROUP_OPEN)
- case int32(m_XML_TOK_NAME):
- fallthrough
- case int32(m_XML_TOK_PREFIXED_NAME):
- (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_element7)
- return int32(_XML_ROLE_CONTENT_ELEMENT)
- case int32(m_XML_TOK_NAME_QUESTION):
- (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_element7)
- return int32(_XML_ROLE_CONTENT_ELEMENT_OPT)
- case int32(m_XML_TOK_NAME_ASTERISK):
- (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_element7)
- return int32(_XML_ROLE_CONTENT_ELEMENT_REP)
- case int32(m_XML_TOK_NAME_PLUS):
- (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_element7)
- return int32(_XML_ROLE_CONTENT_ELEMENT_PLUS)
- }
- return _common(tls, state, tok)
- }
- func _element3(tls *libc.TLS, state uintptr, tok int32, ptr uintptr, end uintptr, enc uintptr) (r int32) {
- _ = ptr
- _ = end
- _ = enc
- switch tok {
- case int32(m_XML_TOK_PROLOG_S):
- return int32(_XML_ROLE_ELEMENT_NONE)
- case int32(m_XML_TOK_CLOSE_PAREN):
- (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_declClose)
- (*TPROLOG_STATE)(unsafe.Pointer(state)).Frole_none = int32(_XML_ROLE_ELEMENT_NONE)
- return int32(_XML_ROLE_GROUP_CLOSE)
- case int32(m_XML_TOK_CLOSE_PAREN_ASTERISK):
- (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_declClose)
- (*TPROLOG_STATE)(unsafe.Pointer(state)).Frole_none = int32(_XML_ROLE_ELEMENT_NONE)
- return int32(_XML_ROLE_GROUP_CLOSE_REP)
- case int32(m_XML_TOK_OR):
- (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_element4)
- return int32(_XML_ROLE_ELEMENT_NONE)
- }
- return _common(tls, state, tok)
- }
- func _element4(tls *libc.TLS, state uintptr, tok int32, ptr uintptr, end uintptr, enc uintptr) (r int32) {
- _ = ptr
- _ = end
- _ = enc
- switch tok {
- case int32(m_XML_TOK_PROLOG_S):
- return int32(_XML_ROLE_ELEMENT_NONE)
- case int32(m_XML_TOK_NAME):
- fallthrough
- case int32(m_XML_TOK_PREFIXED_NAME):
- (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_element5)
- return int32(_XML_ROLE_CONTENT_ELEMENT)
- }
- return _common(tls, state, tok)
- }
- func _element5(tls *libc.TLS, state uintptr, tok int32, ptr uintptr, end uintptr, enc uintptr) (r int32) {
- _ = ptr
- _ = end
- _ = enc
- switch tok {
- case int32(m_XML_TOK_PROLOG_S):
- return int32(_XML_ROLE_ELEMENT_NONE)
- case int32(m_XML_TOK_CLOSE_PAREN_ASTERISK):
- (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_declClose)
- (*TPROLOG_STATE)(unsafe.Pointer(state)).Frole_none = int32(_XML_ROLE_ELEMENT_NONE)
- return int32(_XML_ROLE_GROUP_CLOSE_REP)
- case int32(m_XML_TOK_OR):
- (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_element4)
- return int32(_XML_ROLE_ELEMENT_NONE)
- }
- return _common(tls, state, tok)
- }
- func _element6(tls *libc.TLS, state uintptr, tok int32, ptr uintptr, end uintptr, enc uintptr) (r int32) {
- _ = ptr
- _ = end
- _ = enc
- switch tok {
- case int32(m_XML_TOK_PROLOG_S):
- return int32(_XML_ROLE_ELEMENT_NONE)
- case int32(m_XML_TOK_OPEN_PAREN):
- *(*uint32)(unsafe.Pointer(state + 8)) += uint32(1)
- return int32(_XML_ROLE_GROUP_OPEN)
- case int32(m_XML_TOK_NAME):
- fallthrough
- case int32(m_XML_TOK_PREFIXED_NAME):
- (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_element7)
- return int32(_XML_ROLE_CONTENT_ELEMENT)
- case int32(m_XML_TOK_NAME_QUESTION):
- (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_element7)
- return int32(_XML_ROLE_CONTENT_ELEMENT_OPT)
- case int32(m_XML_TOK_NAME_ASTERISK):
- (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_element7)
- return int32(_XML_ROLE_CONTENT_ELEMENT_REP)
- case int32(m_XML_TOK_NAME_PLUS):
- (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_element7)
- return int32(_XML_ROLE_CONTENT_ELEMENT_PLUS)
- }
- return _common(tls, state, tok)
- }
- func _element7(tls *libc.TLS, state uintptr, tok int32, ptr uintptr, end uintptr, enc uintptr) (r int32) {
- _ = ptr
- _ = end
- _ = enc
- switch tok {
- case int32(m_XML_TOK_PROLOG_S):
- return int32(_XML_ROLE_ELEMENT_NONE)
- case int32(m_XML_TOK_CLOSE_PAREN):
- *(*uint32)(unsafe.Pointer(state + 8)) -= uint32(1)
- if (*TPROLOG_STATE)(unsafe.Pointer(state)).Flevel == uint32(0) {
- (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_declClose)
- (*TPROLOG_STATE)(unsafe.Pointer(state)).Frole_none = int32(_XML_ROLE_ELEMENT_NONE)
- }
- return int32(_XML_ROLE_GROUP_CLOSE)
- case int32(m_XML_TOK_CLOSE_PAREN_ASTERISK):
- *(*uint32)(unsafe.Pointer(state + 8)) -= uint32(1)
- if (*TPROLOG_STATE)(unsafe.Pointer(state)).Flevel == uint32(0) {
- (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_declClose)
- (*TPROLOG_STATE)(unsafe.Pointer(state)).Frole_none = int32(_XML_ROLE_ELEMENT_NONE)
- }
- return int32(_XML_ROLE_GROUP_CLOSE_REP)
- case int32(m_XML_TOK_CLOSE_PAREN_QUESTION):
- *(*uint32)(unsafe.Pointer(state + 8)) -= uint32(1)
- if (*TPROLOG_STATE)(unsafe.Pointer(state)).Flevel == uint32(0) {
- (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_declClose)
- (*TPROLOG_STATE)(unsafe.Pointer(state)).Frole_none = int32(_XML_ROLE_ELEMENT_NONE)
- }
- return int32(_XML_ROLE_GROUP_CLOSE_OPT)
- case int32(m_XML_TOK_CLOSE_PAREN_PLUS):
- *(*uint32)(unsafe.Pointer(state + 8)) -= uint32(1)
- if (*TPROLOG_STATE)(unsafe.Pointer(state)).Flevel == uint32(0) {
- (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_declClose)
- (*TPROLOG_STATE)(unsafe.Pointer(state)).Frole_none = int32(_XML_ROLE_ELEMENT_NONE)
- }
- return int32(_XML_ROLE_GROUP_CLOSE_PLUS)
- case int32(m_XML_TOK_COMMA):
- (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_element6)
- return int32(_XML_ROLE_GROUP_SEQUENCE)
- case int32(m_XML_TOK_OR):
- (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_element6)
- return int32(_XML_ROLE_GROUP_CHOICE)
- }
- return _common(tls, state, tok)
- }
- func _condSect0(tls *libc.TLS, state uintptr, tok int32, ptr uintptr, end uintptr, enc uintptr) (r int32) {
- switch tok {
- case int32(m_XML_TOK_PROLOG_S):
- return int32(_XML_ROLE_NONE)
- case int32(m_XML_TOK_NAME):
- 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 {
- (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_condSect1)
- return int32(_XML_ROLE_NONE)
- }
- 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 {
- (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_condSect2)
- return int32(_XML_ROLE_NONE)
- }
- break
- }
- return _common(tls, state, tok)
- }
- func _condSect1(tls *libc.TLS, state uintptr, tok int32, ptr uintptr, end uintptr, enc uintptr) (r int32) {
- _ = ptr
- _ = end
- _ = enc
- switch tok {
- case int32(m_XML_TOK_PROLOG_S):
- return int32(_XML_ROLE_NONE)
- case int32(m_XML_TOK_OPEN_BRACKET):
- (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_externalSubset1)
- *(*uint32)(unsafe.Pointer(state + 16)) += uint32(1)
- return int32(_XML_ROLE_NONE)
- }
- return _common(tls, state, tok)
- }
- func _condSect2(tls *libc.TLS, state uintptr, tok int32, ptr uintptr, end uintptr, enc uintptr) (r int32) {
- _ = ptr
- _ = end
- _ = enc
- switch tok {
- case int32(m_XML_TOK_PROLOG_S):
- return int32(_XML_ROLE_NONE)
- case int32(m_XML_TOK_OPEN_BRACKET):
- (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_externalSubset1)
- return int32(_XML_ROLE_IGNORE_SECT)
- }
- return _common(tls, state, tok)
- }
- func _declClose(tls *libc.TLS, state uintptr, tok int32, ptr uintptr, end uintptr, enc uintptr) (r int32) {
- var v1 uintptr
- _ = v1
- _ = ptr
- _ = end
- _ = enc
- switch tok {
- case int32(m_XML_TOK_PROLOG_S):
- return (*TPROLOG_STATE)(unsafe.Pointer(state)).Frole_none
- case int32(m_XML_TOK_DECL_CLOSE):
- if (*TPROLOG_STATE)(unsafe.Pointer(state)).FdocumentEntity != 0 {
- v1 = __ccgo_fp(_internalSubset)
- } else {
- v1 = __ccgo_fp(_externalSubset1)
- }
- (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = v1
- return (*TPROLOG_STATE)(unsafe.Pointer(state)).Frole_none
- }
- return _common(tls, state, tok)
- }
- // C documentation
- //
- // /* This function will only be invoked if the internal logic of the
- // * parser has broken down. It is used in two cases:
- // *
- // * 1: When the XML prolog has been finished. At this point the
- // * processor (the parser level above these role handlers) should
- // * switch from prologProcessor to contentProcessor and reinitialise
- // * the handler function.
- // *
- // * 2: When an error has been detected (via common() below). At this
- // * point again the processor should be switched to errorProcessor,
- // * which will never call a handler.
- // *
- // * The result of this is that error() can only be called if the
- // * processor switch failed to happen, which is an internal error and
- // * therefore we shouldn't be able to provoke it simply by using the
- // * library. It is a necessary backstop, however, so we merely exclude
- // * it from the coverage statistics.
- // *
- // * LCOV_EXCL_START
- // */
- func _error(tls *libc.TLS, state uintptr, tok int32, ptr uintptr, end uintptr, enc uintptr) (r int32) {
- _ = state
- _ = tok
- _ = ptr
- _ = end
- _ = enc
- return int32(_XML_ROLE_NONE)
- }
- /* LCOV_EXCL_STOP */
- func _common(tls *libc.TLS, state uintptr, tok int32) (r int32) {
- if !((*TPROLOG_STATE)(unsafe.Pointer(state)).FdocumentEntity != 0) && tok == int32(m_XML_TOK_PARAM_ENTITY_REF) {
- return int32(_XML_ROLE_INNER_PARAM_ENTITY_REF)
- }
- (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_error)
- return int32(_XML_ROLE_ERROR)
- }
- func XXmlPrologStateInit(tls *libc.TLS, state uintptr) {
- (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_prolog0)
- (*TPROLOG_STATE)(unsafe.Pointer(state)).FdocumentEntity = int32(1)
- (*TPROLOG_STATE)(unsafe.Pointer(state)).FincludeLevel = uint32(0)
- (*TPROLOG_STATE)(unsafe.Pointer(state)).FinEntityValue = 0
- }
- func XXmlPrologStateInitExternalEntity(tls *libc.TLS, state uintptr) {
- (*TPROLOG_STATE)(unsafe.Pointer(state)).Fhandler = __ccgo_fp(_externalSubset0)
- (*TPROLOG_STATE)(unsafe.Pointer(state)).FdocumentEntity = 0
- (*TPROLOG_STATE)(unsafe.Pointer(state)).FincludeLevel = uint32(0)
- }
- const m_ASCII_02 = 48
- const m_ASCII_12 = 49
- const m_ASCII_22 = 50
- const m_ASCII_32 = 51
- const m_ASCII_41 = 52
- const m_ASCII_51 = 53
- const m_ASCII_61 = 54
- const m_ASCII_71 = 55
- const m_ASCII_82 = 56
- const m_ASCII_92 = 57
- const m_ASCII_AMP1 = 38
- const m_ASCII_APOS1 = 39
- const m_ASCII_COLON2 = 58
- const m_ASCII_EQUALS2 = 61
- const m_ASCII_EXCL2 = 33
- const m_ASCII_G2 = 0x47
- const m_ASCII_GT1 = 62
- const m_ASCII_K1 = 0x4B
- const m_ASCII_LSQB1 = 91
- const m_ASCII_LT1 = 60
- const m_ASCII_MINUS1 = 45
- const m_ASCII_N1 = 0x4E
- const m_ASCII_P2 = 0x50
- const m_ASCII_PERIOD2 = 46
- const m_ASCII_Q2 = 0x51
- const m_ASCII_QUOT1 = 34
- const m_ASCII_R1 = 0x52
- const m_ASCII_RSQB1 = 93
- const m_ASCII_SEMI1 = 59
- const m_ASCII_SPACE1 = 32
- const m_ASCII_TAB1 = 9
- const m_ASCII_UNDERSCORE1 = 95
- const m_ASCII_Y1 = 0x59
- const m_ASCII_Z1 = 90
- const m_ASCII_a2 = 97
- const m_ASCII_b1 = 98
- const m_ASCII_c2 = 99
- const m_ASCII_d1 = 100
- const m_ASCII_e2 = 101
- const m_ASCII_f1 = 102
- const m_ASCII_g2 = 103
- const m_ASCII_i1 = 105
- const m_ASCII_l2 = 108
- const m_ASCII_m2 = 109
- const m_ASCII_n2 = 110
- const m_ASCII_o2 = 111
- const m_ASCII_p2 = 112
- const m_ASCII_q1 = 113
- const m_ASCII_r2 = 114
- const m_ASCII_s2 = 115
- const m_ASCII_t2 = 116
- const m_ASCII_u1 = 117
- const m_ASCII_v1 = 118
- const m_ASCII_x2 = 120
- const m_ASCII_y1 = 121
- const m_ASCII_z1 = 122
- const m_ENCODING_MAX = 128
- const m___bool_true_false_are_defined = 1
- const m_bool = "_Bool"
- const m_false = 0
- const m_true = 1
- const m_utf8_isName4 = "isNever"
- const m_utf8_isNmstrt4 = "isNever"
- var _namingBitmap = [320]uint32{
- 8: uint32(0xFFFFFFFF),
- 9: uint32(0xFFFFFFFF),
- 10: uint32(0xFFFFFFFF),
- 11: uint32(0xFFFFFFFF),
- 12: uint32(0xFFFFFFFF),
- 13: uint32(0xFFFFFFFF),
- 14: uint32(0xFFFFFFFF),
- 15: uint32(0xFFFFFFFF),
- 17: uint32(0x04000000),
- 18: uint32(0x87FFFFFE),
- 19: uint32(0x07FFFFFE),
- 22: uint32(0xFF7FFFFF),
- 23: uint32(0xFF7FFFFF),
- 24: uint32(0xFFFFFFFF),
- 25: uint32(0x7FF3FFFF),
- 26: uint32(0xFFFFFDFE),
- 27: uint32(0x7FFFFFFF),
- 28: uint32(0xFFFFFFFF),
- 29: uint32(0xFFFFFFFF),
- 30: uint32(0xFFFFE00F),
- 31: uint32(0xFC31FFFF),
- 32: uint32(0x00FFFFFF),
- 34: uint32(0xFFFF0000),
- 35: uint32(0xFFFFFFFF),
- 36: uint32(0xFFFFFFFF),
- 37: uint32(0xF80001FF),
- 38: uint32(0x00000003),
- 44: uint32(0xFFFFD740),
- 45: uint32(0xFFFFFFFB),
- 46: uint32(0x547F7FFF),
- 47: uint32(0x000FFFFD),
- 48: uint32(0xFFFFDFFE),
- 49: uint32(0xFFFFFFFF),
- 50: uint32(0xDFFEFFFF),
- 51: uint32(0xFFFFFFFF),
- 52: uint32(0xFFFF0003),
- 53: uint32(0xFFFFFFFF),
- 54: uint32(0xFFFF199F),
- 55: uint32(0x033FCFFF),
- 57: uint32(0xFFFE0000),
- 58: uint32(0x027FFFFF),
- 59: uint32(0xFFFFFFFE),
- 60: uint32(0x0000007F),
- 62: uint32(0xFFFF0000),
- 63: uint32(0x000707FF),
- 65: uint32(0x07FFFFFE),
- 66: uint32(0x000007FE),
- 67: uint32(0xFFFE0000),
- 68: uint32(0xFFFFFFFF),
- 69: uint32(0x7CFFFFFF),
- 70: uint32(0x002F7FFF),
- 71: uint32(0x00000060),
- 72: uint32(0xFFFFFFE0),
- 73: uint32(0x23FFFFFF),
- 74: uint32(0xFF000000),
- 75: uint32(0x00000003),
- 76: uint32(0xFFF99FE0),
- 77: uint32(0x03C5FDFF),
- 78: uint32(0xB0000000),
- 79: uint32(0x00030003),
- 80: uint32(0xFFF987E0),
- 81: uint32(0x036DFDFF),
- 82: uint32(0x5E000000),
- 83: uint32(0x001C0000),
- 84: uint32(0xFFFBAFE0),
- 85: uint32(0x23EDFDFF),
- 87: uint32(0x00000001),
- 88: uint32(0xFFF99FE0),
- 89: uint32(0x23CDFDFF),
- 90: uint32(0xB0000000),
- 91: uint32(0x00000003),
- 92: uint32(0xD63DC7E0),
- 93: uint32(0x03BFC718),
- 96: uint32(0xFFFDDFE0),
- 97: uint32(0x03EFFDFF),
- 99: uint32(0x00000003),
- 100: uint32(0xFFFDDFE0),
- 101: uint32(0x03EFFDFF),
- 102: uint32(0x40000000),
- 103: uint32(0x00000003),
- 104: uint32(0xFFFDDFE0),
- 105: uint32(0x03FFFDFF),
- 107: uint32(0x00000003),
- 112: uint32(0xFFFFFFFE),
- 113: uint32(0x000D7FFF),
- 114: uint32(0x0000003F),
- 116: uint32(0xFEF02596),
- 117: uint32(0x200D6CAE),
- 118: uint32(0x0000001F),
- 122: uint32(0xFFFFFEFF),
- 123: uint32(0x000003FF),
- 133: uint32(0xFFFFFFFF),
- 134: uint32(0xFFFF003F),
- 135: uint32(0x007FFFFF),
- 136: uint32(0x0007DAED),
- 137: uint32(0x50000000),
- 138: uint32(0x82315001),
- 139: uint32(0x002C62AB),
- 140: uint32(0x40000000),
- 141: uint32(0xF580C900),
- 142: uint32(0x00000007),
- 143: uint32(0x02010800),
- 144: uint32(0xFFFFFFFF),
- 145: uint32(0xFFFFFFFF),
- 146: uint32(0xFFFFFFFF),
- 147: uint32(0xFFFFFFFF),
- 148: uint32(0x0FFFFFFF),
- 149: uint32(0xFFFFFFFF),
- 150: uint32(0xFFFFFFFF),
- 151: uint32(0x03FFFFFF),
- 152: uint32(0x3F3FFFFF),
- 153: uint32(0xFFFFFFFF),
- 154: uint32(0xAAFF3F3F),
- 155: uint32(0x3FFFFFFF),
- 156: uint32(0xFFFFFFFF),
- 157: uint32(0x5FDFFFFF),
- 158: uint32(0x0FCF1FDC),
- 159: uint32(0x1FDC1FFF),
- 161: uint32(0x00004C40),
- 164: uint32(0x00000007),
- 168: uint32(0x00000080),
- 169: uint32(0x000003FE),
- 170: uint32(0xFFFFFFFE),
- 171: uint32(0xFFFFFFFF),
- 172: uint32(0x001FFFFF),
- 173: uint32(0xFFFFFFFE),
- 174: uint32(0xFFFFFFFF),
- 175: uint32(0x07FFFFFF),
- 176: uint32(0xFFFFFFE0),
- 177: uint32(0x00001FFF),
- 184: uint32(0xFFFFFFFF),
- 185: uint32(0xFFFFFFFF),
- 186: uint32(0xFFFFFFFF),
- 187: uint32(0xFFFFFFFF),
- 188: uint32(0xFFFFFFFF),
- 189: uint32(0x0000003F),
- 192: uint32(0xFFFFFFFF),
- 193: uint32(0xFFFFFFFF),
- 194: uint32(0xFFFFFFFF),
- 195: uint32(0xFFFFFFFF),
- 196: uint32(0xFFFFFFFF),
- 197: uint32(0x0000000F),
- 201: uint32(0x07FF6000),
- 202: uint32(0x87FFFFFE),
- 203: uint32(0x07FFFFFE),
- 205: uint32(0x00800000),
- 206: uint32(0xFF7FFFFF),
- 207: uint32(0xFF7FFFFF),
- 208: uint32(0x00FFFFFF),
- 210: uint32(0xFFFF0000),
- 211: uint32(0xFFFFFFFF),
- 212: uint32(0xFFFFFFFF),
- 213: uint32(0xF80001FF),
- 214: uint32(0x00030003),
- 216: uint32(0xFFFFFFFF),
- 217: uint32(0xFFFFFFFF),
- 218: uint32(0x0000003F),
- 219: uint32(0x00000003),
- 220: uint32(0xFFFFD7C0),
- 221: uint32(0xFFFFFFFB),
- 222: uint32(0x547F7FFF),
- 223: uint32(0x000FFFFD),
- 224: uint32(0xFFFFDFFE),
- 225: uint32(0xFFFFFFFF),
- 226: uint32(0xDFFEFFFF),
- 227: uint32(0xFFFFFFFF),
- 228: uint32(0xFFFF007B),
- 229: uint32(0xFFFFFFFF),
- 230: uint32(0xFFFF199F),
- 231: uint32(0x033FCFFF),
- 233: uint32(0xFFFE0000),
- 234: uint32(0x027FFFFF),
- 235: uint32(0xFFFFFFFE),
- 236: uint32(0xFFFE007F),
- 237: uint32(0xBBFFFFFB),
- 238: uint32(0xFFFF0016),
- 239: uint32(0x000707FF),
- 241: uint32(0x07FFFFFE),
- 242: uint32(0x0007FFFF),
- 243: uint32(0xFFFF03FF),
- 244: uint32(0xFFFFFFFF),
- 245: uint32(0x7CFFFFFF),
- 246: uint32(0xFFEF7FFF),
- 247: uint32(0x03FF3DFF),
- 248: uint32(0xFFFFFFEE),
- 249: uint32(0xF3FFFFFF),
- 250: uint32(0xFF1E3FFF),
- 251: uint32(0x0000FFCF),
- 252: uint32(0xFFF99FEE),
- 253: uint32(0xD3C5FDFF),
- 254: uint32(0xB080399F),
- 255: uint32(0x0003FFCF),
- 256: uint32(0xFFF987E4),
- 257: uint32(0xD36DFDFF),
- 258: uint32(0x5E003987),
- 259: uint32(0x001FFFC0),
- 260: uint32(0xFFFBAFEE),
- 261: uint32(0xF3EDFDFF),
- 262: uint32(0x00003BBF),
- 263: uint32(0x0000FFC1),
- 264: uint32(0xFFF99FEE),
- 265: uint32(0xF3CDFDFF),
- 266: uint32(0xB0C0398F),
- 267: uint32(0x0000FFC3),
- 268: uint32(0xD63DC7EC),
- 269: uint32(0xC3BFC718),
- 270: uint32(0x00803DC7),
- 271: uint32(0x0000FF80),
- 272: uint32(0xFFFDDFEE),
- 273: uint32(0xC3EFFDFF),
- 274: uint32(0x00603DDF),
- 275: uint32(0x0000FFC3),
- 276: uint32(0xFFFDDFEC),
- 277: uint32(0xC3EFFDFF),
- 278: uint32(0x40603DDF),
- 279: uint32(0x0000FFC3),
- 280: uint32(0xFFFDDFEC),
- 281: uint32(0xC3FFFDFF),
- 282: uint32(0x00803DCF),
- 283: uint32(0x0000FFC3),
- 288: uint32(0xFFFFFFFE),
- 289: uint32(0x07FF7FFF),
- 290: uint32(0x03FF7FFF),
- 292: uint32(0xFEF02596),
- 293: uint32(0x3BFF6CAE),
- 294: uint32(0x03FF3F5F),
- 296: uint32(0x03000000),
- 297: uint32(0xC2A003FF),
- 298: uint32(0xFFFFFEFF),
- 299: uint32(0xFFFE03FF),
- 300: uint32(0xFEBF0FDF),
- 301: uint32(0x02FE3FFF),
- 310: uint32(0x1FFF0000),
- 311: uint32(0x00000002),
- 312: uint32(0x000000A0),
- 313: uint32(0x003EFFFE),
- 314: uint32(0xFFFFFFFE),
- 315: uint32(0xFFFFFFFF),
- 316: uint32(0x661FFFFF),
- 317: uint32(0xFFFFFFFE),
- 318: uint32(0xFFFFFFFF),
- 319: uint32(0x77FFFFFF),
- }
- var _nmstrtPages = [256]uint8{
- 0: uint8(0x02),
- 1: uint8(0x03),
- 2: uint8(0x04),
- 3: uint8(0x05),
- 4: uint8(0x06),
- 5: uint8(0x07),
- 6: uint8(0x08),
- 9: uint8(0x09),
- 10: uint8(0x0A),
- 11: uint8(0x0B),
- 12: uint8(0x0C),
- 13: uint8(0x0D),
- 14: uint8(0x0E),
- 15: uint8(0x0F),
- 16: uint8(0x10),
- 17: uint8(0x11),
- 30: uint8(0x12),
- 31: uint8(0x13),
- 33: uint8(0x14),
- 48: uint8(0x15),
- 49: uint8(0x16),
- 78: uint8(0x01),
- 79: uint8(0x01),
- 80: uint8(0x01),
- 81: uint8(0x01),
- 82: uint8(0x01),
- 83: uint8(0x01),
- 84: uint8(0x01),
- 85: uint8(0x01),
- 86: uint8(0x01),
- 87: uint8(0x01),
- 88: uint8(0x01),
- 89: uint8(0x01),
- 90: uint8(0x01),
- 91: uint8(0x01),
- 92: uint8(0x01),
- 93: uint8(0x01),
- 94: uint8(0x01),
- 95: uint8(0x01),
- 96: uint8(0x01),
- 97: uint8(0x01),
- 98: uint8(0x01),
- 99: uint8(0x01),
- 100: uint8(0x01),
- 101: uint8(0x01),
- 102: uint8(0x01),
- 103: uint8(0x01),
- 104: uint8(0x01),
- 105: uint8(0x01),
- 106: uint8(0x01),
- 107: uint8(0x01),
- 108: uint8(0x01),
- 109: uint8(0x01),
- 110: uint8(0x01),
- 111: uint8(0x01),
- 112: uint8(0x01),
- 113: uint8(0x01),
- 114: uint8(0x01),
- 115: uint8(0x01),
- 116: uint8(0x01),
- 117: uint8(0x01),
- 118: uint8(0x01),
- 119: uint8(0x01),
- 120: uint8(0x01),
- 121: uint8(0x01),
- 122: uint8(0x01),
- 123: uint8(0x01),
- 124: uint8(0x01),
- 125: uint8(0x01),
- 126: uint8(0x01),
- 127: uint8(0x01),
- 128: uint8(0x01),
- 129: uint8(0x01),
- 130: uint8(0x01),
- 131: uint8(0x01),
- 132: uint8(0x01),
- 133: uint8(0x01),
- 134: uint8(0x01),
- 135: uint8(0x01),
- 136: uint8(0x01),
- 137: uint8(0x01),
- 138: uint8(0x01),
- 139: uint8(0x01),
- 140: uint8(0x01),
- 141: uint8(0x01),
- 142: uint8(0x01),
- 143: uint8(0x01),
- 144: uint8(0x01),
- 145: uint8(0x01),
- 146: uint8(0x01),
- 147: uint8(0x01),
- 148: uint8(0x01),
- 149: uint8(0x01),
- 150: uint8(0x01),
- 151: uint8(0x01),
- 152: uint8(0x01),
- 153: uint8(0x01),
- 154: uint8(0x01),
- 155: uint8(0x01),
- 156: uint8(0x01),
- 157: uint8(0x01),
- 158: uint8(0x01),
- 159: uint8(0x17),
- 172: uint8(0x01),
- 173: uint8(0x01),
- 174: uint8(0x01),
- 175: uint8(0x01),
- 176: uint8(0x01),
- 177: uint8(0x01),
- 178: uint8(0x01),
- 179: uint8(0x01),
- 180: uint8(0x01),
- 181: uint8(0x01),
- 182: uint8(0x01),
- 183: uint8(0x01),
- 184: uint8(0x01),
- 185: uint8(0x01),
- 186: uint8(0x01),
- 187: uint8(0x01),
- 188: uint8(0x01),
- 189: uint8(0x01),
- 190: uint8(0x01),
- 191: uint8(0x01),
- 192: uint8(0x01),
- 193: uint8(0x01),
- 194: uint8(0x01),
- 195: uint8(0x01),
- 196: uint8(0x01),
- 197: uint8(0x01),
- 198: uint8(0x01),
- 199: uint8(0x01),
- 200: uint8(0x01),
- 201: uint8(0x01),
- 202: uint8(0x01),
- 203: uint8(0x01),
- 204: uint8(0x01),
- 205: uint8(0x01),
- 206: uint8(0x01),
- 207: uint8(0x01),
- 208: uint8(0x01),
- 209: uint8(0x01),
- 210: uint8(0x01),
- 211: uint8(0x01),
- 212: uint8(0x01),
- 213: uint8(0x01),
- 214: uint8(0x01),
- 215: uint8(0x18),
- }
- var _namePages = [256]uint8{
- 0: uint8(0x19),
- 1: uint8(0x03),
- 2: uint8(0x1A),
- 3: uint8(0x1B),
- 4: uint8(0x1C),
- 5: uint8(0x1D),
- 6: uint8(0x1E),
- 9: uint8(0x1F),
- 10: uint8(0x20),
- 11: uint8(0x21),
- 12: uint8(0x22),
- 13: uint8(0x23),
- 14: uint8(0x24),
- 15: uint8(0x25),
- 16: uint8(0x10),
- 17: uint8(0x11),
- 30: uint8(0x12),
- 31: uint8(0x13),
- 32: uint8(0x26),
- 33: uint8(0x14),
- 48: uint8(0x27),
- 49: uint8(0x16),
- 78: uint8(0x01),
- 79: uint8(0x01),
- 80: uint8(0x01),
- 81: uint8(0x01),
- 82: uint8(0x01),
- 83: uint8(0x01),
- 84: uint8(0x01),
- 85: uint8(0x01),
- 86: uint8(0x01),
- 87: uint8(0x01),
- 88: uint8(0x01),
- 89: uint8(0x01),
- 90: uint8(0x01),
- 91: uint8(0x01),
- 92: uint8(0x01),
- 93: uint8(0x01),
- 94: uint8(0x01),
- 95: uint8(0x01),
- 96: uint8(0x01),
- 97: uint8(0x01),
- 98: uint8(0x01),
- 99: uint8(0x01),
- 100: uint8(0x01),
- 101: uint8(0x01),
- 102: uint8(0x01),
- 103: uint8(0x01),
- 104: uint8(0x01),
- 105: uint8(0x01),
- 106: uint8(0x01),
- 107: uint8(0x01),
- 108: uint8(0x01),
- 109: uint8(0x01),
- 110: uint8(0x01),
- 111: uint8(0x01),
- 112: uint8(0x01),
- 113: uint8(0x01),
- 114: uint8(0x01),
- 115: uint8(0x01),
- 116: uint8(0x01),
- 117: uint8(0x01),
- 118: uint8(0x01),
- 119: uint8(0x01),
- 120: uint8(0x01),
- 121: uint8(0x01),
- 122: uint8(0x01),
- 123: uint8(0x01),
- 124: uint8(0x01),
- 125: uint8(0x01),
- 126: uint8(0x01),
- 127: uint8(0x01),
- 128: uint8(0x01),
- 129: uint8(0x01),
- 130: uint8(0x01),
- 131: uint8(0x01),
- 132: uint8(0x01),
- 133: uint8(0x01),
- 134: uint8(0x01),
- 135: uint8(0x01),
- 136: uint8(0x01),
- 137: uint8(0x01),
- 138: uint8(0x01),
- 139: uint8(0x01),
- 140: uint8(0x01),
- 141: uint8(0x01),
- 142: uint8(0x01),
- 143: uint8(0x01),
- 144: uint8(0x01),
- 145: uint8(0x01),
- 146: uint8(0x01),
- 147: uint8(0x01),
- 148: uint8(0x01),
- 149: uint8(0x01),
- 150: uint8(0x01),
- 151: uint8(0x01),
- 152: uint8(0x01),
- 153: uint8(0x01),
- 154: uint8(0x01),
- 155: uint8(0x01),
- 156: uint8(0x01),
- 157: uint8(0x01),
- 158: uint8(0x01),
- 159: uint8(0x17),
- 172: uint8(0x01),
- 173: uint8(0x01),
- 174: uint8(0x01),
- 175: uint8(0x01),
- 176: uint8(0x01),
- 177: uint8(0x01),
- 178: uint8(0x01),
- 179: uint8(0x01),
- 180: uint8(0x01),
- 181: uint8(0x01),
- 182: uint8(0x01),
- 183: uint8(0x01),
- 184: uint8(0x01),
- 185: uint8(0x01),
- 186: uint8(0x01),
- 187: uint8(0x01),
- 188: uint8(0x01),
- 189: uint8(0x01),
- 190: uint8(0x01),
- 191: uint8(0x01),
- 192: uint8(0x01),
- 193: uint8(0x01),
- 194: uint8(0x01),
- 195: uint8(0x01),
- 196: uint8(0x01),
- 197: uint8(0x01),
- 198: uint8(0x01),
- 199: uint8(0x01),
- 200: uint8(0x01),
- 201: uint8(0x01),
- 202: uint8(0x01),
- 203: uint8(0x01),
- 204: uint8(0x01),
- 205: uint8(0x01),
- 206: uint8(0x01),
- 207: uint8(0x01),
- 208: uint8(0x01),
- 209: uint8(0x01),
- 210: uint8(0x01),
- 211: uint8(0x01),
- 212: uint8(0x01),
- 213: uint8(0x01),
- 214: uint8(0x01),
- 215: uint8(0x18),
- }
- /* A 2 byte UTF-8 representation splits the characters 11 bits between
- the bottom 5 and 6 bits of the bytes. We need 8 bits to index into
- pages, 3 bits to add to that index and 5 bits to generate the mask.
- */
- /* A 3 byte UTF-8 representation splits the characters 16 bits between
- the bottom 4, 6 and 6 bits of the bytes. We need 8 bits to index
- into pages, 3 bits to add to that index and 5 bits to generate the
- mask.
- */
- /* Detection of invalid UTF-8 sequences is based on Table 3.1B
- of Unicode 3.2: http://www.unicode.org/unicode/reports/tr28/
- with the additional restriction of not allowing the Unicode
- code points 0xFFFF and 0xFFFE (sequences EF,BF,BF and EF,BF,BE).
- Implementation details:
- (A & 0x80) == 0 means A < 0x80
- and
- (A & 0xC0) == 0xC0 means A > 0xBF
- */
- func _isNever(tls *libc.TLS, enc uintptr, p uintptr) (r int32) {
- _ = enc
- _ = p
- return 0
- }
- func _utf8_isName2(tls *libc.TLS, enc uintptr, p uintptr) (r int32) {
- _ = enc
- 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))))
- }
- func _utf8_isName3(tls *libc.TLS, enc uintptr, p uintptr) (r int32) {
- _ = enc
- 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))))
- }
- func _utf8_isNmstrt2(tls *libc.TLS, enc uintptr, p uintptr) (r int32) {
- _ = enc
- 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))))
- }
- func _utf8_isNmstrt3(tls *libc.TLS, enc uintptr, p uintptr) (r int32) {
- _ = enc
- 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))))
- }
- func _utf8_isInvalid2(tls *libc.TLS, enc uintptr, p uintptr) (r int32) {
- _ = enc
- 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))
- }
- func _utf8_isInvalid3(tls *libc.TLS, enc uintptr, p uintptr) (r int32) {
- var v1, v3, v4 int32
- var v2, v5, v6 bool
- _, _, _, _, _, _ = v1, v2, v3, v4, v5, v6
- _ = enc
- if v2 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(p + 2)))&int32(0x80) == 0; !v2 {
- if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(p))) == int32(0xEF) && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(p + 1))) == int32(0xBF) {
- v1 = libc.BoolInt32(libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(p + 2))) > int32(0xBD))
- } else {
- v1 = libc.BoolInt32(libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(p + 2)))&int32(0xC0) == int32(0xC0))
- }
- }
- if v6 = v2 || v1 != 0; !v6 {
- if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(p))) == int32(0xE0) {
- v3 = libc.BoolInt32(libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(p + 1))) < int32(0xA0) || libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(p + 1)))&int32(0xC0) == int32(0xC0))
- } else {
- if v5 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(p + 1)))&int32(0x80) == 0; !v5 {
- if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(p))) == int32(0xED) {
- v4 = libc.BoolInt32(libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(p + 1))) > int32(0x9F))
- } else {
- v4 = libc.BoolInt32(libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(p + 1)))&int32(0xC0) == int32(0xC0))
- }
- }
- v3 = libc.BoolInt32(v5 || v4 != 0)
- }
- }
- return libc.BoolInt32(v6 || v3 != 0)
- }
- func _utf8_isInvalid4(tls *libc.TLS, enc uintptr, p uintptr) (r int32) {
- var v1, v2 int32
- var v3, v4 bool
- _, _, _, _ = v1, v2, v3, v4
- _ = enc
- 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 {
- if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(p))) == int32(0xF0) {
- v1 = libc.BoolInt32(libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(p + 1))) < int32(0x90) || libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(p + 1)))&int32(0xC0) == int32(0xC0))
- } else {
- if v3 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(p + 1)))&int32(0x80) == 0; !v3 {
- if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(p))) == int32(0xF4) {
- v2 = libc.BoolInt32(libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(p + 1))) > int32(0x8F))
- } else {
- v2 = libc.BoolInt32(libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(p + 1)))&int32(0xC0) == int32(0xC0))
- }
- }
- v1 = libc.BoolInt32(v3 || v2 != 0)
- }
- }
- return libc.BoolInt32(v4 || v1 != 0)
- }
- type Tnormal_encoding = struct {
- Fenc TENCODING
- Ftype1 [256]uint8
- FisName2 uintptr
- FisName3 uintptr
- FisName4 uintptr
- FisNmstrt2 uintptr
- FisNmstrt3 uintptr
- FisNmstrt4 uintptr
- FisInvalid2 uintptr
- FisInvalid3 uintptr
- FisInvalid4 uintptr
- }
- const _BT_NONXML = 0
- const _BT_MALFORM = 1
- const _BT_LT = 2
- const _BT_AMP = 3
- const _BT_RSQB = 4
- const _BT_LEAD2 = 5
- const _BT_LEAD3 = 6
- const _BT_LEAD4 = 7
- const _BT_TRAIL = 8
- const _BT_CR = 9
- const _BT_LF = 10
- const _BT_GT = 11
- const _BT_QUOT = 12
- const _BT_APOS = 13
- const _BT_EQUALS = 14
- const _BT_QUEST = 15
- const _BT_EXCL = 16
- const _BT_SOL = 17
- const _BT_SEMI = 18
- const _BT_NUM = 19
- const _BT_LSQB = 20
- const _BT_S = 21
- const _BT_NMSTRT = 22
- const _BT_COLON = 23
- const _BT_HEX = 24
- const _BT_DIGIT = 25
- const _BT_NAME = 26
- const _BT_MINUS = 27
- const _BT_OTHER = 28
- const _BT_NONASCII = 29
- const _BT_PERCNT = 30
- const _BT_LPAR = 31
- const _BT_RPAR = 32
- const _BT_AST = 33
- const _BT_PLUS = 34
- const _BT_COMMA = 35
- const _BT_VERBAR = 36
- /*
- __ __ _
- ___\ \/ /_ __ __ _| |_
- / _ \\ /| '_ \ / _` | __|
- | __// \| |_) | (_| | |_
- \___/_/\_\ .__/ \__,_|\__|
- |_| XML parser
- Copyright (c) 1999-2000 Thai Open Source Software Center Ltd
- Copyright (c) 2000 Clark Cooper <coopercc@users.sourceforge.net>
- Copyright (c) 2002 Fred L. Drake, Jr. <fdrake@users.sourceforge.net>
- Copyright (c) 2007 Karl Waclawek <karl@waclawek.net>
- Copyright (c) 2017 Sebastian Pipping <sebastian@pipping.org>
- Licensed under the MIT license:
- Permission is hereby granted, free of charge, to any person obtaining
- a copy of this software and associated documentation files (the
- "Software"), to deal in the Software without restriction, including
- without limitation the rights to use, copy, modify, merge, publish,
- distribute, sublicense, and/or sell copies of the Software, and to permit
- persons to whom the Software is furnished to do so, subject to the
- following conditions:
- The above copyright notice and this permission notice shall be included
- in all copies or substantial portions of the Software.
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
- NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
- USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
- /* minimum bytes per character */
- /* c is an ASCII character */
- /* This file is included (from xmltok.c, 1-3 times depending on XML_MIN_SIZE)!
- __ __ _
- ___\ \/ /_ __ __ _| |_
- / _ \\ /| '_ \ / _` | __|
- | __// \| |_) | (_| | |_
- \___/_/\_\ .__/ \__,_|\__|
- |_| XML parser
- Copyright (c) 1997-2000 Thai Open Source Software Center Ltd
- Copyright (c) 2000 Clark Cooper <coopercc@users.sourceforge.net>
- Copyright (c) 2002 Fred L. Drake, Jr. <fdrake@users.sourceforge.net>
- Copyright (c) 2002-2016 Karl Waclawek <karl@waclawek.net>
- Copyright (c) 2016-2022 Sebastian Pipping <sebastian@pipping.org>
- Copyright (c) 2017 Rhodri James <rhodri@wildebeest.org.uk>
- Copyright (c) 2018 Benjamin Peterson <benjamin@python.org>
- Copyright (c) 2018 Anton Maklakov <antmak.pub@gmail.com>
- Copyright (c) 2019 David Loffredo <loffredo@steptools.com>
- Copyright (c) 2020 Boris Kolpackov <boris@codesynthesis.com>
- Copyright (c) 2022 Martin Ettl <ettl.martin78@googlemail.com>
- Licensed under the MIT license:
- Permission is hereby granted, free of charge, to any person obtaining
- a copy of this software and associated documentation files (the
- "Software"), to deal in the Software without restriction, including
- without limitation the rights to use, copy, modify, merge, publish,
- distribute, sublicense, and/or sell copies of the Software, and to permit
- persons to whom the Software is furnished to do so, subject to the
- following conditions:
- The above copyright notice and this permission notice shall be included
- in all copies or substantial portions of the Software.
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
- NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
- USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
- /* ptr points to character following "<!-" */
- func _normal_scanComment(tls *libc.TLS, enc uintptr, ptr uintptr, end uintptr, nextTokPtr uintptr) (r int32) {
- if int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(1)) {
- if !(int32(*(*int8)(unsafe.Pointer(ptr))) == libc.Int32FromInt32(m_ASCII_MINUS1)) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(1)
- for int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(1)) {
- switch libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr))))))) {
- case int32(_BT_LEAD2):
- if int64(end)-int64(ptr) < int64(2) {
- return -int32(2)
- }
- if (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisInvalid2})))(tls, enc, ptr) != 0 {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(2)
- case int32(_BT_LEAD3):
- if int64(end)-int64(ptr) < int64(3) {
- return -int32(2)
- }
- if (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisInvalid3})))(tls, enc, ptr) != 0 {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(3)
- case int32(_BT_LEAD4):
- if int64(end)-int64(ptr) < int64(4) {
- return -int32(2)
- }
- if (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisInvalid4})))(tls, enc, ptr) != 0 {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(4)
- case int32(_BT_NONXML):
- fallthrough
- case int32(_BT_MALFORM):
- fallthrough
- case int32(_BT_TRAIL):
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- case int32(_BT_MINUS):
- ptr += uintptr(1)
- if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(1))) {
- return -int32(1)
- }
- if int32(*(*int8)(unsafe.Pointer(ptr))) == int32(m_ASCII_MINUS1) {
- ptr += uintptr(1)
- if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(1))) {
- return -int32(1)
- }
- if !(int32(*(*int8)(unsafe.Pointer(ptr))) == libc.Int32FromInt32(m_ASCII_GT1)) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(1)
- return int32(m_XML_TOK_COMMENT)
- }
- default:
- ptr += uintptr(1)
- break
- }
- }
- }
- return -int32(1)
- }
- /* ptr points to character following "<!" */
- func _normal_scanDecl(tls *libc.TLS, enc uintptr, ptr uintptr, end uintptr, nextTokPtr uintptr) (r int32) {
- if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(1))) {
- return -int32(1)
- }
- switch libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr))))))) {
- case int32(_BT_MINUS):
- return _normal_scanComment(tls, enc, ptr+uintptr(1), end, nextTokPtr)
- case int32(_BT_LSQB):
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(1)
- return int32(m_XML_TOK_COND_SECT_OPEN)
- case int32(_BT_NMSTRT):
- fallthrough
- case int32(_BT_HEX):
- ptr += uintptr(1)
- default:
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- for int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(1)) {
- switch libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr))))))) {
- case int32(_BT_PERCNT):
- if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(2)*libc.Int32FromInt32(1))) {
- return -int32(1)
- }
- /* don't allow <!ENTITY% foo "whatever"> */
- switch libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr + libc.UintptrFromInt32(1)))))))) {
- case int32(_BT_S):
- fallthrough
- case int32(_BT_CR):
- fallthrough
- case int32(_BT_LF):
- fallthrough
- case int32(_BT_PERCNT):
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- /* fall through */
- fallthrough
- case int32(_BT_S):
- fallthrough
- case int32(_BT_CR):
- fallthrough
- case int32(_BT_LF):
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return int32(m_XML_TOK_DECL_OPEN)
- case int32(_BT_NMSTRT):
- fallthrough
- case int32(_BT_HEX):
- ptr += uintptr(1)
- default:
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- }
- return -int32(1)
- }
- func _normal_checkPiTarget(tls *libc.TLS, enc uintptr, ptr uintptr, end uintptr, tokPtr uintptr) (r int32) {
- var upper int32
- _ = upper
- upper = 0
- _ = enc
- *(*int32)(unsafe.Pointer(tokPtr)) = int32(m_XML_TOK_PI)
- if int64(end)-int64(ptr) != int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(3)) {
- return int32(1)
- }
- switch int32(*(*int8)(unsafe.Pointer(ptr))) {
- case int32(m_ASCII_x2):
- case int32(m_ASCII_X):
- upper = int32(1)
- default:
- return int32(1)
- }
- ptr += uintptr(1)
- switch int32(*(*int8)(unsafe.Pointer(ptr))) {
- case int32(m_ASCII_m2):
- case int32(m_ASCII_M):
- upper = int32(1)
- default:
- return int32(1)
- }
- ptr += uintptr(1)
- switch int32(*(*int8)(unsafe.Pointer(ptr))) {
- case int32(m_ASCII_l2):
- case int32(m_ASCII_L):
- upper = int32(1)
- default:
- return int32(1)
- }
- if upper != 0 {
- return 0
- }
- *(*int32)(unsafe.Pointer(tokPtr)) = int32(m_XML_TOK_XML_DECL)
- return int32(1)
- }
- /* ptr points to character following "<?" */
- func _normal_scanPi(tls *libc.TLS, enc uintptr, ptr uintptr, end uintptr, nextTokPtr uintptr) (r int32) {
- bp := tls.Alloc(16)
- defer tls.Free(16)
- var target uintptr
- var _ /* tok at bp+0 */ int32
- _ = target
- target = ptr
- if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(1))) {
- return -int32(1)
- }
- switch libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr))))))) {
- case int32(_BT_NONASCII):
- if !(libc.Int32FromInt32(0) != 0) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- } /* fall through */
- fallthrough
- case int32(_BT_NMSTRT):
- fallthrough
- case int32(_BT_HEX):
- ptr += uintptr(1)
- case int32(_BT_LEAD2):
- if int64(end)-int64(ptr) < int64(libc.Int32FromInt32(2)) {
- return -int32(2)
- }
- 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) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(2)
- case int32(_BT_LEAD3):
- if int64(end)-int64(ptr) < int64(libc.Int32FromInt32(3)) {
- return -int32(2)
- }
- 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) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(3)
- case int32(_BT_LEAD4):
- if int64(end)-int64(ptr) < int64(libc.Int32FromInt32(4)) {
- return -int32(2)
- }
- 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) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(4)
- default:
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- for int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(1)) {
- switch libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr))))))) {
- case int32(_BT_NONASCII):
- if !(libc.Int32FromInt32(0) != 0) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- } /* fall through */
- fallthrough
- case int32(_BT_NMSTRT):
- fallthrough
- case int32(_BT_HEX):
- fallthrough
- case int32(_BT_DIGIT):
- fallthrough
- case int32(_BT_NAME):
- fallthrough
- case int32(_BT_MINUS):
- ptr += uintptr(1)
- case int32(_BT_LEAD2):
- if int64(end)-int64(ptr) < int64(2) {
- return -int32(2)
- }
- 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) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(2)
- case int32(_BT_LEAD3):
- if int64(end)-int64(ptr) < int64(3) {
- return -int32(2)
- }
- 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) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(3)
- case int32(_BT_LEAD4):
- if int64(end)-int64(ptr) < int64(4) {
- return -int32(2)
- }
- 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) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(4)
- case int32(_BT_S):
- fallthrough
- case int32(_BT_CR):
- fallthrough
- case int32(_BT_LF):
- if !(_normal_checkPiTarget(tls, enc, target, ptr, bp) != 0) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(1)
- for int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(1)) {
- switch libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr))))))) {
- case int32(_BT_LEAD2):
- if int64(end)-int64(ptr) < int64(2) {
- return -int32(2)
- }
- if (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisInvalid2})))(tls, enc, ptr) != 0 {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(2)
- case int32(_BT_LEAD3):
- if int64(end)-int64(ptr) < int64(3) {
- return -int32(2)
- }
- if (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisInvalid3})))(tls, enc, ptr) != 0 {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(3)
- case int32(_BT_LEAD4):
- if int64(end)-int64(ptr) < int64(4) {
- return -int32(2)
- }
- if (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisInvalid4})))(tls, enc, ptr) != 0 {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(4)
- case int32(_BT_NONXML):
- fallthrough
- case int32(_BT_MALFORM):
- fallthrough
- case int32(_BT_TRAIL):
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- case int32(_BT_QUEST):
- ptr += uintptr(1)
- if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(1))) {
- return -int32(1)
- }
- if int32(*(*int8)(unsafe.Pointer(ptr))) == int32(m_ASCII_GT1) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(1)
- return *(*int32)(unsafe.Pointer(bp))
- }
- default:
- ptr += uintptr(1)
- break
- }
- }
- return -int32(1)
- case int32(_BT_QUEST):
- if !(_normal_checkPiTarget(tls, enc, target, ptr, bp) != 0) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(1)
- if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(1))) {
- return -int32(1)
- }
- if int32(*(*int8)(unsafe.Pointer(ptr))) == int32(m_ASCII_GT1) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(1)
- return *(*int32)(unsafe.Pointer(bp))
- }
- /* fall through */
- fallthrough
- default:
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- }
- return -int32(1)
- }
- func _normal_scanCdataSection(tls *libc.TLS, enc uintptr, ptr uintptr, end uintptr, nextTokPtr uintptr) (r int32) {
- var i int32
- _ = i
- _ = enc
- /* CDATA[ */
- if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(6)*libc.Int32FromInt32(1))) {
- return -int32(1)
- }
- i = 0
- for {
- if !(i < int32(6)) {
- break
- }
- if !(int32(*(*int8)(unsafe.Pointer(ptr))) == int32(_CDATA_LSQB[i])) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- goto _1
- _1:
- ;
- i++
- ptr += uintptr(1)
- }
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return int32(m_XML_TOK_CDATA_SECT_OPEN)
- }
- var _CDATA_LSQB = [6]int8{
- 0: int8(m_ASCII_C),
- 1: int8(m_ASCII_D),
- 2: int8(m_ASCII_A),
- 3: int8(m_ASCII_T),
- 4: int8(m_ASCII_A),
- 5: int8(m_ASCII_LSQB1),
- }
- func _normal_cdataSectionTok(tls *libc.TLS, enc uintptr, ptr uintptr, end uintptr, nextTokPtr uintptr) (r int32) {
- var n Tsize_t
- _ = n
- if ptr >= end {
- return -int32(4)
- }
- if int32(1) > int32(1) {
- n = libc.Uint64FromInt64(int64(end) - int64(ptr))
- if n&libc.Uint64FromInt32(libc.Int32FromInt32(1)-libc.Int32FromInt32(1)) != 0 {
- n &= libc.Uint64FromInt32(^(libc.Int32FromInt32(1) - libc.Int32FromInt32(1)))
- if n == uint64(0) {
- return -int32(1)
- }
- end = ptr + uintptr(n)
- }
- }
- switch libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr))))))) {
- case int32(_BT_RSQB):
- ptr += uintptr(1)
- if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(1))) {
- return -int32(1)
- }
- if !(int32(*(*int8)(unsafe.Pointer(ptr))) == libc.Int32FromInt32(m_ASCII_RSQB1)) {
- break
- }
- ptr += uintptr(1)
- if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(1))) {
- return -int32(1)
- }
- if !(int32(*(*int8)(unsafe.Pointer(ptr))) == libc.Int32FromInt32(m_ASCII_GT1)) {
- ptr -= uintptr(1)
- break
- }
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(1)
- return int32(m_XML_TOK_CDATA_SECT_CLOSE)
- case int32(_BT_CR):
- ptr += uintptr(1)
- if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(1))) {
- return -int32(1)
- }
- if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr))))))) == int32(_BT_LF) {
- ptr += uintptr(1)
- }
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return int32(m_XML_TOK_DATA_NEWLINE)
- case int32(_BT_LF):
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(1)
- return int32(m_XML_TOK_DATA_NEWLINE)
- case int32(_BT_LEAD2):
- if int64(end)-int64(ptr) < int64(2) {
- return -int32(2)
- }
- if (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisInvalid2})))(tls, enc, ptr) != 0 {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(2)
- case int32(_BT_LEAD3):
- if int64(end)-int64(ptr) < int64(3) {
- return -int32(2)
- }
- if (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisInvalid3})))(tls, enc, ptr) != 0 {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(3)
- case int32(_BT_LEAD4):
- if int64(end)-int64(ptr) < int64(4) {
- return -int32(2)
- }
- if (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisInvalid4})))(tls, enc, ptr) != 0 {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(4)
- case int32(_BT_NONXML):
- fallthrough
- case int32(_BT_MALFORM):
- fallthrough
- case int32(_BT_TRAIL):
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- default:
- ptr += uintptr(1)
- break
- }
- for int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(1)) {
- switch libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr))))))) {
- case int32(_BT_LEAD2):
- 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 {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return int32(m_XML_TOK_DATA_CHARS)
- }
- ptr += uintptr(2)
- case int32(_BT_LEAD3):
- 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 {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return int32(m_XML_TOK_DATA_CHARS)
- }
- ptr += uintptr(3)
- case int32(_BT_LEAD4):
- 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 {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return int32(m_XML_TOK_DATA_CHARS)
- }
- ptr += uintptr(4)
- case int32(_BT_NONXML):
- fallthrough
- case int32(_BT_MALFORM):
- fallthrough
- case int32(_BT_TRAIL):
- fallthrough
- case int32(_BT_CR):
- fallthrough
- case int32(_BT_LF):
- fallthrough
- case int32(_BT_RSQB):
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return int32(m_XML_TOK_DATA_CHARS)
- default:
- ptr += uintptr(1)
- break
- }
- }
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return int32(m_XML_TOK_DATA_CHARS)
- }
- /* ptr points to character following "</" */
- func _normal_scanEndTag(tls *libc.TLS, enc uintptr, ptr uintptr, end uintptr, nextTokPtr uintptr) (r int32) {
- if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(1))) {
- return -int32(1)
- }
- switch libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr))))))) {
- case int32(_BT_NONASCII):
- if !(libc.Int32FromInt32(0) != 0) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- } /* fall through */
- fallthrough
- case int32(_BT_NMSTRT):
- fallthrough
- case int32(_BT_HEX):
- ptr += uintptr(1)
- case int32(_BT_LEAD2):
- if int64(end)-int64(ptr) < int64(libc.Int32FromInt32(2)) {
- return -int32(2)
- }
- 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) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(2)
- case int32(_BT_LEAD3):
- if int64(end)-int64(ptr) < int64(libc.Int32FromInt32(3)) {
- return -int32(2)
- }
- 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) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(3)
- case int32(_BT_LEAD4):
- if int64(end)-int64(ptr) < int64(libc.Int32FromInt32(4)) {
- return -int32(2)
- }
- 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) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(4)
- default:
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- for int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(1)) {
- switch libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr))))))) {
- case int32(_BT_NONASCII):
- goto _1
- case int32(_BT_MINUS):
- goto _2
- case int32(_BT_NAME):
- goto _3
- case int32(_BT_DIGIT):
- goto _4
- case int32(_BT_HEX):
- goto _5
- case int32(_BT_NMSTRT):
- goto _6
- case int32(_BT_LEAD2):
- goto _7
- case int32(_BT_LEAD3):
- goto _8
- case int32(_BT_LEAD4):
- goto _9
- case int32(_BT_LF):
- goto _10
- case int32(_BT_CR):
- goto _11
- case int32(_BT_S):
- goto _12
- case int32(_BT_COLON):
- goto _13
- case int32(_BT_GT):
- goto _14
- default:
- goto _15
- }
- goto _16
- _1:
- ;
- if !(libc.Int32FromInt32(0) != 0) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- } /* fall through */
- _6:
- ;
- _5:
- ;
- _4:
- ;
- _3:
- ;
- _2:
- ;
- ptr += uintptr(1)
- goto _16
- _7:
- ;
- if int64(end)-int64(ptr) < int64(2) {
- return -int32(2)
- }
- 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) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(2)
- goto _16
- _8:
- ;
- if int64(end)-int64(ptr) < int64(3) {
- return -int32(2)
- }
- 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) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(3)
- goto _16
- _9:
- ;
- if int64(end)-int64(ptr) < int64(4) {
- return -int32(2)
- }
- 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) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(4)
- goto _16
- _12:
- ;
- _11:
- ;
- _10:
- ;
- ptr += uintptr(1)
- _19:
- ;
- if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(1))) {
- goto _17
- }
- switch libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr))))))) {
- case int32(_BT_S):
- fallthrough
- case int32(_BT_CR):
- fallthrough
- case int32(_BT_LF):
- case int32(_BT_GT):
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(1)
- return int32(m_XML_TOK_END_TAG)
- default:
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- goto _18
- _18:
- ;
- ptr += uintptr(1)
- goto _19
- goto _17
- _17:
- ;
- return -int32(1)
- _13:
- ;
- /* no need to check qname syntax here,
- since end-tag must match exactly */
- ptr += uintptr(1)
- goto _16
- _14:
- ;
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(1)
- return int32(m_XML_TOK_END_TAG)
- _15:
- ;
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- _16:
- }
- return -int32(1)
- }
- /* ptr points to character following "&#X" */
- func _normal_scanHexCharRef(tls *libc.TLS, enc uintptr, ptr uintptr, end uintptr, nextTokPtr uintptr) (r int32) {
- if int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(1)) {
- switch libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr))))))) {
- case int32(_BT_DIGIT):
- fallthrough
- case int32(_BT_HEX):
- default:
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(1)
- for {
- if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(1))) {
- break
- }
- switch libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr))))))) {
- case int32(_BT_DIGIT):
- fallthrough
- case int32(_BT_HEX):
- case int32(_BT_SEMI):
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(1)
- return int32(m_XML_TOK_CHAR_REF)
- default:
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- goto _1
- _1:
- ;
- ptr += uintptr(1)
- }
- }
- return -int32(1)
- }
- /* ptr points to character following "&#" */
- func _normal_scanCharRef(tls *libc.TLS, enc uintptr, ptr uintptr, end uintptr, nextTokPtr uintptr) (r int32) {
- if int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(1)) {
- if int32(*(*int8)(unsafe.Pointer(ptr))) == int32(m_ASCII_x2) {
- return _normal_scanHexCharRef(tls, enc, ptr+uintptr(1), end, nextTokPtr)
- }
- switch libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr))))))) {
- case int32(_BT_DIGIT):
- default:
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(1)
- for {
- if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(1))) {
- break
- }
- switch libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr))))))) {
- case int32(_BT_DIGIT):
- case int32(_BT_SEMI):
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(1)
- return int32(m_XML_TOK_CHAR_REF)
- default:
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- goto _1
- _1:
- ;
- ptr += uintptr(1)
- }
- }
- return -int32(1)
- }
- /* ptr points to character following "&" */
- func _normal_scanRef(tls *libc.TLS, enc uintptr, ptr uintptr, end uintptr, nextTokPtr uintptr) (r int32) {
- if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(1))) {
- return -int32(1)
- }
- switch libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr))))))) {
- case int32(_BT_NONASCII):
- if !(libc.Int32FromInt32(0) != 0) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- } /* fall through */
- fallthrough
- case int32(_BT_NMSTRT):
- fallthrough
- case int32(_BT_HEX):
- ptr += uintptr(1)
- case int32(_BT_LEAD2):
- if int64(end)-int64(ptr) < int64(libc.Int32FromInt32(2)) {
- return -int32(2)
- }
- 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) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(2)
- case int32(_BT_LEAD3):
- if int64(end)-int64(ptr) < int64(libc.Int32FromInt32(3)) {
- return -int32(2)
- }
- 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) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(3)
- case int32(_BT_LEAD4):
- if int64(end)-int64(ptr) < int64(libc.Int32FromInt32(4)) {
- return -int32(2)
- }
- 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) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(4)
- case int32(_BT_NUM):
- return _normal_scanCharRef(tls, enc, ptr+uintptr(1), end, nextTokPtr)
- default:
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- for int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(1)) {
- switch libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr))))))) {
- case int32(_BT_NONASCII):
- if !(libc.Int32FromInt32(0) != 0) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- } /* fall through */
- fallthrough
- case int32(_BT_NMSTRT):
- fallthrough
- case int32(_BT_HEX):
- fallthrough
- case int32(_BT_DIGIT):
- fallthrough
- case int32(_BT_NAME):
- fallthrough
- case int32(_BT_MINUS):
- ptr += uintptr(1)
- case int32(_BT_LEAD2):
- if int64(end)-int64(ptr) < int64(2) {
- return -int32(2)
- }
- 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) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(2)
- case int32(_BT_LEAD3):
- if int64(end)-int64(ptr) < int64(3) {
- return -int32(2)
- }
- 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) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(3)
- case int32(_BT_LEAD4):
- if int64(end)-int64(ptr) < int64(4) {
- return -int32(2)
- }
- 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) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(4)
- case int32(_BT_SEMI):
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(1)
- return int32(m_XML_TOK_ENTITY_REF)
- default:
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- }
- return -int32(1)
- }
- /* ptr points to character following first character of attribute name */
- func _normal_scanAtts(tls *libc.TLS, enc uintptr, _ptr uintptr, end uintptr, nextTokPtr uintptr) (r int32) {
- bp := tls.Alloc(16)
- defer tls.Free(16)
- *(*uintptr)(unsafe.Pointer(bp)) = _ptr
- var hadColon, open, t, t1, tok int32
- _, _, _, _, _ = hadColon, open, t, t1, tok
- hadColon = 0
- for int64(end)-int64(*(*uintptr)(unsafe.Pointer(bp))) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(1)) {
- switch libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp))))))))) {
- case int32(_BT_NONASCII):
- goto _1
- case int32(_BT_MINUS):
- goto _2
- case int32(_BT_NAME):
- goto _3
- case int32(_BT_DIGIT):
- goto _4
- case int32(_BT_HEX):
- goto _5
- case int32(_BT_NMSTRT):
- goto _6
- case int32(_BT_LEAD2):
- goto _7
- case int32(_BT_LEAD3):
- goto _8
- case int32(_BT_LEAD4):
- goto _9
- case int32(_BT_COLON):
- goto _10
- case int32(_BT_LF):
- goto _11
- case int32(_BT_CR):
- goto _12
- case int32(_BT_S):
- goto _13
- case int32(_BT_EQUALS):
- goto _14
- default:
- goto _15
- }
- goto _16
- _1:
- ;
- if !(libc.Int32FromInt32(0) != 0) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = *(*uintptr)(unsafe.Pointer(bp))
- return m_XML_TOK_INVALID
- } /* fall through */
- _6:
- ;
- _5:
- ;
- _4:
- ;
- _3:
- ;
- _2:
- ;
- *(*uintptr)(unsafe.Pointer(bp)) += uintptr(1)
- goto _16
- _7:
- ;
- if int64(end)-int64(*(*uintptr)(unsafe.Pointer(bp))) < int64(2) {
- return -int32(2)
- }
- 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) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = *(*uintptr)(unsafe.Pointer(bp))
- return m_XML_TOK_INVALID
- }
- *(*uintptr)(unsafe.Pointer(bp)) += uintptr(2)
- goto _16
- _8:
- ;
- if int64(end)-int64(*(*uintptr)(unsafe.Pointer(bp))) < int64(3) {
- return -int32(2)
- }
- 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) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = *(*uintptr)(unsafe.Pointer(bp))
- return m_XML_TOK_INVALID
- }
- *(*uintptr)(unsafe.Pointer(bp)) += uintptr(3)
- goto _16
- _9:
- ;
- if int64(end)-int64(*(*uintptr)(unsafe.Pointer(bp))) < int64(4) {
- return -int32(2)
- }
- 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) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = *(*uintptr)(unsafe.Pointer(bp))
- return m_XML_TOK_INVALID
- }
- *(*uintptr)(unsafe.Pointer(bp)) += uintptr(4)
- goto _16
- _10:
- ;
- if hadColon != 0 {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = *(*uintptr)(unsafe.Pointer(bp))
- return m_XML_TOK_INVALID
- }
- hadColon = int32(1)
- *(*uintptr)(unsafe.Pointer(bp)) += uintptr(1)
- if !(int64(end)-int64(*(*uintptr)(unsafe.Pointer(bp))) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(1))) {
- return -int32(1)
- }
- switch libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp))))))))) {
- case int32(_BT_NONASCII):
- if !(libc.Int32FromInt32(0) != 0) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = *(*uintptr)(unsafe.Pointer(bp))
- return m_XML_TOK_INVALID
- } /* fall through */
- fallthrough
- case int32(_BT_NMSTRT):
- fallthrough
- case int32(_BT_HEX):
- *(*uintptr)(unsafe.Pointer(bp)) += uintptr(1)
- case int32(_BT_LEAD2):
- if int64(end)-int64(*(*uintptr)(unsafe.Pointer(bp))) < int64(libc.Int32FromInt32(2)) {
- return -int32(2)
- }
- 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) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = *(*uintptr)(unsafe.Pointer(bp))
- return m_XML_TOK_INVALID
- }
- *(*uintptr)(unsafe.Pointer(bp)) += uintptr(2)
- case int32(_BT_LEAD3):
- if int64(end)-int64(*(*uintptr)(unsafe.Pointer(bp))) < int64(libc.Int32FromInt32(3)) {
- return -int32(2)
- }
- 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) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = *(*uintptr)(unsafe.Pointer(bp))
- return m_XML_TOK_INVALID
- }
- *(*uintptr)(unsafe.Pointer(bp)) += uintptr(3)
- case int32(_BT_LEAD4):
- if int64(end)-int64(*(*uintptr)(unsafe.Pointer(bp))) < int64(libc.Int32FromInt32(4)) {
- return -int32(2)
- }
- 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) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = *(*uintptr)(unsafe.Pointer(bp))
- return m_XML_TOK_INVALID
- }
- *(*uintptr)(unsafe.Pointer(bp)) += uintptr(4)
- default:
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = *(*uintptr)(unsafe.Pointer(bp))
- return m_XML_TOK_INVALID
- }
- goto _16
- _13:
- ;
- _12:
- ;
- _11:
- ;
- _19:
- ;
- *(*uintptr)(unsafe.Pointer(bp)) += uintptr(1)
- if !(int64(end)-int64(*(*uintptr)(unsafe.Pointer(bp))) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(1))) {
- return -int32(1)
- }
- t = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))))))))
- if t == int32(_BT_EQUALS) {
- goto _17
- }
- switch t {
- case int32(_BT_S):
- fallthrough
- case int32(_BT_LF):
- fallthrough
- case int32(_BT_CR):
- default:
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = *(*uintptr)(unsafe.Pointer(bp))
- return m_XML_TOK_INVALID
- }
- goto _18
- _18:
- ;
- goto _19
- goto _17
- _17:
- ;
- /* fall through */
- _14:
- ;
- hadColon = 0
- for {
- *(*uintptr)(unsafe.Pointer(bp)) += uintptr(1)
- if !(int64(end)-int64(*(*uintptr)(unsafe.Pointer(bp))) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(1))) {
- return -int32(1)
- }
- open = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))))))))
- if open == int32(_BT_QUOT) || open == int32(_BT_APOS) {
- break
- }
- switch open {
- case int32(_BT_S):
- fallthrough
- case int32(_BT_LF):
- fallthrough
- case int32(_BT_CR):
- default:
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = *(*uintptr)(unsafe.Pointer(bp))
- return m_XML_TOK_INVALID
- }
- goto _20
- _20:
- }
- *(*uintptr)(unsafe.Pointer(bp)) += uintptr(1)
- /* in attribute value */
- for {
- if !(int64(end)-int64(*(*uintptr)(unsafe.Pointer(bp))) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(1))) {
- return -int32(1)
- }
- t1 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))))))))
- if t1 == open {
- break
- }
- switch t1 {
- case int32(_BT_LEAD2):
- if int64(end)-int64(*(*uintptr)(unsafe.Pointer(bp))) < int64(2) {
- return -int32(2)
- }
- if (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisInvalid2})))(tls, enc, *(*uintptr)(unsafe.Pointer(bp))) != 0 {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = *(*uintptr)(unsafe.Pointer(bp))
- return m_XML_TOK_INVALID
- }
- *(*uintptr)(unsafe.Pointer(bp)) += uintptr(2)
- case int32(_BT_LEAD3):
- if int64(end)-int64(*(*uintptr)(unsafe.Pointer(bp))) < int64(3) {
- return -int32(2)
- }
- if (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisInvalid3})))(tls, enc, *(*uintptr)(unsafe.Pointer(bp))) != 0 {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = *(*uintptr)(unsafe.Pointer(bp))
- return m_XML_TOK_INVALID
- }
- *(*uintptr)(unsafe.Pointer(bp)) += uintptr(3)
- case int32(_BT_LEAD4):
- if int64(end)-int64(*(*uintptr)(unsafe.Pointer(bp))) < int64(4) {
- return -int32(2)
- }
- if (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisInvalid4})))(tls, enc, *(*uintptr)(unsafe.Pointer(bp))) != 0 {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = *(*uintptr)(unsafe.Pointer(bp))
- return m_XML_TOK_INVALID
- }
- *(*uintptr)(unsafe.Pointer(bp)) += uintptr(4)
- case int32(_BT_NONXML):
- fallthrough
- case int32(_BT_MALFORM):
- fallthrough
- case int32(_BT_TRAIL):
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = *(*uintptr)(unsafe.Pointer(bp))
- return m_XML_TOK_INVALID
- case int32(_BT_AMP):
- tok = _normal_scanRef(tls, enc, *(*uintptr)(unsafe.Pointer(bp))+uintptr(1), end, bp)
- if tok <= 0 {
- if tok == m_XML_TOK_INVALID {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = *(*uintptr)(unsafe.Pointer(bp))
- }
- return tok
- }
- case int32(_BT_LT):
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = *(*uintptr)(unsafe.Pointer(bp))
- return m_XML_TOK_INVALID
- default:
- *(*uintptr)(unsafe.Pointer(bp)) += uintptr(1)
- break
- }
- goto _21
- _21:
- }
- *(*uintptr)(unsafe.Pointer(bp)) += uintptr(1)
- if !(int64(end)-int64(*(*uintptr)(unsafe.Pointer(bp))) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(1))) {
- return -int32(1)
- }
- switch libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp))))))))) {
- case int32(_BT_S):
- fallthrough
- case int32(_BT_CR):
- fallthrough
- case int32(_BT_LF):
- case int32(_BT_SOL):
- goto sol
- case int32(_BT_GT):
- goto gt
- default:
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = *(*uintptr)(unsafe.Pointer(bp))
- return m_XML_TOK_INVALID
- }
- /* ptr points to closing quote */
- _24:
- ;
- *(*uintptr)(unsafe.Pointer(bp)) += uintptr(1)
- if !(int64(end)-int64(*(*uintptr)(unsafe.Pointer(bp))) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(1))) {
- return -int32(1)
- }
- switch libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp))))))))) {
- case int32(_BT_NONASCII):
- goto _25
- case int32(_BT_HEX):
- goto _26
- case int32(_BT_NMSTRT):
- goto _27
- case int32(_BT_LEAD2):
- goto _28
- case int32(_BT_LEAD3):
- goto _29
- case int32(_BT_LEAD4):
- goto _30
- case int32(_BT_LF):
- goto _31
- case int32(_BT_CR):
- goto _32
- case int32(_BT_S):
- goto _33
- case int32(_BT_GT):
- goto _34
- case int32(_BT_SOL):
- goto _35
- default:
- goto _36
- }
- goto _37
- _25:
- ;
- if !(libc.Int32FromInt32(0) != 0) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = *(*uintptr)(unsafe.Pointer(bp))
- return m_XML_TOK_INVALID
- } /* fall through */
- _27:
- ;
- _26:
- ;
- *(*uintptr)(unsafe.Pointer(bp)) += uintptr(1)
- goto _37
- _28:
- ;
- if int64(end)-int64(*(*uintptr)(unsafe.Pointer(bp))) < int64(libc.Int32FromInt32(2)) {
- return -int32(2)
- }
- 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) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = *(*uintptr)(unsafe.Pointer(bp))
- return m_XML_TOK_INVALID
- }
- *(*uintptr)(unsafe.Pointer(bp)) += uintptr(2)
- goto _37
- _29:
- ;
- if int64(end)-int64(*(*uintptr)(unsafe.Pointer(bp))) < int64(libc.Int32FromInt32(3)) {
- return -int32(2)
- }
- 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) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = *(*uintptr)(unsafe.Pointer(bp))
- return m_XML_TOK_INVALID
- }
- *(*uintptr)(unsafe.Pointer(bp)) += uintptr(3)
- goto _37
- _30:
- ;
- if int64(end)-int64(*(*uintptr)(unsafe.Pointer(bp))) < int64(libc.Int32FromInt32(4)) {
- return -int32(2)
- }
- 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) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = *(*uintptr)(unsafe.Pointer(bp))
- return m_XML_TOK_INVALID
- }
- *(*uintptr)(unsafe.Pointer(bp)) += uintptr(4)
- goto _37
- _33:
- ;
- _32:
- ;
- _31:
- ;
- goto _23
- _34:
- ;
- goto gt
- gt:
- ;
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = *(*uintptr)(unsafe.Pointer(bp)) + uintptr(1)
- return int32(m_XML_TOK_START_TAG_WITH_ATTS)
- _35:
- ;
- goto sol
- sol:
- ;
- *(*uintptr)(unsafe.Pointer(bp)) += uintptr(1)
- if !(int64(end)-int64(*(*uintptr)(unsafe.Pointer(bp))) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(1))) {
- return -int32(1)
- }
- if !(int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp))))) == libc.Int32FromInt32(m_ASCII_GT1)) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = *(*uintptr)(unsafe.Pointer(bp))
- return m_XML_TOK_INVALID
- }
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = *(*uintptr)(unsafe.Pointer(bp)) + uintptr(1)
- return int32(m_XML_TOK_EMPTY_ELEMENT_WITH_ATTS)
- _36:
- ;
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = *(*uintptr)(unsafe.Pointer(bp))
- return m_XML_TOK_INVALID
- _37:
- ;
- goto _22
- goto _23
- _23:
- ;
- goto _24
- goto _22
- _22:
- ;
- goto _16
- _15:
- ;
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = *(*uintptr)(unsafe.Pointer(bp))
- return m_XML_TOK_INVALID
- _16:
- }
- return -int32(1)
- }
- /* ptr points to character following "<" */
- func _normal_scanLt(tls *libc.TLS, enc uintptr, ptr uintptr, end uintptr, nextTokPtr uintptr) (r int32) {
- var hadColon int32
- _ = hadColon
- if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(1))) {
- return -int32(1)
- }
- switch libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr))))))) {
- case int32(_BT_NONASCII):
- if !(libc.Int32FromInt32(0) != 0) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- } /* fall through */
- fallthrough
- case int32(_BT_NMSTRT):
- fallthrough
- case int32(_BT_HEX):
- ptr += uintptr(1)
- case int32(_BT_LEAD2):
- if int64(end)-int64(ptr) < int64(libc.Int32FromInt32(2)) {
- return -int32(2)
- }
- 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) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(2)
- case int32(_BT_LEAD3):
- if int64(end)-int64(ptr) < int64(libc.Int32FromInt32(3)) {
- return -int32(2)
- }
- 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) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(3)
- case int32(_BT_LEAD4):
- if int64(end)-int64(ptr) < int64(libc.Int32FromInt32(4)) {
- return -int32(2)
- }
- 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) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(4)
- case int32(_BT_EXCL):
- ptr += uintptr(1)
- if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(1))) {
- return -int32(1)
- }
- switch libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr))))))) {
- case int32(_BT_MINUS):
- return _normal_scanComment(tls, enc, ptr+uintptr(1), end, nextTokPtr)
- case int32(_BT_LSQB):
- return _normal_scanCdataSection(tls, enc, ptr+uintptr(1), end, nextTokPtr)
- }
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- case int32(_BT_QUEST):
- return _normal_scanPi(tls, enc, ptr+uintptr(1), end, nextTokPtr)
- case int32(_BT_SOL):
- return _normal_scanEndTag(tls, enc, ptr+uintptr(1), end, nextTokPtr)
- default:
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- hadColon = 0
- /* we have a start-tag */
- for int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(1)) {
- switch libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr))))))) {
- case int32(_BT_NONASCII):
- goto _1
- case int32(_BT_MINUS):
- goto _2
- case int32(_BT_NAME):
- goto _3
- case int32(_BT_DIGIT):
- goto _4
- case int32(_BT_HEX):
- goto _5
- case int32(_BT_NMSTRT):
- goto _6
- case int32(_BT_LEAD2):
- goto _7
- case int32(_BT_LEAD3):
- goto _8
- case int32(_BT_LEAD4):
- goto _9
- case int32(_BT_COLON):
- goto _10
- case int32(_BT_LF):
- goto _11
- case int32(_BT_CR):
- goto _12
- case int32(_BT_S):
- goto _13
- case int32(_BT_GT):
- goto _14
- case int32(_BT_SOL):
- goto _15
- default:
- goto _16
- }
- goto _17
- _1:
- ;
- if !(libc.Int32FromInt32(0) != 0) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- } /* fall through */
- _6:
- ;
- _5:
- ;
- _4:
- ;
- _3:
- ;
- _2:
- ;
- ptr += uintptr(1)
- goto _17
- _7:
- ;
- if int64(end)-int64(ptr) < int64(2) {
- return -int32(2)
- }
- 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) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(2)
- goto _17
- _8:
- ;
- if int64(end)-int64(ptr) < int64(3) {
- return -int32(2)
- }
- 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) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(3)
- goto _17
- _9:
- ;
- if int64(end)-int64(ptr) < int64(4) {
- return -int32(2)
- }
- 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) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(4)
- goto _17
- _10:
- ;
- if hadColon != 0 {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- hadColon = int32(1)
- ptr += uintptr(1)
- if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(1))) {
- return -int32(1)
- }
- switch libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr))))))) {
- case int32(_BT_NONASCII):
- if !(libc.Int32FromInt32(0) != 0) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- } /* fall through */
- fallthrough
- case int32(_BT_NMSTRT):
- fallthrough
- case int32(_BT_HEX):
- ptr += uintptr(1)
- case int32(_BT_LEAD2):
- if int64(end)-int64(ptr) < int64(libc.Int32FromInt32(2)) {
- return -int32(2)
- }
- 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) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(2)
- case int32(_BT_LEAD3):
- if int64(end)-int64(ptr) < int64(libc.Int32FromInt32(3)) {
- return -int32(2)
- }
- 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) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(3)
- case int32(_BT_LEAD4):
- if int64(end)-int64(ptr) < int64(libc.Int32FromInt32(4)) {
- return -int32(2)
- }
- 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) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(4)
- default:
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- goto _17
- _13:
- ;
- _12:
- ;
- _11:
- ;
- ptr += uintptr(1)
- for int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(1)) {
- switch libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr))))))) {
- case int32(_BT_NONASCII):
- if !(libc.Int32FromInt32(0) != 0) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- } /* fall through */
- fallthrough
- case int32(_BT_NMSTRT):
- fallthrough
- case int32(_BT_HEX):
- ptr += uintptr(1)
- case int32(_BT_LEAD2):
- if int64(end)-int64(ptr) < int64(libc.Int32FromInt32(2)) {
- return -int32(2)
- }
- 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) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(2)
- case int32(_BT_LEAD3):
- if int64(end)-int64(ptr) < int64(libc.Int32FromInt32(3)) {
- return -int32(2)
- }
- 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) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(3)
- case int32(_BT_LEAD4):
- if int64(end)-int64(ptr) < int64(libc.Int32FromInt32(4)) {
- return -int32(2)
- }
- 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) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(4)
- case int32(_BT_GT):
- goto gt
- case int32(_BT_SOL):
- goto sol
- case int32(_BT_S):
- fallthrough
- case int32(_BT_CR):
- fallthrough
- case int32(_BT_LF):
- ptr += uintptr(1)
- continue
- default:
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- return _normal_scanAtts(tls, enc, ptr, end, nextTokPtr)
- }
- return -int32(1)
- _14:
- ;
- goto gt
- gt:
- ;
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(1)
- return int32(m_XML_TOK_START_TAG_NO_ATTS)
- _15:
- ;
- goto sol
- sol:
- ;
- ptr += uintptr(1)
- if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(1))) {
- return -int32(1)
- }
- if !(int32(*(*int8)(unsafe.Pointer(ptr))) == libc.Int32FromInt32(m_ASCII_GT1)) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(1)
- return int32(m_XML_TOK_EMPTY_ELEMENT_NO_ATTS)
- _16:
- ;
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- _17:
- }
- return -int32(1)
- }
- func _normal_contentTok(tls *libc.TLS, enc uintptr, ptr uintptr, end uintptr, nextTokPtr uintptr) (r int32) {
- var n Tsize_t
- _ = n
- if ptr >= end {
- return -int32(4)
- }
- if int32(1) > int32(1) {
- n = libc.Uint64FromInt64(int64(end) - int64(ptr))
- if n&libc.Uint64FromInt32(libc.Int32FromInt32(1)-libc.Int32FromInt32(1)) != 0 {
- n &= libc.Uint64FromInt32(^(libc.Int32FromInt32(1) - libc.Int32FromInt32(1)))
- if n == uint64(0) {
- return -int32(1)
- }
- end = ptr + uintptr(n)
- }
- }
- switch libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr))))))) {
- case int32(_BT_LT):
- return _normal_scanLt(tls, enc, ptr+uintptr(1), end, nextTokPtr)
- case int32(_BT_AMP):
- return _normal_scanRef(tls, enc, ptr+uintptr(1), end, nextTokPtr)
- case int32(_BT_CR):
- ptr += uintptr(1)
- if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(1))) {
- return -int32(3)
- }
- if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr))))))) == int32(_BT_LF) {
- ptr += uintptr(1)
- }
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return int32(m_XML_TOK_DATA_NEWLINE)
- case int32(_BT_LF):
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(1)
- return int32(m_XML_TOK_DATA_NEWLINE)
- case int32(_BT_RSQB):
- ptr += uintptr(1)
- if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(1))) {
- return -int32(5)
- }
- if !(int32(*(*int8)(unsafe.Pointer(ptr))) == libc.Int32FromInt32(m_ASCII_RSQB1)) {
- break
- }
- ptr += uintptr(1)
- if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(1))) {
- return -int32(5)
- }
- if !(int32(*(*int8)(unsafe.Pointer(ptr))) == libc.Int32FromInt32(m_ASCII_GT1)) {
- ptr -= uintptr(1)
- break
- }
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- case int32(_BT_LEAD2):
- if int64(end)-int64(ptr) < int64(2) {
- return -int32(2)
- }
- if (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisInvalid2})))(tls, enc, ptr) != 0 {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(2)
- case int32(_BT_LEAD3):
- if int64(end)-int64(ptr) < int64(3) {
- return -int32(2)
- }
- if (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisInvalid3})))(tls, enc, ptr) != 0 {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(3)
- case int32(_BT_LEAD4):
- if int64(end)-int64(ptr) < int64(4) {
- return -int32(2)
- }
- if (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisInvalid4})))(tls, enc, ptr) != 0 {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(4)
- case int32(_BT_NONXML):
- fallthrough
- case int32(_BT_MALFORM):
- fallthrough
- case int32(_BT_TRAIL):
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- default:
- ptr += uintptr(1)
- break
- }
- for int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(1)) {
- switch libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr))))))) {
- case int32(_BT_LEAD2):
- 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 {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return int32(m_XML_TOK_DATA_CHARS)
- }
- ptr += uintptr(2)
- case int32(_BT_LEAD3):
- 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 {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return int32(m_XML_TOK_DATA_CHARS)
- }
- ptr += uintptr(3)
- case int32(_BT_LEAD4):
- 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 {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return int32(m_XML_TOK_DATA_CHARS)
- }
- ptr += uintptr(4)
- case int32(_BT_RSQB):
- if int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(2)*libc.Int32FromInt32(1)) {
- if !(int32(*(*int8)(unsafe.Pointer(ptr + libc.UintptrFromInt32(1)))) == libc.Int32FromInt32(m_ASCII_RSQB1)) {
- ptr += uintptr(1)
- break
- }
- if int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(3)*libc.Int32FromInt32(1)) {
- if !(int32(*(*int8)(unsafe.Pointer(ptr + uintptr(libc.Int32FromInt32(2)*libc.Int32FromInt32(1))))) == libc.Int32FromInt32(m_ASCII_GT1)) {
- ptr += uintptr(1)
- break
- }
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(libc.Int32FromInt32(2)*libc.Int32FromInt32(1))
- return m_XML_TOK_INVALID
- }
- }
- /* fall through */
- fallthrough
- case int32(_BT_AMP):
- fallthrough
- case int32(_BT_LT):
- fallthrough
- case int32(_BT_NONXML):
- fallthrough
- case int32(_BT_MALFORM):
- fallthrough
- case int32(_BT_TRAIL):
- fallthrough
- case int32(_BT_CR):
- fallthrough
- case int32(_BT_LF):
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return int32(m_XML_TOK_DATA_CHARS)
- default:
- ptr += uintptr(1)
- break
- }
- }
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return int32(m_XML_TOK_DATA_CHARS)
- }
- /* ptr points to character following "%" */
- func _normal_scanPercent(tls *libc.TLS, enc uintptr, ptr uintptr, end uintptr, nextTokPtr uintptr) (r int32) {
- if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(1))) {
- return -int32(1)
- }
- switch libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr))))))) {
- case int32(_BT_NONASCII):
- if !(libc.Int32FromInt32(0) != 0) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- } /* fall through */
- fallthrough
- case int32(_BT_NMSTRT):
- fallthrough
- case int32(_BT_HEX):
- ptr += uintptr(1)
- case int32(_BT_LEAD2):
- if int64(end)-int64(ptr) < int64(libc.Int32FromInt32(2)) {
- return -int32(2)
- }
- 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) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(2)
- case int32(_BT_LEAD3):
- if int64(end)-int64(ptr) < int64(libc.Int32FromInt32(3)) {
- return -int32(2)
- }
- 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) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(3)
- case int32(_BT_LEAD4):
- if int64(end)-int64(ptr) < int64(libc.Int32FromInt32(4)) {
- return -int32(2)
- }
- 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) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(4)
- case int32(_BT_S):
- fallthrough
- case int32(_BT_LF):
- fallthrough
- case int32(_BT_CR):
- fallthrough
- case int32(_BT_PERCNT):
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return int32(m_XML_TOK_PERCENT)
- default:
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- for int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(1)) {
- switch libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr))))))) {
- case int32(_BT_NONASCII):
- if !(libc.Int32FromInt32(0) != 0) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- } /* fall through */
- fallthrough
- case int32(_BT_NMSTRT):
- fallthrough
- case int32(_BT_HEX):
- fallthrough
- case int32(_BT_DIGIT):
- fallthrough
- case int32(_BT_NAME):
- fallthrough
- case int32(_BT_MINUS):
- ptr += uintptr(1)
- case int32(_BT_LEAD2):
- if int64(end)-int64(ptr) < int64(2) {
- return -int32(2)
- }
- 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) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(2)
- case int32(_BT_LEAD3):
- if int64(end)-int64(ptr) < int64(3) {
- return -int32(2)
- }
- 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) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(3)
- case int32(_BT_LEAD4):
- if int64(end)-int64(ptr) < int64(4) {
- return -int32(2)
- }
- 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) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(4)
- case int32(_BT_SEMI):
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(1)
- return int32(m_XML_TOK_PARAM_ENTITY_REF)
- default:
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- }
- return -int32(1)
- }
- func _normal_scanPoundName(tls *libc.TLS, enc uintptr, ptr uintptr, end uintptr, nextTokPtr uintptr) (r int32) {
- if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(1))) {
- return -int32(1)
- }
- switch libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr))))))) {
- case int32(_BT_NONASCII):
- if !(libc.Int32FromInt32(0) != 0) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- } /* fall through */
- fallthrough
- case int32(_BT_NMSTRT):
- fallthrough
- case int32(_BT_HEX):
- ptr += uintptr(1)
- case int32(_BT_LEAD2):
- if int64(end)-int64(ptr) < int64(libc.Int32FromInt32(2)) {
- return -int32(2)
- }
- 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) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(2)
- case int32(_BT_LEAD3):
- if int64(end)-int64(ptr) < int64(libc.Int32FromInt32(3)) {
- return -int32(2)
- }
- 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) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(3)
- case int32(_BT_LEAD4):
- if int64(end)-int64(ptr) < int64(libc.Int32FromInt32(4)) {
- return -int32(2)
- }
- 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) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(4)
- default:
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- for int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(1)) {
- switch libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr))))))) {
- case int32(_BT_NONASCII):
- if !(libc.Int32FromInt32(0) != 0) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- } /* fall through */
- fallthrough
- case int32(_BT_NMSTRT):
- fallthrough
- case int32(_BT_HEX):
- fallthrough
- case int32(_BT_DIGIT):
- fallthrough
- case int32(_BT_NAME):
- fallthrough
- case int32(_BT_MINUS):
- ptr += uintptr(1)
- case int32(_BT_LEAD2):
- if int64(end)-int64(ptr) < int64(2) {
- return -int32(2)
- }
- 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) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(2)
- case int32(_BT_LEAD3):
- if int64(end)-int64(ptr) < int64(3) {
- return -int32(2)
- }
- 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) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(3)
- case int32(_BT_LEAD4):
- if int64(end)-int64(ptr) < int64(4) {
- return -int32(2)
- }
- 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) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(4)
- case int32(_BT_CR):
- fallthrough
- case int32(_BT_LF):
- fallthrough
- case int32(_BT_S):
- fallthrough
- case int32(_BT_RPAR):
- fallthrough
- case int32(_BT_GT):
- fallthrough
- case int32(_BT_PERCNT):
- fallthrough
- case int32(_BT_VERBAR):
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return int32(m_XML_TOK_POUND_NAME)
- default:
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- }
- return -int32(m_XML_TOK_POUND_NAME)
- }
- func _normal_scanLit(tls *libc.TLS, open int32, enc uintptr, ptr uintptr, end uintptr, nextTokPtr uintptr) (r int32) {
- var t int32
- _ = t
- for int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(1)) {
- t = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr)))))))
- switch t {
- case int32(_BT_LEAD2):
- if int64(end)-int64(ptr) < int64(2) {
- return -int32(2)
- }
- if (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisInvalid2})))(tls, enc, ptr) != 0 {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(2)
- case int32(_BT_LEAD3):
- if int64(end)-int64(ptr) < int64(3) {
- return -int32(2)
- }
- if (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisInvalid3})))(tls, enc, ptr) != 0 {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(3)
- case int32(_BT_LEAD4):
- if int64(end)-int64(ptr) < int64(4) {
- return -int32(2)
- }
- if (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisInvalid4})))(tls, enc, ptr) != 0 {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(4)
- case int32(_BT_NONXML):
- fallthrough
- case int32(_BT_MALFORM):
- fallthrough
- case int32(_BT_TRAIL):
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- case int32(_BT_QUOT):
- fallthrough
- case int32(_BT_APOS):
- ptr += uintptr(1)
- if t != open {
- break
- }
- if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(1))) {
- return -int32(m_XML_TOK_LITERAL)
- }
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- switch libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr))))))) {
- case int32(_BT_S):
- fallthrough
- case int32(_BT_CR):
- fallthrough
- case int32(_BT_LF):
- fallthrough
- case int32(_BT_GT):
- fallthrough
- case int32(_BT_PERCNT):
- fallthrough
- case int32(_BT_LSQB):
- return int32(m_XML_TOK_LITERAL)
- default:
- return m_XML_TOK_INVALID
- }
- fallthrough
- default:
- ptr += uintptr(1)
- break
- }
- }
- return -int32(1)
- }
- func _normal_prologTok(tls *libc.TLS, enc uintptr, ptr uintptr, end uintptr, nextTokPtr uintptr) (r int32) {
- var n Tsize_t
- var tok int32
- _, _ = n, tok
- if ptr >= end {
- return -int32(4)
- }
- if int32(1) > int32(1) {
- n = libc.Uint64FromInt64(int64(end) - int64(ptr))
- if n&libc.Uint64FromInt32(libc.Int32FromInt32(1)-libc.Int32FromInt32(1)) != 0 {
- n &= libc.Uint64FromInt32(^(libc.Int32FromInt32(1) - libc.Int32FromInt32(1)))
- if n == uint64(0) {
- return -int32(1)
- }
- end = ptr + uintptr(n)
- }
- }
- switch libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr))))))) {
- case int32(_BT_QUOT):
- goto _1
- case int32(_BT_APOS):
- goto _2
- case int32(_BT_LT):
- goto _3
- case int32(_BT_CR):
- goto _4
- case int32(_BT_LF):
- goto _5
- case int32(_BT_S):
- goto _6
- case int32(_BT_PERCNT):
- goto _7
- case int32(_BT_COMMA):
- goto _8
- case int32(_BT_LSQB):
- goto _9
- case int32(_BT_RSQB):
- goto _10
- case int32(_BT_LPAR):
- goto _11
- case int32(_BT_RPAR):
- goto _12
- case int32(_BT_VERBAR):
- goto _13
- case int32(_BT_GT):
- goto _14
- case int32(_BT_NUM):
- goto _15
- case int32(_BT_LEAD2):
- goto _16
- case int32(_BT_LEAD3):
- goto _17
- case int32(_BT_LEAD4):
- goto _18
- case int32(_BT_HEX):
- goto _19
- case int32(_BT_NMSTRT):
- goto _20
- case int32(_BT_COLON):
- goto _21
- case int32(_BT_MINUS):
- goto _22
- case int32(_BT_NAME):
- goto _23
- case int32(_BT_DIGIT):
- goto _24
- case int32(_BT_NONASCII):
- goto _25
- default:
- goto _26
- }
- goto _27
- _1:
- ;
- return _normal_scanLit(tls, int32(_BT_QUOT), enc, ptr+uintptr(1), end, nextTokPtr)
- _2:
- ;
- return _normal_scanLit(tls, int32(_BT_APOS), enc, ptr+uintptr(1), end, nextTokPtr)
- _3:
- ;
- ptr += uintptr(1)
- if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(1))) {
- return -int32(1)
- }
- switch libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr))))))) {
- case int32(_BT_EXCL):
- return _normal_scanDecl(tls, enc, ptr+uintptr(1), end, nextTokPtr)
- case int32(_BT_QUEST):
- return _normal_scanPi(tls, enc, ptr+uintptr(1), end, nextTokPtr)
- case int32(_BT_NMSTRT):
- fallthrough
- case int32(_BT_HEX):
- fallthrough
- case int32(_BT_NONASCII):
- fallthrough
- case int32(_BT_LEAD2):
- fallthrough
- case int32(_BT_LEAD3):
- fallthrough
- case int32(_BT_LEAD4):
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr - uintptr(1)
- return int32(m_XML_TOK_INSTANCE_START)
- }
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- _4:
- ;
- if ptr+uintptr(1) == end {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = end
- /* indicate that this might be part of a CR/LF pair */
- return -int32(m_XML_TOK_PROLOG_S)
- }
- /* fall through */
- _6:
- ;
- _5:
- ;
- _30:
- ;
- ptr += uintptr(1)
- if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(1))) {
- goto _28
- }
- switch libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr))))))) {
- case int32(_BT_S):
- fallthrough
- case int32(_BT_LF):
- case int32(_BT_CR):
- /* don't split CR/LF pair */
- if ptr+uintptr(1) != end {
- break
- }
- /* fall through */
- fallthrough
- default:
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return int32(m_XML_TOK_PROLOG_S)
- }
- goto _29
- _29:
- ;
- goto _30
- goto _28
- _28:
- ;
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return int32(m_XML_TOK_PROLOG_S)
- _7:
- ;
- return _normal_scanPercent(tls, enc, ptr+uintptr(1), end, nextTokPtr)
- _8:
- ;
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(1)
- return int32(m_XML_TOK_COMMA)
- _9:
- ;
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(1)
- return int32(m_XML_TOK_OPEN_BRACKET)
- _10:
- ;
- ptr += uintptr(1)
- if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(1))) {
- return -int32(m_XML_TOK_CLOSE_BRACKET)
- }
- if int32(*(*int8)(unsafe.Pointer(ptr))) == int32(m_ASCII_RSQB1) {
- if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(2)*libc.Int32FromInt32(1))) {
- return -int32(1)
- }
- if int32(*(*int8)(unsafe.Pointer(ptr + libc.UintptrFromInt32(1)))) == int32(m_ASCII_GT1) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(libc.Int32FromInt32(2)*libc.Int32FromInt32(1))
- return int32(m_XML_TOK_COND_SECT_CLOSE)
- }
- }
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return int32(m_XML_TOK_CLOSE_BRACKET)
- _11:
- ;
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(1)
- return int32(m_XML_TOK_OPEN_PAREN)
- _12:
- ;
- ptr += uintptr(1)
- if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(1))) {
- return -int32(m_XML_TOK_CLOSE_PAREN)
- }
- switch libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr))))))) {
- case int32(_BT_AST):
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(1)
- return int32(m_XML_TOK_CLOSE_PAREN_ASTERISK)
- case int32(_BT_QUEST):
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(1)
- return int32(m_XML_TOK_CLOSE_PAREN_QUESTION)
- case int32(_BT_PLUS):
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(1)
- return int32(m_XML_TOK_CLOSE_PAREN_PLUS)
- case int32(_BT_CR):
- fallthrough
- case int32(_BT_LF):
- fallthrough
- case int32(_BT_S):
- fallthrough
- case int32(_BT_GT):
- fallthrough
- case int32(_BT_COMMA):
- fallthrough
- case int32(_BT_VERBAR):
- fallthrough
- case int32(_BT_RPAR):
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return int32(m_XML_TOK_CLOSE_PAREN)
- }
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- _13:
- ;
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(1)
- return int32(m_XML_TOK_OR)
- _14:
- ;
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(1)
- return int32(m_XML_TOK_DECL_CLOSE)
- _15:
- ;
- return _normal_scanPoundName(tls, enc, ptr+uintptr(1), end, nextTokPtr)
- _16:
- ;
- if int64(end)-int64(ptr) < int64(2) {
- return -int32(2)
- }
- if (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisInvalid2})))(tls, enc, ptr) != 0 {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- if (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisNmstrt2})))(tls, enc, ptr) != 0 {
- ptr += uintptr(2)
- tok = int32(m_XML_TOK_NAME)
- goto _27
- }
- if (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisName2})))(tls, enc, ptr) != 0 {
- ptr += uintptr(2)
- tok = int32(m_XML_TOK_NMTOKEN)
- goto _27
- }
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- _17:
- ;
- if int64(end)-int64(ptr) < int64(3) {
- return -int32(2)
- }
- if (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisInvalid3})))(tls, enc, ptr) != 0 {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- if (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisNmstrt3})))(tls, enc, ptr) != 0 {
- ptr += uintptr(3)
- tok = int32(m_XML_TOK_NAME)
- goto _27
- }
- if (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisName3})))(tls, enc, ptr) != 0 {
- ptr += uintptr(3)
- tok = int32(m_XML_TOK_NMTOKEN)
- goto _27
- }
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- _18:
- ;
- if int64(end)-int64(ptr) < int64(4) {
- return -int32(2)
- }
- if (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisInvalid4})))(tls, enc, ptr) != 0 {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- if (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisNmstrt4})))(tls, enc, ptr) != 0 {
- ptr += uintptr(4)
- tok = int32(m_XML_TOK_NAME)
- goto _27
- }
- if (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisName4})))(tls, enc, ptr) != 0 {
- ptr += uintptr(4)
- tok = int32(m_XML_TOK_NMTOKEN)
- goto _27
- }
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- _20:
- ;
- _19:
- ;
- tok = int32(m_XML_TOK_NAME)
- ptr += uintptr(1)
- goto _27
- _24:
- ;
- _23:
- ;
- _22:
- ;
- _21:
- ;
- tok = int32(m_XML_TOK_NMTOKEN)
- ptr += uintptr(1)
- goto _27
- _25:
- ;
- if 0 != 0 {
- ptr += uintptr(1)
- tok = int32(m_XML_TOK_NAME)
- goto _27
- }
- if 0 != 0 {
- ptr += uintptr(1)
- tok = int32(m_XML_TOK_NMTOKEN)
- goto _27
- }
- /* fall through */
- _26:
- ;
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- _27:
- ;
- for int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(1)) {
- switch libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr))))))) {
- case int32(_BT_NONASCII):
- if !(libc.Int32FromInt32(0) != 0) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- } /* fall through */
- fallthrough
- case int32(_BT_NMSTRT):
- fallthrough
- case int32(_BT_HEX):
- fallthrough
- case int32(_BT_DIGIT):
- fallthrough
- case int32(_BT_NAME):
- fallthrough
- case int32(_BT_MINUS):
- ptr += uintptr(1)
- case int32(_BT_LEAD2):
- if int64(end)-int64(ptr) < int64(2) {
- return -int32(2)
- }
- 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) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(2)
- case int32(_BT_LEAD3):
- if int64(end)-int64(ptr) < int64(3) {
- return -int32(2)
- }
- 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) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(3)
- case int32(_BT_LEAD4):
- if int64(end)-int64(ptr) < int64(4) {
- return -int32(2)
- }
- 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) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(4)
- case int32(_BT_GT):
- fallthrough
- case int32(_BT_RPAR):
- fallthrough
- case int32(_BT_COMMA):
- fallthrough
- case int32(_BT_VERBAR):
- fallthrough
- case int32(_BT_LSQB):
- fallthrough
- case int32(_BT_PERCNT):
- fallthrough
- case int32(_BT_S):
- fallthrough
- case int32(_BT_CR):
- fallthrough
- case int32(_BT_LF):
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return tok
- case int32(_BT_COLON):
- ptr += uintptr(1)
- switch tok {
- case int32(m_XML_TOK_NAME):
- if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(1))) {
- return -int32(1)
- }
- tok = int32(m_XML_TOK_PREFIXED_NAME)
- switch libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr))))))) {
- case int32(_BT_NONASCII):
- if !(libc.Int32FromInt32(0) != 0) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- } /* fall through */
- fallthrough
- case int32(_BT_NMSTRT):
- fallthrough
- case int32(_BT_HEX):
- fallthrough
- case int32(_BT_DIGIT):
- fallthrough
- case int32(_BT_NAME):
- fallthrough
- case int32(_BT_MINUS):
- ptr += uintptr(1)
- case int32(_BT_LEAD2):
- if int64(end)-int64(ptr) < int64(2) {
- return -int32(2)
- }
- 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) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(2)
- case int32(_BT_LEAD3):
- if int64(end)-int64(ptr) < int64(3) {
- return -int32(2)
- }
- 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) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(3)
- case int32(_BT_LEAD4):
- if int64(end)-int64(ptr) < int64(4) {
- return -int32(2)
- }
- 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) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(4)
- default:
- tok = int32(m_XML_TOK_NMTOKEN)
- break
- }
- case int32(m_XML_TOK_PREFIXED_NAME):
- tok = int32(m_XML_TOK_NMTOKEN)
- break
- }
- case int32(_BT_PLUS):
- if tok == int32(m_XML_TOK_NMTOKEN) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(1)
- return int32(m_XML_TOK_NAME_PLUS)
- case int32(_BT_AST):
- if tok == int32(m_XML_TOK_NMTOKEN) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(1)
- return int32(m_XML_TOK_NAME_ASTERISK)
- case int32(_BT_QUEST):
- if tok == int32(m_XML_TOK_NMTOKEN) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(1)
- return int32(m_XML_TOK_NAME_QUESTION)
- default:
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- }
- return -tok
- }
- func _normal_attributeValueTok(tls *libc.TLS, enc uintptr, ptr uintptr, end uintptr, nextTokPtr uintptr) (r int32) {
- var start uintptr
- _ = start
- if ptr >= end {
- return -int32(4)
- } else {
- if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(1))) {
- /* This line cannot be executed. The incoming data has already
- * been tokenized once, so incomplete characters like this have
- * already been eliminated from the input. Retaining the paranoia
- * check is still valuable, however.
- */
- return -int32(1) /* LCOV_EXCL_LINE */
- }
- }
- start = ptr
- for int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(1)) {
- switch libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr))))))) {
- case int32(_BT_LEAD2):
- ptr += uintptr(2) /* NOTE: The encoding has already been validated. */
- case int32(_BT_LEAD3):
- ptr += uintptr(3) /* NOTE: The encoding has already been validated. */
- case int32(_BT_LEAD4):
- ptr += uintptr(4) /* NOTE: The encoding has already been validated. */
- case int32(_BT_AMP):
- if ptr == start {
- return _normal_scanRef(tls, enc, ptr+uintptr(1), end, nextTokPtr)
- }
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return int32(m_XML_TOK_DATA_CHARS)
- case int32(_BT_LT):
- /* this is for inside entity references */
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- case int32(_BT_LF):
- if ptr == start {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(1)
- return int32(m_XML_TOK_DATA_NEWLINE)
- }
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return int32(m_XML_TOK_DATA_CHARS)
- case int32(_BT_CR):
- if ptr == start {
- ptr += uintptr(1)
- if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(1))) {
- return -int32(3)
- }
- if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr))))))) == int32(_BT_LF) {
- ptr += uintptr(1)
- }
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return int32(m_XML_TOK_DATA_NEWLINE)
- }
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return int32(m_XML_TOK_DATA_CHARS)
- case int32(_BT_S):
- if ptr == start {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(1)
- return int32(m_XML_TOK_ATTRIBUTE_VALUE_S)
- }
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return int32(m_XML_TOK_DATA_CHARS)
- default:
- ptr += uintptr(1)
- break
- }
- }
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return int32(m_XML_TOK_DATA_CHARS)
- }
- func _normal_entityValueTok(tls *libc.TLS, enc uintptr, ptr uintptr, end uintptr, nextTokPtr uintptr) (r int32) {
- var start uintptr
- var tok, v1 int32
- _, _, _ = start, tok, v1
- if ptr >= end {
- return -int32(4)
- } else {
- if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(1))) {
- /* This line cannot be executed. The incoming data has already
- * been tokenized once, so incomplete characters like this have
- * already been eliminated from the input. Retaining the paranoia
- * check is still valuable, however.
- */
- return -int32(1) /* LCOV_EXCL_LINE */
- }
- }
- start = ptr
- for int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(1)) {
- switch libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr))))))) {
- case int32(_BT_LEAD2):
- ptr += uintptr(2) /* NOTE: The encoding has already been validated. */
- case int32(_BT_LEAD3):
- ptr += uintptr(3) /* NOTE: The encoding has already been validated. */
- case int32(_BT_LEAD4):
- ptr += uintptr(4) /* NOTE: The encoding has already been validated. */
- case int32(_BT_AMP):
- if ptr == start {
- return _normal_scanRef(tls, enc, ptr+uintptr(1), end, nextTokPtr)
- }
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return int32(m_XML_TOK_DATA_CHARS)
- case int32(_BT_PERCNT):
- if ptr == start {
- tok = _normal_scanPercent(tls, enc, ptr+uintptr(1), end, nextTokPtr)
- if tok == int32(m_XML_TOK_PERCENT) {
- v1 = m_XML_TOK_INVALID
- } else {
- v1 = tok
- }
- return v1
- }
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return int32(m_XML_TOK_DATA_CHARS)
- case int32(_BT_LF):
- if ptr == start {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(1)
- return int32(m_XML_TOK_DATA_NEWLINE)
- }
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return int32(m_XML_TOK_DATA_CHARS)
- case int32(_BT_CR):
- if ptr == start {
- ptr += uintptr(1)
- if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(1))) {
- return -int32(3)
- }
- if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr))))))) == int32(_BT_LF) {
- ptr += uintptr(1)
- }
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return int32(m_XML_TOK_DATA_NEWLINE)
- }
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return int32(m_XML_TOK_DATA_CHARS)
- default:
- ptr += uintptr(1)
- break
- }
- }
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return int32(m_XML_TOK_DATA_CHARS)
- }
- func _normal_ignoreSectionTok(tls *libc.TLS, enc uintptr, ptr uintptr, end uintptr, nextTokPtr uintptr) (r int32) {
- var level int32
- var n Tsize_t
- _, _ = level, n
- level = 0
- if int32(1) > int32(1) {
- n = libc.Uint64FromInt64(int64(end) - int64(ptr))
- if n&libc.Uint64FromInt32(libc.Int32FromInt32(1)-libc.Int32FromInt32(1)) != 0 {
- n &= libc.Uint64FromInt32(^(libc.Int32FromInt32(1) - libc.Int32FromInt32(1)))
- end = ptr + uintptr(n)
- }
- }
- for int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(1)) {
- switch libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr))))))) {
- case int32(_BT_LEAD2):
- if int64(end)-int64(ptr) < int64(2) {
- return -int32(2)
- }
- if (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisInvalid2})))(tls, enc, ptr) != 0 {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(2)
- case int32(_BT_LEAD3):
- if int64(end)-int64(ptr) < int64(3) {
- return -int32(2)
- }
- if (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisInvalid3})))(tls, enc, ptr) != 0 {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(3)
- case int32(_BT_LEAD4):
- if int64(end)-int64(ptr) < int64(4) {
- return -int32(2)
- }
- if (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tnormal_encoding)(unsafe.Pointer(enc)).FisInvalid4})))(tls, enc, ptr) != 0 {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(4)
- case int32(_BT_NONXML):
- fallthrough
- case int32(_BT_MALFORM):
- fallthrough
- case int32(_BT_TRAIL):
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- case int32(_BT_LT):
- ptr += uintptr(1)
- if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(1))) {
- return -int32(1)
- }
- if int32(*(*int8)(unsafe.Pointer(ptr))) == int32(m_ASCII_EXCL2) {
- ptr += uintptr(1)
- if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(1))) {
- return -int32(1)
- }
- if int32(*(*int8)(unsafe.Pointer(ptr))) == int32(m_ASCII_LSQB1) {
- level++
- ptr += uintptr(1)
- }
- }
- case int32(_BT_RSQB):
- ptr += uintptr(1)
- if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(1))) {
- return -int32(1)
- }
- if int32(*(*int8)(unsafe.Pointer(ptr))) == int32(m_ASCII_RSQB1) {
- ptr += uintptr(1)
- if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(1))) {
- return -int32(1)
- }
- if int32(*(*int8)(unsafe.Pointer(ptr))) == int32(m_ASCII_GT1) {
- ptr += uintptr(1)
- if level == 0 {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return int32(m_XML_TOK_IGNORE_SECT)
- }
- level--
- }
- }
- default:
- ptr += uintptr(1)
- break
- }
- }
- return -int32(1)
- }
- func _normal_isPublicId(tls *libc.TLS, enc uintptr, ptr uintptr, end uintptr, badPtr uintptr) (r int32) {
- ptr += uintptr(1)
- end -= uintptr(1)
- for {
- if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(1))) {
- break
- }
- switch libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr))))))) {
- case int32(_BT_DIGIT):
- fallthrough
- case int32(_BT_HEX):
- fallthrough
- case int32(_BT_MINUS):
- fallthrough
- case int32(_BT_APOS):
- fallthrough
- case int32(_BT_LPAR):
- fallthrough
- case int32(_BT_RPAR):
- fallthrough
- case int32(_BT_PLUS):
- fallthrough
- case int32(_BT_COMMA):
- fallthrough
- case int32(_BT_SOL):
- fallthrough
- case int32(_BT_EQUALS):
- fallthrough
- case int32(_BT_QUEST):
- fallthrough
- case int32(_BT_CR):
- fallthrough
- case int32(_BT_LF):
- fallthrough
- case int32(_BT_SEMI):
- fallthrough
- case int32(_BT_EXCL):
- fallthrough
- case int32(_BT_AST):
- fallthrough
- case int32(_BT_PERCNT):
- fallthrough
- case int32(_BT_NUM):
- fallthrough
- case int32(_BT_COLON):
- case int32(_BT_S):
- if int32(*(*int8)(unsafe.Pointer(ptr))) == int32(m_ASCII_TAB1) {
- *(*uintptr)(unsafe.Pointer(badPtr)) = ptr
- return 0
- }
- case int32(_BT_NAME):
- fallthrough
- case int32(_BT_NMSTRT):
- if !(int32(*(*int8)(unsafe.Pointer(ptr))) & ^libc.Int32FromInt32(0x7f) != 0) {
- break
- }
- /* fall through */
- fallthrough
- default:
- switch int32(*(*int8)(unsafe.Pointer(ptr))) {
- case int32(0x24): /* $ */
- fallthrough
- case int32(0x40): /* @ */
- default:
- *(*uintptr)(unsafe.Pointer(badPtr)) = ptr
- return 0
- }
- break
- }
- goto _1
- _1:
- ;
- ptr += uintptr(1)
- }
- return int32(1)
- }
- /* This must only be called for a well-formed start-tag or empty
- element tag. Returns the number of attributes. Pointers to the
- first attsMax attributes are stored in atts.
- */
- func _normal_getAtts(tls *libc.TLS, enc uintptr, ptr uintptr, attsMax int32, atts uintptr) (r int32) {
- var nAtts, open, state int32
- _, _, _ = nAtts, open, state
- state = 1
- nAtts = 0
- open = 0 /* defined when state == inValue;
- initialization just to shut up compilers */
- ptr += uintptr(1)
- for {
- switch libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr))))))) {
- case int32(_BT_LEAD2):
- if state == 0 {
- if nAtts < attsMax {
- (*(*TATTRIBUTE)(unsafe.Pointer(atts + uintptr(nAtts)*32))).Fname = ptr
- (*(*TATTRIBUTE)(unsafe.Pointer(atts + uintptr(nAtts)*32))).Fnormalized = int8(1)
- }
- state = 1
- }
- ptr += uintptr(libc.Int32FromInt32(2) - libc.Int32FromInt32(1))
- case int32(_BT_LEAD3):
- if state == 0 {
- if nAtts < attsMax {
- (*(*TATTRIBUTE)(unsafe.Pointer(atts + uintptr(nAtts)*32))).Fname = ptr
- (*(*TATTRIBUTE)(unsafe.Pointer(atts + uintptr(nAtts)*32))).Fnormalized = int8(1)
- }
- state = 1
- }
- ptr += uintptr(libc.Int32FromInt32(3) - libc.Int32FromInt32(1))
- case int32(_BT_LEAD4):
- if state == 0 {
- if nAtts < attsMax {
- (*(*TATTRIBUTE)(unsafe.Pointer(atts + uintptr(nAtts)*32))).Fname = ptr
- (*(*TATTRIBUTE)(unsafe.Pointer(atts + uintptr(nAtts)*32))).Fnormalized = int8(1)
- }
- state = 1
- }
- ptr += uintptr(libc.Int32FromInt32(4) - libc.Int32FromInt32(1))
- case int32(_BT_NONASCII):
- fallthrough
- case int32(_BT_NMSTRT):
- fallthrough
- case int32(_BT_HEX):
- if state == 0 {
- if nAtts < attsMax {
- (*(*TATTRIBUTE)(unsafe.Pointer(atts + uintptr(nAtts)*32))).Fname = ptr
- (*(*TATTRIBUTE)(unsafe.Pointer(atts + uintptr(nAtts)*32))).Fnormalized = int8(1)
- }
- state = 1
- }
- case int32(_BT_QUOT):
- if state != 2 {
- if nAtts < attsMax {
- (*(*TATTRIBUTE)(unsafe.Pointer(atts + uintptr(nAtts)*32))).FvaluePtr = ptr + uintptr(1)
- }
- state = 2
- open = int32(_BT_QUOT)
- } else {
- if open == int32(_BT_QUOT) {
- state = 0
- if nAtts < attsMax {
- (*(*TATTRIBUTE)(unsafe.Pointer(atts + uintptr(nAtts)*32))).FvalueEnd = ptr
- }
- nAtts++
- }
- }
- case int32(_BT_APOS):
- if state != 2 {
- if nAtts < attsMax {
- (*(*TATTRIBUTE)(unsafe.Pointer(atts + uintptr(nAtts)*32))).FvaluePtr = ptr + uintptr(1)
- }
- state = 2
- open = int32(_BT_APOS)
- } else {
- if open == int32(_BT_APOS) {
- state = 0
- if nAtts < attsMax {
- (*(*TATTRIBUTE)(unsafe.Pointer(atts + uintptr(nAtts)*32))).FvalueEnd = ptr
- }
- nAtts++
- }
- }
- case int32(_BT_AMP):
- if nAtts < attsMax {
- (*(*TATTRIBUTE)(unsafe.Pointer(atts + uintptr(nAtts)*32))).Fnormalized = 0
- }
- case int32(_BT_S):
- if state == 1 {
- state = 0
- } else {
- 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) {
- (*(*TATTRIBUTE)(unsafe.Pointer(atts + uintptr(nAtts)*32))).Fnormalized = 0
- }
- }
- case int32(_BT_CR):
- fallthrough
- case int32(_BT_LF):
- /* This case ensures that the first attribute name is counted
- Apart from that we could just change state on the quote. */
- if state == 1 {
- state = 0
- } else {
- if state == 2 && nAtts < attsMax {
- (*(*TATTRIBUTE)(unsafe.Pointer(atts + uintptr(nAtts)*32))).Fnormalized = 0
- }
- }
- case int32(_BT_GT):
- fallthrough
- case int32(_BT_SOL):
- if state != 2 {
- return nAtts
- }
- default:
- break
- }
- goto _1
- _1:
- ;
- ptr += uintptr(1)
- }
- /* not reached */
- return r
- }
- func _normal_charRefNumber(tls *libc.TLS, enc uintptr, ptr uintptr) (r int32) {
- var c, c1, result int32
- _, _, _ = c, c1, result
- result = 0
- /* skip &# */
- _ = enc
- ptr += uintptr(libc.Int32FromInt32(2) * libc.Int32FromInt32(1))
- if int32(*(*int8)(unsafe.Pointer(ptr))) == int32(m_ASCII_x2) {
- ptr += uintptr(1)
- for {
- if !!(int32(*(*int8)(unsafe.Pointer(ptr))) == libc.Int32FromInt32(m_ASCII_SEMI1)) {
- break
- }
- c = int32(*(*int8)(unsafe.Pointer(ptr)))
- switch c {
- case int32(m_ASCII_02):
- fallthrough
- case int32(m_ASCII_12):
- fallthrough
- case int32(m_ASCII_22):
- fallthrough
- case int32(m_ASCII_32):
- fallthrough
- case int32(m_ASCII_41):
- fallthrough
- case int32(m_ASCII_51):
- fallthrough
- case int32(m_ASCII_61):
- fallthrough
- case int32(m_ASCII_71):
- fallthrough
- case int32(m_ASCII_82):
- fallthrough
- case int32(m_ASCII_92):
- result <<= int32(4)
- result |= c - int32(m_ASCII_02)
- case int32(m_ASCII_A):
- fallthrough
- case int32(m_ASCII_B1):
- fallthrough
- case int32(m_ASCII_C):
- fallthrough
- case int32(m_ASCII_D):
- fallthrough
- case int32(m_ASCII_E):
- fallthrough
- case int32(m_ASCII_F):
- result <<= int32(4)
- result += int32(10) + (c - int32(m_ASCII_A))
- case int32(m_ASCII_a2):
- fallthrough
- case int32(m_ASCII_b1):
- fallthrough
- case int32(m_ASCII_c2):
- fallthrough
- case int32(m_ASCII_d1):
- fallthrough
- case int32(m_ASCII_e2):
- fallthrough
- case int32(m_ASCII_f1):
- result <<= int32(4)
- result += int32(10) + (c - int32(m_ASCII_a2))
- break
- }
- if result >= int32(0x110000) {
- return -int32(1)
- }
- goto _1
- _1:
- ;
- ptr += uintptr(1)
- }
- } else {
- for {
- if !!(int32(*(*int8)(unsafe.Pointer(ptr))) == libc.Int32FromInt32(m_ASCII_SEMI1)) {
- break
- }
- c1 = int32(*(*int8)(unsafe.Pointer(ptr)))
- result *= int32(10)
- result += c1 - int32(m_ASCII_02)
- if result >= int32(0x110000) {
- return -int32(1)
- }
- goto _2
- _2:
- ;
- ptr += uintptr(1)
- }
- }
- return _checkCharRefNumber(tls, result)
- }
- func _normal_predefinedEntityName(tls *libc.TLS, enc uintptr, ptr uintptr, end uintptr) (r int32) {
- _ = enc
- switch (int64(end) - int64(ptr)) / libc.Int64FromInt32(1) {
- case int64(2):
- if int32(*(*int8)(unsafe.Pointer(ptr + libc.UintptrFromInt32(1)))) == int32(m_ASCII_t2) {
- switch int32(*(*int8)(unsafe.Pointer(ptr))) {
- case int32(m_ASCII_l2):
- return int32(m_ASCII_LT1)
- case int32(m_ASCII_g2):
- return int32(m_ASCII_GT1)
- }
- }
- case int64(3):
- if int32(*(*int8)(unsafe.Pointer(ptr))) == int32(m_ASCII_a2) {
- ptr += uintptr(1)
- if int32(*(*int8)(unsafe.Pointer(ptr))) == int32(m_ASCII_m2) {
- ptr += uintptr(1)
- if int32(*(*int8)(unsafe.Pointer(ptr))) == int32(m_ASCII_p2) {
- return int32(m_ASCII_AMP1)
- }
- }
- }
- case int64(4):
- switch int32(*(*int8)(unsafe.Pointer(ptr))) {
- case int32(m_ASCII_q1):
- ptr += uintptr(1)
- if int32(*(*int8)(unsafe.Pointer(ptr))) == int32(m_ASCII_u1) {
- ptr += uintptr(1)
- if int32(*(*int8)(unsafe.Pointer(ptr))) == int32(m_ASCII_o2) {
- ptr += uintptr(1)
- if int32(*(*int8)(unsafe.Pointer(ptr))) == int32(m_ASCII_t2) {
- return int32(m_ASCII_QUOT1)
- }
- }
- }
- case int32(m_ASCII_a2):
- ptr += uintptr(1)
- if int32(*(*int8)(unsafe.Pointer(ptr))) == int32(m_ASCII_p2) {
- ptr += uintptr(1)
- if int32(*(*int8)(unsafe.Pointer(ptr))) == int32(m_ASCII_o2) {
- ptr += uintptr(1)
- if int32(*(*int8)(unsafe.Pointer(ptr))) == int32(m_ASCII_s2) {
- return int32(m_ASCII_APOS1)
- }
- }
- }
- break
- }
- }
- return 0
- }
- func _normal_nameMatchesAscii(tls *libc.TLS, enc uintptr, ptr1 uintptr, end1 uintptr, ptr2 uintptr) (r int32) {
- _ = enc
- for {
- if !(*(*int8)(unsafe.Pointer(ptr2)) != 0) {
- break
- }
- if int64(end1)-int64(ptr1) < int64(1) {
- /* This line cannot be executed. The incoming data has already
- * been tokenized once, so incomplete characters like this have
- * already been eliminated from the input. Retaining the
- * paranoia check is still valuable, however.
- */
- return 0 /* LCOV_EXCL_LINE */
- }
- if !(int32(*(*int8)(unsafe.Pointer(ptr1))) == int32(*(*int8)(unsafe.Pointer(ptr2)))) {
- return 0
- }
- goto _1
- _1:
- ;
- ptr1 += uintptr(1)
- ptr2++
- }
- return libc.BoolInt32(ptr1 == end1)
- }
- func _normal_nameLength(tls *libc.TLS, enc uintptr, ptr uintptr) (r int32) {
- var start uintptr
- _ = start
- start = ptr
- for {
- switch libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr))))))) {
- case int32(_BT_LEAD2):
- ptr += uintptr(2) /* NOTE: The encoding has already been validated. */
- case int32(_BT_LEAD3):
- ptr += uintptr(3) /* NOTE: The encoding has already been validated. */
- case int32(_BT_LEAD4):
- ptr += uintptr(4) /* NOTE: The encoding has already been validated. */
- case int32(_BT_NONASCII):
- fallthrough
- case int32(_BT_NMSTRT):
- fallthrough
- case int32(_BT_COLON):
- fallthrough
- case int32(_BT_HEX):
- fallthrough
- case int32(_BT_DIGIT):
- fallthrough
- case int32(_BT_NAME):
- fallthrough
- case int32(_BT_MINUS):
- ptr += uintptr(1)
- default:
- return int32(int64(ptr) - int64(start))
- }
- goto _1
- _1:
- }
- return r
- }
- func _normal_skipS(tls *libc.TLS, enc uintptr, ptr uintptr) (r uintptr) {
- for {
- switch libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr))))))) {
- case int32(_BT_LF):
- fallthrough
- case int32(_BT_CR):
- fallthrough
- case int32(_BT_S):
- ptr += uintptr(1)
- default:
- return ptr
- }
- goto _1
- _1:
- }
- return r
- }
- func _normal_updatePosition(tls *libc.TLS, enc uintptr, ptr uintptr, end uintptr, pos uintptr) {
- for int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(1)) {
- switch libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr))))))) {
- case int32(_BT_LEAD2):
- ptr += uintptr(2) /* NOTE: The encoding has already been validated. */
- (*TPOSITION)(unsafe.Pointer(pos)).FcolumnNumber++
- case int32(_BT_LEAD3):
- ptr += uintptr(3) /* NOTE: The encoding has already been validated. */
- (*TPOSITION)(unsafe.Pointer(pos)).FcolumnNumber++
- case int32(_BT_LEAD4):
- ptr += uintptr(4) /* NOTE: The encoding has already been validated. */
- (*TPOSITION)(unsafe.Pointer(pos)).FcolumnNumber++
- case int32(_BT_LF):
- (*TPOSITION)(unsafe.Pointer(pos)).FcolumnNumber = uint64(0)
- (*TPOSITION)(unsafe.Pointer(pos)).FlineNumber++
- ptr += uintptr(1)
- case int32(_BT_CR):
- (*TPOSITION)(unsafe.Pointer(pos)).FlineNumber++
- ptr += uintptr(1)
- 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) {
- ptr += uintptr(1)
- }
- (*TPOSITION)(unsafe.Pointer(pos)).FcolumnNumber = uint64(0)
- default:
- ptr += uintptr(1)
- (*TPOSITION)(unsafe.Pointer(pos)).FcolumnNumber++
- break
- }
- }
- }
- const /* UTF8_cvalN is value of masked first byte of N byte sequence */
- _UTF8_cval1 = 0
- const _UTF8_cval2 = 192
- const _UTF8_cval3 = 224
- const _UTF8_cval4 = 240
- func X_INTERNAL_trim_to_complete_utf8_characters(tls *libc.TLS, from uintptr, fromLimRef uintptr) {
- var fromLim uintptr
- var prev uint8
- var walked Tsize_t
- _, _, _ = fromLim, prev, walked
- fromLim = *(*uintptr)(unsafe.Pointer(fromLimRef))
- walked = uint64(0)
- for {
- if !(fromLim > from) {
- break
- }
- prev = libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(fromLim + uintptr(-libc.Int32FromInt32(1)))))
- if uint32(prev)&uint32(0xf8) == uint32(0xf0) { /* 4-byte character, lead by 0b11110xxx byte */
- if walked+uint64(1) >= uint64(4) {
- fromLim += uintptr(libc.Int32FromInt32(4) - libc.Int32FromInt32(1))
- break
- } else {
- walked = uint64(0)
- }
- } else {
- if uint32(prev)&uint32(0xf0) == uint32(0xe0) { /* 3-byte character, lead by 0b1110xxxx byte */
- if walked+uint64(1) >= uint64(3) {
- fromLim += uintptr(libc.Int32FromInt32(3) - libc.Int32FromInt32(1))
- break
- } else {
- walked = uint64(0)
- }
- } else {
- if uint32(prev)&uint32(0xe0) == uint32(0xc0) { /* 2-byte character, lead by 0b110xxxxx byte */
- if walked+uint64(1) >= uint64(2) {
- fromLim += uintptr(libc.Int32FromInt32(2) - libc.Int32FromInt32(1))
- break
- } else {
- walked = uint64(0)
- }
- } else {
- if uint32(prev)&uint32(0x80) == 0x00 { /* 1-byte character, matching 0b0xxxxxxx */
- break
- }
- }
- }
- }
- goto _1
- _1:
- ;
- fromLim--
- walked++
- }
- *(*uintptr)(unsafe.Pointer(fromLimRef)) = fromLim
- }
- func _utf8_toUtf8(tls *libc.TLS, enc uintptr, fromP uintptr, _fromLim uintptr, toP uintptr, toLim uintptr) (r _XML_Convert_Result) {
- bp := tls.Alloc(16)
- defer tls.Free(16)
- *(*uintptr)(unsafe.Pointer(bp)) = _fromLim
- var bytesAvailable, bytesStorable, bytesToCopy Tptrdiff_t
- var fromLimBefore uintptr
- var input_incomplete, output_exhausted uint8
- _, _, _, _, _, _ = bytesAvailable, bytesStorable, bytesToCopy, fromLimBefore, input_incomplete, output_exhausted
- input_incomplete = uint8(m_false)
- output_exhausted = uint8(m_false)
- /* Avoid copying partial characters (due to limited space). */
- bytesAvailable = int64(*(*uintptr)(unsafe.Pointer(bp))) - int64(*(*uintptr)(unsafe.Pointer(fromP)))
- bytesStorable = int64(toLim) - int64(*(*uintptr)(unsafe.Pointer(toP)))
- _ = enc
- if bytesAvailable > bytesStorable {
- *(*uintptr)(unsafe.Pointer(bp)) = *(*uintptr)(unsafe.Pointer(fromP)) + uintptr(bytesStorable)
- output_exhausted = uint8(m_true)
- }
- /* Avoid copying partial characters (from incomplete input). */
- fromLimBefore = *(*uintptr)(unsafe.Pointer(bp))
- X_INTERNAL_trim_to_complete_utf8_characters(tls, *(*uintptr)(unsafe.Pointer(fromP)), bp)
- if *(*uintptr)(unsafe.Pointer(bp)) < fromLimBefore {
- input_incomplete = uint8(m_true)
- }
- bytesToCopy = int64(*(*uintptr)(unsafe.Pointer(bp))) - int64(*(*uintptr)(unsafe.Pointer(fromP)))
- libc.Xmemcpy(tls, *(*uintptr)(unsafe.Pointer(toP)), *(*uintptr)(unsafe.Pointer(fromP)), libc.Uint64FromInt64(bytesToCopy))
- *(*uintptr)(unsafe.Pointer(fromP)) += uintptr(bytesToCopy)
- *(*uintptr)(unsafe.Pointer(toP)) += uintptr(bytesToCopy)
- if output_exhausted != 0 { /* needs to go first */
- return int32(_XML_CONVERT_OUTPUT_EXHAUSTED)
- } else {
- if input_incomplete != 0 {
- return int32(_XML_CONVERT_INPUT_INCOMPLETE)
- } else {
- return int32(_XML_CONVERT_COMPLETED)
- }
- }
- return r
- }
- func _utf8_toUtf16(tls *libc.TLS, enc uintptr, fromP uintptr, fromLim uintptr, toP uintptr, toLim uintptr) (r _XML_Convert_Result) {
- var from, to, v1, v2, v3, v4 uintptr
- var n uint64
- var res _XML_Convert_Result
- _, _, _, _, _, _, _, _ = from, n, res, to, v1, v2, v3, v4
- res = int32(_XML_CONVERT_COMPLETED)
- to = *(*uintptr)(unsafe.Pointer(toP))
- from = *(*uintptr)(unsafe.Pointer(fromP))
- for from < fromLim && to < toLim {
- switch libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(from))))))) {
- case int32(_BT_LEAD2):
- if int64(fromLim)-int64(from) < int64(2) {
- res = int32(_XML_CONVERT_INPUT_INCOMPLETE)
- goto after
- }
- v1 = to
- to += 2
- *(*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))
- from += uintptr(2)
- case int32(_BT_LEAD3):
- if int64(fromLim)-int64(from) < int64(3) {
- res = int32(_XML_CONVERT_INPUT_INCOMPLETE)
- goto after
- }
- v2 = to
- to += 2
- *(*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))
- from += uintptr(3)
- case int32(_BT_LEAD4):
- if (int64(toLim)-int64(to))/2 < int64(2) {
- res = int32(_XML_CONVERT_OUTPUT_EXHAUSTED)
- goto after
- }
- if int64(fromLim)-int64(from) < int64(4) {
- res = int32(_XML_CONVERT_INPUT_INCOMPLETE)
- goto after
- }
- 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))
- n -= uint64(0x10000)
- *(*uint16)(unsafe.Pointer(to)) = uint16(n>>libc.Int32FromInt32(10) | libc.Uint64FromInt32(0xD800))
- *(*uint16)(unsafe.Pointer(to + 1*2)) = uint16(n&libc.Uint64FromInt32(0x3FF) | libc.Uint64FromInt32(0xDC00))
- to += uintptr(2) * 2
- from += uintptr(4)
- default:
- v3 = to
- to += 2
- v4 = from
- from++
- *(*uint16)(unsafe.Pointer(v3)) = libc.Uint16FromInt8(*(*int8)(unsafe.Pointer(v4)))
- break
- }
- }
- if from < fromLim {
- res = int32(_XML_CONVERT_OUTPUT_EXHAUSTED)
- }
- goto after
- after:
- ;
- *(*uintptr)(unsafe.Pointer(fromP)) = from
- *(*uintptr)(unsafe.Pointer(toP)) = to
- return res
- }
- var _utf8_encoding_ns = Tnormal_encoding{
- Fenc: TENCODING{
- Fscanners: [4]TSCANNER{},
- FliteralScanners: [2]TSCANNER{},
- FminBytesPerChar: int32(1),
- FisUtf8: int8(1),
- },
- Ftype1: [256]uint8{
- 9: uint8(_BT_S),
- 10: uint8(_BT_LF),
- 13: uint8(_BT_CR),
- 32: uint8(_BT_S),
- 33: uint8(_BT_EXCL),
- 34: uint8(_BT_QUOT),
- 35: uint8(_BT_NUM),
- 36: uint8(_BT_OTHER),
- 37: uint8(_BT_PERCNT),
- 38: uint8(_BT_AMP),
- 39: uint8(_BT_APOS),
- 40: uint8(_BT_LPAR),
- 41: uint8(_BT_RPAR),
- 42: uint8(_BT_AST),
- 43: uint8(_BT_PLUS),
- 44: uint8(_BT_COMMA),
- 45: uint8(_BT_MINUS),
- 46: uint8(_BT_NAME),
- 47: uint8(_BT_SOL),
- 48: uint8(_BT_DIGIT),
- 49: uint8(_BT_DIGIT),
- 50: uint8(_BT_DIGIT),
- 51: uint8(_BT_DIGIT),
- 52: uint8(_BT_DIGIT),
- 53: uint8(_BT_DIGIT),
- 54: uint8(_BT_DIGIT),
- 55: uint8(_BT_DIGIT),
- 56: uint8(_BT_DIGIT),
- 57: uint8(_BT_DIGIT),
- 58: uint8(_BT_COLON),
- 59: uint8(_BT_SEMI),
- 60: uint8(_BT_LT),
- 61: uint8(_BT_EQUALS),
- 62: uint8(_BT_GT),
- 63: uint8(_BT_QUEST),
- 64: uint8(_BT_OTHER),
- 65: uint8(_BT_HEX),
- 66: uint8(_BT_HEX),
- 67: uint8(_BT_HEX),
- 68: uint8(_BT_HEX),
- 69: uint8(_BT_HEX),
- 70: uint8(_BT_HEX),
- 71: uint8(_BT_NMSTRT),
- 72: uint8(_BT_NMSTRT),
- 73: uint8(_BT_NMSTRT),
- 74: uint8(_BT_NMSTRT),
- 75: uint8(_BT_NMSTRT),
- 76: uint8(_BT_NMSTRT),
- 77: uint8(_BT_NMSTRT),
- 78: uint8(_BT_NMSTRT),
- 79: uint8(_BT_NMSTRT),
- 80: uint8(_BT_NMSTRT),
- 81: uint8(_BT_NMSTRT),
- 82: uint8(_BT_NMSTRT),
- 83: uint8(_BT_NMSTRT),
- 84: uint8(_BT_NMSTRT),
- 85: uint8(_BT_NMSTRT),
- 86: uint8(_BT_NMSTRT),
- 87: uint8(_BT_NMSTRT),
- 88: uint8(_BT_NMSTRT),
- 89: uint8(_BT_NMSTRT),
- 90: uint8(_BT_NMSTRT),
- 91: uint8(_BT_LSQB),
- 92: uint8(_BT_OTHER),
- 93: uint8(_BT_RSQB),
- 94: uint8(_BT_OTHER),
- 95: uint8(_BT_NMSTRT),
- 96: uint8(_BT_OTHER),
- 97: uint8(_BT_HEX),
- 98: uint8(_BT_HEX),
- 99: uint8(_BT_HEX),
- 100: uint8(_BT_HEX),
- 101: uint8(_BT_HEX),
- 102: uint8(_BT_HEX),
- 103: uint8(_BT_NMSTRT),
- 104: uint8(_BT_NMSTRT),
- 105: uint8(_BT_NMSTRT),
- 106: uint8(_BT_NMSTRT),
- 107: uint8(_BT_NMSTRT),
- 108: uint8(_BT_NMSTRT),
- 109: uint8(_BT_NMSTRT),
- 110: uint8(_BT_NMSTRT),
- 111: uint8(_BT_NMSTRT),
- 112: uint8(_BT_NMSTRT),
- 113: uint8(_BT_NMSTRT),
- 114: uint8(_BT_NMSTRT),
- 115: uint8(_BT_NMSTRT),
- 116: uint8(_BT_NMSTRT),
- 117: uint8(_BT_NMSTRT),
- 118: uint8(_BT_NMSTRT),
- 119: uint8(_BT_NMSTRT),
- 120: uint8(_BT_NMSTRT),
- 121: uint8(_BT_NMSTRT),
- 122: uint8(_BT_NMSTRT),
- 123: uint8(_BT_OTHER),
- 124: uint8(_BT_VERBAR),
- 125: uint8(_BT_OTHER),
- 126: uint8(_BT_OTHER),
- 127: uint8(_BT_OTHER),
- 128: uint8(_BT_TRAIL),
- 129: uint8(_BT_TRAIL),
- 130: uint8(_BT_TRAIL),
- 131: uint8(_BT_TRAIL),
- 132: uint8(_BT_TRAIL),
- 133: uint8(_BT_TRAIL),
- 134: uint8(_BT_TRAIL),
- 135: uint8(_BT_TRAIL),
- 136: uint8(_BT_TRAIL),
- 137: uint8(_BT_TRAIL),
- 138: uint8(_BT_TRAIL),
- 139: uint8(_BT_TRAIL),
- 140: uint8(_BT_TRAIL),
- 141: uint8(_BT_TRAIL),
- 142: uint8(_BT_TRAIL),
- 143: uint8(_BT_TRAIL),
- 144: uint8(_BT_TRAIL),
- 145: uint8(_BT_TRAIL),
- 146: uint8(_BT_TRAIL),
- 147: uint8(_BT_TRAIL),
- 148: uint8(_BT_TRAIL),
- 149: uint8(_BT_TRAIL),
- 150: uint8(_BT_TRAIL),
- 151: uint8(_BT_TRAIL),
- 152: uint8(_BT_TRAIL),
- 153: uint8(_BT_TRAIL),
- 154: uint8(_BT_TRAIL),
- 155: uint8(_BT_TRAIL),
- 156: uint8(_BT_TRAIL),
- 157: uint8(_BT_TRAIL),
- 158: uint8(_BT_TRAIL),
- 159: uint8(_BT_TRAIL),
- 160: uint8(_BT_TRAIL),
- 161: uint8(_BT_TRAIL),
- 162: uint8(_BT_TRAIL),
- 163: uint8(_BT_TRAIL),
- 164: uint8(_BT_TRAIL),
- 165: uint8(_BT_TRAIL),
- 166: uint8(_BT_TRAIL),
- 167: uint8(_BT_TRAIL),
- 168: uint8(_BT_TRAIL),
- 169: uint8(_BT_TRAIL),
- 170: uint8(_BT_TRAIL),
- 171: uint8(_BT_TRAIL),
- 172: uint8(_BT_TRAIL),
- 173: uint8(_BT_TRAIL),
- 174: uint8(_BT_TRAIL),
- 175: uint8(_BT_TRAIL),
- 176: uint8(_BT_TRAIL),
- 177: uint8(_BT_TRAIL),
- 178: uint8(_BT_TRAIL),
- 179: uint8(_BT_TRAIL),
- 180: uint8(_BT_TRAIL),
- 181: uint8(_BT_TRAIL),
- 182: uint8(_BT_TRAIL),
- 183: uint8(_BT_TRAIL),
- 184: uint8(_BT_TRAIL),
- 185: uint8(_BT_TRAIL),
- 186: uint8(_BT_TRAIL),
- 187: uint8(_BT_TRAIL),
- 188: uint8(_BT_TRAIL),
- 189: uint8(_BT_TRAIL),
- 190: uint8(_BT_TRAIL),
- 191: uint8(_BT_TRAIL),
- 192: uint8(_BT_LEAD2),
- 193: uint8(_BT_LEAD2),
- 194: uint8(_BT_LEAD2),
- 195: uint8(_BT_LEAD2),
- 196: uint8(_BT_LEAD2),
- 197: uint8(_BT_LEAD2),
- 198: uint8(_BT_LEAD2),
- 199: uint8(_BT_LEAD2),
- 200: uint8(_BT_LEAD2),
- 201: uint8(_BT_LEAD2),
- 202: uint8(_BT_LEAD2),
- 203: uint8(_BT_LEAD2),
- 204: uint8(_BT_LEAD2),
- 205: uint8(_BT_LEAD2),
- 206: uint8(_BT_LEAD2),
- 207: uint8(_BT_LEAD2),
- 208: uint8(_BT_LEAD2),
- 209: uint8(_BT_LEAD2),
- 210: uint8(_BT_LEAD2),
- 211: uint8(_BT_LEAD2),
- 212: uint8(_BT_LEAD2),
- 213: uint8(_BT_LEAD2),
- 214: uint8(_BT_LEAD2),
- 215: uint8(_BT_LEAD2),
- 216: uint8(_BT_LEAD2),
- 217: uint8(_BT_LEAD2),
- 218: uint8(_BT_LEAD2),
- 219: uint8(_BT_LEAD2),
- 220: uint8(_BT_LEAD2),
- 221: uint8(_BT_LEAD2),
- 222: uint8(_BT_LEAD2),
- 223: uint8(_BT_LEAD2),
- 224: uint8(_BT_LEAD3),
- 225: uint8(_BT_LEAD3),
- 226: uint8(_BT_LEAD3),
- 227: uint8(_BT_LEAD3),
- 228: uint8(_BT_LEAD3),
- 229: uint8(_BT_LEAD3),
- 230: uint8(_BT_LEAD3),
- 231: uint8(_BT_LEAD3),
- 232: uint8(_BT_LEAD3),
- 233: uint8(_BT_LEAD3),
- 234: uint8(_BT_LEAD3),
- 235: uint8(_BT_LEAD3),
- 236: uint8(_BT_LEAD3),
- 237: uint8(_BT_LEAD3),
- 238: uint8(_BT_LEAD3),
- 239: uint8(_BT_LEAD3),
- 240: uint8(_BT_LEAD4),
- 241: uint8(_BT_LEAD4),
- 242: uint8(_BT_LEAD4),
- 243: uint8(_BT_LEAD4),
- 244: uint8(_BT_LEAD4),
- 254: uint8(_BT_MALFORM),
- 255: uint8(_BT_MALFORM),
- },
- }
- func init() {
- p := unsafe.Pointer(&_utf8_encoding_ns)
- *(*uintptr)(unsafe.Add(p, 0)) = __ccgo_fp(_normal_prologTok)
- *(*uintptr)(unsafe.Add(p, 8)) = __ccgo_fp(_normal_contentTok)
- *(*uintptr)(unsafe.Add(p, 16)) = __ccgo_fp(_normal_cdataSectionTok)
- *(*uintptr)(unsafe.Add(p, 24)) = __ccgo_fp(_normal_ignoreSectionTok)
- *(*uintptr)(unsafe.Add(p, 32)) = __ccgo_fp(_normal_attributeValueTok)
- *(*uintptr)(unsafe.Add(p, 40)) = __ccgo_fp(_normal_entityValueTok)
- *(*uintptr)(unsafe.Add(p, 48)) = __ccgo_fp(_normal_nameMatchesAscii)
- *(*uintptr)(unsafe.Add(p, 56)) = __ccgo_fp(_normal_nameLength)
- *(*uintptr)(unsafe.Add(p, 64)) = __ccgo_fp(_normal_skipS)
- *(*uintptr)(unsafe.Add(p, 72)) = __ccgo_fp(_normal_getAtts)
- *(*uintptr)(unsafe.Add(p, 80)) = __ccgo_fp(_normal_charRefNumber)
- *(*uintptr)(unsafe.Add(p, 88)) = __ccgo_fp(_normal_predefinedEntityName)
- *(*uintptr)(unsafe.Add(p, 96)) = __ccgo_fp(_normal_updatePosition)
- *(*uintptr)(unsafe.Add(p, 104)) = __ccgo_fp(_normal_isPublicId)
- *(*uintptr)(unsafe.Add(p, 112)) = __ccgo_fp(_utf8_toUtf8)
- *(*uintptr)(unsafe.Add(p, 120)) = __ccgo_fp(_utf8_toUtf16)
- *(*uintptr)(unsafe.Add(p, 392)) = __ccgo_fp(_utf8_isName2)
- *(*uintptr)(unsafe.Add(p, 400)) = __ccgo_fp(_utf8_isName3)
- *(*uintptr)(unsafe.Add(p, 408)) = __ccgo_fp(_isNever)
- *(*uintptr)(unsafe.Add(p, 416)) = __ccgo_fp(_utf8_isNmstrt2)
- *(*uintptr)(unsafe.Add(p, 424)) = __ccgo_fp(_utf8_isNmstrt3)
- *(*uintptr)(unsafe.Add(p, 432)) = __ccgo_fp(_isNever)
- *(*uintptr)(unsafe.Add(p, 440)) = __ccgo_fp(_utf8_isInvalid2)
- *(*uintptr)(unsafe.Add(p, 448)) = __ccgo_fp(_utf8_isInvalid3)
- *(*uintptr)(unsafe.Add(p, 456)) = __ccgo_fp(_utf8_isInvalid4)
- }
- var _utf8_encoding = Tnormal_encoding{
- Fenc: TENCODING{
- Fscanners: [4]TSCANNER{},
- FliteralScanners: [2]TSCANNER{},
- FminBytesPerChar: int32(1),
- FisUtf8: int8(1),
- },
- Ftype1: [256]uint8{
- 9: uint8(_BT_S),
- 10: uint8(_BT_LF),
- 13: uint8(_BT_CR),
- 32: uint8(_BT_S),
- 33: uint8(_BT_EXCL),
- 34: uint8(_BT_QUOT),
- 35: uint8(_BT_NUM),
- 36: uint8(_BT_OTHER),
- 37: uint8(_BT_PERCNT),
- 38: uint8(_BT_AMP),
- 39: uint8(_BT_APOS),
- 40: uint8(_BT_LPAR),
- 41: uint8(_BT_RPAR),
- 42: uint8(_BT_AST),
- 43: uint8(_BT_PLUS),
- 44: uint8(_BT_COMMA),
- 45: uint8(_BT_MINUS),
- 46: uint8(_BT_NAME),
- 47: uint8(_BT_SOL),
- 48: uint8(_BT_DIGIT),
- 49: uint8(_BT_DIGIT),
- 50: uint8(_BT_DIGIT),
- 51: uint8(_BT_DIGIT),
- 52: uint8(_BT_DIGIT),
- 53: uint8(_BT_DIGIT),
- 54: uint8(_BT_DIGIT),
- 55: uint8(_BT_DIGIT),
- 56: uint8(_BT_DIGIT),
- 57: uint8(_BT_DIGIT),
- 58: uint8(_BT_NMSTRT),
- 59: uint8(_BT_SEMI),
- 60: uint8(_BT_LT),
- 61: uint8(_BT_EQUALS),
- 62: uint8(_BT_GT),
- 63: uint8(_BT_QUEST),
- 64: uint8(_BT_OTHER),
- 65: uint8(_BT_HEX),
- 66: uint8(_BT_HEX),
- 67: uint8(_BT_HEX),
- 68: uint8(_BT_HEX),
- 69: uint8(_BT_HEX),
- 70: uint8(_BT_HEX),
- 71: uint8(_BT_NMSTRT),
- 72: uint8(_BT_NMSTRT),
- 73: uint8(_BT_NMSTRT),
- 74: uint8(_BT_NMSTRT),
- 75: uint8(_BT_NMSTRT),
- 76: uint8(_BT_NMSTRT),
- 77: uint8(_BT_NMSTRT),
- 78: uint8(_BT_NMSTRT),
- 79: uint8(_BT_NMSTRT),
- 80: uint8(_BT_NMSTRT),
- 81: uint8(_BT_NMSTRT),
- 82: uint8(_BT_NMSTRT),
- 83: uint8(_BT_NMSTRT),
- 84: uint8(_BT_NMSTRT),
- 85: uint8(_BT_NMSTRT),
- 86: uint8(_BT_NMSTRT),
- 87: uint8(_BT_NMSTRT),
- 88: uint8(_BT_NMSTRT),
- 89: uint8(_BT_NMSTRT),
- 90: uint8(_BT_NMSTRT),
- 91: uint8(_BT_LSQB),
- 92: uint8(_BT_OTHER),
- 93: uint8(_BT_RSQB),
- 94: uint8(_BT_OTHER),
- 95: uint8(_BT_NMSTRT),
- 96: uint8(_BT_OTHER),
- 97: uint8(_BT_HEX),
- 98: uint8(_BT_HEX),
- 99: uint8(_BT_HEX),
- 100: uint8(_BT_HEX),
- 101: uint8(_BT_HEX),
- 102: uint8(_BT_HEX),
- 103: uint8(_BT_NMSTRT),
- 104: uint8(_BT_NMSTRT),
- 105: uint8(_BT_NMSTRT),
- 106: uint8(_BT_NMSTRT),
- 107: uint8(_BT_NMSTRT),
- 108: uint8(_BT_NMSTRT),
- 109: uint8(_BT_NMSTRT),
- 110: uint8(_BT_NMSTRT),
- 111: uint8(_BT_NMSTRT),
- 112: uint8(_BT_NMSTRT),
- 113: uint8(_BT_NMSTRT),
- 114: uint8(_BT_NMSTRT),
- 115: uint8(_BT_NMSTRT),
- 116: uint8(_BT_NMSTRT),
- 117: uint8(_BT_NMSTRT),
- 118: uint8(_BT_NMSTRT),
- 119: uint8(_BT_NMSTRT),
- 120: uint8(_BT_NMSTRT),
- 121: uint8(_BT_NMSTRT),
- 122: uint8(_BT_NMSTRT),
- 123: uint8(_BT_OTHER),
- 124: uint8(_BT_VERBAR),
- 125: uint8(_BT_OTHER),
- 126: uint8(_BT_OTHER),
- 127: uint8(_BT_OTHER),
- 128: uint8(_BT_TRAIL),
- 129: uint8(_BT_TRAIL),
- 130: uint8(_BT_TRAIL),
- 131: uint8(_BT_TRAIL),
- 132: uint8(_BT_TRAIL),
- 133: uint8(_BT_TRAIL),
- 134: uint8(_BT_TRAIL),
- 135: uint8(_BT_TRAIL),
- 136: uint8(_BT_TRAIL),
- 137: uint8(_BT_TRAIL),
- 138: uint8(_BT_TRAIL),
- 139: uint8(_BT_TRAIL),
- 140: uint8(_BT_TRAIL),
- 141: uint8(_BT_TRAIL),
- 142: uint8(_BT_TRAIL),
- 143: uint8(_BT_TRAIL),
- 144: uint8(_BT_TRAIL),
- 145: uint8(_BT_TRAIL),
- 146: uint8(_BT_TRAIL),
- 147: uint8(_BT_TRAIL),
- 148: uint8(_BT_TRAIL),
- 149: uint8(_BT_TRAIL),
- 150: uint8(_BT_TRAIL),
- 151: uint8(_BT_TRAIL),
- 152: uint8(_BT_TRAIL),
- 153: uint8(_BT_TRAIL),
- 154: uint8(_BT_TRAIL),
- 155: uint8(_BT_TRAIL),
- 156: uint8(_BT_TRAIL),
- 157: uint8(_BT_TRAIL),
- 158: uint8(_BT_TRAIL),
- 159: uint8(_BT_TRAIL),
- 160: uint8(_BT_TRAIL),
- 161: uint8(_BT_TRAIL),
- 162: uint8(_BT_TRAIL),
- 163: uint8(_BT_TRAIL),
- 164: uint8(_BT_TRAIL),
- 165: uint8(_BT_TRAIL),
- 166: uint8(_BT_TRAIL),
- 167: uint8(_BT_TRAIL),
- 168: uint8(_BT_TRAIL),
- 169: uint8(_BT_TRAIL),
- 170: uint8(_BT_TRAIL),
- 171: uint8(_BT_TRAIL),
- 172: uint8(_BT_TRAIL),
- 173: uint8(_BT_TRAIL),
- 174: uint8(_BT_TRAIL),
- 175: uint8(_BT_TRAIL),
- 176: uint8(_BT_TRAIL),
- 177: uint8(_BT_TRAIL),
- 178: uint8(_BT_TRAIL),
- 179: uint8(_BT_TRAIL),
- 180: uint8(_BT_TRAIL),
- 181: uint8(_BT_TRAIL),
- 182: uint8(_BT_TRAIL),
- 183: uint8(_BT_TRAIL),
- 184: uint8(_BT_TRAIL),
- 185: uint8(_BT_TRAIL),
- 186: uint8(_BT_TRAIL),
- 187: uint8(_BT_TRAIL),
- 188: uint8(_BT_TRAIL),
- 189: uint8(_BT_TRAIL),
- 190: uint8(_BT_TRAIL),
- 191: uint8(_BT_TRAIL),
- 192: uint8(_BT_LEAD2),
- 193: uint8(_BT_LEAD2),
- 194: uint8(_BT_LEAD2),
- 195: uint8(_BT_LEAD2),
- 196: uint8(_BT_LEAD2),
- 197: uint8(_BT_LEAD2),
- 198: uint8(_BT_LEAD2),
- 199: uint8(_BT_LEAD2),
- 200: uint8(_BT_LEAD2),
- 201: uint8(_BT_LEAD2),
- 202: uint8(_BT_LEAD2),
- 203: uint8(_BT_LEAD2),
- 204: uint8(_BT_LEAD2),
- 205: uint8(_BT_LEAD2),
- 206: uint8(_BT_LEAD2),
- 207: uint8(_BT_LEAD2),
- 208: uint8(_BT_LEAD2),
- 209: uint8(_BT_LEAD2),
- 210: uint8(_BT_LEAD2),
- 211: uint8(_BT_LEAD2),
- 212: uint8(_BT_LEAD2),
- 213: uint8(_BT_LEAD2),
- 214: uint8(_BT_LEAD2),
- 215: uint8(_BT_LEAD2),
- 216: uint8(_BT_LEAD2),
- 217: uint8(_BT_LEAD2),
- 218: uint8(_BT_LEAD2),
- 219: uint8(_BT_LEAD2),
- 220: uint8(_BT_LEAD2),
- 221: uint8(_BT_LEAD2),
- 222: uint8(_BT_LEAD2),
- 223: uint8(_BT_LEAD2),
- 224: uint8(_BT_LEAD3),
- 225: uint8(_BT_LEAD3),
- 226: uint8(_BT_LEAD3),
- 227: uint8(_BT_LEAD3),
- 228: uint8(_BT_LEAD3),
- 229: uint8(_BT_LEAD3),
- 230: uint8(_BT_LEAD3),
- 231: uint8(_BT_LEAD3),
- 232: uint8(_BT_LEAD3),
- 233: uint8(_BT_LEAD3),
- 234: uint8(_BT_LEAD3),
- 235: uint8(_BT_LEAD3),
- 236: uint8(_BT_LEAD3),
- 237: uint8(_BT_LEAD3),
- 238: uint8(_BT_LEAD3),
- 239: uint8(_BT_LEAD3),
- 240: uint8(_BT_LEAD4),
- 241: uint8(_BT_LEAD4),
- 242: uint8(_BT_LEAD4),
- 243: uint8(_BT_LEAD4),
- 244: uint8(_BT_LEAD4),
- 254: uint8(_BT_MALFORM),
- 255: uint8(_BT_MALFORM),
- },
- }
- func init() {
- p := unsafe.Pointer(&_utf8_encoding)
- *(*uintptr)(unsafe.Add(p, 0)) = __ccgo_fp(_normal_prologTok)
- *(*uintptr)(unsafe.Add(p, 8)) = __ccgo_fp(_normal_contentTok)
- *(*uintptr)(unsafe.Add(p, 16)) = __ccgo_fp(_normal_cdataSectionTok)
- *(*uintptr)(unsafe.Add(p, 24)) = __ccgo_fp(_normal_ignoreSectionTok)
- *(*uintptr)(unsafe.Add(p, 32)) = __ccgo_fp(_normal_attributeValueTok)
- *(*uintptr)(unsafe.Add(p, 40)) = __ccgo_fp(_normal_entityValueTok)
- *(*uintptr)(unsafe.Add(p, 48)) = __ccgo_fp(_normal_nameMatchesAscii)
- *(*uintptr)(unsafe.Add(p, 56)) = __ccgo_fp(_normal_nameLength)
- *(*uintptr)(unsafe.Add(p, 64)) = __ccgo_fp(_normal_skipS)
- *(*uintptr)(unsafe.Add(p, 72)) = __ccgo_fp(_normal_getAtts)
- *(*uintptr)(unsafe.Add(p, 80)) = __ccgo_fp(_normal_charRefNumber)
- *(*uintptr)(unsafe.Add(p, 88)) = __ccgo_fp(_normal_predefinedEntityName)
- *(*uintptr)(unsafe.Add(p, 96)) = __ccgo_fp(_normal_updatePosition)
- *(*uintptr)(unsafe.Add(p, 104)) = __ccgo_fp(_normal_isPublicId)
- *(*uintptr)(unsafe.Add(p, 112)) = __ccgo_fp(_utf8_toUtf8)
- *(*uintptr)(unsafe.Add(p, 120)) = __ccgo_fp(_utf8_toUtf16)
- *(*uintptr)(unsafe.Add(p, 392)) = __ccgo_fp(_utf8_isName2)
- *(*uintptr)(unsafe.Add(p, 400)) = __ccgo_fp(_utf8_isName3)
- *(*uintptr)(unsafe.Add(p, 408)) = __ccgo_fp(_isNever)
- *(*uintptr)(unsafe.Add(p, 416)) = __ccgo_fp(_utf8_isNmstrt2)
- *(*uintptr)(unsafe.Add(p, 424)) = __ccgo_fp(_utf8_isNmstrt3)
- *(*uintptr)(unsafe.Add(p, 432)) = __ccgo_fp(_isNever)
- *(*uintptr)(unsafe.Add(p, 440)) = __ccgo_fp(_utf8_isInvalid2)
- *(*uintptr)(unsafe.Add(p, 448)) = __ccgo_fp(_utf8_isInvalid3)
- *(*uintptr)(unsafe.Add(p, 456)) = __ccgo_fp(_utf8_isInvalid4)
- }
- var _internal_utf8_encoding_ns = Tnormal_encoding{
- Fenc: TENCODING{
- Fscanners: [4]TSCANNER{},
- FliteralScanners: [2]TSCANNER{},
- FminBytesPerChar: int32(1),
- FisUtf8: int8(1),
- },
- Ftype1: [256]uint8{
- 9: uint8(_BT_S),
- 10: uint8(_BT_LF),
- 13: uint8(_BT_S),
- 32: uint8(_BT_S),
- 33: uint8(_BT_EXCL),
- 34: uint8(_BT_QUOT),
- 35: uint8(_BT_NUM),
- 36: uint8(_BT_OTHER),
- 37: uint8(_BT_PERCNT),
- 38: uint8(_BT_AMP),
- 39: uint8(_BT_APOS),
- 40: uint8(_BT_LPAR),
- 41: uint8(_BT_RPAR),
- 42: uint8(_BT_AST),
- 43: uint8(_BT_PLUS),
- 44: uint8(_BT_COMMA),
- 45: uint8(_BT_MINUS),
- 46: uint8(_BT_NAME),
- 47: uint8(_BT_SOL),
- 48: uint8(_BT_DIGIT),
- 49: uint8(_BT_DIGIT),
- 50: uint8(_BT_DIGIT),
- 51: uint8(_BT_DIGIT),
- 52: uint8(_BT_DIGIT),
- 53: uint8(_BT_DIGIT),
- 54: uint8(_BT_DIGIT),
- 55: uint8(_BT_DIGIT),
- 56: uint8(_BT_DIGIT),
- 57: uint8(_BT_DIGIT),
- 58: uint8(_BT_COLON),
- 59: uint8(_BT_SEMI),
- 60: uint8(_BT_LT),
- 61: uint8(_BT_EQUALS),
- 62: uint8(_BT_GT),
- 63: uint8(_BT_QUEST),
- 64: uint8(_BT_OTHER),
- 65: uint8(_BT_HEX),
- 66: uint8(_BT_HEX),
- 67: uint8(_BT_HEX),
- 68: uint8(_BT_HEX),
- 69: uint8(_BT_HEX),
- 70: uint8(_BT_HEX),
- 71: uint8(_BT_NMSTRT),
- 72: uint8(_BT_NMSTRT),
- 73: uint8(_BT_NMSTRT),
- 74: uint8(_BT_NMSTRT),
- 75: uint8(_BT_NMSTRT),
- 76: uint8(_BT_NMSTRT),
- 77: uint8(_BT_NMSTRT),
- 78: uint8(_BT_NMSTRT),
- 79: uint8(_BT_NMSTRT),
- 80: uint8(_BT_NMSTRT),
- 81: uint8(_BT_NMSTRT),
- 82: uint8(_BT_NMSTRT),
- 83: uint8(_BT_NMSTRT),
- 84: uint8(_BT_NMSTRT),
- 85: uint8(_BT_NMSTRT),
- 86: uint8(_BT_NMSTRT),
- 87: uint8(_BT_NMSTRT),
- 88: uint8(_BT_NMSTRT),
- 89: uint8(_BT_NMSTRT),
- 90: uint8(_BT_NMSTRT),
- 91: uint8(_BT_LSQB),
- 92: uint8(_BT_OTHER),
- 93: uint8(_BT_RSQB),
- 94: uint8(_BT_OTHER),
- 95: uint8(_BT_NMSTRT),
- 96: uint8(_BT_OTHER),
- 97: uint8(_BT_HEX),
- 98: uint8(_BT_HEX),
- 99: uint8(_BT_HEX),
- 100: uint8(_BT_HEX),
- 101: uint8(_BT_HEX),
- 102: uint8(_BT_HEX),
- 103: uint8(_BT_NMSTRT),
- 104: uint8(_BT_NMSTRT),
- 105: uint8(_BT_NMSTRT),
- 106: uint8(_BT_NMSTRT),
- 107: uint8(_BT_NMSTRT),
- 108: uint8(_BT_NMSTRT),
- 109: uint8(_BT_NMSTRT),
- 110: uint8(_BT_NMSTRT),
- 111: uint8(_BT_NMSTRT),
- 112: uint8(_BT_NMSTRT),
- 113: uint8(_BT_NMSTRT),
- 114: uint8(_BT_NMSTRT),
- 115: uint8(_BT_NMSTRT),
- 116: uint8(_BT_NMSTRT),
- 117: uint8(_BT_NMSTRT),
- 118: uint8(_BT_NMSTRT),
- 119: uint8(_BT_NMSTRT),
- 120: uint8(_BT_NMSTRT),
- 121: uint8(_BT_NMSTRT),
- 122: uint8(_BT_NMSTRT),
- 123: uint8(_BT_OTHER),
- 124: uint8(_BT_VERBAR),
- 125: uint8(_BT_OTHER),
- 126: uint8(_BT_OTHER),
- 127: uint8(_BT_OTHER),
- 128: uint8(_BT_TRAIL),
- 129: uint8(_BT_TRAIL),
- 130: uint8(_BT_TRAIL),
- 131: uint8(_BT_TRAIL),
- 132: uint8(_BT_TRAIL),
- 133: uint8(_BT_TRAIL),
- 134: uint8(_BT_TRAIL),
- 135: uint8(_BT_TRAIL),
- 136: uint8(_BT_TRAIL),
- 137: uint8(_BT_TRAIL),
- 138: uint8(_BT_TRAIL),
- 139: uint8(_BT_TRAIL),
- 140: uint8(_BT_TRAIL),
- 141: uint8(_BT_TRAIL),
- 142: uint8(_BT_TRAIL),
- 143: uint8(_BT_TRAIL),
- 144: uint8(_BT_TRAIL),
- 145: uint8(_BT_TRAIL),
- 146: uint8(_BT_TRAIL),
- 147: uint8(_BT_TRAIL),
- 148: uint8(_BT_TRAIL),
- 149: uint8(_BT_TRAIL),
- 150: uint8(_BT_TRAIL),
- 151: uint8(_BT_TRAIL),
- 152: uint8(_BT_TRAIL),
- 153: uint8(_BT_TRAIL),
- 154: uint8(_BT_TRAIL),
- 155: uint8(_BT_TRAIL),
- 156: uint8(_BT_TRAIL),
- 157: uint8(_BT_TRAIL),
- 158: uint8(_BT_TRAIL),
- 159: uint8(_BT_TRAIL),
- 160: uint8(_BT_TRAIL),
- 161: uint8(_BT_TRAIL),
- 162: uint8(_BT_TRAIL),
- 163: uint8(_BT_TRAIL),
- 164: uint8(_BT_TRAIL),
- 165: uint8(_BT_TRAIL),
- 166: uint8(_BT_TRAIL),
- 167: uint8(_BT_TRAIL),
- 168: uint8(_BT_TRAIL),
- 169: uint8(_BT_TRAIL),
- 170: uint8(_BT_TRAIL),
- 171: uint8(_BT_TRAIL),
- 172: uint8(_BT_TRAIL),
- 173: uint8(_BT_TRAIL),
- 174: uint8(_BT_TRAIL),
- 175: uint8(_BT_TRAIL),
- 176: uint8(_BT_TRAIL),
- 177: uint8(_BT_TRAIL),
- 178: uint8(_BT_TRAIL),
- 179: uint8(_BT_TRAIL),
- 180: uint8(_BT_TRAIL),
- 181: uint8(_BT_TRAIL),
- 182: uint8(_BT_TRAIL),
- 183: uint8(_BT_TRAIL),
- 184: uint8(_BT_TRAIL),
- 185: uint8(_BT_TRAIL),
- 186: uint8(_BT_TRAIL),
- 187: uint8(_BT_TRAIL),
- 188: uint8(_BT_TRAIL),
- 189: uint8(_BT_TRAIL),
- 190: uint8(_BT_TRAIL),
- 191: uint8(_BT_TRAIL),
- 192: uint8(_BT_LEAD2),
- 193: uint8(_BT_LEAD2),
- 194: uint8(_BT_LEAD2),
- 195: uint8(_BT_LEAD2),
- 196: uint8(_BT_LEAD2),
- 197: uint8(_BT_LEAD2),
- 198: uint8(_BT_LEAD2),
- 199: uint8(_BT_LEAD2),
- 200: uint8(_BT_LEAD2),
- 201: uint8(_BT_LEAD2),
- 202: uint8(_BT_LEAD2),
- 203: uint8(_BT_LEAD2),
- 204: uint8(_BT_LEAD2),
- 205: uint8(_BT_LEAD2),
- 206: uint8(_BT_LEAD2),
- 207: uint8(_BT_LEAD2),
- 208: uint8(_BT_LEAD2),
- 209: uint8(_BT_LEAD2),
- 210: uint8(_BT_LEAD2),
- 211: uint8(_BT_LEAD2),
- 212: uint8(_BT_LEAD2),
- 213: uint8(_BT_LEAD2),
- 214: uint8(_BT_LEAD2),
- 215: uint8(_BT_LEAD2),
- 216: uint8(_BT_LEAD2),
- 217: uint8(_BT_LEAD2),
- 218: uint8(_BT_LEAD2),
- 219: uint8(_BT_LEAD2),
- 220: uint8(_BT_LEAD2),
- 221: uint8(_BT_LEAD2),
- 222: uint8(_BT_LEAD2),
- 223: uint8(_BT_LEAD2),
- 224: uint8(_BT_LEAD3),
- 225: uint8(_BT_LEAD3),
- 226: uint8(_BT_LEAD3),
- 227: uint8(_BT_LEAD3),
- 228: uint8(_BT_LEAD3),
- 229: uint8(_BT_LEAD3),
- 230: uint8(_BT_LEAD3),
- 231: uint8(_BT_LEAD3),
- 232: uint8(_BT_LEAD3),
- 233: uint8(_BT_LEAD3),
- 234: uint8(_BT_LEAD3),
- 235: uint8(_BT_LEAD3),
- 236: uint8(_BT_LEAD3),
- 237: uint8(_BT_LEAD3),
- 238: uint8(_BT_LEAD3),
- 239: uint8(_BT_LEAD3),
- 240: uint8(_BT_LEAD4),
- 241: uint8(_BT_LEAD4),
- 242: uint8(_BT_LEAD4),
- 243: uint8(_BT_LEAD4),
- 244: uint8(_BT_LEAD4),
- 254: uint8(_BT_MALFORM),
- 255: uint8(_BT_MALFORM),
- },
- }
- func init() {
- p := unsafe.Pointer(&_internal_utf8_encoding_ns)
- *(*uintptr)(unsafe.Add(p, 0)) = __ccgo_fp(_normal_prologTok)
- *(*uintptr)(unsafe.Add(p, 8)) = __ccgo_fp(_normal_contentTok)
- *(*uintptr)(unsafe.Add(p, 16)) = __ccgo_fp(_normal_cdataSectionTok)
- *(*uintptr)(unsafe.Add(p, 24)) = __ccgo_fp(_normal_ignoreSectionTok)
- *(*uintptr)(unsafe.Add(p, 32)) = __ccgo_fp(_normal_attributeValueTok)
- *(*uintptr)(unsafe.Add(p, 40)) = __ccgo_fp(_normal_entityValueTok)
- *(*uintptr)(unsafe.Add(p, 48)) = __ccgo_fp(_normal_nameMatchesAscii)
- *(*uintptr)(unsafe.Add(p, 56)) = __ccgo_fp(_normal_nameLength)
- *(*uintptr)(unsafe.Add(p, 64)) = __ccgo_fp(_normal_skipS)
- *(*uintptr)(unsafe.Add(p, 72)) = __ccgo_fp(_normal_getAtts)
- *(*uintptr)(unsafe.Add(p, 80)) = __ccgo_fp(_normal_charRefNumber)
- *(*uintptr)(unsafe.Add(p, 88)) = __ccgo_fp(_normal_predefinedEntityName)
- *(*uintptr)(unsafe.Add(p, 96)) = __ccgo_fp(_normal_updatePosition)
- *(*uintptr)(unsafe.Add(p, 104)) = __ccgo_fp(_normal_isPublicId)
- *(*uintptr)(unsafe.Add(p, 112)) = __ccgo_fp(_utf8_toUtf8)
- *(*uintptr)(unsafe.Add(p, 120)) = __ccgo_fp(_utf8_toUtf16)
- *(*uintptr)(unsafe.Add(p, 392)) = __ccgo_fp(_utf8_isName2)
- *(*uintptr)(unsafe.Add(p, 400)) = __ccgo_fp(_utf8_isName3)
- *(*uintptr)(unsafe.Add(p, 408)) = __ccgo_fp(_isNever)
- *(*uintptr)(unsafe.Add(p, 416)) = __ccgo_fp(_utf8_isNmstrt2)
- *(*uintptr)(unsafe.Add(p, 424)) = __ccgo_fp(_utf8_isNmstrt3)
- *(*uintptr)(unsafe.Add(p, 432)) = __ccgo_fp(_isNever)
- *(*uintptr)(unsafe.Add(p, 440)) = __ccgo_fp(_utf8_isInvalid2)
- *(*uintptr)(unsafe.Add(p, 448)) = __ccgo_fp(_utf8_isInvalid3)
- *(*uintptr)(unsafe.Add(p, 456)) = __ccgo_fp(_utf8_isInvalid4)
- }
- var _internal_utf8_encoding = Tnormal_encoding{
- Fenc: TENCODING{
- Fscanners: [4]TSCANNER{},
- FliteralScanners: [2]TSCANNER{},
- FminBytesPerChar: int32(1),
- FisUtf8: int8(1),
- },
- Ftype1: [256]uint8{
- 9: uint8(_BT_S),
- 10: uint8(_BT_LF),
- 13: uint8(_BT_S),
- 32: uint8(_BT_S),
- 33: uint8(_BT_EXCL),
- 34: uint8(_BT_QUOT),
- 35: uint8(_BT_NUM),
- 36: uint8(_BT_OTHER),
- 37: uint8(_BT_PERCNT),
- 38: uint8(_BT_AMP),
- 39: uint8(_BT_APOS),
- 40: uint8(_BT_LPAR),
- 41: uint8(_BT_RPAR),
- 42: uint8(_BT_AST),
- 43: uint8(_BT_PLUS),
- 44: uint8(_BT_COMMA),
- 45: uint8(_BT_MINUS),
- 46: uint8(_BT_NAME),
- 47: uint8(_BT_SOL),
- 48: uint8(_BT_DIGIT),
- 49: uint8(_BT_DIGIT),
- 50: uint8(_BT_DIGIT),
- 51: uint8(_BT_DIGIT),
- 52: uint8(_BT_DIGIT),
- 53: uint8(_BT_DIGIT),
- 54: uint8(_BT_DIGIT),
- 55: uint8(_BT_DIGIT),
- 56: uint8(_BT_DIGIT),
- 57: uint8(_BT_DIGIT),
- 58: uint8(_BT_NMSTRT),
- 59: uint8(_BT_SEMI),
- 60: uint8(_BT_LT),
- 61: uint8(_BT_EQUALS),
- 62: uint8(_BT_GT),
- 63: uint8(_BT_QUEST),
- 64: uint8(_BT_OTHER),
- 65: uint8(_BT_HEX),
- 66: uint8(_BT_HEX),
- 67: uint8(_BT_HEX),
- 68: uint8(_BT_HEX),
- 69: uint8(_BT_HEX),
- 70: uint8(_BT_HEX),
- 71: uint8(_BT_NMSTRT),
- 72: uint8(_BT_NMSTRT),
- 73: uint8(_BT_NMSTRT),
- 74: uint8(_BT_NMSTRT),
- 75: uint8(_BT_NMSTRT),
- 76: uint8(_BT_NMSTRT),
- 77: uint8(_BT_NMSTRT),
- 78: uint8(_BT_NMSTRT),
- 79: uint8(_BT_NMSTRT),
- 80: uint8(_BT_NMSTRT),
- 81: uint8(_BT_NMSTRT),
- 82: uint8(_BT_NMSTRT),
- 83: uint8(_BT_NMSTRT),
- 84: uint8(_BT_NMSTRT),
- 85: uint8(_BT_NMSTRT),
- 86: uint8(_BT_NMSTRT),
- 87: uint8(_BT_NMSTRT),
- 88: uint8(_BT_NMSTRT),
- 89: uint8(_BT_NMSTRT),
- 90: uint8(_BT_NMSTRT),
- 91: uint8(_BT_LSQB),
- 92: uint8(_BT_OTHER),
- 93: uint8(_BT_RSQB),
- 94: uint8(_BT_OTHER),
- 95: uint8(_BT_NMSTRT),
- 96: uint8(_BT_OTHER),
- 97: uint8(_BT_HEX),
- 98: uint8(_BT_HEX),
- 99: uint8(_BT_HEX),
- 100: uint8(_BT_HEX),
- 101: uint8(_BT_HEX),
- 102: uint8(_BT_HEX),
- 103: uint8(_BT_NMSTRT),
- 104: uint8(_BT_NMSTRT),
- 105: uint8(_BT_NMSTRT),
- 106: uint8(_BT_NMSTRT),
- 107: uint8(_BT_NMSTRT),
- 108: uint8(_BT_NMSTRT),
- 109: uint8(_BT_NMSTRT),
- 110: uint8(_BT_NMSTRT),
- 111: uint8(_BT_NMSTRT),
- 112: uint8(_BT_NMSTRT),
- 113: uint8(_BT_NMSTRT),
- 114: uint8(_BT_NMSTRT),
- 115: uint8(_BT_NMSTRT),
- 116: uint8(_BT_NMSTRT),
- 117: uint8(_BT_NMSTRT),
- 118: uint8(_BT_NMSTRT),
- 119: uint8(_BT_NMSTRT),
- 120: uint8(_BT_NMSTRT),
- 121: uint8(_BT_NMSTRT),
- 122: uint8(_BT_NMSTRT),
- 123: uint8(_BT_OTHER),
- 124: uint8(_BT_VERBAR),
- 125: uint8(_BT_OTHER),
- 126: uint8(_BT_OTHER),
- 127: uint8(_BT_OTHER),
- 128: uint8(_BT_TRAIL),
- 129: uint8(_BT_TRAIL),
- 130: uint8(_BT_TRAIL),
- 131: uint8(_BT_TRAIL),
- 132: uint8(_BT_TRAIL),
- 133: uint8(_BT_TRAIL),
- 134: uint8(_BT_TRAIL),
- 135: uint8(_BT_TRAIL),
- 136: uint8(_BT_TRAIL),
- 137: uint8(_BT_TRAIL),
- 138: uint8(_BT_TRAIL),
- 139: uint8(_BT_TRAIL),
- 140: uint8(_BT_TRAIL),
- 141: uint8(_BT_TRAIL),
- 142: uint8(_BT_TRAIL),
- 143: uint8(_BT_TRAIL),
- 144: uint8(_BT_TRAIL),
- 145: uint8(_BT_TRAIL),
- 146: uint8(_BT_TRAIL),
- 147: uint8(_BT_TRAIL),
- 148: uint8(_BT_TRAIL),
- 149: uint8(_BT_TRAIL),
- 150: uint8(_BT_TRAIL),
- 151: uint8(_BT_TRAIL),
- 152: uint8(_BT_TRAIL),
- 153: uint8(_BT_TRAIL),
- 154: uint8(_BT_TRAIL),
- 155: uint8(_BT_TRAIL),
- 156: uint8(_BT_TRAIL),
- 157: uint8(_BT_TRAIL),
- 158: uint8(_BT_TRAIL),
- 159: uint8(_BT_TRAIL),
- 160: uint8(_BT_TRAIL),
- 161: uint8(_BT_TRAIL),
- 162: uint8(_BT_TRAIL),
- 163: uint8(_BT_TRAIL),
- 164: uint8(_BT_TRAIL),
- 165: uint8(_BT_TRAIL),
- 166: uint8(_BT_TRAIL),
- 167: uint8(_BT_TRAIL),
- 168: uint8(_BT_TRAIL),
- 169: uint8(_BT_TRAIL),
- 170: uint8(_BT_TRAIL),
- 171: uint8(_BT_TRAIL),
- 172: uint8(_BT_TRAIL),
- 173: uint8(_BT_TRAIL),
- 174: uint8(_BT_TRAIL),
- 175: uint8(_BT_TRAIL),
- 176: uint8(_BT_TRAIL),
- 177: uint8(_BT_TRAIL),
- 178: uint8(_BT_TRAIL),
- 179: uint8(_BT_TRAIL),
- 180: uint8(_BT_TRAIL),
- 181: uint8(_BT_TRAIL),
- 182: uint8(_BT_TRAIL),
- 183: uint8(_BT_TRAIL),
- 184: uint8(_BT_TRAIL),
- 185: uint8(_BT_TRAIL),
- 186: uint8(_BT_TRAIL),
- 187: uint8(_BT_TRAIL),
- 188: uint8(_BT_TRAIL),
- 189: uint8(_BT_TRAIL),
- 190: uint8(_BT_TRAIL),
- 191: uint8(_BT_TRAIL),
- 192: uint8(_BT_LEAD2),
- 193: uint8(_BT_LEAD2),
- 194: uint8(_BT_LEAD2),
- 195: uint8(_BT_LEAD2),
- 196: uint8(_BT_LEAD2),
- 197: uint8(_BT_LEAD2),
- 198: uint8(_BT_LEAD2),
- 199: uint8(_BT_LEAD2),
- 200: uint8(_BT_LEAD2),
- 201: uint8(_BT_LEAD2),
- 202: uint8(_BT_LEAD2),
- 203: uint8(_BT_LEAD2),
- 204: uint8(_BT_LEAD2),
- 205: uint8(_BT_LEAD2),
- 206: uint8(_BT_LEAD2),
- 207: uint8(_BT_LEAD2),
- 208: uint8(_BT_LEAD2),
- 209: uint8(_BT_LEAD2),
- 210: uint8(_BT_LEAD2),
- 211: uint8(_BT_LEAD2),
- 212: uint8(_BT_LEAD2),
- 213: uint8(_BT_LEAD2),
- 214: uint8(_BT_LEAD2),
- 215: uint8(_BT_LEAD2),
- 216: uint8(_BT_LEAD2),
- 217: uint8(_BT_LEAD2),
- 218: uint8(_BT_LEAD2),
- 219: uint8(_BT_LEAD2),
- 220: uint8(_BT_LEAD2),
- 221: uint8(_BT_LEAD2),
- 222: uint8(_BT_LEAD2),
- 223: uint8(_BT_LEAD2),
- 224: uint8(_BT_LEAD3),
- 225: uint8(_BT_LEAD3),
- 226: uint8(_BT_LEAD3),
- 227: uint8(_BT_LEAD3),
- 228: uint8(_BT_LEAD3),
- 229: uint8(_BT_LEAD3),
- 230: uint8(_BT_LEAD3),
- 231: uint8(_BT_LEAD3),
- 232: uint8(_BT_LEAD3),
- 233: uint8(_BT_LEAD3),
- 234: uint8(_BT_LEAD3),
- 235: uint8(_BT_LEAD3),
- 236: uint8(_BT_LEAD3),
- 237: uint8(_BT_LEAD3),
- 238: uint8(_BT_LEAD3),
- 239: uint8(_BT_LEAD3),
- 240: uint8(_BT_LEAD4),
- 241: uint8(_BT_LEAD4),
- 242: uint8(_BT_LEAD4),
- 243: uint8(_BT_LEAD4),
- 244: uint8(_BT_LEAD4),
- 254: uint8(_BT_MALFORM),
- 255: uint8(_BT_MALFORM),
- },
- }
- func init() {
- p := unsafe.Pointer(&_internal_utf8_encoding)
- *(*uintptr)(unsafe.Add(p, 0)) = __ccgo_fp(_normal_prologTok)
- *(*uintptr)(unsafe.Add(p, 8)) = __ccgo_fp(_normal_contentTok)
- *(*uintptr)(unsafe.Add(p, 16)) = __ccgo_fp(_normal_cdataSectionTok)
- *(*uintptr)(unsafe.Add(p, 24)) = __ccgo_fp(_normal_ignoreSectionTok)
- *(*uintptr)(unsafe.Add(p, 32)) = __ccgo_fp(_normal_attributeValueTok)
- *(*uintptr)(unsafe.Add(p, 40)) = __ccgo_fp(_normal_entityValueTok)
- *(*uintptr)(unsafe.Add(p, 48)) = __ccgo_fp(_normal_nameMatchesAscii)
- *(*uintptr)(unsafe.Add(p, 56)) = __ccgo_fp(_normal_nameLength)
- *(*uintptr)(unsafe.Add(p, 64)) = __ccgo_fp(_normal_skipS)
- *(*uintptr)(unsafe.Add(p, 72)) = __ccgo_fp(_normal_getAtts)
- *(*uintptr)(unsafe.Add(p, 80)) = __ccgo_fp(_normal_charRefNumber)
- *(*uintptr)(unsafe.Add(p, 88)) = __ccgo_fp(_normal_predefinedEntityName)
- *(*uintptr)(unsafe.Add(p, 96)) = __ccgo_fp(_normal_updatePosition)
- *(*uintptr)(unsafe.Add(p, 104)) = __ccgo_fp(_normal_isPublicId)
- *(*uintptr)(unsafe.Add(p, 112)) = __ccgo_fp(_utf8_toUtf8)
- *(*uintptr)(unsafe.Add(p, 120)) = __ccgo_fp(_utf8_toUtf16)
- *(*uintptr)(unsafe.Add(p, 392)) = __ccgo_fp(_utf8_isName2)
- *(*uintptr)(unsafe.Add(p, 400)) = __ccgo_fp(_utf8_isName3)
- *(*uintptr)(unsafe.Add(p, 408)) = __ccgo_fp(_isNever)
- *(*uintptr)(unsafe.Add(p, 416)) = __ccgo_fp(_utf8_isNmstrt2)
- *(*uintptr)(unsafe.Add(p, 424)) = __ccgo_fp(_utf8_isNmstrt3)
- *(*uintptr)(unsafe.Add(p, 432)) = __ccgo_fp(_isNever)
- *(*uintptr)(unsafe.Add(p, 440)) = __ccgo_fp(_utf8_isInvalid2)
- *(*uintptr)(unsafe.Add(p, 448)) = __ccgo_fp(_utf8_isInvalid3)
- *(*uintptr)(unsafe.Add(p, 456)) = __ccgo_fp(_utf8_isInvalid4)
- }
- func _latin1_toUtf8(tls *libc.TLS, enc uintptr, fromP uintptr, fromLim uintptr, toP uintptr, toLim uintptr) (r _XML_Convert_Result) {
- var c uint8
- var v2, v3, v4, v5, v6, v7, v8, v9 uintptr
- _, _, _, _, _, _, _, _, _ = c, v2, v3, v4, v5, v6, v7, v8, v9
- _ = enc
- for {
- if *(*uintptr)(unsafe.Pointer(fromP)) == fromLim {
- return int32(_XML_CONVERT_COMPLETED)
- }
- c = libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(fromP)))))
- if libc.Int32FromUint8(c)&int32(0x80) != 0 {
- if int64(toLim)-int64(*(*uintptr)(unsafe.Pointer(toP))) < int64(2) {
- return int32(_XML_CONVERT_OUTPUT_EXHAUSTED)
- }
- v3 = toP
- v2 = *(*uintptr)(unsafe.Pointer(v3))
- *(*uintptr)(unsafe.Pointer(v3))++
- *(*int8)(unsafe.Pointer(v2)) = int8(libc.Int32FromUint8(c)>>libc.Int32FromInt32(6) | int32(_UTF8_cval2))
- v5 = toP
- v4 = *(*uintptr)(unsafe.Pointer(v5))
- *(*uintptr)(unsafe.Pointer(v5))++
- *(*int8)(unsafe.Pointer(v4)) = int8(libc.Int32FromUint8(c)&libc.Int32FromInt32(0x3f) | libc.Int32FromInt32(0x80))
- *(*uintptr)(unsafe.Pointer(fromP))++
- } else {
- if *(*uintptr)(unsafe.Pointer(toP)) == toLim {
- return int32(_XML_CONVERT_OUTPUT_EXHAUSTED)
- }
- v7 = toP
- v6 = *(*uintptr)(unsafe.Pointer(v7))
- *(*uintptr)(unsafe.Pointer(v7))++
- v9 = fromP
- v8 = *(*uintptr)(unsafe.Pointer(v9))
- *(*uintptr)(unsafe.Pointer(v9))++
- *(*int8)(unsafe.Pointer(v6)) = *(*int8)(unsafe.Pointer(v8))
- }
- goto _1
- _1:
- }
- return r
- }
- func _latin1_toUtf16(tls *libc.TLS, enc uintptr, fromP uintptr, fromLim uintptr, toP uintptr, toLim uintptr) (r _XML_Convert_Result) {
- var v1, v2, v3, v4 uintptr
- _, _, _, _ = v1, v2, v3, v4
- _ = enc
- for *(*uintptr)(unsafe.Pointer(fromP)) < fromLim && *(*uintptr)(unsafe.Pointer(toP)) < toLim {
- v2 = toP
- v1 = *(*uintptr)(unsafe.Pointer(v2))
- *(*uintptr)(unsafe.Pointer(v2)) += 2
- v4 = fromP
- v3 = *(*uintptr)(unsafe.Pointer(v4))
- *(*uintptr)(unsafe.Pointer(v4))++
- *(*uint16)(unsafe.Pointer(v1)) = uint16(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(v3))))
- }
- if *(*uintptr)(unsafe.Pointer(toP)) == toLim && *(*uintptr)(unsafe.Pointer(fromP)) < fromLim {
- return int32(_XML_CONVERT_OUTPUT_EXHAUSTED)
- } else {
- return int32(_XML_CONVERT_COMPLETED)
- }
- return r
- }
- var _latin1_encoding_ns = Tnormal_encoding{
- Fenc: TENCODING{
- Fscanners: [4]TSCANNER{},
- FliteralScanners: [2]TSCANNER{},
- FminBytesPerChar: int32(1),
- },
- Ftype1: [256]uint8{
- 9: uint8(_BT_S),
- 10: uint8(_BT_LF),
- 13: uint8(_BT_CR),
- 32: uint8(_BT_S),
- 33: uint8(_BT_EXCL),
- 34: uint8(_BT_QUOT),
- 35: uint8(_BT_NUM),
- 36: uint8(_BT_OTHER),
- 37: uint8(_BT_PERCNT),
- 38: uint8(_BT_AMP),
- 39: uint8(_BT_APOS),
- 40: uint8(_BT_LPAR),
- 41: uint8(_BT_RPAR),
- 42: uint8(_BT_AST),
- 43: uint8(_BT_PLUS),
- 44: uint8(_BT_COMMA),
- 45: uint8(_BT_MINUS),
- 46: uint8(_BT_NAME),
- 47: uint8(_BT_SOL),
- 48: uint8(_BT_DIGIT),
- 49: uint8(_BT_DIGIT),
- 50: uint8(_BT_DIGIT),
- 51: uint8(_BT_DIGIT),
- 52: uint8(_BT_DIGIT),
- 53: uint8(_BT_DIGIT),
- 54: uint8(_BT_DIGIT),
- 55: uint8(_BT_DIGIT),
- 56: uint8(_BT_DIGIT),
- 57: uint8(_BT_DIGIT),
- 58: uint8(_BT_COLON),
- 59: uint8(_BT_SEMI),
- 60: uint8(_BT_LT),
- 61: uint8(_BT_EQUALS),
- 62: uint8(_BT_GT),
- 63: uint8(_BT_QUEST),
- 64: uint8(_BT_OTHER),
- 65: uint8(_BT_HEX),
- 66: uint8(_BT_HEX),
- 67: uint8(_BT_HEX),
- 68: uint8(_BT_HEX),
- 69: uint8(_BT_HEX),
- 70: uint8(_BT_HEX),
- 71: uint8(_BT_NMSTRT),
- 72: uint8(_BT_NMSTRT),
- 73: uint8(_BT_NMSTRT),
- 74: uint8(_BT_NMSTRT),
- 75: uint8(_BT_NMSTRT),
- 76: uint8(_BT_NMSTRT),
- 77: uint8(_BT_NMSTRT),
- 78: uint8(_BT_NMSTRT),
- 79: uint8(_BT_NMSTRT),
- 80: uint8(_BT_NMSTRT),
- 81: uint8(_BT_NMSTRT),
- 82: uint8(_BT_NMSTRT),
- 83: uint8(_BT_NMSTRT),
- 84: uint8(_BT_NMSTRT),
- 85: uint8(_BT_NMSTRT),
- 86: uint8(_BT_NMSTRT),
- 87: uint8(_BT_NMSTRT),
- 88: uint8(_BT_NMSTRT),
- 89: uint8(_BT_NMSTRT),
- 90: uint8(_BT_NMSTRT),
- 91: uint8(_BT_LSQB),
- 92: uint8(_BT_OTHER),
- 93: uint8(_BT_RSQB),
- 94: uint8(_BT_OTHER),
- 95: uint8(_BT_NMSTRT),
- 96: uint8(_BT_OTHER),
- 97: uint8(_BT_HEX),
- 98: uint8(_BT_HEX),
- 99: uint8(_BT_HEX),
- 100: uint8(_BT_HEX),
- 101: uint8(_BT_HEX),
- 102: uint8(_BT_HEX),
- 103: uint8(_BT_NMSTRT),
- 104: uint8(_BT_NMSTRT),
- 105: uint8(_BT_NMSTRT),
- 106: uint8(_BT_NMSTRT),
- 107: uint8(_BT_NMSTRT),
- 108: uint8(_BT_NMSTRT),
- 109: uint8(_BT_NMSTRT),
- 110: uint8(_BT_NMSTRT),
- 111: uint8(_BT_NMSTRT),
- 112: uint8(_BT_NMSTRT),
- 113: uint8(_BT_NMSTRT),
- 114: uint8(_BT_NMSTRT),
- 115: uint8(_BT_NMSTRT),
- 116: uint8(_BT_NMSTRT),
- 117: uint8(_BT_NMSTRT),
- 118: uint8(_BT_NMSTRT),
- 119: uint8(_BT_NMSTRT),
- 120: uint8(_BT_NMSTRT),
- 121: uint8(_BT_NMSTRT),
- 122: uint8(_BT_NMSTRT),
- 123: uint8(_BT_OTHER),
- 124: uint8(_BT_VERBAR),
- 125: uint8(_BT_OTHER),
- 126: uint8(_BT_OTHER),
- 127: uint8(_BT_OTHER),
- 128: uint8(_BT_OTHER),
- 129: uint8(_BT_OTHER),
- 130: uint8(_BT_OTHER),
- 131: uint8(_BT_OTHER),
- 132: uint8(_BT_OTHER),
- 133: uint8(_BT_OTHER),
- 134: uint8(_BT_OTHER),
- 135: uint8(_BT_OTHER),
- 136: uint8(_BT_OTHER),
- 137: uint8(_BT_OTHER),
- 138: uint8(_BT_OTHER),
- 139: uint8(_BT_OTHER),
- 140: uint8(_BT_OTHER),
- 141: uint8(_BT_OTHER),
- 142: uint8(_BT_OTHER),
- 143: uint8(_BT_OTHER),
- 144: uint8(_BT_OTHER),
- 145: uint8(_BT_OTHER),
- 146: uint8(_BT_OTHER),
- 147: uint8(_BT_OTHER),
- 148: uint8(_BT_OTHER),
- 149: uint8(_BT_OTHER),
- 150: uint8(_BT_OTHER),
- 151: uint8(_BT_OTHER),
- 152: uint8(_BT_OTHER),
- 153: uint8(_BT_OTHER),
- 154: uint8(_BT_OTHER),
- 155: uint8(_BT_OTHER),
- 156: uint8(_BT_OTHER),
- 157: uint8(_BT_OTHER),
- 158: uint8(_BT_OTHER),
- 159: uint8(_BT_OTHER),
- 160: uint8(_BT_OTHER),
- 161: uint8(_BT_OTHER),
- 162: uint8(_BT_OTHER),
- 163: uint8(_BT_OTHER),
- 164: uint8(_BT_OTHER),
- 165: uint8(_BT_OTHER),
- 166: uint8(_BT_OTHER),
- 167: uint8(_BT_OTHER),
- 168: uint8(_BT_OTHER),
- 169: uint8(_BT_OTHER),
- 170: uint8(_BT_NMSTRT),
- 171: uint8(_BT_OTHER),
- 172: uint8(_BT_OTHER),
- 173: uint8(_BT_OTHER),
- 174: uint8(_BT_OTHER),
- 175: uint8(_BT_OTHER),
- 176: uint8(_BT_OTHER),
- 177: uint8(_BT_OTHER),
- 178: uint8(_BT_OTHER),
- 179: uint8(_BT_OTHER),
- 180: uint8(_BT_OTHER),
- 181: uint8(_BT_NMSTRT),
- 182: uint8(_BT_OTHER),
- 183: uint8(_BT_NAME),
- 184: uint8(_BT_OTHER),
- 185: uint8(_BT_OTHER),
- 186: uint8(_BT_NMSTRT),
- 187: uint8(_BT_OTHER),
- 188: uint8(_BT_OTHER),
- 189: uint8(_BT_OTHER),
- 190: uint8(_BT_OTHER),
- 191: uint8(_BT_OTHER),
- 192: uint8(_BT_NMSTRT),
- 193: uint8(_BT_NMSTRT),
- 194: uint8(_BT_NMSTRT),
- 195: uint8(_BT_NMSTRT),
- 196: uint8(_BT_NMSTRT),
- 197: uint8(_BT_NMSTRT),
- 198: uint8(_BT_NMSTRT),
- 199: uint8(_BT_NMSTRT),
- 200: uint8(_BT_NMSTRT),
- 201: uint8(_BT_NMSTRT),
- 202: uint8(_BT_NMSTRT),
- 203: uint8(_BT_NMSTRT),
- 204: uint8(_BT_NMSTRT),
- 205: uint8(_BT_NMSTRT),
- 206: uint8(_BT_NMSTRT),
- 207: uint8(_BT_NMSTRT),
- 208: uint8(_BT_NMSTRT),
- 209: uint8(_BT_NMSTRT),
- 210: uint8(_BT_NMSTRT),
- 211: uint8(_BT_NMSTRT),
- 212: uint8(_BT_NMSTRT),
- 213: uint8(_BT_NMSTRT),
- 214: uint8(_BT_NMSTRT),
- 215: uint8(_BT_OTHER),
- 216: uint8(_BT_NMSTRT),
- 217: uint8(_BT_NMSTRT),
- 218: uint8(_BT_NMSTRT),
- 219: uint8(_BT_NMSTRT),
- 220: uint8(_BT_NMSTRT),
- 221: uint8(_BT_NMSTRT),
- 222: uint8(_BT_NMSTRT),
- 223: uint8(_BT_NMSTRT),
- 224: uint8(_BT_NMSTRT),
- 225: uint8(_BT_NMSTRT),
- 226: uint8(_BT_NMSTRT),
- 227: uint8(_BT_NMSTRT),
- 228: uint8(_BT_NMSTRT),
- 229: uint8(_BT_NMSTRT),
- 230: uint8(_BT_NMSTRT),
- 231: uint8(_BT_NMSTRT),
- 232: uint8(_BT_NMSTRT),
- 233: uint8(_BT_NMSTRT),
- 234: uint8(_BT_NMSTRT),
- 235: uint8(_BT_NMSTRT),
- 236: uint8(_BT_NMSTRT),
- 237: uint8(_BT_NMSTRT),
- 238: uint8(_BT_NMSTRT),
- 239: uint8(_BT_NMSTRT),
- 240: uint8(_BT_NMSTRT),
- 241: uint8(_BT_NMSTRT),
- 242: uint8(_BT_NMSTRT),
- 243: uint8(_BT_NMSTRT),
- 244: uint8(_BT_NMSTRT),
- 245: uint8(_BT_NMSTRT),
- 246: uint8(_BT_NMSTRT),
- 247: uint8(_BT_OTHER),
- 248: uint8(_BT_NMSTRT),
- 249: uint8(_BT_NMSTRT),
- 250: uint8(_BT_NMSTRT),
- 251: uint8(_BT_NMSTRT),
- 252: uint8(_BT_NMSTRT),
- 253: uint8(_BT_NMSTRT),
- 254: uint8(_BT_NMSTRT),
- 255: uint8(_BT_NMSTRT),
- },
- }
- func init() {
- p := unsafe.Pointer(&_latin1_encoding_ns)
- *(*uintptr)(unsafe.Add(p, 0)) = __ccgo_fp(_normal_prologTok)
- *(*uintptr)(unsafe.Add(p, 8)) = __ccgo_fp(_normal_contentTok)
- *(*uintptr)(unsafe.Add(p, 16)) = __ccgo_fp(_normal_cdataSectionTok)
- *(*uintptr)(unsafe.Add(p, 24)) = __ccgo_fp(_normal_ignoreSectionTok)
- *(*uintptr)(unsafe.Add(p, 32)) = __ccgo_fp(_normal_attributeValueTok)
- *(*uintptr)(unsafe.Add(p, 40)) = __ccgo_fp(_normal_entityValueTok)
- *(*uintptr)(unsafe.Add(p, 48)) = __ccgo_fp(_normal_nameMatchesAscii)
- *(*uintptr)(unsafe.Add(p, 56)) = __ccgo_fp(_normal_nameLength)
- *(*uintptr)(unsafe.Add(p, 64)) = __ccgo_fp(_normal_skipS)
- *(*uintptr)(unsafe.Add(p, 72)) = __ccgo_fp(_normal_getAtts)
- *(*uintptr)(unsafe.Add(p, 80)) = __ccgo_fp(_normal_charRefNumber)
- *(*uintptr)(unsafe.Add(p, 88)) = __ccgo_fp(_normal_predefinedEntityName)
- *(*uintptr)(unsafe.Add(p, 96)) = __ccgo_fp(_normal_updatePosition)
- *(*uintptr)(unsafe.Add(p, 104)) = __ccgo_fp(_normal_isPublicId)
- *(*uintptr)(unsafe.Add(p, 112)) = __ccgo_fp(_latin1_toUtf8)
- *(*uintptr)(unsafe.Add(p, 120)) = __ccgo_fp(_latin1_toUtf16)
- }
- var _latin1_encoding = Tnormal_encoding{
- Fenc: TENCODING{
- Fscanners: [4]TSCANNER{},
- FliteralScanners: [2]TSCANNER{},
- FminBytesPerChar: int32(1),
- },
- Ftype1: [256]uint8{
- 9: uint8(_BT_S),
- 10: uint8(_BT_LF),
- 13: uint8(_BT_CR),
- 32: uint8(_BT_S),
- 33: uint8(_BT_EXCL),
- 34: uint8(_BT_QUOT),
- 35: uint8(_BT_NUM),
- 36: uint8(_BT_OTHER),
- 37: uint8(_BT_PERCNT),
- 38: uint8(_BT_AMP),
- 39: uint8(_BT_APOS),
- 40: uint8(_BT_LPAR),
- 41: uint8(_BT_RPAR),
- 42: uint8(_BT_AST),
- 43: uint8(_BT_PLUS),
- 44: uint8(_BT_COMMA),
- 45: uint8(_BT_MINUS),
- 46: uint8(_BT_NAME),
- 47: uint8(_BT_SOL),
- 48: uint8(_BT_DIGIT),
- 49: uint8(_BT_DIGIT),
- 50: uint8(_BT_DIGIT),
- 51: uint8(_BT_DIGIT),
- 52: uint8(_BT_DIGIT),
- 53: uint8(_BT_DIGIT),
- 54: uint8(_BT_DIGIT),
- 55: uint8(_BT_DIGIT),
- 56: uint8(_BT_DIGIT),
- 57: uint8(_BT_DIGIT),
- 58: uint8(_BT_NMSTRT),
- 59: uint8(_BT_SEMI),
- 60: uint8(_BT_LT),
- 61: uint8(_BT_EQUALS),
- 62: uint8(_BT_GT),
- 63: uint8(_BT_QUEST),
- 64: uint8(_BT_OTHER),
- 65: uint8(_BT_HEX),
- 66: uint8(_BT_HEX),
- 67: uint8(_BT_HEX),
- 68: uint8(_BT_HEX),
- 69: uint8(_BT_HEX),
- 70: uint8(_BT_HEX),
- 71: uint8(_BT_NMSTRT),
- 72: uint8(_BT_NMSTRT),
- 73: uint8(_BT_NMSTRT),
- 74: uint8(_BT_NMSTRT),
- 75: uint8(_BT_NMSTRT),
- 76: uint8(_BT_NMSTRT),
- 77: uint8(_BT_NMSTRT),
- 78: uint8(_BT_NMSTRT),
- 79: uint8(_BT_NMSTRT),
- 80: uint8(_BT_NMSTRT),
- 81: uint8(_BT_NMSTRT),
- 82: uint8(_BT_NMSTRT),
- 83: uint8(_BT_NMSTRT),
- 84: uint8(_BT_NMSTRT),
- 85: uint8(_BT_NMSTRT),
- 86: uint8(_BT_NMSTRT),
- 87: uint8(_BT_NMSTRT),
- 88: uint8(_BT_NMSTRT),
- 89: uint8(_BT_NMSTRT),
- 90: uint8(_BT_NMSTRT),
- 91: uint8(_BT_LSQB),
- 92: uint8(_BT_OTHER),
- 93: uint8(_BT_RSQB),
- 94: uint8(_BT_OTHER),
- 95: uint8(_BT_NMSTRT),
- 96: uint8(_BT_OTHER),
- 97: uint8(_BT_HEX),
- 98: uint8(_BT_HEX),
- 99: uint8(_BT_HEX),
- 100: uint8(_BT_HEX),
- 101: uint8(_BT_HEX),
- 102: uint8(_BT_HEX),
- 103: uint8(_BT_NMSTRT),
- 104: uint8(_BT_NMSTRT),
- 105: uint8(_BT_NMSTRT),
- 106: uint8(_BT_NMSTRT),
- 107: uint8(_BT_NMSTRT),
- 108: uint8(_BT_NMSTRT),
- 109: uint8(_BT_NMSTRT),
- 110: uint8(_BT_NMSTRT),
- 111: uint8(_BT_NMSTRT),
- 112: uint8(_BT_NMSTRT),
- 113: uint8(_BT_NMSTRT),
- 114: uint8(_BT_NMSTRT),
- 115: uint8(_BT_NMSTRT),
- 116: uint8(_BT_NMSTRT),
- 117: uint8(_BT_NMSTRT),
- 118: uint8(_BT_NMSTRT),
- 119: uint8(_BT_NMSTRT),
- 120: uint8(_BT_NMSTRT),
- 121: uint8(_BT_NMSTRT),
- 122: uint8(_BT_NMSTRT),
- 123: uint8(_BT_OTHER),
- 124: uint8(_BT_VERBAR),
- 125: uint8(_BT_OTHER),
- 126: uint8(_BT_OTHER),
- 127: uint8(_BT_OTHER),
- 128: uint8(_BT_OTHER),
- 129: uint8(_BT_OTHER),
- 130: uint8(_BT_OTHER),
- 131: uint8(_BT_OTHER),
- 132: uint8(_BT_OTHER),
- 133: uint8(_BT_OTHER),
- 134: uint8(_BT_OTHER),
- 135: uint8(_BT_OTHER),
- 136: uint8(_BT_OTHER),
- 137: uint8(_BT_OTHER),
- 138: uint8(_BT_OTHER),
- 139: uint8(_BT_OTHER),
- 140: uint8(_BT_OTHER),
- 141: uint8(_BT_OTHER),
- 142: uint8(_BT_OTHER),
- 143: uint8(_BT_OTHER),
- 144: uint8(_BT_OTHER),
- 145: uint8(_BT_OTHER),
- 146: uint8(_BT_OTHER),
- 147: uint8(_BT_OTHER),
- 148: uint8(_BT_OTHER),
- 149: uint8(_BT_OTHER),
- 150: uint8(_BT_OTHER),
- 151: uint8(_BT_OTHER),
- 152: uint8(_BT_OTHER),
- 153: uint8(_BT_OTHER),
- 154: uint8(_BT_OTHER),
- 155: uint8(_BT_OTHER),
- 156: uint8(_BT_OTHER),
- 157: uint8(_BT_OTHER),
- 158: uint8(_BT_OTHER),
- 159: uint8(_BT_OTHER),
- 160: uint8(_BT_OTHER),
- 161: uint8(_BT_OTHER),
- 162: uint8(_BT_OTHER),
- 163: uint8(_BT_OTHER),
- 164: uint8(_BT_OTHER),
- 165: uint8(_BT_OTHER),
- 166: uint8(_BT_OTHER),
- 167: uint8(_BT_OTHER),
- 168: uint8(_BT_OTHER),
- 169: uint8(_BT_OTHER),
- 170: uint8(_BT_NMSTRT),
- 171: uint8(_BT_OTHER),
- 172: uint8(_BT_OTHER),
- 173: uint8(_BT_OTHER),
- 174: uint8(_BT_OTHER),
- 175: uint8(_BT_OTHER),
- 176: uint8(_BT_OTHER),
- 177: uint8(_BT_OTHER),
- 178: uint8(_BT_OTHER),
- 179: uint8(_BT_OTHER),
- 180: uint8(_BT_OTHER),
- 181: uint8(_BT_NMSTRT),
- 182: uint8(_BT_OTHER),
- 183: uint8(_BT_NAME),
- 184: uint8(_BT_OTHER),
- 185: uint8(_BT_OTHER),
- 186: uint8(_BT_NMSTRT),
- 187: uint8(_BT_OTHER),
- 188: uint8(_BT_OTHER),
- 189: uint8(_BT_OTHER),
- 190: uint8(_BT_OTHER),
- 191: uint8(_BT_OTHER),
- 192: uint8(_BT_NMSTRT),
- 193: uint8(_BT_NMSTRT),
- 194: uint8(_BT_NMSTRT),
- 195: uint8(_BT_NMSTRT),
- 196: uint8(_BT_NMSTRT),
- 197: uint8(_BT_NMSTRT),
- 198: uint8(_BT_NMSTRT),
- 199: uint8(_BT_NMSTRT),
- 200: uint8(_BT_NMSTRT),
- 201: uint8(_BT_NMSTRT),
- 202: uint8(_BT_NMSTRT),
- 203: uint8(_BT_NMSTRT),
- 204: uint8(_BT_NMSTRT),
- 205: uint8(_BT_NMSTRT),
- 206: uint8(_BT_NMSTRT),
- 207: uint8(_BT_NMSTRT),
- 208: uint8(_BT_NMSTRT),
- 209: uint8(_BT_NMSTRT),
- 210: uint8(_BT_NMSTRT),
- 211: uint8(_BT_NMSTRT),
- 212: uint8(_BT_NMSTRT),
- 213: uint8(_BT_NMSTRT),
- 214: uint8(_BT_NMSTRT),
- 215: uint8(_BT_OTHER),
- 216: uint8(_BT_NMSTRT),
- 217: uint8(_BT_NMSTRT),
- 218: uint8(_BT_NMSTRT),
- 219: uint8(_BT_NMSTRT),
- 220: uint8(_BT_NMSTRT),
- 221: uint8(_BT_NMSTRT),
- 222: uint8(_BT_NMSTRT),
- 223: uint8(_BT_NMSTRT),
- 224: uint8(_BT_NMSTRT),
- 225: uint8(_BT_NMSTRT),
- 226: uint8(_BT_NMSTRT),
- 227: uint8(_BT_NMSTRT),
- 228: uint8(_BT_NMSTRT),
- 229: uint8(_BT_NMSTRT),
- 230: uint8(_BT_NMSTRT),
- 231: uint8(_BT_NMSTRT),
- 232: uint8(_BT_NMSTRT),
- 233: uint8(_BT_NMSTRT),
- 234: uint8(_BT_NMSTRT),
- 235: uint8(_BT_NMSTRT),
- 236: uint8(_BT_NMSTRT),
- 237: uint8(_BT_NMSTRT),
- 238: uint8(_BT_NMSTRT),
- 239: uint8(_BT_NMSTRT),
- 240: uint8(_BT_NMSTRT),
- 241: uint8(_BT_NMSTRT),
- 242: uint8(_BT_NMSTRT),
- 243: uint8(_BT_NMSTRT),
- 244: uint8(_BT_NMSTRT),
- 245: uint8(_BT_NMSTRT),
- 246: uint8(_BT_NMSTRT),
- 247: uint8(_BT_OTHER),
- 248: uint8(_BT_NMSTRT),
- 249: uint8(_BT_NMSTRT),
- 250: uint8(_BT_NMSTRT),
- 251: uint8(_BT_NMSTRT),
- 252: uint8(_BT_NMSTRT),
- 253: uint8(_BT_NMSTRT),
- 254: uint8(_BT_NMSTRT),
- 255: uint8(_BT_NMSTRT),
- },
- }
- func init() {
- p := unsafe.Pointer(&_latin1_encoding)
- *(*uintptr)(unsafe.Add(p, 0)) = __ccgo_fp(_normal_prologTok)
- *(*uintptr)(unsafe.Add(p, 8)) = __ccgo_fp(_normal_contentTok)
- *(*uintptr)(unsafe.Add(p, 16)) = __ccgo_fp(_normal_cdataSectionTok)
- *(*uintptr)(unsafe.Add(p, 24)) = __ccgo_fp(_normal_ignoreSectionTok)
- *(*uintptr)(unsafe.Add(p, 32)) = __ccgo_fp(_normal_attributeValueTok)
- *(*uintptr)(unsafe.Add(p, 40)) = __ccgo_fp(_normal_entityValueTok)
- *(*uintptr)(unsafe.Add(p, 48)) = __ccgo_fp(_normal_nameMatchesAscii)
- *(*uintptr)(unsafe.Add(p, 56)) = __ccgo_fp(_normal_nameLength)
- *(*uintptr)(unsafe.Add(p, 64)) = __ccgo_fp(_normal_skipS)
- *(*uintptr)(unsafe.Add(p, 72)) = __ccgo_fp(_normal_getAtts)
- *(*uintptr)(unsafe.Add(p, 80)) = __ccgo_fp(_normal_charRefNumber)
- *(*uintptr)(unsafe.Add(p, 88)) = __ccgo_fp(_normal_predefinedEntityName)
- *(*uintptr)(unsafe.Add(p, 96)) = __ccgo_fp(_normal_updatePosition)
- *(*uintptr)(unsafe.Add(p, 104)) = __ccgo_fp(_normal_isPublicId)
- *(*uintptr)(unsafe.Add(p, 112)) = __ccgo_fp(_latin1_toUtf8)
- *(*uintptr)(unsafe.Add(p, 120)) = __ccgo_fp(_latin1_toUtf16)
- }
- func _ascii_toUtf8(tls *libc.TLS, enc uintptr, fromP uintptr, fromLim uintptr, toP uintptr, toLim uintptr) (r _XML_Convert_Result) {
- var v1, v2, v3, v4 uintptr
- _, _, _, _ = v1, v2, v3, v4
- _ = enc
- for *(*uintptr)(unsafe.Pointer(fromP)) < fromLim && *(*uintptr)(unsafe.Pointer(toP)) < toLim {
- v2 = toP
- v1 = *(*uintptr)(unsafe.Pointer(v2))
- *(*uintptr)(unsafe.Pointer(v2))++
- v4 = fromP
- v3 = *(*uintptr)(unsafe.Pointer(v4))
- *(*uintptr)(unsafe.Pointer(v4))++
- *(*int8)(unsafe.Pointer(v1)) = *(*int8)(unsafe.Pointer(v3))
- }
- if *(*uintptr)(unsafe.Pointer(toP)) == toLim && *(*uintptr)(unsafe.Pointer(fromP)) < fromLim {
- return int32(_XML_CONVERT_OUTPUT_EXHAUSTED)
- } else {
- return int32(_XML_CONVERT_COMPLETED)
- }
- return r
- }
- var _ascii_encoding_ns = Tnormal_encoding{
- Fenc: TENCODING{
- Fscanners: [4]TSCANNER{},
- FliteralScanners: [2]TSCANNER{},
- FminBytesPerChar: int32(1),
- FisUtf8: int8(1),
- },
- Ftype1: [256]uint8{
- 9: uint8(_BT_S),
- 10: uint8(_BT_LF),
- 13: uint8(_BT_CR),
- 32: uint8(_BT_S),
- 33: uint8(_BT_EXCL),
- 34: uint8(_BT_QUOT),
- 35: uint8(_BT_NUM),
- 36: uint8(_BT_OTHER),
- 37: uint8(_BT_PERCNT),
- 38: uint8(_BT_AMP),
- 39: uint8(_BT_APOS),
- 40: uint8(_BT_LPAR),
- 41: uint8(_BT_RPAR),
- 42: uint8(_BT_AST),
- 43: uint8(_BT_PLUS),
- 44: uint8(_BT_COMMA),
- 45: uint8(_BT_MINUS),
- 46: uint8(_BT_NAME),
- 47: uint8(_BT_SOL),
- 48: uint8(_BT_DIGIT),
- 49: uint8(_BT_DIGIT),
- 50: uint8(_BT_DIGIT),
- 51: uint8(_BT_DIGIT),
- 52: uint8(_BT_DIGIT),
- 53: uint8(_BT_DIGIT),
- 54: uint8(_BT_DIGIT),
- 55: uint8(_BT_DIGIT),
- 56: uint8(_BT_DIGIT),
- 57: uint8(_BT_DIGIT),
- 58: uint8(_BT_COLON),
- 59: uint8(_BT_SEMI),
- 60: uint8(_BT_LT),
- 61: uint8(_BT_EQUALS),
- 62: uint8(_BT_GT),
- 63: uint8(_BT_QUEST),
- 64: uint8(_BT_OTHER),
- 65: uint8(_BT_HEX),
- 66: uint8(_BT_HEX),
- 67: uint8(_BT_HEX),
- 68: uint8(_BT_HEX),
- 69: uint8(_BT_HEX),
- 70: uint8(_BT_HEX),
- 71: uint8(_BT_NMSTRT),
- 72: uint8(_BT_NMSTRT),
- 73: uint8(_BT_NMSTRT),
- 74: uint8(_BT_NMSTRT),
- 75: uint8(_BT_NMSTRT),
- 76: uint8(_BT_NMSTRT),
- 77: uint8(_BT_NMSTRT),
- 78: uint8(_BT_NMSTRT),
- 79: uint8(_BT_NMSTRT),
- 80: uint8(_BT_NMSTRT),
- 81: uint8(_BT_NMSTRT),
- 82: uint8(_BT_NMSTRT),
- 83: uint8(_BT_NMSTRT),
- 84: uint8(_BT_NMSTRT),
- 85: uint8(_BT_NMSTRT),
- 86: uint8(_BT_NMSTRT),
- 87: uint8(_BT_NMSTRT),
- 88: uint8(_BT_NMSTRT),
- 89: uint8(_BT_NMSTRT),
- 90: uint8(_BT_NMSTRT),
- 91: uint8(_BT_LSQB),
- 92: uint8(_BT_OTHER),
- 93: uint8(_BT_RSQB),
- 94: uint8(_BT_OTHER),
- 95: uint8(_BT_NMSTRT),
- 96: uint8(_BT_OTHER),
- 97: uint8(_BT_HEX),
- 98: uint8(_BT_HEX),
- 99: uint8(_BT_HEX),
- 100: uint8(_BT_HEX),
- 101: uint8(_BT_HEX),
- 102: uint8(_BT_HEX),
- 103: uint8(_BT_NMSTRT),
- 104: uint8(_BT_NMSTRT),
- 105: uint8(_BT_NMSTRT),
- 106: uint8(_BT_NMSTRT),
- 107: uint8(_BT_NMSTRT),
- 108: uint8(_BT_NMSTRT),
- 109: uint8(_BT_NMSTRT),
- 110: uint8(_BT_NMSTRT),
- 111: uint8(_BT_NMSTRT),
- 112: uint8(_BT_NMSTRT),
- 113: uint8(_BT_NMSTRT),
- 114: uint8(_BT_NMSTRT),
- 115: uint8(_BT_NMSTRT),
- 116: uint8(_BT_NMSTRT),
- 117: uint8(_BT_NMSTRT),
- 118: uint8(_BT_NMSTRT),
- 119: uint8(_BT_NMSTRT),
- 120: uint8(_BT_NMSTRT),
- 121: uint8(_BT_NMSTRT),
- 122: uint8(_BT_NMSTRT),
- 123: uint8(_BT_OTHER),
- 124: uint8(_BT_VERBAR),
- 125: uint8(_BT_OTHER),
- 126: uint8(_BT_OTHER),
- 127: uint8(_BT_OTHER),
- },
- }
- func init() {
- p := unsafe.Pointer(&_ascii_encoding_ns)
- *(*uintptr)(unsafe.Add(p, 0)) = __ccgo_fp(_normal_prologTok)
- *(*uintptr)(unsafe.Add(p, 8)) = __ccgo_fp(_normal_contentTok)
- *(*uintptr)(unsafe.Add(p, 16)) = __ccgo_fp(_normal_cdataSectionTok)
- *(*uintptr)(unsafe.Add(p, 24)) = __ccgo_fp(_normal_ignoreSectionTok)
- *(*uintptr)(unsafe.Add(p, 32)) = __ccgo_fp(_normal_attributeValueTok)
- *(*uintptr)(unsafe.Add(p, 40)) = __ccgo_fp(_normal_entityValueTok)
- *(*uintptr)(unsafe.Add(p, 48)) = __ccgo_fp(_normal_nameMatchesAscii)
- *(*uintptr)(unsafe.Add(p, 56)) = __ccgo_fp(_normal_nameLength)
- *(*uintptr)(unsafe.Add(p, 64)) = __ccgo_fp(_normal_skipS)
- *(*uintptr)(unsafe.Add(p, 72)) = __ccgo_fp(_normal_getAtts)
- *(*uintptr)(unsafe.Add(p, 80)) = __ccgo_fp(_normal_charRefNumber)
- *(*uintptr)(unsafe.Add(p, 88)) = __ccgo_fp(_normal_predefinedEntityName)
- *(*uintptr)(unsafe.Add(p, 96)) = __ccgo_fp(_normal_updatePosition)
- *(*uintptr)(unsafe.Add(p, 104)) = __ccgo_fp(_normal_isPublicId)
- *(*uintptr)(unsafe.Add(p, 112)) = __ccgo_fp(_ascii_toUtf8)
- *(*uintptr)(unsafe.Add(p, 120)) = __ccgo_fp(_latin1_toUtf16)
- }
- var _ascii_encoding = Tnormal_encoding{
- Fenc: TENCODING{
- Fscanners: [4]TSCANNER{},
- FliteralScanners: [2]TSCANNER{},
- FminBytesPerChar: int32(1),
- FisUtf8: int8(1),
- },
- Ftype1: [256]uint8{
- 9: uint8(_BT_S),
- 10: uint8(_BT_LF),
- 13: uint8(_BT_CR),
- 32: uint8(_BT_S),
- 33: uint8(_BT_EXCL),
- 34: uint8(_BT_QUOT),
- 35: uint8(_BT_NUM),
- 36: uint8(_BT_OTHER),
- 37: uint8(_BT_PERCNT),
- 38: uint8(_BT_AMP),
- 39: uint8(_BT_APOS),
- 40: uint8(_BT_LPAR),
- 41: uint8(_BT_RPAR),
- 42: uint8(_BT_AST),
- 43: uint8(_BT_PLUS),
- 44: uint8(_BT_COMMA),
- 45: uint8(_BT_MINUS),
- 46: uint8(_BT_NAME),
- 47: uint8(_BT_SOL),
- 48: uint8(_BT_DIGIT),
- 49: uint8(_BT_DIGIT),
- 50: uint8(_BT_DIGIT),
- 51: uint8(_BT_DIGIT),
- 52: uint8(_BT_DIGIT),
- 53: uint8(_BT_DIGIT),
- 54: uint8(_BT_DIGIT),
- 55: uint8(_BT_DIGIT),
- 56: uint8(_BT_DIGIT),
- 57: uint8(_BT_DIGIT),
- 58: uint8(_BT_NMSTRT),
- 59: uint8(_BT_SEMI),
- 60: uint8(_BT_LT),
- 61: uint8(_BT_EQUALS),
- 62: uint8(_BT_GT),
- 63: uint8(_BT_QUEST),
- 64: uint8(_BT_OTHER),
- 65: uint8(_BT_HEX),
- 66: uint8(_BT_HEX),
- 67: uint8(_BT_HEX),
- 68: uint8(_BT_HEX),
- 69: uint8(_BT_HEX),
- 70: uint8(_BT_HEX),
- 71: uint8(_BT_NMSTRT),
- 72: uint8(_BT_NMSTRT),
- 73: uint8(_BT_NMSTRT),
- 74: uint8(_BT_NMSTRT),
- 75: uint8(_BT_NMSTRT),
- 76: uint8(_BT_NMSTRT),
- 77: uint8(_BT_NMSTRT),
- 78: uint8(_BT_NMSTRT),
- 79: uint8(_BT_NMSTRT),
- 80: uint8(_BT_NMSTRT),
- 81: uint8(_BT_NMSTRT),
- 82: uint8(_BT_NMSTRT),
- 83: uint8(_BT_NMSTRT),
- 84: uint8(_BT_NMSTRT),
- 85: uint8(_BT_NMSTRT),
- 86: uint8(_BT_NMSTRT),
- 87: uint8(_BT_NMSTRT),
- 88: uint8(_BT_NMSTRT),
- 89: uint8(_BT_NMSTRT),
- 90: uint8(_BT_NMSTRT),
- 91: uint8(_BT_LSQB),
- 92: uint8(_BT_OTHER),
- 93: uint8(_BT_RSQB),
- 94: uint8(_BT_OTHER),
- 95: uint8(_BT_NMSTRT),
- 96: uint8(_BT_OTHER),
- 97: uint8(_BT_HEX),
- 98: uint8(_BT_HEX),
- 99: uint8(_BT_HEX),
- 100: uint8(_BT_HEX),
- 101: uint8(_BT_HEX),
- 102: uint8(_BT_HEX),
- 103: uint8(_BT_NMSTRT),
- 104: uint8(_BT_NMSTRT),
- 105: uint8(_BT_NMSTRT),
- 106: uint8(_BT_NMSTRT),
- 107: uint8(_BT_NMSTRT),
- 108: uint8(_BT_NMSTRT),
- 109: uint8(_BT_NMSTRT),
- 110: uint8(_BT_NMSTRT),
- 111: uint8(_BT_NMSTRT),
- 112: uint8(_BT_NMSTRT),
- 113: uint8(_BT_NMSTRT),
- 114: uint8(_BT_NMSTRT),
- 115: uint8(_BT_NMSTRT),
- 116: uint8(_BT_NMSTRT),
- 117: uint8(_BT_NMSTRT),
- 118: uint8(_BT_NMSTRT),
- 119: uint8(_BT_NMSTRT),
- 120: uint8(_BT_NMSTRT),
- 121: uint8(_BT_NMSTRT),
- 122: uint8(_BT_NMSTRT),
- 123: uint8(_BT_OTHER),
- 124: uint8(_BT_VERBAR),
- 125: uint8(_BT_OTHER),
- 126: uint8(_BT_OTHER),
- 127: uint8(_BT_OTHER),
- },
- }
- func init() {
- p := unsafe.Pointer(&_ascii_encoding)
- *(*uintptr)(unsafe.Add(p, 0)) = __ccgo_fp(_normal_prologTok)
- *(*uintptr)(unsafe.Add(p, 8)) = __ccgo_fp(_normal_contentTok)
- *(*uintptr)(unsafe.Add(p, 16)) = __ccgo_fp(_normal_cdataSectionTok)
- *(*uintptr)(unsafe.Add(p, 24)) = __ccgo_fp(_normal_ignoreSectionTok)
- *(*uintptr)(unsafe.Add(p, 32)) = __ccgo_fp(_normal_attributeValueTok)
- *(*uintptr)(unsafe.Add(p, 40)) = __ccgo_fp(_normal_entityValueTok)
- *(*uintptr)(unsafe.Add(p, 48)) = __ccgo_fp(_normal_nameMatchesAscii)
- *(*uintptr)(unsafe.Add(p, 56)) = __ccgo_fp(_normal_nameLength)
- *(*uintptr)(unsafe.Add(p, 64)) = __ccgo_fp(_normal_skipS)
- *(*uintptr)(unsafe.Add(p, 72)) = __ccgo_fp(_normal_getAtts)
- *(*uintptr)(unsafe.Add(p, 80)) = __ccgo_fp(_normal_charRefNumber)
- *(*uintptr)(unsafe.Add(p, 88)) = __ccgo_fp(_normal_predefinedEntityName)
- *(*uintptr)(unsafe.Add(p, 96)) = __ccgo_fp(_normal_updatePosition)
- *(*uintptr)(unsafe.Add(p, 104)) = __ccgo_fp(_normal_isPublicId)
- *(*uintptr)(unsafe.Add(p, 112)) = __ccgo_fp(_ascii_toUtf8)
- *(*uintptr)(unsafe.Add(p, 120)) = __ccgo_fp(_latin1_toUtf16)
- }
- func _unicode_byte_type(tls *libc.TLS, hi int8, lo int8) (r int32) {
- switch libc.Int32FromUint8(libc.Uint8FromInt8(hi)) {
- /* 0xD800-0xDBFF first 16-bit code unit or high surrogate (W1) */
- case int32(0xD8):
- fallthrough
- case int32(0xD9):
- fallthrough
- case int32(0xDA):
- fallthrough
- case int32(0xDB):
- return int32(_BT_LEAD4)
- /* 0xDC00-0xDFFF second 16-bit code unit or low surrogate (W2) */
- fallthrough
- case int32(0xDC):
- fallthrough
- case int32(0xDD):
- fallthrough
- case int32(0xDE):
- fallthrough
- case int32(0xDF):
- return int32(_BT_TRAIL)
- case int32(0xFF):
- switch libc.Int32FromUint8(libc.Uint8FromInt8(lo)) {
- case int32(0xFF): /* noncharacter-FFFF */
- fallthrough
- case int32(0xFE): /* noncharacter-FFFE */
- return int32(_BT_NONXML)
- }
- break
- }
- return int32(_BT_NONASCII)
- }
- func _little2_toUtf8(tls *libc.TLS, enc uintptr, fromP uintptr, fromLim uintptr, toP uintptr, toLim uintptr) (r _XML_Convert_Result) {
- var from, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v2, v20, v21, v3, v4, v5, v6, v7, v8, v9 uintptr
- var hi, lo, lo2 uint8
- var plane int32
- _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = 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
- from = *(*uintptr)(unsafe.Pointer(fromP))
- _ = enc
- fromLim = from + uintptr((int64(fromLim)-int64(from))>>libc.Int32FromInt32(1)<<libc.Int32FromInt32(1)) /* shrink to even */
- for {
- if !(from < fromLim) {
- break
- }
- lo = libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(from)))
- hi = libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(from + 1)))
- switch libc.Int32FromUint8(hi) {
- case 0:
- if libc.Int32FromUint8(lo) < int32(0x80) {
- if *(*uintptr)(unsafe.Pointer(toP)) == toLim {
- *(*uintptr)(unsafe.Pointer(fromP)) = from
- return int32(_XML_CONVERT_OUTPUT_EXHAUSTED)
- }
- v3 = toP
- v2 = *(*uintptr)(unsafe.Pointer(v3))
- *(*uintptr)(unsafe.Pointer(v3))++
- *(*int8)(unsafe.Pointer(v2)) = libc.Int8FromUint8(lo)
- break
- } /* fall through */
- fallthrough
- case int32(0x1):
- fallthrough
- case int32(0x2):
- fallthrough
- case int32(0x3):
- fallthrough
- case int32(0x4):
- fallthrough
- case int32(0x5):
- fallthrough
- case int32(0x6):
- fallthrough
- case int32(0x7):
- if int64(toLim)-int64(*(*uintptr)(unsafe.Pointer(toP))) < int64(2) {
- *(*uintptr)(unsafe.Pointer(fromP)) = from
- return int32(_XML_CONVERT_OUTPUT_EXHAUSTED)
- }
- v5 = toP
- v4 = *(*uintptr)(unsafe.Pointer(v5))
- *(*uintptr)(unsafe.Pointer(v5))++
- *(*int8)(unsafe.Pointer(v4)) = int8(libc.Int32FromUint8(lo)>>libc.Int32FromInt32(6) | libc.Int32FromUint8(hi)<<libc.Int32FromInt32(2) | int32(_UTF8_cval2))
- v7 = toP
- v6 = *(*uintptr)(unsafe.Pointer(v7))
- *(*uintptr)(unsafe.Pointer(v7))++
- *(*int8)(unsafe.Pointer(v6)) = int8(libc.Int32FromUint8(lo)&libc.Int32FromInt32(0x3f) | libc.Int32FromInt32(0x80))
- default:
- if int64(toLim)-int64(*(*uintptr)(unsafe.Pointer(toP))) < int64(3) {
- *(*uintptr)(unsafe.Pointer(fromP)) = from
- return int32(_XML_CONVERT_OUTPUT_EXHAUSTED)
- } /* 16 bits divided 4, 6, 6 amongst 3 bytes */
- v9 = toP
- v8 = *(*uintptr)(unsafe.Pointer(v9))
- *(*uintptr)(unsafe.Pointer(v9))++
- *(*int8)(unsafe.Pointer(v8)) = int8(libc.Int32FromUint8(hi)>>libc.Int32FromInt32(4) | int32(_UTF8_cval3))
- v11 = toP
- v10 = *(*uintptr)(unsafe.Pointer(v11))
- *(*uintptr)(unsafe.Pointer(v11))++
- *(*int8)(unsafe.Pointer(v10)) = int8(libc.Int32FromUint8(hi)&libc.Int32FromInt32(0xf)<<libc.Int32FromInt32(2) | libc.Int32FromUint8(lo)>>libc.Int32FromInt32(6) | libc.Int32FromInt32(0x80))
- v13 = toP
- v12 = *(*uintptr)(unsafe.Pointer(v13))
- *(*uintptr)(unsafe.Pointer(v13))++
- *(*int8)(unsafe.Pointer(v12)) = int8(libc.Int32FromUint8(lo)&libc.Int32FromInt32(0x3f) | libc.Int32FromInt32(0x80))
- case int32(0xD8):
- fallthrough
- case int32(0xD9):
- fallthrough
- case int32(0xDA):
- fallthrough
- case int32(0xDB):
- if int64(toLim)-int64(*(*uintptr)(unsafe.Pointer(toP))) < int64(4) {
- *(*uintptr)(unsafe.Pointer(fromP)) = from
- return int32(_XML_CONVERT_OUTPUT_EXHAUSTED)
- }
- if int64(fromLim)-int64(from) < int64(4) {
- *(*uintptr)(unsafe.Pointer(fromP)) = from
- return int32(_XML_CONVERT_INPUT_INCOMPLETE)
- }
- plane = libc.Int32FromUint8(hi)&int32(0x3)<<int32(2) | libc.Int32FromUint8(lo)>>int32(6)&int32(0x3) + int32(1)
- v15 = toP
- v14 = *(*uintptr)(unsafe.Pointer(v15))
- *(*uintptr)(unsafe.Pointer(v15))++
- *(*int8)(unsafe.Pointer(v14)) = int8(plane>>libc.Int32FromInt32(2) | int32(_UTF8_cval4))
- v17 = toP
- v16 = *(*uintptr)(unsafe.Pointer(v17))
- *(*uintptr)(unsafe.Pointer(v17))++
- *(*int8)(unsafe.Pointer(v16)) = int8(libc.Int32FromUint8(lo)>>libc.Int32FromInt32(2)&libc.Int32FromInt32(0xF) | plane&libc.Int32FromInt32(0x3)<<libc.Int32FromInt32(4) | libc.Int32FromInt32(0x80))
- from += uintptr(2)
- lo2 = libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(from)))
- v19 = toP
- v18 = *(*uintptr)(unsafe.Pointer(v19))
- *(*uintptr)(unsafe.Pointer(v19))++
- *(*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))
- v21 = toP
- v20 = *(*uintptr)(unsafe.Pointer(v21))
- *(*uintptr)(unsafe.Pointer(v21))++
- *(*int8)(unsafe.Pointer(v20)) = int8(libc.Int32FromUint8(lo2)&libc.Int32FromInt32(0x3f) | libc.Int32FromInt32(0x80))
- break
- }
- goto _1
- _1:
- ;
- from += uintptr(2)
- }
- *(*uintptr)(unsafe.Pointer(fromP)) = from
- if from < fromLim {
- return int32(_XML_CONVERT_INPUT_INCOMPLETE)
- } else {
- return int32(_XML_CONVERT_COMPLETED)
- }
- return r
- }
- func _little2_toUtf16(tls *libc.TLS, enc uintptr, fromP uintptr, fromLim uintptr, toP uintptr, toLim uintptr) (r _XML_Convert_Result) {
- var res _XML_Convert_Result
- var v2, v3 uintptr
- _, _, _ = res, v2, v3
- res = int32(_XML_CONVERT_COMPLETED)
- _ = enc
- 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 */
- 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) {
- fromLim -= uintptr(2)
- res = int32(_XML_CONVERT_INPUT_INCOMPLETE)
- }
- for {
- if !(*(*uintptr)(unsafe.Pointer(fromP)) < fromLim && *(*uintptr)(unsafe.Pointer(toP)) < toLim) {
- break
- }
- v3 = toP
- v2 = *(*uintptr)(unsafe.Pointer(v3))
- *(*uintptr)(unsafe.Pointer(v3)) += 2
- *(*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)))))))
- goto _1
- _1:
- ;
- *(*uintptr)(unsafe.Pointer(fromP)) += uintptr(2)
- }
- if *(*uintptr)(unsafe.Pointer(toP)) == toLim && *(*uintptr)(unsafe.Pointer(fromP)) < fromLim {
- return int32(_XML_CONVERT_OUTPUT_EXHAUSTED)
- } else {
- return res
- }
- return r
- }
- func _big2_toUtf8(tls *libc.TLS, enc uintptr, fromP uintptr, fromLim uintptr, toP uintptr, toLim uintptr) (r _XML_Convert_Result) {
- var from, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v2, v20, v21, v3, v4, v5, v6, v7, v8, v9 uintptr
- var hi, lo, lo2 uint8
- var plane int32
- _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = 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
- from = *(*uintptr)(unsafe.Pointer(fromP))
- _ = enc
- fromLim = from + uintptr((int64(fromLim)-int64(from))>>libc.Int32FromInt32(1)<<libc.Int32FromInt32(1)) /* shrink to even */
- for {
- if !(from < fromLim) {
- break
- }
- lo = libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(from + 1)))
- hi = libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(from)))
- switch libc.Int32FromUint8(hi) {
- case 0:
- if libc.Int32FromUint8(lo) < int32(0x80) {
- if *(*uintptr)(unsafe.Pointer(toP)) == toLim {
- *(*uintptr)(unsafe.Pointer(fromP)) = from
- return int32(_XML_CONVERT_OUTPUT_EXHAUSTED)
- }
- v3 = toP
- v2 = *(*uintptr)(unsafe.Pointer(v3))
- *(*uintptr)(unsafe.Pointer(v3))++
- *(*int8)(unsafe.Pointer(v2)) = libc.Int8FromUint8(lo)
- break
- } /* fall through */
- fallthrough
- case int32(0x1):
- fallthrough
- case int32(0x2):
- fallthrough
- case int32(0x3):
- fallthrough
- case int32(0x4):
- fallthrough
- case int32(0x5):
- fallthrough
- case int32(0x6):
- fallthrough
- case int32(0x7):
- if int64(toLim)-int64(*(*uintptr)(unsafe.Pointer(toP))) < int64(2) {
- *(*uintptr)(unsafe.Pointer(fromP)) = from
- return int32(_XML_CONVERT_OUTPUT_EXHAUSTED)
- }
- v5 = toP
- v4 = *(*uintptr)(unsafe.Pointer(v5))
- *(*uintptr)(unsafe.Pointer(v5))++
- *(*int8)(unsafe.Pointer(v4)) = int8(libc.Int32FromUint8(lo)>>libc.Int32FromInt32(6) | libc.Int32FromUint8(hi)<<libc.Int32FromInt32(2) | int32(_UTF8_cval2))
- v7 = toP
- v6 = *(*uintptr)(unsafe.Pointer(v7))
- *(*uintptr)(unsafe.Pointer(v7))++
- *(*int8)(unsafe.Pointer(v6)) = int8(libc.Int32FromUint8(lo)&libc.Int32FromInt32(0x3f) | libc.Int32FromInt32(0x80))
- default:
- if int64(toLim)-int64(*(*uintptr)(unsafe.Pointer(toP))) < int64(3) {
- *(*uintptr)(unsafe.Pointer(fromP)) = from
- return int32(_XML_CONVERT_OUTPUT_EXHAUSTED)
- } /* 16 bits divided 4, 6, 6 amongst 3 bytes */
- v9 = toP
- v8 = *(*uintptr)(unsafe.Pointer(v9))
- *(*uintptr)(unsafe.Pointer(v9))++
- *(*int8)(unsafe.Pointer(v8)) = int8(libc.Int32FromUint8(hi)>>libc.Int32FromInt32(4) | int32(_UTF8_cval3))
- v11 = toP
- v10 = *(*uintptr)(unsafe.Pointer(v11))
- *(*uintptr)(unsafe.Pointer(v11))++
- *(*int8)(unsafe.Pointer(v10)) = int8(libc.Int32FromUint8(hi)&libc.Int32FromInt32(0xf)<<libc.Int32FromInt32(2) | libc.Int32FromUint8(lo)>>libc.Int32FromInt32(6) | libc.Int32FromInt32(0x80))
- v13 = toP
- v12 = *(*uintptr)(unsafe.Pointer(v13))
- *(*uintptr)(unsafe.Pointer(v13))++
- *(*int8)(unsafe.Pointer(v12)) = int8(libc.Int32FromUint8(lo)&libc.Int32FromInt32(0x3f) | libc.Int32FromInt32(0x80))
- case int32(0xD8):
- fallthrough
- case int32(0xD9):
- fallthrough
- case int32(0xDA):
- fallthrough
- case int32(0xDB):
- if int64(toLim)-int64(*(*uintptr)(unsafe.Pointer(toP))) < int64(4) {
- *(*uintptr)(unsafe.Pointer(fromP)) = from
- return int32(_XML_CONVERT_OUTPUT_EXHAUSTED)
- }
- if int64(fromLim)-int64(from) < int64(4) {
- *(*uintptr)(unsafe.Pointer(fromP)) = from
- return int32(_XML_CONVERT_INPUT_INCOMPLETE)
- }
- plane = libc.Int32FromUint8(hi)&int32(0x3)<<int32(2) | libc.Int32FromUint8(lo)>>int32(6)&int32(0x3) + int32(1)
- v15 = toP
- v14 = *(*uintptr)(unsafe.Pointer(v15))
- *(*uintptr)(unsafe.Pointer(v15))++
- *(*int8)(unsafe.Pointer(v14)) = int8(plane>>libc.Int32FromInt32(2) | int32(_UTF8_cval4))
- v17 = toP
- v16 = *(*uintptr)(unsafe.Pointer(v17))
- *(*uintptr)(unsafe.Pointer(v17))++
- *(*int8)(unsafe.Pointer(v16)) = int8(libc.Int32FromUint8(lo)>>libc.Int32FromInt32(2)&libc.Int32FromInt32(0xF) | plane&libc.Int32FromInt32(0x3)<<libc.Int32FromInt32(4) | libc.Int32FromInt32(0x80))
- from += uintptr(2)
- lo2 = libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(from + 1)))
- v19 = toP
- v18 = *(*uintptr)(unsafe.Pointer(v19))
- *(*uintptr)(unsafe.Pointer(v19))++
- *(*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))
- v21 = toP
- v20 = *(*uintptr)(unsafe.Pointer(v21))
- *(*uintptr)(unsafe.Pointer(v21))++
- *(*int8)(unsafe.Pointer(v20)) = int8(libc.Int32FromUint8(lo2)&libc.Int32FromInt32(0x3f) | libc.Int32FromInt32(0x80))
- break
- }
- goto _1
- _1:
- ;
- from += uintptr(2)
- }
- *(*uintptr)(unsafe.Pointer(fromP)) = from
- if from < fromLim {
- return int32(_XML_CONVERT_INPUT_INCOMPLETE)
- } else {
- return int32(_XML_CONVERT_COMPLETED)
- }
- return r
- }
- func _big2_toUtf16(tls *libc.TLS, enc uintptr, fromP uintptr, fromLim uintptr, toP uintptr, toLim uintptr) (r _XML_Convert_Result) {
- var res _XML_Convert_Result
- var v2, v3 uintptr
- _, _, _ = res, v2, v3
- res = int32(_XML_CONVERT_COMPLETED)
- _ = enc
- 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 */
- 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) {
- fromLim -= uintptr(2)
- res = int32(_XML_CONVERT_INPUT_INCOMPLETE)
- }
- for {
- if !(*(*uintptr)(unsafe.Pointer(fromP)) < fromLim && *(*uintptr)(unsafe.Pointer(toP)) < toLim) {
- break
- }
- v3 = toP
- v2 = *(*uintptr)(unsafe.Pointer(v3))
- *(*uintptr)(unsafe.Pointer(v3)) += 2
- *(*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)))))
- goto _1
- _1:
- ;
- *(*uintptr)(unsafe.Pointer(fromP)) += uintptr(2)
- }
- if *(*uintptr)(unsafe.Pointer(toP)) == toLim && *(*uintptr)(unsafe.Pointer(fromP)) < fromLim {
- return int32(_XML_CONVERT_OUTPUT_EXHAUSTED)
- } else {
- return res
- }
- return r
- }
- /* CHAR_MATCHES is guaranteed to have MINBPC bytes available. */
- /* This file is included (from xmltok.c, 1-3 times depending on XML_MIN_SIZE)!
- __ __ _
- ___\ \/ /_ __ __ _| |_
- / _ \\ /| '_ \ / _` | __|
- | __// \| |_) | (_| | |_
- \___/_/\_\ .__/ \__,_|\__|
- |_| XML parser
- Copyright (c) 1997-2000 Thai Open Source Software Center Ltd
- Copyright (c) 2000 Clark Cooper <coopercc@users.sourceforge.net>
- Copyright (c) 2002 Fred L. Drake, Jr. <fdrake@users.sourceforge.net>
- Copyright (c) 2002-2016 Karl Waclawek <karl@waclawek.net>
- Copyright (c) 2016-2022 Sebastian Pipping <sebastian@pipping.org>
- Copyright (c) 2017 Rhodri James <rhodri@wildebeest.org.uk>
- Copyright (c) 2018 Benjamin Peterson <benjamin@python.org>
- Copyright (c) 2018 Anton Maklakov <antmak.pub@gmail.com>
- Copyright (c) 2019 David Loffredo <loffredo@steptools.com>
- Copyright (c) 2020 Boris Kolpackov <boris@codesynthesis.com>
- Copyright (c) 2022 Martin Ettl <ettl.martin78@googlemail.com>
- Licensed under the MIT license:
- Permission is hereby granted, free of charge, to any person obtaining
- a copy of this software and associated documentation files (the
- "Software"), to deal in the Software without restriction, including
- without limitation the rights to use, copy, modify, merge, publish,
- distribute, sublicense, and/or sell copies of the Software, and to permit
- persons to whom the Software is furnished to do so, subject to the
- following conditions:
- The above copyright notice and this permission notice shall be included
- in all copies or substantial portions of the Software.
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
- NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
- USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
- /* ptr points to character following "<!-" */
- func _little2_scanComment(tls *libc.TLS, enc uintptr, ptr uintptr, end uintptr, nextTokPtr uintptr) (r int32) {
- var v1 int32
- _ = v1
- if int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2)) {
- if !(int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 && int32(*(*int8)(unsafe.Pointer(ptr))) == int32(m_ASCII_MINUS1)) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(2)
- for int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2)) {
- if int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 {
- v1 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr)))))))
- } else {
- v1 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr + 1)), *(*int8)(unsafe.Pointer(ptr)))
- }
- switch v1 {
- case int32(_BT_LEAD2):
- if int64(end)-int64(ptr) < int64(2) {
- return -int32(2)
- }
- if 0 != 0 {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(2)
- case int32(_BT_LEAD3):
- if int64(end)-int64(ptr) < int64(3) {
- return -int32(2)
- }
- if 0 != 0 {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(3)
- case int32(_BT_LEAD4):
- if int64(end)-int64(ptr) < int64(4) {
- return -int32(2)
- }
- if 0 != 0 {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(4)
- case int32(_BT_NONXML):
- fallthrough
- case int32(_BT_MALFORM):
- fallthrough
- case int32(_BT_TRAIL):
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- case int32(_BT_MINUS):
- ptr += uintptr(2)
- if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
- return -int32(1)
- }
- if int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 && int32(*(*int8)(unsafe.Pointer(ptr))) == int32(m_ASCII_MINUS1) {
- ptr += uintptr(2)
- if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
- return -int32(1)
- }
- if !(int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 && int32(*(*int8)(unsafe.Pointer(ptr))) == int32(m_ASCII_GT1)) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(2)
- return int32(m_XML_TOK_COMMENT)
- }
- default:
- ptr += uintptr(2)
- break
- }
- }
- }
- return -int32(1)
- }
- /* ptr points to character following "<!" */
- func _little2_scanDecl(tls *libc.TLS, enc uintptr, ptr uintptr, end uintptr, nextTokPtr uintptr) (r int32) {
- var v1, v2, v3 int32
- _, _, _ = v1, v2, v3
- if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
- return -int32(1)
- }
- if int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 {
- v1 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr)))))))
- } else {
- v1 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr + 1)), *(*int8)(unsafe.Pointer(ptr)))
- }
- switch v1 {
- case int32(_BT_MINUS):
- return _little2_scanComment(tls, enc, ptr+uintptr(2), end, nextTokPtr)
- case int32(_BT_LSQB):
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(2)
- return int32(m_XML_TOK_COND_SECT_OPEN)
- case int32(_BT_NMSTRT):
- fallthrough
- case int32(_BT_HEX):
- ptr += uintptr(2)
- default:
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- for int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2)) {
- if int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 {
- v2 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr)))))))
- } else {
- v2 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr + 1)), *(*int8)(unsafe.Pointer(ptr)))
- }
- switch v2 {
- case int32(_BT_PERCNT):
- if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(2)*libc.Int32FromInt32(2))) {
- return -int32(1)
- }
- /* don't allow <!ENTITY% foo "whatever"> */
- if int32(*(*int8)(unsafe.Pointer(ptr + libc.UintptrFromInt32(2) + 1))) == 0 {
- v3 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr + libc.UintptrFromInt32(2))))))))
- } else {
- v3 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr + libc.UintptrFromInt32(2) + 1)), *(*int8)(unsafe.Pointer(ptr + libc.UintptrFromInt32(2))))
- }
- switch v3 {
- case int32(_BT_S):
- fallthrough
- case int32(_BT_CR):
- fallthrough
- case int32(_BT_LF):
- fallthrough
- case int32(_BT_PERCNT):
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- /* fall through */
- fallthrough
- case int32(_BT_S):
- fallthrough
- case int32(_BT_CR):
- fallthrough
- case int32(_BT_LF):
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return int32(m_XML_TOK_DECL_OPEN)
- case int32(_BT_NMSTRT):
- fallthrough
- case int32(_BT_HEX):
- ptr += uintptr(2)
- default:
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- }
- return -int32(1)
- }
- func _little2_checkPiTarget(tls *libc.TLS, enc uintptr, ptr uintptr, end uintptr, tokPtr uintptr) (r int32) {
- var upper, v1, v2, v3 int32
- _, _, _, _ = upper, v1, v2, v3
- upper = 0
- _ = enc
- *(*int32)(unsafe.Pointer(tokPtr)) = int32(m_XML_TOK_PI)
- if int64(end)-int64(ptr) != int64(libc.Int32FromInt32(2)*libc.Int32FromInt32(3)) {
- return int32(1)
- }
- if int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 {
- v1 = int32(*(*int8)(unsafe.Pointer(ptr)))
- } else {
- v1 = -int32(1)
- }
- switch v1 {
- case int32(m_ASCII_x2):
- case int32(m_ASCII_X):
- upper = int32(1)
- default:
- return int32(1)
- }
- ptr += uintptr(2)
- if int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 {
- v2 = int32(*(*int8)(unsafe.Pointer(ptr)))
- } else {
- v2 = -int32(1)
- }
- switch v2 {
- case int32(m_ASCII_m2):
- case int32(m_ASCII_M):
- upper = int32(1)
- default:
- return int32(1)
- }
- ptr += uintptr(2)
- if int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 {
- v3 = int32(*(*int8)(unsafe.Pointer(ptr)))
- } else {
- v3 = -int32(1)
- }
- switch v3 {
- case int32(m_ASCII_l2):
- case int32(m_ASCII_L):
- upper = int32(1)
- default:
- return int32(1)
- }
- if upper != 0 {
- return 0
- }
- *(*int32)(unsafe.Pointer(tokPtr)) = int32(m_XML_TOK_XML_DECL)
- return int32(1)
- }
- /* ptr points to character following "<?" */
- func _little2_scanPi(tls *libc.TLS, enc uintptr, ptr uintptr, end uintptr, nextTokPtr uintptr) (r int32) {
- bp := tls.Alloc(16)
- defer tls.Free(16)
- var target uintptr
- var v1, v2, v3 int32
- var _ /* tok at bp+0 */ int32
- _, _, _, _ = target, v1, v2, v3
- target = ptr
- if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
- return -int32(1)
- }
- if int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 {
- v1 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr)))))))
- } else {
- v1 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr + 1)), *(*int8)(unsafe.Pointer(ptr)))
- }
- switch v1 {
- case int32(_BT_NONASCII):
- 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) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- } /* fall through */
- fallthrough
- case int32(_BT_NMSTRT):
- fallthrough
- case int32(_BT_HEX):
- ptr += uintptr(2)
- case int32(_BT_LEAD2):
- if int64(end)-int64(ptr) < int64(libc.Int32FromInt32(2)) {
- return -int32(2)
- }
- if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(2)
- case int32(_BT_LEAD3):
- if int64(end)-int64(ptr) < int64(libc.Int32FromInt32(3)) {
- return -int32(2)
- }
- if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(3)
- case int32(_BT_LEAD4):
- if int64(end)-int64(ptr) < int64(libc.Int32FromInt32(4)) {
- return -int32(2)
- }
- if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(4)
- default:
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- for int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2)) {
- if int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 {
- v2 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr)))))))
- } else {
- v2 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr + 1)), *(*int8)(unsafe.Pointer(ptr)))
- }
- switch v2 {
- case int32(_BT_NONASCII):
- 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) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- } /* fall through */
- fallthrough
- case int32(_BT_NMSTRT):
- fallthrough
- case int32(_BT_HEX):
- fallthrough
- case int32(_BT_DIGIT):
- fallthrough
- case int32(_BT_NAME):
- fallthrough
- case int32(_BT_MINUS):
- ptr += uintptr(2)
- case int32(_BT_LEAD2):
- if int64(end)-int64(ptr) < int64(2) {
- return -int32(2)
- }
- if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(2)
- case int32(_BT_LEAD3):
- if int64(end)-int64(ptr) < int64(3) {
- return -int32(2)
- }
- if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(3)
- case int32(_BT_LEAD4):
- if int64(end)-int64(ptr) < int64(4) {
- return -int32(2)
- }
- if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(4)
- case int32(_BT_S):
- fallthrough
- case int32(_BT_CR):
- fallthrough
- case int32(_BT_LF):
- if !(_little2_checkPiTarget(tls, enc, target, ptr, bp) != 0) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(2)
- for int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2)) {
- if int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 {
- v3 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr)))))))
- } else {
- v3 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr + 1)), *(*int8)(unsafe.Pointer(ptr)))
- }
- switch v3 {
- case int32(_BT_LEAD2):
- if int64(end)-int64(ptr) < int64(2) {
- return -int32(2)
- }
- if 0 != 0 {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(2)
- case int32(_BT_LEAD3):
- if int64(end)-int64(ptr) < int64(3) {
- return -int32(2)
- }
- if 0 != 0 {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(3)
- case int32(_BT_LEAD4):
- if int64(end)-int64(ptr) < int64(4) {
- return -int32(2)
- }
- if 0 != 0 {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(4)
- case int32(_BT_NONXML):
- fallthrough
- case int32(_BT_MALFORM):
- fallthrough
- case int32(_BT_TRAIL):
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- case int32(_BT_QUEST):
- ptr += uintptr(2)
- if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
- return -int32(1)
- }
- if int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 && int32(*(*int8)(unsafe.Pointer(ptr))) == int32(m_ASCII_GT1) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(2)
- return *(*int32)(unsafe.Pointer(bp))
- }
- default:
- ptr += uintptr(2)
- break
- }
- }
- return -int32(1)
- case int32(_BT_QUEST):
- if !(_little2_checkPiTarget(tls, enc, target, ptr, bp) != 0) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(2)
- if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
- return -int32(1)
- }
- if int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 && int32(*(*int8)(unsafe.Pointer(ptr))) == int32(m_ASCII_GT1) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(2)
- return *(*int32)(unsafe.Pointer(bp))
- }
- /* fall through */
- fallthrough
- default:
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- }
- return -int32(1)
- }
- func _little2_scanCdataSection(tls *libc.TLS, enc uintptr, ptr uintptr, end uintptr, nextTokPtr uintptr) (r int32) {
- var i int32
- _ = i
- _ = enc
- /* CDATA[ */
- if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(6)*libc.Int32FromInt32(2))) {
- return -int32(1)
- }
- i = 0
- for {
- if !(i < int32(6)) {
- break
- }
- if !(int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 && int32(*(*int8)(unsafe.Pointer(ptr))) == int32(_CDATA_LSQB1[i])) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- goto _1
- _1:
- ;
- i++
- ptr += uintptr(2)
- }
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return int32(m_XML_TOK_CDATA_SECT_OPEN)
- }
- var _CDATA_LSQB1 = [6]int8{
- 0: int8(m_ASCII_C),
- 1: int8(m_ASCII_D),
- 2: int8(m_ASCII_A),
- 3: int8(m_ASCII_T),
- 4: int8(m_ASCII_A),
- 5: int8(m_ASCII_LSQB1),
- }
- func _little2_cdataSectionTok(tls *libc.TLS, enc uintptr, ptr uintptr, end uintptr, nextTokPtr uintptr) (r int32) {
- var n Tsize_t
- var v1, v2, v3 int32
- _, _, _, _ = n, v1, v2, v3
- if ptr >= end {
- return -int32(4)
- }
- if int32(2) > int32(1) {
- n = libc.Uint64FromInt64(int64(end) - int64(ptr))
- if n&libc.Uint64FromInt32(libc.Int32FromInt32(2)-libc.Int32FromInt32(1)) != 0 {
- n &= libc.Uint64FromInt32(^(libc.Int32FromInt32(2) - libc.Int32FromInt32(1)))
- if n == uint64(0) {
- return -int32(1)
- }
- end = ptr + uintptr(n)
- }
- }
- if int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 {
- v1 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr)))))))
- } else {
- v1 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr + 1)), *(*int8)(unsafe.Pointer(ptr)))
- }
- switch v1 {
- case int32(_BT_RSQB):
- ptr += uintptr(2)
- if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
- return -int32(1)
- }
- if !(int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 && int32(*(*int8)(unsafe.Pointer(ptr))) == int32(m_ASCII_RSQB1)) {
- break
- }
- ptr += uintptr(2)
- if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
- return -int32(1)
- }
- if !(int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 && int32(*(*int8)(unsafe.Pointer(ptr))) == int32(m_ASCII_GT1)) {
- ptr -= uintptr(2)
- break
- }
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(2)
- return int32(m_XML_TOK_CDATA_SECT_CLOSE)
- case int32(_BT_CR):
- ptr += uintptr(2)
- if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
- return -int32(1)
- }
- if int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 {
- v2 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr)))))))
- } else {
- v2 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr + 1)), *(*int8)(unsafe.Pointer(ptr)))
- }
- if v2 == int32(_BT_LF) {
- ptr += uintptr(2)
- }
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return int32(m_XML_TOK_DATA_NEWLINE)
- case int32(_BT_LF):
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(2)
- return int32(m_XML_TOK_DATA_NEWLINE)
- case int32(_BT_LEAD2):
- if int64(end)-int64(ptr) < int64(2) {
- return -int32(2)
- }
- if 0 != 0 {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(2)
- case int32(_BT_LEAD3):
- if int64(end)-int64(ptr) < int64(3) {
- return -int32(2)
- }
- if 0 != 0 {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(3)
- case int32(_BT_LEAD4):
- if int64(end)-int64(ptr) < int64(4) {
- return -int32(2)
- }
- if 0 != 0 {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(4)
- case int32(_BT_NONXML):
- fallthrough
- case int32(_BT_MALFORM):
- fallthrough
- case int32(_BT_TRAIL):
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- default:
- ptr += uintptr(2)
- break
- }
- for int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2)) {
- if int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 {
- v3 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr)))))))
- } else {
- v3 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr + 1)), *(*int8)(unsafe.Pointer(ptr)))
- }
- switch v3 {
- case int32(_BT_LEAD2):
- if int64(end)-int64(ptr) < int64(2) || libc.Bool(0 != 0) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return int32(m_XML_TOK_DATA_CHARS)
- }
- ptr += uintptr(2)
- case int32(_BT_LEAD3):
- if int64(end)-int64(ptr) < int64(3) || libc.Bool(0 != 0) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return int32(m_XML_TOK_DATA_CHARS)
- }
- ptr += uintptr(3)
- case int32(_BT_LEAD4):
- if int64(end)-int64(ptr) < int64(4) || libc.Bool(0 != 0) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return int32(m_XML_TOK_DATA_CHARS)
- }
- ptr += uintptr(4)
- case int32(_BT_NONXML):
- fallthrough
- case int32(_BT_MALFORM):
- fallthrough
- case int32(_BT_TRAIL):
- fallthrough
- case int32(_BT_CR):
- fallthrough
- case int32(_BT_LF):
- fallthrough
- case int32(_BT_RSQB):
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return int32(m_XML_TOK_DATA_CHARS)
- default:
- ptr += uintptr(2)
- break
- }
- }
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return int32(m_XML_TOK_DATA_CHARS)
- }
- /* ptr points to character following "</" */
- func _little2_scanEndTag(tls *libc.TLS, enc uintptr, ptr uintptr, end uintptr, nextTokPtr uintptr) (r int32) {
- var v1, v2, v22 int32
- _, _, _ = v1, v2, v22
- if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
- return -int32(1)
- }
- if int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 {
- v1 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr)))))))
- } else {
- v1 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr + 1)), *(*int8)(unsafe.Pointer(ptr)))
- }
- switch v1 {
- case int32(_BT_NONASCII):
- 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) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- } /* fall through */
- fallthrough
- case int32(_BT_NMSTRT):
- fallthrough
- case int32(_BT_HEX):
- ptr += uintptr(2)
- case int32(_BT_LEAD2):
- if int64(end)-int64(ptr) < int64(libc.Int32FromInt32(2)) {
- return -int32(2)
- }
- if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(2)
- case int32(_BT_LEAD3):
- if int64(end)-int64(ptr) < int64(libc.Int32FromInt32(3)) {
- return -int32(2)
- }
- if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(3)
- case int32(_BT_LEAD4):
- if int64(end)-int64(ptr) < int64(libc.Int32FromInt32(4)) {
- return -int32(2)
- }
- if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(4)
- default:
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- for int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2)) {
- if int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 {
- v2 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr)))))))
- } else {
- v2 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr + 1)), *(*int8)(unsafe.Pointer(ptr)))
- }
- switch v2 {
- case int32(_BT_NONASCII):
- goto _3
- case int32(_BT_MINUS):
- goto _4
- case int32(_BT_NAME):
- goto _5
- case int32(_BT_DIGIT):
- goto _6
- case int32(_BT_HEX):
- goto _7
- case int32(_BT_NMSTRT):
- goto _8
- case int32(_BT_LEAD2):
- goto _9
- case int32(_BT_LEAD3):
- goto _10
- case int32(_BT_LEAD4):
- goto _11
- case int32(_BT_LF):
- goto _12
- case int32(_BT_CR):
- goto _13
- case int32(_BT_S):
- goto _14
- case int32(_BT_COLON):
- goto _15
- case int32(_BT_GT):
- goto _16
- default:
- goto _17
- }
- goto _18
- _3:
- ;
- 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) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- } /* fall through */
- _8:
- ;
- _7:
- ;
- _6:
- ;
- _5:
- ;
- _4:
- ;
- ptr += uintptr(2)
- goto _18
- _9:
- ;
- if int64(end)-int64(ptr) < int64(2) {
- return -int32(2)
- }
- if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(2)
- goto _18
- _10:
- ;
- if int64(end)-int64(ptr) < int64(3) {
- return -int32(2)
- }
- if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(3)
- goto _18
- _11:
- ;
- if int64(end)-int64(ptr) < int64(4) {
- return -int32(2)
- }
- if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(4)
- goto _18
- _14:
- ;
- _13:
- ;
- _12:
- ;
- ptr += uintptr(2)
- _21:
- ;
- if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
- goto _19
- }
- if int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 {
- v22 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr)))))))
- } else {
- v22 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr + 1)), *(*int8)(unsafe.Pointer(ptr)))
- }
- switch v22 {
- case int32(_BT_S):
- fallthrough
- case int32(_BT_CR):
- fallthrough
- case int32(_BT_LF):
- case int32(_BT_GT):
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(2)
- return int32(m_XML_TOK_END_TAG)
- default:
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- goto _20
- _20:
- ;
- ptr += uintptr(2)
- goto _21
- goto _19
- _19:
- ;
- return -int32(1)
- _15:
- ;
- /* no need to check qname syntax here,
- since end-tag must match exactly */
- ptr += uintptr(2)
- goto _18
- _16:
- ;
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(2)
- return int32(m_XML_TOK_END_TAG)
- _17:
- ;
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- _18:
- }
- return -int32(1)
- }
- /* ptr points to character following "&#X" */
- func _little2_scanHexCharRef(tls *libc.TLS, enc uintptr, ptr uintptr, end uintptr, nextTokPtr uintptr) (r int32) {
- var v1, v3 int32
- _, _ = v1, v3
- if int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2)) {
- if int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 {
- v1 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr)))))))
- } else {
- v1 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr + 1)), *(*int8)(unsafe.Pointer(ptr)))
- }
- switch v1 {
- case int32(_BT_DIGIT):
- fallthrough
- case int32(_BT_HEX):
- default:
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(2)
- for {
- if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
- break
- }
- if int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 {
- v3 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr)))))))
- } else {
- v3 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr + 1)), *(*int8)(unsafe.Pointer(ptr)))
- }
- switch v3 {
- case int32(_BT_DIGIT):
- fallthrough
- case int32(_BT_HEX):
- case int32(_BT_SEMI):
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(2)
- return int32(m_XML_TOK_CHAR_REF)
- default:
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- goto _2
- _2:
- ;
- ptr += uintptr(2)
- }
- }
- return -int32(1)
- }
- /* ptr points to character following "&#" */
- func _little2_scanCharRef(tls *libc.TLS, enc uintptr, ptr uintptr, end uintptr, nextTokPtr uintptr) (r int32) {
- var v1, v3 int32
- _, _ = v1, v3
- if int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2)) {
- if int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 && int32(*(*int8)(unsafe.Pointer(ptr))) == int32(m_ASCII_x2) {
- return _little2_scanHexCharRef(tls, enc, ptr+uintptr(2), end, nextTokPtr)
- }
- if int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 {
- v1 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr)))))))
- } else {
- v1 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr + 1)), *(*int8)(unsafe.Pointer(ptr)))
- }
- switch v1 {
- case int32(_BT_DIGIT):
- default:
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(2)
- for {
- if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
- break
- }
- if int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 {
- v3 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr)))))))
- } else {
- v3 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr + 1)), *(*int8)(unsafe.Pointer(ptr)))
- }
- switch v3 {
- case int32(_BT_DIGIT):
- case int32(_BT_SEMI):
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(2)
- return int32(m_XML_TOK_CHAR_REF)
- default:
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- goto _2
- _2:
- ;
- ptr += uintptr(2)
- }
- }
- return -int32(1)
- }
- /* ptr points to character following "&" */
- func _little2_scanRef(tls *libc.TLS, enc uintptr, ptr uintptr, end uintptr, nextTokPtr uintptr) (r int32) {
- var v1, v2 int32
- _, _ = v1, v2
- if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
- return -int32(1)
- }
- if int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 {
- v1 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr)))))))
- } else {
- v1 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr + 1)), *(*int8)(unsafe.Pointer(ptr)))
- }
- switch v1 {
- case int32(_BT_NONASCII):
- 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) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- } /* fall through */
- fallthrough
- case int32(_BT_NMSTRT):
- fallthrough
- case int32(_BT_HEX):
- ptr += uintptr(2)
- case int32(_BT_LEAD2):
- if int64(end)-int64(ptr) < int64(libc.Int32FromInt32(2)) {
- return -int32(2)
- }
- if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(2)
- case int32(_BT_LEAD3):
- if int64(end)-int64(ptr) < int64(libc.Int32FromInt32(3)) {
- return -int32(2)
- }
- if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(3)
- case int32(_BT_LEAD4):
- if int64(end)-int64(ptr) < int64(libc.Int32FromInt32(4)) {
- return -int32(2)
- }
- if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(4)
- case int32(_BT_NUM):
- return _little2_scanCharRef(tls, enc, ptr+uintptr(2), end, nextTokPtr)
- default:
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- for int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2)) {
- if int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 {
- v2 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr)))))))
- } else {
- v2 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr + 1)), *(*int8)(unsafe.Pointer(ptr)))
- }
- switch v2 {
- case int32(_BT_NONASCII):
- 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) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- } /* fall through */
- fallthrough
- case int32(_BT_NMSTRT):
- fallthrough
- case int32(_BT_HEX):
- fallthrough
- case int32(_BT_DIGIT):
- fallthrough
- case int32(_BT_NAME):
- fallthrough
- case int32(_BT_MINUS):
- ptr += uintptr(2)
- case int32(_BT_LEAD2):
- if int64(end)-int64(ptr) < int64(2) {
- return -int32(2)
- }
- if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(2)
- case int32(_BT_LEAD3):
- if int64(end)-int64(ptr) < int64(3) {
- return -int32(2)
- }
- if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(3)
- case int32(_BT_LEAD4):
- if int64(end)-int64(ptr) < int64(4) {
- return -int32(2)
- }
- if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(4)
- case int32(_BT_SEMI):
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(2)
- return int32(m_XML_TOK_ENTITY_REF)
- default:
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- }
- return -int32(1)
- }
- /* ptr points to character following first character of attribute name */
- func _little2_scanAtts(tls *libc.TLS, enc uintptr, _ptr uintptr, end uintptr, nextTokPtr uintptr) (r int32) {
- bp := tls.Alloc(16)
- defer tls.Free(16)
- *(*uintptr)(unsafe.Pointer(bp)) = _ptr
- var hadColon, open, t, t1, tok, v1, v18, v22, v24, v26, v27, v31 int32
- _, _, _, _, _, _, _, _, _, _, _, _ = hadColon, open, t, t1, tok, v1, v18, v22, v24, v26, v27, v31
- hadColon = 0
- for int64(end)-int64(*(*uintptr)(unsafe.Pointer(bp))) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2)) {
- if int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 1))) == 0 {
- v1 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))))))))
- } else {
- v1 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 1)), *(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))))
- }
- switch v1 {
- case int32(_BT_NONASCII):
- goto _2
- case int32(_BT_MINUS):
- goto _3
- case int32(_BT_NAME):
- goto _4
- case int32(_BT_DIGIT):
- goto _5
- case int32(_BT_HEX):
- goto _6
- case int32(_BT_NMSTRT):
- goto _7
- case int32(_BT_LEAD2):
- goto _8
- case int32(_BT_LEAD3):
- goto _9
- case int32(_BT_LEAD4):
- goto _10
- case int32(_BT_COLON):
- goto _11
- case int32(_BT_LF):
- goto _12
- case int32(_BT_CR):
- goto _13
- case int32(_BT_S):
- goto _14
- case int32(_BT_EQUALS):
- goto _15
- default:
- goto _16
- }
- goto _17
- _2:
- ;
- 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) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = *(*uintptr)(unsafe.Pointer(bp))
- return m_XML_TOK_INVALID
- } /* fall through */
- _7:
- ;
- _6:
- ;
- _5:
- ;
- _4:
- ;
- _3:
- ;
- *(*uintptr)(unsafe.Pointer(bp)) += uintptr(2)
- goto _17
- _8:
- ;
- if int64(end)-int64(*(*uintptr)(unsafe.Pointer(bp))) < int64(2) {
- return -int32(2)
- }
- if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = *(*uintptr)(unsafe.Pointer(bp))
- return m_XML_TOK_INVALID
- }
- *(*uintptr)(unsafe.Pointer(bp)) += uintptr(2)
- goto _17
- _9:
- ;
- if int64(end)-int64(*(*uintptr)(unsafe.Pointer(bp))) < int64(3) {
- return -int32(2)
- }
- if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = *(*uintptr)(unsafe.Pointer(bp))
- return m_XML_TOK_INVALID
- }
- *(*uintptr)(unsafe.Pointer(bp)) += uintptr(3)
- goto _17
- _10:
- ;
- if int64(end)-int64(*(*uintptr)(unsafe.Pointer(bp))) < int64(4) {
- return -int32(2)
- }
- if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = *(*uintptr)(unsafe.Pointer(bp))
- return m_XML_TOK_INVALID
- }
- *(*uintptr)(unsafe.Pointer(bp)) += uintptr(4)
- goto _17
- _11:
- ;
- if hadColon != 0 {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = *(*uintptr)(unsafe.Pointer(bp))
- return m_XML_TOK_INVALID
- }
- hadColon = int32(1)
- *(*uintptr)(unsafe.Pointer(bp)) += uintptr(2)
- if !(int64(end)-int64(*(*uintptr)(unsafe.Pointer(bp))) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
- return -int32(1)
- }
- if int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 1))) == 0 {
- v18 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))))))))
- } else {
- v18 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 1)), *(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))))
- }
- switch v18 {
- case int32(_BT_NONASCII):
- 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) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = *(*uintptr)(unsafe.Pointer(bp))
- return m_XML_TOK_INVALID
- } /* fall through */
- fallthrough
- case int32(_BT_NMSTRT):
- fallthrough
- case int32(_BT_HEX):
- *(*uintptr)(unsafe.Pointer(bp)) += uintptr(2)
- case int32(_BT_LEAD2):
- if int64(end)-int64(*(*uintptr)(unsafe.Pointer(bp))) < int64(libc.Int32FromInt32(2)) {
- return -int32(2)
- }
- if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = *(*uintptr)(unsafe.Pointer(bp))
- return m_XML_TOK_INVALID
- }
- *(*uintptr)(unsafe.Pointer(bp)) += uintptr(2)
- case int32(_BT_LEAD3):
- if int64(end)-int64(*(*uintptr)(unsafe.Pointer(bp))) < int64(libc.Int32FromInt32(3)) {
- return -int32(2)
- }
- if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = *(*uintptr)(unsafe.Pointer(bp))
- return m_XML_TOK_INVALID
- }
- *(*uintptr)(unsafe.Pointer(bp)) += uintptr(3)
- case int32(_BT_LEAD4):
- if int64(end)-int64(*(*uintptr)(unsafe.Pointer(bp))) < int64(libc.Int32FromInt32(4)) {
- return -int32(2)
- }
- if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = *(*uintptr)(unsafe.Pointer(bp))
- return m_XML_TOK_INVALID
- }
- *(*uintptr)(unsafe.Pointer(bp)) += uintptr(4)
- default:
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = *(*uintptr)(unsafe.Pointer(bp))
- return m_XML_TOK_INVALID
- }
- goto _17
- _14:
- ;
- _13:
- ;
- _12:
- ;
- _21:
- ;
- *(*uintptr)(unsafe.Pointer(bp)) += uintptr(2)
- if !(int64(end)-int64(*(*uintptr)(unsafe.Pointer(bp))) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
- return -int32(1)
- }
- if int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 1))) == 0 {
- v22 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))))))))
- } else {
- v22 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 1)), *(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))))
- }
- t = v22
- if t == int32(_BT_EQUALS) {
- goto _19
- }
- switch t {
- case int32(_BT_S):
- fallthrough
- case int32(_BT_LF):
- fallthrough
- case int32(_BT_CR):
- default:
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = *(*uintptr)(unsafe.Pointer(bp))
- return m_XML_TOK_INVALID
- }
- goto _20
- _20:
- ;
- goto _21
- goto _19
- _19:
- ;
- /* fall through */
- _15:
- ;
- hadColon = 0
- for {
- *(*uintptr)(unsafe.Pointer(bp)) += uintptr(2)
- if !(int64(end)-int64(*(*uintptr)(unsafe.Pointer(bp))) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
- return -int32(1)
- }
- if int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 1))) == 0 {
- v24 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))))))))
- } else {
- v24 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 1)), *(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))))
- }
- open = v24
- if open == int32(_BT_QUOT) || open == int32(_BT_APOS) {
- break
- }
- switch open {
- case int32(_BT_S):
- fallthrough
- case int32(_BT_LF):
- fallthrough
- case int32(_BT_CR):
- default:
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = *(*uintptr)(unsafe.Pointer(bp))
- return m_XML_TOK_INVALID
- }
- goto _23
- _23:
- }
- *(*uintptr)(unsafe.Pointer(bp)) += uintptr(2)
- /* in attribute value */
- for {
- if !(int64(end)-int64(*(*uintptr)(unsafe.Pointer(bp))) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
- return -int32(1)
- }
- if int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 1))) == 0 {
- v26 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))))))))
- } else {
- v26 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 1)), *(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))))
- }
- t1 = v26
- if t1 == open {
- break
- }
- switch t1 {
- case int32(_BT_LEAD2):
- if int64(end)-int64(*(*uintptr)(unsafe.Pointer(bp))) < int64(2) {
- return -int32(2)
- }
- if 0 != 0 {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = *(*uintptr)(unsafe.Pointer(bp))
- return m_XML_TOK_INVALID
- }
- *(*uintptr)(unsafe.Pointer(bp)) += uintptr(2)
- case int32(_BT_LEAD3):
- if int64(end)-int64(*(*uintptr)(unsafe.Pointer(bp))) < int64(3) {
- return -int32(2)
- }
- if 0 != 0 {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = *(*uintptr)(unsafe.Pointer(bp))
- return m_XML_TOK_INVALID
- }
- *(*uintptr)(unsafe.Pointer(bp)) += uintptr(3)
- case int32(_BT_LEAD4):
- if int64(end)-int64(*(*uintptr)(unsafe.Pointer(bp))) < int64(4) {
- return -int32(2)
- }
- if 0 != 0 {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = *(*uintptr)(unsafe.Pointer(bp))
- return m_XML_TOK_INVALID
- }
- *(*uintptr)(unsafe.Pointer(bp)) += uintptr(4)
- case int32(_BT_NONXML):
- fallthrough
- case int32(_BT_MALFORM):
- fallthrough
- case int32(_BT_TRAIL):
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = *(*uintptr)(unsafe.Pointer(bp))
- return m_XML_TOK_INVALID
- case int32(_BT_AMP):
- tok = _little2_scanRef(tls, enc, *(*uintptr)(unsafe.Pointer(bp))+uintptr(2), end, bp)
- if tok <= 0 {
- if tok == m_XML_TOK_INVALID {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = *(*uintptr)(unsafe.Pointer(bp))
- }
- return tok
- }
- case int32(_BT_LT):
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = *(*uintptr)(unsafe.Pointer(bp))
- return m_XML_TOK_INVALID
- default:
- *(*uintptr)(unsafe.Pointer(bp)) += uintptr(2)
- break
- }
- goto _25
- _25:
- }
- *(*uintptr)(unsafe.Pointer(bp)) += uintptr(2)
- if !(int64(end)-int64(*(*uintptr)(unsafe.Pointer(bp))) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
- return -int32(1)
- }
- if int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 1))) == 0 {
- v27 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))))))))
- } else {
- v27 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 1)), *(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))))
- }
- switch v27 {
- case int32(_BT_S):
- fallthrough
- case int32(_BT_CR):
- fallthrough
- case int32(_BT_LF):
- case int32(_BT_SOL):
- goto sol
- case int32(_BT_GT):
- goto gt
- default:
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = *(*uintptr)(unsafe.Pointer(bp))
- return m_XML_TOK_INVALID
- }
- /* ptr points to closing quote */
- _30:
- ;
- *(*uintptr)(unsafe.Pointer(bp)) += uintptr(2)
- if !(int64(end)-int64(*(*uintptr)(unsafe.Pointer(bp))) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
- return -int32(1)
- }
- if int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 1))) == 0 {
- v31 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))))))))
- } else {
- v31 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 1)), *(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))))
- }
- switch v31 {
- case int32(_BT_NONASCII):
- goto _32
- case int32(_BT_HEX):
- goto _33
- case int32(_BT_NMSTRT):
- goto _34
- case int32(_BT_LEAD2):
- goto _35
- case int32(_BT_LEAD3):
- goto _36
- case int32(_BT_LEAD4):
- goto _37
- case int32(_BT_LF):
- goto _38
- case int32(_BT_CR):
- goto _39
- case int32(_BT_S):
- goto _40
- case int32(_BT_GT):
- goto _41
- case int32(_BT_SOL):
- goto _42
- default:
- goto _43
- }
- goto _44
- _32:
- ;
- 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) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = *(*uintptr)(unsafe.Pointer(bp))
- return m_XML_TOK_INVALID
- } /* fall through */
- _34:
- ;
- _33:
- ;
- *(*uintptr)(unsafe.Pointer(bp)) += uintptr(2)
- goto _44
- _35:
- ;
- if int64(end)-int64(*(*uintptr)(unsafe.Pointer(bp))) < int64(libc.Int32FromInt32(2)) {
- return -int32(2)
- }
- if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = *(*uintptr)(unsafe.Pointer(bp))
- return m_XML_TOK_INVALID
- }
- *(*uintptr)(unsafe.Pointer(bp)) += uintptr(2)
- goto _44
- _36:
- ;
- if int64(end)-int64(*(*uintptr)(unsafe.Pointer(bp))) < int64(libc.Int32FromInt32(3)) {
- return -int32(2)
- }
- if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = *(*uintptr)(unsafe.Pointer(bp))
- return m_XML_TOK_INVALID
- }
- *(*uintptr)(unsafe.Pointer(bp)) += uintptr(3)
- goto _44
- _37:
- ;
- if int64(end)-int64(*(*uintptr)(unsafe.Pointer(bp))) < int64(libc.Int32FromInt32(4)) {
- return -int32(2)
- }
- if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = *(*uintptr)(unsafe.Pointer(bp))
- return m_XML_TOK_INVALID
- }
- *(*uintptr)(unsafe.Pointer(bp)) += uintptr(4)
- goto _44
- _40:
- ;
- _39:
- ;
- _38:
- ;
- goto _29
- _41:
- ;
- goto gt
- gt:
- ;
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = *(*uintptr)(unsafe.Pointer(bp)) + uintptr(2)
- return int32(m_XML_TOK_START_TAG_WITH_ATTS)
- _42:
- ;
- goto sol
- sol:
- ;
- *(*uintptr)(unsafe.Pointer(bp)) += uintptr(2)
- if !(int64(end)-int64(*(*uintptr)(unsafe.Pointer(bp))) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
- return -int32(1)
- }
- if !(int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 1))) == 0 && int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp))))) == int32(m_ASCII_GT1)) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = *(*uintptr)(unsafe.Pointer(bp))
- return m_XML_TOK_INVALID
- }
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = *(*uintptr)(unsafe.Pointer(bp)) + uintptr(2)
- return int32(m_XML_TOK_EMPTY_ELEMENT_WITH_ATTS)
- _43:
- ;
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = *(*uintptr)(unsafe.Pointer(bp))
- return m_XML_TOK_INVALID
- _44:
- ;
- goto _28
- goto _29
- _29:
- ;
- goto _30
- goto _28
- _28:
- ;
- goto _17
- _16:
- ;
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = *(*uintptr)(unsafe.Pointer(bp))
- return m_XML_TOK_INVALID
- _17:
- }
- return -int32(1)
- }
- /* ptr points to character following "<" */
- func _little2_scanLt(tls *libc.TLS, enc uintptr, ptr uintptr, end uintptr, nextTokPtr uintptr) (r int32) {
- var hadColon, v1, v2, v21, v22, v3 int32
- _, _, _, _, _, _ = hadColon, v1, v2, v21, v22, v3
- if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
- return -int32(1)
- }
- if int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 {
- v1 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr)))))))
- } else {
- v1 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr + 1)), *(*int8)(unsafe.Pointer(ptr)))
- }
- switch v1 {
- case int32(_BT_NONASCII):
- 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) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- } /* fall through */
- fallthrough
- case int32(_BT_NMSTRT):
- fallthrough
- case int32(_BT_HEX):
- ptr += uintptr(2)
- case int32(_BT_LEAD2):
- if int64(end)-int64(ptr) < int64(libc.Int32FromInt32(2)) {
- return -int32(2)
- }
- if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(2)
- case int32(_BT_LEAD3):
- if int64(end)-int64(ptr) < int64(libc.Int32FromInt32(3)) {
- return -int32(2)
- }
- if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(3)
- case int32(_BT_LEAD4):
- if int64(end)-int64(ptr) < int64(libc.Int32FromInt32(4)) {
- return -int32(2)
- }
- if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(4)
- case int32(_BT_EXCL):
- ptr += uintptr(2)
- if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
- return -int32(1)
- }
- if int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 {
- v2 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr)))))))
- } else {
- v2 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr + 1)), *(*int8)(unsafe.Pointer(ptr)))
- }
- switch v2 {
- case int32(_BT_MINUS):
- return _little2_scanComment(tls, enc, ptr+uintptr(2), end, nextTokPtr)
- case int32(_BT_LSQB):
- return _little2_scanCdataSection(tls, enc, ptr+uintptr(2), end, nextTokPtr)
- }
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- case int32(_BT_QUEST):
- return _little2_scanPi(tls, enc, ptr+uintptr(2), end, nextTokPtr)
- case int32(_BT_SOL):
- return _little2_scanEndTag(tls, enc, ptr+uintptr(2), end, nextTokPtr)
- default:
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- hadColon = 0
- /* we have a start-tag */
- for int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2)) {
- if int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 {
- v3 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr)))))))
- } else {
- v3 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr + 1)), *(*int8)(unsafe.Pointer(ptr)))
- }
- switch v3 {
- case int32(_BT_NONASCII):
- goto _4
- case int32(_BT_MINUS):
- goto _5
- case int32(_BT_NAME):
- goto _6
- case int32(_BT_DIGIT):
- goto _7
- case int32(_BT_HEX):
- goto _8
- case int32(_BT_NMSTRT):
- goto _9
- case int32(_BT_LEAD2):
- goto _10
- case int32(_BT_LEAD3):
- goto _11
- case int32(_BT_LEAD4):
- goto _12
- case int32(_BT_COLON):
- goto _13
- case int32(_BT_LF):
- goto _14
- case int32(_BT_CR):
- goto _15
- case int32(_BT_S):
- goto _16
- case int32(_BT_GT):
- goto _17
- case int32(_BT_SOL):
- goto _18
- default:
- goto _19
- }
- goto _20
- _4:
- ;
- 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) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- } /* fall through */
- _9:
- ;
- _8:
- ;
- _7:
- ;
- _6:
- ;
- _5:
- ;
- ptr += uintptr(2)
- goto _20
- _10:
- ;
- if int64(end)-int64(ptr) < int64(2) {
- return -int32(2)
- }
- if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(2)
- goto _20
- _11:
- ;
- if int64(end)-int64(ptr) < int64(3) {
- return -int32(2)
- }
- if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(3)
- goto _20
- _12:
- ;
- if int64(end)-int64(ptr) < int64(4) {
- return -int32(2)
- }
- if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(4)
- goto _20
- _13:
- ;
- if hadColon != 0 {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- hadColon = int32(1)
- ptr += uintptr(2)
- if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
- return -int32(1)
- }
- if int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 {
- v21 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr)))))))
- } else {
- v21 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr + 1)), *(*int8)(unsafe.Pointer(ptr)))
- }
- switch v21 {
- case int32(_BT_NONASCII):
- 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) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- } /* fall through */
- fallthrough
- case int32(_BT_NMSTRT):
- fallthrough
- case int32(_BT_HEX):
- ptr += uintptr(2)
- case int32(_BT_LEAD2):
- if int64(end)-int64(ptr) < int64(libc.Int32FromInt32(2)) {
- return -int32(2)
- }
- if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(2)
- case int32(_BT_LEAD3):
- if int64(end)-int64(ptr) < int64(libc.Int32FromInt32(3)) {
- return -int32(2)
- }
- if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(3)
- case int32(_BT_LEAD4):
- if int64(end)-int64(ptr) < int64(libc.Int32FromInt32(4)) {
- return -int32(2)
- }
- if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(4)
- default:
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- goto _20
- _16:
- ;
- _15:
- ;
- _14:
- ;
- ptr += uintptr(2)
- for int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2)) {
- if int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 {
- v22 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr)))))))
- } else {
- v22 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr + 1)), *(*int8)(unsafe.Pointer(ptr)))
- }
- switch v22 {
- case int32(_BT_NONASCII):
- 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) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- } /* fall through */
- fallthrough
- case int32(_BT_NMSTRT):
- fallthrough
- case int32(_BT_HEX):
- ptr += uintptr(2)
- case int32(_BT_LEAD2):
- if int64(end)-int64(ptr) < int64(libc.Int32FromInt32(2)) {
- return -int32(2)
- }
- if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(2)
- case int32(_BT_LEAD3):
- if int64(end)-int64(ptr) < int64(libc.Int32FromInt32(3)) {
- return -int32(2)
- }
- if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(3)
- case int32(_BT_LEAD4):
- if int64(end)-int64(ptr) < int64(libc.Int32FromInt32(4)) {
- return -int32(2)
- }
- if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(4)
- case int32(_BT_GT):
- goto gt
- case int32(_BT_SOL):
- goto sol
- case int32(_BT_S):
- fallthrough
- case int32(_BT_CR):
- fallthrough
- case int32(_BT_LF):
- ptr += uintptr(2)
- continue
- default:
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- return _little2_scanAtts(tls, enc, ptr, end, nextTokPtr)
- }
- return -int32(1)
- _17:
- ;
- goto gt
- gt:
- ;
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(2)
- return int32(m_XML_TOK_START_TAG_NO_ATTS)
- _18:
- ;
- goto sol
- sol:
- ;
- ptr += uintptr(2)
- if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
- return -int32(1)
- }
- if !(int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 && int32(*(*int8)(unsafe.Pointer(ptr))) == int32(m_ASCII_GT1)) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(2)
- return int32(m_XML_TOK_EMPTY_ELEMENT_NO_ATTS)
- _19:
- ;
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- _20:
- }
- return -int32(1)
- }
- func _little2_contentTok(tls *libc.TLS, enc uintptr, ptr uintptr, end uintptr, nextTokPtr uintptr) (r int32) {
- var n Tsize_t
- var v1, v2, v3 int32
- _, _, _, _ = n, v1, v2, v3
- if ptr >= end {
- return -int32(4)
- }
- if int32(2) > int32(1) {
- n = libc.Uint64FromInt64(int64(end) - int64(ptr))
- if n&libc.Uint64FromInt32(libc.Int32FromInt32(2)-libc.Int32FromInt32(1)) != 0 {
- n &= libc.Uint64FromInt32(^(libc.Int32FromInt32(2) - libc.Int32FromInt32(1)))
- if n == uint64(0) {
- return -int32(1)
- }
- end = ptr + uintptr(n)
- }
- }
- if int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 {
- v1 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr)))))))
- } else {
- v1 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr + 1)), *(*int8)(unsafe.Pointer(ptr)))
- }
- switch v1 {
- case int32(_BT_LT):
- return _little2_scanLt(tls, enc, ptr+uintptr(2), end, nextTokPtr)
- case int32(_BT_AMP):
- return _little2_scanRef(tls, enc, ptr+uintptr(2), end, nextTokPtr)
- case int32(_BT_CR):
- ptr += uintptr(2)
- if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
- return -int32(3)
- }
- if int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 {
- v2 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr)))))))
- } else {
- v2 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr + 1)), *(*int8)(unsafe.Pointer(ptr)))
- }
- if v2 == int32(_BT_LF) {
- ptr += uintptr(2)
- }
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return int32(m_XML_TOK_DATA_NEWLINE)
- case int32(_BT_LF):
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(2)
- return int32(m_XML_TOK_DATA_NEWLINE)
- case int32(_BT_RSQB):
- ptr += uintptr(2)
- if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
- return -int32(5)
- }
- if !(int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 && int32(*(*int8)(unsafe.Pointer(ptr))) == int32(m_ASCII_RSQB1)) {
- break
- }
- ptr += uintptr(2)
- if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
- return -int32(5)
- }
- if !(int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 && int32(*(*int8)(unsafe.Pointer(ptr))) == int32(m_ASCII_GT1)) {
- ptr -= uintptr(2)
- break
- }
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- case int32(_BT_LEAD2):
- if int64(end)-int64(ptr) < int64(2) {
- return -int32(2)
- }
- if 0 != 0 {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(2)
- case int32(_BT_LEAD3):
- if int64(end)-int64(ptr) < int64(3) {
- return -int32(2)
- }
- if 0 != 0 {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(3)
- case int32(_BT_LEAD4):
- if int64(end)-int64(ptr) < int64(4) {
- return -int32(2)
- }
- if 0 != 0 {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(4)
- case int32(_BT_NONXML):
- fallthrough
- case int32(_BT_MALFORM):
- fallthrough
- case int32(_BT_TRAIL):
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- default:
- ptr += uintptr(2)
- break
- }
- for int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2)) {
- if int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 {
- v3 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr)))))))
- } else {
- v3 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr + 1)), *(*int8)(unsafe.Pointer(ptr)))
- }
- switch v3 {
- case int32(_BT_LEAD2):
- if int64(end)-int64(ptr) < int64(2) || libc.Bool(0 != 0) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return int32(m_XML_TOK_DATA_CHARS)
- }
- ptr += uintptr(2)
- case int32(_BT_LEAD3):
- if int64(end)-int64(ptr) < int64(3) || libc.Bool(0 != 0) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return int32(m_XML_TOK_DATA_CHARS)
- }
- ptr += uintptr(3)
- case int32(_BT_LEAD4):
- if int64(end)-int64(ptr) < int64(4) || libc.Bool(0 != 0) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return int32(m_XML_TOK_DATA_CHARS)
- }
- ptr += uintptr(4)
- case int32(_BT_RSQB):
- if int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(2)*libc.Int32FromInt32(2)) {
- if !(int32(*(*int8)(unsafe.Pointer(ptr + libc.UintptrFromInt32(2) + 1))) == 0 && int32(*(*int8)(unsafe.Pointer(ptr + libc.UintptrFromInt32(2)))) == int32(m_ASCII_RSQB1)) {
- ptr += uintptr(2)
- break
- }
- if int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(3)*libc.Int32FromInt32(2)) {
- 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)) {
- ptr += uintptr(2)
- break
- }
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(libc.Int32FromInt32(2)*libc.Int32FromInt32(2))
- return m_XML_TOK_INVALID
- }
- }
- /* fall through */
- fallthrough
- case int32(_BT_AMP):
- fallthrough
- case int32(_BT_LT):
- fallthrough
- case int32(_BT_NONXML):
- fallthrough
- case int32(_BT_MALFORM):
- fallthrough
- case int32(_BT_TRAIL):
- fallthrough
- case int32(_BT_CR):
- fallthrough
- case int32(_BT_LF):
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return int32(m_XML_TOK_DATA_CHARS)
- default:
- ptr += uintptr(2)
- break
- }
- }
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return int32(m_XML_TOK_DATA_CHARS)
- }
- /* ptr points to character following "%" */
- func _little2_scanPercent(tls *libc.TLS, enc uintptr, ptr uintptr, end uintptr, nextTokPtr uintptr) (r int32) {
- var v1, v2 int32
- _, _ = v1, v2
- if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
- return -int32(1)
- }
- if int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 {
- v1 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr)))))))
- } else {
- v1 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr + 1)), *(*int8)(unsafe.Pointer(ptr)))
- }
- switch v1 {
- case int32(_BT_NONASCII):
- 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) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- } /* fall through */
- fallthrough
- case int32(_BT_NMSTRT):
- fallthrough
- case int32(_BT_HEX):
- ptr += uintptr(2)
- case int32(_BT_LEAD2):
- if int64(end)-int64(ptr) < int64(libc.Int32FromInt32(2)) {
- return -int32(2)
- }
- if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(2)
- case int32(_BT_LEAD3):
- if int64(end)-int64(ptr) < int64(libc.Int32FromInt32(3)) {
- return -int32(2)
- }
- if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(3)
- case int32(_BT_LEAD4):
- if int64(end)-int64(ptr) < int64(libc.Int32FromInt32(4)) {
- return -int32(2)
- }
- if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(4)
- case int32(_BT_S):
- fallthrough
- case int32(_BT_LF):
- fallthrough
- case int32(_BT_CR):
- fallthrough
- case int32(_BT_PERCNT):
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return int32(m_XML_TOK_PERCENT)
- default:
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- for int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2)) {
- if int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 {
- v2 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr)))))))
- } else {
- v2 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr + 1)), *(*int8)(unsafe.Pointer(ptr)))
- }
- switch v2 {
- case int32(_BT_NONASCII):
- 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) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- } /* fall through */
- fallthrough
- case int32(_BT_NMSTRT):
- fallthrough
- case int32(_BT_HEX):
- fallthrough
- case int32(_BT_DIGIT):
- fallthrough
- case int32(_BT_NAME):
- fallthrough
- case int32(_BT_MINUS):
- ptr += uintptr(2)
- case int32(_BT_LEAD2):
- if int64(end)-int64(ptr) < int64(2) {
- return -int32(2)
- }
- if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(2)
- case int32(_BT_LEAD3):
- if int64(end)-int64(ptr) < int64(3) {
- return -int32(2)
- }
- if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(3)
- case int32(_BT_LEAD4):
- if int64(end)-int64(ptr) < int64(4) {
- return -int32(2)
- }
- if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(4)
- case int32(_BT_SEMI):
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(2)
- return int32(m_XML_TOK_PARAM_ENTITY_REF)
- default:
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- }
- return -int32(1)
- }
- func _little2_scanPoundName(tls *libc.TLS, enc uintptr, ptr uintptr, end uintptr, nextTokPtr uintptr) (r int32) {
- var v1, v2 int32
- _, _ = v1, v2
- if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
- return -int32(1)
- }
- if int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 {
- v1 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr)))))))
- } else {
- v1 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr + 1)), *(*int8)(unsafe.Pointer(ptr)))
- }
- switch v1 {
- case int32(_BT_NONASCII):
- 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) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- } /* fall through */
- fallthrough
- case int32(_BT_NMSTRT):
- fallthrough
- case int32(_BT_HEX):
- ptr += uintptr(2)
- case int32(_BT_LEAD2):
- if int64(end)-int64(ptr) < int64(libc.Int32FromInt32(2)) {
- return -int32(2)
- }
- if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(2)
- case int32(_BT_LEAD3):
- if int64(end)-int64(ptr) < int64(libc.Int32FromInt32(3)) {
- return -int32(2)
- }
- if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(3)
- case int32(_BT_LEAD4):
- if int64(end)-int64(ptr) < int64(libc.Int32FromInt32(4)) {
- return -int32(2)
- }
- if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(4)
- default:
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- for int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2)) {
- if int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 {
- v2 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr)))))))
- } else {
- v2 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr + 1)), *(*int8)(unsafe.Pointer(ptr)))
- }
- switch v2 {
- case int32(_BT_NONASCII):
- 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) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- } /* fall through */
- fallthrough
- case int32(_BT_NMSTRT):
- fallthrough
- case int32(_BT_HEX):
- fallthrough
- case int32(_BT_DIGIT):
- fallthrough
- case int32(_BT_NAME):
- fallthrough
- case int32(_BT_MINUS):
- ptr += uintptr(2)
- case int32(_BT_LEAD2):
- if int64(end)-int64(ptr) < int64(2) {
- return -int32(2)
- }
- if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(2)
- case int32(_BT_LEAD3):
- if int64(end)-int64(ptr) < int64(3) {
- return -int32(2)
- }
- if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(3)
- case int32(_BT_LEAD4):
- if int64(end)-int64(ptr) < int64(4) {
- return -int32(2)
- }
- if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(4)
- case int32(_BT_CR):
- fallthrough
- case int32(_BT_LF):
- fallthrough
- case int32(_BT_S):
- fallthrough
- case int32(_BT_RPAR):
- fallthrough
- case int32(_BT_GT):
- fallthrough
- case int32(_BT_PERCNT):
- fallthrough
- case int32(_BT_VERBAR):
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return int32(m_XML_TOK_POUND_NAME)
- default:
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- }
- return -int32(m_XML_TOK_POUND_NAME)
- }
- func _little2_scanLit(tls *libc.TLS, open int32, enc uintptr, ptr uintptr, end uintptr, nextTokPtr uintptr) (r int32) {
- var t, v1, v2 int32
- _, _, _ = t, v1, v2
- for int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2)) {
- if int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 {
- v1 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr)))))))
- } else {
- v1 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr + 1)), *(*int8)(unsafe.Pointer(ptr)))
- }
- t = v1
- switch t {
- case int32(_BT_LEAD2):
- if int64(end)-int64(ptr) < int64(2) {
- return -int32(2)
- }
- if 0 != 0 {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(2)
- case int32(_BT_LEAD3):
- if int64(end)-int64(ptr) < int64(3) {
- return -int32(2)
- }
- if 0 != 0 {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(3)
- case int32(_BT_LEAD4):
- if int64(end)-int64(ptr) < int64(4) {
- return -int32(2)
- }
- if 0 != 0 {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(4)
- case int32(_BT_NONXML):
- fallthrough
- case int32(_BT_MALFORM):
- fallthrough
- case int32(_BT_TRAIL):
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- case int32(_BT_QUOT):
- fallthrough
- case int32(_BT_APOS):
- ptr += uintptr(2)
- if t != open {
- break
- }
- if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
- return -int32(m_XML_TOK_LITERAL)
- }
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- if int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 {
- v2 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr)))))))
- } else {
- v2 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr + 1)), *(*int8)(unsafe.Pointer(ptr)))
- }
- switch v2 {
- case int32(_BT_S):
- fallthrough
- case int32(_BT_CR):
- fallthrough
- case int32(_BT_LF):
- fallthrough
- case int32(_BT_GT):
- fallthrough
- case int32(_BT_PERCNT):
- fallthrough
- case int32(_BT_LSQB):
- return int32(m_XML_TOK_LITERAL)
- default:
- return m_XML_TOK_INVALID
- }
- fallthrough
- default:
- ptr += uintptr(2)
- break
- }
- }
- return -int32(1)
- }
- func _little2_prologTok(tls *libc.TLS, enc uintptr, ptr uintptr, end uintptr, nextTokPtr uintptr) (r int32) {
- var n Tsize_t
- var tok, v1, v29, v33, v34, v35, v36 int32
- _, _, _, _, _, _, _, _ = n, tok, v1, v29, v33, v34, v35, v36
- if ptr >= end {
- return -int32(4)
- }
- if int32(2) > int32(1) {
- n = libc.Uint64FromInt64(int64(end) - int64(ptr))
- if n&libc.Uint64FromInt32(libc.Int32FromInt32(2)-libc.Int32FromInt32(1)) != 0 {
- n &= libc.Uint64FromInt32(^(libc.Int32FromInt32(2) - libc.Int32FromInt32(1)))
- if n == uint64(0) {
- return -int32(1)
- }
- end = ptr + uintptr(n)
- }
- }
- if int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 {
- v1 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr)))))))
- } else {
- v1 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr + 1)), *(*int8)(unsafe.Pointer(ptr)))
- }
- switch v1 {
- case int32(_BT_QUOT):
- goto _2
- case int32(_BT_APOS):
- goto _3
- case int32(_BT_LT):
- goto _4
- case int32(_BT_CR):
- goto _5
- case int32(_BT_LF):
- goto _6
- case int32(_BT_S):
- goto _7
- case int32(_BT_PERCNT):
- goto _8
- case int32(_BT_COMMA):
- goto _9
- case int32(_BT_LSQB):
- goto _10
- case int32(_BT_RSQB):
- goto _11
- case int32(_BT_LPAR):
- goto _12
- case int32(_BT_RPAR):
- goto _13
- case int32(_BT_VERBAR):
- goto _14
- case int32(_BT_GT):
- goto _15
- case int32(_BT_NUM):
- goto _16
- case int32(_BT_LEAD2):
- goto _17
- case int32(_BT_LEAD3):
- goto _18
- case int32(_BT_LEAD4):
- goto _19
- case int32(_BT_HEX):
- goto _20
- case int32(_BT_NMSTRT):
- goto _21
- case int32(_BT_COLON):
- goto _22
- case int32(_BT_MINUS):
- goto _23
- case int32(_BT_NAME):
- goto _24
- case int32(_BT_DIGIT):
- goto _25
- case int32(_BT_NONASCII):
- goto _26
- default:
- goto _27
- }
- goto _28
- _2:
- ;
- return _little2_scanLit(tls, int32(_BT_QUOT), enc, ptr+uintptr(2), end, nextTokPtr)
- _3:
- ;
- return _little2_scanLit(tls, int32(_BT_APOS), enc, ptr+uintptr(2), end, nextTokPtr)
- _4:
- ;
- ptr += uintptr(2)
- if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
- return -int32(1)
- }
- if int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 {
- v29 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr)))))))
- } else {
- v29 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr + 1)), *(*int8)(unsafe.Pointer(ptr)))
- }
- switch v29 {
- case int32(_BT_EXCL):
- return _little2_scanDecl(tls, enc, ptr+uintptr(2), end, nextTokPtr)
- case int32(_BT_QUEST):
- return _little2_scanPi(tls, enc, ptr+uintptr(2), end, nextTokPtr)
- case int32(_BT_NMSTRT):
- fallthrough
- case int32(_BT_HEX):
- fallthrough
- case int32(_BT_NONASCII):
- fallthrough
- case int32(_BT_LEAD2):
- fallthrough
- case int32(_BT_LEAD3):
- fallthrough
- case int32(_BT_LEAD4):
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr - uintptr(2)
- return int32(m_XML_TOK_INSTANCE_START)
- }
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- _5:
- ;
- if ptr+uintptr(2) == end {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = end
- /* indicate that this might be part of a CR/LF pair */
- return -int32(m_XML_TOK_PROLOG_S)
- }
- /* fall through */
- _7:
- ;
- _6:
- ;
- _32:
- ;
- ptr += uintptr(2)
- if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
- goto _30
- }
- if int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 {
- v33 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr)))))))
- } else {
- v33 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr + 1)), *(*int8)(unsafe.Pointer(ptr)))
- }
- switch v33 {
- case int32(_BT_S):
- fallthrough
- case int32(_BT_LF):
- case int32(_BT_CR):
- /* don't split CR/LF pair */
- if ptr+uintptr(2) != end {
- break
- }
- /* fall through */
- fallthrough
- default:
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return int32(m_XML_TOK_PROLOG_S)
- }
- goto _31
- _31:
- ;
- goto _32
- goto _30
- _30:
- ;
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return int32(m_XML_TOK_PROLOG_S)
- _8:
- ;
- return _little2_scanPercent(tls, enc, ptr+uintptr(2), end, nextTokPtr)
- _9:
- ;
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(2)
- return int32(m_XML_TOK_COMMA)
- _10:
- ;
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(2)
- return int32(m_XML_TOK_OPEN_BRACKET)
- _11:
- ;
- ptr += uintptr(2)
- if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
- return -int32(m_XML_TOK_CLOSE_BRACKET)
- }
- if int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 && int32(*(*int8)(unsafe.Pointer(ptr))) == int32(m_ASCII_RSQB1) {
- if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(2)*libc.Int32FromInt32(2))) {
- return -int32(1)
- }
- if int32(*(*int8)(unsafe.Pointer(ptr + libc.UintptrFromInt32(2) + 1))) == 0 && int32(*(*int8)(unsafe.Pointer(ptr + libc.UintptrFromInt32(2)))) == int32(m_ASCII_GT1) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(libc.Int32FromInt32(2)*libc.Int32FromInt32(2))
- return int32(m_XML_TOK_COND_SECT_CLOSE)
- }
- }
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return int32(m_XML_TOK_CLOSE_BRACKET)
- _12:
- ;
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(2)
- return int32(m_XML_TOK_OPEN_PAREN)
- _13:
- ;
- ptr += uintptr(2)
- if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
- return -int32(m_XML_TOK_CLOSE_PAREN)
- }
- if int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 {
- v34 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr)))))))
- } else {
- v34 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr + 1)), *(*int8)(unsafe.Pointer(ptr)))
- }
- switch v34 {
- case int32(_BT_AST):
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(2)
- return int32(m_XML_TOK_CLOSE_PAREN_ASTERISK)
- case int32(_BT_QUEST):
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(2)
- return int32(m_XML_TOK_CLOSE_PAREN_QUESTION)
- case int32(_BT_PLUS):
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(2)
- return int32(m_XML_TOK_CLOSE_PAREN_PLUS)
- case int32(_BT_CR):
- fallthrough
- case int32(_BT_LF):
- fallthrough
- case int32(_BT_S):
- fallthrough
- case int32(_BT_GT):
- fallthrough
- case int32(_BT_COMMA):
- fallthrough
- case int32(_BT_VERBAR):
- fallthrough
- case int32(_BT_RPAR):
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return int32(m_XML_TOK_CLOSE_PAREN)
- }
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- _14:
- ;
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(2)
- return int32(m_XML_TOK_OR)
- _15:
- ;
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(2)
- return int32(m_XML_TOK_DECL_CLOSE)
- _16:
- ;
- return _little2_scanPoundName(tls, enc, ptr+uintptr(2), end, nextTokPtr)
- _17:
- ;
- if int64(end)-int64(ptr) < int64(2) {
- return -int32(2)
- }
- if 0 != 0 {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- if 0 != 0 {
- ptr += uintptr(2)
- tok = int32(m_XML_TOK_NAME)
- goto _28
- }
- if 0 != 0 {
- ptr += uintptr(2)
- tok = int32(m_XML_TOK_NMTOKEN)
- goto _28
- }
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- _18:
- ;
- if int64(end)-int64(ptr) < int64(3) {
- return -int32(2)
- }
- if 0 != 0 {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- if 0 != 0 {
- ptr += uintptr(3)
- tok = int32(m_XML_TOK_NAME)
- goto _28
- }
- if 0 != 0 {
- ptr += uintptr(3)
- tok = int32(m_XML_TOK_NMTOKEN)
- goto _28
- }
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- _19:
- ;
- if int64(end)-int64(ptr) < int64(4) {
- return -int32(2)
- }
- if 0 != 0 {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- if 0 != 0 {
- ptr += uintptr(4)
- tok = int32(m_XML_TOK_NAME)
- goto _28
- }
- if 0 != 0 {
- ptr += uintptr(4)
- tok = int32(m_XML_TOK_NMTOKEN)
- goto _28
- }
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- _21:
- ;
- _20:
- ;
- tok = int32(m_XML_TOK_NAME)
- ptr += uintptr(2)
- goto _28
- _25:
- ;
- _24:
- ;
- _23:
- ;
- _22:
- ;
- tok = int32(m_XML_TOK_NMTOKEN)
- ptr += uintptr(2)
- goto _28
- _26:
- ;
- 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 {
- ptr += uintptr(2)
- tok = int32(m_XML_TOK_NAME)
- goto _28
- }
- 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 {
- ptr += uintptr(2)
- tok = int32(m_XML_TOK_NMTOKEN)
- goto _28
- }
- /* fall through */
- _27:
- ;
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- _28:
- ;
- for int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2)) {
- if int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 {
- v35 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr)))))))
- } else {
- v35 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr + 1)), *(*int8)(unsafe.Pointer(ptr)))
- }
- switch v35 {
- case int32(_BT_NONASCII):
- 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) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- } /* fall through */
- fallthrough
- case int32(_BT_NMSTRT):
- fallthrough
- case int32(_BT_HEX):
- fallthrough
- case int32(_BT_DIGIT):
- fallthrough
- case int32(_BT_NAME):
- fallthrough
- case int32(_BT_MINUS):
- ptr += uintptr(2)
- case int32(_BT_LEAD2):
- if int64(end)-int64(ptr) < int64(2) {
- return -int32(2)
- }
- if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(2)
- case int32(_BT_LEAD3):
- if int64(end)-int64(ptr) < int64(3) {
- return -int32(2)
- }
- if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(3)
- case int32(_BT_LEAD4):
- if int64(end)-int64(ptr) < int64(4) {
- return -int32(2)
- }
- if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(4)
- case int32(_BT_GT):
- fallthrough
- case int32(_BT_RPAR):
- fallthrough
- case int32(_BT_COMMA):
- fallthrough
- case int32(_BT_VERBAR):
- fallthrough
- case int32(_BT_LSQB):
- fallthrough
- case int32(_BT_PERCNT):
- fallthrough
- case int32(_BT_S):
- fallthrough
- case int32(_BT_CR):
- fallthrough
- case int32(_BT_LF):
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return tok
- case int32(_BT_COLON):
- ptr += uintptr(2)
- switch tok {
- case int32(m_XML_TOK_NAME):
- if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
- return -int32(1)
- }
- tok = int32(m_XML_TOK_PREFIXED_NAME)
- if int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 {
- v36 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr)))))))
- } else {
- v36 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr + 1)), *(*int8)(unsafe.Pointer(ptr)))
- }
- switch v36 {
- case int32(_BT_NONASCII):
- 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) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- } /* fall through */
- fallthrough
- case int32(_BT_NMSTRT):
- fallthrough
- case int32(_BT_HEX):
- fallthrough
- case int32(_BT_DIGIT):
- fallthrough
- case int32(_BT_NAME):
- fallthrough
- case int32(_BT_MINUS):
- ptr += uintptr(2)
- case int32(_BT_LEAD2):
- if int64(end)-int64(ptr) < int64(2) {
- return -int32(2)
- }
- if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(2)
- case int32(_BT_LEAD3):
- if int64(end)-int64(ptr) < int64(3) {
- return -int32(2)
- }
- if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(3)
- case int32(_BT_LEAD4):
- if int64(end)-int64(ptr) < int64(4) {
- return -int32(2)
- }
- if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(4)
- default:
- tok = int32(m_XML_TOK_NMTOKEN)
- break
- }
- case int32(m_XML_TOK_PREFIXED_NAME):
- tok = int32(m_XML_TOK_NMTOKEN)
- break
- }
- case int32(_BT_PLUS):
- if tok == int32(m_XML_TOK_NMTOKEN) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(2)
- return int32(m_XML_TOK_NAME_PLUS)
- case int32(_BT_AST):
- if tok == int32(m_XML_TOK_NMTOKEN) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(2)
- return int32(m_XML_TOK_NAME_ASTERISK)
- case int32(_BT_QUEST):
- if tok == int32(m_XML_TOK_NMTOKEN) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(2)
- return int32(m_XML_TOK_NAME_QUESTION)
- default:
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- }
- return -tok
- }
- func _little2_attributeValueTok(tls *libc.TLS, enc uintptr, ptr uintptr, end uintptr, nextTokPtr uintptr) (r int32) {
- var start uintptr
- var v1, v2 int32
- _, _, _ = start, v1, v2
- if ptr >= end {
- return -int32(4)
- } else {
- if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
- /* This line cannot be executed. The incoming data has already
- * been tokenized once, so incomplete characters like this have
- * already been eliminated from the input. Retaining the paranoia
- * check is still valuable, however.
- */
- return -int32(1) /* LCOV_EXCL_LINE */
- }
- }
- start = ptr
- for int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2)) {
- if int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 {
- v1 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr)))))))
- } else {
- v1 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr + 1)), *(*int8)(unsafe.Pointer(ptr)))
- }
- switch v1 {
- case int32(_BT_LEAD2):
- ptr += uintptr(2) /* NOTE: The encoding has already been validated. */
- case int32(_BT_LEAD3):
- ptr += uintptr(3) /* NOTE: The encoding has already been validated. */
- case int32(_BT_LEAD4):
- ptr += uintptr(4) /* NOTE: The encoding has already been validated. */
- case int32(_BT_AMP):
- if ptr == start {
- return _little2_scanRef(tls, enc, ptr+uintptr(2), end, nextTokPtr)
- }
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return int32(m_XML_TOK_DATA_CHARS)
- case int32(_BT_LT):
- /* this is for inside entity references */
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- case int32(_BT_LF):
- if ptr == start {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(2)
- return int32(m_XML_TOK_DATA_NEWLINE)
- }
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return int32(m_XML_TOK_DATA_CHARS)
- case int32(_BT_CR):
- if ptr == start {
- ptr += uintptr(2)
- if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
- return -int32(3)
- }
- if int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 {
- v2 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr)))))))
- } else {
- v2 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr + 1)), *(*int8)(unsafe.Pointer(ptr)))
- }
- if v2 == int32(_BT_LF) {
- ptr += uintptr(2)
- }
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return int32(m_XML_TOK_DATA_NEWLINE)
- }
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return int32(m_XML_TOK_DATA_CHARS)
- case int32(_BT_S):
- if ptr == start {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(2)
- return int32(m_XML_TOK_ATTRIBUTE_VALUE_S)
- }
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return int32(m_XML_TOK_DATA_CHARS)
- default:
- ptr += uintptr(2)
- break
- }
- }
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return int32(m_XML_TOK_DATA_CHARS)
- }
- func _little2_entityValueTok(tls *libc.TLS, enc uintptr, ptr uintptr, end uintptr, nextTokPtr uintptr) (r int32) {
- var start uintptr
- var tok, v1, v2, v3 int32
- _, _, _, _, _ = start, tok, v1, v2, v3
- if ptr >= end {
- return -int32(4)
- } else {
- if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
- /* This line cannot be executed. The incoming data has already
- * been tokenized once, so incomplete characters like this have
- * already been eliminated from the input. Retaining the paranoia
- * check is still valuable, however.
- */
- return -int32(1) /* LCOV_EXCL_LINE */
- }
- }
- start = ptr
- for int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2)) {
- if int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 {
- v1 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr)))))))
- } else {
- v1 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr + 1)), *(*int8)(unsafe.Pointer(ptr)))
- }
- switch v1 {
- case int32(_BT_LEAD2):
- ptr += uintptr(2) /* NOTE: The encoding has already been validated. */
- case int32(_BT_LEAD3):
- ptr += uintptr(3) /* NOTE: The encoding has already been validated. */
- case int32(_BT_LEAD4):
- ptr += uintptr(4) /* NOTE: The encoding has already been validated. */
- case int32(_BT_AMP):
- if ptr == start {
- return _little2_scanRef(tls, enc, ptr+uintptr(2), end, nextTokPtr)
- }
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return int32(m_XML_TOK_DATA_CHARS)
- case int32(_BT_PERCNT):
- if ptr == start {
- tok = _little2_scanPercent(tls, enc, ptr+uintptr(2), end, nextTokPtr)
- if tok == int32(m_XML_TOK_PERCENT) {
- v2 = m_XML_TOK_INVALID
- } else {
- v2 = tok
- }
- return v2
- }
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return int32(m_XML_TOK_DATA_CHARS)
- case int32(_BT_LF):
- if ptr == start {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(2)
- return int32(m_XML_TOK_DATA_NEWLINE)
- }
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return int32(m_XML_TOK_DATA_CHARS)
- case int32(_BT_CR):
- if ptr == start {
- ptr += uintptr(2)
- if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
- return -int32(3)
- }
- if int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 {
- v3 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr)))))))
- } else {
- v3 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr + 1)), *(*int8)(unsafe.Pointer(ptr)))
- }
- if v3 == int32(_BT_LF) {
- ptr += uintptr(2)
- }
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return int32(m_XML_TOK_DATA_NEWLINE)
- }
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return int32(m_XML_TOK_DATA_CHARS)
- default:
- ptr += uintptr(2)
- break
- }
- }
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return int32(m_XML_TOK_DATA_CHARS)
- }
- func _little2_ignoreSectionTok(tls *libc.TLS, enc uintptr, ptr uintptr, end uintptr, nextTokPtr uintptr) (r int32) {
- var level, v1 int32
- var n Tsize_t
- _, _, _ = level, n, v1
- level = 0
- if int32(2) > int32(1) {
- n = libc.Uint64FromInt64(int64(end) - int64(ptr))
- if n&libc.Uint64FromInt32(libc.Int32FromInt32(2)-libc.Int32FromInt32(1)) != 0 {
- n &= libc.Uint64FromInt32(^(libc.Int32FromInt32(2) - libc.Int32FromInt32(1)))
- end = ptr + uintptr(n)
- }
- }
- for int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2)) {
- if int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 {
- v1 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr)))))))
- } else {
- v1 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr + 1)), *(*int8)(unsafe.Pointer(ptr)))
- }
- switch v1 {
- case int32(_BT_LEAD2):
- if int64(end)-int64(ptr) < int64(2) {
- return -int32(2)
- }
- if 0 != 0 {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(2)
- case int32(_BT_LEAD3):
- if int64(end)-int64(ptr) < int64(3) {
- return -int32(2)
- }
- if 0 != 0 {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(3)
- case int32(_BT_LEAD4):
- if int64(end)-int64(ptr) < int64(4) {
- return -int32(2)
- }
- if 0 != 0 {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(4)
- case int32(_BT_NONXML):
- fallthrough
- case int32(_BT_MALFORM):
- fallthrough
- case int32(_BT_TRAIL):
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- case int32(_BT_LT):
- ptr += uintptr(2)
- if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
- return -int32(1)
- }
- if int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 && int32(*(*int8)(unsafe.Pointer(ptr))) == int32(m_ASCII_EXCL2) {
- ptr += uintptr(2)
- if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
- return -int32(1)
- }
- if int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 && int32(*(*int8)(unsafe.Pointer(ptr))) == int32(m_ASCII_LSQB1) {
- level++
- ptr += uintptr(2)
- }
- }
- case int32(_BT_RSQB):
- ptr += uintptr(2)
- if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
- return -int32(1)
- }
- if int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 && int32(*(*int8)(unsafe.Pointer(ptr))) == int32(m_ASCII_RSQB1) {
- ptr += uintptr(2)
- if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
- return -int32(1)
- }
- if int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 && int32(*(*int8)(unsafe.Pointer(ptr))) == int32(m_ASCII_GT1) {
- ptr += uintptr(2)
- if level == 0 {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return int32(m_XML_TOK_IGNORE_SECT)
- }
- level--
- }
- }
- default:
- ptr += uintptr(2)
- break
- }
- }
- return -int32(1)
- }
- func _little2_isPublicId(tls *libc.TLS, enc uintptr, ptr uintptr, end uintptr, badPtr uintptr) (r int32) {
- var v2, v3, v4 int32
- _, _, _ = v2, v3, v4
- ptr += uintptr(2)
- end -= uintptr(2)
- for {
- if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
- break
- }
- if int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 {
- v2 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr)))))))
- } else {
- v2 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr + 1)), *(*int8)(unsafe.Pointer(ptr)))
- }
- switch v2 {
- case int32(_BT_DIGIT):
- fallthrough
- case int32(_BT_HEX):
- fallthrough
- case int32(_BT_MINUS):
- fallthrough
- case int32(_BT_APOS):
- fallthrough
- case int32(_BT_LPAR):
- fallthrough
- case int32(_BT_RPAR):
- fallthrough
- case int32(_BT_PLUS):
- fallthrough
- case int32(_BT_COMMA):
- fallthrough
- case int32(_BT_SOL):
- fallthrough
- case int32(_BT_EQUALS):
- fallthrough
- case int32(_BT_QUEST):
- fallthrough
- case int32(_BT_CR):
- fallthrough
- case int32(_BT_LF):
- fallthrough
- case int32(_BT_SEMI):
- fallthrough
- case int32(_BT_EXCL):
- fallthrough
- case int32(_BT_AST):
- fallthrough
- case int32(_BT_PERCNT):
- fallthrough
- case int32(_BT_NUM):
- fallthrough
- case int32(_BT_COLON):
- case int32(_BT_S):
- if int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 && int32(*(*int8)(unsafe.Pointer(ptr))) == int32(m_ASCII_TAB1) {
- *(*uintptr)(unsafe.Pointer(badPtr)) = ptr
- return 0
- }
- case int32(_BT_NAME):
- fallthrough
- case int32(_BT_NMSTRT):
- if int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 {
- v3 = int32(*(*int8)(unsafe.Pointer(ptr)))
- } else {
- v3 = -int32(1)
- }
- if !(v3 & ^libc.Int32FromInt32(0x7f) != 0) {
- break
- }
- /* fall through */
- fallthrough
- default:
- if int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 {
- v4 = int32(*(*int8)(unsafe.Pointer(ptr)))
- } else {
- v4 = -int32(1)
- }
- switch v4 {
- case int32(0x24): /* $ */
- fallthrough
- case int32(0x40): /* @ */
- default:
- *(*uintptr)(unsafe.Pointer(badPtr)) = ptr
- return 0
- }
- break
- }
- goto _1
- _1:
- ;
- ptr += uintptr(2)
- }
- return int32(1)
- }
- /* This must only be called for a well-formed start-tag or empty
- element tag. Returns the number of attributes. Pointers to the
- first attsMax attributes are stored in atts.
- */
- func _little2_getAtts(tls *libc.TLS, enc uintptr, ptr uintptr, attsMax int32, atts uintptr) (r int32) {
- var nAtts, open, state, v2, v3, v5, v7 int32
- var v4, v6, v8, v9 bool
- _, _, _, _, _, _, _, _, _, _, _ = nAtts, open, state, v2, v3, v4, v5, v6, v7, v8, v9
- state = 1
- nAtts = 0
- open = 0 /* defined when state == inValue;
- initialization just to shut up compilers */
- ptr += uintptr(2)
- for {
- if int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 {
- v2 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr)))))))
- } else {
- v2 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr + 1)), *(*int8)(unsafe.Pointer(ptr)))
- }
- switch v2 {
- case int32(_BT_LEAD2):
- if state == 0 {
- if nAtts < attsMax {
- (*(*TATTRIBUTE)(unsafe.Pointer(atts + uintptr(nAtts)*32))).Fname = ptr
- (*(*TATTRIBUTE)(unsafe.Pointer(atts + uintptr(nAtts)*32))).Fnormalized = int8(1)
- }
- state = 1
- }
- ptr += uintptr(libc.Int32FromInt32(2) - libc.Int32FromInt32(2))
- case int32(_BT_LEAD3):
- if state == 0 {
- if nAtts < attsMax {
- (*(*TATTRIBUTE)(unsafe.Pointer(atts + uintptr(nAtts)*32))).Fname = ptr
- (*(*TATTRIBUTE)(unsafe.Pointer(atts + uintptr(nAtts)*32))).Fnormalized = int8(1)
- }
- state = 1
- }
- ptr += uintptr(libc.Int32FromInt32(3) - libc.Int32FromInt32(2))
- case int32(_BT_LEAD4):
- if state == 0 {
- if nAtts < attsMax {
- (*(*TATTRIBUTE)(unsafe.Pointer(atts + uintptr(nAtts)*32))).Fname = ptr
- (*(*TATTRIBUTE)(unsafe.Pointer(atts + uintptr(nAtts)*32))).Fnormalized = int8(1)
- }
- state = 1
- }
- ptr += uintptr(libc.Int32FromInt32(4) - libc.Int32FromInt32(2))
- case int32(_BT_NONASCII):
- fallthrough
- case int32(_BT_NMSTRT):
- fallthrough
- case int32(_BT_HEX):
- if state == 0 {
- if nAtts < attsMax {
- (*(*TATTRIBUTE)(unsafe.Pointer(atts + uintptr(nAtts)*32))).Fname = ptr
- (*(*TATTRIBUTE)(unsafe.Pointer(atts + uintptr(nAtts)*32))).Fnormalized = int8(1)
- }
- state = 1
- }
- case int32(_BT_QUOT):
- if state != 2 {
- if nAtts < attsMax {
- (*(*TATTRIBUTE)(unsafe.Pointer(atts + uintptr(nAtts)*32))).FvaluePtr = ptr + uintptr(2)
- }
- state = 2
- open = int32(_BT_QUOT)
- } else {
- if open == int32(_BT_QUOT) {
- state = 0
- if nAtts < attsMax {
- (*(*TATTRIBUTE)(unsafe.Pointer(atts + uintptr(nAtts)*32))).FvalueEnd = ptr
- }
- nAtts++
- }
- }
- case int32(_BT_APOS):
- if state != 2 {
- if nAtts < attsMax {
- (*(*TATTRIBUTE)(unsafe.Pointer(atts + uintptr(nAtts)*32))).FvaluePtr = ptr + uintptr(2)
- }
- state = 2
- open = int32(_BT_APOS)
- } else {
- if open == int32(_BT_APOS) {
- state = 0
- if nAtts < attsMax {
- (*(*TATTRIBUTE)(unsafe.Pointer(atts + uintptr(nAtts)*32))).FvalueEnd = ptr
- }
- nAtts++
- }
- }
- case int32(_BT_AMP):
- if nAtts < attsMax {
- (*(*TATTRIBUTE)(unsafe.Pointer(atts + uintptr(nAtts)*32))).Fnormalized = 0
- }
- case int32(_BT_S):
- if state == 1 {
- state = 0
- } else {
- if v9 = state == 2 && nAtts < attsMax && (*(*TATTRIBUTE)(unsafe.Pointer(atts + uintptr(nAtts)*32))).Fnormalized != 0; v9 {
- if v4 = ptr == (*(*TATTRIBUTE)(unsafe.Pointer(atts + uintptr(nAtts)*32))).FvaluePtr; !v4 {
- if int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 {
- v3 = int32(*(*int8)(unsafe.Pointer(ptr)))
- } else {
- v3 = -int32(1)
- }
- }
- if v6 = v4 || v3 != int32(m_ASCII_SPACE1); !v6 {
- if int32(*(*int8)(unsafe.Pointer(ptr + libc.UintptrFromInt32(2) + 1))) == 0 {
- v5 = int32(*(*int8)(unsafe.Pointer(ptr + libc.UintptrFromInt32(2))))
- } else {
- v5 = -int32(1)
- }
- }
- if v8 = v6 || v5 == int32(m_ASCII_SPACE1); !v8 {
- if int32(*(*int8)(unsafe.Pointer(ptr + libc.UintptrFromInt32(2) + 1))) == 0 {
- v7 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr + libc.UintptrFromInt32(2))))))))
- } else {
- v7 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr + libc.UintptrFromInt32(2) + 1)), *(*int8)(unsafe.Pointer(ptr + libc.UintptrFromInt32(2))))
- }
- }
- }
- if v9 && (v8 || v7 == open) {
- (*(*TATTRIBUTE)(unsafe.Pointer(atts + uintptr(nAtts)*32))).Fnormalized = 0
- }
- }
- case int32(_BT_CR):
- fallthrough
- case int32(_BT_LF):
- /* This case ensures that the first attribute name is counted
- Apart from that we could just change state on the quote. */
- if state == 1 {
- state = 0
- } else {
- if state == 2 && nAtts < attsMax {
- (*(*TATTRIBUTE)(unsafe.Pointer(atts + uintptr(nAtts)*32))).Fnormalized = 0
- }
- }
- case int32(_BT_GT):
- fallthrough
- case int32(_BT_SOL):
- if state != 2 {
- return nAtts
- }
- default:
- break
- }
- goto _1
- _1:
- ;
- ptr += uintptr(2)
- }
- /* not reached */
- return r
- }
- func _little2_charRefNumber(tls *libc.TLS, enc uintptr, ptr uintptr) (r int32) {
- var c, c1, result, v2, v4 int32
- _, _, _, _, _ = c, c1, result, v2, v4
- result = 0
- /* skip &# */
- _ = enc
- ptr += uintptr(libc.Int32FromInt32(2) * libc.Int32FromInt32(2))
- if int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 && int32(*(*int8)(unsafe.Pointer(ptr))) == int32(m_ASCII_x2) {
- ptr += uintptr(2)
- for {
- if !!(int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 && int32(*(*int8)(unsafe.Pointer(ptr))) == int32(m_ASCII_SEMI1)) {
- break
- }
- if int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 {
- v2 = int32(*(*int8)(unsafe.Pointer(ptr)))
- } else {
- v2 = -int32(1)
- }
- c = v2
- switch c {
- case int32(m_ASCII_02):
- fallthrough
- case int32(m_ASCII_12):
- fallthrough
- case int32(m_ASCII_22):
- fallthrough
- case int32(m_ASCII_32):
- fallthrough
- case int32(m_ASCII_41):
- fallthrough
- case int32(m_ASCII_51):
- fallthrough
- case int32(m_ASCII_61):
- fallthrough
- case int32(m_ASCII_71):
- fallthrough
- case int32(m_ASCII_82):
- fallthrough
- case int32(m_ASCII_92):
- result <<= int32(4)
- result |= c - int32(m_ASCII_02)
- case int32(m_ASCII_A):
- fallthrough
- case int32(m_ASCII_B1):
- fallthrough
- case int32(m_ASCII_C):
- fallthrough
- case int32(m_ASCII_D):
- fallthrough
- case int32(m_ASCII_E):
- fallthrough
- case int32(m_ASCII_F):
- result <<= int32(4)
- result += int32(10) + (c - int32(m_ASCII_A))
- case int32(m_ASCII_a2):
- fallthrough
- case int32(m_ASCII_b1):
- fallthrough
- case int32(m_ASCII_c2):
- fallthrough
- case int32(m_ASCII_d1):
- fallthrough
- case int32(m_ASCII_e2):
- fallthrough
- case int32(m_ASCII_f1):
- result <<= int32(4)
- result += int32(10) + (c - int32(m_ASCII_a2))
- break
- }
- if result >= int32(0x110000) {
- return -int32(1)
- }
- goto _1
- _1:
- ;
- ptr += uintptr(2)
- }
- } else {
- for {
- if !!(int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 && int32(*(*int8)(unsafe.Pointer(ptr))) == int32(m_ASCII_SEMI1)) {
- break
- }
- if int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 {
- v4 = int32(*(*int8)(unsafe.Pointer(ptr)))
- } else {
- v4 = -int32(1)
- }
- c1 = v4
- result *= int32(10)
- result += c1 - int32(m_ASCII_02)
- if result >= int32(0x110000) {
- return -int32(1)
- }
- goto _3
- _3:
- ;
- ptr += uintptr(2)
- }
- }
- return _checkCharRefNumber(tls, result)
- }
- func _little2_predefinedEntityName(tls *libc.TLS, enc uintptr, ptr uintptr, end uintptr) (r int32) {
- var v1, v2 int32
- _, _ = v1, v2
- _ = enc
- switch (int64(end) - int64(ptr)) / libc.Int64FromInt32(2) {
- case int64(2):
- if int32(*(*int8)(unsafe.Pointer(ptr + libc.UintptrFromInt32(2) + 1))) == 0 && int32(*(*int8)(unsafe.Pointer(ptr + libc.UintptrFromInt32(2)))) == int32(m_ASCII_t2) {
- if int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 {
- v1 = int32(*(*int8)(unsafe.Pointer(ptr)))
- } else {
- v1 = -int32(1)
- }
- switch v1 {
- case int32(m_ASCII_l2):
- return int32(m_ASCII_LT1)
- case int32(m_ASCII_g2):
- return int32(m_ASCII_GT1)
- }
- }
- case int64(3):
- if int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 && int32(*(*int8)(unsafe.Pointer(ptr))) == int32(m_ASCII_a2) {
- ptr += uintptr(2)
- if int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 && int32(*(*int8)(unsafe.Pointer(ptr))) == int32(m_ASCII_m2) {
- ptr += uintptr(2)
- if int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 && int32(*(*int8)(unsafe.Pointer(ptr))) == int32(m_ASCII_p2) {
- return int32(m_ASCII_AMP1)
- }
- }
- }
- case int64(4):
- if int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 {
- v2 = int32(*(*int8)(unsafe.Pointer(ptr)))
- } else {
- v2 = -int32(1)
- }
- switch v2 {
- case int32(m_ASCII_q1):
- ptr += uintptr(2)
- if int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 && int32(*(*int8)(unsafe.Pointer(ptr))) == int32(m_ASCII_u1) {
- ptr += uintptr(2)
- if int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 && int32(*(*int8)(unsafe.Pointer(ptr))) == int32(m_ASCII_o2) {
- ptr += uintptr(2)
- if int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 && int32(*(*int8)(unsafe.Pointer(ptr))) == int32(m_ASCII_t2) {
- return int32(m_ASCII_QUOT1)
- }
- }
- }
- case int32(m_ASCII_a2):
- ptr += uintptr(2)
- if int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 && int32(*(*int8)(unsafe.Pointer(ptr))) == int32(m_ASCII_p2) {
- ptr += uintptr(2)
- if int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 && int32(*(*int8)(unsafe.Pointer(ptr))) == int32(m_ASCII_o2) {
- ptr += uintptr(2)
- if int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 && int32(*(*int8)(unsafe.Pointer(ptr))) == int32(m_ASCII_s2) {
- return int32(m_ASCII_APOS1)
- }
- }
- }
- break
- }
- }
- return 0
- }
- func _little2_nameMatchesAscii(tls *libc.TLS, enc uintptr, ptr1 uintptr, end1 uintptr, ptr2 uintptr) (r int32) {
- _ = enc
- for {
- if !(*(*int8)(unsafe.Pointer(ptr2)) != 0) {
- break
- }
- if int64(end1)-int64(ptr1) < int64(2) {
- /* This line cannot be executed. The incoming data has already
- * been tokenized once, so incomplete characters like this have
- * already been eliminated from the input. Retaining the
- * paranoia check is still valuable, however.
- */
- return 0 /* LCOV_EXCL_LINE */
- }
- if !(int32(*(*int8)(unsafe.Pointer(ptr1 + 1))) == 0 && int32(*(*int8)(unsafe.Pointer(ptr1))) == int32(*(*int8)(unsafe.Pointer(ptr2)))) {
- return 0
- }
- goto _1
- _1:
- ;
- ptr1 += uintptr(2)
- ptr2++
- }
- return libc.BoolInt32(ptr1 == end1)
- }
- func _little2_nameLength(tls *libc.TLS, enc uintptr, ptr uintptr) (r int32) {
- var start uintptr
- var v2 int32
- _, _ = start, v2
- start = ptr
- for {
- if int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 {
- v2 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr)))))))
- } else {
- v2 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr + 1)), *(*int8)(unsafe.Pointer(ptr)))
- }
- switch v2 {
- case int32(_BT_LEAD2):
- ptr += uintptr(2) /* NOTE: The encoding has already been validated. */
- case int32(_BT_LEAD3):
- ptr += uintptr(3) /* NOTE: The encoding has already been validated. */
- case int32(_BT_LEAD4):
- ptr += uintptr(4) /* NOTE: The encoding has already been validated. */
- case int32(_BT_NONASCII):
- fallthrough
- case int32(_BT_NMSTRT):
- fallthrough
- case int32(_BT_COLON):
- fallthrough
- case int32(_BT_HEX):
- fallthrough
- case int32(_BT_DIGIT):
- fallthrough
- case int32(_BT_NAME):
- fallthrough
- case int32(_BT_MINUS):
- ptr += uintptr(2)
- default:
- return int32(int64(ptr) - int64(start))
- }
- goto _1
- _1:
- }
- return r
- }
- func _little2_skipS(tls *libc.TLS, enc uintptr, ptr uintptr) (r uintptr) {
- var v2 int32
- _ = v2
- for {
- if int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 {
- v2 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr)))))))
- } else {
- v2 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr + 1)), *(*int8)(unsafe.Pointer(ptr)))
- }
- switch v2 {
- case int32(_BT_LF):
- fallthrough
- case int32(_BT_CR):
- fallthrough
- case int32(_BT_S):
- ptr += uintptr(2)
- default:
- return ptr
- }
- goto _1
- _1:
- }
- return r
- }
- func _little2_updatePosition(tls *libc.TLS, enc uintptr, ptr uintptr, end uintptr, pos uintptr) {
- var v1, v2 int32
- var v3 bool
- _, _, _ = v1, v2, v3
- for int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2)) {
- if int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 {
- v1 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr)))))))
- } else {
- v1 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr + 1)), *(*int8)(unsafe.Pointer(ptr)))
- }
- switch v1 {
- case int32(_BT_LEAD2):
- ptr += uintptr(2) /* NOTE: The encoding has already been validated. */
- (*TPOSITION)(unsafe.Pointer(pos)).FcolumnNumber++
- case int32(_BT_LEAD3):
- ptr += uintptr(3) /* NOTE: The encoding has already been validated. */
- (*TPOSITION)(unsafe.Pointer(pos)).FcolumnNumber++
- case int32(_BT_LEAD4):
- ptr += uintptr(4) /* NOTE: The encoding has already been validated. */
- (*TPOSITION)(unsafe.Pointer(pos)).FcolumnNumber++
- case int32(_BT_LF):
- (*TPOSITION)(unsafe.Pointer(pos)).FcolumnNumber = uint64(0)
- (*TPOSITION)(unsafe.Pointer(pos)).FlineNumber++
- ptr += uintptr(2)
- case int32(_BT_CR):
- (*TPOSITION)(unsafe.Pointer(pos)).FlineNumber++
- ptr += uintptr(2)
- if v3 = int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2)); v3 {
- if int32(*(*int8)(unsafe.Pointer(ptr + 1))) == 0 {
- v2 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr)))))))
- } else {
- v2 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr + 1)), *(*int8)(unsafe.Pointer(ptr)))
- }
- }
- if v3 && v2 == int32(_BT_LF) {
- ptr += uintptr(2)
- }
- (*TPOSITION)(unsafe.Pointer(pos)).FcolumnNumber = uint64(0)
- default:
- ptr += uintptr(2)
- (*TPOSITION)(unsafe.Pointer(pos)).FcolumnNumber++
- break
- }
- }
- }
- var _little2_encoding_ns = Tnormal_encoding{
- Fenc: TENCODING{
- Fscanners: [4]TSCANNER{},
- FliteralScanners: [2]TSCANNER{},
- FminBytesPerChar: int32(2),
- FisUtf16: int8(1),
- },
- Ftype1: [256]uint8{
- 9: uint8(_BT_S),
- 10: uint8(_BT_LF),
- 13: uint8(_BT_CR),
- 32: uint8(_BT_S),
- 33: uint8(_BT_EXCL),
- 34: uint8(_BT_QUOT),
- 35: uint8(_BT_NUM),
- 36: uint8(_BT_OTHER),
- 37: uint8(_BT_PERCNT),
- 38: uint8(_BT_AMP),
- 39: uint8(_BT_APOS),
- 40: uint8(_BT_LPAR),
- 41: uint8(_BT_RPAR),
- 42: uint8(_BT_AST),
- 43: uint8(_BT_PLUS),
- 44: uint8(_BT_COMMA),
- 45: uint8(_BT_MINUS),
- 46: uint8(_BT_NAME),
- 47: uint8(_BT_SOL),
- 48: uint8(_BT_DIGIT),
- 49: uint8(_BT_DIGIT),
- 50: uint8(_BT_DIGIT),
- 51: uint8(_BT_DIGIT),
- 52: uint8(_BT_DIGIT),
- 53: uint8(_BT_DIGIT),
- 54: uint8(_BT_DIGIT),
- 55: uint8(_BT_DIGIT),
- 56: uint8(_BT_DIGIT),
- 57: uint8(_BT_DIGIT),
- 58: uint8(_BT_COLON),
- 59: uint8(_BT_SEMI),
- 60: uint8(_BT_LT),
- 61: uint8(_BT_EQUALS),
- 62: uint8(_BT_GT),
- 63: uint8(_BT_QUEST),
- 64: uint8(_BT_OTHER),
- 65: uint8(_BT_HEX),
- 66: uint8(_BT_HEX),
- 67: uint8(_BT_HEX),
- 68: uint8(_BT_HEX),
- 69: uint8(_BT_HEX),
- 70: uint8(_BT_HEX),
- 71: uint8(_BT_NMSTRT),
- 72: uint8(_BT_NMSTRT),
- 73: uint8(_BT_NMSTRT),
- 74: uint8(_BT_NMSTRT),
- 75: uint8(_BT_NMSTRT),
- 76: uint8(_BT_NMSTRT),
- 77: uint8(_BT_NMSTRT),
- 78: uint8(_BT_NMSTRT),
- 79: uint8(_BT_NMSTRT),
- 80: uint8(_BT_NMSTRT),
- 81: uint8(_BT_NMSTRT),
- 82: uint8(_BT_NMSTRT),
- 83: uint8(_BT_NMSTRT),
- 84: uint8(_BT_NMSTRT),
- 85: uint8(_BT_NMSTRT),
- 86: uint8(_BT_NMSTRT),
- 87: uint8(_BT_NMSTRT),
- 88: uint8(_BT_NMSTRT),
- 89: uint8(_BT_NMSTRT),
- 90: uint8(_BT_NMSTRT),
- 91: uint8(_BT_LSQB),
- 92: uint8(_BT_OTHER),
- 93: uint8(_BT_RSQB),
- 94: uint8(_BT_OTHER),
- 95: uint8(_BT_NMSTRT),
- 96: uint8(_BT_OTHER),
- 97: uint8(_BT_HEX),
- 98: uint8(_BT_HEX),
- 99: uint8(_BT_HEX),
- 100: uint8(_BT_HEX),
- 101: uint8(_BT_HEX),
- 102: uint8(_BT_HEX),
- 103: uint8(_BT_NMSTRT),
- 104: uint8(_BT_NMSTRT),
- 105: uint8(_BT_NMSTRT),
- 106: uint8(_BT_NMSTRT),
- 107: uint8(_BT_NMSTRT),
- 108: uint8(_BT_NMSTRT),
- 109: uint8(_BT_NMSTRT),
- 110: uint8(_BT_NMSTRT),
- 111: uint8(_BT_NMSTRT),
- 112: uint8(_BT_NMSTRT),
- 113: uint8(_BT_NMSTRT),
- 114: uint8(_BT_NMSTRT),
- 115: uint8(_BT_NMSTRT),
- 116: uint8(_BT_NMSTRT),
- 117: uint8(_BT_NMSTRT),
- 118: uint8(_BT_NMSTRT),
- 119: uint8(_BT_NMSTRT),
- 120: uint8(_BT_NMSTRT),
- 121: uint8(_BT_NMSTRT),
- 122: uint8(_BT_NMSTRT),
- 123: uint8(_BT_OTHER),
- 124: uint8(_BT_VERBAR),
- 125: uint8(_BT_OTHER),
- 126: uint8(_BT_OTHER),
- 127: uint8(_BT_OTHER),
- 128: uint8(_BT_OTHER),
- 129: uint8(_BT_OTHER),
- 130: uint8(_BT_OTHER),
- 131: uint8(_BT_OTHER),
- 132: uint8(_BT_OTHER),
- 133: uint8(_BT_OTHER),
- 134: uint8(_BT_OTHER),
- 135: uint8(_BT_OTHER),
- 136: uint8(_BT_OTHER),
- 137: uint8(_BT_OTHER),
- 138: uint8(_BT_OTHER),
- 139: uint8(_BT_OTHER),
- 140: uint8(_BT_OTHER),
- 141: uint8(_BT_OTHER),
- 142: uint8(_BT_OTHER),
- 143: uint8(_BT_OTHER),
- 144: uint8(_BT_OTHER),
- 145: uint8(_BT_OTHER),
- 146: uint8(_BT_OTHER),
- 147: uint8(_BT_OTHER),
- 148: uint8(_BT_OTHER),
- 149: uint8(_BT_OTHER),
- 150: uint8(_BT_OTHER),
- 151: uint8(_BT_OTHER),
- 152: uint8(_BT_OTHER),
- 153: uint8(_BT_OTHER),
- 154: uint8(_BT_OTHER),
- 155: uint8(_BT_OTHER),
- 156: uint8(_BT_OTHER),
- 157: uint8(_BT_OTHER),
- 158: uint8(_BT_OTHER),
- 159: uint8(_BT_OTHER),
- 160: uint8(_BT_OTHER),
- 161: uint8(_BT_OTHER),
- 162: uint8(_BT_OTHER),
- 163: uint8(_BT_OTHER),
- 164: uint8(_BT_OTHER),
- 165: uint8(_BT_OTHER),
- 166: uint8(_BT_OTHER),
- 167: uint8(_BT_OTHER),
- 168: uint8(_BT_OTHER),
- 169: uint8(_BT_OTHER),
- 170: uint8(_BT_NMSTRT),
- 171: uint8(_BT_OTHER),
- 172: uint8(_BT_OTHER),
- 173: uint8(_BT_OTHER),
- 174: uint8(_BT_OTHER),
- 175: uint8(_BT_OTHER),
- 176: uint8(_BT_OTHER),
- 177: uint8(_BT_OTHER),
- 178: uint8(_BT_OTHER),
- 179: uint8(_BT_OTHER),
- 180: uint8(_BT_OTHER),
- 181: uint8(_BT_NMSTRT),
- 182: uint8(_BT_OTHER),
- 183: uint8(_BT_NAME),
- 184: uint8(_BT_OTHER),
- 185: uint8(_BT_OTHER),
- 186: uint8(_BT_NMSTRT),
- 187: uint8(_BT_OTHER),
- 188: uint8(_BT_OTHER),
- 189: uint8(_BT_OTHER),
- 190: uint8(_BT_OTHER),
- 191: uint8(_BT_OTHER),
- 192: uint8(_BT_NMSTRT),
- 193: uint8(_BT_NMSTRT),
- 194: uint8(_BT_NMSTRT),
- 195: uint8(_BT_NMSTRT),
- 196: uint8(_BT_NMSTRT),
- 197: uint8(_BT_NMSTRT),
- 198: uint8(_BT_NMSTRT),
- 199: uint8(_BT_NMSTRT),
- 200: uint8(_BT_NMSTRT),
- 201: uint8(_BT_NMSTRT),
- 202: uint8(_BT_NMSTRT),
- 203: uint8(_BT_NMSTRT),
- 204: uint8(_BT_NMSTRT),
- 205: uint8(_BT_NMSTRT),
- 206: uint8(_BT_NMSTRT),
- 207: uint8(_BT_NMSTRT),
- 208: uint8(_BT_NMSTRT),
- 209: uint8(_BT_NMSTRT),
- 210: uint8(_BT_NMSTRT),
- 211: uint8(_BT_NMSTRT),
- 212: uint8(_BT_NMSTRT),
- 213: uint8(_BT_NMSTRT),
- 214: uint8(_BT_NMSTRT),
- 215: uint8(_BT_OTHER),
- 216: uint8(_BT_NMSTRT),
- 217: uint8(_BT_NMSTRT),
- 218: uint8(_BT_NMSTRT),
- 219: uint8(_BT_NMSTRT),
- 220: uint8(_BT_NMSTRT),
- 221: uint8(_BT_NMSTRT),
- 222: uint8(_BT_NMSTRT),
- 223: uint8(_BT_NMSTRT),
- 224: uint8(_BT_NMSTRT),
- 225: uint8(_BT_NMSTRT),
- 226: uint8(_BT_NMSTRT),
- 227: uint8(_BT_NMSTRT),
- 228: uint8(_BT_NMSTRT),
- 229: uint8(_BT_NMSTRT),
- 230: uint8(_BT_NMSTRT),
- 231: uint8(_BT_NMSTRT),
- 232: uint8(_BT_NMSTRT),
- 233: uint8(_BT_NMSTRT),
- 234: uint8(_BT_NMSTRT),
- 235: uint8(_BT_NMSTRT),
- 236: uint8(_BT_NMSTRT),
- 237: uint8(_BT_NMSTRT),
- 238: uint8(_BT_NMSTRT),
- 239: uint8(_BT_NMSTRT),
- 240: uint8(_BT_NMSTRT),
- 241: uint8(_BT_NMSTRT),
- 242: uint8(_BT_NMSTRT),
- 243: uint8(_BT_NMSTRT),
- 244: uint8(_BT_NMSTRT),
- 245: uint8(_BT_NMSTRT),
- 246: uint8(_BT_NMSTRT),
- 247: uint8(_BT_OTHER),
- 248: uint8(_BT_NMSTRT),
- 249: uint8(_BT_NMSTRT),
- 250: uint8(_BT_NMSTRT),
- 251: uint8(_BT_NMSTRT),
- 252: uint8(_BT_NMSTRT),
- 253: uint8(_BT_NMSTRT),
- 254: uint8(_BT_NMSTRT),
- 255: uint8(_BT_NMSTRT),
- },
- }
- func init() {
- p := unsafe.Pointer(&_little2_encoding_ns)
- *(*uintptr)(unsafe.Add(p, 0)) = __ccgo_fp(_little2_prologTok)
- *(*uintptr)(unsafe.Add(p, 8)) = __ccgo_fp(_little2_contentTok)
- *(*uintptr)(unsafe.Add(p, 16)) = __ccgo_fp(_little2_cdataSectionTok)
- *(*uintptr)(unsafe.Add(p, 24)) = __ccgo_fp(_little2_ignoreSectionTok)
- *(*uintptr)(unsafe.Add(p, 32)) = __ccgo_fp(_little2_attributeValueTok)
- *(*uintptr)(unsafe.Add(p, 40)) = __ccgo_fp(_little2_entityValueTok)
- *(*uintptr)(unsafe.Add(p, 48)) = __ccgo_fp(_little2_nameMatchesAscii)
- *(*uintptr)(unsafe.Add(p, 56)) = __ccgo_fp(_little2_nameLength)
- *(*uintptr)(unsafe.Add(p, 64)) = __ccgo_fp(_little2_skipS)
- *(*uintptr)(unsafe.Add(p, 72)) = __ccgo_fp(_little2_getAtts)
- *(*uintptr)(unsafe.Add(p, 80)) = __ccgo_fp(_little2_charRefNumber)
- *(*uintptr)(unsafe.Add(p, 88)) = __ccgo_fp(_little2_predefinedEntityName)
- *(*uintptr)(unsafe.Add(p, 96)) = __ccgo_fp(_little2_updatePosition)
- *(*uintptr)(unsafe.Add(p, 104)) = __ccgo_fp(_little2_isPublicId)
- *(*uintptr)(unsafe.Add(p, 112)) = __ccgo_fp(_little2_toUtf8)
- *(*uintptr)(unsafe.Add(p, 120)) = __ccgo_fp(_little2_toUtf16)
- }
- var _little2_encoding = Tnormal_encoding{
- Fenc: TENCODING{
- Fscanners: [4]TSCANNER{},
- FliteralScanners: [2]TSCANNER{},
- FminBytesPerChar: int32(2),
- FisUtf16: int8(1),
- },
- Ftype1: [256]uint8{
- 9: uint8(_BT_S),
- 10: uint8(_BT_LF),
- 13: uint8(_BT_CR),
- 32: uint8(_BT_S),
- 33: uint8(_BT_EXCL),
- 34: uint8(_BT_QUOT),
- 35: uint8(_BT_NUM),
- 36: uint8(_BT_OTHER),
- 37: uint8(_BT_PERCNT),
- 38: uint8(_BT_AMP),
- 39: uint8(_BT_APOS),
- 40: uint8(_BT_LPAR),
- 41: uint8(_BT_RPAR),
- 42: uint8(_BT_AST),
- 43: uint8(_BT_PLUS),
- 44: uint8(_BT_COMMA),
- 45: uint8(_BT_MINUS),
- 46: uint8(_BT_NAME),
- 47: uint8(_BT_SOL),
- 48: uint8(_BT_DIGIT),
- 49: uint8(_BT_DIGIT),
- 50: uint8(_BT_DIGIT),
- 51: uint8(_BT_DIGIT),
- 52: uint8(_BT_DIGIT),
- 53: uint8(_BT_DIGIT),
- 54: uint8(_BT_DIGIT),
- 55: uint8(_BT_DIGIT),
- 56: uint8(_BT_DIGIT),
- 57: uint8(_BT_DIGIT),
- 58: uint8(_BT_NMSTRT),
- 59: uint8(_BT_SEMI),
- 60: uint8(_BT_LT),
- 61: uint8(_BT_EQUALS),
- 62: uint8(_BT_GT),
- 63: uint8(_BT_QUEST),
- 64: uint8(_BT_OTHER),
- 65: uint8(_BT_HEX),
- 66: uint8(_BT_HEX),
- 67: uint8(_BT_HEX),
- 68: uint8(_BT_HEX),
- 69: uint8(_BT_HEX),
- 70: uint8(_BT_HEX),
- 71: uint8(_BT_NMSTRT),
- 72: uint8(_BT_NMSTRT),
- 73: uint8(_BT_NMSTRT),
- 74: uint8(_BT_NMSTRT),
- 75: uint8(_BT_NMSTRT),
- 76: uint8(_BT_NMSTRT),
- 77: uint8(_BT_NMSTRT),
- 78: uint8(_BT_NMSTRT),
- 79: uint8(_BT_NMSTRT),
- 80: uint8(_BT_NMSTRT),
- 81: uint8(_BT_NMSTRT),
- 82: uint8(_BT_NMSTRT),
- 83: uint8(_BT_NMSTRT),
- 84: uint8(_BT_NMSTRT),
- 85: uint8(_BT_NMSTRT),
- 86: uint8(_BT_NMSTRT),
- 87: uint8(_BT_NMSTRT),
- 88: uint8(_BT_NMSTRT),
- 89: uint8(_BT_NMSTRT),
- 90: uint8(_BT_NMSTRT),
- 91: uint8(_BT_LSQB),
- 92: uint8(_BT_OTHER),
- 93: uint8(_BT_RSQB),
- 94: uint8(_BT_OTHER),
- 95: uint8(_BT_NMSTRT),
- 96: uint8(_BT_OTHER),
- 97: uint8(_BT_HEX),
- 98: uint8(_BT_HEX),
- 99: uint8(_BT_HEX),
- 100: uint8(_BT_HEX),
- 101: uint8(_BT_HEX),
- 102: uint8(_BT_HEX),
- 103: uint8(_BT_NMSTRT),
- 104: uint8(_BT_NMSTRT),
- 105: uint8(_BT_NMSTRT),
- 106: uint8(_BT_NMSTRT),
- 107: uint8(_BT_NMSTRT),
- 108: uint8(_BT_NMSTRT),
- 109: uint8(_BT_NMSTRT),
- 110: uint8(_BT_NMSTRT),
- 111: uint8(_BT_NMSTRT),
- 112: uint8(_BT_NMSTRT),
- 113: uint8(_BT_NMSTRT),
- 114: uint8(_BT_NMSTRT),
- 115: uint8(_BT_NMSTRT),
- 116: uint8(_BT_NMSTRT),
- 117: uint8(_BT_NMSTRT),
- 118: uint8(_BT_NMSTRT),
- 119: uint8(_BT_NMSTRT),
- 120: uint8(_BT_NMSTRT),
- 121: uint8(_BT_NMSTRT),
- 122: uint8(_BT_NMSTRT),
- 123: uint8(_BT_OTHER),
- 124: uint8(_BT_VERBAR),
- 125: uint8(_BT_OTHER),
- 126: uint8(_BT_OTHER),
- 127: uint8(_BT_OTHER),
- 128: uint8(_BT_OTHER),
- 129: uint8(_BT_OTHER),
- 130: uint8(_BT_OTHER),
- 131: uint8(_BT_OTHER),
- 132: uint8(_BT_OTHER),
- 133: uint8(_BT_OTHER),
- 134: uint8(_BT_OTHER),
- 135: uint8(_BT_OTHER),
- 136: uint8(_BT_OTHER),
- 137: uint8(_BT_OTHER),
- 138: uint8(_BT_OTHER),
- 139: uint8(_BT_OTHER),
- 140: uint8(_BT_OTHER),
- 141: uint8(_BT_OTHER),
- 142: uint8(_BT_OTHER),
- 143: uint8(_BT_OTHER),
- 144: uint8(_BT_OTHER),
- 145: uint8(_BT_OTHER),
- 146: uint8(_BT_OTHER),
- 147: uint8(_BT_OTHER),
- 148: uint8(_BT_OTHER),
- 149: uint8(_BT_OTHER),
- 150: uint8(_BT_OTHER),
- 151: uint8(_BT_OTHER),
- 152: uint8(_BT_OTHER),
- 153: uint8(_BT_OTHER),
- 154: uint8(_BT_OTHER),
- 155: uint8(_BT_OTHER),
- 156: uint8(_BT_OTHER),
- 157: uint8(_BT_OTHER),
- 158: uint8(_BT_OTHER),
- 159: uint8(_BT_OTHER),
- 160: uint8(_BT_OTHER),
- 161: uint8(_BT_OTHER),
- 162: uint8(_BT_OTHER),
- 163: uint8(_BT_OTHER),
- 164: uint8(_BT_OTHER),
- 165: uint8(_BT_OTHER),
- 166: uint8(_BT_OTHER),
- 167: uint8(_BT_OTHER),
- 168: uint8(_BT_OTHER),
- 169: uint8(_BT_OTHER),
- 170: uint8(_BT_NMSTRT),
- 171: uint8(_BT_OTHER),
- 172: uint8(_BT_OTHER),
- 173: uint8(_BT_OTHER),
- 174: uint8(_BT_OTHER),
- 175: uint8(_BT_OTHER),
- 176: uint8(_BT_OTHER),
- 177: uint8(_BT_OTHER),
- 178: uint8(_BT_OTHER),
- 179: uint8(_BT_OTHER),
- 180: uint8(_BT_OTHER),
- 181: uint8(_BT_NMSTRT),
- 182: uint8(_BT_OTHER),
- 183: uint8(_BT_NAME),
- 184: uint8(_BT_OTHER),
- 185: uint8(_BT_OTHER),
- 186: uint8(_BT_NMSTRT),
- 187: uint8(_BT_OTHER),
- 188: uint8(_BT_OTHER),
- 189: uint8(_BT_OTHER),
- 190: uint8(_BT_OTHER),
- 191: uint8(_BT_OTHER),
- 192: uint8(_BT_NMSTRT),
- 193: uint8(_BT_NMSTRT),
- 194: uint8(_BT_NMSTRT),
- 195: uint8(_BT_NMSTRT),
- 196: uint8(_BT_NMSTRT),
- 197: uint8(_BT_NMSTRT),
- 198: uint8(_BT_NMSTRT),
- 199: uint8(_BT_NMSTRT),
- 200: uint8(_BT_NMSTRT),
- 201: uint8(_BT_NMSTRT),
- 202: uint8(_BT_NMSTRT),
- 203: uint8(_BT_NMSTRT),
- 204: uint8(_BT_NMSTRT),
- 205: uint8(_BT_NMSTRT),
- 206: uint8(_BT_NMSTRT),
- 207: uint8(_BT_NMSTRT),
- 208: uint8(_BT_NMSTRT),
- 209: uint8(_BT_NMSTRT),
- 210: uint8(_BT_NMSTRT),
- 211: uint8(_BT_NMSTRT),
- 212: uint8(_BT_NMSTRT),
- 213: uint8(_BT_NMSTRT),
- 214: uint8(_BT_NMSTRT),
- 215: uint8(_BT_OTHER),
- 216: uint8(_BT_NMSTRT),
- 217: uint8(_BT_NMSTRT),
- 218: uint8(_BT_NMSTRT),
- 219: uint8(_BT_NMSTRT),
- 220: uint8(_BT_NMSTRT),
- 221: uint8(_BT_NMSTRT),
- 222: uint8(_BT_NMSTRT),
- 223: uint8(_BT_NMSTRT),
- 224: uint8(_BT_NMSTRT),
- 225: uint8(_BT_NMSTRT),
- 226: uint8(_BT_NMSTRT),
- 227: uint8(_BT_NMSTRT),
- 228: uint8(_BT_NMSTRT),
- 229: uint8(_BT_NMSTRT),
- 230: uint8(_BT_NMSTRT),
- 231: uint8(_BT_NMSTRT),
- 232: uint8(_BT_NMSTRT),
- 233: uint8(_BT_NMSTRT),
- 234: uint8(_BT_NMSTRT),
- 235: uint8(_BT_NMSTRT),
- 236: uint8(_BT_NMSTRT),
- 237: uint8(_BT_NMSTRT),
- 238: uint8(_BT_NMSTRT),
- 239: uint8(_BT_NMSTRT),
- 240: uint8(_BT_NMSTRT),
- 241: uint8(_BT_NMSTRT),
- 242: uint8(_BT_NMSTRT),
- 243: uint8(_BT_NMSTRT),
- 244: uint8(_BT_NMSTRT),
- 245: uint8(_BT_NMSTRT),
- 246: uint8(_BT_NMSTRT),
- 247: uint8(_BT_OTHER),
- 248: uint8(_BT_NMSTRT),
- 249: uint8(_BT_NMSTRT),
- 250: uint8(_BT_NMSTRT),
- 251: uint8(_BT_NMSTRT),
- 252: uint8(_BT_NMSTRT),
- 253: uint8(_BT_NMSTRT),
- 254: uint8(_BT_NMSTRT),
- 255: uint8(_BT_NMSTRT),
- },
- }
- func init() {
- p := unsafe.Pointer(&_little2_encoding)
- *(*uintptr)(unsafe.Add(p, 0)) = __ccgo_fp(_little2_prologTok)
- *(*uintptr)(unsafe.Add(p, 8)) = __ccgo_fp(_little2_contentTok)
- *(*uintptr)(unsafe.Add(p, 16)) = __ccgo_fp(_little2_cdataSectionTok)
- *(*uintptr)(unsafe.Add(p, 24)) = __ccgo_fp(_little2_ignoreSectionTok)
- *(*uintptr)(unsafe.Add(p, 32)) = __ccgo_fp(_little2_attributeValueTok)
- *(*uintptr)(unsafe.Add(p, 40)) = __ccgo_fp(_little2_entityValueTok)
- *(*uintptr)(unsafe.Add(p, 48)) = __ccgo_fp(_little2_nameMatchesAscii)
- *(*uintptr)(unsafe.Add(p, 56)) = __ccgo_fp(_little2_nameLength)
- *(*uintptr)(unsafe.Add(p, 64)) = __ccgo_fp(_little2_skipS)
- *(*uintptr)(unsafe.Add(p, 72)) = __ccgo_fp(_little2_getAtts)
- *(*uintptr)(unsafe.Add(p, 80)) = __ccgo_fp(_little2_charRefNumber)
- *(*uintptr)(unsafe.Add(p, 88)) = __ccgo_fp(_little2_predefinedEntityName)
- *(*uintptr)(unsafe.Add(p, 96)) = __ccgo_fp(_little2_updatePosition)
- *(*uintptr)(unsafe.Add(p, 104)) = __ccgo_fp(_little2_isPublicId)
- *(*uintptr)(unsafe.Add(p, 112)) = __ccgo_fp(_little2_toUtf8)
- *(*uintptr)(unsafe.Add(p, 120)) = __ccgo_fp(_little2_toUtf16)
- }
- var _internal_little2_encoding_ns = Tnormal_encoding{
- Fenc: TENCODING{
- Fscanners: [4]TSCANNER{},
- FliteralScanners: [2]TSCANNER{},
- FminBytesPerChar: int32(2),
- FisUtf16: int8(1),
- },
- Ftype1: [256]uint8{
- 9: uint8(_BT_S),
- 10: uint8(_BT_LF),
- 13: uint8(_BT_S),
- 32: uint8(_BT_S),
- 33: uint8(_BT_EXCL),
- 34: uint8(_BT_QUOT),
- 35: uint8(_BT_NUM),
- 36: uint8(_BT_OTHER),
- 37: uint8(_BT_PERCNT),
- 38: uint8(_BT_AMP),
- 39: uint8(_BT_APOS),
- 40: uint8(_BT_LPAR),
- 41: uint8(_BT_RPAR),
- 42: uint8(_BT_AST),
- 43: uint8(_BT_PLUS),
- 44: uint8(_BT_COMMA),
- 45: uint8(_BT_MINUS),
- 46: uint8(_BT_NAME),
- 47: uint8(_BT_SOL),
- 48: uint8(_BT_DIGIT),
- 49: uint8(_BT_DIGIT),
- 50: uint8(_BT_DIGIT),
- 51: uint8(_BT_DIGIT),
- 52: uint8(_BT_DIGIT),
- 53: uint8(_BT_DIGIT),
- 54: uint8(_BT_DIGIT),
- 55: uint8(_BT_DIGIT),
- 56: uint8(_BT_DIGIT),
- 57: uint8(_BT_DIGIT),
- 58: uint8(_BT_COLON),
- 59: uint8(_BT_SEMI),
- 60: uint8(_BT_LT),
- 61: uint8(_BT_EQUALS),
- 62: uint8(_BT_GT),
- 63: uint8(_BT_QUEST),
- 64: uint8(_BT_OTHER),
- 65: uint8(_BT_HEX),
- 66: uint8(_BT_HEX),
- 67: uint8(_BT_HEX),
- 68: uint8(_BT_HEX),
- 69: uint8(_BT_HEX),
- 70: uint8(_BT_HEX),
- 71: uint8(_BT_NMSTRT),
- 72: uint8(_BT_NMSTRT),
- 73: uint8(_BT_NMSTRT),
- 74: uint8(_BT_NMSTRT),
- 75: uint8(_BT_NMSTRT),
- 76: uint8(_BT_NMSTRT),
- 77: uint8(_BT_NMSTRT),
- 78: uint8(_BT_NMSTRT),
- 79: uint8(_BT_NMSTRT),
- 80: uint8(_BT_NMSTRT),
- 81: uint8(_BT_NMSTRT),
- 82: uint8(_BT_NMSTRT),
- 83: uint8(_BT_NMSTRT),
- 84: uint8(_BT_NMSTRT),
- 85: uint8(_BT_NMSTRT),
- 86: uint8(_BT_NMSTRT),
- 87: uint8(_BT_NMSTRT),
- 88: uint8(_BT_NMSTRT),
- 89: uint8(_BT_NMSTRT),
- 90: uint8(_BT_NMSTRT),
- 91: uint8(_BT_LSQB),
- 92: uint8(_BT_OTHER),
- 93: uint8(_BT_RSQB),
- 94: uint8(_BT_OTHER),
- 95: uint8(_BT_NMSTRT),
- 96: uint8(_BT_OTHER),
- 97: uint8(_BT_HEX),
- 98: uint8(_BT_HEX),
- 99: uint8(_BT_HEX),
- 100: uint8(_BT_HEX),
- 101: uint8(_BT_HEX),
- 102: uint8(_BT_HEX),
- 103: uint8(_BT_NMSTRT),
- 104: uint8(_BT_NMSTRT),
- 105: uint8(_BT_NMSTRT),
- 106: uint8(_BT_NMSTRT),
- 107: uint8(_BT_NMSTRT),
- 108: uint8(_BT_NMSTRT),
- 109: uint8(_BT_NMSTRT),
- 110: uint8(_BT_NMSTRT),
- 111: uint8(_BT_NMSTRT),
- 112: uint8(_BT_NMSTRT),
- 113: uint8(_BT_NMSTRT),
- 114: uint8(_BT_NMSTRT),
- 115: uint8(_BT_NMSTRT),
- 116: uint8(_BT_NMSTRT),
- 117: uint8(_BT_NMSTRT),
- 118: uint8(_BT_NMSTRT),
- 119: uint8(_BT_NMSTRT),
- 120: uint8(_BT_NMSTRT),
- 121: uint8(_BT_NMSTRT),
- 122: uint8(_BT_NMSTRT),
- 123: uint8(_BT_OTHER),
- 124: uint8(_BT_VERBAR),
- 125: uint8(_BT_OTHER),
- 126: uint8(_BT_OTHER),
- 127: uint8(_BT_OTHER),
- 128: uint8(_BT_OTHER),
- 129: uint8(_BT_OTHER),
- 130: uint8(_BT_OTHER),
- 131: uint8(_BT_OTHER),
- 132: uint8(_BT_OTHER),
- 133: uint8(_BT_OTHER),
- 134: uint8(_BT_OTHER),
- 135: uint8(_BT_OTHER),
- 136: uint8(_BT_OTHER),
- 137: uint8(_BT_OTHER),
- 138: uint8(_BT_OTHER),
- 139: uint8(_BT_OTHER),
- 140: uint8(_BT_OTHER),
- 141: uint8(_BT_OTHER),
- 142: uint8(_BT_OTHER),
- 143: uint8(_BT_OTHER),
- 144: uint8(_BT_OTHER),
- 145: uint8(_BT_OTHER),
- 146: uint8(_BT_OTHER),
- 147: uint8(_BT_OTHER),
- 148: uint8(_BT_OTHER),
- 149: uint8(_BT_OTHER),
- 150: uint8(_BT_OTHER),
- 151: uint8(_BT_OTHER),
- 152: uint8(_BT_OTHER),
- 153: uint8(_BT_OTHER),
- 154: uint8(_BT_OTHER),
- 155: uint8(_BT_OTHER),
- 156: uint8(_BT_OTHER),
- 157: uint8(_BT_OTHER),
- 158: uint8(_BT_OTHER),
- 159: uint8(_BT_OTHER),
- 160: uint8(_BT_OTHER),
- 161: uint8(_BT_OTHER),
- 162: uint8(_BT_OTHER),
- 163: uint8(_BT_OTHER),
- 164: uint8(_BT_OTHER),
- 165: uint8(_BT_OTHER),
- 166: uint8(_BT_OTHER),
- 167: uint8(_BT_OTHER),
- 168: uint8(_BT_OTHER),
- 169: uint8(_BT_OTHER),
- 170: uint8(_BT_NMSTRT),
- 171: uint8(_BT_OTHER),
- 172: uint8(_BT_OTHER),
- 173: uint8(_BT_OTHER),
- 174: uint8(_BT_OTHER),
- 175: uint8(_BT_OTHER),
- 176: uint8(_BT_OTHER),
- 177: uint8(_BT_OTHER),
- 178: uint8(_BT_OTHER),
- 179: uint8(_BT_OTHER),
- 180: uint8(_BT_OTHER),
- 181: uint8(_BT_NMSTRT),
- 182: uint8(_BT_OTHER),
- 183: uint8(_BT_NAME),
- 184: uint8(_BT_OTHER),
- 185: uint8(_BT_OTHER),
- 186: uint8(_BT_NMSTRT),
- 187: uint8(_BT_OTHER),
- 188: uint8(_BT_OTHER),
- 189: uint8(_BT_OTHER),
- 190: uint8(_BT_OTHER),
- 191: uint8(_BT_OTHER),
- 192: uint8(_BT_NMSTRT),
- 193: uint8(_BT_NMSTRT),
- 194: uint8(_BT_NMSTRT),
- 195: uint8(_BT_NMSTRT),
- 196: uint8(_BT_NMSTRT),
- 197: uint8(_BT_NMSTRT),
- 198: uint8(_BT_NMSTRT),
- 199: uint8(_BT_NMSTRT),
- 200: uint8(_BT_NMSTRT),
- 201: uint8(_BT_NMSTRT),
- 202: uint8(_BT_NMSTRT),
- 203: uint8(_BT_NMSTRT),
- 204: uint8(_BT_NMSTRT),
- 205: uint8(_BT_NMSTRT),
- 206: uint8(_BT_NMSTRT),
- 207: uint8(_BT_NMSTRT),
- 208: uint8(_BT_NMSTRT),
- 209: uint8(_BT_NMSTRT),
- 210: uint8(_BT_NMSTRT),
- 211: uint8(_BT_NMSTRT),
- 212: uint8(_BT_NMSTRT),
- 213: uint8(_BT_NMSTRT),
- 214: uint8(_BT_NMSTRT),
- 215: uint8(_BT_OTHER),
- 216: uint8(_BT_NMSTRT),
- 217: uint8(_BT_NMSTRT),
- 218: uint8(_BT_NMSTRT),
- 219: uint8(_BT_NMSTRT),
- 220: uint8(_BT_NMSTRT),
- 221: uint8(_BT_NMSTRT),
- 222: uint8(_BT_NMSTRT),
- 223: uint8(_BT_NMSTRT),
- 224: uint8(_BT_NMSTRT),
- 225: uint8(_BT_NMSTRT),
- 226: uint8(_BT_NMSTRT),
- 227: uint8(_BT_NMSTRT),
- 228: uint8(_BT_NMSTRT),
- 229: uint8(_BT_NMSTRT),
- 230: uint8(_BT_NMSTRT),
- 231: uint8(_BT_NMSTRT),
- 232: uint8(_BT_NMSTRT),
- 233: uint8(_BT_NMSTRT),
- 234: uint8(_BT_NMSTRT),
- 235: uint8(_BT_NMSTRT),
- 236: uint8(_BT_NMSTRT),
- 237: uint8(_BT_NMSTRT),
- 238: uint8(_BT_NMSTRT),
- 239: uint8(_BT_NMSTRT),
- 240: uint8(_BT_NMSTRT),
- 241: uint8(_BT_NMSTRT),
- 242: uint8(_BT_NMSTRT),
- 243: uint8(_BT_NMSTRT),
- 244: uint8(_BT_NMSTRT),
- 245: uint8(_BT_NMSTRT),
- 246: uint8(_BT_NMSTRT),
- 247: uint8(_BT_OTHER),
- 248: uint8(_BT_NMSTRT),
- 249: uint8(_BT_NMSTRT),
- 250: uint8(_BT_NMSTRT),
- 251: uint8(_BT_NMSTRT),
- 252: uint8(_BT_NMSTRT),
- 253: uint8(_BT_NMSTRT),
- 254: uint8(_BT_NMSTRT),
- 255: uint8(_BT_NMSTRT),
- },
- }
- func init() {
- p := unsafe.Pointer(&_internal_little2_encoding_ns)
- *(*uintptr)(unsafe.Add(p, 0)) = __ccgo_fp(_little2_prologTok)
- *(*uintptr)(unsafe.Add(p, 8)) = __ccgo_fp(_little2_contentTok)
- *(*uintptr)(unsafe.Add(p, 16)) = __ccgo_fp(_little2_cdataSectionTok)
- *(*uintptr)(unsafe.Add(p, 24)) = __ccgo_fp(_little2_ignoreSectionTok)
- *(*uintptr)(unsafe.Add(p, 32)) = __ccgo_fp(_little2_attributeValueTok)
- *(*uintptr)(unsafe.Add(p, 40)) = __ccgo_fp(_little2_entityValueTok)
- *(*uintptr)(unsafe.Add(p, 48)) = __ccgo_fp(_little2_nameMatchesAscii)
- *(*uintptr)(unsafe.Add(p, 56)) = __ccgo_fp(_little2_nameLength)
- *(*uintptr)(unsafe.Add(p, 64)) = __ccgo_fp(_little2_skipS)
- *(*uintptr)(unsafe.Add(p, 72)) = __ccgo_fp(_little2_getAtts)
- *(*uintptr)(unsafe.Add(p, 80)) = __ccgo_fp(_little2_charRefNumber)
- *(*uintptr)(unsafe.Add(p, 88)) = __ccgo_fp(_little2_predefinedEntityName)
- *(*uintptr)(unsafe.Add(p, 96)) = __ccgo_fp(_little2_updatePosition)
- *(*uintptr)(unsafe.Add(p, 104)) = __ccgo_fp(_little2_isPublicId)
- *(*uintptr)(unsafe.Add(p, 112)) = __ccgo_fp(_little2_toUtf8)
- *(*uintptr)(unsafe.Add(p, 120)) = __ccgo_fp(_little2_toUtf16)
- }
- var _internal_little2_encoding = Tnormal_encoding{
- Fenc: TENCODING{
- Fscanners: [4]TSCANNER{},
- FliteralScanners: [2]TSCANNER{},
- FminBytesPerChar: int32(2),
- FisUtf16: int8(1),
- },
- Ftype1: [256]uint8{
- 9: uint8(_BT_S),
- 10: uint8(_BT_LF),
- 13: uint8(_BT_S),
- 32: uint8(_BT_S),
- 33: uint8(_BT_EXCL),
- 34: uint8(_BT_QUOT),
- 35: uint8(_BT_NUM),
- 36: uint8(_BT_OTHER),
- 37: uint8(_BT_PERCNT),
- 38: uint8(_BT_AMP),
- 39: uint8(_BT_APOS),
- 40: uint8(_BT_LPAR),
- 41: uint8(_BT_RPAR),
- 42: uint8(_BT_AST),
- 43: uint8(_BT_PLUS),
- 44: uint8(_BT_COMMA),
- 45: uint8(_BT_MINUS),
- 46: uint8(_BT_NAME),
- 47: uint8(_BT_SOL),
- 48: uint8(_BT_DIGIT),
- 49: uint8(_BT_DIGIT),
- 50: uint8(_BT_DIGIT),
- 51: uint8(_BT_DIGIT),
- 52: uint8(_BT_DIGIT),
- 53: uint8(_BT_DIGIT),
- 54: uint8(_BT_DIGIT),
- 55: uint8(_BT_DIGIT),
- 56: uint8(_BT_DIGIT),
- 57: uint8(_BT_DIGIT),
- 58: uint8(_BT_NMSTRT),
- 59: uint8(_BT_SEMI),
- 60: uint8(_BT_LT),
- 61: uint8(_BT_EQUALS),
- 62: uint8(_BT_GT),
- 63: uint8(_BT_QUEST),
- 64: uint8(_BT_OTHER),
- 65: uint8(_BT_HEX),
- 66: uint8(_BT_HEX),
- 67: uint8(_BT_HEX),
- 68: uint8(_BT_HEX),
- 69: uint8(_BT_HEX),
- 70: uint8(_BT_HEX),
- 71: uint8(_BT_NMSTRT),
- 72: uint8(_BT_NMSTRT),
- 73: uint8(_BT_NMSTRT),
- 74: uint8(_BT_NMSTRT),
- 75: uint8(_BT_NMSTRT),
- 76: uint8(_BT_NMSTRT),
- 77: uint8(_BT_NMSTRT),
- 78: uint8(_BT_NMSTRT),
- 79: uint8(_BT_NMSTRT),
- 80: uint8(_BT_NMSTRT),
- 81: uint8(_BT_NMSTRT),
- 82: uint8(_BT_NMSTRT),
- 83: uint8(_BT_NMSTRT),
- 84: uint8(_BT_NMSTRT),
- 85: uint8(_BT_NMSTRT),
- 86: uint8(_BT_NMSTRT),
- 87: uint8(_BT_NMSTRT),
- 88: uint8(_BT_NMSTRT),
- 89: uint8(_BT_NMSTRT),
- 90: uint8(_BT_NMSTRT),
- 91: uint8(_BT_LSQB),
- 92: uint8(_BT_OTHER),
- 93: uint8(_BT_RSQB),
- 94: uint8(_BT_OTHER),
- 95: uint8(_BT_NMSTRT),
- 96: uint8(_BT_OTHER),
- 97: uint8(_BT_HEX),
- 98: uint8(_BT_HEX),
- 99: uint8(_BT_HEX),
- 100: uint8(_BT_HEX),
- 101: uint8(_BT_HEX),
- 102: uint8(_BT_HEX),
- 103: uint8(_BT_NMSTRT),
- 104: uint8(_BT_NMSTRT),
- 105: uint8(_BT_NMSTRT),
- 106: uint8(_BT_NMSTRT),
- 107: uint8(_BT_NMSTRT),
- 108: uint8(_BT_NMSTRT),
- 109: uint8(_BT_NMSTRT),
- 110: uint8(_BT_NMSTRT),
- 111: uint8(_BT_NMSTRT),
- 112: uint8(_BT_NMSTRT),
- 113: uint8(_BT_NMSTRT),
- 114: uint8(_BT_NMSTRT),
- 115: uint8(_BT_NMSTRT),
- 116: uint8(_BT_NMSTRT),
- 117: uint8(_BT_NMSTRT),
- 118: uint8(_BT_NMSTRT),
- 119: uint8(_BT_NMSTRT),
- 120: uint8(_BT_NMSTRT),
- 121: uint8(_BT_NMSTRT),
- 122: uint8(_BT_NMSTRT),
- 123: uint8(_BT_OTHER),
- 124: uint8(_BT_VERBAR),
- 125: uint8(_BT_OTHER),
- 126: uint8(_BT_OTHER),
- 127: uint8(_BT_OTHER),
- 128: uint8(_BT_OTHER),
- 129: uint8(_BT_OTHER),
- 130: uint8(_BT_OTHER),
- 131: uint8(_BT_OTHER),
- 132: uint8(_BT_OTHER),
- 133: uint8(_BT_OTHER),
- 134: uint8(_BT_OTHER),
- 135: uint8(_BT_OTHER),
- 136: uint8(_BT_OTHER),
- 137: uint8(_BT_OTHER),
- 138: uint8(_BT_OTHER),
- 139: uint8(_BT_OTHER),
- 140: uint8(_BT_OTHER),
- 141: uint8(_BT_OTHER),
- 142: uint8(_BT_OTHER),
- 143: uint8(_BT_OTHER),
- 144: uint8(_BT_OTHER),
- 145: uint8(_BT_OTHER),
- 146: uint8(_BT_OTHER),
- 147: uint8(_BT_OTHER),
- 148: uint8(_BT_OTHER),
- 149: uint8(_BT_OTHER),
- 150: uint8(_BT_OTHER),
- 151: uint8(_BT_OTHER),
- 152: uint8(_BT_OTHER),
- 153: uint8(_BT_OTHER),
- 154: uint8(_BT_OTHER),
- 155: uint8(_BT_OTHER),
- 156: uint8(_BT_OTHER),
- 157: uint8(_BT_OTHER),
- 158: uint8(_BT_OTHER),
- 159: uint8(_BT_OTHER),
- 160: uint8(_BT_OTHER),
- 161: uint8(_BT_OTHER),
- 162: uint8(_BT_OTHER),
- 163: uint8(_BT_OTHER),
- 164: uint8(_BT_OTHER),
- 165: uint8(_BT_OTHER),
- 166: uint8(_BT_OTHER),
- 167: uint8(_BT_OTHER),
- 168: uint8(_BT_OTHER),
- 169: uint8(_BT_OTHER),
- 170: uint8(_BT_NMSTRT),
- 171: uint8(_BT_OTHER),
- 172: uint8(_BT_OTHER),
- 173: uint8(_BT_OTHER),
- 174: uint8(_BT_OTHER),
- 175: uint8(_BT_OTHER),
- 176: uint8(_BT_OTHER),
- 177: uint8(_BT_OTHER),
- 178: uint8(_BT_OTHER),
- 179: uint8(_BT_OTHER),
- 180: uint8(_BT_OTHER),
- 181: uint8(_BT_NMSTRT),
- 182: uint8(_BT_OTHER),
- 183: uint8(_BT_NAME),
- 184: uint8(_BT_OTHER),
- 185: uint8(_BT_OTHER),
- 186: uint8(_BT_NMSTRT),
- 187: uint8(_BT_OTHER),
- 188: uint8(_BT_OTHER),
- 189: uint8(_BT_OTHER),
- 190: uint8(_BT_OTHER),
- 191: uint8(_BT_OTHER),
- 192: uint8(_BT_NMSTRT),
- 193: uint8(_BT_NMSTRT),
- 194: uint8(_BT_NMSTRT),
- 195: uint8(_BT_NMSTRT),
- 196: uint8(_BT_NMSTRT),
- 197: uint8(_BT_NMSTRT),
- 198: uint8(_BT_NMSTRT),
- 199: uint8(_BT_NMSTRT),
- 200: uint8(_BT_NMSTRT),
- 201: uint8(_BT_NMSTRT),
- 202: uint8(_BT_NMSTRT),
- 203: uint8(_BT_NMSTRT),
- 204: uint8(_BT_NMSTRT),
- 205: uint8(_BT_NMSTRT),
- 206: uint8(_BT_NMSTRT),
- 207: uint8(_BT_NMSTRT),
- 208: uint8(_BT_NMSTRT),
- 209: uint8(_BT_NMSTRT),
- 210: uint8(_BT_NMSTRT),
- 211: uint8(_BT_NMSTRT),
- 212: uint8(_BT_NMSTRT),
- 213: uint8(_BT_NMSTRT),
- 214: uint8(_BT_NMSTRT),
- 215: uint8(_BT_OTHER),
- 216: uint8(_BT_NMSTRT),
- 217: uint8(_BT_NMSTRT),
- 218: uint8(_BT_NMSTRT),
- 219: uint8(_BT_NMSTRT),
- 220: uint8(_BT_NMSTRT),
- 221: uint8(_BT_NMSTRT),
- 222: uint8(_BT_NMSTRT),
- 223: uint8(_BT_NMSTRT),
- 224: uint8(_BT_NMSTRT),
- 225: uint8(_BT_NMSTRT),
- 226: uint8(_BT_NMSTRT),
- 227: uint8(_BT_NMSTRT),
- 228: uint8(_BT_NMSTRT),
- 229: uint8(_BT_NMSTRT),
- 230: uint8(_BT_NMSTRT),
- 231: uint8(_BT_NMSTRT),
- 232: uint8(_BT_NMSTRT),
- 233: uint8(_BT_NMSTRT),
- 234: uint8(_BT_NMSTRT),
- 235: uint8(_BT_NMSTRT),
- 236: uint8(_BT_NMSTRT),
- 237: uint8(_BT_NMSTRT),
- 238: uint8(_BT_NMSTRT),
- 239: uint8(_BT_NMSTRT),
- 240: uint8(_BT_NMSTRT),
- 241: uint8(_BT_NMSTRT),
- 242: uint8(_BT_NMSTRT),
- 243: uint8(_BT_NMSTRT),
- 244: uint8(_BT_NMSTRT),
- 245: uint8(_BT_NMSTRT),
- 246: uint8(_BT_NMSTRT),
- 247: uint8(_BT_OTHER),
- 248: uint8(_BT_NMSTRT),
- 249: uint8(_BT_NMSTRT),
- 250: uint8(_BT_NMSTRT),
- 251: uint8(_BT_NMSTRT),
- 252: uint8(_BT_NMSTRT),
- 253: uint8(_BT_NMSTRT),
- 254: uint8(_BT_NMSTRT),
- 255: uint8(_BT_NMSTRT),
- },
- }
- func init() {
- p := unsafe.Pointer(&_internal_little2_encoding)
- *(*uintptr)(unsafe.Add(p, 0)) = __ccgo_fp(_little2_prologTok)
- *(*uintptr)(unsafe.Add(p, 8)) = __ccgo_fp(_little2_contentTok)
- *(*uintptr)(unsafe.Add(p, 16)) = __ccgo_fp(_little2_cdataSectionTok)
- *(*uintptr)(unsafe.Add(p, 24)) = __ccgo_fp(_little2_ignoreSectionTok)
- *(*uintptr)(unsafe.Add(p, 32)) = __ccgo_fp(_little2_attributeValueTok)
- *(*uintptr)(unsafe.Add(p, 40)) = __ccgo_fp(_little2_entityValueTok)
- *(*uintptr)(unsafe.Add(p, 48)) = __ccgo_fp(_little2_nameMatchesAscii)
- *(*uintptr)(unsafe.Add(p, 56)) = __ccgo_fp(_little2_nameLength)
- *(*uintptr)(unsafe.Add(p, 64)) = __ccgo_fp(_little2_skipS)
- *(*uintptr)(unsafe.Add(p, 72)) = __ccgo_fp(_little2_getAtts)
- *(*uintptr)(unsafe.Add(p, 80)) = __ccgo_fp(_little2_charRefNumber)
- *(*uintptr)(unsafe.Add(p, 88)) = __ccgo_fp(_little2_predefinedEntityName)
- *(*uintptr)(unsafe.Add(p, 96)) = __ccgo_fp(_little2_updatePosition)
- *(*uintptr)(unsafe.Add(p, 104)) = __ccgo_fp(_little2_isPublicId)
- *(*uintptr)(unsafe.Add(p, 112)) = __ccgo_fp(_little2_toUtf8)
- *(*uintptr)(unsafe.Add(p, 120)) = __ccgo_fp(_little2_toUtf16)
- }
- /* CHAR_MATCHES is guaranteed to have MINBPC bytes available. */
- /* This file is included (from xmltok.c, 1-3 times depending on XML_MIN_SIZE)!
- __ __ _
- ___\ \/ /_ __ __ _| |_
- / _ \\ /| '_ \ / _` | __|
- | __// \| |_) | (_| | |_
- \___/_/\_\ .__/ \__,_|\__|
- |_| XML parser
- Copyright (c) 1997-2000 Thai Open Source Software Center Ltd
- Copyright (c) 2000 Clark Cooper <coopercc@users.sourceforge.net>
- Copyright (c) 2002 Fred L. Drake, Jr. <fdrake@users.sourceforge.net>
- Copyright (c) 2002-2016 Karl Waclawek <karl@waclawek.net>
- Copyright (c) 2016-2022 Sebastian Pipping <sebastian@pipping.org>
- Copyright (c) 2017 Rhodri James <rhodri@wildebeest.org.uk>
- Copyright (c) 2018 Benjamin Peterson <benjamin@python.org>
- Copyright (c) 2018 Anton Maklakov <antmak.pub@gmail.com>
- Copyright (c) 2019 David Loffredo <loffredo@steptools.com>
- Copyright (c) 2020 Boris Kolpackov <boris@codesynthesis.com>
- Copyright (c) 2022 Martin Ettl <ettl.martin78@googlemail.com>
- Licensed under the MIT license:
- Permission is hereby granted, free of charge, to any person obtaining
- a copy of this software and associated documentation files (the
- "Software"), to deal in the Software without restriction, including
- without limitation the rights to use, copy, modify, merge, publish,
- distribute, sublicense, and/or sell copies of the Software, and to permit
- persons to whom the Software is furnished to do so, subject to the
- following conditions:
- The above copyright notice and this permission notice shall be included
- in all copies or substantial portions of the Software.
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
- NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
- USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
- /* ptr points to character following "<!-" */
- func _big2_scanComment(tls *libc.TLS, enc uintptr, ptr uintptr, end uintptr, nextTokPtr uintptr) (r int32) {
- var v1 int32
- _ = v1
- if int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2)) {
- if !(int32(*(*int8)(unsafe.Pointer(ptr))) == 0 && int32(*(*int8)(unsafe.Pointer(ptr + 1))) == int32(m_ASCII_MINUS1)) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(2)
- for int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2)) {
- if int32(*(*int8)(unsafe.Pointer(ptr))) == 0 {
- v1 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr + 1)))))))
- } else {
- v1 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr)), *(*int8)(unsafe.Pointer(ptr + 1)))
- }
- switch v1 {
- case int32(_BT_LEAD2):
- if int64(end)-int64(ptr) < int64(2) {
- return -int32(2)
- }
- if 0 != 0 {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(2)
- case int32(_BT_LEAD3):
- if int64(end)-int64(ptr) < int64(3) {
- return -int32(2)
- }
- if 0 != 0 {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(3)
- case int32(_BT_LEAD4):
- if int64(end)-int64(ptr) < int64(4) {
- return -int32(2)
- }
- if 0 != 0 {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(4)
- case int32(_BT_NONXML):
- fallthrough
- case int32(_BT_MALFORM):
- fallthrough
- case int32(_BT_TRAIL):
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- case int32(_BT_MINUS):
- ptr += uintptr(2)
- if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
- return -int32(1)
- }
- if int32(*(*int8)(unsafe.Pointer(ptr))) == 0 && int32(*(*int8)(unsafe.Pointer(ptr + 1))) == int32(m_ASCII_MINUS1) {
- ptr += uintptr(2)
- if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
- return -int32(1)
- }
- if !(int32(*(*int8)(unsafe.Pointer(ptr))) == 0 && int32(*(*int8)(unsafe.Pointer(ptr + 1))) == int32(m_ASCII_GT1)) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(2)
- return int32(m_XML_TOK_COMMENT)
- }
- default:
- ptr += uintptr(2)
- break
- }
- }
- }
- return -int32(1)
- }
- /* ptr points to character following "<!" */
- func _big2_scanDecl(tls *libc.TLS, enc uintptr, ptr uintptr, end uintptr, nextTokPtr uintptr) (r int32) {
- var v1, v2, v3 int32
- _, _, _ = v1, v2, v3
- if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
- return -int32(1)
- }
- if int32(*(*int8)(unsafe.Pointer(ptr))) == 0 {
- v1 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr + 1)))))))
- } else {
- v1 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr)), *(*int8)(unsafe.Pointer(ptr + 1)))
- }
- switch v1 {
- case int32(_BT_MINUS):
- return _big2_scanComment(tls, enc, ptr+uintptr(2), end, nextTokPtr)
- case int32(_BT_LSQB):
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(2)
- return int32(m_XML_TOK_COND_SECT_OPEN)
- case int32(_BT_NMSTRT):
- fallthrough
- case int32(_BT_HEX):
- ptr += uintptr(2)
- default:
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- for int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2)) {
- if int32(*(*int8)(unsafe.Pointer(ptr))) == 0 {
- v2 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr + 1)))))))
- } else {
- v2 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr)), *(*int8)(unsafe.Pointer(ptr + 1)))
- }
- switch v2 {
- case int32(_BT_PERCNT):
- if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(2)*libc.Int32FromInt32(2))) {
- return -int32(1)
- }
- /* don't allow <!ENTITY% foo "whatever"> */
- if int32(*(*int8)(unsafe.Pointer(ptr + libc.UintptrFromInt32(2)))) == 0 {
- v3 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr + libc.UintptrFromInt32(2) + 1)))))))
- } else {
- v3 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr + libc.UintptrFromInt32(2))), *(*int8)(unsafe.Pointer(ptr + libc.UintptrFromInt32(2) + 1)))
- }
- switch v3 {
- case int32(_BT_S):
- fallthrough
- case int32(_BT_CR):
- fallthrough
- case int32(_BT_LF):
- fallthrough
- case int32(_BT_PERCNT):
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- /* fall through */
- fallthrough
- case int32(_BT_S):
- fallthrough
- case int32(_BT_CR):
- fallthrough
- case int32(_BT_LF):
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return int32(m_XML_TOK_DECL_OPEN)
- case int32(_BT_NMSTRT):
- fallthrough
- case int32(_BT_HEX):
- ptr += uintptr(2)
- default:
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- }
- return -int32(1)
- }
- func _big2_checkPiTarget(tls *libc.TLS, enc uintptr, ptr uintptr, end uintptr, tokPtr uintptr) (r int32) {
- var upper, v1, v2, v3 int32
- _, _, _, _ = upper, v1, v2, v3
- upper = 0
- _ = enc
- *(*int32)(unsafe.Pointer(tokPtr)) = int32(m_XML_TOK_PI)
- if int64(end)-int64(ptr) != int64(libc.Int32FromInt32(2)*libc.Int32FromInt32(3)) {
- return int32(1)
- }
- if int32(*(*int8)(unsafe.Pointer(ptr))) == 0 {
- v1 = int32(*(*int8)(unsafe.Pointer(ptr + 1)))
- } else {
- v1 = -int32(1)
- }
- switch v1 {
- case int32(m_ASCII_x2):
- case int32(m_ASCII_X):
- upper = int32(1)
- default:
- return int32(1)
- }
- ptr += uintptr(2)
- if int32(*(*int8)(unsafe.Pointer(ptr))) == 0 {
- v2 = int32(*(*int8)(unsafe.Pointer(ptr + 1)))
- } else {
- v2 = -int32(1)
- }
- switch v2 {
- case int32(m_ASCII_m2):
- case int32(m_ASCII_M):
- upper = int32(1)
- default:
- return int32(1)
- }
- ptr += uintptr(2)
- if int32(*(*int8)(unsafe.Pointer(ptr))) == 0 {
- v3 = int32(*(*int8)(unsafe.Pointer(ptr + 1)))
- } else {
- v3 = -int32(1)
- }
- switch v3 {
- case int32(m_ASCII_l2):
- case int32(m_ASCII_L):
- upper = int32(1)
- default:
- return int32(1)
- }
- if upper != 0 {
- return 0
- }
- *(*int32)(unsafe.Pointer(tokPtr)) = int32(m_XML_TOK_XML_DECL)
- return int32(1)
- }
- /* ptr points to character following "<?" */
- func _big2_scanPi(tls *libc.TLS, enc uintptr, ptr uintptr, end uintptr, nextTokPtr uintptr) (r int32) {
- bp := tls.Alloc(16)
- defer tls.Free(16)
- var target uintptr
- var v1, v2, v3 int32
- var _ /* tok at bp+0 */ int32
- _, _, _, _ = target, v1, v2, v3
- target = ptr
- if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
- return -int32(1)
- }
- if int32(*(*int8)(unsafe.Pointer(ptr))) == 0 {
- v1 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr + 1)))))))
- } else {
- v1 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr)), *(*int8)(unsafe.Pointer(ptr + 1)))
- }
- switch v1 {
- case int32(_BT_NONASCII):
- 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) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- } /* fall through */
- fallthrough
- case int32(_BT_NMSTRT):
- fallthrough
- case int32(_BT_HEX):
- ptr += uintptr(2)
- case int32(_BT_LEAD2):
- if int64(end)-int64(ptr) < int64(libc.Int32FromInt32(2)) {
- return -int32(2)
- }
- if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(2)
- case int32(_BT_LEAD3):
- if int64(end)-int64(ptr) < int64(libc.Int32FromInt32(3)) {
- return -int32(2)
- }
- if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(3)
- case int32(_BT_LEAD4):
- if int64(end)-int64(ptr) < int64(libc.Int32FromInt32(4)) {
- return -int32(2)
- }
- if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(4)
- default:
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- for int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2)) {
- if int32(*(*int8)(unsafe.Pointer(ptr))) == 0 {
- v2 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr + 1)))))))
- } else {
- v2 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr)), *(*int8)(unsafe.Pointer(ptr + 1)))
- }
- switch v2 {
- case int32(_BT_NONASCII):
- 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) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- } /* fall through */
- fallthrough
- case int32(_BT_NMSTRT):
- fallthrough
- case int32(_BT_HEX):
- fallthrough
- case int32(_BT_DIGIT):
- fallthrough
- case int32(_BT_NAME):
- fallthrough
- case int32(_BT_MINUS):
- ptr += uintptr(2)
- case int32(_BT_LEAD2):
- if int64(end)-int64(ptr) < int64(2) {
- return -int32(2)
- }
- if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(2)
- case int32(_BT_LEAD3):
- if int64(end)-int64(ptr) < int64(3) {
- return -int32(2)
- }
- if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(3)
- case int32(_BT_LEAD4):
- if int64(end)-int64(ptr) < int64(4) {
- return -int32(2)
- }
- if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(4)
- case int32(_BT_S):
- fallthrough
- case int32(_BT_CR):
- fallthrough
- case int32(_BT_LF):
- if !(_big2_checkPiTarget(tls, enc, target, ptr, bp) != 0) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(2)
- for int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2)) {
- if int32(*(*int8)(unsafe.Pointer(ptr))) == 0 {
- v3 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr + 1)))))))
- } else {
- v3 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr)), *(*int8)(unsafe.Pointer(ptr + 1)))
- }
- switch v3 {
- case int32(_BT_LEAD2):
- if int64(end)-int64(ptr) < int64(2) {
- return -int32(2)
- }
- if 0 != 0 {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(2)
- case int32(_BT_LEAD3):
- if int64(end)-int64(ptr) < int64(3) {
- return -int32(2)
- }
- if 0 != 0 {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(3)
- case int32(_BT_LEAD4):
- if int64(end)-int64(ptr) < int64(4) {
- return -int32(2)
- }
- if 0 != 0 {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(4)
- case int32(_BT_NONXML):
- fallthrough
- case int32(_BT_MALFORM):
- fallthrough
- case int32(_BT_TRAIL):
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- case int32(_BT_QUEST):
- ptr += uintptr(2)
- if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
- return -int32(1)
- }
- if int32(*(*int8)(unsafe.Pointer(ptr))) == 0 && int32(*(*int8)(unsafe.Pointer(ptr + 1))) == int32(m_ASCII_GT1) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(2)
- return *(*int32)(unsafe.Pointer(bp))
- }
- default:
- ptr += uintptr(2)
- break
- }
- }
- return -int32(1)
- case int32(_BT_QUEST):
- if !(_big2_checkPiTarget(tls, enc, target, ptr, bp) != 0) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(2)
- if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
- return -int32(1)
- }
- if int32(*(*int8)(unsafe.Pointer(ptr))) == 0 && int32(*(*int8)(unsafe.Pointer(ptr + 1))) == int32(m_ASCII_GT1) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(2)
- return *(*int32)(unsafe.Pointer(bp))
- }
- /* fall through */
- fallthrough
- default:
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- }
- return -int32(1)
- }
- func _big2_scanCdataSection(tls *libc.TLS, enc uintptr, ptr uintptr, end uintptr, nextTokPtr uintptr) (r int32) {
- var i int32
- _ = i
- _ = enc
- /* CDATA[ */
- if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(6)*libc.Int32FromInt32(2))) {
- return -int32(1)
- }
- i = 0
- for {
- if !(i < int32(6)) {
- break
- }
- if !(int32(*(*int8)(unsafe.Pointer(ptr))) == 0 && int32(*(*int8)(unsafe.Pointer(ptr + 1))) == int32(_CDATA_LSQB2[i])) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- goto _1
- _1:
- ;
- i++
- ptr += uintptr(2)
- }
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return int32(m_XML_TOK_CDATA_SECT_OPEN)
- }
- var _CDATA_LSQB2 = [6]int8{
- 0: int8(m_ASCII_C),
- 1: int8(m_ASCII_D),
- 2: int8(m_ASCII_A),
- 3: int8(m_ASCII_T),
- 4: int8(m_ASCII_A),
- 5: int8(m_ASCII_LSQB1),
- }
- func _big2_cdataSectionTok(tls *libc.TLS, enc uintptr, ptr uintptr, end uintptr, nextTokPtr uintptr) (r int32) {
- var n Tsize_t
- var v1, v2, v3 int32
- _, _, _, _ = n, v1, v2, v3
- if ptr >= end {
- return -int32(4)
- }
- if int32(2) > int32(1) {
- n = libc.Uint64FromInt64(int64(end) - int64(ptr))
- if n&libc.Uint64FromInt32(libc.Int32FromInt32(2)-libc.Int32FromInt32(1)) != 0 {
- n &= libc.Uint64FromInt32(^(libc.Int32FromInt32(2) - libc.Int32FromInt32(1)))
- if n == uint64(0) {
- return -int32(1)
- }
- end = ptr + uintptr(n)
- }
- }
- if int32(*(*int8)(unsafe.Pointer(ptr))) == 0 {
- v1 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr + 1)))))))
- } else {
- v1 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr)), *(*int8)(unsafe.Pointer(ptr + 1)))
- }
- switch v1 {
- case int32(_BT_RSQB):
- ptr += uintptr(2)
- if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
- return -int32(1)
- }
- if !(int32(*(*int8)(unsafe.Pointer(ptr))) == 0 && int32(*(*int8)(unsafe.Pointer(ptr + 1))) == int32(m_ASCII_RSQB1)) {
- break
- }
- ptr += uintptr(2)
- if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
- return -int32(1)
- }
- if !(int32(*(*int8)(unsafe.Pointer(ptr))) == 0 && int32(*(*int8)(unsafe.Pointer(ptr + 1))) == int32(m_ASCII_GT1)) {
- ptr -= uintptr(2)
- break
- }
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(2)
- return int32(m_XML_TOK_CDATA_SECT_CLOSE)
- case int32(_BT_CR):
- ptr += uintptr(2)
- if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
- return -int32(1)
- }
- if int32(*(*int8)(unsafe.Pointer(ptr))) == 0 {
- v2 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr + 1)))))))
- } else {
- v2 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr)), *(*int8)(unsafe.Pointer(ptr + 1)))
- }
- if v2 == int32(_BT_LF) {
- ptr += uintptr(2)
- }
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return int32(m_XML_TOK_DATA_NEWLINE)
- case int32(_BT_LF):
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(2)
- return int32(m_XML_TOK_DATA_NEWLINE)
- case int32(_BT_LEAD2):
- if int64(end)-int64(ptr) < int64(2) {
- return -int32(2)
- }
- if 0 != 0 {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(2)
- case int32(_BT_LEAD3):
- if int64(end)-int64(ptr) < int64(3) {
- return -int32(2)
- }
- if 0 != 0 {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(3)
- case int32(_BT_LEAD4):
- if int64(end)-int64(ptr) < int64(4) {
- return -int32(2)
- }
- if 0 != 0 {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(4)
- case int32(_BT_NONXML):
- fallthrough
- case int32(_BT_MALFORM):
- fallthrough
- case int32(_BT_TRAIL):
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- default:
- ptr += uintptr(2)
- break
- }
- for int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2)) {
- if int32(*(*int8)(unsafe.Pointer(ptr))) == 0 {
- v3 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr + 1)))))))
- } else {
- v3 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr)), *(*int8)(unsafe.Pointer(ptr + 1)))
- }
- switch v3 {
- case int32(_BT_LEAD2):
- if int64(end)-int64(ptr) < int64(2) || libc.Bool(0 != 0) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return int32(m_XML_TOK_DATA_CHARS)
- }
- ptr += uintptr(2)
- case int32(_BT_LEAD3):
- if int64(end)-int64(ptr) < int64(3) || libc.Bool(0 != 0) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return int32(m_XML_TOK_DATA_CHARS)
- }
- ptr += uintptr(3)
- case int32(_BT_LEAD4):
- if int64(end)-int64(ptr) < int64(4) || libc.Bool(0 != 0) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return int32(m_XML_TOK_DATA_CHARS)
- }
- ptr += uintptr(4)
- case int32(_BT_NONXML):
- fallthrough
- case int32(_BT_MALFORM):
- fallthrough
- case int32(_BT_TRAIL):
- fallthrough
- case int32(_BT_CR):
- fallthrough
- case int32(_BT_LF):
- fallthrough
- case int32(_BT_RSQB):
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return int32(m_XML_TOK_DATA_CHARS)
- default:
- ptr += uintptr(2)
- break
- }
- }
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return int32(m_XML_TOK_DATA_CHARS)
- }
- /* ptr points to character following "</" */
- func _big2_scanEndTag(tls *libc.TLS, enc uintptr, ptr uintptr, end uintptr, nextTokPtr uintptr) (r int32) {
- var v1, v2, v22 int32
- _, _, _ = v1, v2, v22
- if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
- return -int32(1)
- }
- if int32(*(*int8)(unsafe.Pointer(ptr))) == 0 {
- v1 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr + 1)))))))
- } else {
- v1 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr)), *(*int8)(unsafe.Pointer(ptr + 1)))
- }
- switch v1 {
- case int32(_BT_NONASCII):
- 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) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- } /* fall through */
- fallthrough
- case int32(_BT_NMSTRT):
- fallthrough
- case int32(_BT_HEX):
- ptr += uintptr(2)
- case int32(_BT_LEAD2):
- if int64(end)-int64(ptr) < int64(libc.Int32FromInt32(2)) {
- return -int32(2)
- }
- if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(2)
- case int32(_BT_LEAD3):
- if int64(end)-int64(ptr) < int64(libc.Int32FromInt32(3)) {
- return -int32(2)
- }
- if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(3)
- case int32(_BT_LEAD4):
- if int64(end)-int64(ptr) < int64(libc.Int32FromInt32(4)) {
- return -int32(2)
- }
- if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(4)
- default:
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- for int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2)) {
- if int32(*(*int8)(unsafe.Pointer(ptr))) == 0 {
- v2 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr + 1)))))))
- } else {
- v2 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr)), *(*int8)(unsafe.Pointer(ptr + 1)))
- }
- switch v2 {
- case int32(_BT_NONASCII):
- goto _3
- case int32(_BT_MINUS):
- goto _4
- case int32(_BT_NAME):
- goto _5
- case int32(_BT_DIGIT):
- goto _6
- case int32(_BT_HEX):
- goto _7
- case int32(_BT_NMSTRT):
- goto _8
- case int32(_BT_LEAD2):
- goto _9
- case int32(_BT_LEAD3):
- goto _10
- case int32(_BT_LEAD4):
- goto _11
- case int32(_BT_LF):
- goto _12
- case int32(_BT_CR):
- goto _13
- case int32(_BT_S):
- goto _14
- case int32(_BT_COLON):
- goto _15
- case int32(_BT_GT):
- goto _16
- default:
- goto _17
- }
- goto _18
- _3:
- ;
- 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) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- } /* fall through */
- _8:
- ;
- _7:
- ;
- _6:
- ;
- _5:
- ;
- _4:
- ;
- ptr += uintptr(2)
- goto _18
- _9:
- ;
- if int64(end)-int64(ptr) < int64(2) {
- return -int32(2)
- }
- if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(2)
- goto _18
- _10:
- ;
- if int64(end)-int64(ptr) < int64(3) {
- return -int32(2)
- }
- if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(3)
- goto _18
- _11:
- ;
- if int64(end)-int64(ptr) < int64(4) {
- return -int32(2)
- }
- if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(4)
- goto _18
- _14:
- ;
- _13:
- ;
- _12:
- ;
- ptr += uintptr(2)
- _21:
- ;
- if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
- goto _19
- }
- if int32(*(*int8)(unsafe.Pointer(ptr))) == 0 {
- v22 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr + 1)))))))
- } else {
- v22 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr)), *(*int8)(unsafe.Pointer(ptr + 1)))
- }
- switch v22 {
- case int32(_BT_S):
- fallthrough
- case int32(_BT_CR):
- fallthrough
- case int32(_BT_LF):
- case int32(_BT_GT):
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(2)
- return int32(m_XML_TOK_END_TAG)
- default:
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- goto _20
- _20:
- ;
- ptr += uintptr(2)
- goto _21
- goto _19
- _19:
- ;
- return -int32(1)
- _15:
- ;
- /* no need to check qname syntax here,
- since end-tag must match exactly */
- ptr += uintptr(2)
- goto _18
- _16:
- ;
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(2)
- return int32(m_XML_TOK_END_TAG)
- _17:
- ;
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- _18:
- }
- return -int32(1)
- }
- /* ptr points to character following "&#X" */
- func _big2_scanHexCharRef(tls *libc.TLS, enc uintptr, ptr uintptr, end uintptr, nextTokPtr uintptr) (r int32) {
- var v1, v3 int32
- _, _ = v1, v3
- if int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2)) {
- if int32(*(*int8)(unsafe.Pointer(ptr))) == 0 {
- v1 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr + 1)))))))
- } else {
- v1 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr)), *(*int8)(unsafe.Pointer(ptr + 1)))
- }
- switch v1 {
- case int32(_BT_DIGIT):
- fallthrough
- case int32(_BT_HEX):
- default:
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(2)
- for {
- if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
- break
- }
- if int32(*(*int8)(unsafe.Pointer(ptr))) == 0 {
- v3 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr + 1)))))))
- } else {
- v3 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr)), *(*int8)(unsafe.Pointer(ptr + 1)))
- }
- switch v3 {
- case int32(_BT_DIGIT):
- fallthrough
- case int32(_BT_HEX):
- case int32(_BT_SEMI):
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(2)
- return int32(m_XML_TOK_CHAR_REF)
- default:
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- goto _2
- _2:
- ;
- ptr += uintptr(2)
- }
- }
- return -int32(1)
- }
- /* ptr points to character following "&#" */
- func _big2_scanCharRef(tls *libc.TLS, enc uintptr, ptr uintptr, end uintptr, nextTokPtr uintptr) (r int32) {
- var v1, v3 int32
- _, _ = v1, v3
- if int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2)) {
- if int32(*(*int8)(unsafe.Pointer(ptr))) == 0 && int32(*(*int8)(unsafe.Pointer(ptr + 1))) == int32(m_ASCII_x2) {
- return _big2_scanHexCharRef(tls, enc, ptr+uintptr(2), end, nextTokPtr)
- }
- if int32(*(*int8)(unsafe.Pointer(ptr))) == 0 {
- v1 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr + 1)))))))
- } else {
- v1 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr)), *(*int8)(unsafe.Pointer(ptr + 1)))
- }
- switch v1 {
- case int32(_BT_DIGIT):
- default:
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(2)
- for {
- if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
- break
- }
- if int32(*(*int8)(unsafe.Pointer(ptr))) == 0 {
- v3 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr + 1)))))))
- } else {
- v3 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr)), *(*int8)(unsafe.Pointer(ptr + 1)))
- }
- switch v3 {
- case int32(_BT_DIGIT):
- case int32(_BT_SEMI):
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(2)
- return int32(m_XML_TOK_CHAR_REF)
- default:
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- goto _2
- _2:
- ;
- ptr += uintptr(2)
- }
- }
- return -int32(1)
- }
- /* ptr points to character following "&" */
- func _big2_scanRef(tls *libc.TLS, enc uintptr, ptr uintptr, end uintptr, nextTokPtr uintptr) (r int32) {
- var v1, v2 int32
- _, _ = v1, v2
- if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
- return -int32(1)
- }
- if int32(*(*int8)(unsafe.Pointer(ptr))) == 0 {
- v1 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr + 1)))))))
- } else {
- v1 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr)), *(*int8)(unsafe.Pointer(ptr + 1)))
- }
- switch v1 {
- case int32(_BT_NONASCII):
- 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) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- } /* fall through */
- fallthrough
- case int32(_BT_NMSTRT):
- fallthrough
- case int32(_BT_HEX):
- ptr += uintptr(2)
- case int32(_BT_LEAD2):
- if int64(end)-int64(ptr) < int64(libc.Int32FromInt32(2)) {
- return -int32(2)
- }
- if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(2)
- case int32(_BT_LEAD3):
- if int64(end)-int64(ptr) < int64(libc.Int32FromInt32(3)) {
- return -int32(2)
- }
- if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(3)
- case int32(_BT_LEAD4):
- if int64(end)-int64(ptr) < int64(libc.Int32FromInt32(4)) {
- return -int32(2)
- }
- if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(4)
- case int32(_BT_NUM):
- return _big2_scanCharRef(tls, enc, ptr+uintptr(2), end, nextTokPtr)
- default:
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- for int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2)) {
- if int32(*(*int8)(unsafe.Pointer(ptr))) == 0 {
- v2 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr + 1)))))))
- } else {
- v2 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr)), *(*int8)(unsafe.Pointer(ptr + 1)))
- }
- switch v2 {
- case int32(_BT_NONASCII):
- 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) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- } /* fall through */
- fallthrough
- case int32(_BT_NMSTRT):
- fallthrough
- case int32(_BT_HEX):
- fallthrough
- case int32(_BT_DIGIT):
- fallthrough
- case int32(_BT_NAME):
- fallthrough
- case int32(_BT_MINUS):
- ptr += uintptr(2)
- case int32(_BT_LEAD2):
- if int64(end)-int64(ptr) < int64(2) {
- return -int32(2)
- }
- if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(2)
- case int32(_BT_LEAD3):
- if int64(end)-int64(ptr) < int64(3) {
- return -int32(2)
- }
- if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(3)
- case int32(_BT_LEAD4):
- if int64(end)-int64(ptr) < int64(4) {
- return -int32(2)
- }
- if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(4)
- case int32(_BT_SEMI):
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(2)
- return int32(m_XML_TOK_ENTITY_REF)
- default:
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- }
- return -int32(1)
- }
- /* ptr points to character following first character of attribute name */
- func _big2_scanAtts(tls *libc.TLS, enc uintptr, _ptr uintptr, end uintptr, nextTokPtr uintptr) (r int32) {
- bp := tls.Alloc(16)
- defer tls.Free(16)
- *(*uintptr)(unsafe.Pointer(bp)) = _ptr
- var hadColon, open, t, t1, tok, v1, v18, v22, v24, v26, v27, v31 int32
- _, _, _, _, _, _, _, _, _, _, _, _ = hadColon, open, t, t1, tok, v1, v18, v22, v24, v26, v27, v31
- hadColon = 0
- for int64(end)-int64(*(*uintptr)(unsafe.Pointer(bp))) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2)) {
- if int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp))))) == 0 {
- v1 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 1)))))))
- } else {
- v1 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))), *(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 1)))
- }
- switch v1 {
- case int32(_BT_NONASCII):
- goto _2
- case int32(_BT_MINUS):
- goto _3
- case int32(_BT_NAME):
- goto _4
- case int32(_BT_DIGIT):
- goto _5
- case int32(_BT_HEX):
- goto _6
- case int32(_BT_NMSTRT):
- goto _7
- case int32(_BT_LEAD2):
- goto _8
- case int32(_BT_LEAD3):
- goto _9
- case int32(_BT_LEAD4):
- goto _10
- case int32(_BT_COLON):
- goto _11
- case int32(_BT_LF):
- goto _12
- case int32(_BT_CR):
- goto _13
- case int32(_BT_S):
- goto _14
- case int32(_BT_EQUALS):
- goto _15
- default:
- goto _16
- }
- goto _17
- _2:
- ;
- 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) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = *(*uintptr)(unsafe.Pointer(bp))
- return m_XML_TOK_INVALID
- } /* fall through */
- _7:
- ;
- _6:
- ;
- _5:
- ;
- _4:
- ;
- _3:
- ;
- *(*uintptr)(unsafe.Pointer(bp)) += uintptr(2)
- goto _17
- _8:
- ;
- if int64(end)-int64(*(*uintptr)(unsafe.Pointer(bp))) < int64(2) {
- return -int32(2)
- }
- if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = *(*uintptr)(unsafe.Pointer(bp))
- return m_XML_TOK_INVALID
- }
- *(*uintptr)(unsafe.Pointer(bp)) += uintptr(2)
- goto _17
- _9:
- ;
- if int64(end)-int64(*(*uintptr)(unsafe.Pointer(bp))) < int64(3) {
- return -int32(2)
- }
- if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = *(*uintptr)(unsafe.Pointer(bp))
- return m_XML_TOK_INVALID
- }
- *(*uintptr)(unsafe.Pointer(bp)) += uintptr(3)
- goto _17
- _10:
- ;
- if int64(end)-int64(*(*uintptr)(unsafe.Pointer(bp))) < int64(4) {
- return -int32(2)
- }
- if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = *(*uintptr)(unsafe.Pointer(bp))
- return m_XML_TOK_INVALID
- }
- *(*uintptr)(unsafe.Pointer(bp)) += uintptr(4)
- goto _17
- _11:
- ;
- if hadColon != 0 {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = *(*uintptr)(unsafe.Pointer(bp))
- return m_XML_TOK_INVALID
- }
- hadColon = int32(1)
- *(*uintptr)(unsafe.Pointer(bp)) += uintptr(2)
- if !(int64(end)-int64(*(*uintptr)(unsafe.Pointer(bp))) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
- return -int32(1)
- }
- if int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp))))) == 0 {
- v18 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 1)))))))
- } else {
- v18 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))), *(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 1)))
- }
- switch v18 {
- case int32(_BT_NONASCII):
- 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) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = *(*uintptr)(unsafe.Pointer(bp))
- return m_XML_TOK_INVALID
- } /* fall through */
- fallthrough
- case int32(_BT_NMSTRT):
- fallthrough
- case int32(_BT_HEX):
- *(*uintptr)(unsafe.Pointer(bp)) += uintptr(2)
- case int32(_BT_LEAD2):
- if int64(end)-int64(*(*uintptr)(unsafe.Pointer(bp))) < int64(libc.Int32FromInt32(2)) {
- return -int32(2)
- }
- if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = *(*uintptr)(unsafe.Pointer(bp))
- return m_XML_TOK_INVALID
- }
- *(*uintptr)(unsafe.Pointer(bp)) += uintptr(2)
- case int32(_BT_LEAD3):
- if int64(end)-int64(*(*uintptr)(unsafe.Pointer(bp))) < int64(libc.Int32FromInt32(3)) {
- return -int32(2)
- }
- if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = *(*uintptr)(unsafe.Pointer(bp))
- return m_XML_TOK_INVALID
- }
- *(*uintptr)(unsafe.Pointer(bp)) += uintptr(3)
- case int32(_BT_LEAD4):
- if int64(end)-int64(*(*uintptr)(unsafe.Pointer(bp))) < int64(libc.Int32FromInt32(4)) {
- return -int32(2)
- }
- if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = *(*uintptr)(unsafe.Pointer(bp))
- return m_XML_TOK_INVALID
- }
- *(*uintptr)(unsafe.Pointer(bp)) += uintptr(4)
- default:
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = *(*uintptr)(unsafe.Pointer(bp))
- return m_XML_TOK_INVALID
- }
- goto _17
- _14:
- ;
- _13:
- ;
- _12:
- ;
- _21:
- ;
- *(*uintptr)(unsafe.Pointer(bp)) += uintptr(2)
- if !(int64(end)-int64(*(*uintptr)(unsafe.Pointer(bp))) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
- return -int32(1)
- }
- if int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp))))) == 0 {
- v22 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 1)))))))
- } else {
- v22 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))), *(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 1)))
- }
- t = v22
- if t == int32(_BT_EQUALS) {
- goto _19
- }
- switch t {
- case int32(_BT_S):
- fallthrough
- case int32(_BT_LF):
- fallthrough
- case int32(_BT_CR):
- default:
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = *(*uintptr)(unsafe.Pointer(bp))
- return m_XML_TOK_INVALID
- }
- goto _20
- _20:
- ;
- goto _21
- goto _19
- _19:
- ;
- /* fall through */
- _15:
- ;
- hadColon = 0
- for {
- *(*uintptr)(unsafe.Pointer(bp)) += uintptr(2)
- if !(int64(end)-int64(*(*uintptr)(unsafe.Pointer(bp))) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
- return -int32(1)
- }
- if int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp))))) == 0 {
- v24 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 1)))))))
- } else {
- v24 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))), *(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 1)))
- }
- open = v24
- if open == int32(_BT_QUOT) || open == int32(_BT_APOS) {
- break
- }
- switch open {
- case int32(_BT_S):
- fallthrough
- case int32(_BT_LF):
- fallthrough
- case int32(_BT_CR):
- default:
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = *(*uintptr)(unsafe.Pointer(bp))
- return m_XML_TOK_INVALID
- }
- goto _23
- _23:
- }
- *(*uintptr)(unsafe.Pointer(bp)) += uintptr(2)
- /* in attribute value */
- for {
- if !(int64(end)-int64(*(*uintptr)(unsafe.Pointer(bp))) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
- return -int32(1)
- }
- if int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp))))) == 0 {
- v26 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 1)))))))
- } else {
- v26 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))), *(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 1)))
- }
- t1 = v26
- if t1 == open {
- break
- }
- switch t1 {
- case int32(_BT_LEAD2):
- if int64(end)-int64(*(*uintptr)(unsafe.Pointer(bp))) < int64(2) {
- return -int32(2)
- }
- if 0 != 0 {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = *(*uintptr)(unsafe.Pointer(bp))
- return m_XML_TOK_INVALID
- }
- *(*uintptr)(unsafe.Pointer(bp)) += uintptr(2)
- case int32(_BT_LEAD3):
- if int64(end)-int64(*(*uintptr)(unsafe.Pointer(bp))) < int64(3) {
- return -int32(2)
- }
- if 0 != 0 {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = *(*uintptr)(unsafe.Pointer(bp))
- return m_XML_TOK_INVALID
- }
- *(*uintptr)(unsafe.Pointer(bp)) += uintptr(3)
- case int32(_BT_LEAD4):
- if int64(end)-int64(*(*uintptr)(unsafe.Pointer(bp))) < int64(4) {
- return -int32(2)
- }
- if 0 != 0 {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = *(*uintptr)(unsafe.Pointer(bp))
- return m_XML_TOK_INVALID
- }
- *(*uintptr)(unsafe.Pointer(bp)) += uintptr(4)
- case int32(_BT_NONXML):
- fallthrough
- case int32(_BT_MALFORM):
- fallthrough
- case int32(_BT_TRAIL):
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = *(*uintptr)(unsafe.Pointer(bp))
- return m_XML_TOK_INVALID
- case int32(_BT_AMP):
- tok = _big2_scanRef(tls, enc, *(*uintptr)(unsafe.Pointer(bp))+uintptr(2), end, bp)
- if tok <= 0 {
- if tok == m_XML_TOK_INVALID {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = *(*uintptr)(unsafe.Pointer(bp))
- }
- return tok
- }
- case int32(_BT_LT):
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = *(*uintptr)(unsafe.Pointer(bp))
- return m_XML_TOK_INVALID
- default:
- *(*uintptr)(unsafe.Pointer(bp)) += uintptr(2)
- break
- }
- goto _25
- _25:
- }
- *(*uintptr)(unsafe.Pointer(bp)) += uintptr(2)
- if !(int64(end)-int64(*(*uintptr)(unsafe.Pointer(bp))) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
- return -int32(1)
- }
- if int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp))))) == 0 {
- v27 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 1)))))))
- } else {
- v27 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))), *(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 1)))
- }
- switch v27 {
- case int32(_BT_S):
- fallthrough
- case int32(_BT_CR):
- fallthrough
- case int32(_BT_LF):
- case int32(_BT_SOL):
- goto sol
- case int32(_BT_GT):
- goto gt
- default:
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = *(*uintptr)(unsafe.Pointer(bp))
- return m_XML_TOK_INVALID
- }
- /* ptr points to closing quote */
- _30:
- ;
- *(*uintptr)(unsafe.Pointer(bp)) += uintptr(2)
- if !(int64(end)-int64(*(*uintptr)(unsafe.Pointer(bp))) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
- return -int32(1)
- }
- if int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp))))) == 0 {
- v31 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 1)))))))
- } else {
- v31 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))), *(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 1)))
- }
- switch v31 {
- case int32(_BT_NONASCII):
- goto _32
- case int32(_BT_HEX):
- goto _33
- case int32(_BT_NMSTRT):
- goto _34
- case int32(_BT_LEAD2):
- goto _35
- case int32(_BT_LEAD3):
- goto _36
- case int32(_BT_LEAD4):
- goto _37
- case int32(_BT_LF):
- goto _38
- case int32(_BT_CR):
- goto _39
- case int32(_BT_S):
- goto _40
- case int32(_BT_GT):
- goto _41
- case int32(_BT_SOL):
- goto _42
- default:
- goto _43
- }
- goto _44
- _32:
- ;
- 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) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = *(*uintptr)(unsafe.Pointer(bp))
- return m_XML_TOK_INVALID
- } /* fall through */
- _34:
- ;
- _33:
- ;
- *(*uintptr)(unsafe.Pointer(bp)) += uintptr(2)
- goto _44
- _35:
- ;
- if int64(end)-int64(*(*uintptr)(unsafe.Pointer(bp))) < int64(libc.Int32FromInt32(2)) {
- return -int32(2)
- }
- if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = *(*uintptr)(unsafe.Pointer(bp))
- return m_XML_TOK_INVALID
- }
- *(*uintptr)(unsafe.Pointer(bp)) += uintptr(2)
- goto _44
- _36:
- ;
- if int64(end)-int64(*(*uintptr)(unsafe.Pointer(bp))) < int64(libc.Int32FromInt32(3)) {
- return -int32(2)
- }
- if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = *(*uintptr)(unsafe.Pointer(bp))
- return m_XML_TOK_INVALID
- }
- *(*uintptr)(unsafe.Pointer(bp)) += uintptr(3)
- goto _44
- _37:
- ;
- if int64(end)-int64(*(*uintptr)(unsafe.Pointer(bp))) < int64(libc.Int32FromInt32(4)) {
- return -int32(2)
- }
- if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = *(*uintptr)(unsafe.Pointer(bp))
- return m_XML_TOK_INVALID
- }
- *(*uintptr)(unsafe.Pointer(bp)) += uintptr(4)
- goto _44
- _40:
- ;
- _39:
- ;
- _38:
- ;
- goto _29
- _41:
- ;
- goto gt
- gt:
- ;
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = *(*uintptr)(unsafe.Pointer(bp)) + uintptr(2)
- return int32(m_XML_TOK_START_TAG_WITH_ATTS)
- _42:
- ;
- goto sol
- sol:
- ;
- *(*uintptr)(unsafe.Pointer(bp)) += uintptr(2)
- if !(int64(end)-int64(*(*uintptr)(unsafe.Pointer(bp))) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
- return -int32(1)
- }
- if !(int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp))))) == 0 && int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 1))) == int32(m_ASCII_GT1)) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = *(*uintptr)(unsafe.Pointer(bp))
- return m_XML_TOK_INVALID
- }
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = *(*uintptr)(unsafe.Pointer(bp)) + uintptr(2)
- return int32(m_XML_TOK_EMPTY_ELEMENT_WITH_ATTS)
- _43:
- ;
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = *(*uintptr)(unsafe.Pointer(bp))
- return m_XML_TOK_INVALID
- _44:
- ;
- goto _28
- goto _29
- _29:
- ;
- goto _30
- goto _28
- _28:
- ;
- goto _17
- _16:
- ;
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = *(*uintptr)(unsafe.Pointer(bp))
- return m_XML_TOK_INVALID
- _17:
- }
- return -int32(1)
- }
- /* ptr points to character following "<" */
- func _big2_scanLt(tls *libc.TLS, enc uintptr, ptr uintptr, end uintptr, nextTokPtr uintptr) (r int32) {
- var hadColon, v1, v2, v21, v22, v3 int32
- _, _, _, _, _, _ = hadColon, v1, v2, v21, v22, v3
- if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
- return -int32(1)
- }
- if int32(*(*int8)(unsafe.Pointer(ptr))) == 0 {
- v1 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr + 1)))))))
- } else {
- v1 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr)), *(*int8)(unsafe.Pointer(ptr + 1)))
- }
- switch v1 {
- case int32(_BT_NONASCII):
- 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) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- } /* fall through */
- fallthrough
- case int32(_BT_NMSTRT):
- fallthrough
- case int32(_BT_HEX):
- ptr += uintptr(2)
- case int32(_BT_LEAD2):
- if int64(end)-int64(ptr) < int64(libc.Int32FromInt32(2)) {
- return -int32(2)
- }
- if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(2)
- case int32(_BT_LEAD3):
- if int64(end)-int64(ptr) < int64(libc.Int32FromInt32(3)) {
- return -int32(2)
- }
- if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(3)
- case int32(_BT_LEAD4):
- if int64(end)-int64(ptr) < int64(libc.Int32FromInt32(4)) {
- return -int32(2)
- }
- if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(4)
- case int32(_BT_EXCL):
- ptr += uintptr(2)
- if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
- return -int32(1)
- }
- if int32(*(*int8)(unsafe.Pointer(ptr))) == 0 {
- v2 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr + 1)))))))
- } else {
- v2 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr)), *(*int8)(unsafe.Pointer(ptr + 1)))
- }
- switch v2 {
- case int32(_BT_MINUS):
- return _big2_scanComment(tls, enc, ptr+uintptr(2), end, nextTokPtr)
- case int32(_BT_LSQB):
- return _big2_scanCdataSection(tls, enc, ptr+uintptr(2), end, nextTokPtr)
- }
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- case int32(_BT_QUEST):
- return _big2_scanPi(tls, enc, ptr+uintptr(2), end, nextTokPtr)
- case int32(_BT_SOL):
- return _big2_scanEndTag(tls, enc, ptr+uintptr(2), end, nextTokPtr)
- default:
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- hadColon = 0
- /* we have a start-tag */
- for int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2)) {
- if int32(*(*int8)(unsafe.Pointer(ptr))) == 0 {
- v3 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr + 1)))))))
- } else {
- v3 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr)), *(*int8)(unsafe.Pointer(ptr + 1)))
- }
- switch v3 {
- case int32(_BT_NONASCII):
- goto _4
- case int32(_BT_MINUS):
- goto _5
- case int32(_BT_NAME):
- goto _6
- case int32(_BT_DIGIT):
- goto _7
- case int32(_BT_HEX):
- goto _8
- case int32(_BT_NMSTRT):
- goto _9
- case int32(_BT_LEAD2):
- goto _10
- case int32(_BT_LEAD3):
- goto _11
- case int32(_BT_LEAD4):
- goto _12
- case int32(_BT_COLON):
- goto _13
- case int32(_BT_LF):
- goto _14
- case int32(_BT_CR):
- goto _15
- case int32(_BT_S):
- goto _16
- case int32(_BT_GT):
- goto _17
- case int32(_BT_SOL):
- goto _18
- default:
- goto _19
- }
- goto _20
- _4:
- ;
- 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) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- } /* fall through */
- _9:
- ;
- _8:
- ;
- _7:
- ;
- _6:
- ;
- _5:
- ;
- ptr += uintptr(2)
- goto _20
- _10:
- ;
- if int64(end)-int64(ptr) < int64(2) {
- return -int32(2)
- }
- if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(2)
- goto _20
- _11:
- ;
- if int64(end)-int64(ptr) < int64(3) {
- return -int32(2)
- }
- if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(3)
- goto _20
- _12:
- ;
- if int64(end)-int64(ptr) < int64(4) {
- return -int32(2)
- }
- if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(4)
- goto _20
- _13:
- ;
- if hadColon != 0 {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- hadColon = int32(1)
- ptr += uintptr(2)
- if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
- return -int32(1)
- }
- if int32(*(*int8)(unsafe.Pointer(ptr))) == 0 {
- v21 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr + 1)))))))
- } else {
- v21 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr)), *(*int8)(unsafe.Pointer(ptr + 1)))
- }
- switch v21 {
- case int32(_BT_NONASCII):
- 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) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- } /* fall through */
- fallthrough
- case int32(_BT_NMSTRT):
- fallthrough
- case int32(_BT_HEX):
- ptr += uintptr(2)
- case int32(_BT_LEAD2):
- if int64(end)-int64(ptr) < int64(libc.Int32FromInt32(2)) {
- return -int32(2)
- }
- if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(2)
- case int32(_BT_LEAD3):
- if int64(end)-int64(ptr) < int64(libc.Int32FromInt32(3)) {
- return -int32(2)
- }
- if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(3)
- case int32(_BT_LEAD4):
- if int64(end)-int64(ptr) < int64(libc.Int32FromInt32(4)) {
- return -int32(2)
- }
- if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(4)
- default:
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- goto _20
- _16:
- ;
- _15:
- ;
- _14:
- ;
- ptr += uintptr(2)
- for int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2)) {
- if int32(*(*int8)(unsafe.Pointer(ptr))) == 0 {
- v22 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr + 1)))))))
- } else {
- v22 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr)), *(*int8)(unsafe.Pointer(ptr + 1)))
- }
- switch v22 {
- case int32(_BT_NONASCII):
- 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) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- } /* fall through */
- fallthrough
- case int32(_BT_NMSTRT):
- fallthrough
- case int32(_BT_HEX):
- ptr += uintptr(2)
- case int32(_BT_LEAD2):
- if int64(end)-int64(ptr) < int64(libc.Int32FromInt32(2)) {
- return -int32(2)
- }
- if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(2)
- case int32(_BT_LEAD3):
- if int64(end)-int64(ptr) < int64(libc.Int32FromInt32(3)) {
- return -int32(2)
- }
- if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(3)
- case int32(_BT_LEAD4):
- if int64(end)-int64(ptr) < int64(libc.Int32FromInt32(4)) {
- return -int32(2)
- }
- if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(4)
- case int32(_BT_GT):
- goto gt
- case int32(_BT_SOL):
- goto sol
- case int32(_BT_S):
- fallthrough
- case int32(_BT_CR):
- fallthrough
- case int32(_BT_LF):
- ptr += uintptr(2)
- continue
- default:
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- return _big2_scanAtts(tls, enc, ptr, end, nextTokPtr)
- }
- return -int32(1)
- _17:
- ;
- goto gt
- gt:
- ;
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(2)
- return int32(m_XML_TOK_START_TAG_NO_ATTS)
- _18:
- ;
- goto sol
- sol:
- ;
- ptr += uintptr(2)
- if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
- return -int32(1)
- }
- if !(int32(*(*int8)(unsafe.Pointer(ptr))) == 0 && int32(*(*int8)(unsafe.Pointer(ptr + 1))) == int32(m_ASCII_GT1)) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(2)
- return int32(m_XML_TOK_EMPTY_ELEMENT_NO_ATTS)
- _19:
- ;
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- _20:
- }
- return -int32(1)
- }
- func _big2_contentTok(tls *libc.TLS, enc uintptr, ptr uintptr, end uintptr, nextTokPtr uintptr) (r int32) {
- var n Tsize_t
- var v1, v2, v3 int32
- _, _, _, _ = n, v1, v2, v3
- if ptr >= end {
- return -int32(4)
- }
- if int32(2) > int32(1) {
- n = libc.Uint64FromInt64(int64(end) - int64(ptr))
- if n&libc.Uint64FromInt32(libc.Int32FromInt32(2)-libc.Int32FromInt32(1)) != 0 {
- n &= libc.Uint64FromInt32(^(libc.Int32FromInt32(2) - libc.Int32FromInt32(1)))
- if n == uint64(0) {
- return -int32(1)
- }
- end = ptr + uintptr(n)
- }
- }
- if int32(*(*int8)(unsafe.Pointer(ptr))) == 0 {
- v1 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr + 1)))))))
- } else {
- v1 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr)), *(*int8)(unsafe.Pointer(ptr + 1)))
- }
- switch v1 {
- case int32(_BT_LT):
- return _big2_scanLt(tls, enc, ptr+uintptr(2), end, nextTokPtr)
- case int32(_BT_AMP):
- return _big2_scanRef(tls, enc, ptr+uintptr(2), end, nextTokPtr)
- case int32(_BT_CR):
- ptr += uintptr(2)
- if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
- return -int32(3)
- }
- if int32(*(*int8)(unsafe.Pointer(ptr))) == 0 {
- v2 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr + 1)))))))
- } else {
- v2 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr)), *(*int8)(unsafe.Pointer(ptr + 1)))
- }
- if v2 == int32(_BT_LF) {
- ptr += uintptr(2)
- }
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return int32(m_XML_TOK_DATA_NEWLINE)
- case int32(_BT_LF):
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(2)
- return int32(m_XML_TOK_DATA_NEWLINE)
- case int32(_BT_RSQB):
- ptr += uintptr(2)
- if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
- return -int32(5)
- }
- if !(int32(*(*int8)(unsafe.Pointer(ptr))) == 0 && int32(*(*int8)(unsafe.Pointer(ptr + 1))) == int32(m_ASCII_RSQB1)) {
- break
- }
- ptr += uintptr(2)
- if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
- return -int32(5)
- }
- if !(int32(*(*int8)(unsafe.Pointer(ptr))) == 0 && int32(*(*int8)(unsafe.Pointer(ptr + 1))) == int32(m_ASCII_GT1)) {
- ptr -= uintptr(2)
- break
- }
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- case int32(_BT_LEAD2):
- if int64(end)-int64(ptr) < int64(2) {
- return -int32(2)
- }
- if 0 != 0 {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(2)
- case int32(_BT_LEAD3):
- if int64(end)-int64(ptr) < int64(3) {
- return -int32(2)
- }
- if 0 != 0 {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(3)
- case int32(_BT_LEAD4):
- if int64(end)-int64(ptr) < int64(4) {
- return -int32(2)
- }
- if 0 != 0 {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(4)
- case int32(_BT_NONXML):
- fallthrough
- case int32(_BT_MALFORM):
- fallthrough
- case int32(_BT_TRAIL):
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- default:
- ptr += uintptr(2)
- break
- }
- for int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2)) {
- if int32(*(*int8)(unsafe.Pointer(ptr))) == 0 {
- v3 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr + 1)))))))
- } else {
- v3 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr)), *(*int8)(unsafe.Pointer(ptr + 1)))
- }
- switch v3 {
- case int32(_BT_LEAD2):
- if int64(end)-int64(ptr) < int64(2) || libc.Bool(0 != 0) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return int32(m_XML_TOK_DATA_CHARS)
- }
- ptr += uintptr(2)
- case int32(_BT_LEAD3):
- if int64(end)-int64(ptr) < int64(3) || libc.Bool(0 != 0) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return int32(m_XML_TOK_DATA_CHARS)
- }
- ptr += uintptr(3)
- case int32(_BT_LEAD4):
- if int64(end)-int64(ptr) < int64(4) || libc.Bool(0 != 0) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return int32(m_XML_TOK_DATA_CHARS)
- }
- ptr += uintptr(4)
- case int32(_BT_RSQB):
- if int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(2)*libc.Int32FromInt32(2)) {
- if !(int32(*(*int8)(unsafe.Pointer(ptr + libc.UintptrFromInt32(2)))) == 0 && int32(*(*int8)(unsafe.Pointer(ptr + libc.UintptrFromInt32(2) + 1))) == int32(m_ASCII_RSQB1)) {
- ptr += uintptr(2)
- break
- }
- if int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(3)*libc.Int32FromInt32(2)) {
- 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)) {
- ptr += uintptr(2)
- break
- }
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(libc.Int32FromInt32(2)*libc.Int32FromInt32(2))
- return m_XML_TOK_INVALID
- }
- }
- /* fall through */
- fallthrough
- case int32(_BT_AMP):
- fallthrough
- case int32(_BT_LT):
- fallthrough
- case int32(_BT_NONXML):
- fallthrough
- case int32(_BT_MALFORM):
- fallthrough
- case int32(_BT_TRAIL):
- fallthrough
- case int32(_BT_CR):
- fallthrough
- case int32(_BT_LF):
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return int32(m_XML_TOK_DATA_CHARS)
- default:
- ptr += uintptr(2)
- break
- }
- }
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return int32(m_XML_TOK_DATA_CHARS)
- }
- /* ptr points to character following "%" */
- func _big2_scanPercent(tls *libc.TLS, enc uintptr, ptr uintptr, end uintptr, nextTokPtr uintptr) (r int32) {
- var v1, v2 int32
- _, _ = v1, v2
- if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
- return -int32(1)
- }
- if int32(*(*int8)(unsafe.Pointer(ptr))) == 0 {
- v1 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr + 1)))))))
- } else {
- v1 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr)), *(*int8)(unsafe.Pointer(ptr + 1)))
- }
- switch v1 {
- case int32(_BT_NONASCII):
- 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) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- } /* fall through */
- fallthrough
- case int32(_BT_NMSTRT):
- fallthrough
- case int32(_BT_HEX):
- ptr += uintptr(2)
- case int32(_BT_LEAD2):
- if int64(end)-int64(ptr) < int64(libc.Int32FromInt32(2)) {
- return -int32(2)
- }
- if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(2)
- case int32(_BT_LEAD3):
- if int64(end)-int64(ptr) < int64(libc.Int32FromInt32(3)) {
- return -int32(2)
- }
- if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(3)
- case int32(_BT_LEAD4):
- if int64(end)-int64(ptr) < int64(libc.Int32FromInt32(4)) {
- return -int32(2)
- }
- if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(4)
- case int32(_BT_S):
- fallthrough
- case int32(_BT_LF):
- fallthrough
- case int32(_BT_CR):
- fallthrough
- case int32(_BT_PERCNT):
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return int32(m_XML_TOK_PERCENT)
- default:
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- for int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2)) {
- if int32(*(*int8)(unsafe.Pointer(ptr))) == 0 {
- v2 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr + 1)))))))
- } else {
- v2 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr)), *(*int8)(unsafe.Pointer(ptr + 1)))
- }
- switch v2 {
- case int32(_BT_NONASCII):
- 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) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- } /* fall through */
- fallthrough
- case int32(_BT_NMSTRT):
- fallthrough
- case int32(_BT_HEX):
- fallthrough
- case int32(_BT_DIGIT):
- fallthrough
- case int32(_BT_NAME):
- fallthrough
- case int32(_BT_MINUS):
- ptr += uintptr(2)
- case int32(_BT_LEAD2):
- if int64(end)-int64(ptr) < int64(2) {
- return -int32(2)
- }
- if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(2)
- case int32(_BT_LEAD3):
- if int64(end)-int64(ptr) < int64(3) {
- return -int32(2)
- }
- if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(3)
- case int32(_BT_LEAD4):
- if int64(end)-int64(ptr) < int64(4) {
- return -int32(2)
- }
- if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(4)
- case int32(_BT_SEMI):
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(2)
- return int32(m_XML_TOK_PARAM_ENTITY_REF)
- default:
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- }
- return -int32(1)
- }
- func _big2_scanPoundName(tls *libc.TLS, enc uintptr, ptr uintptr, end uintptr, nextTokPtr uintptr) (r int32) {
- var v1, v2 int32
- _, _ = v1, v2
- if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
- return -int32(1)
- }
- if int32(*(*int8)(unsafe.Pointer(ptr))) == 0 {
- v1 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr + 1)))))))
- } else {
- v1 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr)), *(*int8)(unsafe.Pointer(ptr + 1)))
- }
- switch v1 {
- case int32(_BT_NONASCII):
- 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) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- } /* fall through */
- fallthrough
- case int32(_BT_NMSTRT):
- fallthrough
- case int32(_BT_HEX):
- ptr += uintptr(2)
- case int32(_BT_LEAD2):
- if int64(end)-int64(ptr) < int64(libc.Int32FromInt32(2)) {
- return -int32(2)
- }
- if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(2)
- case int32(_BT_LEAD3):
- if int64(end)-int64(ptr) < int64(libc.Int32FromInt32(3)) {
- return -int32(2)
- }
- if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(3)
- case int32(_BT_LEAD4):
- if int64(end)-int64(ptr) < int64(libc.Int32FromInt32(4)) {
- return -int32(2)
- }
- if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(4)
- default:
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- for int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2)) {
- if int32(*(*int8)(unsafe.Pointer(ptr))) == 0 {
- v2 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr + 1)))))))
- } else {
- v2 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr)), *(*int8)(unsafe.Pointer(ptr + 1)))
- }
- switch v2 {
- case int32(_BT_NONASCII):
- 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) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- } /* fall through */
- fallthrough
- case int32(_BT_NMSTRT):
- fallthrough
- case int32(_BT_HEX):
- fallthrough
- case int32(_BT_DIGIT):
- fallthrough
- case int32(_BT_NAME):
- fallthrough
- case int32(_BT_MINUS):
- ptr += uintptr(2)
- case int32(_BT_LEAD2):
- if int64(end)-int64(ptr) < int64(2) {
- return -int32(2)
- }
- if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(2)
- case int32(_BT_LEAD3):
- if int64(end)-int64(ptr) < int64(3) {
- return -int32(2)
- }
- if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(3)
- case int32(_BT_LEAD4):
- if int64(end)-int64(ptr) < int64(4) {
- return -int32(2)
- }
- if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(4)
- case int32(_BT_CR):
- fallthrough
- case int32(_BT_LF):
- fallthrough
- case int32(_BT_S):
- fallthrough
- case int32(_BT_RPAR):
- fallthrough
- case int32(_BT_GT):
- fallthrough
- case int32(_BT_PERCNT):
- fallthrough
- case int32(_BT_VERBAR):
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return int32(m_XML_TOK_POUND_NAME)
- default:
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- }
- return -int32(m_XML_TOK_POUND_NAME)
- }
- func _big2_scanLit(tls *libc.TLS, open int32, enc uintptr, ptr uintptr, end uintptr, nextTokPtr uintptr) (r int32) {
- var t, v1, v2 int32
- _, _, _ = t, v1, v2
- for int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2)) {
- if int32(*(*int8)(unsafe.Pointer(ptr))) == 0 {
- v1 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr + 1)))))))
- } else {
- v1 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr)), *(*int8)(unsafe.Pointer(ptr + 1)))
- }
- t = v1
- switch t {
- case int32(_BT_LEAD2):
- if int64(end)-int64(ptr) < int64(2) {
- return -int32(2)
- }
- if 0 != 0 {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(2)
- case int32(_BT_LEAD3):
- if int64(end)-int64(ptr) < int64(3) {
- return -int32(2)
- }
- if 0 != 0 {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(3)
- case int32(_BT_LEAD4):
- if int64(end)-int64(ptr) < int64(4) {
- return -int32(2)
- }
- if 0 != 0 {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(4)
- case int32(_BT_NONXML):
- fallthrough
- case int32(_BT_MALFORM):
- fallthrough
- case int32(_BT_TRAIL):
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- case int32(_BT_QUOT):
- fallthrough
- case int32(_BT_APOS):
- ptr += uintptr(2)
- if t != open {
- break
- }
- if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
- return -int32(m_XML_TOK_LITERAL)
- }
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- if int32(*(*int8)(unsafe.Pointer(ptr))) == 0 {
- v2 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr + 1)))))))
- } else {
- v2 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr)), *(*int8)(unsafe.Pointer(ptr + 1)))
- }
- switch v2 {
- case int32(_BT_S):
- fallthrough
- case int32(_BT_CR):
- fallthrough
- case int32(_BT_LF):
- fallthrough
- case int32(_BT_GT):
- fallthrough
- case int32(_BT_PERCNT):
- fallthrough
- case int32(_BT_LSQB):
- return int32(m_XML_TOK_LITERAL)
- default:
- return m_XML_TOK_INVALID
- }
- fallthrough
- default:
- ptr += uintptr(2)
- break
- }
- }
- return -int32(1)
- }
- func _big2_prologTok(tls *libc.TLS, enc uintptr, ptr uintptr, end uintptr, nextTokPtr uintptr) (r int32) {
- var n Tsize_t
- var tok, v1, v29, v33, v34, v35, v36 int32
- _, _, _, _, _, _, _, _ = n, tok, v1, v29, v33, v34, v35, v36
- if ptr >= end {
- return -int32(4)
- }
- if int32(2) > int32(1) {
- n = libc.Uint64FromInt64(int64(end) - int64(ptr))
- if n&libc.Uint64FromInt32(libc.Int32FromInt32(2)-libc.Int32FromInt32(1)) != 0 {
- n &= libc.Uint64FromInt32(^(libc.Int32FromInt32(2) - libc.Int32FromInt32(1)))
- if n == uint64(0) {
- return -int32(1)
- }
- end = ptr + uintptr(n)
- }
- }
- if int32(*(*int8)(unsafe.Pointer(ptr))) == 0 {
- v1 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr + 1)))))))
- } else {
- v1 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr)), *(*int8)(unsafe.Pointer(ptr + 1)))
- }
- switch v1 {
- case int32(_BT_QUOT):
- goto _2
- case int32(_BT_APOS):
- goto _3
- case int32(_BT_LT):
- goto _4
- case int32(_BT_CR):
- goto _5
- case int32(_BT_LF):
- goto _6
- case int32(_BT_S):
- goto _7
- case int32(_BT_PERCNT):
- goto _8
- case int32(_BT_COMMA):
- goto _9
- case int32(_BT_LSQB):
- goto _10
- case int32(_BT_RSQB):
- goto _11
- case int32(_BT_LPAR):
- goto _12
- case int32(_BT_RPAR):
- goto _13
- case int32(_BT_VERBAR):
- goto _14
- case int32(_BT_GT):
- goto _15
- case int32(_BT_NUM):
- goto _16
- case int32(_BT_LEAD2):
- goto _17
- case int32(_BT_LEAD3):
- goto _18
- case int32(_BT_LEAD4):
- goto _19
- case int32(_BT_HEX):
- goto _20
- case int32(_BT_NMSTRT):
- goto _21
- case int32(_BT_COLON):
- goto _22
- case int32(_BT_MINUS):
- goto _23
- case int32(_BT_NAME):
- goto _24
- case int32(_BT_DIGIT):
- goto _25
- case int32(_BT_NONASCII):
- goto _26
- default:
- goto _27
- }
- goto _28
- _2:
- ;
- return _big2_scanLit(tls, int32(_BT_QUOT), enc, ptr+uintptr(2), end, nextTokPtr)
- _3:
- ;
- return _big2_scanLit(tls, int32(_BT_APOS), enc, ptr+uintptr(2), end, nextTokPtr)
- _4:
- ;
- ptr += uintptr(2)
- if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
- return -int32(1)
- }
- if int32(*(*int8)(unsafe.Pointer(ptr))) == 0 {
- v29 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr + 1)))))))
- } else {
- v29 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr)), *(*int8)(unsafe.Pointer(ptr + 1)))
- }
- switch v29 {
- case int32(_BT_EXCL):
- return _big2_scanDecl(tls, enc, ptr+uintptr(2), end, nextTokPtr)
- case int32(_BT_QUEST):
- return _big2_scanPi(tls, enc, ptr+uintptr(2), end, nextTokPtr)
- case int32(_BT_NMSTRT):
- fallthrough
- case int32(_BT_HEX):
- fallthrough
- case int32(_BT_NONASCII):
- fallthrough
- case int32(_BT_LEAD2):
- fallthrough
- case int32(_BT_LEAD3):
- fallthrough
- case int32(_BT_LEAD4):
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr - uintptr(2)
- return int32(m_XML_TOK_INSTANCE_START)
- }
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- _5:
- ;
- if ptr+uintptr(2) == end {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = end
- /* indicate that this might be part of a CR/LF pair */
- return -int32(m_XML_TOK_PROLOG_S)
- }
- /* fall through */
- _7:
- ;
- _6:
- ;
- _32:
- ;
- ptr += uintptr(2)
- if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
- goto _30
- }
- if int32(*(*int8)(unsafe.Pointer(ptr))) == 0 {
- v33 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr + 1)))))))
- } else {
- v33 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr)), *(*int8)(unsafe.Pointer(ptr + 1)))
- }
- switch v33 {
- case int32(_BT_S):
- fallthrough
- case int32(_BT_LF):
- case int32(_BT_CR):
- /* don't split CR/LF pair */
- if ptr+uintptr(2) != end {
- break
- }
- /* fall through */
- fallthrough
- default:
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return int32(m_XML_TOK_PROLOG_S)
- }
- goto _31
- _31:
- ;
- goto _32
- goto _30
- _30:
- ;
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return int32(m_XML_TOK_PROLOG_S)
- _8:
- ;
- return _big2_scanPercent(tls, enc, ptr+uintptr(2), end, nextTokPtr)
- _9:
- ;
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(2)
- return int32(m_XML_TOK_COMMA)
- _10:
- ;
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(2)
- return int32(m_XML_TOK_OPEN_BRACKET)
- _11:
- ;
- ptr += uintptr(2)
- if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
- return -int32(m_XML_TOK_CLOSE_BRACKET)
- }
- if int32(*(*int8)(unsafe.Pointer(ptr))) == 0 && int32(*(*int8)(unsafe.Pointer(ptr + 1))) == int32(m_ASCII_RSQB1) {
- if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(2)*libc.Int32FromInt32(2))) {
- return -int32(1)
- }
- if int32(*(*int8)(unsafe.Pointer(ptr + libc.UintptrFromInt32(2)))) == 0 && int32(*(*int8)(unsafe.Pointer(ptr + libc.UintptrFromInt32(2) + 1))) == int32(m_ASCII_GT1) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(libc.Int32FromInt32(2)*libc.Int32FromInt32(2))
- return int32(m_XML_TOK_COND_SECT_CLOSE)
- }
- }
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return int32(m_XML_TOK_CLOSE_BRACKET)
- _12:
- ;
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(2)
- return int32(m_XML_TOK_OPEN_PAREN)
- _13:
- ;
- ptr += uintptr(2)
- if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
- return -int32(m_XML_TOK_CLOSE_PAREN)
- }
- if int32(*(*int8)(unsafe.Pointer(ptr))) == 0 {
- v34 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr + 1)))))))
- } else {
- v34 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr)), *(*int8)(unsafe.Pointer(ptr + 1)))
- }
- switch v34 {
- case int32(_BT_AST):
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(2)
- return int32(m_XML_TOK_CLOSE_PAREN_ASTERISK)
- case int32(_BT_QUEST):
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(2)
- return int32(m_XML_TOK_CLOSE_PAREN_QUESTION)
- case int32(_BT_PLUS):
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(2)
- return int32(m_XML_TOK_CLOSE_PAREN_PLUS)
- case int32(_BT_CR):
- fallthrough
- case int32(_BT_LF):
- fallthrough
- case int32(_BT_S):
- fallthrough
- case int32(_BT_GT):
- fallthrough
- case int32(_BT_COMMA):
- fallthrough
- case int32(_BT_VERBAR):
- fallthrough
- case int32(_BT_RPAR):
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return int32(m_XML_TOK_CLOSE_PAREN)
- }
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- _14:
- ;
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(2)
- return int32(m_XML_TOK_OR)
- _15:
- ;
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(2)
- return int32(m_XML_TOK_DECL_CLOSE)
- _16:
- ;
- return _big2_scanPoundName(tls, enc, ptr+uintptr(2), end, nextTokPtr)
- _17:
- ;
- if int64(end)-int64(ptr) < int64(2) {
- return -int32(2)
- }
- if 0 != 0 {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- if 0 != 0 {
- ptr += uintptr(2)
- tok = int32(m_XML_TOK_NAME)
- goto _28
- }
- if 0 != 0 {
- ptr += uintptr(2)
- tok = int32(m_XML_TOK_NMTOKEN)
- goto _28
- }
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- _18:
- ;
- if int64(end)-int64(ptr) < int64(3) {
- return -int32(2)
- }
- if 0 != 0 {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- if 0 != 0 {
- ptr += uintptr(3)
- tok = int32(m_XML_TOK_NAME)
- goto _28
- }
- if 0 != 0 {
- ptr += uintptr(3)
- tok = int32(m_XML_TOK_NMTOKEN)
- goto _28
- }
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- _19:
- ;
- if int64(end)-int64(ptr) < int64(4) {
- return -int32(2)
- }
- if 0 != 0 {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- if 0 != 0 {
- ptr += uintptr(4)
- tok = int32(m_XML_TOK_NAME)
- goto _28
- }
- if 0 != 0 {
- ptr += uintptr(4)
- tok = int32(m_XML_TOK_NMTOKEN)
- goto _28
- }
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- _21:
- ;
- _20:
- ;
- tok = int32(m_XML_TOK_NAME)
- ptr += uintptr(2)
- goto _28
- _25:
- ;
- _24:
- ;
- _23:
- ;
- _22:
- ;
- tok = int32(m_XML_TOK_NMTOKEN)
- ptr += uintptr(2)
- goto _28
- _26:
- ;
- 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 {
- ptr += uintptr(2)
- tok = int32(m_XML_TOK_NAME)
- goto _28
- }
- 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 {
- ptr += uintptr(2)
- tok = int32(m_XML_TOK_NMTOKEN)
- goto _28
- }
- /* fall through */
- _27:
- ;
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- _28:
- ;
- for int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2)) {
- if int32(*(*int8)(unsafe.Pointer(ptr))) == 0 {
- v35 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr + 1)))))))
- } else {
- v35 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr)), *(*int8)(unsafe.Pointer(ptr + 1)))
- }
- switch v35 {
- case int32(_BT_NONASCII):
- 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) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- } /* fall through */
- fallthrough
- case int32(_BT_NMSTRT):
- fallthrough
- case int32(_BT_HEX):
- fallthrough
- case int32(_BT_DIGIT):
- fallthrough
- case int32(_BT_NAME):
- fallthrough
- case int32(_BT_MINUS):
- ptr += uintptr(2)
- case int32(_BT_LEAD2):
- if int64(end)-int64(ptr) < int64(2) {
- return -int32(2)
- }
- if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(2)
- case int32(_BT_LEAD3):
- if int64(end)-int64(ptr) < int64(3) {
- return -int32(2)
- }
- if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(3)
- case int32(_BT_LEAD4):
- if int64(end)-int64(ptr) < int64(4) {
- return -int32(2)
- }
- if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(4)
- case int32(_BT_GT):
- fallthrough
- case int32(_BT_RPAR):
- fallthrough
- case int32(_BT_COMMA):
- fallthrough
- case int32(_BT_VERBAR):
- fallthrough
- case int32(_BT_LSQB):
- fallthrough
- case int32(_BT_PERCNT):
- fallthrough
- case int32(_BT_S):
- fallthrough
- case int32(_BT_CR):
- fallthrough
- case int32(_BT_LF):
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return tok
- case int32(_BT_COLON):
- ptr += uintptr(2)
- switch tok {
- case int32(m_XML_TOK_NAME):
- if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
- return -int32(1)
- }
- tok = int32(m_XML_TOK_PREFIXED_NAME)
- if int32(*(*int8)(unsafe.Pointer(ptr))) == 0 {
- v36 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr + 1)))))))
- } else {
- v36 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr)), *(*int8)(unsafe.Pointer(ptr + 1)))
- }
- switch v36 {
- case int32(_BT_NONASCII):
- 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) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- } /* fall through */
- fallthrough
- case int32(_BT_NMSTRT):
- fallthrough
- case int32(_BT_HEX):
- fallthrough
- case int32(_BT_DIGIT):
- fallthrough
- case int32(_BT_NAME):
- fallthrough
- case int32(_BT_MINUS):
- ptr += uintptr(2)
- case int32(_BT_LEAD2):
- if int64(end)-int64(ptr) < int64(2) {
- return -int32(2)
- }
- if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(2)
- case int32(_BT_LEAD3):
- if int64(end)-int64(ptr) < int64(3) {
- return -int32(2)
- }
- if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(3)
- case int32(_BT_LEAD4):
- if int64(end)-int64(ptr) < int64(4) {
- return -int32(2)
- }
- if libc.Bool(0 != 0) || libc.Bool(!(libc.Int32FromInt32(0) != 0)) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(4)
- default:
- tok = int32(m_XML_TOK_NMTOKEN)
- break
- }
- case int32(m_XML_TOK_PREFIXED_NAME):
- tok = int32(m_XML_TOK_NMTOKEN)
- break
- }
- case int32(_BT_PLUS):
- if tok == int32(m_XML_TOK_NMTOKEN) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(2)
- return int32(m_XML_TOK_NAME_PLUS)
- case int32(_BT_AST):
- if tok == int32(m_XML_TOK_NMTOKEN) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(2)
- return int32(m_XML_TOK_NAME_ASTERISK)
- case int32(_BT_QUEST):
- if tok == int32(m_XML_TOK_NMTOKEN) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(2)
- return int32(m_XML_TOK_NAME_QUESTION)
- default:
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- }
- return -tok
- }
- func _big2_attributeValueTok(tls *libc.TLS, enc uintptr, ptr uintptr, end uintptr, nextTokPtr uintptr) (r int32) {
- var start uintptr
- var v1, v2 int32
- _, _, _ = start, v1, v2
- if ptr >= end {
- return -int32(4)
- } else {
- if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
- /* This line cannot be executed. The incoming data has already
- * been tokenized once, so incomplete characters like this have
- * already been eliminated from the input. Retaining the paranoia
- * check is still valuable, however.
- */
- return -int32(1) /* LCOV_EXCL_LINE */
- }
- }
- start = ptr
- for int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2)) {
- if int32(*(*int8)(unsafe.Pointer(ptr))) == 0 {
- v1 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr + 1)))))))
- } else {
- v1 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr)), *(*int8)(unsafe.Pointer(ptr + 1)))
- }
- switch v1 {
- case int32(_BT_LEAD2):
- ptr += uintptr(2) /* NOTE: The encoding has already been validated. */
- case int32(_BT_LEAD3):
- ptr += uintptr(3) /* NOTE: The encoding has already been validated. */
- case int32(_BT_LEAD4):
- ptr += uintptr(4) /* NOTE: The encoding has already been validated. */
- case int32(_BT_AMP):
- if ptr == start {
- return _big2_scanRef(tls, enc, ptr+uintptr(2), end, nextTokPtr)
- }
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return int32(m_XML_TOK_DATA_CHARS)
- case int32(_BT_LT):
- /* this is for inside entity references */
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- case int32(_BT_LF):
- if ptr == start {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(2)
- return int32(m_XML_TOK_DATA_NEWLINE)
- }
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return int32(m_XML_TOK_DATA_CHARS)
- case int32(_BT_CR):
- if ptr == start {
- ptr += uintptr(2)
- if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
- return -int32(3)
- }
- if int32(*(*int8)(unsafe.Pointer(ptr))) == 0 {
- v2 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr + 1)))))))
- } else {
- v2 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr)), *(*int8)(unsafe.Pointer(ptr + 1)))
- }
- if v2 == int32(_BT_LF) {
- ptr += uintptr(2)
- }
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return int32(m_XML_TOK_DATA_NEWLINE)
- }
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return int32(m_XML_TOK_DATA_CHARS)
- case int32(_BT_S):
- if ptr == start {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(2)
- return int32(m_XML_TOK_ATTRIBUTE_VALUE_S)
- }
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return int32(m_XML_TOK_DATA_CHARS)
- default:
- ptr += uintptr(2)
- break
- }
- }
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return int32(m_XML_TOK_DATA_CHARS)
- }
- func _big2_entityValueTok(tls *libc.TLS, enc uintptr, ptr uintptr, end uintptr, nextTokPtr uintptr) (r int32) {
- var start uintptr
- var tok, v1, v2, v3 int32
- _, _, _, _, _ = start, tok, v1, v2, v3
- if ptr >= end {
- return -int32(4)
- } else {
- if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
- /* This line cannot be executed. The incoming data has already
- * been tokenized once, so incomplete characters like this have
- * already been eliminated from the input. Retaining the paranoia
- * check is still valuable, however.
- */
- return -int32(1) /* LCOV_EXCL_LINE */
- }
- }
- start = ptr
- for int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2)) {
- if int32(*(*int8)(unsafe.Pointer(ptr))) == 0 {
- v1 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr + 1)))))))
- } else {
- v1 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr)), *(*int8)(unsafe.Pointer(ptr + 1)))
- }
- switch v1 {
- case int32(_BT_LEAD2):
- ptr += uintptr(2) /* NOTE: The encoding has already been validated. */
- case int32(_BT_LEAD3):
- ptr += uintptr(3) /* NOTE: The encoding has already been validated. */
- case int32(_BT_LEAD4):
- ptr += uintptr(4) /* NOTE: The encoding has already been validated. */
- case int32(_BT_AMP):
- if ptr == start {
- return _big2_scanRef(tls, enc, ptr+uintptr(2), end, nextTokPtr)
- }
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return int32(m_XML_TOK_DATA_CHARS)
- case int32(_BT_PERCNT):
- if ptr == start {
- tok = _big2_scanPercent(tls, enc, ptr+uintptr(2), end, nextTokPtr)
- if tok == int32(m_XML_TOK_PERCENT) {
- v2 = m_XML_TOK_INVALID
- } else {
- v2 = tok
- }
- return v2
- }
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return int32(m_XML_TOK_DATA_CHARS)
- case int32(_BT_LF):
- if ptr == start {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(2)
- return int32(m_XML_TOK_DATA_NEWLINE)
- }
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return int32(m_XML_TOK_DATA_CHARS)
- case int32(_BT_CR):
- if ptr == start {
- ptr += uintptr(2)
- if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
- return -int32(3)
- }
- if int32(*(*int8)(unsafe.Pointer(ptr))) == 0 {
- v3 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr + 1)))))))
- } else {
- v3 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr)), *(*int8)(unsafe.Pointer(ptr + 1)))
- }
- if v3 == int32(_BT_LF) {
- ptr += uintptr(2)
- }
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return int32(m_XML_TOK_DATA_NEWLINE)
- }
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return int32(m_XML_TOK_DATA_CHARS)
- default:
- ptr += uintptr(2)
- break
- }
- }
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return int32(m_XML_TOK_DATA_CHARS)
- }
- func _big2_ignoreSectionTok(tls *libc.TLS, enc uintptr, ptr uintptr, end uintptr, nextTokPtr uintptr) (r int32) {
- var level, v1 int32
- var n Tsize_t
- _, _, _ = level, n, v1
- level = 0
- if int32(2) > int32(1) {
- n = libc.Uint64FromInt64(int64(end) - int64(ptr))
- if n&libc.Uint64FromInt32(libc.Int32FromInt32(2)-libc.Int32FromInt32(1)) != 0 {
- n &= libc.Uint64FromInt32(^(libc.Int32FromInt32(2) - libc.Int32FromInt32(1)))
- end = ptr + uintptr(n)
- }
- }
- for int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2)) {
- if int32(*(*int8)(unsafe.Pointer(ptr))) == 0 {
- v1 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr + 1)))))))
- } else {
- v1 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr)), *(*int8)(unsafe.Pointer(ptr + 1)))
- }
- switch v1 {
- case int32(_BT_LEAD2):
- if int64(end)-int64(ptr) < int64(2) {
- return -int32(2)
- }
- if 0 != 0 {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(2)
- case int32(_BT_LEAD3):
- if int64(end)-int64(ptr) < int64(3) {
- return -int32(2)
- }
- if 0 != 0 {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(3)
- case int32(_BT_LEAD4):
- if int64(end)-int64(ptr) < int64(4) {
- return -int32(2)
- }
- if 0 != 0 {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- }
- ptr += uintptr(4)
- case int32(_BT_NONXML):
- fallthrough
- case int32(_BT_MALFORM):
- fallthrough
- case int32(_BT_TRAIL):
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return m_XML_TOK_INVALID
- case int32(_BT_LT):
- ptr += uintptr(2)
- if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
- return -int32(1)
- }
- if int32(*(*int8)(unsafe.Pointer(ptr))) == 0 && int32(*(*int8)(unsafe.Pointer(ptr + 1))) == int32(m_ASCII_EXCL2) {
- ptr += uintptr(2)
- if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
- return -int32(1)
- }
- if int32(*(*int8)(unsafe.Pointer(ptr))) == 0 && int32(*(*int8)(unsafe.Pointer(ptr + 1))) == int32(m_ASCII_LSQB1) {
- level++
- ptr += uintptr(2)
- }
- }
- case int32(_BT_RSQB):
- ptr += uintptr(2)
- if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
- return -int32(1)
- }
- if int32(*(*int8)(unsafe.Pointer(ptr))) == 0 && int32(*(*int8)(unsafe.Pointer(ptr + 1))) == int32(m_ASCII_RSQB1) {
- ptr += uintptr(2)
- if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
- return -int32(1)
- }
- if int32(*(*int8)(unsafe.Pointer(ptr))) == 0 && int32(*(*int8)(unsafe.Pointer(ptr + 1))) == int32(m_ASCII_GT1) {
- ptr += uintptr(2)
- if level == 0 {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return int32(m_XML_TOK_IGNORE_SECT)
- }
- level--
- }
- }
- default:
- ptr += uintptr(2)
- break
- }
- }
- return -int32(1)
- }
- func _big2_isPublicId(tls *libc.TLS, enc uintptr, ptr uintptr, end uintptr, badPtr uintptr) (r int32) {
- var v2, v3, v4 int32
- _, _, _ = v2, v3, v4
- ptr += uintptr(2)
- end -= uintptr(2)
- for {
- if !(int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2))) {
- break
- }
- if int32(*(*int8)(unsafe.Pointer(ptr))) == 0 {
- v2 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr + 1)))))))
- } else {
- v2 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr)), *(*int8)(unsafe.Pointer(ptr + 1)))
- }
- switch v2 {
- case int32(_BT_DIGIT):
- fallthrough
- case int32(_BT_HEX):
- fallthrough
- case int32(_BT_MINUS):
- fallthrough
- case int32(_BT_APOS):
- fallthrough
- case int32(_BT_LPAR):
- fallthrough
- case int32(_BT_RPAR):
- fallthrough
- case int32(_BT_PLUS):
- fallthrough
- case int32(_BT_COMMA):
- fallthrough
- case int32(_BT_SOL):
- fallthrough
- case int32(_BT_EQUALS):
- fallthrough
- case int32(_BT_QUEST):
- fallthrough
- case int32(_BT_CR):
- fallthrough
- case int32(_BT_LF):
- fallthrough
- case int32(_BT_SEMI):
- fallthrough
- case int32(_BT_EXCL):
- fallthrough
- case int32(_BT_AST):
- fallthrough
- case int32(_BT_PERCNT):
- fallthrough
- case int32(_BT_NUM):
- fallthrough
- case int32(_BT_COLON):
- case int32(_BT_S):
- if int32(*(*int8)(unsafe.Pointer(ptr))) == 0 && int32(*(*int8)(unsafe.Pointer(ptr + 1))) == int32(m_ASCII_TAB1) {
- *(*uintptr)(unsafe.Pointer(badPtr)) = ptr
- return 0
- }
- case int32(_BT_NAME):
- fallthrough
- case int32(_BT_NMSTRT):
- if int32(*(*int8)(unsafe.Pointer(ptr))) == 0 {
- v3 = int32(*(*int8)(unsafe.Pointer(ptr + 1)))
- } else {
- v3 = -int32(1)
- }
- if !(v3 & ^libc.Int32FromInt32(0x7f) != 0) {
- break
- }
- /* fall through */
- fallthrough
- default:
- if int32(*(*int8)(unsafe.Pointer(ptr))) == 0 {
- v4 = int32(*(*int8)(unsafe.Pointer(ptr + 1)))
- } else {
- v4 = -int32(1)
- }
- switch v4 {
- case int32(0x24): /* $ */
- fallthrough
- case int32(0x40): /* @ */
- default:
- *(*uintptr)(unsafe.Pointer(badPtr)) = ptr
- return 0
- }
- break
- }
- goto _1
- _1:
- ;
- ptr += uintptr(2)
- }
- return int32(1)
- }
- /* This must only be called for a well-formed start-tag or empty
- element tag. Returns the number of attributes. Pointers to the
- first attsMax attributes are stored in atts.
- */
- func _big2_getAtts(tls *libc.TLS, enc uintptr, ptr uintptr, attsMax int32, atts uintptr) (r int32) {
- var nAtts, open, state, v2, v3, v5, v7 int32
- var v4, v6, v8, v9 bool
- _, _, _, _, _, _, _, _, _, _, _ = nAtts, open, state, v2, v3, v4, v5, v6, v7, v8, v9
- state = 1
- nAtts = 0
- open = 0 /* defined when state == inValue;
- initialization just to shut up compilers */
- ptr += uintptr(2)
- for {
- if int32(*(*int8)(unsafe.Pointer(ptr))) == 0 {
- v2 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr + 1)))))))
- } else {
- v2 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr)), *(*int8)(unsafe.Pointer(ptr + 1)))
- }
- switch v2 {
- case int32(_BT_LEAD2):
- if state == 0 {
- if nAtts < attsMax {
- (*(*TATTRIBUTE)(unsafe.Pointer(atts + uintptr(nAtts)*32))).Fname = ptr
- (*(*TATTRIBUTE)(unsafe.Pointer(atts + uintptr(nAtts)*32))).Fnormalized = int8(1)
- }
- state = 1
- }
- ptr += uintptr(libc.Int32FromInt32(2) - libc.Int32FromInt32(2))
- case int32(_BT_LEAD3):
- if state == 0 {
- if nAtts < attsMax {
- (*(*TATTRIBUTE)(unsafe.Pointer(atts + uintptr(nAtts)*32))).Fname = ptr
- (*(*TATTRIBUTE)(unsafe.Pointer(atts + uintptr(nAtts)*32))).Fnormalized = int8(1)
- }
- state = 1
- }
- ptr += uintptr(libc.Int32FromInt32(3) - libc.Int32FromInt32(2))
- case int32(_BT_LEAD4):
- if state == 0 {
- if nAtts < attsMax {
- (*(*TATTRIBUTE)(unsafe.Pointer(atts + uintptr(nAtts)*32))).Fname = ptr
- (*(*TATTRIBUTE)(unsafe.Pointer(atts + uintptr(nAtts)*32))).Fnormalized = int8(1)
- }
- state = 1
- }
- ptr += uintptr(libc.Int32FromInt32(4) - libc.Int32FromInt32(2))
- case int32(_BT_NONASCII):
- fallthrough
- case int32(_BT_NMSTRT):
- fallthrough
- case int32(_BT_HEX):
- if state == 0 {
- if nAtts < attsMax {
- (*(*TATTRIBUTE)(unsafe.Pointer(atts + uintptr(nAtts)*32))).Fname = ptr
- (*(*TATTRIBUTE)(unsafe.Pointer(atts + uintptr(nAtts)*32))).Fnormalized = int8(1)
- }
- state = 1
- }
- case int32(_BT_QUOT):
- if state != 2 {
- if nAtts < attsMax {
- (*(*TATTRIBUTE)(unsafe.Pointer(atts + uintptr(nAtts)*32))).FvaluePtr = ptr + uintptr(2)
- }
- state = 2
- open = int32(_BT_QUOT)
- } else {
- if open == int32(_BT_QUOT) {
- state = 0
- if nAtts < attsMax {
- (*(*TATTRIBUTE)(unsafe.Pointer(atts + uintptr(nAtts)*32))).FvalueEnd = ptr
- }
- nAtts++
- }
- }
- case int32(_BT_APOS):
- if state != 2 {
- if nAtts < attsMax {
- (*(*TATTRIBUTE)(unsafe.Pointer(atts + uintptr(nAtts)*32))).FvaluePtr = ptr + uintptr(2)
- }
- state = 2
- open = int32(_BT_APOS)
- } else {
- if open == int32(_BT_APOS) {
- state = 0
- if nAtts < attsMax {
- (*(*TATTRIBUTE)(unsafe.Pointer(atts + uintptr(nAtts)*32))).FvalueEnd = ptr
- }
- nAtts++
- }
- }
- case int32(_BT_AMP):
- if nAtts < attsMax {
- (*(*TATTRIBUTE)(unsafe.Pointer(atts + uintptr(nAtts)*32))).Fnormalized = 0
- }
- case int32(_BT_S):
- if state == 1 {
- state = 0
- } else {
- if v9 = state == 2 && nAtts < attsMax && (*(*TATTRIBUTE)(unsafe.Pointer(atts + uintptr(nAtts)*32))).Fnormalized != 0; v9 {
- if v4 = ptr == (*(*TATTRIBUTE)(unsafe.Pointer(atts + uintptr(nAtts)*32))).FvaluePtr; !v4 {
- if int32(*(*int8)(unsafe.Pointer(ptr))) == 0 {
- v3 = int32(*(*int8)(unsafe.Pointer(ptr + 1)))
- } else {
- v3 = -int32(1)
- }
- }
- if v6 = v4 || v3 != int32(m_ASCII_SPACE1); !v6 {
- if int32(*(*int8)(unsafe.Pointer(ptr + libc.UintptrFromInt32(2)))) == 0 {
- v5 = int32(*(*int8)(unsafe.Pointer(ptr + libc.UintptrFromInt32(2) + 1)))
- } else {
- v5 = -int32(1)
- }
- }
- if v8 = v6 || v5 == int32(m_ASCII_SPACE1); !v8 {
- if int32(*(*int8)(unsafe.Pointer(ptr + libc.UintptrFromInt32(2)))) == 0 {
- v7 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr + libc.UintptrFromInt32(2) + 1)))))))
- } else {
- v7 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr + libc.UintptrFromInt32(2))), *(*int8)(unsafe.Pointer(ptr + libc.UintptrFromInt32(2) + 1)))
- }
- }
- }
- if v9 && (v8 || v7 == open) {
- (*(*TATTRIBUTE)(unsafe.Pointer(atts + uintptr(nAtts)*32))).Fnormalized = 0
- }
- }
- case int32(_BT_CR):
- fallthrough
- case int32(_BT_LF):
- /* This case ensures that the first attribute name is counted
- Apart from that we could just change state on the quote. */
- if state == 1 {
- state = 0
- } else {
- if state == 2 && nAtts < attsMax {
- (*(*TATTRIBUTE)(unsafe.Pointer(atts + uintptr(nAtts)*32))).Fnormalized = 0
- }
- }
- case int32(_BT_GT):
- fallthrough
- case int32(_BT_SOL):
- if state != 2 {
- return nAtts
- }
- default:
- break
- }
- goto _1
- _1:
- ;
- ptr += uintptr(2)
- }
- /* not reached */
- return r
- }
- func _big2_charRefNumber(tls *libc.TLS, enc uintptr, ptr uintptr) (r int32) {
- var c, c1, result, v2, v4 int32
- _, _, _, _, _ = c, c1, result, v2, v4
- result = 0
- /* skip &# */
- _ = enc
- ptr += uintptr(libc.Int32FromInt32(2) * libc.Int32FromInt32(2))
- if int32(*(*int8)(unsafe.Pointer(ptr))) == 0 && int32(*(*int8)(unsafe.Pointer(ptr + 1))) == int32(m_ASCII_x2) {
- ptr += uintptr(2)
- for {
- if !!(int32(*(*int8)(unsafe.Pointer(ptr))) == 0 && int32(*(*int8)(unsafe.Pointer(ptr + 1))) == int32(m_ASCII_SEMI1)) {
- break
- }
- if int32(*(*int8)(unsafe.Pointer(ptr))) == 0 {
- v2 = int32(*(*int8)(unsafe.Pointer(ptr + 1)))
- } else {
- v2 = -int32(1)
- }
- c = v2
- switch c {
- case int32(m_ASCII_02):
- fallthrough
- case int32(m_ASCII_12):
- fallthrough
- case int32(m_ASCII_22):
- fallthrough
- case int32(m_ASCII_32):
- fallthrough
- case int32(m_ASCII_41):
- fallthrough
- case int32(m_ASCII_51):
- fallthrough
- case int32(m_ASCII_61):
- fallthrough
- case int32(m_ASCII_71):
- fallthrough
- case int32(m_ASCII_82):
- fallthrough
- case int32(m_ASCII_92):
- result <<= int32(4)
- result |= c - int32(m_ASCII_02)
- case int32(m_ASCII_A):
- fallthrough
- case int32(m_ASCII_B1):
- fallthrough
- case int32(m_ASCII_C):
- fallthrough
- case int32(m_ASCII_D):
- fallthrough
- case int32(m_ASCII_E):
- fallthrough
- case int32(m_ASCII_F):
- result <<= int32(4)
- result += int32(10) + (c - int32(m_ASCII_A))
- case int32(m_ASCII_a2):
- fallthrough
- case int32(m_ASCII_b1):
- fallthrough
- case int32(m_ASCII_c2):
- fallthrough
- case int32(m_ASCII_d1):
- fallthrough
- case int32(m_ASCII_e2):
- fallthrough
- case int32(m_ASCII_f1):
- result <<= int32(4)
- result += int32(10) + (c - int32(m_ASCII_a2))
- break
- }
- if result >= int32(0x110000) {
- return -int32(1)
- }
- goto _1
- _1:
- ;
- ptr += uintptr(2)
- }
- } else {
- for {
- if !!(int32(*(*int8)(unsafe.Pointer(ptr))) == 0 && int32(*(*int8)(unsafe.Pointer(ptr + 1))) == int32(m_ASCII_SEMI1)) {
- break
- }
- if int32(*(*int8)(unsafe.Pointer(ptr))) == 0 {
- v4 = int32(*(*int8)(unsafe.Pointer(ptr + 1)))
- } else {
- v4 = -int32(1)
- }
- c1 = v4
- result *= int32(10)
- result += c1 - int32(m_ASCII_02)
- if result >= int32(0x110000) {
- return -int32(1)
- }
- goto _3
- _3:
- ;
- ptr += uintptr(2)
- }
- }
- return _checkCharRefNumber(tls, result)
- }
- func _big2_predefinedEntityName(tls *libc.TLS, enc uintptr, ptr uintptr, end uintptr) (r int32) {
- var v1, v2 int32
- _, _ = v1, v2
- _ = enc
- switch (int64(end) - int64(ptr)) / libc.Int64FromInt32(2) {
- case int64(2):
- if int32(*(*int8)(unsafe.Pointer(ptr + libc.UintptrFromInt32(2)))) == 0 && int32(*(*int8)(unsafe.Pointer(ptr + libc.UintptrFromInt32(2) + 1))) == int32(m_ASCII_t2) {
- if int32(*(*int8)(unsafe.Pointer(ptr))) == 0 {
- v1 = int32(*(*int8)(unsafe.Pointer(ptr + 1)))
- } else {
- v1 = -int32(1)
- }
- switch v1 {
- case int32(m_ASCII_l2):
- return int32(m_ASCII_LT1)
- case int32(m_ASCII_g2):
- return int32(m_ASCII_GT1)
- }
- }
- case int64(3):
- if int32(*(*int8)(unsafe.Pointer(ptr))) == 0 && int32(*(*int8)(unsafe.Pointer(ptr + 1))) == int32(m_ASCII_a2) {
- ptr += uintptr(2)
- if int32(*(*int8)(unsafe.Pointer(ptr))) == 0 && int32(*(*int8)(unsafe.Pointer(ptr + 1))) == int32(m_ASCII_m2) {
- ptr += uintptr(2)
- if int32(*(*int8)(unsafe.Pointer(ptr))) == 0 && int32(*(*int8)(unsafe.Pointer(ptr + 1))) == int32(m_ASCII_p2) {
- return int32(m_ASCII_AMP1)
- }
- }
- }
- case int64(4):
- if int32(*(*int8)(unsafe.Pointer(ptr))) == 0 {
- v2 = int32(*(*int8)(unsafe.Pointer(ptr + 1)))
- } else {
- v2 = -int32(1)
- }
- switch v2 {
- case int32(m_ASCII_q1):
- ptr += uintptr(2)
- if int32(*(*int8)(unsafe.Pointer(ptr))) == 0 && int32(*(*int8)(unsafe.Pointer(ptr + 1))) == int32(m_ASCII_u1) {
- ptr += uintptr(2)
- if int32(*(*int8)(unsafe.Pointer(ptr))) == 0 && int32(*(*int8)(unsafe.Pointer(ptr + 1))) == int32(m_ASCII_o2) {
- ptr += uintptr(2)
- if int32(*(*int8)(unsafe.Pointer(ptr))) == 0 && int32(*(*int8)(unsafe.Pointer(ptr + 1))) == int32(m_ASCII_t2) {
- return int32(m_ASCII_QUOT1)
- }
- }
- }
- case int32(m_ASCII_a2):
- ptr += uintptr(2)
- if int32(*(*int8)(unsafe.Pointer(ptr))) == 0 && int32(*(*int8)(unsafe.Pointer(ptr + 1))) == int32(m_ASCII_p2) {
- ptr += uintptr(2)
- if int32(*(*int8)(unsafe.Pointer(ptr))) == 0 && int32(*(*int8)(unsafe.Pointer(ptr + 1))) == int32(m_ASCII_o2) {
- ptr += uintptr(2)
- if int32(*(*int8)(unsafe.Pointer(ptr))) == 0 && int32(*(*int8)(unsafe.Pointer(ptr + 1))) == int32(m_ASCII_s2) {
- return int32(m_ASCII_APOS1)
- }
- }
- }
- break
- }
- }
- return 0
- }
- func _big2_nameMatchesAscii(tls *libc.TLS, enc uintptr, ptr1 uintptr, end1 uintptr, ptr2 uintptr) (r int32) {
- _ = enc
- for {
- if !(*(*int8)(unsafe.Pointer(ptr2)) != 0) {
- break
- }
- if int64(end1)-int64(ptr1) < int64(2) {
- /* This line cannot be executed. The incoming data has already
- * been tokenized once, so incomplete characters like this have
- * already been eliminated from the input. Retaining the
- * paranoia check is still valuable, however.
- */
- return 0 /* LCOV_EXCL_LINE */
- }
- if !(int32(*(*int8)(unsafe.Pointer(ptr1))) == 0 && int32(*(*int8)(unsafe.Pointer(ptr1 + 1))) == int32(*(*int8)(unsafe.Pointer(ptr2)))) {
- return 0
- }
- goto _1
- _1:
- ;
- ptr1 += uintptr(2)
- ptr2++
- }
- return libc.BoolInt32(ptr1 == end1)
- }
- func _big2_nameLength(tls *libc.TLS, enc uintptr, ptr uintptr) (r int32) {
- var start uintptr
- var v2 int32
- _, _ = start, v2
- start = ptr
- for {
- if int32(*(*int8)(unsafe.Pointer(ptr))) == 0 {
- v2 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr + 1)))))))
- } else {
- v2 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr)), *(*int8)(unsafe.Pointer(ptr + 1)))
- }
- switch v2 {
- case int32(_BT_LEAD2):
- ptr += uintptr(2) /* NOTE: The encoding has already been validated. */
- case int32(_BT_LEAD3):
- ptr += uintptr(3) /* NOTE: The encoding has already been validated. */
- case int32(_BT_LEAD4):
- ptr += uintptr(4) /* NOTE: The encoding has already been validated. */
- case int32(_BT_NONASCII):
- fallthrough
- case int32(_BT_NMSTRT):
- fallthrough
- case int32(_BT_COLON):
- fallthrough
- case int32(_BT_HEX):
- fallthrough
- case int32(_BT_DIGIT):
- fallthrough
- case int32(_BT_NAME):
- fallthrough
- case int32(_BT_MINUS):
- ptr += uintptr(2)
- default:
- return int32(int64(ptr) - int64(start))
- }
- goto _1
- _1:
- }
- return r
- }
- func _big2_skipS(tls *libc.TLS, enc uintptr, ptr uintptr) (r uintptr) {
- var v2 int32
- _ = v2
- for {
- if int32(*(*int8)(unsafe.Pointer(ptr))) == 0 {
- v2 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr + 1)))))))
- } else {
- v2 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr)), *(*int8)(unsafe.Pointer(ptr + 1)))
- }
- switch v2 {
- case int32(_BT_LF):
- fallthrough
- case int32(_BT_CR):
- fallthrough
- case int32(_BT_S):
- ptr += uintptr(2)
- default:
- return ptr
- }
- goto _1
- _1:
- }
- return r
- }
- func _big2_updatePosition(tls *libc.TLS, enc uintptr, ptr uintptr, end uintptr, pos uintptr) {
- var v1, v2 int32
- var v3 bool
- _, _, _ = v1, v2, v3
- for int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2)) {
- if int32(*(*int8)(unsafe.Pointer(ptr))) == 0 {
- v1 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr + 1)))))))
- } else {
- v1 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr)), *(*int8)(unsafe.Pointer(ptr + 1)))
- }
- switch v1 {
- case int32(_BT_LEAD2):
- ptr += uintptr(2) /* NOTE: The encoding has already been validated. */
- (*TPOSITION)(unsafe.Pointer(pos)).FcolumnNumber++
- case int32(_BT_LEAD3):
- ptr += uintptr(3) /* NOTE: The encoding has already been validated. */
- (*TPOSITION)(unsafe.Pointer(pos)).FcolumnNumber++
- case int32(_BT_LEAD4):
- ptr += uintptr(4) /* NOTE: The encoding has already been validated. */
- (*TPOSITION)(unsafe.Pointer(pos)).FcolumnNumber++
- case int32(_BT_LF):
- (*TPOSITION)(unsafe.Pointer(pos)).FcolumnNumber = uint64(0)
- (*TPOSITION)(unsafe.Pointer(pos)).FlineNumber++
- ptr += uintptr(2)
- case int32(_BT_CR):
- (*TPOSITION)(unsafe.Pointer(pos)).FlineNumber++
- ptr += uintptr(2)
- if v3 = int64(end)-int64(ptr) >= int64(libc.Int32FromInt32(1)*libc.Int32FromInt32(2)); v3 {
- if int32(*(*int8)(unsafe.Pointer(ptr))) == 0 {
- v2 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(enc + 136 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr + 1)))))))
- } else {
- v2 = _unicode_byte_type(tls, *(*int8)(unsafe.Pointer(ptr)), *(*int8)(unsafe.Pointer(ptr + 1)))
- }
- }
- if v3 && v2 == int32(_BT_LF) {
- ptr += uintptr(2)
- }
- (*TPOSITION)(unsafe.Pointer(pos)).FcolumnNumber = uint64(0)
- default:
- ptr += uintptr(2)
- (*TPOSITION)(unsafe.Pointer(pos)).FcolumnNumber++
- break
- }
- }
- }
- var _big2_encoding_ns = Tnormal_encoding{
- Fenc: TENCODING{
- Fscanners: [4]TSCANNER{},
- FliteralScanners: [2]TSCANNER{},
- FminBytesPerChar: int32(2),
- },
- Ftype1: [256]uint8{
- 9: uint8(_BT_S),
- 10: uint8(_BT_LF),
- 13: uint8(_BT_CR),
- 32: uint8(_BT_S),
- 33: uint8(_BT_EXCL),
- 34: uint8(_BT_QUOT),
- 35: uint8(_BT_NUM),
- 36: uint8(_BT_OTHER),
- 37: uint8(_BT_PERCNT),
- 38: uint8(_BT_AMP),
- 39: uint8(_BT_APOS),
- 40: uint8(_BT_LPAR),
- 41: uint8(_BT_RPAR),
- 42: uint8(_BT_AST),
- 43: uint8(_BT_PLUS),
- 44: uint8(_BT_COMMA),
- 45: uint8(_BT_MINUS),
- 46: uint8(_BT_NAME),
- 47: uint8(_BT_SOL),
- 48: uint8(_BT_DIGIT),
- 49: uint8(_BT_DIGIT),
- 50: uint8(_BT_DIGIT),
- 51: uint8(_BT_DIGIT),
- 52: uint8(_BT_DIGIT),
- 53: uint8(_BT_DIGIT),
- 54: uint8(_BT_DIGIT),
- 55: uint8(_BT_DIGIT),
- 56: uint8(_BT_DIGIT),
- 57: uint8(_BT_DIGIT),
- 58: uint8(_BT_COLON),
- 59: uint8(_BT_SEMI),
- 60: uint8(_BT_LT),
- 61: uint8(_BT_EQUALS),
- 62: uint8(_BT_GT),
- 63: uint8(_BT_QUEST),
- 64: uint8(_BT_OTHER),
- 65: uint8(_BT_HEX),
- 66: uint8(_BT_HEX),
- 67: uint8(_BT_HEX),
- 68: uint8(_BT_HEX),
- 69: uint8(_BT_HEX),
- 70: uint8(_BT_HEX),
- 71: uint8(_BT_NMSTRT),
- 72: uint8(_BT_NMSTRT),
- 73: uint8(_BT_NMSTRT),
- 74: uint8(_BT_NMSTRT),
- 75: uint8(_BT_NMSTRT),
- 76: uint8(_BT_NMSTRT),
- 77: uint8(_BT_NMSTRT),
- 78: uint8(_BT_NMSTRT),
- 79: uint8(_BT_NMSTRT),
- 80: uint8(_BT_NMSTRT),
- 81: uint8(_BT_NMSTRT),
- 82: uint8(_BT_NMSTRT),
- 83: uint8(_BT_NMSTRT),
- 84: uint8(_BT_NMSTRT),
- 85: uint8(_BT_NMSTRT),
- 86: uint8(_BT_NMSTRT),
- 87: uint8(_BT_NMSTRT),
- 88: uint8(_BT_NMSTRT),
- 89: uint8(_BT_NMSTRT),
- 90: uint8(_BT_NMSTRT),
- 91: uint8(_BT_LSQB),
- 92: uint8(_BT_OTHER),
- 93: uint8(_BT_RSQB),
- 94: uint8(_BT_OTHER),
- 95: uint8(_BT_NMSTRT),
- 96: uint8(_BT_OTHER),
- 97: uint8(_BT_HEX),
- 98: uint8(_BT_HEX),
- 99: uint8(_BT_HEX),
- 100: uint8(_BT_HEX),
- 101: uint8(_BT_HEX),
- 102: uint8(_BT_HEX),
- 103: uint8(_BT_NMSTRT),
- 104: uint8(_BT_NMSTRT),
- 105: uint8(_BT_NMSTRT),
- 106: uint8(_BT_NMSTRT),
- 107: uint8(_BT_NMSTRT),
- 108: uint8(_BT_NMSTRT),
- 109: uint8(_BT_NMSTRT),
- 110: uint8(_BT_NMSTRT),
- 111: uint8(_BT_NMSTRT),
- 112: uint8(_BT_NMSTRT),
- 113: uint8(_BT_NMSTRT),
- 114: uint8(_BT_NMSTRT),
- 115: uint8(_BT_NMSTRT),
- 116: uint8(_BT_NMSTRT),
- 117: uint8(_BT_NMSTRT),
- 118: uint8(_BT_NMSTRT),
- 119: uint8(_BT_NMSTRT),
- 120: uint8(_BT_NMSTRT),
- 121: uint8(_BT_NMSTRT),
- 122: uint8(_BT_NMSTRT),
- 123: uint8(_BT_OTHER),
- 124: uint8(_BT_VERBAR),
- 125: uint8(_BT_OTHER),
- 126: uint8(_BT_OTHER),
- 127: uint8(_BT_OTHER),
- 128: uint8(_BT_OTHER),
- 129: uint8(_BT_OTHER),
- 130: uint8(_BT_OTHER),
- 131: uint8(_BT_OTHER),
- 132: uint8(_BT_OTHER),
- 133: uint8(_BT_OTHER),
- 134: uint8(_BT_OTHER),
- 135: uint8(_BT_OTHER),
- 136: uint8(_BT_OTHER),
- 137: uint8(_BT_OTHER),
- 138: uint8(_BT_OTHER),
- 139: uint8(_BT_OTHER),
- 140: uint8(_BT_OTHER),
- 141: uint8(_BT_OTHER),
- 142: uint8(_BT_OTHER),
- 143: uint8(_BT_OTHER),
- 144: uint8(_BT_OTHER),
- 145: uint8(_BT_OTHER),
- 146: uint8(_BT_OTHER),
- 147: uint8(_BT_OTHER),
- 148: uint8(_BT_OTHER),
- 149: uint8(_BT_OTHER),
- 150: uint8(_BT_OTHER),
- 151: uint8(_BT_OTHER),
- 152: uint8(_BT_OTHER),
- 153: uint8(_BT_OTHER),
- 154: uint8(_BT_OTHER),
- 155: uint8(_BT_OTHER),
- 156: uint8(_BT_OTHER),
- 157: uint8(_BT_OTHER),
- 158: uint8(_BT_OTHER),
- 159: uint8(_BT_OTHER),
- 160: uint8(_BT_OTHER),
- 161: uint8(_BT_OTHER),
- 162: uint8(_BT_OTHER),
- 163: uint8(_BT_OTHER),
- 164: uint8(_BT_OTHER),
- 165: uint8(_BT_OTHER),
- 166: uint8(_BT_OTHER),
- 167: uint8(_BT_OTHER),
- 168: uint8(_BT_OTHER),
- 169: uint8(_BT_OTHER),
- 170: uint8(_BT_NMSTRT),
- 171: uint8(_BT_OTHER),
- 172: uint8(_BT_OTHER),
- 173: uint8(_BT_OTHER),
- 174: uint8(_BT_OTHER),
- 175: uint8(_BT_OTHER),
- 176: uint8(_BT_OTHER),
- 177: uint8(_BT_OTHER),
- 178: uint8(_BT_OTHER),
- 179: uint8(_BT_OTHER),
- 180: uint8(_BT_OTHER),
- 181: uint8(_BT_NMSTRT),
- 182: uint8(_BT_OTHER),
- 183: uint8(_BT_NAME),
- 184: uint8(_BT_OTHER),
- 185: uint8(_BT_OTHER),
- 186: uint8(_BT_NMSTRT),
- 187: uint8(_BT_OTHER),
- 188: uint8(_BT_OTHER),
- 189: uint8(_BT_OTHER),
- 190: uint8(_BT_OTHER),
- 191: uint8(_BT_OTHER),
- 192: uint8(_BT_NMSTRT),
- 193: uint8(_BT_NMSTRT),
- 194: uint8(_BT_NMSTRT),
- 195: uint8(_BT_NMSTRT),
- 196: uint8(_BT_NMSTRT),
- 197: uint8(_BT_NMSTRT),
- 198: uint8(_BT_NMSTRT),
- 199: uint8(_BT_NMSTRT),
- 200: uint8(_BT_NMSTRT),
- 201: uint8(_BT_NMSTRT),
- 202: uint8(_BT_NMSTRT),
- 203: uint8(_BT_NMSTRT),
- 204: uint8(_BT_NMSTRT),
- 205: uint8(_BT_NMSTRT),
- 206: uint8(_BT_NMSTRT),
- 207: uint8(_BT_NMSTRT),
- 208: uint8(_BT_NMSTRT),
- 209: uint8(_BT_NMSTRT),
- 210: uint8(_BT_NMSTRT),
- 211: uint8(_BT_NMSTRT),
- 212: uint8(_BT_NMSTRT),
- 213: uint8(_BT_NMSTRT),
- 214: uint8(_BT_NMSTRT),
- 215: uint8(_BT_OTHER),
- 216: uint8(_BT_NMSTRT),
- 217: uint8(_BT_NMSTRT),
- 218: uint8(_BT_NMSTRT),
- 219: uint8(_BT_NMSTRT),
- 220: uint8(_BT_NMSTRT),
- 221: uint8(_BT_NMSTRT),
- 222: uint8(_BT_NMSTRT),
- 223: uint8(_BT_NMSTRT),
- 224: uint8(_BT_NMSTRT),
- 225: uint8(_BT_NMSTRT),
- 226: uint8(_BT_NMSTRT),
- 227: uint8(_BT_NMSTRT),
- 228: uint8(_BT_NMSTRT),
- 229: uint8(_BT_NMSTRT),
- 230: uint8(_BT_NMSTRT),
- 231: uint8(_BT_NMSTRT),
- 232: uint8(_BT_NMSTRT),
- 233: uint8(_BT_NMSTRT),
- 234: uint8(_BT_NMSTRT),
- 235: uint8(_BT_NMSTRT),
- 236: uint8(_BT_NMSTRT),
- 237: uint8(_BT_NMSTRT),
- 238: uint8(_BT_NMSTRT),
- 239: uint8(_BT_NMSTRT),
- 240: uint8(_BT_NMSTRT),
- 241: uint8(_BT_NMSTRT),
- 242: uint8(_BT_NMSTRT),
- 243: uint8(_BT_NMSTRT),
- 244: uint8(_BT_NMSTRT),
- 245: uint8(_BT_NMSTRT),
- 246: uint8(_BT_NMSTRT),
- 247: uint8(_BT_OTHER),
- 248: uint8(_BT_NMSTRT),
- 249: uint8(_BT_NMSTRT),
- 250: uint8(_BT_NMSTRT),
- 251: uint8(_BT_NMSTRT),
- 252: uint8(_BT_NMSTRT),
- 253: uint8(_BT_NMSTRT),
- 254: uint8(_BT_NMSTRT),
- 255: uint8(_BT_NMSTRT),
- },
- }
- func init() {
- p := unsafe.Pointer(&_big2_encoding_ns)
- *(*uintptr)(unsafe.Add(p, 0)) = __ccgo_fp(_big2_prologTok)
- *(*uintptr)(unsafe.Add(p, 8)) = __ccgo_fp(_big2_contentTok)
- *(*uintptr)(unsafe.Add(p, 16)) = __ccgo_fp(_big2_cdataSectionTok)
- *(*uintptr)(unsafe.Add(p, 24)) = __ccgo_fp(_big2_ignoreSectionTok)
- *(*uintptr)(unsafe.Add(p, 32)) = __ccgo_fp(_big2_attributeValueTok)
- *(*uintptr)(unsafe.Add(p, 40)) = __ccgo_fp(_big2_entityValueTok)
- *(*uintptr)(unsafe.Add(p, 48)) = __ccgo_fp(_big2_nameMatchesAscii)
- *(*uintptr)(unsafe.Add(p, 56)) = __ccgo_fp(_big2_nameLength)
- *(*uintptr)(unsafe.Add(p, 64)) = __ccgo_fp(_big2_skipS)
- *(*uintptr)(unsafe.Add(p, 72)) = __ccgo_fp(_big2_getAtts)
- *(*uintptr)(unsafe.Add(p, 80)) = __ccgo_fp(_big2_charRefNumber)
- *(*uintptr)(unsafe.Add(p, 88)) = __ccgo_fp(_big2_predefinedEntityName)
- *(*uintptr)(unsafe.Add(p, 96)) = __ccgo_fp(_big2_updatePosition)
- *(*uintptr)(unsafe.Add(p, 104)) = __ccgo_fp(_big2_isPublicId)
- *(*uintptr)(unsafe.Add(p, 112)) = __ccgo_fp(_big2_toUtf8)
- *(*uintptr)(unsafe.Add(p, 120)) = __ccgo_fp(_big2_toUtf16)
- }
- var _big2_encoding = Tnormal_encoding{
- Fenc: TENCODING{
- Fscanners: [4]TSCANNER{},
- FliteralScanners: [2]TSCANNER{},
- FminBytesPerChar: int32(2),
- },
- Ftype1: [256]uint8{
- 9: uint8(_BT_S),
- 10: uint8(_BT_LF),
- 13: uint8(_BT_CR),
- 32: uint8(_BT_S),
- 33: uint8(_BT_EXCL),
- 34: uint8(_BT_QUOT),
- 35: uint8(_BT_NUM),
- 36: uint8(_BT_OTHER),
- 37: uint8(_BT_PERCNT),
- 38: uint8(_BT_AMP),
- 39: uint8(_BT_APOS),
- 40: uint8(_BT_LPAR),
- 41: uint8(_BT_RPAR),
- 42: uint8(_BT_AST),
- 43: uint8(_BT_PLUS),
- 44: uint8(_BT_COMMA),
- 45: uint8(_BT_MINUS),
- 46: uint8(_BT_NAME),
- 47: uint8(_BT_SOL),
- 48: uint8(_BT_DIGIT),
- 49: uint8(_BT_DIGIT),
- 50: uint8(_BT_DIGIT),
- 51: uint8(_BT_DIGIT),
- 52: uint8(_BT_DIGIT),
- 53: uint8(_BT_DIGIT),
- 54: uint8(_BT_DIGIT),
- 55: uint8(_BT_DIGIT),
- 56: uint8(_BT_DIGIT),
- 57: uint8(_BT_DIGIT),
- 58: uint8(_BT_NMSTRT),
- 59: uint8(_BT_SEMI),
- 60: uint8(_BT_LT),
- 61: uint8(_BT_EQUALS),
- 62: uint8(_BT_GT),
- 63: uint8(_BT_QUEST),
- 64: uint8(_BT_OTHER),
- 65: uint8(_BT_HEX),
- 66: uint8(_BT_HEX),
- 67: uint8(_BT_HEX),
- 68: uint8(_BT_HEX),
- 69: uint8(_BT_HEX),
- 70: uint8(_BT_HEX),
- 71: uint8(_BT_NMSTRT),
- 72: uint8(_BT_NMSTRT),
- 73: uint8(_BT_NMSTRT),
- 74: uint8(_BT_NMSTRT),
- 75: uint8(_BT_NMSTRT),
- 76: uint8(_BT_NMSTRT),
- 77: uint8(_BT_NMSTRT),
- 78: uint8(_BT_NMSTRT),
- 79: uint8(_BT_NMSTRT),
- 80: uint8(_BT_NMSTRT),
- 81: uint8(_BT_NMSTRT),
- 82: uint8(_BT_NMSTRT),
- 83: uint8(_BT_NMSTRT),
- 84: uint8(_BT_NMSTRT),
- 85: uint8(_BT_NMSTRT),
- 86: uint8(_BT_NMSTRT),
- 87: uint8(_BT_NMSTRT),
- 88: uint8(_BT_NMSTRT),
- 89: uint8(_BT_NMSTRT),
- 90: uint8(_BT_NMSTRT),
- 91: uint8(_BT_LSQB),
- 92: uint8(_BT_OTHER),
- 93: uint8(_BT_RSQB),
- 94: uint8(_BT_OTHER),
- 95: uint8(_BT_NMSTRT),
- 96: uint8(_BT_OTHER),
- 97: uint8(_BT_HEX),
- 98: uint8(_BT_HEX),
- 99: uint8(_BT_HEX),
- 100: uint8(_BT_HEX),
- 101: uint8(_BT_HEX),
- 102: uint8(_BT_HEX),
- 103: uint8(_BT_NMSTRT),
- 104: uint8(_BT_NMSTRT),
- 105: uint8(_BT_NMSTRT),
- 106: uint8(_BT_NMSTRT),
- 107: uint8(_BT_NMSTRT),
- 108: uint8(_BT_NMSTRT),
- 109: uint8(_BT_NMSTRT),
- 110: uint8(_BT_NMSTRT),
- 111: uint8(_BT_NMSTRT),
- 112: uint8(_BT_NMSTRT),
- 113: uint8(_BT_NMSTRT),
- 114: uint8(_BT_NMSTRT),
- 115: uint8(_BT_NMSTRT),
- 116: uint8(_BT_NMSTRT),
- 117: uint8(_BT_NMSTRT),
- 118: uint8(_BT_NMSTRT),
- 119: uint8(_BT_NMSTRT),
- 120: uint8(_BT_NMSTRT),
- 121: uint8(_BT_NMSTRT),
- 122: uint8(_BT_NMSTRT),
- 123: uint8(_BT_OTHER),
- 124: uint8(_BT_VERBAR),
- 125: uint8(_BT_OTHER),
- 126: uint8(_BT_OTHER),
- 127: uint8(_BT_OTHER),
- 128: uint8(_BT_OTHER),
- 129: uint8(_BT_OTHER),
- 130: uint8(_BT_OTHER),
- 131: uint8(_BT_OTHER),
- 132: uint8(_BT_OTHER),
- 133: uint8(_BT_OTHER),
- 134: uint8(_BT_OTHER),
- 135: uint8(_BT_OTHER),
- 136: uint8(_BT_OTHER),
- 137: uint8(_BT_OTHER),
- 138: uint8(_BT_OTHER),
- 139: uint8(_BT_OTHER),
- 140: uint8(_BT_OTHER),
- 141: uint8(_BT_OTHER),
- 142: uint8(_BT_OTHER),
- 143: uint8(_BT_OTHER),
- 144: uint8(_BT_OTHER),
- 145: uint8(_BT_OTHER),
- 146: uint8(_BT_OTHER),
- 147: uint8(_BT_OTHER),
- 148: uint8(_BT_OTHER),
- 149: uint8(_BT_OTHER),
- 150: uint8(_BT_OTHER),
- 151: uint8(_BT_OTHER),
- 152: uint8(_BT_OTHER),
- 153: uint8(_BT_OTHER),
- 154: uint8(_BT_OTHER),
- 155: uint8(_BT_OTHER),
- 156: uint8(_BT_OTHER),
- 157: uint8(_BT_OTHER),
- 158: uint8(_BT_OTHER),
- 159: uint8(_BT_OTHER),
- 160: uint8(_BT_OTHER),
- 161: uint8(_BT_OTHER),
- 162: uint8(_BT_OTHER),
- 163: uint8(_BT_OTHER),
- 164: uint8(_BT_OTHER),
- 165: uint8(_BT_OTHER),
- 166: uint8(_BT_OTHER),
- 167: uint8(_BT_OTHER),
- 168: uint8(_BT_OTHER),
- 169: uint8(_BT_OTHER),
- 170: uint8(_BT_NMSTRT),
- 171: uint8(_BT_OTHER),
- 172: uint8(_BT_OTHER),
- 173: uint8(_BT_OTHER),
- 174: uint8(_BT_OTHER),
- 175: uint8(_BT_OTHER),
- 176: uint8(_BT_OTHER),
- 177: uint8(_BT_OTHER),
- 178: uint8(_BT_OTHER),
- 179: uint8(_BT_OTHER),
- 180: uint8(_BT_OTHER),
- 181: uint8(_BT_NMSTRT),
- 182: uint8(_BT_OTHER),
- 183: uint8(_BT_NAME),
- 184: uint8(_BT_OTHER),
- 185: uint8(_BT_OTHER),
- 186: uint8(_BT_NMSTRT),
- 187: uint8(_BT_OTHER),
- 188: uint8(_BT_OTHER),
- 189: uint8(_BT_OTHER),
- 190: uint8(_BT_OTHER),
- 191: uint8(_BT_OTHER),
- 192: uint8(_BT_NMSTRT),
- 193: uint8(_BT_NMSTRT),
- 194: uint8(_BT_NMSTRT),
- 195: uint8(_BT_NMSTRT),
- 196: uint8(_BT_NMSTRT),
- 197: uint8(_BT_NMSTRT),
- 198: uint8(_BT_NMSTRT),
- 199: uint8(_BT_NMSTRT),
- 200: uint8(_BT_NMSTRT),
- 201: uint8(_BT_NMSTRT),
- 202: uint8(_BT_NMSTRT),
- 203: uint8(_BT_NMSTRT),
- 204: uint8(_BT_NMSTRT),
- 205: uint8(_BT_NMSTRT),
- 206: uint8(_BT_NMSTRT),
- 207: uint8(_BT_NMSTRT),
- 208: uint8(_BT_NMSTRT),
- 209: uint8(_BT_NMSTRT),
- 210: uint8(_BT_NMSTRT),
- 211: uint8(_BT_NMSTRT),
- 212: uint8(_BT_NMSTRT),
- 213: uint8(_BT_NMSTRT),
- 214: uint8(_BT_NMSTRT),
- 215: uint8(_BT_OTHER),
- 216: uint8(_BT_NMSTRT),
- 217: uint8(_BT_NMSTRT),
- 218: uint8(_BT_NMSTRT),
- 219: uint8(_BT_NMSTRT),
- 220: uint8(_BT_NMSTRT),
- 221: uint8(_BT_NMSTRT),
- 222: uint8(_BT_NMSTRT),
- 223: uint8(_BT_NMSTRT),
- 224: uint8(_BT_NMSTRT),
- 225: uint8(_BT_NMSTRT),
- 226: uint8(_BT_NMSTRT),
- 227: uint8(_BT_NMSTRT),
- 228: uint8(_BT_NMSTRT),
- 229: uint8(_BT_NMSTRT),
- 230: uint8(_BT_NMSTRT),
- 231: uint8(_BT_NMSTRT),
- 232: uint8(_BT_NMSTRT),
- 233: uint8(_BT_NMSTRT),
- 234: uint8(_BT_NMSTRT),
- 235: uint8(_BT_NMSTRT),
- 236: uint8(_BT_NMSTRT),
- 237: uint8(_BT_NMSTRT),
- 238: uint8(_BT_NMSTRT),
- 239: uint8(_BT_NMSTRT),
- 240: uint8(_BT_NMSTRT),
- 241: uint8(_BT_NMSTRT),
- 242: uint8(_BT_NMSTRT),
- 243: uint8(_BT_NMSTRT),
- 244: uint8(_BT_NMSTRT),
- 245: uint8(_BT_NMSTRT),
- 246: uint8(_BT_NMSTRT),
- 247: uint8(_BT_OTHER),
- 248: uint8(_BT_NMSTRT),
- 249: uint8(_BT_NMSTRT),
- 250: uint8(_BT_NMSTRT),
- 251: uint8(_BT_NMSTRT),
- 252: uint8(_BT_NMSTRT),
- 253: uint8(_BT_NMSTRT),
- 254: uint8(_BT_NMSTRT),
- 255: uint8(_BT_NMSTRT),
- },
- }
- func init() {
- p := unsafe.Pointer(&_big2_encoding)
- *(*uintptr)(unsafe.Add(p, 0)) = __ccgo_fp(_big2_prologTok)
- *(*uintptr)(unsafe.Add(p, 8)) = __ccgo_fp(_big2_contentTok)
- *(*uintptr)(unsafe.Add(p, 16)) = __ccgo_fp(_big2_cdataSectionTok)
- *(*uintptr)(unsafe.Add(p, 24)) = __ccgo_fp(_big2_ignoreSectionTok)
- *(*uintptr)(unsafe.Add(p, 32)) = __ccgo_fp(_big2_attributeValueTok)
- *(*uintptr)(unsafe.Add(p, 40)) = __ccgo_fp(_big2_entityValueTok)
- *(*uintptr)(unsafe.Add(p, 48)) = __ccgo_fp(_big2_nameMatchesAscii)
- *(*uintptr)(unsafe.Add(p, 56)) = __ccgo_fp(_big2_nameLength)
- *(*uintptr)(unsafe.Add(p, 64)) = __ccgo_fp(_big2_skipS)
- *(*uintptr)(unsafe.Add(p, 72)) = __ccgo_fp(_big2_getAtts)
- *(*uintptr)(unsafe.Add(p, 80)) = __ccgo_fp(_big2_charRefNumber)
- *(*uintptr)(unsafe.Add(p, 88)) = __ccgo_fp(_big2_predefinedEntityName)
- *(*uintptr)(unsafe.Add(p, 96)) = __ccgo_fp(_big2_updatePosition)
- *(*uintptr)(unsafe.Add(p, 104)) = __ccgo_fp(_big2_isPublicId)
- *(*uintptr)(unsafe.Add(p, 112)) = __ccgo_fp(_big2_toUtf8)
- *(*uintptr)(unsafe.Add(p, 120)) = __ccgo_fp(_big2_toUtf16)
- }
- func _streqci(tls *libc.TLS, s1 uintptr, s2 uintptr) (r int32) {
- var c1, c2 int8
- var v2, v3 uintptr
- _, _, _, _ = c1, c2, v2, v3
- for {
- v2 = s1
- s1++
- c1 = *(*int8)(unsafe.Pointer(v2))
- v3 = s2
- s2++
- c2 = *(*int8)(unsafe.Pointer(v3))
- if int32(m_ASCII_a2) <= int32(c1) && int32(c1) <= int32(m_ASCII_z1) {
- c1 = int8(int32(c1) + (libc.Int32FromInt32(m_ASCII_A) - libc.Int32FromInt32(m_ASCII_a2)))
- }
- if int32(m_ASCII_a2) <= int32(c2) && int32(c2) <= int32(m_ASCII_z1) {
- /* The following line will never get executed. streqci() is
- * only called from two places, both of which guarantee to put
- * upper-case strings into s2.
- */
- c2 = int8(int32(c2) + (libc.Int32FromInt32(m_ASCII_A) - libc.Int32FromInt32(m_ASCII_a2)))
- } /* LCOV_EXCL_LINE */
- if int32(c1) != int32(c2) {
- return 0
- }
- if !(c1 != 0) {
- break
- }
- goto _1
- _1:
- }
- return int32(1)
- }
- func _initUpdatePosition(tls *libc.TLS, enc uintptr, ptr uintptr, end uintptr, pos uintptr) {
- _ = enc
- _normal_updatePosition(tls, uintptr(unsafe.Pointer(&_utf8_encoding)), ptr, end, pos)
- }
- func _toAscii(tls *libc.TLS, enc uintptr, _ptr uintptr, end uintptr) (r int32) {
- bp := tls.Alloc(32)
- defer tls.Free(32)
- *(*uintptr)(unsafe.Pointer(bp)) = _ptr
- var _ /* buf at bp+8 */ [1]int8
- var _ /* p at bp+16 */ uintptr
- *(*uintptr)(unsafe.Pointer(bp + 16)) = bp + 8
- (*(*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))
- if *(*uintptr)(unsafe.Pointer(bp + 16)) == bp+8 {
- return -int32(1)
- } else {
- return int32((*(*[1]int8)(unsafe.Pointer(bp + 8)))[0])
- }
- return r
- }
- func _isSpace(tls *libc.TLS, c int32) (r int32) {
- switch c {
- case int32(0x20):
- fallthrough
- case int32(0xD):
- fallthrough
- case int32(0xA):
- fallthrough
- case int32(0x9):
- return int32(1)
- }
- return 0
- }
- // C documentation
- //
- // /* Return 1 if there's just optional white space or there's an S
- // followed by name=val.
- // */
- func _parsePseudoAttribute(tls *libc.TLS, enc uintptr, ptr uintptr, end uintptr, namePtr uintptr, nameEndPtr uintptr, valPtr uintptr, nextTokPtr uintptr) (r int32) {
- var c, v2 int32
- var open int8
- _, _, _ = c, open, v2
- if ptr == end {
- *(*uintptr)(unsafe.Pointer(namePtr)) = libc.UintptrFromInt32(0)
- return int32(1)
- }
- if !(_isSpace(tls, _toAscii(tls, enc, ptr, end)) != 0) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return 0
- }
- for cond := true; cond; cond = _isSpace(tls, _toAscii(tls, enc, ptr, end)) != 0 {
- ptr += uintptr((*TENCODING)(unsafe.Pointer(enc)).FminBytesPerChar)
- }
- if ptr == end {
- *(*uintptr)(unsafe.Pointer(namePtr)) = libc.UintptrFromInt32(0)
- return int32(1)
- }
- *(*uintptr)(unsafe.Pointer(namePtr)) = ptr
- for {
- c = _toAscii(tls, enc, ptr, end)
- if c == -int32(1) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return 0
- }
- if c == int32(m_ASCII_EQUALS2) {
- *(*uintptr)(unsafe.Pointer(nameEndPtr)) = ptr
- break
- }
- if _isSpace(tls, c) != 0 {
- *(*uintptr)(unsafe.Pointer(nameEndPtr)) = ptr
- for {
- ptr += uintptr((*TENCODING)(unsafe.Pointer(enc)).FminBytesPerChar)
- goto _3
- _3:
- ;
- v2 = _toAscii(tls, enc, ptr, end)
- c = v2
- if !(_isSpace(tls, v2) != 0) {
- break
- }
- }
- if c != int32(m_ASCII_EQUALS2) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return 0
- }
- break
- }
- ptr += uintptr((*TENCODING)(unsafe.Pointer(enc)).FminBytesPerChar)
- goto _1
- _1:
- }
- if ptr == *(*uintptr)(unsafe.Pointer(namePtr)) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return 0
- }
- ptr += uintptr((*TENCODING)(unsafe.Pointer(enc)).FminBytesPerChar)
- c = _toAscii(tls, enc, ptr, end)
- for _isSpace(tls, c) != 0 {
- ptr += uintptr((*TENCODING)(unsafe.Pointer(enc)).FminBytesPerChar)
- c = _toAscii(tls, enc, ptr, end)
- }
- if c != int32(m_ASCII_QUOT1) && c != int32(m_ASCII_APOS1) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return 0
- }
- open = int8(c)
- ptr += uintptr((*TENCODING)(unsafe.Pointer(enc)).FminBytesPerChar)
- *(*uintptr)(unsafe.Pointer(valPtr)) = ptr
- for {
- c = _toAscii(tls, enc, ptr, end)
- if c == int32(open) {
- break
- }
- 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) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr
- return 0
- }
- goto _4
- _4:
- ;
- ptr += uintptr((*TENCODING)(unsafe.Pointer(enc)).FminBytesPerChar)
- }
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr((*TENCODING)(unsafe.Pointer(enc)).FminBytesPerChar)
- return int32(1)
- }
- var _KW_version = [8]int8{
- 0: int8(m_ASCII_v1),
- 1: int8(m_ASCII_e2),
- 2: int8(m_ASCII_r2),
- 3: int8(m_ASCII_s2),
- 4: int8(m_ASCII_i1),
- 5: int8(m_ASCII_o2),
- 6: int8(m_ASCII_n2),
- }
- var _KW_encoding = [9]int8{
- 0: int8(m_ASCII_e2),
- 1: int8(m_ASCII_n2),
- 2: int8(m_ASCII_c2),
- 3: int8(m_ASCII_o2),
- 4: int8(m_ASCII_d1),
- 5: int8(m_ASCII_i1),
- 6: int8(m_ASCII_n2),
- 7: int8(m_ASCII_g2),
- }
- var _KW_standalone = [11]int8{
- 0: int8(m_ASCII_s2),
- 1: int8(m_ASCII_t2),
- 2: int8(m_ASCII_a2),
- 3: int8(m_ASCII_n2),
- 4: int8(m_ASCII_d1),
- 5: int8(m_ASCII_a2),
- 6: int8(m_ASCII_l2),
- 7: int8(m_ASCII_o2),
- 8: int8(m_ASCII_n2),
- 9: int8(m_ASCII_e2),
- }
- var _KW_yes = [4]int8{
- 0: int8(m_ASCII_y1),
- 1: int8(m_ASCII_e2),
- 2: int8(m_ASCII_s2),
- }
- var _KW_no = [3]int8{
- 0: int8(m_ASCII_n2),
- 1: int8(m_ASCII_o2),
- }
- 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) {
- bp := tls.Alloc(32)
- defer tls.Free(32)
- *(*uintptr)(unsafe.Pointer(bp)) = _ptr
- var c int32
- var _ /* name at bp+16 */ uintptr
- var _ /* nameEnd at bp+24 */ uintptr
- var _ /* val at bp+8 */ uintptr
- _ = c
- *(*uintptr)(unsafe.Pointer(bp + 8)) = libc.UintptrFromInt32(0)
- *(*uintptr)(unsafe.Pointer(bp + 16)) = libc.UintptrFromInt32(0)
- *(*uintptr)(unsafe.Pointer(bp + 24)) = libc.UintptrFromInt32(0)
- *(*uintptr)(unsafe.Pointer(bp)) += uintptr(int32(5) * (*TENCODING)(unsafe.Pointer(enc)).FminBytesPerChar)
- end -= uintptr(int32(2) * (*TENCODING)(unsafe.Pointer(enc)).FminBytesPerChar)
- if !(_parsePseudoAttribute(tls, enc, *(*uintptr)(unsafe.Pointer(bp)), end, bp+16, bp+24, bp+8, bp) != 0) || !(*(*uintptr)(unsafe.Pointer(bp + 16)) != 0) {
- *(*uintptr)(unsafe.Pointer(badPtr)) = *(*uintptr)(unsafe.Pointer(bp))
- return 0
- }
- 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) {
- if !(isGeneralTextEntity != 0) {
- *(*uintptr)(unsafe.Pointer(badPtr)) = *(*uintptr)(unsafe.Pointer(bp + 16))
- return 0
- }
- } else {
- if versionPtr != 0 {
- *(*uintptr)(unsafe.Pointer(versionPtr)) = *(*uintptr)(unsafe.Pointer(bp + 8))
- }
- if versionEndPtr != 0 {
- *(*uintptr)(unsafe.Pointer(versionEndPtr)) = *(*uintptr)(unsafe.Pointer(bp))
- }
- if !(_parsePseudoAttribute(tls, enc, *(*uintptr)(unsafe.Pointer(bp)), end, bp+16, bp+24, bp+8, bp) != 0) {
- *(*uintptr)(unsafe.Pointer(badPtr)) = *(*uintptr)(unsafe.Pointer(bp))
- return 0
- }
- if !(*(*uintptr)(unsafe.Pointer(bp + 16)) != 0) {
- if isGeneralTextEntity != 0 {
- /* a TextDecl must have an EncodingDecl */
- *(*uintptr)(unsafe.Pointer(badPtr)) = *(*uintptr)(unsafe.Pointer(bp))
- return 0
- }
- return int32(1)
- }
- }
- 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 {
- c = _toAscii(tls, enc, *(*uintptr)(unsafe.Pointer(bp + 8)), end)
- if !(int32(m_ASCII_a2) <= c && c <= int32(m_ASCII_z1)) && !(int32(m_ASCII_A) <= c && c <= int32(m_ASCII_Z1)) {
- *(*uintptr)(unsafe.Pointer(badPtr)) = *(*uintptr)(unsafe.Pointer(bp + 8))
- return 0
- }
- if encodingName != 0 {
- *(*uintptr)(unsafe.Pointer(encodingName)) = *(*uintptr)(unsafe.Pointer(bp + 8))
- }
- if encoding != 0 {
- *(*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))
- }
- if !(_parsePseudoAttribute(tls, enc, *(*uintptr)(unsafe.Pointer(bp)), end, bp+16, bp+24, bp+8, bp) != 0) {
- *(*uintptr)(unsafe.Pointer(badPtr)) = *(*uintptr)(unsafe.Pointer(bp))
- return 0
- }
- if !(*(*uintptr)(unsafe.Pointer(bp + 16)) != 0) {
- return int32(1)
- }
- }
- 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 {
- *(*uintptr)(unsafe.Pointer(badPtr)) = *(*uintptr)(unsafe.Pointer(bp + 16))
- return 0
- }
- 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 {
- if standalone != 0 {
- *(*int32)(unsafe.Pointer(standalone)) = int32(1)
- }
- } else {
- 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 {
- if standalone != 0 {
- *(*int32)(unsafe.Pointer(standalone)) = 0
- }
- } else {
- *(*uintptr)(unsafe.Pointer(badPtr)) = *(*uintptr)(unsafe.Pointer(bp + 8))
- return 0
- }
- }
- for _isSpace(tls, _toAscii(tls, enc, *(*uintptr)(unsafe.Pointer(bp)), end)) != 0 {
- *(*uintptr)(unsafe.Pointer(bp)) += uintptr((*TENCODING)(unsafe.Pointer(enc)).FminBytesPerChar)
- }
- if *(*uintptr)(unsafe.Pointer(bp)) != end {
- *(*uintptr)(unsafe.Pointer(badPtr)) = *(*uintptr)(unsafe.Pointer(bp))
- return 0
- }
- return int32(1)
- }
- func _checkCharRefNumber(tls *libc.TLS, result int32) (r int32) {
- switch result >> libc.Int32FromInt32(8) {
- case int32(0xD8):
- fallthrough
- case int32(0xD9):
- fallthrough
- case int32(0xDA):
- fallthrough
- case int32(0xDB):
- fallthrough
- case int32(0xDC):
- fallthrough
- case int32(0xDD):
- fallthrough
- case int32(0xDE):
- fallthrough
- case int32(0xDF):
- return -int32(1)
- case 0:
- if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_latin1_encoding)) + 136 + uintptr(result)))) == int32(_BT_NONXML) {
- return -int32(1)
- }
- case int32(0xFF):
- if result == int32(0xFFFE) || result == int32(0xFFFF) {
- return -int32(1)
- }
- break
- }
- return result
- }
- func XXmlUtf8Encode(tls *libc.TLS, c int32, buf uintptr) (r int32) {
- if c < 0 {
- return 0
- } /* LCOV_EXCL_LINE: this case is always eliminated beforehand */
- if c < 128 {
- *(*int8)(unsafe.Pointer(buf)) = int8(c | int32(_UTF8_cval1))
- return int32(1)
- }
- if c < 2048 {
- *(*int8)(unsafe.Pointer(buf)) = int8(c>>libc.Int32FromInt32(6) | int32(_UTF8_cval2))
- *(*int8)(unsafe.Pointer(buf + 1)) = int8(c&libc.Int32FromInt32(0x3f) | libc.Int32FromInt32(0x80))
- return int32(2)
- }
- if c < 65536 {
- *(*int8)(unsafe.Pointer(buf)) = int8(c>>libc.Int32FromInt32(12) | int32(_UTF8_cval3))
- *(*int8)(unsafe.Pointer(buf + 1)) = int8(c>>libc.Int32FromInt32(6)&libc.Int32FromInt32(0x3f) | libc.Int32FromInt32(0x80))
- *(*int8)(unsafe.Pointer(buf + 2)) = int8(c&libc.Int32FromInt32(0x3f) | libc.Int32FromInt32(0x80))
- return int32(3)
- }
- if c < int32(0x110000) {
- *(*int8)(unsafe.Pointer(buf)) = int8(c>>libc.Int32FromInt32(18) | int32(_UTF8_cval4))
- *(*int8)(unsafe.Pointer(buf + 1)) = int8(c>>libc.Int32FromInt32(12)&libc.Int32FromInt32(0x3f) | libc.Int32FromInt32(0x80))
- *(*int8)(unsafe.Pointer(buf + 2)) = int8(c>>libc.Int32FromInt32(6)&libc.Int32FromInt32(0x3f) | libc.Int32FromInt32(0x80))
- *(*int8)(unsafe.Pointer(buf + 3)) = int8(c&libc.Int32FromInt32(0x3f) | libc.Int32FromInt32(0x80))
- return int32(4)
- }
- return 0 /* LCOV_EXCL_LINE: this case too is eliminated before calling */
- }
- func XXmlUtf16Encode(tls *libc.TLS, charNum int32, buf uintptr) (r int32) {
- if charNum < 0 {
- return 0
- }
- if charNum < int32(0x10000) {
- *(*uint16)(unsafe.Pointer(buf)) = libc.Uint16FromInt32(charNum)
- return int32(1)
- }
- if charNum < int32(0x110000) {
- charNum -= int32(0x10000)
- *(*uint16)(unsafe.Pointer(buf)) = libc.Uint16FromInt32(charNum>>libc.Int32FromInt32(10) + libc.Int32FromInt32(0xD800))
- *(*uint16)(unsafe.Pointer(buf + 1*2)) = libc.Uint16FromInt32(charNum&libc.Int32FromInt32(0x3FF) + libc.Int32FromInt32(0xDC00))
- return int32(2)
- }
- return 0
- }
- type Tunknown_encoding = struct {
- Fnormal Tnormal_encoding
- Fconvert TCONVERTER
- FuserData uintptr
- Futf16 [256]uint16
- Futf8 [256][4]int8
- }
- func XXmlSizeOfUnknownEncoding(tls *libc.TLS) (r int32) {
- return int32(2016)
- }
- func _unknown_isName(tls *libc.TLS, enc uintptr, p uintptr) (r int32) {
- var c int32
- var uenc uintptr
- _, _ = c, uenc
- uenc = enc
- 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)
- if c & ^libc.Int32FromInt32(0xFFFF) != 0 {
- return 0
- }
- 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))))
- }
- func _unknown_isNmstrt(tls *libc.TLS, enc uintptr, p uintptr) (r int32) {
- var c int32
- var uenc uintptr
- _, _ = c, uenc
- uenc = enc
- 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)
- if c & ^libc.Int32FromInt32(0xFFFF) != 0 {
- return 0
- }
- 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))))
- }
- func _unknown_isInvalid(tls *libc.TLS, enc uintptr, p uintptr) (r int32) {
- var c int32
- var uenc uintptr
- _, _ = c, uenc
- uenc = enc
- 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)
- return libc.BoolInt32(c & ^libc.Int32FromInt32(0xFFFF) != 0 || _checkCharRefNumber(tls, c) < 0)
- }
- func _unknown_toUtf8(tls *libc.TLS, enc uintptr, fromP uintptr, fromLim uintptr, toP uintptr, toLim uintptr) (r _XML_Convert_Result) {
- bp := tls.Alloc(16)
- defer tls.Free(16)
- var c, n int32
- var uenc, utf8, v2 uintptr
- var _ /* buf at bp+0 */ [4]int8
- _, _, _, _, _ = c, n, uenc, utf8, v2
- uenc = enc
- for {
- if *(*uintptr)(unsafe.Pointer(fromP)) == fromLim {
- return int32(_XML_CONVERT_COMPLETED)
- }
- utf8 = uenc + 992 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(fromP))))))*4
- v2 = utf8
- utf8++
- n = int32(*(*int8)(unsafe.Pointer(v2)))
- if n == 0 {
- 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)))
- n = XXmlUtf8Encode(tls, c, bp)
- if int64(n) > int64(toLim)-int64(*(*uintptr)(unsafe.Pointer(toP))) {
- return int32(_XML_CONVERT_OUTPUT_EXHAUSTED)
- }
- utf8 = bp
- *(*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)))
- } else {
- if int64(n) > int64(toLim)-int64(*(*uintptr)(unsafe.Pointer(toP))) {
- return int32(_XML_CONVERT_OUTPUT_EXHAUSTED)
- }
- *(*uintptr)(unsafe.Pointer(fromP))++
- }
- libc.Xmemcpy(tls, *(*uintptr)(unsafe.Pointer(toP)), utf8, libc.Uint64FromInt32(n))
- *(*uintptr)(unsafe.Pointer(toP)) += uintptr(n)
- goto _1
- _1:
- }
- return r
- }
- func _unknown_toUtf16(tls *libc.TLS, enc uintptr, fromP uintptr, fromLim uintptr, toP uintptr, toLim uintptr) (r _XML_Convert_Result) {
- var c uint16
- var uenc, v1, v2 uintptr
- _, _, _, _ = c, uenc, v1, v2
- uenc = enc
- for *(*uintptr)(unsafe.Pointer(fromP)) < fromLim && *(*uintptr)(unsafe.Pointer(toP)) < toLim {
- c = *(*uint16)(unsafe.Pointer(uenc + 480 + uintptr(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(fromP))))))*2))
- if libc.Int32FromUint16(c) == 0 {
- 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))))
- *(*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)))
- } else {
- *(*uintptr)(unsafe.Pointer(fromP))++
- }
- v2 = toP
- v1 = *(*uintptr)(unsafe.Pointer(v2))
- *(*uintptr)(unsafe.Pointer(v2)) += 2
- *(*uint16)(unsafe.Pointer(v1)) = c
- }
- if *(*uintptr)(unsafe.Pointer(toP)) == toLim && *(*uintptr)(unsafe.Pointer(fromP)) < fromLim {
- return int32(_XML_CONVERT_OUTPUT_EXHAUSTED)
- } else {
- return int32(_XML_CONVERT_COMPLETED)
- }
- return r
- }
- func XXmlInitUnknownEncoding(tls *libc.TLS, mem uintptr, table uintptr, convert TCONVERTER, userData uintptr) (r uintptr) {
- var c, i, v3 int32
- var e uintptr
- _, _, _, _ = c, e, i, v3
- e = mem
- libc.Xmemcpy(tls, mem, uintptr(unsafe.Pointer(&_latin1_encoding)), uint64(464))
- i = 0
- for {
- if !(i < int32(128)) {
- break
- }
- 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 {
- return uintptr(0)
- }
- goto _1
- _1:
- ;
- i++
- }
- i = 0
- for {
- if !(i < int32(256)) {
- break
- }
- c = *(*int32)(unsafe.Pointer(table + uintptr(i)*4))
- if c == -int32(1) {
- *(*uint8)(unsafe.Pointer(e + 136 + uintptr(i))) = uint8(_BT_MALFORM)
- /* This shouldn't really get used. */
- *(*uint16)(unsafe.Pointer(e + 480 + uintptr(i)*2)) = uint16(0xFFFF)
- *(*int8)(unsafe.Pointer(e + 992 + uintptr(i)*4)) = int8(1)
- *(*int8)(unsafe.Pointer(e + 992 + uintptr(i)*4 + 1)) = 0
- } else {
- if c < 0 {
- if c < -int32(4) {
- return uintptr(0)
- }
- /* Multi-byte sequences need a converter function */
- if !(convert != 0) {
- return uintptr(0)
- }
- *(*uint8)(unsafe.Pointer(e + 136 + uintptr(i))) = libc.Uint8FromInt32(int32(_BT_LEAD2) - (c + libc.Int32FromInt32(2)))
- *(*int8)(unsafe.Pointer(e + 992 + uintptr(i)*4)) = 0
- *(*uint16)(unsafe.Pointer(e + 480 + uintptr(i)*2)) = uint16(0)
- } else {
- if c < int32(0x80) {
- 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 {
- return uintptr(0)
- }
- *(*uint8)(unsafe.Pointer(e + 136 + uintptr(i))) = *(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_latin1_encoding)) + 136 + uintptr(c)))
- *(*int8)(unsafe.Pointer(e + 992 + uintptr(i)*4)) = int8(1)
- *(*int8)(unsafe.Pointer(e + 992 + uintptr(i)*4 + 1)) = int8(c)
- if c == 0 {
- v3 = int32(0xFFFF)
- } else {
- v3 = c
- }
- *(*uint16)(unsafe.Pointer(e + 480 + uintptr(i)*2)) = libc.Uint16FromInt32(v3)
- } else {
- if _checkCharRefNumber(tls, c) < 0 {
- *(*uint8)(unsafe.Pointer(e + 136 + uintptr(i))) = uint8(_BT_NONXML)
- /* This shouldn't really get used. */
- *(*uint16)(unsafe.Pointer(e + 480 + uintptr(i)*2)) = uint16(0xFFFF)
- *(*int8)(unsafe.Pointer(e + 992 + uintptr(i)*4)) = int8(1)
- *(*int8)(unsafe.Pointer(e + 992 + uintptr(i)*4 + 1)) = 0
- } else {
- if c > int32(0xFFFF) {
- return uintptr(0)
- }
- if _namingBitmap[libc.Int32FromUint8(_nmstrtPages[c>>int32(8)])<<int32(3)+c&int32(0xff)>>int32(5)]&(uint32(1)<<(c&int32(0xff)&int32(0x1F))) != 0 {
- *(*uint8)(unsafe.Pointer(e + 136 + uintptr(i))) = uint8(_BT_NMSTRT)
- } else {
- if _namingBitmap[libc.Int32FromUint8(_namePages[c>>int32(8)])<<int32(3)+c&int32(0xff)>>int32(5)]&(uint32(1)<<(c&int32(0xff)&int32(0x1F))) != 0 {
- *(*uint8)(unsafe.Pointer(e + 136 + uintptr(i))) = uint8(_BT_NAME)
- } else {
- *(*uint8)(unsafe.Pointer(e + 136 + uintptr(i))) = uint8(_BT_OTHER)
- }
- }
- *(*int8)(unsafe.Pointer(e + 992 + uintptr(i)*4)) = int8(XXmlUtf8Encode(tls, c, e+992+uintptr(i)*4+uintptr(1)))
- *(*uint16)(unsafe.Pointer(e + 480 + uintptr(i)*2)) = libc.Uint16FromInt32(c)
- }
- }
- }
- }
- goto _2
- _2:
- ;
- i++
- }
- (*Tunknown_encoding)(unsafe.Pointer(e)).FuserData = userData
- (*Tunknown_encoding)(unsafe.Pointer(e)).Fconvert = convert
- if convert != 0 {
- (*Tunknown_encoding)(unsafe.Pointer(e)).Fnormal.FisName2 = __ccgo_fp(_unknown_isName)
- (*Tunknown_encoding)(unsafe.Pointer(e)).Fnormal.FisName3 = __ccgo_fp(_unknown_isName)
- (*Tunknown_encoding)(unsafe.Pointer(e)).Fnormal.FisName4 = __ccgo_fp(_unknown_isName)
- (*Tunknown_encoding)(unsafe.Pointer(e)).Fnormal.FisNmstrt2 = __ccgo_fp(_unknown_isNmstrt)
- (*Tunknown_encoding)(unsafe.Pointer(e)).Fnormal.FisNmstrt3 = __ccgo_fp(_unknown_isNmstrt)
- (*Tunknown_encoding)(unsafe.Pointer(e)).Fnormal.FisNmstrt4 = __ccgo_fp(_unknown_isNmstrt)
- (*Tunknown_encoding)(unsafe.Pointer(e)).Fnormal.FisInvalid2 = __ccgo_fp(_unknown_isInvalid)
- (*Tunknown_encoding)(unsafe.Pointer(e)).Fnormal.FisInvalid3 = __ccgo_fp(_unknown_isInvalid)
- (*Tunknown_encoding)(unsafe.Pointer(e)).Fnormal.FisInvalid4 = __ccgo_fp(_unknown_isInvalid)
- }
- (*Tunknown_encoding)(unsafe.Pointer(e)).Fnormal.Fenc.Futf8Convert = __ccgo_fp(_unknown_toUtf8)
- (*Tunknown_encoding)(unsafe.Pointer(e)).Fnormal.Fenc.Futf16Convert = __ccgo_fp(_unknown_toUtf16)
- return e
- }
- const _UNKNOWN_ENC = -1
- const _ISO_8859_1_ENC = 0
- const _US_ASCII_ENC = 1
- const _UTF_8_ENC = 2
- const _UTF_16_ENC = 3
- const _UTF_16BE_ENC = 4
- const _UTF_16LE_ENC = 5
- const
- /* must match encodingNames up to here */
- _NO_ENC = 6
- var _KW_ISO_8859_1 = [11]int8{
- 0: int8(m_ASCII_I),
- 1: int8(m_ASCII_S),
- 2: int8(m_ASCII_O),
- 3: int8(m_ASCII_MINUS1),
- 4: int8(m_ASCII_82),
- 5: int8(m_ASCII_82),
- 6: int8(m_ASCII_51),
- 7: int8(m_ASCII_92),
- 8: int8(m_ASCII_MINUS1),
- 9: int8(m_ASCII_12),
- }
- var _KW_US_ASCII = [9]int8{
- 0: int8(m_ASCII_U1),
- 1: int8(m_ASCII_S),
- 2: int8(m_ASCII_MINUS1),
- 3: int8(m_ASCII_A),
- 4: int8(m_ASCII_S),
- 5: int8(m_ASCII_C),
- 6: int8(m_ASCII_I),
- 7: int8(m_ASCII_I),
- }
- var _KW_UTF_8 = [6]int8{
- 0: int8(m_ASCII_U1),
- 1: int8(m_ASCII_T),
- 2: int8(m_ASCII_F),
- 3: int8(m_ASCII_MINUS1),
- 4: int8(m_ASCII_82),
- }
- var _KW_UTF_16 = [7]int8{
- 0: int8(m_ASCII_U1),
- 1: int8(m_ASCII_T),
- 2: int8(m_ASCII_F),
- 3: int8(m_ASCII_MINUS1),
- 4: int8(m_ASCII_12),
- 5: int8(m_ASCII_61),
- }
- var _KW_UTF_16BE = [9]int8{
- 0: int8(m_ASCII_U1),
- 1: int8(m_ASCII_T),
- 2: int8(m_ASCII_F),
- 3: int8(m_ASCII_MINUS1),
- 4: int8(m_ASCII_12),
- 5: int8(m_ASCII_61),
- 6: int8(m_ASCII_B1),
- 7: int8(m_ASCII_E),
- }
- var _KW_UTF_16LE = [9]int8{
- 0: int8(m_ASCII_U1),
- 1: int8(m_ASCII_T),
- 2: int8(m_ASCII_F),
- 3: int8(m_ASCII_MINUS1),
- 4: int8(m_ASCII_12),
- 5: int8(m_ASCII_61),
- 6: int8(m_ASCII_L),
- 7: int8(m_ASCII_E),
- }
- func _getEncodingIndex(tls *libc.TLS, name uintptr) (r int32) {
- var i int32
- _ = i
- if name == libc.UintptrFromInt32(0) {
- return int32(_NO_ENC)
- }
- i = 0
- for {
- if !(i < libc.Int32FromUint64(libc.Uint64FromInt64(48)/libc.Uint64FromInt64(8))) {
- break
- }
- if _streqci(tls, name, _encodingNames[i]) != 0 {
- return i
- }
- goto _1
- _1:
- ;
- i++
- }
- return int32(_UNKNOWN_ENC)
- }
- var _encodingNames = [6]uintptr{
- 0: uintptr(unsafe.Pointer(&_KW_ISO_8859_1)),
- 1: uintptr(unsafe.Pointer(&_KW_US_ASCII)),
- 2: uintptr(unsafe.Pointer(&_KW_UTF_8)),
- 3: uintptr(unsafe.Pointer(&_KW_UTF_16)),
- 4: uintptr(unsafe.Pointer(&_KW_UTF_16BE)),
- 5: uintptr(unsafe.Pointer(&_KW_UTF_16LE)),
- }
- /* For binary compatibility, we store the index of the encoding
- specified at initialization in the isUtf16 member.
- */
- /* This is what detects the encoding. encodingTable maps from
- encoding indices to encodings; INIT_ENC_INDEX(enc) is the index of
- the external (protocol) specified encoding; state is
- XML_CONTENT_STATE if we're parsing an external text entity, and
- XML_PROLOG_STATE otherwise.
- */
- func _initScan(tls *libc.TLS, encodingTable uintptr, enc uintptr, state int32, ptr uintptr, end uintptr, nextTokPtr uintptr) (r int32) {
- var e int32
- var encPtr uintptr
- _, _ = e, encPtr
- if ptr >= end {
- return -int32(4)
- }
- encPtr = (*TINIT_ENCODING)(unsafe.Pointer(enc)).FencPtr
- if ptr+uintptr(1) == end {
- /* only a single byte available for auto-detection */
- /* so we're parsing an external text entity... */
- /* if UTF-16 was externally specified, then we need at least 2 bytes */
- switch int32((*TINIT_ENCODING)(unsafe.Pointer(enc)).FinitEnc.FisUtf16) {
- case int32(_UTF_16_ENC):
- fallthrough
- case int32(_UTF_16LE_ENC):
- fallthrough
- case int32(_UTF_16BE_ENC):
- return -int32(1)
- }
- switch libc.Int32FromUint8(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr)))) {
- case int32(0xFE):
- fallthrough
- case int32(0xFF):
- fallthrough
- case int32(0xEF): /* possibly first byte of UTF-8 BOM */
- if int32((*TINIT_ENCODING)(unsafe.Pointer(enc)).FinitEnc.FisUtf16) == int32(_ISO_8859_1_ENC) && state == int32(m_XML_CONTENT_STATE) {
- break
- }
- /* fall through */
- fallthrough
- case 0x00:
- fallthrough
- case int32(0x3C):
- return -int32(1)
- }
- } else {
- switch libc.Int32FromUint8(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr))))<<libc.Int32FromInt32(8) | libc.Int32FromUint8(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr + 1)))) {
- case int32(0xFEFF):
- if int32((*TINIT_ENCODING)(unsafe.Pointer(enc)).FinitEnc.FisUtf16) == int32(_ISO_8859_1_ENC) && state == int32(m_XML_CONTENT_STATE) {
- break
- }
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(2)
- *(*uintptr)(unsafe.Pointer(encPtr)) = *(*uintptr)(unsafe.Pointer(encodingTable + uintptr(_UTF_16BE_ENC)*8))
- return int32(m_XML_TOK_BOM)
- /* 00 3C is handled in the default case */
- fallthrough
- case int32(0x3C00):
- 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) {
- break
- }
- *(*uintptr)(unsafe.Pointer(encPtr)) = *(*uintptr)(unsafe.Pointer(encodingTable + uintptr(_UTF_16LE_ENC)*8))
- 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)
- case int32(0xFFFE):
- if int32((*TINIT_ENCODING)(unsafe.Pointer(enc)).FinitEnc.FisUtf16) == int32(_ISO_8859_1_ENC) && state == int32(m_XML_CONTENT_STATE) {
- break
- }
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(2)
- *(*uintptr)(unsafe.Pointer(encPtr)) = *(*uintptr)(unsafe.Pointer(encodingTable + uintptr(_UTF_16LE_ENC)*8))
- return int32(m_XML_TOK_BOM)
- case int32(0xEFBB):
- /* Maybe a UTF-8 BOM (EF BB BF) */
- /* If there's an explicitly specified (external) encoding
- of ISO-8859-1 or some flavour of UTF-16
- and this is an external text entity,
- don't look for the BOM,
- because it might be a legal data.
- */
- if state == int32(m_XML_CONTENT_STATE) {
- e = int32((*TINIT_ENCODING)(unsafe.Pointer(enc)).FinitEnc.FisUtf16)
- if e == int32(_ISO_8859_1_ENC) || e == int32(_UTF_16BE_ENC) || e == int32(_UTF_16LE_ENC) || e == int32(_UTF_16_ENC) {
- break
- }
- }
- if ptr+uintptr(2) == end {
- return -int32(1)
- }
- if libc.Int32FromUint8(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(ptr + 2)))) == int32(0xBF) {
- *(*uintptr)(unsafe.Pointer(nextTokPtr)) = ptr + uintptr(3)
- *(*uintptr)(unsafe.Pointer(encPtr)) = *(*uintptr)(unsafe.Pointer(encodingTable + uintptr(_UTF_8_ENC)*8))
- return int32(m_XML_TOK_BOM)
- }
- default:
- if int32(*(*int8)(unsafe.Pointer(ptr))) == int32('\000') {
- /* 0 isn't a legal data character. Furthermore a document
- entity can only start with ASCII characters. So the only
- way this can fail to be big-endian UTF-16 if it it's an
- external parsed general entity that's labelled as
- UTF-16LE.
- */
- if state == int32(m_XML_CONTENT_STATE) && int32((*TINIT_ENCODING)(unsafe.Pointer(enc)).FinitEnc.FisUtf16) == int32(_UTF_16LE_ENC) {
- break
- }
- *(*uintptr)(unsafe.Pointer(encPtr)) = *(*uintptr)(unsafe.Pointer(encodingTable + uintptr(_UTF_16BE_ENC)*8))
- 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)
- } else {
- if int32(*(*int8)(unsafe.Pointer(ptr + 1))) == int32('\000') {
- /* We could recover here in the case:
- - parsing an external entity
- - second byte is 0
- - no externally specified encoding
- - no encoding declaration
- by assuming UTF-16LE. But we don't, because this would mean when
- presented just with a single byte, we couldn't reliably determine
- whether we needed further bytes.
- */
- if state == int32(m_XML_CONTENT_STATE) {
- break
- }
- *(*uintptr)(unsafe.Pointer(encPtr)) = *(*uintptr)(unsafe.Pointer(encodingTable + uintptr(_UTF_16LE_ENC)*8))
- 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)
- }
- }
- break
- }
- }
- *(*uintptr)(unsafe.Pointer(encPtr)) = *(*uintptr)(unsafe.Pointer(encodingTable + uintptr(int32((*TINIT_ENCODING)(unsafe.Pointer(enc)).FinitEnc.FisUtf16))*8))
- 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)
- }
- /* This file is included!
- __ __ _
- ___\ \/ /_ __ __ _| |_
- / _ \\ /| '_ \ / _` | __|
- | __// \| |_) | (_| | |_
- \___/_/\_\ .__/ \__,_|\__|
- |_| XML parser
- Copyright (c) 1997-2000 Thai Open Source Software Center Ltd
- Copyright (c) 2000 Clark Cooper <coopercc@users.sourceforge.net>
- Copyright (c) 2002 Greg Stein <gstein@users.sourceforge.net>
- Copyright (c) 2002 Fred L. Drake, Jr. <fdrake@users.sourceforge.net>
- Copyright (c) 2002-2006 Karl Waclawek <karl@waclawek.net>
- Copyright (c) 2017-2021 Sebastian Pipping <sebastian@pipping.org>
- Licensed under the MIT license:
- Permission is hereby granted, free of charge, to any person obtaining
- a copy of this software and associated documentation files (the
- "Software"), to deal in the Software without restriction, including
- without limitation the rights to use, copy, modify, merge, publish,
- distribute, sublicense, and/or sell copies of the Software, and to permit
- persons to whom the Software is furnished to do so, subject to the
- following conditions:
- The above copyright notice and this permission notice shall be included
- in all copies or substantial portions of the Software.
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
- NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
- USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
- func XXmlGetUtf8InternalEncoding(tls *libc.TLS) (r uintptr) {
- return uintptr(unsafe.Pointer(&_internal_utf8_encoding))
- }
- func XXmlGetUtf16InternalEncoding(tls *libc.TLS) (r uintptr) {
- return uintptr(unsafe.Pointer(&_internal_little2_encoding))
- }
- var _encodings = [7]uintptr{
- 0: uintptr(unsafe.Pointer(&_latin1_encoding)),
- 1: uintptr(unsafe.Pointer(&_ascii_encoding)),
- 2: uintptr(unsafe.Pointer(&_utf8_encoding)),
- 3: uintptr(unsafe.Pointer(&_big2_encoding)),
- 4: uintptr(unsafe.Pointer(&_big2_encoding)),
- 5: uintptr(unsafe.Pointer(&_little2_encoding)),
- 6: uintptr(unsafe.Pointer(&_utf8_encoding)),
- }
- func _initScanProlog(tls *libc.TLS, enc uintptr, ptr uintptr, end uintptr, nextTokPtr uintptr) (r int32) {
- return _initScan(tls, uintptr(unsafe.Pointer(&_encodings)), enc, m_XML_PROLOG_STATE, ptr, end, nextTokPtr)
- }
- func _initScanContent(tls *libc.TLS, enc uintptr, ptr uintptr, end uintptr, nextTokPtr uintptr) (r int32) {
- return _initScan(tls, uintptr(unsafe.Pointer(&_encodings)), enc, int32(m_XML_CONTENT_STATE), ptr, end, nextTokPtr)
- }
- func XXmlInitEncoding(tls *libc.TLS, p uintptr, encPtr uintptr, name uintptr) (r int32) {
- var i int32
- _ = i
- i = _getEncodingIndex(tls, name)
- if i == int32(_UNKNOWN_ENC) {
- return 0
- }
- (*TINIT_ENCODING)(unsafe.Pointer(p)).FinitEnc.FisUtf16 = int8(i)
- *(*TSCANNER)(unsafe.Pointer(p)) = __ccgo_fp(_initScanProlog)
- *(*TSCANNER)(unsafe.Pointer(p + 1*8)) = __ccgo_fp(_initScanContent)
- (*TINIT_ENCODING)(unsafe.Pointer(p)).FinitEnc.FupdatePosition = __ccgo_fp(_initUpdatePosition)
- (*TINIT_ENCODING)(unsafe.Pointer(p)).FencPtr = encPtr
- *(*uintptr)(unsafe.Pointer(encPtr)) = p
- return int32(1)
- }
- func _findEncoding(tls *libc.TLS, enc uintptr, _ptr uintptr, end uintptr) (r uintptr) {
- bp := tls.Alloc(144)
- defer tls.Free(144)
- *(*uintptr)(unsafe.Pointer(bp)) = _ptr
- var i int32
- var _ /* buf at bp+8 */ [128]int8
- var _ /* p at bp+136 */ uintptr
- _ = i
- *(*[128]int8)(unsafe.Pointer(bp + 8)) = [128]int8{}
- *(*uintptr)(unsafe.Pointer(bp + 136)) = bp + 8
- (*(*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))
- if *(*uintptr)(unsafe.Pointer(bp)) != end {
- return uintptr(0)
- }
- *(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 136)))) = 0
- if _streqci(tls, bp+8, uintptr(unsafe.Pointer(&_KW_UTF_16))) != 0 && (*TENCODING)(unsafe.Pointer(enc)).FminBytesPerChar == int32(2) {
- return enc
- }
- i = _getEncodingIndex(tls, bp+8)
- if i == int32(_UNKNOWN_ENC) {
- return uintptr(0)
- }
- return _encodings[i]
- }
- 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) {
- return _doParseXmlDecl(tls, __ccgo_fp(_findEncoding), isGeneralTextEntity, enc, ptr, end, badPtr, versionPtr, versionEndPtr, encodingName, encoding, standalone)
- }
- /* This file is included!
- __ __ _
- ___\ \/ /_ __ __ _| |_
- / _ \\ /| '_ \ / _` | __|
- | __// \| |_) | (_| | |_
- \___/_/\_\ .__/ \__,_|\__|
- |_| XML parser
- Copyright (c) 1997-2000 Thai Open Source Software Center Ltd
- Copyright (c) 2000 Clark Cooper <coopercc@users.sourceforge.net>
- Copyright (c) 2002 Greg Stein <gstein@users.sourceforge.net>
- Copyright (c) 2002 Fred L. Drake, Jr. <fdrake@users.sourceforge.net>
- Copyright (c) 2002-2006 Karl Waclawek <karl@waclawek.net>
- Copyright (c) 2017-2021 Sebastian Pipping <sebastian@pipping.org>
- Licensed under the MIT license:
- Permission is hereby granted, free of charge, to any person obtaining
- a copy of this software and associated documentation files (the
- "Software"), to deal in the Software without restriction, including
- without limitation the rights to use, copy, modify, merge, publish,
- distribute, sublicense, and/or sell copies of the Software, and to permit
- persons to whom the Software is furnished to do so, subject to the
- following conditions:
- The above copyright notice and this permission notice shall be included
- in all copies or substantial portions of the Software.
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
- NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
- USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
- func XXmlGetUtf8InternalEncodingNS(tls *libc.TLS) (r uintptr) {
- return uintptr(unsafe.Pointer(&_internal_utf8_encoding_ns))
- }
- func XXmlGetUtf16InternalEncodingNS(tls *libc.TLS) (r uintptr) {
- return uintptr(unsafe.Pointer(&_internal_little2_encoding_ns))
- }
- var _encodingsNS = [7]uintptr{
- 0: uintptr(unsafe.Pointer(&_latin1_encoding_ns)),
- 1: uintptr(unsafe.Pointer(&_ascii_encoding_ns)),
- 2: uintptr(unsafe.Pointer(&_utf8_encoding_ns)),
- 3: uintptr(unsafe.Pointer(&_big2_encoding_ns)),
- 4: uintptr(unsafe.Pointer(&_big2_encoding_ns)),
- 5: uintptr(unsafe.Pointer(&_little2_encoding_ns)),
- 6: uintptr(unsafe.Pointer(&_utf8_encoding_ns)),
- }
- func _initScanPrologNS(tls *libc.TLS, enc uintptr, ptr uintptr, end uintptr, nextTokPtr uintptr) (r int32) {
- return _initScan(tls, uintptr(unsafe.Pointer(&_encodingsNS)), enc, m_XML_PROLOG_STATE, ptr, end, nextTokPtr)
- }
- func _initScanContentNS(tls *libc.TLS, enc uintptr, ptr uintptr, end uintptr, nextTokPtr uintptr) (r int32) {
- return _initScan(tls, uintptr(unsafe.Pointer(&_encodingsNS)), enc, int32(m_XML_CONTENT_STATE), ptr, end, nextTokPtr)
- }
- func XXmlInitEncodingNS(tls *libc.TLS, p uintptr, encPtr uintptr, name uintptr) (r int32) {
- var i int32
- _ = i
- i = _getEncodingIndex(tls, name)
- if i == int32(_UNKNOWN_ENC) {
- return 0
- }
- (*TINIT_ENCODING)(unsafe.Pointer(p)).FinitEnc.FisUtf16 = int8(i)
- *(*TSCANNER)(unsafe.Pointer(p)) = __ccgo_fp(_initScanPrologNS)
- *(*TSCANNER)(unsafe.Pointer(p + 1*8)) = __ccgo_fp(_initScanContentNS)
- (*TINIT_ENCODING)(unsafe.Pointer(p)).FinitEnc.FupdatePosition = __ccgo_fp(_initUpdatePosition)
- (*TINIT_ENCODING)(unsafe.Pointer(p)).FencPtr = encPtr
- *(*uintptr)(unsafe.Pointer(encPtr)) = p
- return int32(1)
- }
- func _findEncodingNS(tls *libc.TLS, enc uintptr, _ptr uintptr, end uintptr) (r uintptr) {
- bp := tls.Alloc(144)
- defer tls.Free(144)
- *(*uintptr)(unsafe.Pointer(bp)) = _ptr
- var i int32
- var _ /* buf at bp+8 */ [128]int8
- var _ /* p at bp+136 */ uintptr
- _ = i
- *(*[128]int8)(unsafe.Pointer(bp + 8)) = [128]int8{}
- *(*uintptr)(unsafe.Pointer(bp + 136)) = bp + 8
- (*(*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))
- if *(*uintptr)(unsafe.Pointer(bp)) != end {
- return uintptr(0)
- }
- *(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 136)))) = 0
- if _streqci(tls, bp+8, uintptr(unsafe.Pointer(&_KW_UTF_16))) != 0 && (*TENCODING)(unsafe.Pointer(enc)).FminBytesPerChar == int32(2) {
- return enc
- }
- i = _getEncodingIndex(tls, bp+8)
- if i == int32(_UNKNOWN_ENC) {
- return uintptr(0)
- }
- return _encodingsNS[i]
- }
- 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) {
- return _doParseXmlDecl(tls, __ccgo_fp(_findEncodingNS), isGeneralTextEntity, enc, ptr, end, badPtr, versionPtr, versionEndPtr, encodingName, encoding, standalone)
- }
- func XXmlInitUnknownEncodingNS(tls *libc.TLS, mem uintptr, table uintptr, convert TCONVERTER, userData uintptr) (r uintptr) {
- var enc uintptr
- _ = enc
- enc = XXmlInitUnknownEncoding(tls, mem, table, convert, userData)
- if enc != 0 {
- *(*uint8)(unsafe.Pointer(enc + 136 + 58)) = uint8(_BT_COLON)
- }
- return enc
- }
- func __ccgo_fp(f interface{}) uintptr {
- type iface [2]uintptr
- return (*iface)(unsafe.Pointer(&f))[1]
- }
- var __ccgo_ts = (*reflect.StringHeader)(unsafe.Pointer(&__ccgo_ts1)).Data
- 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"
|