saslwrapper.cpp 257 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480
  1. /* Generated by Cython 0.29.21 */
  2. #define PY_SSIZE_T_CLEAN
  3. #include "Python.h"
  4. #ifndef Py_PYTHON_H
  5. #error Python headers needed to compile C extensions, please install development version of Python.
  6. #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
  7. #error Cython requires Python 2.6+ or Python 3.3+.
  8. #else
  9. #define CYTHON_ABI "0_29_21"
  10. #define CYTHON_HEX_VERSION 0x001D15F0
  11. #define CYTHON_FUTURE_DIVISION 1
  12. #include <stddef.h>
  13. #ifndef offsetof
  14. #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
  15. #endif
  16. #if !defined(WIN32) && !defined(MS_WINDOWS)
  17. #ifndef __stdcall
  18. #define __stdcall
  19. #endif
  20. #ifndef __cdecl
  21. #define __cdecl
  22. #endif
  23. #ifndef __fastcall
  24. #define __fastcall
  25. #endif
  26. #endif
  27. #ifndef DL_IMPORT
  28. #define DL_IMPORT(t) t
  29. #endif
  30. #ifndef DL_EXPORT
  31. #define DL_EXPORT(t) t
  32. #endif
  33. #define __PYX_COMMA ,
  34. #ifndef HAVE_LONG_LONG
  35. #if PY_VERSION_HEX >= 0x02070000
  36. #define HAVE_LONG_LONG
  37. #endif
  38. #endif
  39. #ifndef PY_LONG_LONG
  40. #define PY_LONG_LONG LONG_LONG
  41. #endif
  42. #ifndef Py_HUGE_VAL
  43. #define Py_HUGE_VAL HUGE_VAL
  44. #endif
  45. #ifdef PYPY_VERSION
  46. #define CYTHON_COMPILING_IN_PYPY 1
  47. #define CYTHON_COMPILING_IN_PYSTON 0
  48. #define CYTHON_COMPILING_IN_CPYTHON 0
  49. #undef CYTHON_USE_TYPE_SLOTS
  50. #define CYTHON_USE_TYPE_SLOTS 0
  51. #undef CYTHON_USE_PYTYPE_LOOKUP
  52. #define CYTHON_USE_PYTYPE_LOOKUP 0
  53. #if PY_VERSION_HEX < 0x03050000
  54. #undef CYTHON_USE_ASYNC_SLOTS
  55. #define CYTHON_USE_ASYNC_SLOTS 0
  56. #elif !defined(CYTHON_USE_ASYNC_SLOTS)
  57. #define CYTHON_USE_ASYNC_SLOTS 1
  58. #endif
  59. #undef CYTHON_USE_PYLIST_INTERNALS
  60. #define CYTHON_USE_PYLIST_INTERNALS 0
  61. #undef CYTHON_USE_UNICODE_INTERNALS
  62. #define CYTHON_USE_UNICODE_INTERNALS 0
  63. #undef CYTHON_USE_UNICODE_WRITER
  64. #define CYTHON_USE_UNICODE_WRITER 0
  65. #undef CYTHON_USE_PYLONG_INTERNALS
  66. #define CYTHON_USE_PYLONG_INTERNALS 0
  67. #undef CYTHON_AVOID_BORROWED_REFS
  68. #define CYTHON_AVOID_BORROWED_REFS 1
  69. #undef CYTHON_ASSUME_SAFE_MACROS
  70. #define CYTHON_ASSUME_SAFE_MACROS 0
  71. #undef CYTHON_UNPACK_METHODS
  72. #define CYTHON_UNPACK_METHODS 0
  73. #undef CYTHON_FAST_THREAD_STATE
  74. #define CYTHON_FAST_THREAD_STATE 0
  75. #undef CYTHON_FAST_PYCALL
  76. #define CYTHON_FAST_PYCALL 0
  77. #undef CYTHON_PEP489_MULTI_PHASE_INIT
  78. #define CYTHON_PEP489_MULTI_PHASE_INIT 0
  79. #undef CYTHON_USE_TP_FINALIZE
  80. #define CYTHON_USE_TP_FINALIZE 0
  81. #undef CYTHON_USE_DICT_VERSIONS
  82. #define CYTHON_USE_DICT_VERSIONS 0
  83. #undef CYTHON_USE_EXC_INFO_STACK
  84. #define CYTHON_USE_EXC_INFO_STACK 0
  85. #elif defined(PYSTON_VERSION)
  86. #define CYTHON_COMPILING_IN_PYPY 0
  87. #define CYTHON_COMPILING_IN_PYSTON 1
  88. #define CYTHON_COMPILING_IN_CPYTHON 0
  89. #ifndef CYTHON_USE_TYPE_SLOTS
  90. #define CYTHON_USE_TYPE_SLOTS 1
  91. #endif
  92. #undef CYTHON_USE_PYTYPE_LOOKUP
  93. #define CYTHON_USE_PYTYPE_LOOKUP 0
  94. #undef CYTHON_USE_ASYNC_SLOTS
  95. #define CYTHON_USE_ASYNC_SLOTS 0
  96. #undef CYTHON_USE_PYLIST_INTERNALS
  97. #define CYTHON_USE_PYLIST_INTERNALS 0
  98. #ifndef CYTHON_USE_UNICODE_INTERNALS
  99. #define CYTHON_USE_UNICODE_INTERNALS 1
  100. #endif
  101. #undef CYTHON_USE_UNICODE_WRITER
  102. #define CYTHON_USE_UNICODE_WRITER 0
  103. #undef CYTHON_USE_PYLONG_INTERNALS
  104. #define CYTHON_USE_PYLONG_INTERNALS 0
  105. #ifndef CYTHON_AVOID_BORROWED_REFS
  106. #define CYTHON_AVOID_BORROWED_REFS 0
  107. #endif
  108. #ifndef CYTHON_ASSUME_SAFE_MACROS
  109. #define CYTHON_ASSUME_SAFE_MACROS 1
  110. #endif
  111. #ifndef CYTHON_UNPACK_METHODS
  112. #define CYTHON_UNPACK_METHODS 1
  113. #endif
  114. #undef CYTHON_FAST_THREAD_STATE
  115. #define CYTHON_FAST_THREAD_STATE 0
  116. #undef CYTHON_FAST_PYCALL
  117. #define CYTHON_FAST_PYCALL 0
  118. #undef CYTHON_PEP489_MULTI_PHASE_INIT
  119. #define CYTHON_PEP489_MULTI_PHASE_INIT 0
  120. #undef CYTHON_USE_TP_FINALIZE
  121. #define CYTHON_USE_TP_FINALIZE 0
  122. #undef CYTHON_USE_DICT_VERSIONS
  123. #define CYTHON_USE_DICT_VERSIONS 0
  124. #undef CYTHON_USE_EXC_INFO_STACK
  125. #define CYTHON_USE_EXC_INFO_STACK 0
  126. #else
  127. #define CYTHON_COMPILING_IN_PYPY 0
  128. #define CYTHON_COMPILING_IN_PYSTON 0
  129. #define CYTHON_COMPILING_IN_CPYTHON 1
  130. #ifndef CYTHON_USE_TYPE_SLOTS
  131. #define CYTHON_USE_TYPE_SLOTS 1
  132. #endif
  133. #if PY_VERSION_HEX < 0x02070000
  134. #undef CYTHON_USE_PYTYPE_LOOKUP
  135. #define CYTHON_USE_PYTYPE_LOOKUP 0
  136. #elif !defined(CYTHON_USE_PYTYPE_LOOKUP)
  137. #define CYTHON_USE_PYTYPE_LOOKUP 1
  138. #endif
  139. #if PY_MAJOR_VERSION < 3
  140. #undef CYTHON_USE_ASYNC_SLOTS
  141. #define CYTHON_USE_ASYNC_SLOTS 0
  142. #elif !defined(CYTHON_USE_ASYNC_SLOTS)
  143. #define CYTHON_USE_ASYNC_SLOTS 1
  144. #endif
  145. #if PY_VERSION_HEX < 0x02070000
  146. #undef CYTHON_USE_PYLONG_INTERNALS
  147. #define CYTHON_USE_PYLONG_INTERNALS 0
  148. #elif !defined(CYTHON_USE_PYLONG_INTERNALS)
  149. #define CYTHON_USE_PYLONG_INTERNALS 1
  150. #endif
  151. #ifndef CYTHON_USE_PYLIST_INTERNALS
  152. #define CYTHON_USE_PYLIST_INTERNALS 1
  153. #endif
  154. #ifndef CYTHON_USE_UNICODE_INTERNALS
  155. #define CYTHON_USE_UNICODE_INTERNALS 1
  156. #endif
  157. #if PY_VERSION_HEX < 0x030300F0
  158. #undef CYTHON_USE_UNICODE_WRITER
  159. #define CYTHON_USE_UNICODE_WRITER 0
  160. #elif !defined(CYTHON_USE_UNICODE_WRITER)
  161. #define CYTHON_USE_UNICODE_WRITER 1
  162. #endif
  163. #ifndef CYTHON_AVOID_BORROWED_REFS
  164. #define CYTHON_AVOID_BORROWED_REFS 0
  165. #endif
  166. #ifndef CYTHON_ASSUME_SAFE_MACROS
  167. #define CYTHON_ASSUME_SAFE_MACROS 1
  168. #endif
  169. #ifndef CYTHON_UNPACK_METHODS
  170. #define CYTHON_UNPACK_METHODS 1
  171. #endif
  172. #ifndef CYTHON_FAST_THREAD_STATE
  173. #define CYTHON_FAST_THREAD_STATE 1
  174. #endif
  175. #ifndef CYTHON_FAST_PYCALL
  176. #define CYTHON_FAST_PYCALL 1
  177. #endif
  178. #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
  179. #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000)
  180. #endif
  181. #ifndef CYTHON_USE_TP_FINALIZE
  182. #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1)
  183. #endif
  184. #ifndef CYTHON_USE_DICT_VERSIONS
  185. #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1)
  186. #endif
  187. #ifndef CYTHON_USE_EXC_INFO_STACK
  188. #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3)
  189. #endif
  190. #endif
  191. #if !defined(CYTHON_FAST_PYCCALL)
  192. #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
  193. #endif
  194. #if CYTHON_USE_PYLONG_INTERNALS
  195. #include "longintrepr.h"
  196. #undef SHIFT
  197. #undef BASE
  198. #undef MASK
  199. #ifdef SIZEOF_VOID_P
  200. enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) };
  201. #endif
  202. #endif
  203. #ifndef __has_attribute
  204. #define __has_attribute(x) 0
  205. #endif
  206. #ifndef __has_cpp_attribute
  207. #define __has_cpp_attribute(x) 0
  208. #endif
  209. #ifndef CYTHON_RESTRICT
  210. #if defined(__GNUC__)
  211. #define CYTHON_RESTRICT __restrict__
  212. #elif defined(_MSC_VER) && _MSC_VER >= 1400
  213. #define CYTHON_RESTRICT __restrict
  214. #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
  215. #define CYTHON_RESTRICT restrict
  216. #else
  217. #define CYTHON_RESTRICT
  218. #endif
  219. #endif
  220. #ifndef CYTHON_UNUSED
  221. # if defined(__GNUC__)
  222. # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
  223. # define CYTHON_UNUSED __attribute__ ((__unused__))
  224. # else
  225. # define CYTHON_UNUSED
  226. # endif
  227. # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
  228. # define CYTHON_UNUSED __attribute__ ((__unused__))
  229. # else
  230. # define CYTHON_UNUSED
  231. # endif
  232. #endif
  233. #ifndef CYTHON_MAYBE_UNUSED_VAR
  234. # if defined(__cplusplus)
  235. template<class T> void CYTHON_MAYBE_UNUSED_VAR( const T& ) { }
  236. # else
  237. # define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
  238. # endif
  239. #endif
  240. #ifndef CYTHON_NCP_UNUSED
  241. # if CYTHON_COMPILING_IN_CPYTHON
  242. # define CYTHON_NCP_UNUSED
  243. # else
  244. # define CYTHON_NCP_UNUSED CYTHON_UNUSED
  245. # endif
  246. #endif
  247. #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
  248. #ifdef _MSC_VER
  249. #ifndef _MSC_STDINT_H_
  250. #if _MSC_VER < 1300
  251. typedef unsigned char uint8_t;
  252. typedef unsigned int uint32_t;
  253. #else
  254. typedef unsigned __int8 uint8_t;
  255. typedef unsigned __int32 uint32_t;
  256. #endif
  257. #endif
  258. #else
  259. #include <stdint.h>
  260. #endif
  261. #ifndef CYTHON_FALLTHROUGH
  262. #if defined(__cplusplus) && __cplusplus >= 201103L
  263. #if __has_cpp_attribute(fallthrough)
  264. #define CYTHON_FALLTHROUGH [[fallthrough]]
  265. #elif __has_cpp_attribute(clang::fallthrough)
  266. #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
  267. #elif __has_cpp_attribute(gnu::fallthrough)
  268. #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
  269. #endif
  270. #endif
  271. #ifndef CYTHON_FALLTHROUGH
  272. #if __has_attribute(fallthrough)
  273. #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
  274. #else
  275. #define CYTHON_FALLTHROUGH
  276. #endif
  277. #endif
  278. #if defined(__clang__ ) && defined(__apple_build_version__)
  279. #if __apple_build_version__ < 7000000
  280. #undef CYTHON_FALLTHROUGH
  281. #define CYTHON_FALLTHROUGH
  282. #endif
  283. #endif
  284. #endif
  285. #ifndef __cplusplus
  286. #error "Cython files generated with the C++ option must be compiled with a C++ compiler."
  287. #endif
  288. #ifndef CYTHON_INLINE
  289. #if defined(__clang__)
  290. #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
  291. #else
  292. #define CYTHON_INLINE inline
  293. #endif
  294. #endif
  295. template<typename T>
  296. void __Pyx_call_destructor(T& x) {
  297. x.~T();
  298. }
  299. template<typename T>
  300. class __Pyx_FakeReference {
  301. public:
  302. __Pyx_FakeReference() : ptr(NULL) { }
  303. __Pyx_FakeReference(const T& ref) : ptr(const_cast<T*>(&ref)) { }
  304. T *operator->() { return ptr; }
  305. T *operator&() { return ptr; }
  306. operator T&() { return *ptr; }
  307. template<typename U> bool operator ==(U other) { return *ptr == other; }
  308. template<typename U> bool operator !=(U other) { return *ptr != other; }
  309. private:
  310. T *ptr;
  311. };
  312. #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
  313. #define Py_OptimizeFlag 0
  314. #endif
  315. #define __PYX_BUILD_PY_SSIZE_T "n"
  316. #define CYTHON_FORMAT_SSIZE_T "z"
  317. #if PY_MAJOR_VERSION < 3
  318. #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
  319. #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
  320. PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
  321. #define __Pyx_DefaultClassType PyClass_Type
  322. #else
  323. #define __Pyx_BUILTIN_MODULE_NAME "builtins"
  324. #if PY_VERSION_HEX >= 0x030800A4 && PY_VERSION_HEX < 0x030800B2
  325. #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
  326. PyCode_New(a, 0, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
  327. #else
  328. #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
  329. PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
  330. #endif
  331. #define __Pyx_DefaultClassType PyType_Type
  332. #endif
  333. #ifndef Py_TPFLAGS_CHECKTYPES
  334. #define Py_TPFLAGS_CHECKTYPES 0
  335. #endif
  336. #ifndef Py_TPFLAGS_HAVE_INDEX
  337. #define Py_TPFLAGS_HAVE_INDEX 0
  338. #endif
  339. #ifndef Py_TPFLAGS_HAVE_NEWBUFFER
  340. #define Py_TPFLAGS_HAVE_NEWBUFFER 0
  341. #endif
  342. #ifndef Py_TPFLAGS_HAVE_FINALIZE
  343. #define Py_TPFLAGS_HAVE_FINALIZE 0
  344. #endif
  345. #ifndef METH_STACKLESS
  346. #define METH_STACKLESS 0
  347. #endif
  348. #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
  349. #ifndef METH_FASTCALL
  350. #define METH_FASTCALL 0x80
  351. #endif
  352. typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs);
  353. typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args,
  354. Py_ssize_t nargs, PyObject *kwnames);
  355. #else
  356. #define __Pyx_PyCFunctionFast _PyCFunctionFast
  357. #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
  358. #endif
  359. #if CYTHON_FAST_PYCCALL
  360. #define __Pyx_PyFastCFunction_Check(func)\
  361. ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)))))
  362. #else
  363. #define __Pyx_PyFastCFunction_Check(func) 0
  364. #endif
  365. #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
  366. #define PyObject_Malloc(s) PyMem_Malloc(s)
  367. #define PyObject_Free(p) PyMem_Free(p)
  368. #define PyObject_Realloc(p) PyMem_Realloc(p)
  369. #endif
  370. #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1
  371. #define PyMem_RawMalloc(n) PyMem_Malloc(n)
  372. #define PyMem_RawRealloc(p, n) PyMem_Realloc(p, n)
  373. #define PyMem_RawFree(p) PyMem_Free(p)
  374. #endif
  375. #if CYTHON_COMPILING_IN_PYSTON
  376. #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co)
  377. #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
  378. #else
  379. #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
  380. #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
  381. #endif
  382. #if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000
  383. #define __Pyx_PyThreadState_Current PyThreadState_GET()
  384. #elif PY_VERSION_HEX >= 0x03060000
  385. #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
  386. #elif PY_VERSION_HEX >= 0x03000000
  387. #define __Pyx_PyThreadState_Current PyThreadState_GET()
  388. #else
  389. #define __Pyx_PyThreadState_Current _PyThreadState_Current
  390. #endif
  391. #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)
  392. #include "pythread.h"
  393. #define Py_tss_NEEDS_INIT 0
  394. typedef int Py_tss_t;
  395. static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) {
  396. *key = PyThread_create_key();
  397. return 0;
  398. }
  399. static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) {
  400. Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t));
  401. *key = Py_tss_NEEDS_INIT;
  402. return key;
  403. }
  404. static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) {
  405. PyObject_Free(key);
  406. }
  407. static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) {
  408. return *key != Py_tss_NEEDS_INIT;
  409. }
  410. static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) {
  411. PyThread_delete_key(*key);
  412. *key = Py_tss_NEEDS_INIT;
  413. }
  414. static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) {
  415. return PyThread_set_key_value(*key, value);
  416. }
  417. static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) {
  418. return PyThread_get_key_value(*key);
  419. }
  420. #endif
  421. #if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
  422. #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
  423. #else
  424. #define __Pyx_PyDict_NewPresized(n) PyDict_New()
  425. #endif
  426. #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
  427. #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
  428. #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
  429. #else
  430. #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
  431. #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
  432. #endif
  433. #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS
  434. #define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
  435. #else
  436. #define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name)
  437. #endif
  438. #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
  439. #define CYTHON_PEP393_ENABLED 1
  440. #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\
  441. 0 : _PyUnicode_Ready((PyObject *)(op)))
  442. #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u)
  443. #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
  444. #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u)
  445. #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u)
  446. #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u)
  447. #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i)
  448. #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch)
  449. #if defined(PyUnicode_IS_READY) && defined(PyUnicode_GET_SIZE)
  450. #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
  451. #else
  452. #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u))
  453. #endif
  454. #else
  455. #define CYTHON_PEP393_ENABLED 0
  456. #define PyUnicode_1BYTE_KIND 1
  457. #define PyUnicode_2BYTE_KIND 2
  458. #define PyUnicode_4BYTE_KIND 4
  459. #define __Pyx_PyUnicode_READY(op) (0)
  460. #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u)
  461. #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
  462. #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111)
  463. #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE))
  464. #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u))
  465. #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
  466. #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch)
  467. #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u))
  468. #endif
  469. #if CYTHON_COMPILING_IN_PYPY
  470. #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b)
  471. #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b)
  472. #else
  473. #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b)
  474. #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
  475. PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
  476. #endif
  477. #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains)
  478. #define PyUnicode_Contains(u, s) PySequence_Contains(u, s)
  479. #endif
  480. #if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check)
  481. #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type)
  482. #endif
  483. #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
  484. #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
  485. #endif
  486. #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
  487. #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
  488. #if PY_MAJOR_VERSION >= 3
  489. #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b)
  490. #else
  491. #define __Pyx_PyString_Format(a, b) PyString_Format(a, b)
  492. #endif
  493. #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
  494. #define PyObject_ASCII(o) PyObject_Repr(o)
  495. #endif
  496. #if PY_MAJOR_VERSION >= 3
  497. #define PyBaseString_Type PyUnicode_Type
  498. #define PyStringObject PyUnicodeObject
  499. #define PyString_Type PyUnicode_Type
  500. #define PyString_Check PyUnicode_Check
  501. #define PyString_CheckExact PyUnicode_CheckExact
  502. #ifndef PyObject_Unicode
  503. #define PyObject_Unicode PyObject_Str
  504. #endif
  505. #endif
  506. #if PY_MAJOR_VERSION >= 3
  507. #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
  508. #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
  509. #else
  510. #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
  511. #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
  512. #endif
  513. #ifndef PySet_CheckExact
  514. #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
  515. #endif
  516. #if PY_VERSION_HEX >= 0x030900A4
  517. #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt)
  518. #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size)
  519. #else
  520. #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt)
  521. #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size)
  522. #endif
  523. #if CYTHON_ASSUME_SAFE_MACROS
  524. #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq)
  525. #else
  526. #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq)
  527. #endif
  528. #if PY_MAJOR_VERSION >= 3
  529. #define PyIntObject PyLongObject
  530. #define PyInt_Type PyLong_Type
  531. #define PyInt_Check(op) PyLong_Check(op)
  532. #define PyInt_CheckExact(op) PyLong_CheckExact(op)
  533. #define PyInt_FromString PyLong_FromString
  534. #define PyInt_FromUnicode PyLong_FromUnicode
  535. #define PyInt_FromLong PyLong_FromLong
  536. #define PyInt_FromSize_t PyLong_FromSize_t
  537. #define PyInt_FromSsize_t PyLong_FromSsize_t
  538. #define PyInt_AsLong PyLong_AsLong
  539. #define PyInt_AS_LONG PyLong_AS_LONG
  540. #define PyInt_AsSsize_t PyLong_AsSsize_t
  541. #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask
  542. #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
  543. #define PyNumber_Int PyNumber_Long
  544. #endif
  545. #if PY_MAJOR_VERSION >= 3
  546. #define PyBoolObject PyLongObject
  547. #endif
  548. #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
  549. #ifndef PyUnicode_InternFromString
  550. #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
  551. #endif
  552. #endif
  553. #if PY_VERSION_HEX < 0x030200A4
  554. typedef long Py_hash_t;
  555. #define __Pyx_PyInt_FromHash_t PyInt_FromLong
  556. #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t
  557. #else
  558. #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
  559. #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t
  560. #endif
  561. #if PY_MAJOR_VERSION >= 3
  562. #define __Pyx_PyMethod_New(func, self, klass) ((self) ? ((void)(klass), PyMethod_New(func, self)) : __Pyx_NewRef(func))
  563. #else
  564. #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
  565. #endif
  566. #if CYTHON_USE_ASYNC_SLOTS
  567. #if PY_VERSION_HEX >= 0x030500B1
  568. #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
  569. #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
  570. #else
  571. #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
  572. #endif
  573. #else
  574. #define __Pyx_PyType_AsAsync(obj) NULL
  575. #endif
  576. #ifndef __Pyx_PyAsyncMethodsStruct
  577. typedef struct {
  578. unaryfunc am_await;
  579. unaryfunc am_aiter;
  580. unaryfunc am_anext;
  581. } __Pyx_PyAsyncMethodsStruct;
  582. #endif
  583. #if defined(WIN32) || defined(MS_WINDOWS)
  584. #define _USE_MATH_DEFINES
  585. #endif
  586. #include <math.h>
  587. #ifdef NAN
  588. #define __PYX_NAN() ((float) NAN)
  589. #else
  590. static CYTHON_INLINE float __PYX_NAN() {
  591. float value;
  592. memset(&value, 0xFF, sizeof(value));
  593. return value;
  594. }
  595. #endif
  596. #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
  597. #define __Pyx_truncl trunc
  598. #else
  599. #define __Pyx_truncl truncl
  600. #endif
  601. #define __PYX_MARK_ERR_POS(f_index, lineno) \
  602. { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; }
  603. #define __PYX_ERR(f_index, lineno, Ln_error) \
  604. { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; }
  605. #ifndef __PYX_EXTERN_C
  606. #ifdef __cplusplus
  607. #define __PYX_EXTERN_C extern "C"
  608. #else
  609. #define __PYX_EXTERN_C extern
  610. #endif
  611. #endif
  612. #define __PYX_HAVE__sasl__saslwrapper
  613. #define __PYX_HAVE_API__sasl__saslwrapper
  614. /* Early includes */
  615. #include <stdint.h>
  616. #include <string.h>
  617. #include "ios"
  618. #include "new"
  619. #include "stdexcept"
  620. #include "typeinfo"
  621. #include <string>
  622. #include "saslwrapper.h"
  623. #ifdef _OPENMP
  624. #include <omp.h>
  625. #endif /* _OPENMP */
  626. #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
  627. #define CYTHON_WITHOUT_ASSERTIONS
  628. #endif
  629. typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding;
  630. const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;
  631. #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
  632. #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0
  633. #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8)
  634. #define __PYX_DEFAULT_STRING_ENCODING ""
  635. #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
  636. #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
  637. #define __Pyx_uchar_cast(c) ((unsigned char)c)
  638. #define __Pyx_long_cast(x) ((long)x)
  639. #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\
  640. (sizeof(type) < sizeof(Py_ssize_t)) ||\
  641. (sizeof(type) > sizeof(Py_ssize_t) &&\
  642. likely(v < (type)PY_SSIZE_T_MAX ||\
  643. v == (type)PY_SSIZE_T_MAX) &&\
  644. (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
  645. v == (type)PY_SSIZE_T_MIN))) ||\
  646. (sizeof(type) == sizeof(Py_ssize_t) &&\
  647. (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
  648. v == (type)PY_SSIZE_T_MAX))) )
  649. static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
  650. return (size_t) i < (size_t) limit;
  651. }
  652. #if defined (__cplusplus) && __cplusplus >= 201103L
  653. #include <cstdlib>
  654. #define __Pyx_sst_abs(value) std::abs(value)
  655. #elif SIZEOF_INT >= SIZEOF_SIZE_T
  656. #define __Pyx_sst_abs(value) abs(value)
  657. #elif SIZEOF_LONG >= SIZEOF_SIZE_T
  658. #define __Pyx_sst_abs(value) labs(value)
  659. #elif defined (_MSC_VER)
  660. #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
  661. #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
  662. #define __Pyx_sst_abs(value) llabs(value)
  663. #elif defined (__GNUC__)
  664. #define __Pyx_sst_abs(value) __builtin_llabs(value)
  665. #else
  666. #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
  667. #endif
  668. static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*);
  669. static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
  670. #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
  671. #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
  672. #define __Pyx_PyBytes_FromString PyBytes_FromString
  673. #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
  674. static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
  675. #if PY_MAJOR_VERSION < 3
  676. #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString
  677. #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
  678. #else
  679. #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
  680. #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
  681. #endif
  682. #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s))
  683. #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s))
  684. #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s))
  685. #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s))
  686. #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s))
  687. #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s))
  688. #define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s))
  689. #define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
  690. #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
  691. #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s))
  692. #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s))
  693. #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
  694. #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
  695. #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
  696. #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s)
  697. #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
  698. static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) {
  699. const Py_UNICODE *u_end = u;
  700. while (*u_end++) ;
  701. return (size_t)(u_end - u - 1);
  702. }
  703. #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
  704. #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
  705. #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
  706. #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
  707. #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
  708. static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b);
  709. static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
  710. static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
  711. static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
  712. #define __Pyx_PySequence_Tuple(obj)\
  713. (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
  714. static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
  715. static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
  716. static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*);
  717. #if CYTHON_ASSUME_SAFE_MACROS
  718. #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
  719. #else
  720. #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
  721. #endif
  722. #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
  723. #if PY_MAJOR_VERSION >= 3
  724. #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
  725. #else
  726. #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
  727. #endif
  728. #define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x))
  729. #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
  730. static int __Pyx_sys_getdefaultencoding_not_ascii;
  731. static int __Pyx_init_sys_getdefaultencoding_params(void) {
  732. PyObject* sys;
  733. PyObject* default_encoding = NULL;
  734. PyObject* ascii_chars_u = NULL;
  735. PyObject* ascii_chars_b = NULL;
  736. const char* default_encoding_c;
  737. sys = PyImport_ImportModule("sys");
  738. if (!sys) goto bad;
  739. default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL);
  740. Py_DECREF(sys);
  741. if (!default_encoding) goto bad;
  742. default_encoding_c = PyBytes_AsString(default_encoding);
  743. if (!default_encoding_c) goto bad;
  744. if (strcmp(default_encoding_c, "ascii") == 0) {
  745. __Pyx_sys_getdefaultencoding_not_ascii = 0;
  746. } else {
  747. char ascii_chars[128];
  748. int c;
  749. for (c = 0; c < 128; c++) {
  750. ascii_chars[c] = c;
  751. }
  752. __Pyx_sys_getdefaultencoding_not_ascii = 1;
  753. ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
  754. if (!ascii_chars_u) goto bad;
  755. ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
  756. if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
  757. PyErr_Format(
  758. PyExc_ValueError,
  759. "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
  760. default_encoding_c);
  761. goto bad;
  762. }
  763. Py_DECREF(ascii_chars_u);
  764. Py_DECREF(ascii_chars_b);
  765. }
  766. Py_DECREF(default_encoding);
  767. return 0;
  768. bad:
  769. Py_XDECREF(default_encoding);
  770. Py_XDECREF(ascii_chars_u);
  771. Py_XDECREF(ascii_chars_b);
  772. return -1;
  773. }
  774. #endif
  775. #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
  776. #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
  777. #else
  778. #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
  779. #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
  780. static char* __PYX_DEFAULT_STRING_ENCODING;
  781. static int __Pyx_init_sys_getdefaultencoding_params(void) {
  782. PyObject* sys;
  783. PyObject* default_encoding = NULL;
  784. char* default_encoding_c;
  785. sys = PyImport_ImportModule("sys");
  786. if (!sys) goto bad;
  787. default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
  788. Py_DECREF(sys);
  789. if (!default_encoding) goto bad;
  790. default_encoding_c = PyBytes_AsString(default_encoding);
  791. if (!default_encoding_c) goto bad;
  792. __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1);
  793. if (!__PYX_DEFAULT_STRING_ENCODING) goto bad;
  794. strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
  795. Py_DECREF(default_encoding);
  796. return 0;
  797. bad:
  798. Py_XDECREF(default_encoding);
  799. return -1;
  800. }
  801. #endif
  802. #endif
  803. /* Test for GCC > 2.95 */
  804. #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
  805. #define likely(x) __builtin_expect(!!(x), 1)
  806. #define unlikely(x) __builtin_expect(!!(x), 0)
  807. #else /* !__GNUC__ or GCC < 2.95 */
  808. #define likely(x) (x)
  809. #define unlikely(x) (x)
  810. #endif /* __GNUC__ */
  811. static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }
  812. static PyObject *__pyx_m = NULL;
  813. static PyObject *__pyx_d;
  814. static PyObject *__pyx_b;
  815. static PyObject *__pyx_cython_runtime = NULL;
  816. static PyObject *__pyx_empty_tuple;
  817. static PyObject *__pyx_empty_bytes;
  818. static PyObject *__pyx_empty_unicode;
  819. static int __pyx_lineno;
  820. static int __pyx_clineno = 0;
  821. static const char * __pyx_cfilenm= __FILE__;
  822. static const char *__pyx_filename;
  823. static const char *__pyx_f[] = {
  824. "stringsource",
  825. "sasl/saslwrapper.pyx",
  826. };
  827. /*--- Type declarations ---*/
  828. struct __pyx_obj_4sasl_11saslwrapper_Client;
  829. /* "sasl/saslwrapper.pyx":50
  830. *
  831. *
  832. * cdef class Client: # <<<<<<<<<<<<<<
  833. * cdef ClientImpl _this
  834. *
  835. */
  836. struct __pyx_obj_4sasl_11saslwrapper_Client {
  837. PyObject_HEAD
  838. struct __pyx_vtabstruct_4sasl_11saslwrapper_Client *__pyx_vtab;
  839. saslwrapper::ClientImpl _this;
  840. };
  841. struct __pyx_vtabstruct_4sasl_11saslwrapper_Client {
  842. PyObject *(*setAttr)(struct __pyx_obj_4sasl_11saslwrapper_Client *, PyObject *, PyObject *, int __pyx_skip_dispatch);
  843. PyObject *(*init)(struct __pyx_obj_4sasl_11saslwrapper_Client *, int __pyx_skip_dispatch);
  844. PyObject *(*start)(struct __pyx_obj_4sasl_11saslwrapper_Client *, PyObject *, int __pyx_skip_dispatch);
  845. PyObject *(*step)(struct __pyx_obj_4sasl_11saslwrapper_Client *, PyObject *, int __pyx_skip_dispatch);
  846. PyObject *(*encode)(struct __pyx_obj_4sasl_11saslwrapper_Client *, PyObject *, int __pyx_skip_dispatch);
  847. PyObject *(*decode)(struct __pyx_obj_4sasl_11saslwrapper_Client *, PyObject *, int __pyx_skip_dispatch);
  848. PyObject *(*getUserId)(struct __pyx_obj_4sasl_11saslwrapper_Client *, int __pyx_skip_dispatch);
  849. PyObject *(*getSSF)(struct __pyx_obj_4sasl_11saslwrapper_Client *, int __pyx_skip_dispatch);
  850. PyObject *(*getError)(struct __pyx_obj_4sasl_11saslwrapper_Client *, int __pyx_skip_dispatch);
  851. };
  852. static struct __pyx_vtabstruct_4sasl_11saslwrapper_Client *__pyx_vtabptr_4sasl_11saslwrapper_Client;
  853. /* --- Runtime support code (head) --- */
  854. /* Refnanny.proto */
  855. #ifndef CYTHON_REFNANNY
  856. #define CYTHON_REFNANNY 0
  857. #endif
  858. #if CYTHON_REFNANNY
  859. typedef struct {
  860. void (*INCREF)(void*, PyObject*, int);
  861. void (*DECREF)(void*, PyObject*, int);
  862. void (*GOTREF)(void*, PyObject*, int);
  863. void (*GIVEREF)(void*, PyObject*, int);
  864. void* (*SetupContext)(const char*, int, const char*);
  865. void (*FinishContext)(void**);
  866. } __Pyx_RefNannyAPIStruct;
  867. static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
  868. static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
  869. #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
  870. #ifdef WITH_THREAD
  871. #define __Pyx_RefNannySetupContext(name, acquire_gil)\
  872. if (acquire_gil) {\
  873. PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
  874. __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
  875. PyGILState_Release(__pyx_gilstate_save);\
  876. } else {\
  877. __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
  878. }
  879. #else
  880. #define __Pyx_RefNannySetupContext(name, acquire_gil)\
  881. __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
  882. #endif
  883. #define __Pyx_RefNannyFinishContext()\
  884. __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
  885. #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  886. #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  887. #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  888. #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  889. #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
  890. #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
  891. #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
  892. #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
  893. #else
  894. #define __Pyx_RefNannyDeclarations
  895. #define __Pyx_RefNannySetupContext(name, acquire_gil)
  896. #define __Pyx_RefNannyFinishContext()
  897. #define __Pyx_INCREF(r) Py_INCREF(r)
  898. #define __Pyx_DECREF(r) Py_DECREF(r)
  899. #define __Pyx_GOTREF(r)
  900. #define __Pyx_GIVEREF(r)
  901. #define __Pyx_XINCREF(r) Py_XINCREF(r)
  902. #define __Pyx_XDECREF(r) Py_XDECREF(r)
  903. #define __Pyx_XGOTREF(r)
  904. #define __Pyx_XGIVEREF(r)
  905. #endif
  906. #define __Pyx_XDECREF_SET(r, v) do {\
  907. PyObject *tmp = (PyObject *) r;\
  908. r = v; __Pyx_XDECREF(tmp);\
  909. } while (0)
  910. #define __Pyx_DECREF_SET(r, v) do {\
  911. PyObject *tmp = (PyObject *) r;\
  912. r = v; __Pyx_DECREF(tmp);\
  913. } while (0)
  914. #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
  915. #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
  916. /* PyObjectGetAttrStr.proto */
  917. #if CYTHON_USE_TYPE_SLOTS
  918. static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
  919. #else
  920. #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
  921. #endif
  922. /* GetBuiltinName.proto */
  923. static PyObject *__Pyx_GetBuiltinName(PyObject *name);
  924. /* PyDictVersioning.proto */
  925. #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
  926. #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1)
  927. #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag)
  928. #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\
  929. (version_var) = __PYX_GET_DICT_VERSION(dict);\
  930. (cache_var) = (value);
  931. #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\
  932. static PY_UINT64_T __pyx_dict_version = 0;\
  933. static PyObject *__pyx_dict_cached_value = NULL;\
  934. if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
  935. (VAR) = __pyx_dict_cached_value;\
  936. } else {\
  937. (VAR) = __pyx_dict_cached_value = (LOOKUP);\
  938. __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
  939. }\
  940. }
  941. static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj);
  942. static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj);
  943. static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);
  944. #else
  945. #define __PYX_GET_DICT_VERSION(dict) (0)
  946. #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)
  947. #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP);
  948. #endif
  949. /* GetModuleGlobalName.proto */
  950. #if CYTHON_USE_DICT_VERSIONS
  951. #define __Pyx_GetModuleGlobalName(var, name) {\
  952. static PY_UINT64_T __pyx_dict_version = 0;\
  953. static PyObject *__pyx_dict_cached_value = NULL;\
  954. (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\
  955. (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\
  956. __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
  957. }
  958. #define __Pyx_GetModuleGlobalNameUncached(var, name) {\
  959. PY_UINT64_T __pyx_dict_version;\
  960. PyObject *__pyx_dict_cached_value;\
  961. (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
  962. }
  963. static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value);
  964. #else
  965. #define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name)
  966. #define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name)
  967. static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name);
  968. #endif
  969. /* PyCFunctionFastCall.proto */
  970. #if CYTHON_FAST_PYCCALL
  971. static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
  972. #else
  973. #define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL)
  974. #endif
  975. /* PyFunctionFastCall.proto */
  976. #if CYTHON_FAST_PYCALL
  977. #define __Pyx_PyFunction_FastCall(func, args, nargs)\
  978. __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
  979. #if 1 || PY_VERSION_HEX < 0x030600B1
  980. static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs);
  981. #else
  982. #define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs)
  983. #endif
  984. #define __Pyx_BUILD_ASSERT_EXPR(cond)\
  985. (sizeof(char [1 - 2*!(cond)]) - 1)
  986. #ifndef Py_MEMBER_SIZE
  987. #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member)
  988. #endif
  989. static size_t __pyx_pyframe_localsplus_offset = 0;
  990. #include "frameobject.h"
  991. #define __Pxy_PyFrame_Initialize_Offsets()\
  992. ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\
  993. (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus)))
  994. #define __Pyx_PyFrame_GetLocalsplus(frame)\
  995. (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset))
  996. #endif
  997. /* PyObjectCall.proto */
  998. #if CYTHON_COMPILING_IN_CPYTHON
  999. static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
  1000. #else
  1001. #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
  1002. #endif
  1003. /* PyObjectCall2Args.proto */
  1004. static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2);
  1005. /* PyObjectCallMethO.proto */
  1006. #if CYTHON_COMPILING_IN_CPYTHON
  1007. static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
  1008. #endif
  1009. /* PyObjectCallOneArg.proto */
  1010. static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
  1011. /* PyThreadStateGet.proto */
  1012. #if CYTHON_FAST_THREAD_STATE
  1013. #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
  1014. #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;
  1015. #define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type
  1016. #else
  1017. #define __Pyx_PyThreadState_declare
  1018. #define __Pyx_PyThreadState_assign
  1019. #define __Pyx_PyErr_Occurred() PyErr_Occurred()
  1020. #endif
  1021. /* PyErrFetchRestore.proto */
  1022. #if CYTHON_FAST_THREAD_STATE
  1023. #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
  1024. #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
  1025. #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
  1026. #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
  1027. #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
  1028. static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
  1029. static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
  1030. #if CYTHON_COMPILING_IN_CPYTHON
  1031. #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
  1032. #else
  1033. #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
  1034. #endif
  1035. #else
  1036. #define __Pyx_PyErr_Clear() PyErr_Clear()
  1037. #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
  1038. #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
  1039. #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
  1040. #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb)
  1041. #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb)
  1042. #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
  1043. #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
  1044. #endif
  1045. /* WriteUnraisableException.proto */
  1046. static void __Pyx_WriteUnraisable(const char *name, int clineno,
  1047. int lineno, const char *filename,
  1048. int full_traceback, int nogil);
  1049. /* RaiseArgTupleInvalid.proto */
  1050. static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
  1051. Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
  1052. /* RaiseDoubleKeywords.proto */
  1053. static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);
  1054. /* ParseKeywords.proto */
  1055. static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
  1056. PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
  1057. const char* function_name);
  1058. /* PyObjectCallNoArg.proto */
  1059. #if CYTHON_COMPILING_IN_CPYTHON
  1060. static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func);
  1061. #else
  1062. #define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL)
  1063. #endif
  1064. /* RaiseException.proto */
  1065. static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
  1066. /* PyObject_GenericGetAttrNoDict.proto */
  1067. #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
  1068. static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name);
  1069. #else
  1070. #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr
  1071. #endif
  1072. /* PyObject_GenericGetAttr.proto */
  1073. #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
  1074. static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name);
  1075. #else
  1076. #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr
  1077. #endif
  1078. /* SetVTable.proto */
  1079. static int __Pyx_SetVtable(PyObject *dict, void *vtable);
  1080. /* PyErrExceptionMatches.proto */
  1081. #if CYTHON_FAST_THREAD_STATE
  1082. #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
  1083. static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
  1084. #else
  1085. #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
  1086. #endif
  1087. /* PyObjectGetAttrStrNoError.proto */
  1088. static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name);
  1089. /* SetupReduce.proto */
  1090. static int __Pyx_setup_reduce(PyObject* type_obj);
  1091. /* Import.proto */
  1092. static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);
  1093. /* ImportFrom.proto */
  1094. static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
  1095. /* CLineInTraceback.proto */
  1096. #ifdef CYTHON_CLINE_IN_TRACEBACK
  1097. #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
  1098. #else
  1099. static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);
  1100. #endif
  1101. /* CodeObjectCache.proto */
  1102. typedef struct {
  1103. PyCodeObject* code_object;
  1104. int code_line;
  1105. } __Pyx_CodeObjectCacheEntry;
  1106. struct __Pyx_CodeObjectCache {
  1107. int count;
  1108. int max_count;
  1109. __Pyx_CodeObjectCacheEntry* entries;
  1110. };
  1111. static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
  1112. static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
  1113. static PyCodeObject *__pyx_find_code_object(int code_line);
  1114. static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
  1115. /* AddTraceback.proto */
  1116. static void __Pyx_AddTraceback(const char *funcname, int c_line,
  1117. int py_line, const char *filename);
  1118. /* None.proto */
  1119. #include <new>
  1120. /* CIntToPy.proto */
  1121. static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);
  1122. /* CIntFromPy.proto */
  1123. static CYTHON_INLINE uint32_t __Pyx_PyInt_As_uint32_t(PyObject *);
  1124. /* CIntToPy.proto */
  1125. static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
  1126. /* CIntFromPy.proto */
  1127. static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
  1128. /* CIntFromPy.proto */
  1129. static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
  1130. /* FastTypeChecks.proto */
  1131. #if CYTHON_COMPILING_IN_CPYTHON
  1132. #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
  1133. static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
  1134. static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
  1135. static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
  1136. #else
  1137. #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
  1138. #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
  1139. #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
  1140. #endif
  1141. #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
  1142. /* CheckBinaryVersion.proto */
  1143. static int __Pyx_check_binary_version(void);
  1144. /* InitStrings.proto */
  1145. static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
  1146. static PyObject *__pyx_f_4sasl_11saslwrapper_6Client_setAttr(struct __pyx_obj_4sasl_11saslwrapper_Client *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_value, int __pyx_skip_dispatch); /* proto*/
  1147. static PyObject *__pyx_f_4sasl_11saslwrapper_6Client_init(struct __pyx_obj_4sasl_11saslwrapper_Client *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
  1148. static PyObject *__pyx_f_4sasl_11saslwrapper_6Client_start(struct __pyx_obj_4sasl_11saslwrapper_Client *__pyx_v_self, PyObject *__pyx_v_mech_list, int __pyx_skip_dispatch); /* proto*/
  1149. static PyObject *__pyx_f_4sasl_11saslwrapper_6Client_step(struct __pyx_obj_4sasl_11saslwrapper_Client *__pyx_v_self, PyObject *__pyx_v_challenge, int __pyx_skip_dispatch); /* proto*/
  1150. static PyObject *__pyx_f_4sasl_11saslwrapper_6Client_encode(struct __pyx_obj_4sasl_11saslwrapper_Client *__pyx_v_self, PyObject *__pyx_v_clear_text, int __pyx_skip_dispatch); /* proto*/
  1151. static PyObject *__pyx_f_4sasl_11saslwrapper_6Client_decode(struct __pyx_obj_4sasl_11saslwrapper_Client *__pyx_v_self, PyObject *__pyx_v_cipher_text, int __pyx_skip_dispatch); /* proto*/
  1152. static PyObject *__pyx_f_4sasl_11saslwrapper_6Client_getUserId(struct __pyx_obj_4sasl_11saslwrapper_Client *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
  1153. static PyObject *__pyx_f_4sasl_11saslwrapper_6Client_getSSF(struct __pyx_obj_4sasl_11saslwrapper_Client *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
  1154. static PyObject *__pyx_f_4sasl_11saslwrapper_6Client_getError(struct __pyx_obj_4sasl_11saslwrapper_Client *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
  1155. /* Module declarations from 'libcpp' */
  1156. /* Module declarations from 'libc.stdint' */
  1157. /* Module declarations from 'libc.string' */
  1158. /* Module declarations from 'libcpp.string' */
  1159. /* Module declarations from 'sasl.saslwrapper' */
  1160. static PyTypeObject *__pyx_ptype_4sasl_11saslwrapper_Client = 0;
  1161. static std::string __pyx_f_4sasl_11saslwrapper_to_bytes(PyObject *, int __pyx_skip_dispatch); /*proto*/
  1162. static PyObject *__pyx_f_4sasl_11saslwrapper_to_string(PyObject *, int __pyx_skip_dispatch); /*proto*/
  1163. static std::string __pyx_convert_string_from_py_std__in_string(PyObject *); /*proto*/
  1164. static CYTHON_INLINE PyObject *__pyx_convert_PyObject_string_to_py_std__in_string(std::string const &); /*proto*/
  1165. static CYTHON_INLINE PyObject *__pyx_convert_PyUnicode_string_to_py_std__in_string(std::string const &); /*proto*/
  1166. static CYTHON_INLINE PyObject *__pyx_convert_PyStr_string_to_py_std__in_string(std::string const &); /*proto*/
  1167. static CYTHON_INLINE PyObject *__pyx_convert_PyBytes_string_to_py_std__in_string(std::string const &); /*proto*/
  1168. static CYTHON_INLINE PyObject *__pyx_convert_PyByteArray_string_to_py_std__in_string(std::string const &); /*proto*/
  1169. #define __Pyx_MODULE_NAME "sasl.saslwrapper"
  1170. extern int __pyx_module_is_main_sasl__saslwrapper;
  1171. int __pyx_module_is_main_sasl__saslwrapper = 0;
  1172. /* Implementation of 'sasl.saslwrapper' */
  1173. static PyObject *__pyx_builtin_TypeError;
  1174. static const char __pyx_k_PY3[] = "PY3";
  1175. static const char __pyx_k_key[] = "key";
  1176. static const char __pyx_k_six[] = "six";
  1177. static const char __pyx_k_init[] = "init";
  1178. static const char __pyx_k_main[] = "__main__";
  1179. static const char __pyx_k_name[] = "__name__";
  1180. static const char __pyx_k_step[] = "step";
  1181. static const char __pyx_k_test[] = "__test__";
  1182. static const char __pyx_k_start[] = "start";
  1183. static const char __pyx_k_utf_8[] = "utf-8";
  1184. static const char __pyx_k_value[] = "value";
  1185. static const char __pyx_k_Client[] = "Client";
  1186. static const char __pyx_k_decode[] = "decode";
  1187. static const char __pyx_k_encode[] = "encode";
  1188. static const char __pyx_k_getSSF[] = "getSSF";
  1189. static const char __pyx_k_import[] = "__import__";
  1190. static const char __pyx_k_reduce[] = "__reduce__";
  1191. static const char __pyx_k_setAttr[] = "setAttr";
  1192. static const char __pyx_k_getError[] = "getError";
  1193. static const char __pyx_k_getstate[] = "__getstate__";
  1194. static const char __pyx_k_setstate[] = "__setstate__";
  1195. static const char __pyx_k_TypeError[] = "TypeError";
  1196. static const char __pyx_k_getUserId[] = "getUserId";
  1197. static const char __pyx_k_reduce_ex[] = "__reduce_ex__";
  1198. static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
  1199. static const char __pyx_k_string_types[] = "string_types";
  1200. static const char __pyx_k_reduce_cython[] = "__reduce_cython__";
  1201. static const char __pyx_k_setstate_cython[] = "__setstate_cython__";
  1202. static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
  1203. static const char __pyx_k_self__this_cannot_be_converted_t[] = "self._this cannot be converted to a Python object for pickling";
  1204. static PyObject *__pyx_n_s_Client;
  1205. static PyObject *__pyx_n_s_PY3;
  1206. static PyObject *__pyx_n_s_TypeError;
  1207. static PyObject *__pyx_n_s_cline_in_traceback;
  1208. static PyObject *__pyx_n_s_decode;
  1209. static PyObject *__pyx_n_s_encode;
  1210. static PyObject *__pyx_n_s_getError;
  1211. static PyObject *__pyx_n_s_getSSF;
  1212. static PyObject *__pyx_n_s_getUserId;
  1213. static PyObject *__pyx_n_s_getstate;
  1214. static PyObject *__pyx_n_s_import;
  1215. static PyObject *__pyx_n_s_init;
  1216. static PyObject *__pyx_n_s_key;
  1217. static PyObject *__pyx_n_s_main;
  1218. static PyObject *__pyx_n_s_name;
  1219. static PyObject *__pyx_n_s_pyx_vtable;
  1220. static PyObject *__pyx_n_s_reduce;
  1221. static PyObject *__pyx_n_s_reduce_cython;
  1222. static PyObject *__pyx_n_s_reduce_ex;
  1223. static PyObject *__pyx_kp_s_self__this_cannot_be_converted_t;
  1224. static PyObject *__pyx_n_s_setAttr;
  1225. static PyObject *__pyx_n_s_setstate;
  1226. static PyObject *__pyx_n_s_setstate_cython;
  1227. static PyObject *__pyx_n_s_six;
  1228. static PyObject *__pyx_n_s_start;
  1229. static PyObject *__pyx_n_s_step;
  1230. static PyObject *__pyx_n_s_string_types;
  1231. static PyObject *__pyx_n_s_test;
  1232. static PyObject *__pyx_kp_u_utf_8;
  1233. static PyObject *__pyx_n_s_value;
  1234. static PyObject *__pyx_pf_4sasl_11saslwrapper_to_bytes(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_bytes_or_str); /* proto */
  1235. static PyObject *__pyx_pf_4sasl_11saslwrapper_2to_string(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_bytes_or_str); /* proto */
  1236. static PyObject *__pyx_pf_4sasl_11saslwrapper_6Client_setAttr(struct __pyx_obj_4sasl_11saslwrapper_Client *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_value); /* proto */
  1237. static PyObject *__pyx_pf_4sasl_11saslwrapper_6Client_2init(struct __pyx_obj_4sasl_11saslwrapper_Client *__pyx_v_self); /* proto */
  1238. static PyObject *__pyx_pf_4sasl_11saslwrapper_6Client_4start(struct __pyx_obj_4sasl_11saslwrapper_Client *__pyx_v_self, PyObject *__pyx_v_mech_list); /* proto */
  1239. static PyObject *__pyx_pf_4sasl_11saslwrapper_6Client_6step(struct __pyx_obj_4sasl_11saslwrapper_Client *__pyx_v_self, PyObject *__pyx_v_challenge); /* proto */
  1240. static PyObject *__pyx_pf_4sasl_11saslwrapper_6Client_8encode(struct __pyx_obj_4sasl_11saslwrapper_Client *__pyx_v_self, PyObject *__pyx_v_clear_text); /* proto */
  1241. static PyObject *__pyx_pf_4sasl_11saslwrapper_6Client_10decode(struct __pyx_obj_4sasl_11saslwrapper_Client *__pyx_v_self, PyObject *__pyx_v_cipher_text); /* proto */
  1242. static PyObject *__pyx_pf_4sasl_11saslwrapper_6Client_12getUserId(struct __pyx_obj_4sasl_11saslwrapper_Client *__pyx_v_self); /* proto */
  1243. static PyObject *__pyx_pf_4sasl_11saslwrapper_6Client_14getSSF(struct __pyx_obj_4sasl_11saslwrapper_Client *__pyx_v_self); /* proto */
  1244. static PyObject *__pyx_pf_4sasl_11saslwrapper_6Client_16getError(struct __pyx_obj_4sasl_11saslwrapper_Client *__pyx_v_self); /* proto */
  1245. static PyObject *__pyx_pf_4sasl_11saslwrapper_6Client_18__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_4sasl_11saslwrapper_Client *__pyx_v_self); /* proto */
  1246. static PyObject *__pyx_pf_4sasl_11saslwrapper_6Client_20__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_4sasl_11saslwrapper_Client *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
  1247. static PyObject *__pyx_tp_new_4sasl_11saslwrapper_Client(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
  1248. static PyObject *__pyx_tuple_;
  1249. static PyObject *__pyx_tuple__2;
  1250. /* Late includes */
  1251. /* "sasl/saslwrapper.pyx":38
  1252. *
  1253. *
  1254. * cpdef string_t to_bytes(bytes_or_str): # <<<<<<<<<<<<<<
  1255. * if PY3 and isinstance(bytes_or_str, string_types):
  1256. * return bytes_or_str.encode('utf-8')
  1257. */
  1258. static PyObject *__pyx_pw_4sasl_11saslwrapper_1to_bytes(PyObject *__pyx_self, PyObject *__pyx_v_bytes_or_str); /*proto*/
  1259. static std::string __pyx_f_4sasl_11saslwrapper_to_bytes(PyObject *__pyx_v_bytes_or_str, CYTHON_UNUSED int __pyx_skip_dispatch) {
  1260. std::string __pyx_r;
  1261. __Pyx_RefNannyDeclarations
  1262. int __pyx_t_1;
  1263. PyObject *__pyx_t_2 = NULL;
  1264. int __pyx_t_3;
  1265. int __pyx_t_4;
  1266. PyObject *__pyx_t_5 = NULL;
  1267. PyObject *__pyx_t_6 = NULL;
  1268. std::string __pyx_t_7;
  1269. int __pyx_lineno = 0;
  1270. const char *__pyx_filename = NULL;
  1271. int __pyx_clineno = 0;
  1272. __Pyx_RefNannySetupContext("to_bytes", 0);
  1273. /* "sasl/saslwrapper.pyx":39
  1274. *
  1275. * cpdef string_t to_bytes(bytes_or_str):
  1276. * if PY3 and isinstance(bytes_or_str, string_types): # <<<<<<<<<<<<<<
  1277. * return bytes_or_str.encode('utf-8')
  1278. * return bytes_or_str
  1279. */
  1280. __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_PY3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 39, __pyx_L1_error)
  1281. __Pyx_GOTREF(__pyx_t_2);
  1282. __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(1, 39, __pyx_L1_error)
  1283. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  1284. if (__pyx_t_3) {
  1285. } else {
  1286. __pyx_t_1 = __pyx_t_3;
  1287. goto __pyx_L4_bool_binop_done;
  1288. }
  1289. __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_string_types); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 39, __pyx_L1_error)
  1290. __Pyx_GOTREF(__pyx_t_2);
  1291. __pyx_t_3 = PyObject_IsInstance(__pyx_v_bytes_or_str, __pyx_t_2); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 39, __pyx_L1_error)
  1292. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  1293. __pyx_t_4 = (__pyx_t_3 != 0);
  1294. __pyx_t_1 = __pyx_t_4;
  1295. __pyx_L4_bool_binop_done:;
  1296. if (__pyx_t_1) {
  1297. /* "sasl/saslwrapper.pyx":40
  1298. * cpdef string_t to_bytes(bytes_or_str):
  1299. * if PY3 and isinstance(bytes_or_str, string_types):
  1300. * return bytes_or_str.encode('utf-8') # <<<<<<<<<<<<<<
  1301. * return bytes_or_str
  1302. *
  1303. */
  1304. __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_bytes_or_str, __pyx_n_s_encode); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 40, __pyx_L1_error)
  1305. __Pyx_GOTREF(__pyx_t_5);
  1306. __pyx_t_6 = NULL;
  1307. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
  1308. __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
  1309. if (likely(__pyx_t_6)) {
  1310. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
  1311. __Pyx_INCREF(__pyx_t_6);
  1312. __Pyx_INCREF(function);
  1313. __Pyx_DECREF_SET(__pyx_t_5, function);
  1314. }
  1315. }
  1316. __pyx_t_2 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_kp_u_utf_8) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_kp_u_utf_8);
  1317. __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  1318. if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 40, __pyx_L1_error)
  1319. __Pyx_GOTREF(__pyx_t_2);
  1320. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  1321. __pyx_t_7 = __pyx_convert_string_from_py_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 40, __pyx_L1_error)
  1322. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  1323. __pyx_r = __pyx_t_7;
  1324. goto __pyx_L0;
  1325. /* "sasl/saslwrapper.pyx":39
  1326. *
  1327. * cpdef string_t to_bytes(bytes_or_str):
  1328. * if PY3 and isinstance(bytes_or_str, string_types): # <<<<<<<<<<<<<<
  1329. * return bytes_or_str.encode('utf-8')
  1330. * return bytes_or_str
  1331. */
  1332. }
  1333. /* "sasl/saslwrapper.pyx":41
  1334. * if PY3 and isinstance(bytes_or_str, string_types):
  1335. * return bytes_or_str.encode('utf-8')
  1336. * return bytes_or_str # <<<<<<<<<<<<<<
  1337. *
  1338. *
  1339. */
  1340. __pyx_t_7 = __pyx_convert_string_from_py_std__in_string(__pyx_v_bytes_or_str); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 41, __pyx_L1_error)
  1341. __pyx_r = __pyx_t_7;
  1342. goto __pyx_L0;
  1343. /* "sasl/saslwrapper.pyx":38
  1344. *
  1345. *
  1346. * cpdef string_t to_bytes(bytes_or_str): # <<<<<<<<<<<<<<
  1347. * if PY3 and isinstance(bytes_or_str, string_types):
  1348. * return bytes_or_str.encode('utf-8')
  1349. */
  1350. /* function exit code */
  1351. __pyx_L1_error:;
  1352. __Pyx_XDECREF(__pyx_t_2);
  1353. __Pyx_XDECREF(__pyx_t_5);
  1354. __Pyx_XDECREF(__pyx_t_6);
  1355. __Pyx_WriteUnraisable("sasl.saslwrapper.to_bytes", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  1356. __Pyx_pretend_to_initialize(&__pyx_r);
  1357. __pyx_L0:;
  1358. __Pyx_RefNannyFinishContext();
  1359. return __pyx_r;
  1360. }
  1361. /* Python wrapper */
  1362. static PyObject *__pyx_pw_4sasl_11saslwrapper_1to_bytes(PyObject *__pyx_self, PyObject *__pyx_v_bytes_or_str); /*proto*/
  1363. static PyObject *__pyx_pw_4sasl_11saslwrapper_1to_bytes(PyObject *__pyx_self, PyObject *__pyx_v_bytes_or_str) {
  1364. PyObject *__pyx_r = 0;
  1365. __Pyx_RefNannyDeclarations
  1366. __Pyx_RefNannySetupContext("to_bytes (wrapper)", 0);
  1367. __pyx_r = __pyx_pf_4sasl_11saslwrapper_to_bytes(__pyx_self, ((PyObject *)__pyx_v_bytes_or_str));
  1368. /* function exit code */
  1369. __Pyx_RefNannyFinishContext();
  1370. return __pyx_r;
  1371. }
  1372. static PyObject *__pyx_pf_4sasl_11saslwrapper_to_bytes(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_bytes_or_str) {
  1373. PyObject *__pyx_r = NULL;
  1374. __Pyx_RefNannyDeclarations
  1375. PyObject *__pyx_t_1 = NULL;
  1376. int __pyx_lineno = 0;
  1377. const char *__pyx_filename = NULL;
  1378. int __pyx_clineno = 0;
  1379. __Pyx_RefNannySetupContext("to_bytes", 0);
  1380. __Pyx_XDECREF(__pyx_r);
  1381. __pyx_t_1 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_f_4sasl_11saslwrapper_to_bytes(__pyx_v_bytes_or_str, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 38, __pyx_L1_error)
  1382. __Pyx_GOTREF(__pyx_t_1);
  1383. __pyx_r = __pyx_t_1;
  1384. __pyx_t_1 = 0;
  1385. goto __pyx_L0;
  1386. /* function exit code */
  1387. __pyx_L1_error:;
  1388. __Pyx_XDECREF(__pyx_t_1);
  1389. __Pyx_AddTraceback("sasl.saslwrapper.to_bytes", __pyx_clineno, __pyx_lineno, __pyx_filename);
  1390. __pyx_r = NULL;
  1391. __pyx_L0:;
  1392. __Pyx_XGIVEREF(__pyx_r);
  1393. __Pyx_RefNannyFinishContext();
  1394. return __pyx_r;
  1395. }
  1396. /* "sasl/saslwrapper.pyx":44
  1397. *
  1398. *
  1399. * cpdef to_string(bytes_or_str): # <<<<<<<<<<<<<<
  1400. * if isinstance(bytes_or_str, bytes):
  1401. * return bytes_or_str.decode('utf-8')
  1402. */
  1403. static PyObject *__pyx_pw_4sasl_11saslwrapper_3to_string(PyObject *__pyx_self, PyObject *__pyx_v_bytes_or_str); /*proto*/
  1404. static PyObject *__pyx_f_4sasl_11saslwrapper_to_string(PyObject *__pyx_v_bytes_or_str, CYTHON_UNUSED int __pyx_skip_dispatch) {
  1405. PyObject *__pyx_r = NULL;
  1406. __Pyx_RefNannyDeclarations
  1407. int __pyx_t_1;
  1408. int __pyx_t_2;
  1409. PyObject *__pyx_t_3 = NULL;
  1410. PyObject *__pyx_t_4 = NULL;
  1411. PyObject *__pyx_t_5 = NULL;
  1412. int __pyx_lineno = 0;
  1413. const char *__pyx_filename = NULL;
  1414. int __pyx_clineno = 0;
  1415. __Pyx_RefNannySetupContext("to_string", 0);
  1416. /* "sasl/saslwrapper.pyx":45
  1417. *
  1418. * cpdef to_string(bytes_or_str):
  1419. * if isinstance(bytes_or_str, bytes): # <<<<<<<<<<<<<<
  1420. * return bytes_or_str.decode('utf-8')
  1421. * return bytes_or_str
  1422. */
  1423. __pyx_t_1 = PyBytes_Check(__pyx_v_bytes_or_str);
  1424. __pyx_t_2 = (__pyx_t_1 != 0);
  1425. if (__pyx_t_2) {
  1426. /* "sasl/saslwrapper.pyx":46
  1427. * cpdef to_string(bytes_or_str):
  1428. * if isinstance(bytes_or_str, bytes):
  1429. * return bytes_or_str.decode('utf-8') # <<<<<<<<<<<<<<
  1430. * return bytes_or_str
  1431. *
  1432. */
  1433. __Pyx_XDECREF(__pyx_r);
  1434. __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_bytes_or_str, __pyx_n_s_decode); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 46, __pyx_L1_error)
  1435. __Pyx_GOTREF(__pyx_t_4);
  1436. __pyx_t_5 = NULL;
  1437. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
  1438. __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
  1439. if (likely(__pyx_t_5)) {
  1440. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
  1441. __Pyx_INCREF(__pyx_t_5);
  1442. __Pyx_INCREF(function);
  1443. __Pyx_DECREF_SET(__pyx_t_4, function);
  1444. }
  1445. }
  1446. __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_kp_u_utf_8) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_kp_u_utf_8);
  1447. __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  1448. if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 46, __pyx_L1_error)
  1449. __Pyx_GOTREF(__pyx_t_3);
  1450. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  1451. __pyx_r = __pyx_t_3;
  1452. __pyx_t_3 = 0;
  1453. goto __pyx_L0;
  1454. /* "sasl/saslwrapper.pyx":45
  1455. *
  1456. * cpdef to_string(bytes_or_str):
  1457. * if isinstance(bytes_or_str, bytes): # <<<<<<<<<<<<<<
  1458. * return bytes_or_str.decode('utf-8')
  1459. * return bytes_or_str
  1460. */
  1461. }
  1462. /* "sasl/saslwrapper.pyx":47
  1463. * if isinstance(bytes_or_str, bytes):
  1464. * return bytes_or_str.decode('utf-8')
  1465. * return bytes_or_str # <<<<<<<<<<<<<<
  1466. *
  1467. *
  1468. */
  1469. __Pyx_XDECREF(__pyx_r);
  1470. __Pyx_INCREF(__pyx_v_bytes_or_str);
  1471. __pyx_r = __pyx_v_bytes_or_str;
  1472. goto __pyx_L0;
  1473. /* "sasl/saslwrapper.pyx":44
  1474. *
  1475. *
  1476. * cpdef to_string(bytes_or_str): # <<<<<<<<<<<<<<
  1477. * if isinstance(bytes_or_str, bytes):
  1478. * return bytes_or_str.decode('utf-8')
  1479. */
  1480. /* function exit code */
  1481. __pyx_L1_error:;
  1482. __Pyx_XDECREF(__pyx_t_3);
  1483. __Pyx_XDECREF(__pyx_t_4);
  1484. __Pyx_XDECREF(__pyx_t_5);
  1485. __Pyx_AddTraceback("sasl.saslwrapper.to_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  1486. __pyx_r = 0;
  1487. __pyx_L0:;
  1488. __Pyx_XGIVEREF(__pyx_r);
  1489. __Pyx_RefNannyFinishContext();
  1490. return __pyx_r;
  1491. }
  1492. /* Python wrapper */
  1493. static PyObject *__pyx_pw_4sasl_11saslwrapper_3to_string(PyObject *__pyx_self, PyObject *__pyx_v_bytes_or_str); /*proto*/
  1494. static PyObject *__pyx_pw_4sasl_11saslwrapper_3to_string(PyObject *__pyx_self, PyObject *__pyx_v_bytes_or_str) {
  1495. PyObject *__pyx_r = 0;
  1496. __Pyx_RefNannyDeclarations
  1497. __Pyx_RefNannySetupContext("to_string (wrapper)", 0);
  1498. __pyx_r = __pyx_pf_4sasl_11saslwrapper_2to_string(__pyx_self, ((PyObject *)__pyx_v_bytes_or_str));
  1499. /* function exit code */
  1500. __Pyx_RefNannyFinishContext();
  1501. return __pyx_r;
  1502. }
  1503. static PyObject *__pyx_pf_4sasl_11saslwrapper_2to_string(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_bytes_or_str) {
  1504. PyObject *__pyx_r = NULL;
  1505. __Pyx_RefNannyDeclarations
  1506. PyObject *__pyx_t_1 = NULL;
  1507. int __pyx_lineno = 0;
  1508. const char *__pyx_filename = NULL;
  1509. int __pyx_clineno = 0;
  1510. __Pyx_RefNannySetupContext("to_string", 0);
  1511. __Pyx_XDECREF(__pyx_r);
  1512. __pyx_t_1 = __pyx_f_4sasl_11saslwrapper_to_string(__pyx_v_bytes_or_str, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 44, __pyx_L1_error)
  1513. __Pyx_GOTREF(__pyx_t_1);
  1514. __pyx_r = __pyx_t_1;
  1515. __pyx_t_1 = 0;
  1516. goto __pyx_L0;
  1517. /* function exit code */
  1518. __pyx_L1_error:;
  1519. __Pyx_XDECREF(__pyx_t_1);
  1520. __Pyx_AddTraceback("sasl.saslwrapper.to_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  1521. __pyx_r = NULL;
  1522. __pyx_L0:;
  1523. __Pyx_XGIVEREF(__pyx_r);
  1524. __Pyx_RefNannyFinishContext();
  1525. return __pyx_r;
  1526. }
  1527. /* "sasl/saslwrapper.pyx":53
  1528. * cdef ClientImpl _this
  1529. *
  1530. * cpdef setAttr(self, key, value): # <<<<<<<<<<<<<<
  1531. * if isinstance(value, int):
  1532. * return self._this.setAttr(to_bytes(key), <uint32_t> value)
  1533. */
  1534. static PyObject *__pyx_pw_4sasl_11saslwrapper_6Client_1setAttr(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  1535. static PyObject *__pyx_f_4sasl_11saslwrapper_6Client_setAttr(struct __pyx_obj_4sasl_11saslwrapper_Client *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_value, int __pyx_skip_dispatch) {
  1536. PyObject *__pyx_r = NULL;
  1537. __Pyx_RefNannyDeclarations
  1538. PyObject *__pyx_t_1 = NULL;
  1539. PyObject *__pyx_t_2 = NULL;
  1540. PyObject *__pyx_t_3 = NULL;
  1541. PyObject *__pyx_t_4 = NULL;
  1542. int __pyx_t_5;
  1543. PyObject *__pyx_t_6 = NULL;
  1544. int __pyx_t_7;
  1545. int __pyx_t_8;
  1546. uint32_t __pyx_t_9;
  1547. int __pyx_lineno = 0;
  1548. const char *__pyx_filename = NULL;
  1549. int __pyx_clineno = 0;
  1550. __Pyx_RefNannySetupContext("setAttr", 0);
  1551. /* Check if called by wrapper */
  1552. if (unlikely(__pyx_skip_dispatch)) ;
  1553. /* Check if overridden in Python */
  1554. else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
  1555. #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
  1556. static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
  1557. if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
  1558. PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
  1559. #endif
  1560. __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_setAttr); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 53, __pyx_L1_error)
  1561. __Pyx_GOTREF(__pyx_t_1);
  1562. if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_4sasl_11saslwrapper_6Client_1setAttr)) {
  1563. __Pyx_XDECREF(__pyx_r);
  1564. __Pyx_INCREF(__pyx_t_1);
  1565. __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
  1566. __pyx_t_5 = 0;
  1567. if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
  1568. __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
  1569. if (likely(__pyx_t_4)) {
  1570. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
  1571. __Pyx_INCREF(__pyx_t_4);
  1572. __Pyx_INCREF(function);
  1573. __Pyx_DECREF_SET(__pyx_t_3, function);
  1574. __pyx_t_5 = 1;
  1575. }
  1576. }
  1577. #if CYTHON_FAST_PYCALL
  1578. if (PyFunction_Check(__pyx_t_3)) {
  1579. PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_key, __pyx_v_value};
  1580. __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 53, __pyx_L1_error)
  1581. __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  1582. __Pyx_GOTREF(__pyx_t_2);
  1583. } else
  1584. #endif
  1585. #if CYTHON_FAST_PYCCALL
  1586. if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
  1587. PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_key, __pyx_v_value};
  1588. __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 53, __pyx_L1_error)
  1589. __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  1590. __Pyx_GOTREF(__pyx_t_2);
  1591. } else
  1592. #endif
  1593. {
  1594. __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 53, __pyx_L1_error)
  1595. __Pyx_GOTREF(__pyx_t_6);
  1596. if (__pyx_t_4) {
  1597. __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
  1598. }
  1599. __Pyx_INCREF(__pyx_v_key);
  1600. __Pyx_GIVEREF(__pyx_v_key);
  1601. PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_key);
  1602. __Pyx_INCREF(__pyx_v_value);
  1603. __Pyx_GIVEREF(__pyx_v_value);
  1604. PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_value);
  1605. __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 53, __pyx_L1_error)
  1606. __Pyx_GOTREF(__pyx_t_2);
  1607. __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  1608. }
  1609. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  1610. __pyx_r = __pyx_t_2;
  1611. __pyx_t_2 = 0;
  1612. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  1613. goto __pyx_L0;
  1614. }
  1615. #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
  1616. __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
  1617. __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
  1618. if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
  1619. __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
  1620. }
  1621. #endif
  1622. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  1623. #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
  1624. }
  1625. #endif
  1626. }
  1627. /* "sasl/saslwrapper.pyx":54
  1628. *
  1629. * cpdef setAttr(self, key, value):
  1630. * if isinstance(value, int): # <<<<<<<<<<<<<<
  1631. * return self._this.setAttr(to_bytes(key), <uint32_t> value)
  1632. * elif isinstance(value, string_types):
  1633. */
  1634. __pyx_t_7 = PyInt_Check(__pyx_v_value);
  1635. __pyx_t_8 = (__pyx_t_7 != 0);
  1636. if (__pyx_t_8) {
  1637. /* "sasl/saslwrapper.pyx":55
  1638. * cpdef setAttr(self, key, value):
  1639. * if isinstance(value, int):
  1640. * return self._this.setAttr(to_bytes(key), <uint32_t> value) # <<<<<<<<<<<<<<
  1641. * elif isinstance(value, string_types):
  1642. * return self._this.setAttr(to_bytes(key), <string_t> to_bytes(value))
  1643. */
  1644. __Pyx_XDECREF(__pyx_r);
  1645. __pyx_t_9 = __Pyx_PyInt_As_uint32_t(__pyx_v_value); if (unlikely((__pyx_t_9 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(1, 55, __pyx_L1_error)
  1646. __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->_this.setAttr(__pyx_f_4sasl_11saslwrapper_to_bytes(__pyx_v_key, 0), ((uint32_t)__pyx_t_9))); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 55, __pyx_L1_error)
  1647. __Pyx_GOTREF(__pyx_t_1);
  1648. __pyx_r = __pyx_t_1;
  1649. __pyx_t_1 = 0;
  1650. goto __pyx_L0;
  1651. /* "sasl/saslwrapper.pyx":54
  1652. *
  1653. * cpdef setAttr(self, key, value):
  1654. * if isinstance(value, int): # <<<<<<<<<<<<<<
  1655. * return self._this.setAttr(to_bytes(key), <uint32_t> value)
  1656. * elif isinstance(value, string_types):
  1657. */
  1658. }
  1659. /* "sasl/saslwrapper.pyx":56
  1660. * if isinstance(value, int):
  1661. * return self._this.setAttr(to_bytes(key), <uint32_t> value)
  1662. * elif isinstance(value, string_types): # <<<<<<<<<<<<<<
  1663. * return self._this.setAttr(to_bytes(key), <string_t> to_bytes(value))
  1664. *
  1665. */
  1666. __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_string_types); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 56, __pyx_L1_error)
  1667. __Pyx_GOTREF(__pyx_t_1);
  1668. __pyx_t_8 = PyObject_IsInstance(__pyx_v_value, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(1, 56, __pyx_L1_error)
  1669. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  1670. __pyx_t_7 = (__pyx_t_8 != 0);
  1671. if (__pyx_t_7) {
  1672. /* "sasl/saslwrapper.pyx":57
  1673. * return self._this.setAttr(to_bytes(key), <uint32_t> value)
  1674. * elif isinstance(value, string_types):
  1675. * return self._this.setAttr(to_bytes(key), <string_t> to_bytes(value)) # <<<<<<<<<<<<<<
  1676. *
  1677. * cpdef init(self):
  1678. */
  1679. __Pyx_XDECREF(__pyx_r);
  1680. __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->_this.setAttr(__pyx_f_4sasl_11saslwrapper_to_bytes(__pyx_v_key, 0), ((std::string)__pyx_f_4sasl_11saslwrapper_to_bytes(__pyx_v_value, 0)))); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 57, __pyx_L1_error)
  1681. __Pyx_GOTREF(__pyx_t_1);
  1682. __pyx_r = __pyx_t_1;
  1683. __pyx_t_1 = 0;
  1684. goto __pyx_L0;
  1685. /* "sasl/saslwrapper.pyx":56
  1686. * if isinstance(value, int):
  1687. * return self._this.setAttr(to_bytes(key), <uint32_t> value)
  1688. * elif isinstance(value, string_types): # <<<<<<<<<<<<<<
  1689. * return self._this.setAttr(to_bytes(key), <string_t> to_bytes(value))
  1690. *
  1691. */
  1692. }
  1693. /* "sasl/saslwrapper.pyx":53
  1694. * cdef ClientImpl _this
  1695. *
  1696. * cpdef setAttr(self, key, value): # <<<<<<<<<<<<<<
  1697. * if isinstance(value, int):
  1698. * return self._this.setAttr(to_bytes(key), <uint32_t> value)
  1699. */
  1700. /* function exit code */
  1701. __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  1702. goto __pyx_L0;
  1703. __pyx_L1_error:;
  1704. __Pyx_XDECREF(__pyx_t_1);
  1705. __Pyx_XDECREF(__pyx_t_2);
  1706. __Pyx_XDECREF(__pyx_t_3);
  1707. __Pyx_XDECREF(__pyx_t_4);
  1708. __Pyx_XDECREF(__pyx_t_6);
  1709. __Pyx_AddTraceback("sasl.saslwrapper.Client.setAttr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  1710. __pyx_r = 0;
  1711. __pyx_L0:;
  1712. __Pyx_XGIVEREF(__pyx_r);
  1713. __Pyx_RefNannyFinishContext();
  1714. return __pyx_r;
  1715. }
  1716. /* Python wrapper */
  1717. static PyObject *__pyx_pw_4sasl_11saslwrapper_6Client_1setAttr(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  1718. static PyObject *__pyx_pw_4sasl_11saslwrapper_6Client_1setAttr(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  1719. PyObject *__pyx_v_key = 0;
  1720. PyObject *__pyx_v_value = 0;
  1721. int __pyx_lineno = 0;
  1722. const char *__pyx_filename = NULL;
  1723. int __pyx_clineno = 0;
  1724. PyObject *__pyx_r = 0;
  1725. __Pyx_RefNannyDeclarations
  1726. __Pyx_RefNannySetupContext("setAttr (wrapper)", 0);
  1727. {
  1728. static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_key,&__pyx_n_s_value,0};
  1729. PyObject* values[2] = {0,0};
  1730. if (unlikely(__pyx_kwds)) {
  1731. Py_ssize_t kw_args;
  1732. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  1733. switch (pos_args) {
  1734. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  1735. CYTHON_FALLTHROUGH;
  1736. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  1737. CYTHON_FALLTHROUGH;
  1738. case 0: break;
  1739. default: goto __pyx_L5_argtuple_error;
  1740. }
  1741. kw_args = PyDict_Size(__pyx_kwds);
  1742. switch (pos_args) {
  1743. case 0:
  1744. if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--;
  1745. else goto __pyx_L5_argtuple_error;
  1746. CYTHON_FALLTHROUGH;
  1747. case 1:
  1748. if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--;
  1749. else {
  1750. __Pyx_RaiseArgtupleInvalid("setAttr", 1, 2, 2, 1); __PYX_ERR(1, 53, __pyx_L3_error)
  1751. }
  1752. }
  1753. if (unlikely(kw_args > 0)) {
  1754. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setAttr") < 0)) __PYX_ERR(1, 53, __pyx_L3_error)
  1755. }
  1756. } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
  1757. goto __pyx_L5_argtuple_error;
  1758. } else {
  1759. values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  1760. values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  1761. }
  1762. __pyx_v_key = values[0];
  1763. __pyx_v_value = values[1];
  1764. }
  1765. goto __pyx_L4_argument_unpacking_done;
  1766. __pyx_L5_argtuple_error:;
  1767. __Pyx_RaiseArgtupleInvalid("setAttr", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 53, __pyx_L3_error)
  1768. __pyx_L3_error:;
  1769. __Pyx_AddTraceback("sasl.saslwrapper.Client.setAttr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  1770. __Pyx_RefNannyFinishContext();
  1771. return NULL;
  1772. __pyx_L4_argument_unpacking_done:;
  1773. __pyx_r = __pyx_pf_4sasl_11saslwrapper_6Client_setAttr(((struct __pyx_obj_4sasl_11saslwrapper_Client *)__pyx_v_self), __pyx_v_key, __pyx_v_value);
  1774. /* function exit code */
  1775. __Pyx_RefNannyFinishContext();
  1776. return __pyx_r;
  1777. }
  1778. static PyObject *__pyx_pf_4sasl_11saslwrapper_6Client_setAttr(struct __pyx_obj_4sasl_11saslwrapper_Client *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_value) {
  1779. PyObject *__pyx_r = NULL;
  1780. __Pyx_RefNannyDeclarations
  1781. PyObject *__pyx_t_1 = NULL;
  1782. int __pyx_lineno = 0;
  1783. const char *__pyx_filename = NULL;
  1784. int __pyx_clineno = 0;
  1785. __Pyx_RefNannySetupContext("setAttr", 0);
  1786. __Pyx_XDECREF(__pyx_r);
  1787. __pyx_t_1 = __pyx_f_4sasl_11saslwrapper_6Client_setAttr(__pyx_v_self, __pyx_v_key, __pyx_v_value, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 53, __pyx_L1_error)
  1788. __Pyx_GOTREF(__pyx_t_1);
  1789. __pyx_r = __pyx_t_1;
  1790. __pyx_t_1 = 0;
  1791. goto __pyx_L0;
  1792. /* function exit code */
  1793. __pyx_L1_error:;
  1794. __Pyx_XDECREF(__pyx_t_1);
  1795. __Pyx_AddTraceback("sasl.saslwrapper.Client.setAttr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  1796. __pyx_r = NULL;
  1797. __pyx_L0:;
  1798. __Pyx_XGIVEREF(__pyx_r);
  1799. __Pyx_RefNannyFinishContext();
  1800. return __pyx_r;
  1801. }
  1802. /* "sasl/saslwrapper.pyx":59
  1803. * return self._this.setAttr(to_bytes(key), <string_t> to_bytes(value))
  1804. *
  1805. * cpdef init(self): # <<<<<<<<<<<<<<
  1806. * return self._this.init()
  1807. *
  1808. */
  1809. static PyObject *__pyx_pw_4sasl_11saslwrapper_6Client_3init(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
  1810. static PyObject *__pyx_f_4sasl_11saslwrapper_6Client_init(struct __pyx_obj_4sasl_11saslwrapper_Client *__pyx_v_self, int __pyx_skip_dispatch) {
  1811. PyObject *__pyx_r = NULL;
  1812. __Pyx_RefNannyDeclarations
  1813. PyObject *__pyx_t_1 = NULL;
  1814. PyObject *__pyx_t_2 = NULL;
  1815. PyObject *__pyx_t_3 = NULL;
  1816. PyObject *__pyx_t_4 = NULL;
  1817. int __pyx_lineno = 0;
  1818. const char *__pyx_filename = NULL;
  1819. int __pyx_clineno = 0;
  1820. __Pyx_RefNannySetupContext("init", 0);
  1821. /* Check if called by wrapper */
  1822. if (unlikely(__pyx_skip_dispatch)) ;
  1823. /* Check if overridden in Python */
  1824. else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
  1825. #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
  1826. static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
  1827. if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
  1828. PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
  1829. #endif
  1830. __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_init); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 59, __pyx_L1_error)
  1831. __Pyx_GOTREF(__pyx_t_1);
  1832. if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_4sasl_11saslwrapper_6Client_3init)) {
  1833. __Pyx_XDECREF(__pyx_r);
  1834. __Pyx_INCREF(__pyx_t_1);
  1835. __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
  1836. if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
  1837. __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
  1838. if (likely(__pyx_t_4)) {
  1839. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
  1840. __Pyx_INCREF(__pyx_t_4);
  1841. __Pyx_INCREF(function);
  1842. __Pyx_DECREF_SET(__pyx_t_3, function);
  1843. }
  1844. }
  1845. __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
  1846. __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  1847. if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 59, __pyx_L1_error)
  1848. __Pyx_GOTREF(__pyx_t_2);
  1849. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  1850. __pyx_r = __pyx_t_2;
  1851. __pyx_t_2 = 0;
  1852. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  1853. goto __pyx_L0;
  1854. }
  1855. #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
  1856. __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
  1857. __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
  1858. if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
  1859. __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
  1860. }
  1861. #endif
  1862. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  1863. #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
  1864. }
  1865. #endif
  1866. }
  1867. /* "sasl/saslwrapper.pyx":60
  1868. *
  1869. * cpdef init(self):
  1870. * return self._this.init() # <<<<<<<<<<<<<<
  1871. *
  1872. * cpdef start(self, mech_list):
  1873. */
  1874. __Pyx_XDECREF(__pyx_r);
  1875. __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->_this.init()); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 60, __pyx_L1_error)
  1876. __Pyx_GOTREF(__pyx_t_1);
  1877. __pyx_r = __pyx_t_1;
  1878. __pyx_t_1 = 0;
  1879. goto __pyx_L0;
  1880. /* "sasl/saslwrapper.pyx":59
  1881. * return self._this.setAttr(to_bytes(key), <string_t> to_bytes(value))
  1882. *
  1883. * cpdef init(self): # <<<<<<<<<<<<<<
  1884. * return self._this.init()
  1885. *
  1886. */
  1887. /* function exit code */
  1888. __pyx_L1_error:;
  1889. __Pyx_XDECREF(__pyx_t_1);
  1890. __Pyx_XDECREF(__pyx_t_2);
  1891. __Pyx_XDECREF(__pyx_t_3);
  1892. __Pyx_XDECREF(__pyx_t_4);
  1893. __Pyx_AddTraceback("sasl.saslwrapper.Client.init", __pyx_clineno, __pyx_lineno, __pyx_filename);
  1894. __pyx_r = 0;
  1895. __pyx_L0:;
  1896. __Pyx_XGIVEREF(__pyx_r);
  1897. __Pyx_RefNannyFinishContext();
  1898. return __pyx_r;
  1899. }
  1900. /* Python wrapper */
  1901. static PyObject *__pyx_pw_4sasl_11saslwrapper_6Client_3init(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
  1902. static PyObject *__pyx_pw_4sasl_11saslwrapper_6Client_3init(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  1903. PyObject *__pyx_r = 0;
  1904. __Pyx_RefNannyDeclarations
  1905. __Pyx_RefNannySetupContext("init (wrapper)", 0);
  1906. __pyx_r = __pyx_pf_4sasl_11saslwrapper_6Client_2init(((struct __pyx_obj_4sasl_11saslwrapper_Client *)__pyx_v_self));
  1907. /* function exit code */
  1908. __Pyx_RefNannyFinishContext();
  1909. return __pyx_r;
  1910. }
  1911. static PyObject *__pyx_pf_4sasl_11saslwrapper_6Client_2init(struct __pyx_obj_4sasl_11saslwrapper_Client *__pyx_v_self) {
  1912. PyObject *__pyx_r = NULL;
  1913. __Pyx_RefNannyDeclarations
  1914. PyObject *__pyx_t_1 = NULL;
  1915. int __pyx_lineno = 0;
  1916. const char *__pyx_filename = NULL;
  1917. int __pyx_clineno = 0;
  1918. __Pyx_RefNannySetupContext("init", 0);
  1919. __Pyx_XDECREF(__pyx_r);
  1920. __pyx_t_1 = __pyx_f_4sasl_11saslwrapper_6Client_init(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 59, __pyx_L1_error)
  1921. __Pyx_GOTREF(__pyx_t_1);
  1922. __pyx_r = __pyx_t_1;
  1923. __pyx_t_1 = 0;
  1924. goto __pyx_L0;
  1925. /* function exit code */
  1926. __pyx_L1_error:;
  1927. __Pyx_XDECREF(__pyx_t_1);
  1928. __Pyx_AddTraceback("sasl.saslwrapper.Client.init", __pyx_clineno, __pyx_lineno, __pyx_filename);
  1929. __pyx_r = NULL;
  1930. __pyx_L0:;
  1931. __Pyx_XGIVEREF(__pyx_r);
  1932. __Pyx_RefNannyFinishContext();
  1933. return __pyx_r;
  1934. }
  1935. /* "sasl/saslwrapper.pyx":62
  1936. * return self._this.init()
  1937. *
  1938. * cpdef start(self, mech_list): # <<<<<<<<<<<<<<
  1939. * cdef string_t chosen
  1940. * cdef string_t initial_response
  1941. */
  1942. static PyObject *__pyx_pw_4sasl_11saslwrapper_6Client_5start(PyObject *__pyx_v_self, PyObject *__pyx_v_mech_list); /*proto*/
  1943. static PyObject *__pyx_f_4sasl_11saslwrapper_6Client_start(struct __pyx_obj_4sasl_11saslwrapper_Client *__pyx_v_self, PyObject *__pyx_v_mech_list, int __pyx_skip_dispatch) {
  1944. std::string __pyx_v_chosen;
  1945. std::string __pyx_v_initial_response;
  1946. bool __pyx_v_success;
  1947. PyObject *__pyx_r = NULL;
  1948. __Pyx_RefNannyDeclarations
  1949. PyObject *__pyx_t_1 = NULL;
  1950. PyObject *__pyx_t_2 = NULL;
  1951. PyObject *__pyx_t_3 = NULL;
  1952. PyObject *__pyx_t_4 = NULL;
  1953. int __pyx_lineno = 0;
  1954. const char *__pyx_filename = NULL;
  1955. int __pyx_clineno = 0;
  1956. __Pyx_RefNannySetupContext("start", 0);
  1957. /* Check if called by wrapper */
  1958. if (unlikely(__pyx_skip_dispatch)) ;
  1959. /* Check if overridden in Python */
  1960. else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
  1961. #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
  1962. static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
  1963. if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
  1964. PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
  1965. #endif
  1966. __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_start); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 62, __pyx_L1_error)
  1967. __Pyx_GOTREF(__pyx_t_1);
  1968. if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_4sasl_11saslwrapper_6Client_5start)) {
  1969. __Pyx_XDECREF(__pyx_r);
  1970. __Pyx_INCREF(__pyx_t_1);
  1971. __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
  1972. if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
  1973. __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
  1974. if (likely(__pyx_t_4)) {
  1975. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
  1976. __Pyx_INCREF(__pyx_t_4);
  1977. __Pyx_INCREF(function);
  1978. __Pyx_DECREF_SET(__pyx_t_3, function);
  1979. }
  1980. }
  1981. __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_mech_list) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_mech_list);
  1982. __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  1983. if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 62, __pyx_L1_error)
  1984. __Pyx_GOTREF(__pyx_t_2);
  1985. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  1986. __pyx_r = __pyx_t_2;
  1987. __pyx_t_2 = 0;
  1988. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  1989. goto __pyx_L0;
  1990. }
  1991. #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
  1992. __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
  1993. __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
  1994. if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
  1995. __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
  1996. }
  1997. #endif
  1998. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  1999. #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
  2000. }
  2001. #endif
  2002. }
  2003. /* "sasl/saslwrapper.pyx":65
  2004. * cdef string_t chosen
  2005. * cdef string_t initial_response
  2006. * success = self._this.start(to_bytes(mech_list), chosen, initial_response) # <<<<<<<<<<<<<<
  2007. * return (success, chosen, initial_response)
  2008. *
  2009. */
  2010. __pyx_v_success = __pyx_v_self->_this.start(__pyx_f_4sasl_11saslwrapper_to_bytes(__pyx_v_mech_list, 0), __pyx_v_chosen, __pyx_v_initial_response);
  2011. /* "sasl/saslwrapper.pyx":66
  2012. * cdef string_t initial_response
  2013. * success = self._this.start(to_bytes(mech_list), chosen, initial_response)
  2014. * return (success, chosen, initial_response) # <<<<<<<<<<<<<<
  2015. *
  2016. * cpdef step(self, challenge):
  2017. */
  2018. __Pyx_XDECREF(__pyx_r);
  2019. __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_success); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 66, __pyx_L1_error)
  2020. __Pyx_GOTREF(__pyx_t_1);
  2021. __pyx_t_2 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_v_chosen); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 66, __pyx_L1_error)
  2022. __Pyx_GOTREF(__pyx_t_2);
  2023. __pyx_t_3 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_v_initial_response); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 66, __pyx_L1_error)
  2024. __Pyx_GOTREF(__pyx_t_3);
  2025. __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 66, __pyx_L1_error)
  2026. __Pyx_GOTREF(__pyx_t_4);
  2027. __Pyx_GIVEREF(__pyx_t_1);
  2028. PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
  2029. __Pyx_GIVEREF(__pyx_t_2);
  2030. PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
  2031. __Pyx_GIVEREF(__pyx_t_3);
  2032. PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
  2033. __pyx_t_1 = 0;
  2034. __pyx_t_2 = 0;
  2035. __pyx_t_3 = 0;
  2036. __pyx_r = __pyx_t_4;
  2037. __pyx_t_4 = 0;
  2038. goto __pyx_L0;
  2039. /* "sasl/saslwrapper.pyx":62
  2040. * return self._this.init()
  2041. *
  2042. * cpdef start(self, mech_list): # <<<<<<<<<<<<<<
  2043. * cdef string_t chosen
  2044. * cdef string_t initial_response
  2045. */
  2046. /* function exit code */
  2047. __pyx_L1_error:;
  2048. __Pyx_XDECREF(__pyx_t_1);
  2049. __Pyx_XDECREF(__pyx_t_2);
  2050. __Pyx_XDECREF(__pyx_t_3);
  2051. __Pyx_XDECREF(__pyx_t_4);
  2052. __Pyx_AddTraceback("sasl.saslwrapper.Client.start", __pyx_clineno, __pyx_lineno, __pyx_filename);
  2053. __pyx_r = 0;
  2054. __pyx_L0:;
  2055. __Pyx_XGIVEREF(__pyx_r);
  2056. __Pyx_RefNannyFinishContext();
  2057. return __pyx_r;
  2058. }
  2059. /* Python wrapper */
  2060. static PyObject *__pyx_pw_4sasl_11saslwrapper_6Client_5start(PyObject *__pyx_v_self, PyObject *__pyx_v_mech_list); /*proto*/
  2061. static PyObject *__pyx_pw_4sasl_11saslwrapper_6Client_5start(PyObject *__pyx_v_self, PyObject *__pyx_v_mech_list) {
  2062. PyObject *__pyx_r = 0;
  2063. __Pyx_RefNannyDeclarations
  2064. __Pyx_RefNannySetupContext("start (wrapper)", 0);
  2065. __pyx_r = __pyx_pf_4sasl_11saslwrapper_6Client_4start(((struct __pyx_obj_4sasl_11saslwrapper_Client *)__pyx_v_self), ((PyObject *)__pyx_v_mech_list));
  2066. /* function exit code */
  2067. __Pyx_RefNannyFinishContext();
  2068. return __pyx_r;
  2069. }
  2070. static PyObject *__pyx_pf_4sasl_11saslwrapper_6Client_4start(struct __pyx_obj_4sasl_11saslwrapper_Client *__pyx_v_self, PyObject *__pyx_v_mech_list) {
  2071. PyObject *__pyx_r = NULL;
  2072. __Pyx_RefNannyDeclarations
  2073. PyObject *__pyx_t_1 = NULL;
  2074. int __pyx_lineno = 0;
  2075. const char *__pyx_filename = NULL;
  2076. int __pyx_clineno = 0;
  2077. __Pyx_RefNannySetupContext("start", 0);
  2078. __Pyx_XDECREF(__pyx_r);
  2079. __pyx_t_1 = __pyx_f_4sasl_11saslwrapper_6Client_start(__pyx_v_self, __pyx_v_mech_list, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 62, __pyx_L1_error)
  2080. __Pyx_GOTREF(__pyx_t_1);
  2081. __pyx_r = __pyx_t_1;
  2082. __pyx_t_1 = 0;
  2083. goto __pyx_L0;
  2084. /* function exit code */
  2085. __pyx_L1_error:;
  2086. __Pyx_XDECREF(__pyx_t_1);
  2087. __Pyx_AddTraceback("sasl.saslwrapper.Client.start", __pyx_clineno, __pyx_lineno, __pyx_filename);
  2088. __pyx_r = NULL;
  2089. __pyx_L0:;
  2090. __Pyx_XGIVEREF(__pyx_r);
  2091. __Pyx_RefNannyFinishContext();
  2092. return __pyx_r;
  2093. }
  2094. /* "sasl/saslwrapper.pyx":68
  2095. * return (success, chosen, initial_response)
  2096. *
  2097. * cpdef step(self, challenge): # <<<<<<<<<<<<<<
  2098. * cdef string_t response
  2099. * success = self._this.step(to_bytes(challenge), response)
  2100. */
  2101. static PyObject *__pyx_pw_4sasl_11saslwrapper_6Client_7step(PyObject *__pyx_v_self, PyObject *__pyx_v_challenge); /*proto*/
  2102. static PyObject *__pyx_f_4sasl_11saslwrapper_6Client_step(struct __pyx_obj_4sasl_11saslwrapper_Client *__pyx_v_self, PyObject *__pyx_v_challenge, int __pyx_skip_dispatch) {
  2103. std::string __pyx_v_response;
  2104. bool __pyx_v_success;
  2105. PyObject *__pyx_r = NULL;
  2106. __Pyx_RefNannyDeclarations
  2107. PyObject *__pyx_t_1 = NULL;
  2108. PyObject *__pyx_t_2 = NULL;
  2109. PyObject *__pyx_t_3 = NULL;
  2110. PyObject *__pyx_t_4 = NULL;
  2111. int __pyx_lineno = 0;
  2112. const char *__pyx_filename = NULL;
  2113. int __pyx_clineno = 0;
  2114. __Pyx_RefNannySetupContext("step", 0);
  2115. /* Check if called by wrapper */
  2116. if (unlikely(__pyx_skip_dispatch)) ;
  2117. /* Check if overridden in Python */
  2118. else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
  2119. #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
  2120. static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
  2121. if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
  2122. PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
  2123. #endif
  2124. __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_step); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 68, __pyx_L1_error)
  2125. __Pyx_GOTREF(__pyx_t_1);
  2126. if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_4sasl_11saslwrapper_6Client_7step)) {
  2127. __Pyx_XDECREF(__pyx_r);
  2128. __Pyx_INCREF(__pyx_t_1);
  2129. __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
  2130. if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
  2131. __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
  2132. if (likely(__pyx_t_4)) {
  2133. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
  2134. __Pyx_INCREF(__pyx_t_4);
  2135. __Pyx_INCREF(function);
  2136. __Pyx_DECREF_SET(__pyx_t_3, function);
  2137. }
  2138. }
  2139. __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_challenge) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_challenge);
  2140. __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  2141. if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 68, __pyx_L1_error)
  2142. __Pyx_GOTREF(__pyx_t_2);
  2143. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  2144. __pyx_r = __pyx_t_2;
  2145. __pyx_t_2 = 0;
  2146. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  2147. goto __pyx_L0;
  2148. }
  2149. #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
  2150. __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
  2151. __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
  2152. if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
  2153. __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
  2154. }
  2155. #endif
  2156. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  2157. #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
  2158. }
  2159. #endif
  2160. }
  2161. /* "sasl/saslwrapper.pyx":70
  2162. * cpdef step(self, challenge):
  2163. * cdef string_t response
  2164. * success = self._this.step(to_bytes(challenge), response) # <<<<<<<<<<<<<<
  2165. * return (success, response)
  2166. *
  2167. */
  2168. __pyx_v_success = __pyx_v_self->_this.step(__pyx_f_4sasl_11saslwrapper_to_bytes(__pyx_v_challenge, 0), __pyx_v_response);
  2169. /* "sasl/saslwrapper.pyx":71
  2170. * cdef string_t response
  2171. * success = self._this.step(to_bytes(challenge), response)
  2172. * return (success, response) # <<<<<<<<<<<<<<
  2173. *
  2174. * cpdef encode(self, clear_text):
  2175. */
  2176. __Pyx_XDECREF(__pyx_r);
  2177. __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_success); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 71, __pyx_L1_error)
  2178. __Pyx_GOTREF(__pyx_t_1);
  2179. __pyx_t_2 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_v_response); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 71, __pyx_L1_error)
  2180. __Pyx_GOTREF(__pyx_t_2);
  2181. __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 71, __pyx_L1_error)
  2182. __Pyx_GOTREF(__pyx_t_3);
  2183. __Pyx_GIVEREF(__pyx_t_1);
  2184. PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  2185. __Pyx_GIVEREF(__pyx_t_2);
  2186. PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
  2187. __pyx_t_1 = 0;
  2188. __pyx_t_2 = 0;
  2189. __pyx_r = __pyx_t_3;
  2190. __pyx_t_3 = 0;
  2191. goto __pyx_L0;
  2192. /* "sasl/saslwrapper.pyx":68
  2193. * return (success, chosen, initial_response)
  2194. *
  2195. * cpdef step(self, challenge): # <<<<<<<<<<<<<<
  2196. * cdef string_t response
  2197. * success = self._this.step(to_bytes(challenge), response)
  2198. */
  2199. /* function exit code */
  2200. __pyx_L1_error:;
  2201. __Pyx_XDECREF(__pyx_t_1);
  2202. __Pyx_XDECREF(__pyx_t_2);
  2203. __Pyx_XDECREF(__pyx_t_3);
  2204. __Pyx_XDECREF(__pyx_t_4);
  2205. __Pyx_AddTraceback("sasl.saslwrapper.Client.step", __pyx_clineno, __pyx_lineno, __pyx_filename);
  2206. __pyx_r = 0;
  2207. __pyx_L0:;
  2208. __Pyx_XGIVEREF(__pyx_r);
  2209. __Pyx_RefNannyFinishContext();
  2210. return __pyx_r;
  2211. }
  2212. /* Python wrapper */
  2213. static PyObject *__pyx_pw_4sasl_11saslwrapper_6Client_7step(PyObject *__pyx_v_self, PyObject *__pyx_v_challenge); /*proto*/
  2214. static PyObject *__pyx_pw_4sasl_11saslwrapper_6Client_7step(PyObject *__pyx_v_self, PyObject *__pyx_v_challenge) {
  2215. PyObject *__pyx_r = 0;
  2216. __Pyx_RefNannyDeclarations
  2217. __Pyx_RefNannySetupContext("step (wrapper)", 0);
  2218. __pyx_r = __pyx_pf_4sasl_11saslwrapper_6Client_6step(((struct __pyx_obj_4sasl_11saslwrapper_Client *)__pyx_v_self), ((PyObject *)__pyx_v_challenge));
  2219. /* function exit code */
  2220. __Pyx_RefNannyFinishContext();
  2221. return __pyx_r;
  2222. }
  2223. static PyObject *__pyx_pf_4sasl_11saslwrapper_6Client_6step(struct __pyx_obj_4sasl_11saslwrapper_Client *__pyx_v_self, PyObject *__pyx_v_challenge) {
  2224. PyObject *__pyx_r = NULL;
  2225. __Pyx_RefNannyDeclarations
  2226. PyObject *__pyx_t_1 = NULL;
  2227. int __pyx_lineno = 0;
  2228. const char *__pyx_filename = NULL;
  2229. int __pyx_clineno = 0;
  2230. __Pyx_RefNannySetupContext("step", 0);
  2231. __Pyx_XDECREF(__pyx_r);
  2232. __pyx_t_1 = __pyx_f_4sasl_11saslwrapper_6Client_step(__pyx_v_self, __pyx_v_challenge, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 68, __pyx_L1_error)
  2233. __Pyx_GOTREF(__pyx_t_1);
  2234. __pyx_r = __pyx_t_1;
  2235. __pyx_t_1 = 0;
  2236. goto __pyx_L0;
  2237. /* function exit code */
  2238. __pyx_L1_error:;
  2239. __Pyx_XDECREF(__pyx_t_1);
  2240. __Pyx_AddTraceback("sasl.saslwrapper.Client.step", __pyx_clineno, __pyx_lineno, __pyx_filename);
  2241. __pyx_r = NULL;
  2242. __pyx_L0:;
  2243. __Pyx_XGIVEREF(__pyx_r);
  2244. __Pyx_RefNannyFinishContext();
  2245. return __pyx_r;
  2246. }
  2247. /* "sasl/saslwrapper.pyx":73
  2248. * return (success, response)
  2249. *
  2250. * cpdef encode(self, clear_text): # <<<<<<<<<<<<<<
  2251. * cdef string_t cipher_text
  2252. * success = self._this.encode(to_bytes(clear_text), cipher_text)
  2253. */
  2254. static PyObject *__pyx_pw_4sasl_11saslwrapper_6Client_9encode(PyObject *__pyx_v_self, PyObject *__pyx_v_clear_text); /*proto*/
  2255. static PyObject *__pyx_f_4sasl_11saslwrapper_6Client_encode(struct __pyx_obj_4sasl_11saslwrapper_Client *__pyx_v_self, PyObject *__pyx_v_clear_text, int __pyx_skip_dispatch) {
  2256. std::string __pyx_v_cipher_text;
  2257. bool __pyx_v_success;
  2258. PyObject *__pyx_r = NULL;
  2259. __Pyx_RefNannyDeclarations
  2260. PyObject *__pyx_t_1 = NULL;
  2261. PyObject *__pyx_t_2 = NULL;
  2262. PyObject *__pyx_t_3 = NULL;
  2263. PyObject *__pyx_t_4 = NULL;
  2264. int __pyx_lineno = 0;
  2265. const char *__pyx_filename = NULL;
  2266. int __pyx_clineno = 0;
  2267. __Pyx_RefNannySetupContext("encode", 0);
  2268. /* Check if called by wrapper */
  2269. if (unlikely(__pyx_skip_dispatch)) ;
  2270. /* Check if overridden in Python */
  2271. else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
  2272. #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
  2273. static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
  2274. if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
  2275. PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
  2276. #endif
  2277. __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_encode); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 73, __pyx_L1_error)
  2278. __Pyx_GOTREF(__pyx_t_1);
  2279. if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_4sasl_11saslwrapper_6Client_9encode)) {
  2280. __Pyx_XDECREF(__pyx_r);
  2281. __Pyx_INCREF(__pyx_t_1);
  2282. __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
  2283. if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
  2284. __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
  2285. if (likely(__pyx_t_4)) {
  2286. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
  2287. __Pyx_INCREF(__pyx_t_4);
  2288. __Pyx_INCREF(function);
  2289. __Pyx_DECREF_SET(__pyx_t_3, function);
  2290. }
  2291. }
  2292. __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_clear_text) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_clear_text);
  2293. __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  2294. if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 73, __pyx_L1_error)
  2295. __Pyx_GOTREF(__pyx_t_2);
  2296. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  2297. __pyx_r = __pyx_t_2;
  2298. __pyx_t_2 = 0;
  2299. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  2300. goto __pyx_L0;
  2301. }
  2302. #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
  2303. __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
  2304. __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
  2305. if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
  2306. __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
  2307. }
  2308. #endif
  2309. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  2310. #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
  2311. }
  2312. #endif
  2313. }
  2314. /* "sasl/saslwrapper.pyx":75
  2315. * cpdef encode(self, clear_text):
  2316. * cdef string_t cipher_text
  2317. * success = self._this.encode(to_bytes(clear_text), cipher_text) # <<<<<<<<<<<<<<
  2318. * return (success, cipher_text)
  2319. *
  2320. */
  2321. __pyx_v_success = __pyx_v_self->_this.encode(__pyx_f_4sasl_11saslwrapper_to_bytes(__pyx_v_clear_text, 0), __pyx_v_cipher_text);
  2322. /* "sasl/saslwrapper.pyx":76
  2323. * cdef string_t cipher_text
  2324. * success = self._this.encode(to_bytes(clear_text), cipher_text)
  2325. * return (success, cipher_text) # <<<<<<<<<<<<<<
  2326. *
  2327. * cpdef decode(self, cipher_text):
  2328. */
  2329. __Pyx_XDECREF(__pyx_r);
  2330. __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_success); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 76, __pyx_L1_error)
  2331. __Pyx_GOTREF(__pyx_t_1);
  2332. __pyx_t_2 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_v_cipher_text); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 76, __pyx_L1_error)
  2333. __Pyx_GOTREF(__pyx_t_2);
  2334. __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 76, __pyx_L1_error)
  2335. __Pyx_GOTREF(__pyx_t_3);
  2336. __Pyx_GIVEREF(__pyx_t_1);
  2337. PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  2338. __Pyx_GIVEREF(__pyx_t_2);
  2339. PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
  2340. __pyx_t_1 = 0;
  2341. __pyx_t_2 = 0;
  2342. __pyx_r = __pyx_t_3;
  2343. __pyx_t_3 = 0;
  2344. goto __pyx_L0;
  2345. /* "sasl/saslwrapper.pyx":73
  2346. * return (success, response)
  2347. *
  2348. * cpdef encode(self, clear_text): # <<<<<<<<<<<<<<
  2349. * cdef string_t cipher_text
  2350. * success = self._this.encode(to_bytes(clear_text), cipher_text)
  2351. */
  2352. /* function exit code */
  2353. __pyx_L1_error:;
  2354. __Pyx_XDECREF(__pyx_t_1);
  2355. __Pyx_XDECREF(__pyx_t_2);
  2356. __Pyx_XDECREF(__pyx_t_3);
  2357. __Pyx_XDECREF(__pyx_t_4);
  2358. __Pyx_AddTraceback("sasl.saslwrapper.Client.encode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  2359. __pyx_r = 0;
  2360. __pyx_L0:;
  2361. __Pyx_XGIVEREF(__pyx_r);
  2362. __Pyx_RefNannyFinishContext();
  2363. return __pyx_r;
  2364. }
  2365. /* Python wrapper */
  2366. static PyObject *__pyx_pw_4sasl_11saslwrapper_6Client_9encode(PyObject *__pyx_v_self, PyObject *__pyx_v_clear_text); /*proto*/
  2367. static PyObject *__pyx_pw_4sasl_11saslwrapper_6Client_9encode(PyObject *__pyx_v_self, PyObject *__pyx_v_clear_text) {
  2368. PyObject *__pyx_r = 0;
  2369. __Pyx_RefNannyDeclarations
  2370. __Pyx_RefNannySetupContext("encode (wrapper)", 0);
  2371. __pyx_r = __pyx_pf_4sasl_11saslwrapper_6Client_8encode(((struct __pyx_obj_4sasl_11saslwrapper_Client *)__pyx_v_self), ((PyObject *)__pyx_v_clear_text));
  2372. /* function exit code */
  2373. __Pyx_RefNannyFinishContext();
  2374. return __pyx_r;
  2375. }
  2376. static PyObject *__pyx_pf_4sasl_11saslwrapper_6Client_8encode(struct __pyx_obj_4sasl_11saslwrapper_Client *__pyx_v_self, PyObject *__pyx_v_clear_text) {
  2377. PyObject *__pyx_r = NULL;
  2378. __Pyx_RefNannyDeclarations
  2379. PyObject *__pyx_t_1 = NULL;
  2380. int __pyx_lineno = 0;
  2381. const char *__pyx_filename = NULL;
  2382. int __pyx_clineno = 0;
  2383. __Pyx_RefNannySetupContext("encode", 0);
  2384. __Pyx_XDECREF(__pyx_r);
  2385. __pyx_t_1 = __pyx_f_4sasl_11saslwrapper_6Client_encode(__pyx_v_self, __pyx_v_clear_text, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 73, __pyx_L1_error)
  2386. __Pyx_GOTREF(__pyx_t_1);
  2387. __pyx_r = __pyx_t_1;
  2388. __pyx_t_1 = 0;
  2389. goto __pyx_L0;
  2390. /* function exit code */
  2391. __pyx_L1_error:;
  2392. __Pyx_XDECREF(__pyx_t_1);
  2393. __Pyx_AddTraceback("sasl.saslwrapper.Client.encode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  2394. __pyx_r = NULL;
  2395. __pyx_L0:;
  2396. __Pyx_XGIVEREF(__pyx_r);
  2397. __Pyx_RefNannyFinishContext();
  2398. return __pyx_r;
  2399. }
  2400. /* "sasl/saslwrapper.pyx":78
  2401. * return (success, cipher_text)
  2402. *
  2403. * cpdef decode(self, cipher_text): # <<<<<<<<<<<<<<
  2404. * cdef string_t clear_text
  2405. * success = self._this.decode(to_bytes(cipher_text), clear_text)
  2406. */
  2407. static PyObject *__pyx_pw_4sasl_11saslwrapper_6Client_11decode(PyObject *__pyx_v_self, PyObject *__pyx_v_cipher_text); /*proto*/
  2408. static PyObject *__pyx_f_4sasl_11saslwrapper_6Client_decode(struct __pyx_obj_4sasl_11saslwrapper_Client *__pyx_v_self, PyObject *__pyx_v_cipher_text, int __pyx_skip_dispatch) {
  2409. std::string __pyx_v_clear_text;
  2410. bool __pyx_v_success;
  2411. PyObject *__pyx_r = NULL;
  2412. __Pyx_RefNannyDeclarations
  2413. PyObject *__pyx_t_1 = NULL;
  2414. PyObject *__pyx_t_2 = NULL;
  2415. PyObject *__pyx_t_3 = NULL;
  2416. PyObject *__pyx_t_4 = NULL;
  2417. int __pyx_lineno = 0;
  2418. const char *__pyx_filename = NULL;
  2419. int __pyx_clineno = 0;
  2420. __Pyx_RefNannySetupContext("decode", 0);
  2421. /* Check if called by wrapper */
  2422. if (unlikely(__pyx_skip_dispatch)) ;
  2423. /* Check if overridden in Python */
  2424. else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
  2425. #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
  2426. static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
  2427. if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
  2428. PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
  2429. #endif
  2430. __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_decode); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 78, __pyx_L1_error)
  2431. __Pyx_GOTREF(__pyx_t_1);
  2432. if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_4sasl_11saslwrapper_6Client_11decode)) {
  2433. __Pyx_XDECREF(__pyx_r);
  2434. __Pyx_INCREF(__pyx_t_1);
  2435. __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
  2436. if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
  2437. __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
  2438. if (likely(__pyx_t_4)) {
  2439. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
  2440. __Pyx_INCREF(__pyx_t_4);
  2441. __Pyx_INCREF(function);
  2442. __Pyx_DECREF_SET(__pyx_t_3, function);
  2443. }
  2444. }
  2445. __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_cipher_text) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_cipher_text);
  2446. __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  2447. if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 78, __pyx_L1_error)
  2448. __Pyx_GOTREF(__pyx_t_2);
  2449. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  2450. __pyx_r = __pyx_t_2;
  2451. __pyx_t_2 = 0;
  2452. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  2453. goto __pyx_L0;
  2454. }
  2455. #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
  2456. __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
  2457. __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
  2458. if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
  2459. __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
  2460. }
  2461. #endif
  2462. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  2463. #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
  2464. }
  2465. #endif
  2466. }
  2467. /* "sasl/saslwrapper.pyx":80
  2468. * cpdef decode(self, cipher_text):
  2469. * cdef string_t clear_text
  2470. * success = self._this.decode(to_bytes(cipher_text), clear_text) # <<<<<<<<<<<<<<
  2471. * return (success, clear_text)
  2472. *
  2473. */
  2474. __pyx_v_success = __pyx_v_self->_this.decode(__pyx_f_4sasl_11saslwrapper_to_bytes(__pyx_v_cipher_text, 0), __pyx_v_clear_text);
  2475. /* "sasl/saslwrapper.pyx":81
  2476. * cdef string_t clear_text
  2477. * success = self._this.decode(to_bytes(cipher_text), clear_text)
  2478. * return (success, clear_text) # <<<<<<<<<<<<<<
  2479. *
  2480. * cpdef getUserId(self):
  2481. */
  2482. __Pyx_XDECREF(__pyx_r);
  2483. __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_success); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 81, __pyx_L1_error)
  2484. __Pyx_GOTREF(__pyx_t_1);
  2485. __pyx_t_2 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_v_clear_text); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 81, __pyx_L1_error)
  2486. __Pyx_GOTREF(__pyx_t_2);
  2487. __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 81, __pyx_L1_error)
  2488. __Pyx_GOTREF(__pyx_t_3);
  2489. __Pyx_GIVEREF(__pyx_t_1);
  2490. PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  2491. __Pyx_GIVEREF(__pyx_t_2);
  2492. PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
  2493. __pyx_t_1 = 0;
  2494. __pyx_t_2 = 0;
  2495. __pyx_r = __pyx_t_3;
  2496. __pyx_t_3 = 0;
  2497. goto __pyx_L0;
  2498. /* "sasl/saslwrapper.pyx":78
  2499. * return (success, cipher_text)
  2500. *
  2501. * cpdef decode(self, cipher_text): # <<<<<<<<<<<<<<
  2502. * cdef string_t clear_text
  2503. * success = self._this.decode(to_bytes(cipher_text), clear_text)
  2504. */
  2505. /* function exit code */
  2506. __pyx_L1_error:;
  2507. __Pyx_XDECREF(__pyx_t_1);
  2508. __Pyx_XDECREF(__pyx_t_2);
  2509. __Pyx_XDECREF(__pyx_t_3);
  2510. __Pyx_XDECREF(__pyx_t_4);
  2511. __Pyx_AddTraceback("sasl.saslwrapper.Client.decode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  2512. __pyx_r = 0;
  2513. __pyx_L0:;
  2514. __Pyx_XGIVEREF(__pyx_r);
  2515. __Pyx_RefNannyFinishContext();
  2516. return __pyx_r;
  2517. }
  2518. /* Python wrapper */
  2519. static PyObject *__pyx_pw_4sasl_11saslwrapper_6Client_11decode(PyObject *__pyx_v_self, PyObject *__pyx_v_cipher_text); /*proto*/
  2520. static PyObject *__pyx_pw_4sasl_11saslwrapper_6Client_11decode(PyObject *__pyx_v_self, PyObject *__pyx_v_cipher_text) {
  2521. PyObject *__pyx_r = 0;
  2522. __Pyx_RefNannyDeclarations
  2523. __Pyx_RefNannySetupContext("decode (wrapper)", 0);
  2524. __pyx_r = __pyx_pf_4sasl_11saslwrapper_6Client_10decode(((struct __pyx_obj_4sasl_11saslwrapper_Client *)__pyx_v_self), ((PyObject *)__pyx_v_cipher_text));
  2525. /* function exit code */
  2526. __Pyx_RefNannyFinishContext();
  2527. return __pyx_r;
  2528. }
  2529. static PyObject *__pyx_pf_4sasl_11saslwrapper_6Client_10decode(struct __pyx_obj_4sasl_11saslwrapper_Client *__pyx_v_self, PyObject *__pyx_v_cipher_text) {
  2530. PyObject *__pyx_r = NULL;
  2531. __Pyx_RefNannyDeclarations
  2532. PyObject *__pyx_t_1 = NULL;
  2533. int __pyx_lineno = 0;
  2534. const char *__pyx_filename = NULL;
  2535. int __pyx_clineno = 0;
  2536. __Pyx_RefNannySetupContext("decode", 0);
  2537. __Pyx_XDECREF(__pyx_r);
  2538. __pyx_t_1 = __pyx_f_4sasl_11saslwrapper_6Client_decode(__pyx_v_self, __pyx_v_cipher_text, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 78, __pyx_L1_error)
  2539. __Pyx_GOTREF(__pyx_t_1);
  2540. __pyx_r = __pyx_t_1;
  2541. __pyx_t_1 = 0;
  2542. goto __pyx_L0;
  2543. /* function exit code */
  2544. __pyx_L1_error:;
  2545. __Pyx_XDECREF(__pyx_t_1);
  2546. __Pyx_AddTraceback("sasl.saslwrapper.Client.decode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  2547. __pyx_r = NULL;
  2548. __pyx_L0:;
  2549. __Pyx_XGIVEREF(__pyx_r);
  2550. __Pyx_RefNannyFinishContext();
  2551. return __pyx_r;
  2552. }
  2553. /* "sasl/saslwrapper.pyx":83
  2554. * return (success, clear_text)
  2555. *
  2556. * cpdef getUserId(self): # <<<<<<<<<<<<<<
  2557. * cdef string_t user_id
  2558. * success = self._this.getUserId(user_id)
  2559. */
  2560. static PyObject *__pyx_pw_4sasl_11saslwrapper_6Client_13getUserId(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
  2561. static PyObject *__pyx_f_4sasl_11saslwrapper_6Client_getUserId(struct __pyx_obj_4sasl_11saslwrapper_Client *__pyx_v_self, int __pyx_skip_dispatch) {
  2562. std::string __pyx_v_user_id;
  2563. bool __pyx_v_success;
  2564. PyObject *__pyx_r = NULL;
  2565. __Pyx_RefNannyDeclarations
  2566. PyObject *__pyx_t_1 = NULL;
  2567. PyObject *__pyx_t_2 = NULL;
  2568. PyObject *__pyx_t_3 = NULL;
  2569. PyObject *__pyx_t_4 = NULL;
  2570. int __pyx_lineno = 0;
  2571. const char *__pyx_filename = NULL;
  2572. int __pyx_clineno = 0;
  2573. __Pyx_RefNannySetupContext("getUserId", 0);
  2574. /* Check if called by wrapper */
  2575. if (unlikely(__pyx_skip_dispatch)) ;
  2576. /* Check if overridden in Python */
  2577. else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
  2578. #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
  2579. static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
  2580. if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
  2581. PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
  2582. #endif
  2583. __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getUserId); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 83, __pyx_L1_error)
  2584. __Pyx_GOTREF(__pyx_t_1);
  2585. if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_4sasl_11saslwrapper_6Client_13getUserId)) {
  2586. __Pyx_XDECREF(__pyx_r);
  2587. __Pyx_INCREF(__pyx_t_1);
  2588. __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
  2589. if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
  2590. __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
  2591. if (likely(__pyx_t_4)) {
  2592. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
  2593. __Pyx_INCREF(__pyx_t_4);
  2594. __Pyx_INCREF(function);
  2595. __Pyx_DECREF_SET(__pyx_t_3, function);
  2596. }
  2597. }
  2598. __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
  2599. __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  2600. if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 83, __pyx_L1_error)
  2601. __Pyx_GOTREF(__pyx_t_2);
  2602. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  2603. __pyx_r = __pyx_t_2;
  2604. __pyx_t_2 = 0;
  2605. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  2606. goto __pyx_L0;
  2607. }
  2608. #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
  2609. __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
  2610. __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
  2611. if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
  2612. __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
  2613. }
  2614. #endif
  2615. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  2616. #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
  2617. }
  2618. #endif
  2619. }
  2620. /* "sasl/saslwrapper.pyx":85
  2621. * cpdef getUserId(self):
  2622. * cdef string_t user_id
  2623. * success = self._this.getUserId(user_id) # <<<<<<<<<<<<<<
  2624. * return (success, user_id)
  2625. *
  2626. */
  2627. __pyx_v_success = __pyx_v_self->_this.getUserId(__pyx_v_user_id);
  2628. /* "sasl/saslwrapper.pyx":86
  2629. * cdef string_t user_id
  2630. * success = self._this.getUserId(user_id)
  2631. * return (success, user_id) # <<<<<<<<<<<<<<
  2632. *
  2633. * cpdef getSSF(self):
  2634. */
  2635. __Pyx_XDECREF(__pyx_r);
  2636. __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_success); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 86, __pyx_L1_error)
  2637. __Pyx_GOTREF(__pyx_t_1);
  2638. __pyx_t_2 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_v_user_id); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 86, __pyx_L1_error)
  2639. __Pyx_GOTREF(__pyx_t_2);
  2640. __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 86, __pyx_L1_error)
  2641. __Pyx_GOTREF(__pyx_t_3);
  2642. __Pyx_GIVEREF(__pyx_t_1);
  2643. PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  2644. __Pyx_GIVEREF(__pyx_t_2);
  2645. PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
  2646. __pyx_t_1 = 0;
  2647. __pyx_t_2 = 0;
  2648. __pyx_r = __pyx_t_3;
  2649. __pyx_t_3 = 0;
  2650. goto __pyx_L0;
  2651. /* "sasl/saslwrapper.pyx":83
  2652. * return (success, clear_text)
  2653. *
  2654. * cpdef getUserId(self): # <<<<<<<<<<<<<<
  2655. * cdef string_t user_id
  2656. * success = self._this.getUserId(user_id)
  2657. */
  2658. /* function exit code */
  2659. __pyx_L1_error:;
  2660. __Pyx_XDECREF(__pyx_t_1);
  2661. __Pyx_XDECREF(__pyx_t_2);
  2662. __Pyx_XDECREF(__pyx_t_3);
  2663. __Pyx_XDECREF(__pyx_t_4);
  2664. __Pyx_AddTraceback("sasl.saslwrapper.Client.getUserId", __pyx_clineno, __pyx_lineno, __pyx_filename);
  2665. __pyx_r = 0;
  2666. __pyx_L0:;
  2667. __Pyx_XGIVEREF(__pyx_r);
  2668. __Pyx_RefNannyFinishContext();
  2669. return __pyx_r;
  2670. }
  2671. /* Python wrapper */
  2672. static PyObject *__pyx_pw_4sasl_11saslwrapper_6Client_13getUserId(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
  2673. static PyObject *__pyx_pw_4sasl_11saslwrapper_6Client_13getUserId(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  2674. PyObject *__pyx_r = 0;
  2675. __Pyx_RefNannyDeclarations
  2676. __Pyx_RefNannySetupContext("getUserId (wrapper)", 0);
  2677. __pyx_r = __pyx_pf_4sasl_11saslwrapper_6Client_12getUserId(((struct __pyx_obj_4sasl_11saslwrapper_Client *)__pyx_v_self));
  2678. /* function exit code */
  2679. __Pyx_RefNannyFinishContext();
  2680. return __pyx_r;
  2681. }
  2682. static PyObject *__pyx_pf_4sasl_11saslwrapper_6Client_12getUserId(struct __pyx_obj_4sasl_11saslwrapper_Client *__pyx_v_self) {
  2683. PyObject *__pyx_r = NULL;
  2684. __Pyx_RefNannyDeclarations
  2685. PyObject *__pyx_t_1 = NULL;
  2686. int __pyx_lineno = 0;
  2687. const char *__pyx_filename = NULL;
  2688. int __pyx_clineno = 0;
  2689. __Pyx_RefNannySetupContext("getUserId", 0);
  2690. __Pyx_XDECREF(__pyx_r);
  2691. __pyx_t_1 = __pyx_f_4sasl_11saslwrapper_6Client_getUserId(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 83, __pyx_L1_error)
  2692. __Pyx_GOTREF(__pyx_t_1);
  2693. __pyx_r = __pyx_t_1;
  2694. __pyx_t_1 = 0;
  2695. goto __pyx_L0;
  2696. /* function exit code */
  2697. __pyx_L1_error:;
  2698. __Pyx_XDECREF(__pyx_t_1);
  2699. __Pyx_AddTraceback("sasl.saslwrapper.Client.getUserId", __pyx_clineno, __pyx_lineno, __pyx_filename);
  2700. __pyx_r = NULL;
  2701. __pyx_L0:;
  2702. __Pyx_XGIVEREF(__pyx_r);
  2703. __Pyx_RefNannyFinishContext();
  2704. return __pyx_r;
  2705. }
  2706. /* "sasl/saslwrapper.pyx":88
  2707. * return (success, user_id)
  2708. *
  2709. * cpdef getSSF(self): # <<<<<<<<<<<<<<
  2710. * cdef int ssf
  2711. * success = self._this.getSSF(&ssf)
  2712. */
  2713. static PyObject *__pyx_pw_4sasl_11saslwrapper_6Client_15getSSF(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
  2714. static PyObject *__pyx_f_4sasl_11saslwrapper_6Client_getSSF(struct __pyx_obj_4sasl_11saslwrapper_Client *__pyx_v_self, int __pyx_skip_dispatch) {
  2715. int __pyx_v_ssf;
  2716. bool __pyx_v_success;
  2717. PyObject *__pyx_r = NULL;
  2718. __Pyx_RefNannyDeclarations
  2719. PyObject *__pyx_t_1 = NULL;
  2720. PyObject *__pyx_t_2 = NULL;
  2721. PyObject *__pyx_t_3 = NULL;
  2722. PyObject *__pyx_t_4 = NULL;
  2723. int __pyx_lineno = 0;
  2724. const char *__pyx_filename = NULL;
  2725. int __pyx_clineno = 0;
  2726. __Pyx_RefNannySetupContext("getSSF", 0);
  2727. /* Check if called by wrapper */
  2728. if (unlikely(__pyx_skip_dispatch)) ;
  2729. /* Check if overridden in Python */
  2730. else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
  2731. #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
  2732. static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
  2733. if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
  2734. PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
  2735. #endif
  2736. __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getSSF); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 88, __pyx_L1_error)
  2737. __Pyx_GOTREF(__pyx_t_1);
  2738. if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_4sasl_11saslwrapper_6Client_15getSSF)) {
  2739. __Pyx_XDECREF(__pyx_r);
  2740. __Pyx_INCREF(__pyx_t_1);
  2741. __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
  2742. if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
  2743. __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
  2744. if (likely(__pyx_t_4)) {
  2745. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
  2746. __Pyx_INCREF(__pyx_t_4);
  2747. __Pyx_INCREF(function);
  2748. __Pyx_DECREF_SET(__pyx_t_3, function);
  2749. }
  2750. }
  2751. __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
  2752. __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  2753. if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 88, __pyx_L1_error)
  2754. __Pyx_GOTREF(__pyx_t_2);
  2755. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  2756. __pyx_r = __pyx_t_2;
  2757. __pyx_t_2 = 0;
  2758. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  2759. goto __pyx_L0;
  2760. }
  2761. #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
  2762. __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
  2763. __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
  2764. if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
  2765. __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
  2766. }
  2767. #endif
  2768. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  2769. #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
  2770. }
  2771. #endif
  2772. }
  2773. /* "sasl/saslwrapper.pyx":90
  2774. * cpdef getSSF(self):
  2775. * cdef int ssf
  2776. * success = self._this.getSSF(&ssf) # <<<<<<<<<<<<<<
  2777. * return (success, ssf)
  2778. *
  2779. */
  2780. __pyx_v_success = __pyx_v_self->_this.getSSF((&__pyx_v_ssf));
  2781. /* "sasl/saslwrapper.pyx":91
  2782. * cdef int ssf
  2783. * success = self._this.getSSF(&ssf)
  2784. * return (success, ssf) # <<<<<<<<<<<<<<
  2785. *
  2786. * cpdef getError(self):
  2787. */
  2788. __Pyx_XDECREF(__pyx_r);
  2789. __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_success); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 91, __pyx_L1_error)
  2790. __Pyx_GOTREF(__pyx_t_1);
  2791. __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_ssf); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 91, __pyx_L1_error)
  2792. __Pyx_GOTREF(__pyx_t_2);
  2793. __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 91, __pyx_L1_error)
  2794. __Pyx_GOTREF(__pyx_t_3);
  2795. __Pyx_GIVEREF(__pyx_t_1);
  2796. PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  2797. __Pyx_GIVEREF(__pyx_t_2);
  2798. PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
  2799. __pyx_t_1 = 0;
  2800. __pyx_t_2 = 0;
  2801. __pyx_r = __pyx_t_3;
  2802. __pyx_t_3 = 0;
  2803. goto __pyx_L0;
  2804. /* "sasl/saslwrapper.pyx":88
  2805. * return (success, user_id)
  2806. *
  2807. * cpdef getSSF(self): # <<<<<<<<<<<<<<
  2808. * cdef int ssf
  2809. * success = self._this.getSSF(&ssf)
  2810. */
  2811. /* function exit code */
  2812. __pyx_L1_error:;
  2813. __Pyx_XDECREF(__pyx_t_1);
  2814. __Pyx_XDECREF(__pyx_t_2);
  2815. __Pyx_XDECREF(__pyx_t_3);
  2816. __Pyx_XDECREF(__pyx_t_4);
  2817. __Pyx_AddTraceback("sasl.saslwrapper.Client.getSSF", __pyx_clineno, __pyx_lineno, __pyx_filename);
  2818. __pyx_r = 0;
  2819. __pyx_L0:;
  2820. __Pyx_XGIVEREF(__pyx_r);
  2821. __Pyx_RefNannyFinishContext();
  2822. return __pyx_r;
  2823. }
  2824. /* Python wrapper */
  2825. static PyObject *__pyx_pw_4sasl_11saslwrapper_6Client_15getSSF(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
  2826. static PyObject *__pyx_pw_4sasl_11saslwrapper_6Client_15getSSF(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  2827. PyObject *__pyx_r = 0;
  2828. __Pyx_RefNannyDeclarations
  2829. __Pyx_RefNannySetupContext("getSSF (wrapper)", 0);
  2830. __pyx_r = __pyx_pf_4sasl_11saslwrapper_6Client_14getSSF(((struct __pyx_obj_4sasl_11saslwrapper_Client *)__pyx_v_self));
  2831. /* function exit code */
  2832. __Pyx_RefNannyFinishContext();
  2833. return __pyx_r;
  2834. }
  2835. static PyObject *__pyx_pf_4sasl_11saslwrapper_6Client_14getSSF(struct __pyx_obj_4sasl_11saslwrapper_Client *__pyx_v_self) {
  2836. PyObject *__pyx_r = NULL;
  2837. __Pyx_RefNannyDeclarations
  2838. PyObject *__pyx_t_1 = NULL;
  2839. int __pyx_lineno = 0;
  2840. const char *__pyx_filename = NULL;
  2841. int __pyx_clineno = 0;
  2842. __Pyx_RefNannySetupContext("getSSF", 0);
  2843. __Pyx_XDECREF(__pyx_r);
  2844. __pyx_t_1 = __pyx_f_4sasl_11saslwrapper_6Client_getSSF(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 88, __pyx_L1_error)
  2845. __Pyx_GOTREF(__pyx_t_1);
  2846. __pyx_r = __pyx_t_1;
  2847. __pyx_t_1 = 0;
  2848. goto __pyx_L0;
  2849. /* function exit code */
  2850. __pyx_L1_error:;
  2851. __Pyx_XDECREF(__pyx_t_1);
  2852. __Pyx_AddTraceback("sasl.saslwrapper.Client.getSSF", __pyx_clineno, __pyx_lineno, __pyx_filename);
  2853. __pyx_r = NULL;
  2854. __pyx_L0:;
  2855. __Pyx_XGIVEREF(__pyx_r);
  2856. __Pyx_RefNannyFinishContext();
  2857. return __pyx_r;
  2858. }
  2859. /* "sasl/saslwrapper.pyx":93
  2860. * return (success, ssf)
  2861. *
  2862. * cpdef getError(self): # <<<<<<<<<<<<<<
  2863. * cdef string_t error
  2864. * self._this.getError(error)
  2865. */
  2866. static PyObject *__pyx_pw_4sasl_11saslwrapper_6Client_17getError(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
  2867. static PyObject *__pyx_f_4sasl_11saslwrapper_6Client_getError(struct __pyx_obj_4sasl_11saslwrapper_Client *__pyx_v_self, int __pyx_skip_dispatch) {
  2868. std::string __pyx_v_error;
  2869. PyObject *__pyx_r = NULL;
  2870. __Pyx_RefNannyDeclarations
  2871. PyObject *__pyx_t_1 = NULL;
  2872. PyObject *__pyx_t_2 = NULL;
  2873. PyObject *__pyx_t_3 = NULL;
  2874. PyObject *__pyx_t_4 = NULL;
  2875. int __pyx_lineno = 0;
  2876. const char *__pyx_filename = NULL;
  2877. int __pyx_clineno = 0;
  2878. __Pyx_RefNannySetupContext("getError", 0);
  2879. /* Check if called by wrapper */
  2880. if (unlikely(__pyx_skip_dispatch)) ;
  2881. /* Check if overridden in Python */
  2882. else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
  2883. #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
  2884. static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
  2885. if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
  2886. PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
  2887. #endif
  2888. __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getError); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 93, __pyx_L1_error)
  2889. __Pyx_GOTREF(__pyx_t_1);
  2890. if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_4sasl_11saslwrapper_6Client_17getError)) {
  2891. __Pyx_XDECREF(__pyx_r);
  2892. __Pyx_INCREF(__pyx_t_1);
  2893. __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
  2894. if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
  2895. __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
  2896. if (likely(__pyx_t_4)) {
  2897. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
  2898. __Pyx_INCREF(__pyx_t_4);
  2899. __Pyx_INCREF(function);
  2900. __Pyx_DECREF_SET(__pyx_t_3, function);
  2901. }
  2902. }
  2903. __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
  2904. __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  2905. if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 93, __pyx_L1_error)
  2906. __Pyx_GOTREF(__pyx_t_2);
  2907. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  2908. __pyx_r = __pyx_t_2;
  2909. __pyx_t_2 = 0;
  2910. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  2911. goto __pyx_L0;
  2912. }
  2913. #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
  2914. __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
  2915. __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
  2916. if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
  2917. __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
  2918. }
  2919. #endif
  2920. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  2921. #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
  2922. }
  2923. #endif
  2924. }
  2925. /* "sasl/saslwrapper.pyx":95
  2926. * cpdef getError(self):
  2927. * cdef string_t error
  2928. * self._this.getError(error) # <<<<<<<<<<<<<<
  2929. * return error
  2930. */
  2931. __pyx_v_self->_this.getError(__pyx_v_error);
  2932. /* "sasl/saslwrapper.pyx":96
  2933. * cdef string_t error
  2934. * self._this.getError(error)
  2935. * return error # <<<<<<<<<<<<<<
  2936. */
  2937. __Pyx_XDECREF(__pyx_r);
  2938. __pyx_t_1 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_v_error); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 96, __pyx_L1_error)
  2939. __Pyx_GOTREF(__pyx_t_1);
  2940. __pyx_r = __pyx_t_1;
  2941. __pyx_t_1 = 0;
  2942. goto __pyx_L0;
  2943. /* "sasl/saslwrapper.pyx":93
  2944. * return (success, ssf)
  2945. *
  2946. * cpdef getError(self): # <<<<<<<<<<<<<<
  2947. * cdef string_t error
  2948. * self._this.getError(error)
  2949. */
  2950. /* function exit code */
  2951. __pyx_L1_error:;
  2952. __Pyx_XDECREF(__pyx_t_1);
  2953. __Pyx_XDECREF(__pyx_t_2);
  2954. __Pyx_XDECREF(__pyx_t_3);
  2955. __Pyx_XDECREF(__pyx_t_4);
  2956. __Pyx_AddTraceback("sasl.saslwrapper.Client.getError", __pyx_clineno, __pyx_lineno, __pyx_filename);
  2957. __pyx_r = 0;
  2958. __pyx_L0:;
  2959. __Pyx_XGIVEREF(__pyx_r);
  2960. __Pyx_RefNannyFinishContext();
  2961. return __pyx_r;
  2962. }
  2963. /* Python wrapper */
  2964. static PyObject *__pyx_pw_4sasl_11saslwrapper_6Client_17getError(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
  2965. static PyObject *__pyx_pw_4sasl_11saslwrapper_6Client_17getError(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  2966. PyObject *__pyx_r = 0;
  2967. __Pyx_RefNannyDeclarations
  2968. __Pyx_RefNannySetupContext("getError (wrapper)", 0);
  2969. __pyx_r = __pyx_pf_4sasl_11saslwrapper_6Client_16getError(((struct __pyx_obj_4sasl_11saslwrapper_Client *)__pyx_v_self));
  2970. /* function exit code */
  2971. __Pyx_RefNannyFinishContext();
  2972. return __pyx_r;
  2973. }
  2974. static PyObject *__pyx_pf_4sasl_11saslwrapper_6Client_16getError(struct __pyx_obj_4sasl_11saslwrapper_Client *__pyx_v_self) {
  2975. PyObject *__pyx_r = NULL;
  2976. __Pyx_RefNannyDeclarations
  2977. PyObject *__pyx_t_1 = NULL;
  2978. int __pyx_lineno = 0;
  2979. const char *__pyx_filename = NULL;
  2980. int __pyx_clineno = 0;
  2981. __Pyx_RefNannySetupContext("getError", 0);
  2982. __Pyx_XDECREF(__pyx_r);
  2983. __pyx_t_1 = __pyx_f_4sasl_11saslwrapper_6Client_getError(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 93, __pyx_L1_error)
  2984. __Pyx_GOTREF(__pyx_t_1);
  2985. __pyx_r = __pyx_t_1;
  2986. __pyx_t_1 = 0;
  2987. goto __pyx_L0;
  2988. /* function exit code */
  2989. __pyx_L1_error:;
  2990. __Pyx_XDECREF(__pyx_t_1);
  2991. __Pyx_AddTraceback("sasl.saslwrapper.Client.getError", __pyx_clineno, __pyx_lineno, __pyx_filename);
  2992. __pyx_r = NULL;
  2993. __pyx_L0:;
  2994. __Pyx_XGIVEREF(__pyx_r);
  2995. __Pyx_RefNannyFinishContext();
  2996. return __pyx_r;
  2997. }
  2998. /* "(tree fragment)":1
  2999. * def __reduce_cython__(self): # <<<<<<<<<<<<<<
  3000. * raise TypeError("self._this cannot be converted to a Python object for pickling")
  3001. * def __setstate_cython__(self, __pyx_state):
  3002. */
  3003. /* Python wrapper */
  3004. static PyObject *__pyx_pw_4sasl_11saslwrapper_6Client_19__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
  3005. static PyObject *__pyx_pw_4sasl_11saslwrapper_6Client_19__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  3006. PyObject *__pyx_r = 0;
  3007. __Pyx_RefNannyDeclarations
  3008. __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  3009. __pyx_r = __pyx_pf_4sasl_11saslwrapper_6Client_18__reduce_cython__(((struct __pyx_obj_4sasl_11saslwrapper_Client *)__pyx_v_self));
  3010. /* function exit code */
  3011. __Pyx_RefNannyFinishContext();
  3012. return __pyx_r;
  3013. }
  3014. static PyObject *__pyx_pf_4sasl_11saslwrapper_6Client_18__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_4sasl_11saslwrapper_Client *__pyx_v_self) {
  3015. PyObject *__pyx_r = NULL;
  3016. __Pyx_RefNannyDeclarations
  3017. PyObject *__pyx_t_1 = NULL;
  3018. int __pyx_lineno = 0;
  3019. const char *__pyx_filename = NULL;
  3020. int __pyx_clineno = 0;
  3021. __Pyx_RefNannySetupContext("__reduce_cython__", 0);
  3022. /* "(tree fragment)":2
  3023. * def __reduce_cython__(self):
  3024. * raise TypeError("self._this cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<<
  3025. * def __setstate_cython__(self, __pyx_state):
  3026. * raise TypeError("self._this cannot be converted to a Python object for pickling")
  3027. */
  3028. __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2, __pyx_L1_error)
  3029. __Pyx_GOTREF(__pyx_t_1);
  3030. __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  3031. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  3032. __PYX_ERR(0, 2, __pyx_L1_error)
  3033. /* "(tree fragment)":1
  3034. * def __reduce_cython__(self): # <<<<<<<<<<<<<<
  3035. * raise TypeError("self._this cannot be converted to a Python object for pickling")
  3036. * def __setstate_cython__(self, __pyx_state):
  3037. */
  3038. /* function exit code */
  3039. __pyx_L1_error:;
  3040. __Pyx_XDECREF(__pyx_t_1);
  3041. __Pyx_AddTraceback("sasl.saslwrapper.Client.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  3042. __pyx_r = NULL;
  3043. __Pyx_XGIVEREF(__pyx_r);
  3044. __Pyx_RefNannyFinishContext();
  3045. return __pyx_r;
  3046. }
  3047. /* "(tree fragment)":3
  3048. * def __reduce_cython__(self):
  3049. * raise TypeError("self._this cannot be converted to a Python object for pickling")
  3050. * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
  3051. * raise TypeError("self._this cannot be converted to a Python object for pickling")
  3052. */
  3053. /* Python wrapper */
  3054. static PyObject *__pyx_pw_4sasl_11saslwrapper_6Client_21__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
  3055. static PyObject *__pyx_pw_4sasl_11saslwrapper_6Client_21__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  3056. PyObject *__pyx_r = 0;
  3057. __Pyx_RefNannyDeclarations
  3058. __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  3059. __pyx_r = __pyx_pf_4sasl_11saslwrapper_6Client_20__setstate_cython__(((struct __pyx_obj_4sasl_11saslwrapper_Client *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
  3060. /* function exit code */
  3061. __Pyx_RefNannyFinishContext();
  3062. return __pyx_r;
  3063. }
  3064. static PyObject *__pyx_pf_4sasl_11saslwrapper_6Client_20__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_4sasl_11saslwrapper_Client *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  3065. PyObject *__pyx_r = NULL;
  3066. __Pyx_RefNannyDeclarations
  3067. PyObject *__pyx_t_1 = NULL;
  3068. int __pyx_lineno = 0;
  3069. const char *__pyx_filename = NULL;
  3070. int __pyx_clineno = 0;
  3071. __Pyx_RefNannySetupContext("__setstate_cython__", 0);
  3072. /* "(tree fragment)":4
  3073. * raise TypeError("self._this cannot be converted to a Python object for pickling")
  3074. * def __setstate_cython__(self, __pyx_state):
  3075. * raise TypeError("self._this cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<<
  3076. */
  3077. __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4, __pyx_L1_error)
  3078. __Pyx_GOTREF(__pyx_t_1);
  3079. __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  3080. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  3081. __PYX_ERR(0, 4, __pyx_L1_error)
  3082. /* "(tree fragment)":3
  3083. * def __reduce_cython__(self):
  3084. * raise TypeError("self._this cannot be converted to a Python object for pickling")
  3085. * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
  3086. * raise TypeError("self._this cannot be converted to a Python object for pickling")
  3087. */
  3088. /* function exit code */
  3089. __pyx_L1_error:;
  3090. __Pyx_XDECREF(__pyx_t_1);
  3091. __Pyx_AddTraceback("sasl.saslwrapper.Client.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  3092. __pyx_r = NULL;
  3093. __Pyx_XGIVEREF(__pyx_r);
  3094. __Pyx_RefNannyFinishContext();
  3095. return __pyx_r;
  3096. }
  3097. /* "string.from_py":13
  3098. *
  3099. * @cname("__pyx_convert_string_from_py_std__in_string")
  3100. * cdef string __pyx_convert_string_from_py_std__in_string(object o) except *: # <<<<<<<<<<<<<<
  3101. * cdef Py_ssize_t length = 0
  3102. * cdef const char* data = __Pyx_PyObject_AsStringAndSize(o, &length)
  3103. */
  3104. static std::string __pyx_convert_string_from_py_std__in_string(PyObject *__pyx_v_o) {
  3105. Py_ssize_t __pyx_v_length;
  3106. char const *__pyx_v_data;
  3107. std::string __pyx_r;
  3108. __Pyx_RefNannyDeclarations
  3109. char const *__pyx_t_1;
  3110. int __pyx_lineno = 0;
  3111. const char *__pyx_filename = NULL;
  3112. int __pyx_clineno = 0;
  3113. __Pyx_RefNannySetupContext("__pyx_convert_string_from_py_std__in_string", 0);
  3114. /* "string.from_py":14
  3115. * @cname("__pyx_convert_string_from_py_std__in_string")
  3116. * cdef string __pyx_convert_string_from_py_std__in_string(object o) except *:
  3117. * cdef Py_ssize_t length = 0 # <<<<<<<<<<<<<<
  3118. * cdef const char* data = __Pyx_PyObject_AsStringAndSize(o, &length)
  3119. * return string(data, length)
  3120. */
  3121. __pyx_v_length = 0;
  3122. /* "string.from_py":15
  3123. * cdef string __pyx_convert_string_from_py_std__in_string(object o) except *:
  3124. * cdef Py_ssize_t length = 0
  3125. * cdef const char* data = __Pyx_PyObject_AsStringAndSize(o, &length) # <<<<<<<<<<<<<<
  3126. * return string(data, length)
  3127. *
  3128. */
  3129. __pyx_t_1 = __Pyx_PyObject_AsStringAndSize(__pyx_v_o, (&__pyx_v_length)); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(0, 15, __pyx_L1_error)
  3130. __pyx_v_data = __pyx_t_1;
  3131. /* "string.from_py":16
  3132. * cdef Py_ssize_t length = 0
  3133. * cdef const char* data = __Pyx_PyObject_AsStringAndSize(o, &length)
  3134. * return string(data, length) # <<<<<<<<<<<<<<
  3135. *
  3136. *
  3137. */
  3138. __pyx_r = std::string(__pyx_v_data, __pyx_v_length);
  3139. goto __pyx_L0;
  3140. /* "string.from_py":13
  3141. *
  3142. * @cname("__pyx_convert_string_from_py_std__in_string")
  3143. * cdef string __pyx_convert_string_from_py_std__in_string(object o) except *: # <<<<<<<<<<<<<<
  3144. * cdef Py_ssize_t length = 0
  3145. * cdef const char* data = __Pyx_PyObject_AsStringAndSize(o, &length)
  3146. */
  3147. /* function exit code */
  3148. __pyx_L1_error:;
  3149. __Pyx_AddTraceback("string.from_py.__pyx_convert_string_from_py_std__in_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  3150. __Pyx_pretend_to_initialize(&__pyx_r);
  3151. __pyx_L0:;
  3152. __Pyx_RefNannyFinishContext();
  3153. return __pyx_r;
  3154. }
  3155. /* "string.to_py":31
  3156. *
  3157. * @cname("__pyx_convert_PyObject_string_to_py_std__in_string")
  3158. * cdef inline object __pyx_convert_PyObject_string_to_py_std__in_string(const string& s): # <<<<<<<<<<<<<<
  3159. * return __Pyx_PyObject_FromStringAndSize(s.data(), s.size())
  3160. * cdef extern from *:
  3161. */
  3162. static CYTHON_INLINE PyObject *__pyx_convert_PyObject_string_to_py_std__in_string(std::string const &__pyx_v_s) {
  3163. PyObject *__pyx_r = NULL;
  3164. __Pyx_RefNannyDeclarations
  3165. PyObject *__pyx_t_1 = NULL;
  3166. int __pyx_lineno = 0;
  3167. const char *__pyx_filename = NULL;
  3168. int __pyx_clineno = 0;
  3169. __Pyx_RefNannySetupContext("__pyx_convert_PyObject_string_to_py_std__in_string", 0);
  3170. /* "string.to_py":32
  3171. * @cname("__pyx_convert_PyObject_string_to_py_std__in_string")
  3172. * cdef inline object __pyx_convert_PyObject_string_to_py_std__in_string(const string& s):
  3173. * return __Pyx_PyObject_FromStringAndSize(s.data(), s.size()) # <<<<<<<<<<<<<<
  3174. * cdef extern from *:
  3175. * cdef object __Pyx_PyUnicode_FromStringAndSize(const char*, size_t)
  3176. */
  3177. __Pyx_XDECREF(__pyx_r);
  3178. __pyx_t_1 = __Pyx_PyObject_FromStringAndSize(__pyx_v_s.data(), __pyx_v_s.size()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 32, __pyx_L1_error)
  3179. __Pyx_GOTREF(__pyx_t_1);
  3180. __pyx_r = __pyx_t_1;
  3181. __pyx_t_1 = 0;
  3182. goto __pyx_L0;
  3183. /* "string.to_py":31
  3184. *
  3185. * @cname("__pyx_convert_PyObject_string_to_py_std__in_string")
  3186. * cdef inline object __pyx_convert_PyObject_string_to_py_std__in_string(const string& s): # <<<<<<<<<<<<<<
  3187. * return __Pyx_PyObject_FromStringAndSize(s.data(), s.size())
  3188. * cdef extern from *:
  3189. */
  3190. /* function exit code */
  3191. __pyx_L1_error:;
  3192. __Pyx_XDECREF(__pyx_t_1);
  3193. __Pyx_AddTraceback("string.to_py.__pyx_convert_PyObject_string_to_py_std__in_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  3194. __pyx_r = 0;
  3195. __pyx_L0:;
  3196. __Pyx_XGIVEREF(__pyx_r);
  3197. __Pyx_RefNannyFinishContext();
  3198. return __pyx_r;
  3199. }
  3200. /* "string.to_py":37
  3201. *
  3202. * @cname("__pyx_convert_PyUnicode_string_to_py_std__in_string")
  3203. * cdef inline object __pyx_convert_PyUnicode_string_to_py_std__in_string(const string& s): # <<<<<<<<<<<<<<
  3204. * return __Pyx_PyUnicode_FromStringAndSize(s.data(), s.size())
  3205. * cdef extern from *:
  3206. */
  3207. static CYTHON_INLINE PyObject *__pyx_convert_PyUnicode_string_to_py_std__in_string(std::string const &__pyx_v_s) {
  3208. PyObject *__pyx_r = NULL;
  3209. __Pyx_RefNannyDeclarations
  3210. PyObject *__pyx_t_1 = NULL;
  3211. int __pyx_lineno = 0;
  3212. const char *__pyx_filename = NULL;
  3213. int __pyx_clineno = 0;
  3214. __Pyx_RefNannySetupContext("__pyx_convert_PyUnicode_string_to_py_std__in_string", 0);
  3215. /* "string.to_py":38
  3216. * @cname("__pyx_convert_PyUnicode_string_to_py_std__in_string")
  3217. * cdef inline object __pyx_convert_PyUnicode_string_to_py_std__in_string(const string& s):
  3218. * return __Pyx_PyUnicode_FromStringAndSize(s.data(), s.size()) # <<<<<<<<<<<<<<
  3219. * cdef extern from *:
  3220. * cdef object __Pyx_PyStr_FromStringAndSize(const char*, size_t)
  3221. */
  3222. __Pyx_XDECREF(__pyx_r);
  3223. __pyx_t_1 = __Pyx_PyUnicode_FromStringAndSize(__pyx_v_s.data(), __pyx_v_s.size()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 38, __pyx_L1_error)
  3224. __Pyx_GOTREF(__pyx_t_1);
  3225. __pyx_r = __pyx_t_1;
  3226. __pyx_t_1 = 0;
  3227. goto __pyx_L0;
  3228. /* "string.to_py":37
  3229. *
  3230. * @cname("__pyx_convert_PyUnicode_string_to_py_std__in_string")
  3231. * cdef inline object __pyx_convert_PyUnicode_string_to_py_std__in_string(const string& s): # <<<<<<<<<<<<<<
  3232. * return __Pyx_PyUnicode_FromStringAndSize(s.data(), s.size())
  3233. * cdef extern from *:
  3234. */
  3235. /* function exit code */
  3236. __pyx_L1_error:;
  3237. __Pyx_XDECREF(__pyx_t_1);
  3238. __Pyx_AddTraceback("string.to_py.__pyx_convert_PyUnicode_string_to_py_std__in_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  3239. __pyx_r = 0;
  3240. __pyx_L0:;
  3241. __Pyx_XGIVEREF(__pyx_r);
  3242. __Pyx_RefNannyFinishContext();
  3243. return __pyx_r;
  3244. }
  3245. /* "string.to_py":43
  3246. *
  3247. * @cname("__pyx_convert_PyStr_string_to_py_std__in_string")
  3248. * cdef inline object __pyx_convert_PyStr_string_to_py_std__in_string(const string& s): # <<<<<<<<<<<<<<
  3249. * return __Pyx_PyStr_FromStringAndSize(s.data(), s.size())
  3250. * cdef extern from *:
  3251. */
  3252. static CYTHON_INLINE PyObject *__pyx_convert_PyStr_string_to_py_std__in_string(std::string const &__pyx_v_s) {
  3253. PyObject *__pyx_r = NULL;
  3254. __Pyx_RefNannyDeclarations
  3255. PyObject *__pyx_t_1 = NULL;
  3256. int __pyx_lineno = 0;
  3257. const char *__pyx_filename = NULL;
  3258. int __pyx_clineno = 0;
  3259. __Pyx_RefNannySetupContext("__pyx_convert_PyStr_string_to_py_std__in_string", 0);
  3260. /* "string.to_py":44
  3261. * @cname("__pyx_convert_PyStr_string_to_py_std__in_string")
  3262. * cdef inline object __pyx_convert_PyStr_string_to_py_std__in_string(const string& s):
  3263. * return __Pyx_PyStr_FromStringAndSize(s.data(), s.size()) # <<<<<<<<<<<<<<
  3264. * cdef extern from *:
  3265. * cdef object __Pyx_PyBytes_FromStringAndSize(const char*, size_t)
  3266. */
  3267. __Pyx_XDECREF(__pyx_r);
  3268. __pyx_t_1 = __Pyx_PyStr_FromStringAndSize(__pyx_v_s.data(), __pyx_v_s.size()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 44, __pyx_L1_error)
  3269. __Pyx_GOTREF(__pyx_t_1);
  3270. __pyx_r = __pyx_t_1;
  3271. __pyx_t_1 = 0;
  3272. goto __pyx_L0;
  3273. /* "string.to_py":43
  3274. *
  3275. * @cname("__pyx_convert_PyStr_string_to_py_std__in_string")
  3276. * cdef inline object __pyx_convert_PyStr_string_to_py_std__in_string(const string& s): # <<<<<<<<<<<<<<
  3277. * return __Pyx_PyStr_FromStringAndSize(s.data(), s.size())
  3278. * cdef extern from *:
  3279. */
  3280. /* function exit code */
  3281. __pyx_L1_error:;
  3282. __Pyx_XDECREF(__pyx_t_1);
  3283. __Pyx_AddTraceback("string.to_py.__pyx_convert_PyStr_string_to_py_std__in_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  3284. __pyx_r = 0;
  3285. __pyx_L0:;
  3286. __Pyx_XGIVEREF(__pyx_r);
  3287. __Pyx_RefNannyFinishContext();
  3288. return __pyx_r;
  3289. }
  3290. /* "string.to_py":49
  3291. *
  3292. * @cname("__pyx_convert_PyBytes_string_to_py_std__in_string")
  3293. * cdef inline object __pyx_convert_PyBytes_string_to_py_std__in_string(const string& s): # <<<<<<<<<<<<<<
  3294. * return __Pyx_PyBytes_FromStringAndSize(s.data(), s.size())
  3295. * cdef extern from *:
  3296. */
  3297. static CYTHON_INLINE PyObject *__pyx_convert_PyBytes_string_to_py_std__in_string(std::string const &__pyx_v_s) {
  3298. PyObject *__pyx_r = NULL;
  3299. __Pyx_RefNannyDeclarations
  3300. PyObject *__pyx_t_1 = NULL;
  3301. int __pyx_lineno = 0;
  3302. const char *__pyx_filename = NULL;
  3303. int __pyx_clineno = 0;
  3304. __Pyx_RefNannySetupContext("__pyx_convert_PyBytes_string_to_py_std__in_string", 0);
  3305. /* "string.to_py":50
  3306. * @cname("__pyx_convert_PyBytes_string_to_py_std__in_string")
  3307. * cdef inline object __pyx_convert_PyBytes_string_to_py_std__in_string(const string& s):
  3308. * return __Pyx_PyBytes_FromStringAndSize(s.data(), s.size()) # <<<<<<<<<<<<<<
  3309. * cdef extern from *:
  3310. * cdef object __Pyx_PyByteArray_FromStringAndSize(const char*, size_t)
  3311. */
  3312. __Pyx_XDECREF(__pyx_r);
  3313. __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_s.data(), __pyx_v_s.size()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 50, __pyx_L1_error)
  3314. __Pyx_GOTREF(__pyx_t_1);
  3315. __pyx_r = __pyx_t_1;
  3316. __pyx_t_1 = 0;
  3317. goto __pyx_L0;
  3318. /* "string.to_py":49
  3319. *
  3320. * @cname("__pyx_convert_PyBytes_string_to_py_std__in_string")
  3321. * cdef inline object __pyx_convert_PyBytes_string_to_py_std__in_string(const string& s): # <<<<<<<<<<<<<<
  3322. * return __Pyx_PyBytes_FromStringAndSize(s.data(), s.size())
  3323. * cdef extern from *:
  3324. */
  3325. /* function exit code */
  3326. __pyx_L1_error:;
  3327. __Pyx_XDECREF(__pyx_t_1);
  3328. __Pyx_AddTraceback("string.to_py.__pyx_convert_PyBytes_string_to_py_std__in_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  3329. __pyx_r = 0;
  3330. __pyx_L0:;
  3331. __Pyx_XGIVEREF(__pyx_r);
  3332. __Pyx_RefNannyFinishContext();
  3333. return __pyx_r;
  3334. }
  3335. /* "string.to_py":55
  3336. *
  3337. * @cname("__pyx_convert_PyByteArray_string_to_py_std__in_string")
  3338. * cdef inline object __pyx_convert_PyByteArray_string_to_py_std__in_string(const string& s): # <<<<<<<<<<<<<<
  3339. * return __Pyx_PyByteArray_FromStringAndSize(s.data(), s.size())
  3340. *
  3341. */
  3342. static CYTHON_INLINE PyObject *__pyx_convert_PyByteArray_string_to_py_std__in_string(std::string const &__pyx_v_s) {
  3343. PyObject *__pyx_r = NULL;
  3344. __Pyx_RefNannyDeclarations
  3345. PyObject *__pyx_t_1 = NULL;
  3346. int __pyx_lineno = 0;
  3347. const char *__pyx_filename = NULL;
  3348. int __pyx_clineno = 0;
  3349. __Pyx_RefNannySetupContext("__pyx_convert_PyByteArray_string_to_py_std__in_string", 0);
  3350. /* "string.to_py":56
  3351. * @cname("__pyx_convert_PyByteArray_string_to_py_std__in_string")
  3352. * cdef inline object __pyx_convert_PyByteArray_string_to_py_std__in_string(const string& s):
  3353. * return __Pyx_PyByteArray_FromStringAndSize(s.data(), s.size()) # <<<<<<<<<<<<<<
  3354. *
  3355. */
  3356. __Pyx_XDECREF(__pyx_r);
  3357. __pyx_t_1 = __Pyx_PyByteArray_FromStringAndSize(__pyx_v_s.data(), __pyx_v_s.size()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 56, __pyx_L1_error)
  3358. __Pyx_GOTREF(__pyx_t_1);
  3359. __pyx_r = __pyx_t_1;
  3360. __pyx_t_1 = 0;
  3361. goto __pyx_L0;
  3362. /* "string.to_py":55
  3363. *
  3364. * @cname("__pyx_convert_PyByteArray_string_to_py_std__in_string")
  3365. * cdef inline object __pyx_convert_PyByteArray_string_to_py_std__in_string(const string& s): # <<<<<<<<<<<<<<
  3366. * return __Pyx_PyByteArray_FromStringAndSize(s.data(), s.size())
  3367. *
  3368. */
  3369. /* function exit code */
  3370. __pyx_L1_error:;
  3371. __Pyx_XDECREF(__pyx_t_1);
  3372. __Pyx_AddTraceback("string.to_py.__pyx_convert_PyByteArray_string_to_py_std__in_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  3373. __pyx_r = 0;
  3374. __pyx_L0:;
  3375. __Pyx_XGIVEREF(__pyx_r);
  3376. __Pyx_RefNannyFinishContext();
  3377. return __pyx_r;
  3378. }
  3379. static struct __pyx_vtabstruct_4sasl_11saslwrapper_Client __pyx_vtable_4sasl_11saslwrapper_Client;
  3380. static PyObject *__pyx_tp_new_4sasl_11saslwrapper_Client(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  3381. struct __pyx_obj_4sasl_11saslwrapper_Client *p;
  3382. PyObject *o;
  3383. if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
  3384. o = (*t->tp_alloc)(t, 0);
  3385. } else {
  3386. o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  3387. }
  3388. if (unlikely(!o)) return 0;
  3389. p = ((struct __pyx_obj_4sasl_11saslwrapper_Client *)o);
  3390. p->__pyx_vtab = __pyx_vtabptr_4sasl_11saslwrapper_Client;
  3391. new((void*)&(p->_this)) saslwrapper::ClientImpl();
  3392. return o;
  3393. }
  3394. static void __pyx_tp_dealloc_4sasl_11saslwrapper_Client(PyObject *o) {
  3395. struct __pyx_obj_4sasl_11saslwrapper_Client *p = (struct __pyx_obj_4sasl_11saslwrapper_Client *)o;
  3396. #if CYTHON_USE_TP_FINALIZE
  3397. if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
  3398. if (PyObject_CallFinalizerFromDealloc(o)) return;
  3399. }
  3400. #endif
  3401. __Pyx_call_destructor(p->_this);
  3402. (*Py_TYPE(o)->tp_free)(o);
  3403. }
  3404. static PyMethodDef __pyx_methods_4sasl_11saslwrapper_Client[] = {
  3405. {"setAttr", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_4sasl_11saslwrapper_6Client_1setAttr, METH_VARARGS|METH_KEYWORDS, 0},
  3406. {"init", (PyCFunction)__pyx_pw_4sasl_11saslwrapper_6Client_3init, METH_NOARGS, 0},
  3407. {"start", (PyCFunction)__pyx_pw_4sasl_11saslwrapper_6Client_5start, METH_O, 0},
  3408. {"step", (PyCFunction)__pyx_pw_4sasl_11saslwrapper_6Client_7step, METH_O, 0},
  3409. {"encode", (PyCFunction)__pyx_pw_4sasl_11saslwrapper_6Client_9encode, METH_O, 0},
  3410. {"decode", (PyCFunction)__pyx_pw_4sasl_11saslwrapper_6Client_11decode, METH_O, 0},
  3411. {"getUserId", (PyCFunction)__pyx_pw_4sasl_11saslwrapper_6Client_13getUserId, METH_NOARGS, 0},
  3412. {"getSSF", (PyCFunction)__pyx_pw_4sasl_11saslwrapper_6Client_15getSSF, METH_NOARGS, 0},
  3413. {"getError", (PyCFunction)__pyx_pw_4sasl_11saslwrapper_6Client_17getError, METH_NOARGS, 0},
  3414. {"__reduce_cython__", (PyCFunction)__pyx_pw_4sasl_11saslwrapper_6Client_19__reduce_cython__, METH_NOARGS, 0},
  3415. {"__setstate_cython__", (PyCFunction)__pyx_pw_4sasl_11saslwrapper_6Client_21__setstate_cython__, METH_O, 0},
  3416. {0, 0, 0, 0}
  3417. };
  3418. static PyTypeObject __pyx_type_4sasl_11saslwrapper_Client = {
  3419. PyVarObject_HEAD_INIT(0, 0)
  3420. "sasl.saslwrapper.Client", /*tp_name*/
  3421. sizeof(struct __pyx_obj_4sasl_11saslwrapper_Client), /*tp_basicsize*/
  3422. 0, /*tp_itemsize*/
  3423. __pyx_tp_dealloc_4sasl_11saslwrapper_Client, /*tp_dealloc*/
  3424. #if PY_VERSION_HEX < 0x030800b4
  3425. 0, /*tp_print*/
  3426. #endif
  3427. #if PY_VERSION_HEX >= 0x030800b4
  3428. 0, /*tp_vectorcall_offset*/
  3429. #endif
  3430. 0, /*tp_getattr*/
  3431. 0, /*tp_setattr*/
  3432. #if PY_MAJOR_VERSION < 3
  3433. 0, /*tp_compare*/
  3434. #endif
  3435. #if PY_MAJOR_VERSION >= 3
  3436. 0, /*tp_as_async*/
  3437. #endif
  3438. 0, /*tp_repr*/
  3439. 0, /*tp_as_number*/
  3440. 0, /*tp_as_sequence*/
  3441. 0, /*tp_as_mapping*/
  3442. 0, /*tp_hash*/
  3443. 0, /*tp_call*/
  3444. 0, /*tp_str*/
  3445. 0, /*tp_getattro*/
  3446. 0, /*tp_setattro*/
  3447. 0, /*tp_as_buffer*/
  3448. Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  3449. 0, /*tp_doc*/
  3450. 0, /*tp_traverse*/
  3451. 0, /*tp_clear*/
  3452. 0, /*tp_richcompare*/
  3453. 0, /*tp_weaklistoffset*/
  3454. 0, /*tp_iter*/
  3455. 0, /*tp_iternext*/
  3456. __pyx_methods_4sasl_11saslwrapper_Client, /*tp_methods*/
  3457. 0, /*tp_members*/
  3458. 0, /*tp_getset*/
  3459. 0, /*tp_base*/
  3460. 0, /*tp_dict*/
  3461. 0, /*tp_descr_get*/
  3462. 0, /*tp_descr_set*/
  3463. 0, /*tp_dictoffset*/
  3464. 0, /*tp_init*/
  3465. 0, /*tp_alloc*/
  3466. __pyx_tp_new_4sasl_11saslwrapper_Client, /*tp_new*/
  3467. 0, /*tp_free*/
  3468. 0, /*tp_is_gc*/
  3469. 0, /*tp_bases*/
  3470. 0, /*tp_mro*/
  3471. 0, /*tp_cache*/
  3472. 0, /*tp_subclasses*/
  3473. 0, /*tp_weaklist*/
  3474. 0, /*tp_del*/
  3475. 0, /*tp_version_tag*/
  3476. #if PY_VERSION_HEX >= 0x030400a1
  3477. 0, /*tp_finalize*/
  3478. #endif
  3479. #if PY_VERSION_HEX >= 0x030800b1
  3480. 0, /*tp_vectorcall*/
  3481. #endif
  3482. #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  3483. 0, /*tp_print*/
  3484. #endif
  3485. };
  3486. static PyMethodDef __pyx_methods[] = {
  3487. {"to_bytes", (PyCFunction)__pyx_pw_4sasl_11saslwrapper_1to_bytes, METH_O, 0},
  3488. {"to_string", (PyCFunction)__pyx_pw_4sasl_11saslwrapper_3to_string, METH_O, 0},
  3489. {0, 0, 0, 0}
  3490. };
  3491. #if PY_MAJOR_VERSION >= 3
  3492. #if CYTHON_PEP489_MULTI_PHASE_INIT
  3493. static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
  3494. static int __pyx_pymod_exec_saslwrapper(PyObject* module); /*proto*/
  3495. static PyModuleDef_Slot __pyx_moduledef_slots[] = {
  3496. {Py_mod_create, (void*)__pyx_pymod_create},
  3497. {Py_mod_exec, (void*)__pyx_pymod_exec_saslwrapper},
  3498. {0, NULL}
  3499. };
  3500. #endif
  3501. static struct PyModuleDef __pyx_moduledef = {
  3502. PyModuleDef_HEAD_INIT,
  3503. "saslwrapper",
  3504. 0, /* m_doc */
  3505. #if CYTHON_PEP489_MULTI_PHASE_INIT
  3506. 0, /* m_size */
  3507. #else
  3508. -1, /* m_size */
  3509. #endif
  3510. __pyx_methods /* m_methods */,
  3511. #if CYTHON_PEP489_MULTI_PHASE_INIT
  3512. __pyx_moduledef_slots, /* m_slots */
  3513. #else
  3514. NULL, /* m_reload */
  3515. #endif
  3516. NULL, /* m_traverse */
  3517. NULL, /* m_clear */
  3518. NULL /* m_free */
  3519. };
  3520. #endif
  3521. #ifndef CYTHON_SMALL_CODE
  3522. #if defined(__clang__)
  3523. #define CYTHON_SMALL_CODE
  3524. #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
  3525. #define CYTHON_SMALL_CODE __attribute__((cold))
  3526. #else
  3527. #define CYTHON_SMALL_CODE
  3528. #endif
  3529. #endif
  3530. static __Pyx_StringTabEntry __pyx_string_tab[] = {
  3531. {&__pyx_n_s_Client, __pyx_k_Client, sizeof(__pyx_k_Client), 0, 0, 1, 1},
  3532. {&__pyx_n_s_PY3, __pyx_k_PY3, sizeof(__pyx_k_PY3), 0, 0, 1, 1},
  3533. {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
  3534. {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
  3535. {&__pyx_n_s_decode, __pyx_k_decode, sizeof(__pyx_k_decode), 0, 0, 1, 1},
  3536. {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1},
  3537. {&__pyx_n_s_getError, __pyx_k_getError, sizeof(__pyx_k_getError), 0, 0, 1, 1},
  3538. {&__pyx_n_s_getSSF, __pyx_k_getSSF, sizeof(__pyx_k_getSSF), 0, 0, 1, 1},
  3539. {&__pyx_n_s_getUserId, __pyx_k_getUserId, sizeof(__pyx_k_getUserId), 0, 0, 1, 1},
  3540. {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1},
  3541. {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
  3542. {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1},
  3543. {&__pyx_n_s_key, __pyx_k_key, sizeof(__pyx_k_key), 0, 0, 1, 1},
  3544. {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
  3545. {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
  3546. {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
  3547. {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1},
  3548. {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1},
  3549. {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1},
  3550. {&__pyx_kp_s_self__this_cannot_be_converted_t, __pyx_k_self__this_cannot_be_converted_t, sizeof(__pyx_k_self__this_cannot_be_converted_t), 0, 0, 1, 0},
  3551. {&__pyx_n_s_setAttr, __pyx_k_setAttr, sizeof(__pyx_k_setAttr), 0, 0, 1, 1},
  3552. {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1},
  3553. {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1},
  3554. {&__pyx_n_s_six, __pyx_k_six, sizeof(__pyx_k_six), 0, 0, 1, 1},
  3555. {&__pyx_n_s_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1},
  3556. {&__pyx_n_s_step, __pyx_k_step, sizeof(__pyx_k_step), 0, 0, 1, 1},
  3557. {&__pyx_n_s_string_types, __pyx_k_string_types, sizeof(__pyx_k_string_types), 0, 0, 1, 1},
  3558. {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
  3559. {&__pyx_kp_u_utf_8, __pyx_k_utf_8, sizeof(__pyx_k_utf_8), 0, 1, 0, 0},
  3560. {&__pyx_n_s_value, __pyx_k_value, sizeof(__pyx_k_value), 0, 0, 1, 1},
  3561. {0, 0, 0, 0, 0, 0, 0}
  3562. };
  3563. static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) {
  3564. __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(0, 2, __pyx_L1_error)
  3565. return 0;
  3566. __pyx_L1_error:;
  3567. return -1;
  3568. }
  3569. static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
  3570. __Pyx_RefNannyDeclarations
  3571. __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
  3572. /* "(tree fragment)":2
  3573. * def __reduce_cython__(self):
  3574. * raise TypeError("self._this cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<<
  3575. * def __setstate_cython__(self, __pyx_state):
  3576. * raise TypeError("self._this cannot be converted to a Python object for pickling")
  3577. */
  3578. __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_self__this_cannot_be_converted_t); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 2, __pyx_L1_error)
  3579. __Pyx_GOTREF(__pyx_tuple_);
  3580. __Pyx_GIVEREF(__pyx_tuple_);
  3581. /* "(tree fragment)":4
  3582. * raise TypeError("self._this cannot be converted to a Python object for pickling")
  3583. * def __setstate_cython__(self, __pyx_state):
  3584. * raise TypeError("self._this cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<<
  3585. */
  3586. __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_self__this_cannot_be_converted_t); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 4, __pyx_L1_error)
  3587. __Pyx_GOTREF(__pyx_tuple__2);
  3588. __Pyx_GIVEREF(__pyx_tuple__2);
  3589. __Pyx_RefNannyFinishContext();
  3590. return 0;
  3591. __pyx_L1_error:;
  3592. __Pyx_RefNannyFinishContext();
  3593. return -1;
  3594. }
  3595. static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) {
  3596. if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(1, 1, __pyx_L1_error);
  3597. return 0;
  3598. __pyx_L1_error:;
  3599. return -1;
  3600. }
  3601. static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/
  3602. static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/
  3603. static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/
  3604. static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/
  3605. static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/
  3606. static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/
  3607. static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/
  3608. static int __Pyx_modinit_global_init_code(void) {
  3609. __Pyx_RefNannyDeclarations
  3610. __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);
  3611. /*--- Global init code ---*/
  3612. __Pyx_RefNannyFinishContext();
  3613. return 0;
  3614. }
  3615. static int __Pyx_modinit_variable_export_code(void) {
  3616. __Pyx_RefNannyDeclarations
  3617. __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
  3618. /*--- Variable export code ---*/
  3619. __Pyx_RefNannyFinishContext();
  3620. return 0;
  3621. }
  3622. static int __Pyx_modinit_function_export_code(void) {
  3623. __Pyx_RefNannyDeclarations
  3624. __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
  3625. /*--- Function export code ---*/
  3626. __Pyx_RefNannyFinishContext();
  3627. return 0;
  3628. }
  3629. static int __Pyx_modinit_type_init_code(void) {
  3630. __Pyx_RefNannyDeclarations
  3631. int __pyx_lineno = 0;
  3632. const char *__pyx_filename = NULL;
  3633. int __pyx_clineno = 0;
  3634. __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
  3635. /*--- Type init code ---*/
  3636. __pyx_vtabptr_4sasl_11saslwrapper_Client = &__pyx_vtable_4sasl_11saslwrapper_Client;
  3637. __pyx_vtable_4sasl_11saslwrapper_Client.setAttr = (PyObject *(*)(struct __pyx_obj_4sasl_11saslwrapper_Client *, PyObject *, PyObject *, int __pyx_skip_dispatch))__pyx_f_4sasl_11saslwrapper_6Client_setAttr;
  3638. __pyx_vtable_4sasl_11saslwrapper_Client.init = (PyObject *(*)(struct __pyx_obj_4sasl_11saslwrapper_Client *, int __pyx_skip_dispatch))__pyx_f_4sasl_11saslwrapper_6Client_init;
  3639. __pyx_vtable_4sasl_11saslwrapper_Client.start = (PyObject *(*)(struct __pyx_obj_4sasl_11saslwrapper_Client *, PyObject *, int __pyx_skip_dispatch))__pyx_f_4sasl_11saslwrapper_6Client_start;
  3640. __pyx_vtable_4sasl_11saslwrapper_Client.step = (PyObject *(*)(struct __pyx_obj_4sasl_11saslwrapper_Client *, PyObject *, int __pyx_skip_dispatch))__pyx_f_4sasl_11saslwrapper_6Client_step;
  3641. __pyx_vtable_4sasl_11saslwrapper_Client.encode = (PyObject *(*)(struct __pyx_obj_4sasl_11saslwrapper_Client *, PyObject *, int __pyx_skip_dispatch))__pyx_f_4sasl_11saslwrapper_6Client_encode;
  3642. __pyx_vtable_4sasl_11saslwrapper_Client.decode = (PyObject *(*)(struct __pyx_obj_4sasl_11saslwrapper_Client *, PyObject *, int __pyx_skip_dispatch))__pyx_f_4sasl_11saslwrapper_6Client_decode;
  3643. __pyx_vtable_4sasl_11saslwrapper_Client.getUserId = (PyObject *(*)(struct __pyx_obj_4sasl_11saslwrapper_Client *, int __pyx_skip_dispatch))__pyx_f_4sasl_11saslwrapper_6Client_getUserId;
  3644. __pyx_vtable_4sasl_11saslwrapper_Client.getSSF = (PyObject *(*)(struct __pyx_obj_4sasl_11saslwrapper_Client *, int __pyx_skip_dispatch))__pyx_f_4sasl_11saslwrapper_6Client_getSSF;
  3645. __pyx_vtable_4sasl_11saslwrapper_Client.getError = (PyObject *(*)(struct __pyx_obj_4sasl_11saslwrapper_Client *, int __pyx_skip_dispatch))__pyx_f_4sasl_11saslwrapper_6Client_getError;
  3646. if (PyType_Ready(&__pyx_type_4sasl_11saslwrapper_Client) < 0) __PYX_ERR(1, 50, __pyx_L1_error)
  3647. #if PY_VERSION_HEX < 0x030800B1
  3648. __pyx_type_4sasl_11saslwrapper_Client.tp_print = 0;
  3649. #endif
  3650. if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_4sasl_11saslwrapper_Client.tp_dictoffset && __pyx_type_4sasl_11saslwrapper_Client.tp_getattro == PyObject_GenericGetAttr)) {
  3651. __pyx_type_4sasl_11saslwrapper_Client.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  3652. }
  3653. if (__Pyx_SetVtable(__pyx_type_4sasl_11saslwrapper_Client.tp_dict, __pyx_vtabptr_4sasl_11saslwrapper_Client) < 0) __PYX_ERR(1, 50, __pyx_L1_error)
  3654. if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Client, (PyObject *)&__pyx_type_4sasl_11saslwrapper_Client) < 0) __PYX_ERR(1, 50, __pyx_L1_error)
  3655. if (__Pyx_setup_reduce((PyObject*)&__pyx_type_4sasl_11saslwrapper_Client) < 0) __PYX_ERR(1, 50, __pyx_L1_error)
  3656. __pyx_ptype_4sasl_11saslwrapper_Client = &__pyx_type_4sasl_11saslwrapper_Client;
  3657. __Pyx_RefNannyFinishContext();
  3658. return 0;
  3659. __pyx_L1_error:;
  3660. __Pyx_RefNannyFinishContext();
  3661. return -1;
  3662. }
  3663. static int __Pyx_modinit_type_import_code(void) {
  3664. __Pyx_RefNannyDeclarations
  3665. __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);
  3666. /*--- Type import code ---*/
  3667. __Pyx_RefNannyFinishContext();
  3668. return 0;
  3669. }
  3670. static int __Pyx_modinit_variable_import_code(void) {
  3671. __Pyx_RefNannyDeclarations
  3672. __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
  3673. /*--- Variable import code ---*/
  3674. __Pyx_RefNannyFinishContext();
  3675. return 0;
  3676. }
  3677. static int __Pyx_modinit_function_import_code(void) {
  3678. __Pyx_RefNannyDeclarations
  3679. __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
  3680. /*--- Function import code ---*/
  3681. __Pyx_RefNannyFinishContext();
  3682. return 0;
  3683. }
  3684. #ifndef CYTHON_NO_PYINIT_EXPORT
  3685. #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
  3686. #elif PY_MAJOR_VERSION < 3
  3687. #ifdef __cplusplus
  3688. #define __Pyx_PyMODINIT_FUNC extern "C" void
  3689. #else
  3690. #define __Pyx_PyMODINIT_FUNC void
  3691. #endif
  3692. #else
  3693. #ifdef __cplusplus
  3694. #define __Pyx_PyMODINIT_FUNC extern "C" PyObject *
  3695. #else
  3696. #define __Pyx_PyMODINIT_FUNC PyObject *
  3697. #endif
  3698. #endif
  3699. #if PY_MAJOR_VERSION < 3
  3700. __Pyx_PyMODINIT_FUNC initsaslwrapper(void) CYTHON_SMALL_CODE; /*proto*/
  3701. __Pyx_PyMODINIT_FUNC initsaslwrapper(void)
  3702. #else
  3703. __Pyx_PyMODINIT_FUNC PyInit_saslwrapper(void) CYTHON_SMALL_CODE; /*proto*/
  3704. __Pyx_PyMODINIT_FUNC PyInit_saslwrapper(void)
  3705. #if CYTHON_PEP489_MULTI_PHASE_INIT
  3706. {
  3707. return PyModuleDef_Init(&__pyx_moduledef);
  3708. }
  3709. static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) {
  3710. #if PY_VERSION_HEX >= 0x030700A1
  3711. static PY_INT64_T main_interpreter_id = -1;
  3712. PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
  3713. if (main_interpreter_id == -1) {
  3714. main_interpreter_id = current_id;
  3715. return (unlikely(current_id == -1)) ? -1 : 0;
  3716. } else if (unlikely(main_interpreter_id != current_id))
  3717. #else
  3718. static PyInterpreterState *main_interpreter = NULL;
  3719. PyInterpreterState *current_interpreter = PyThreadState_Get()->interp;
  3720. if (!main_interpreter) {
  3721. main_interpreter = current_interpreter;
  3722. } else if (unlikely(main_interpreter != current_interpreter))
  3723. #endif
  3724. {
  3725. PyErr_SetString(
  3726. PyExc_ImportError,
  3727. "Interpreter change detected - this module can only be loaded into one interpreter per process.");
  3728. return -1;
  3729. }
  3730. return 0;
  3731. }
  3732. static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) {
  3733. PyObject *value = PyObject_GetAttrString(spec, from_name);
  3734. int result = 0;
  3735. if (likely(value)) {
  3736. if (allow_none || value != Py_None) {
  3737. result = PyDict_SetItemString(moddict, to_name, value);
  3738. }
  3739. Py_DECREF(value);
  3740. } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
  3741. PyErr_Clear();
  3742. } else {
  3743. result = -1;
  3744. }
  3745. return result;
  3746. }
  3747. static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
  3748. PyObject *module = NULL, *moddict, *modname;
  3749. if (__Pyx_check_single_interpreter())
  3750. return NULL;
  3751. if (__pyx_m)
  3752. return __Pyx_NewRef(__pyx_m);
  3753. modname = PyObject_GetAttrString(spec, "name");
  3754. if (unlikely(!modname)) goto bad;
  3755. module = PyModule_NewObject(modname);
  3756. Py_DECREF(modname);
  3757. if (unlikely(!module)) goto bad;
  3758. moddict = PyModule_GetDict(module);
  3759. if (unlikely(!moddict)) goto bad;
  3760. if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad;
  3761. if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad;
  3762. if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad;
  3763. if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad;
  3764. return module;
  3765. bad:
  3766. Py_XDECREF(module);
  3767. return NULL;
  3768. }
  3769. static CYTHON_SMALL_CODE int __pyx_pymod_exec_saslwrapper(PyObject *__pyx_pyinit_module)
  3770. #endif
  3771. #endif
  3772. {
  3773. PyObject *__pyx_t_1 = NULL;
  3774. PyObject *__pyx_t_2 = NULL;
  3775. int __pyx_lineno = 0;
  3776. const char *__pyx_filename = NULL;
  3777. int __pyx_clineno = 0;
  3778. __Pyx_RefNannyDeclarations
  3779. #if CYTHON_PEP489_MULTI_PHASE_INIT
  3780. if (__pyx_m) {
  3781. if (__pyx_m == __pyx_pyinit_module) return 0;
  3782. PyErr_SetString(PyExc_RuntimeError, "Module 'saslwrapper' has already been imported. Re-initialisation is not supported.");
  3783. return -1;
  3784. }
  3785. #elif PY_MAJOR_VERSION >= 3
  3786. if (__pyx_m) return __Pyx_NewRef(__pyx_m);
  3787. #endif
  3788. #if CYTHON_REFNANNY
  3789. __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
  3790. if (!__Pyx_RefNanny) {
  3791. PyErr_Clear();
  3792. __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
  3793. if (!__Pyx_RefNanny)
  3794. Py_FatalError("failed to import 'refnanny' module");
  3795. }
  3796. #endif
  3797. __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_saslwrapper(void)", 0);
  3798. if (__Pyx_check_binary_version() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  3799. #ifdef __Pxy_PyFrame_Initialize_Offsets
  3800. __Pxy_PyFrame_Initialize_Offsets();
  3801. #endif
  3802. __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(1, 1, __pyx_L1_error)
  3803. __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(1, 1, __pyx_L1_error)
  3804. __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(1, 1, __pyx_L1_error)
  3805. #ifdef __Pyx_CyFunction_USED
  3806. if (__pyx_CyFunction_init() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  3807. #endif
  3808. #ifdef __Pyx_FusedFunction_USED
  3809. if (__pyx_FusedFunction_init() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  3810. #endif
  3811. #ifdef __Pyx_Coroutine_USED
  3812. if (__pyx_Coroutine_init() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  3813. #endif
  3814. #ifdef __Pyx_Generator_USED
  3815. if (__pyx_Generator_init() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  3816. #endif
  3817. #ifdef __Pyx_AsyncGen_USED
  3818. if (__pyx_AsyncGen_init() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  3819. #endif
  3820. #ifdef __Pyx_StopAsyncIteration_USED
  3821. if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  3822. #endif
  3823. /*--- Library function declarations ---*/
  3824. /*--- Threads initialization code ---*/
  3825. #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
  3826. #ifdef WITH_THREAD /* Python build with threading support? */
  3827. PyEval_InitThreads();
  3828. #endif
  3829. #endif
  3830. /*--- Module creation code ---*/
  3831. #if CYTHON_PEP489_MULTI_PHASE_INIT
  3832. __pyx_m = __pyx_pyinit_module;
  3833. Py_INCREF(__pyx_m);
  3834. #else
  3835. #if PY_MAJOR_VERSION < 3
  3836. __pyx_m = Py_InitModule4("saslwrapper", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
  3837. #else
  3838. __pyx_m = PyModule_Create(&__pyx_moduledef);
  3839. #endif
  3840. if (unlikely(!__pyx_m)) __PYX_ERR(1, 1, __pyx_L1_error)
  3841. #endif
  3842. __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(1, 1, __pyx_L1_error)
  3843. Py_INCREF(__pyx_d);
  3844. __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(1, 1, __pyx_L1_error)
  3845. Py_INCREF(__pyx_b);
  3846. __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(1, 1, __pyx_L1_error)
  3847. Py_INCREF(__pyx_cython_runtime);
  3848. if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(1, 1, __pyx_L1_error);
  3849. /*--- Initialize various global constants etc. ---*/
  3850. if (__Pyx_InitGlobals() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  3851. #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
  3852. if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  3853. #endif
  3854. if (__pyx_module_is_main_sasl__saslwrapper) {
  3855. if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  3856. }
  3857. #if PY_MAJOR_VERSION >= 3
  3858. {
  3859. PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(1, 1, __pyx_L1_error)
  3860. if (!PyDict_GetItemString(modules, "sasl.saslwrapper")) {
  3861. if (unlikely(PyDict_SetItemString(modules, "sasl.saslwrapper", __pyx_m) < 0)) __PYX_ERR(1, 1, __pyx_L1_error)
  3862. }
  3863. }
  3864. #endif
  3865. /*--- Builtin init code ---*/
  3866. if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  3867. /*--- Constants init code ---*/
  3868. if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  3869. /*--- Global type/function init code ---*/
  3870. (void)__Pyx_modinit_global_init_code();
  3871. (void)__Pyx_modinit_variable_export_code();
  3872. (void)__Pyx_modinit_function_export_code();
  3873. if (unlikely(__Pyx_modinit_type_init_code() < 0)) __PYX_ERR(1, 1, __pyx_L1_error)
  3874. (void)__Pyx_modinit_type_import_code();
  3875. (void)__Pyx_modinit_variable_import_code();
  3876. (void)__Pyx_modinit_function_import_code();
  3877. /*--- Execution code ---*/
  3878. #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
  3879. if (__Pyx_patch_abc() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  3880. #endif
  3881. /* "sasl/saslwrapper.pyx":17
  3882. * #cython: language_level=3
  3883. *
  3884. * from six import string_types, PY3 # <<<<<<<<<<<<<<
  3885. *
  3886. * from libcpp cimport bool
  3887. */
  3888. __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 17, __pyx_L1_error)
  3889. __Pyx_GOTREF(__pyx_t_1);
  3890. __Pyx_INCREF(__pyx_n_s_string_types);
  3891. __Pyx_GIVEREF(__pyx_n_s_string_types);
  3892. PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_string_types);
  3893. __Pyx_INCREF(__pyx_n_s_PY3);
  3894. __Pyx_GIVEREF(__pyx_n_s_PY3);
  3895. PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_PY3);
  3896. __pyx_t_2 = __Pyx_Import(__pyx_n_s_six, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 17, __pyx_L1_error)
  3897. __Pyx_GOTREF(__pyx_t_2);
  3898. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  3899. __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_string_types); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 17, __pyx_L1_error)
  3900. __Pyx_GOTREF(__pyx_t_1);
  3901. if (PyDict_SetItem(__pyx_d, __pyx_n_s_string_types, __pyx_t_1) < 0) __PYX_ERR(1, 17, __pyx_L1_error)
  3902. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  3903. __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_PY3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 17, __pyx_L1_error)
  3904. __Pyx_GOTREF(__pyx_t_1);
  3905. if (PyDict_SetItem(__pyx_d, __pyx_n_s_PY3, __pyx_t_1) < 0) __PYX_ERR(1, 17, __pyx_L1_error)
  3906. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  3907. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  3908. /* "sasl/saslwrapper.pyx":1
  3909. * # Copyright 2015 Cloudera Inc. # <<<<<<<<<<<<<<
  3910. * #
  3911. * # Licensed under the Apache License, Version 2.0 (the "License");
  3912. */
  3913. __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error)
  3914. __Pyx_GOTREF(__pyx_t_2);
  3915. if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  3916. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  3917. /* "string.to_py":55
  3918. *
  3919. * @cname("__pyx_convert_PyByteArray_string_to_py_std__in_string")
  3920. * cdef inline object __pyx_convert_PyByteArray_string_to_py_std__in_string(const string& s): # <<<<<<<<<<<<<<
  3921. * return __Pyx_PyByteArray_FromStringAndSize(s.data(), s.size())
  3922. *
  3923. */
  3924. /*--- Wrapped vars code ---*/
  3925. goto __pyx_L0;
  3926. __pyx_L1_error:;
  3927. __Pyx_XDECREF(__pyx_t_1);
  3928. __Pyx_XDECREF(__pyx_t_2);
  3929. if (__pyx_m) {
  3930. if (__pyx_d) {
  3931. __Pyx_AddTraceback("init sasl.saslwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
  3932. }
  3933. Py_CLEAR(__pyx_m);
  3934. } else if (!PyErr_Occurred()) {
  3935. PyErr_SetString(PyExc_ImportError, "init sasl.saslwrapper");
  3936. }
  3937. __pyx_L0:;
  3938. __Pyx_RefNannyFinishContext();
  3939. #if CYTHON_PEP489_MULTI_PHASE_INIT
  3940. return (__pyx_m != NULL) ? 0 : -1;
  3941. #elif PY_MAJOR_VERSION >= 3
  3942. return __pyx_m;
  3943. #else
  3944. return;
  3945. #endif
  3946. }
  3947. /* --- Runtime support code --- */
  3948. /* Refnanny */
  3949. #if CYTHON_REFNANNY
  3950. static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
  3951. PyObject *m = NULL, *p = NULL;
  3952. void *r = NULL;
  3953. m = PyImport_ImportModule(modname);
  3954. if (!m) goto end;
  3955. p = PyObject_GetAttrString(m, "RefNannyAPI");
  3956. if (!p) goto end;
  3957. r = PyLong_AsVoidPtr(p);
  3958. end:
  3959. Py_XDECREF(p);
  3960. Py_XDECREF(m);
  3961. return (__Pyx_RefNannyAPIStruct *)r;
  3962. }
  3963. #endif
  3964. /* PyObjectGetAttrStr */
  3965. #if CYTHON_USE_TYPE_SLOTS
  3966. static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
  3967. PyTypeObject* tp = Py_TYPE(obj);
  3968. if (likely(tp->tp_getattro))
  3969. return tp->tp_getattro(obj, attr_name);
  3970. #if PY_MAJOR_VERSION < 3
  3971. if (likely(tp->tp_getattr))
  3972. return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
  3973. #endif
  3974. return PyObject_GetAttr(obj, attr_name);
  3975. }
  3976. #endif
  3977. /* GetBuiltinName */
  3978. static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
  3979. PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
  3980. if (unlikely(!result)) {
  3981. PyErr_Format(PyExc_NameError,
  3982. #if PY_MAJOR_VERSION >= 3
  3983. "name '%U' is not defined", name);
  3984. #else
  3985. "name '%.200s' is not defined", PyString_AS_STRING(name));
  3986. #endif
  3987. }
  3988. return result;
  3989. }
  3990. /* PyDictVersioning */
  3991. #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
  3992. static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
  3993. PyObject *dict = Py_TYPE(obj)->tp_dict;
  3994. return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
  3995. }
  3996. static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
  3997. PyObject **dictptr = NULL;
  3998. Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;
  3999. if (offset) {
  4000. #if CYTHON_COMPILING_IN_CPYTHON
  4001. dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj);
  4002. #else
  4003. dictptr = _PyObject_GetDictPtr(obj);
  4004. #endif
  4005. }
  4006. return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
  4007. }
  4008. static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
  4009. PyObject *dict = Py_TYPE(obj)->tp_dict;
  4010. if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
  4011. return 0;
  4012. return obj_dict_version == __Pyx_get_object_dict_version(obj);
  4013. }
  4014. #endif
  4015. /* GetModuleGlobalName */
  4016. #if CYTHON_USE_DICT_VERSIONS
  4017. static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value)
  4018. #else
  4019. static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
  4020. #endif
  4021. {
  4022. PyObject *result;
  4023. #if !CYTHON_AVOID_BORROWED_REFS
  4024. #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
  4025. result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
  4026. __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
  4027. if (likely(result)) {
  4028. return __Pyx_NewRef(result);
  4029. } else if (unlikely(PyErr_Occurred())) {
  4030. return NULL;
  4031. }
  4032. #else
  4033. result = PyDict_GetItem(__pyx_d, name);
  4034. __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
  4035. if (likely(result)) {
  4036. return __Pyx_NewRef(result);
  4037. }
  4038. #endif
  4039. #else
  4040. result = PyObject_GetItem(__pyx_d, name);
  4041. __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
  4042. if (likely(result)) {
  4043. return __Pyx_NewRef(result);
  4044. }
  4045. PyErr_Clear();
  4046. #endif
  4047. return __Pyx_GetBuiltinName(name);
  4048. }
  4049. /* PyCFunctionFastCall */
  4050. #if CYTHON_FAST_PYCCALL
  4051. static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
  4052. PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
  4053. PyCFunction meth = PyCFunction_GET_FUNCTION(func);
  4054. PyObject *self = PyCFunction_GET_SELF(func);
  4055. int flags = PyCFunction_GET_FLAGS(func);
  4056. assert(PyCFunction_Check(func));
  4057. assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)));
  4058. assert(nargs >= 0);
  4059. assert(nargs == 0 || args != NULL);
  4060. /* _PyCFunction_FastCallDict() must not be called with an exception set,
  4061. because it may clear it (directly or indirectly) and so the
  4062. caller loses its exception */
  4063. assert(!PyErr_Occurred());
  4064. if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
  4065. return (*((__Pyx_PyCFunctionFastWithKeywords)(void*)meth)) (self, args, nargs, NULL);
  4066. } else {
  4067. return (*((__Pyx_PyCFunctionFast)(void*)meth)) (self, args, nargs);
  4068. }
  4069. }
  4070. #endif
  4071. /* PyFunctionFastCall */
  4072. #if CYTHON_FAST_PYCALL
  4073. static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
  4074. PyObject *globals) {
  4075. PyFrameObject *f;
  4076. PyThreadState *tstate = __Pyx_PyThreadState_Current;
  4077. PyObject **fastlocals;
  4078. Py_ssize_t i;
  4079. PyObject *result;
  4080. assert(globals != NULL);
  4081. /* XXX Perhaps we should create a specialized
  4082. PyFrame_New() that doesn't take locals, but does
  4083. take builtins without sanity checking them.
  4084. */
  4085. assert(tstate != NULL);
  4086. f = PyFrame_New(tstate, co, globals, NULL);
  4087. if (f == NULL) {
  4088. return NULL;
  4089. }
  4090. fastlocals = __Pyx_PyFrame_GetLocalsplus(f);
  4091. for (i = 0; i < na; i++) {
  4092. Py_INCREF(*args);
  4093. fastlocals[i] = *args++;
  4094. }
  4095. result = PyEval_EvalFrameEx(f,0);
  4096. ++tstate->recursion_depth;
  4097. Py_DECREF(f);
  4098. --tstate->recursion_depth;
  4099. return result;
  4100. }
  4101. #if 1 || PY_VERSION_HEX < 0x030600B1
  4102. static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) {
  4103. PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
  4104. PyObject *globals = PyFunction_GET_GLOBALS(func);
  4105. PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
  4106. PyObject *closure;
  4107. #if PY_MAJOR_VERSION >= 3
  4108. PyObject *kwdefs;
  4109. #endif
  4110. PyObject *kwtuple, **k;
  4111. PyObject **d;
  4112. Py_ssize_t nd;
  4113. Py_ssize_t nk;
  4114. PyObject *result;
  4115. assert(kwargs == NULL || PyDict_Check(kwargs));
  4116. nk = kwargs ? PyDict_Size(kwargs) : 0;
  4117. if (Py_EnterRecursiveCall((char*)" while calling a Python object")) {
  4118. return NULL;
  4119. }
  4120. if (
  4121. #if PY_MAJOR_VERSION >= 3
  4122. co->co_kwonlyargcount == 0 &&
  4123. #endif
  4124. likely(kwargs == NULL || nk == 0) &&
  4125. co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
  4126. if (argdefs == NULL && co->co_argcount == nargs) {
  4127. result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
  4128. goto done;
  4129. }
  4130. else if (nargs == 0 && argdefs != NULL
  4131. && co->co_argcount == Py_SIZE(argdefs)) {
  4132. /* function called with no arguments, but all parameters have
  4133. a default value: use default values as arguments .*/
  4134. args = &PyTuple_GET_ITEM(argdefs, 0);
  4135. result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
  4136. goto done;
  4137. }
  4138. }
  4139. if (kwargs != NULL) {
  4140. Py_ssize_t pos, i;
  4141. kwtuple = PyTuple_New(2 * nk);
  4142. if (kwtuple == NULL) {
  4143. result = NULL;
  4144. goto done;
  4145. }
  4146. k = &PyTuple_GET_ITEM(kwtuple, 0);
  4147. pos = i = 0;
  4148. while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
  4149. Py_INCREF(k[i]);
  4150. Py_INCREF(k[i+1]);
  4151. i += 2;
  4152. }
  4153. nk = i / 2;
  4154. }
  4155. else {
  4156. kwtuple = NULL;
  4157. k = NULL;
  4158. }
  4159. closure = PyFunction_GET_CLOSURE(func);
  4160. #if PY_MAJOR_VERSION >= 3
  4161. kwdefs = PyFunction_GET_KW_DEFAULTS(func);
  4162. #endif
  4163. if (argdefs != NULL) {
  4164. d = &PyTuple_GET_ITEM(argdefs, 0);
  4165. nd = Py_SIZE(argdefs);
  4166. }
  4167. else {
  4168. d = NULL;
  4169. nd = 0;
  4170. }
  4171. #if PY_MAJOR_VERSION >= 3
  4172. result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
  4173. args, (int)nargs,
  4174. k, (int)nk,
  4175. d, (int)nd, kwdefs, closure);
  4176. #else
  4177. result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
  4178. args, (int)nargs,
  4179. k, (int)nk,
  4180. d, (int)nd, closure);
  4181. #endif
  4182. Py_XDECREF(kwtuple);
  4183. done:
  4184. Py_LeaveRecursiveCall();
  4185. return result;
  4186. }
  4187. #endif
  4188. #endif
  4189. /* PyObjectCall */
  4190. #if CYTHON_COMPILING_IN_CPYTHON
  4191. static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
  4192. PyObject *result;
  4193. ternaryfunc call = func->ob_type->tp_call;
  4194. if (unlikely(!call))
  4195. return PyObject_Call(func, arg, kw);
  4196. if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
  4197. return NULL;
  4198. result = (*call)(func, arg, kw);
  4199. Py_LeaveRecursiveCall();
  4200. if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
  4201. PyErr_SetString(
  4202. PyExc_SystemError,
  4203. "NULL result without error in PyObject_Call");
  4204. }
  4205. return result;
  4206. }
  4207. #endif
  4208. /* PyObjectCall2Args */
  4209. static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) {
  4210. PyObject *args, *result = NULL;
  4211. #if CYTHON_FAST_PYCALL
  4212. if (PyFunction_Check(function)) {
  4213. PyObject *args[2] = {arg1, arg2};
  4214. return __Pyx_PyFunction_FastCall(function, args, 2);
  4215. }
  4216. #endif
  4217. #if CYTHON_FAST_PYCCALL
  4218. if (__Pyx_PyFastCFunction_Check(function)) {
  4219. PyObject *args[2] = {arg1, arg2};
  4220. return __Pyx_PyCFunction_FastCall(function, args, 2);
  4221. }
  4222. #endif
  4223. args = PyTuple_New(2);
  4224. if (unlikely(!args)) goto done;
  4225. Py_INCREF(arg1);
  4226. PyTuple_SET_ITEM(args, 0, arg1);
  4227. Py_INCREF(arg2);
  4228. PyTuple_SET_ITEM(args, 1, arg2);
  4229. Py_INCREF(function);
  4230. result = __Pyx_PyObject_Call(function, args, NULL);
  4231. Py_DECREF(args);
  4232. Py_DECREF(function);
  4233. done:
  4234. return result;
  4235. }
  4236. /* PyObjectCallMethO */
  4237. #if CYTHON_COMPILING_IN_CPYTHON
  4238. static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
  4239. PyObject *self, *result;
  4240. PyCFunction cfunc;
  4241. cfunc = PyCFunction_GET_FUNCTION(func);
  4242. self = PyCFunction_GET_SELF(func);
  4243. if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
  4244. return NULL;
  4245. result = cfunc(self, arg);
  4246. Py_LeaveRecursiveCall();
  4247. if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
  4248. PyErr_SetString(
  4249. PyExc_SystemError,
  4250. "NULL result without error in PyObject_Call");
  4251. }
  4252. return result;
  4253. }
  4254. #endif
  4255. /* PyObjectCallOneArg */
  4256. #if CYTHON_COMPILING_IN_CPYTHON
  4257. static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
  4258. PyObject *result;
  4259. PyObject *args = PyTuple_New(1);
  4260. if (unlikely(!args)) return NULL;
  4261. Py_INCREF(arg);
  4262. PyTuple_SET_ITEM(args, 0, arg);
  4263. result = __Pyx_PyObject_Call(func, args, NULL);
  4264. Py_DECREF(args);
  4265. return result;
  4266. }
  4267. static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
  4268. #if CYTHON_FAST_PYCALL
  4269. if (PyFunction_Check(func)) {
  4270. return __Pyx_PyFunction_FastCall(func, &arg, 1);
  4271. }
  4272. #endif
  4273. if (likely(PyCFunction_Check(func))) {
  4274. if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
  4275. return __Pyx_PyObject_CallMethO(func, arg);
  4276. #if CYTHON_FAST_PYCCALL
  4277. } else if (PyCFunction_GET_FLAGS(func) & METH_FASTCALL) {
  4278. return __Pyx_PyCFunction_FastCall(func, &arg, 1);
  4279. #endif
  4280. }
  4281. }
  4282. return __Pyx__PyObject_CallOneArg(func, arg);
  4283. }
  4284. #else
  4285. static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
  4286. PyObject *result;
  4287. PyObject *args = PyTuple_Pack(1, arg);
  4288. if (unlikely(!args)) return NULL;
  4289. result = __Pyx_PyObject_Call(func, args, NULL);
  4290. Py_DECREF(args);
  4291. return result;
  4292. }
  4293. #endif
  4294. /* PyErrFetchRestore */
  4295. #if CYTHON_FAST_THREAD_STATE
  4296. static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
  4297. PyObject *tmp_type, *tmp_value, *tmp_tb;
  4298. tmp_type = tstate->curexc_type;
  4299. tmp_value = tstate->curexc_value;
  4300. tmp_tb = tstate->curexc_traceback;
  4301. tstate->curexc_type = type;
  4302. tstate->curexc_value = value;
  4303. tstate->curexc_traceback = tb;
  4304. Py_XDECREF(tmp_type);
  4305. Py_XDECREF(tmp_value);
  4306. Py_XDECREF(tmp_tb);
  4307. }
  4308. static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
  4309. *type = tstate->curexc_type;
  4310. *value = tstate->curexc_value;
  4311. *tb = tstate->curexc_traceback;
  4312. tstate->curexc_type = 0;
  4313. tstate->curexc_value = 0;
  4314. tstate->curexc_traceback = 0;
  4315. }
  4316. #endif
  4317. /* WriteUnraisableException */
  4318. static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno,
  4319. CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename,
  4320. int full_traceback, CYTHON_UNUSED int nogil) {
  4321. PyObject *old_exc, *old_val, *old_tb;
  4322. PyObject *ctx;
  4323. __Pyx_PyThreadState_declare
  4324. #ifdef WITH_THREAD
  4325. PyGILState_STATE state;
  4326. if (nogil)
  4327. state = PyGILState_Ensure();
  4328. #ifdef _MSC_VER
  4329. else state = (PyGILState_STATE)-1;
  4330. #endif
  4331. #endif
  4332. __Pyx_PyThreadState_assign
  4333. __Pyx_ErrFetch(&old_exc, &old_val, &old_tb);
  4334. if (full_traceback) {
  4335. Py_XINCREF(old_exc);
  4336. Py_XINCREF(old_val);
  4337. Py_XINCREF(old_tb);
  4338. __Pyx_ErrRestore(old_exc, old_val, old_tb);
  4339. PyErr_PrintEx(1);
  4340. }
  4341. #if PY_MAJOR_VERSION < 3
  4342. ctx = PyString_FromString(name);
  4343. #else
  4344. ctx = PyUnicode_FromString(name);
  4345. #endif
  4346. __Pyx_ErrRestore(old_exc, old_val, old_tb);
  4347. if (!ctx) {
  4348. PyErr_WriteUnraisable(Py_None);
  4349. } else {
  4350. PyErr_WriteUnraisable(ctx);
  4351. Py_DECREF(ctx);
  4352. }
  4353. #ifdef WITH_THREAD
  4354. if (nogil)
  4355. PyGILState_Release(state);
  4356. #endif
  4357. }
  4358. /* RaiseArgTupleInvalid */
  4359. static void __Pyx_RaiseArgtupleInvalid(
  4360. const char* func_name,
  4361. int exact,
  4362. Py_ssize_t num_min,
  4363. Py_ssize_t num_max,
  4364. Py_ssize_t num_found)
  4365. {
  4366. Py_ssize_t num_expected;
  4367. const char *more_or_less;
  4368. if (num_found < num_min) {
  4369. num_expected = num_min;
  4370. more_or_less = "at least";
  4371. } else {
  4372. num_expected = num_max;
  4373. more_or_less = "at most";
  4374. }
  4375. if (exact) {
  4376. more_or_less = "exactly";
  4377. }
  4378. PyErr_Format(PyExc_TypeError,
  4379. "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
  4380. func_name, more_or_less, num_expected,
  4381. (num_expected == 1) ? "" : "s", num_found);
  4382. }
  4383. /* RaiseDoubleKeywords */
  4384. static void __Pyx_RaiseDoubleKeywordsError(
  4385. const char* func_name,
  4386. PyObject* kw_name)
  4387. {
  4388. PyErr_Format(PyExc_TypeError,
  4389. #if PY_MAJOR_VERSION >= 3
  4390. "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
  4391. #else
  4392. "%s() got multiple values for keyword argument '%s'", func_name,
  4393. PyString_AsString(kw_name));
  4394. #endif
  4395. }
  4396. /* ParseKeywords */
  4397. static int __Pyx_ParseOptionalKeywords(
  4398. PyObject *kwds,
  4399. PyObject **argnames[],
  4400. PyObject *kwds2,
  4401. PyObject *values[],
  4402. Py_ssize_t num_pos_args,
  4403. const char* function_name)
  4404. {
  4405. PyObject *key = 0, *value = 0;
  4406. Py_ssize_t pos = 0;
  4407. PyObject*** name;
  4408. PyObject*** first_kw_arg = argnames + num_pos_args;
  4409. while (PyDict_Next(kwds, &pos, &key, &value)) {
  4410. name = first_kw_arg;
  4411. while (*name && (**name != key)) name++;
  4412. if (*name) {
  4413. values[name-argnames] = value;
  4414. continue;
  4415. }
  4416. name = first_kw_arg;
  4417. #if PY_MAJOR_VERSION < 3
  4418. if (likely(PyString_Check(key))) {
  4419. while (*name) {
  4420. if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
  4421. && _PyString_Eq(**name, key)) {
  4422. values[name-argnames] = value;
  4423. break;
  4424. }
  4425. name++;
  4426. }
  4427. if (*name) continue;
  4428. else {
  4429. PyObject*** argname = argnames;
  4430. while (argname != first_kw_arg) {
  4431. if ((**argname == key) || (
  4432. (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
  4433. && _PyString_Eq(**argname, key))) {
  4434. goto arg_passed_twice;
  4435. }
  4436. argname++;
  4437. }
  4438. }
  4439. } else
  4440. #endif
  4441. if (likely(PyUnicode_Check(key))) {
  4442. while (*name) {
  4443. int cmp = (**name == key) ? 0 :
  4444. #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
  4445. (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
  4446. #endif
  4447. PyUnicode_Compare(**name, key);
  4448. if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
  4449. if (cmp == 0) {
  4450. values[name-argnames] = value;
  4451. break;
  4452. }
  4453. name++;
  4454. }
  4455. if (*name) continue;
  4456. else {
  4457. PyObject*** argname = argnames;
  4458. while (argname != first_kw_arg) {
  4459. int cmp = (**argname == key) ? 0 :
  4460. #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
  4461. (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
  4462. #endif
  4463. PyUnicode_Compare(**argname, key);
  4464. if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
  4465. if (cmp == 0) goto arg_passed_twice;
  4466. argname++;
  4467. }
  4468. }
  4469. } else
  4470. goto invalid_keyword_type;
  4471. if (kwds2) {
  4472. if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
  4473. } else {
  4474. goto invalid_keyword;
  4475. }
  4476. }
  4477. return 0;
  4478. arg_passed_twice:
  4479. __Pyx_RaiseDoubleKeywordsError(function_name, key);
  4480. goto bad;
  4481. invalid_keyword_type:
  4482. PyErr_Format(PyExc_TypeError,
  4483. "%.200s() keywords must be strings", function_name);
  4484. goto bad;
  4485. invalid_keyword:
  4486. PyErr_Format(PyExc_TypeError,
  4487. #if PY_MAJOR_VERSION < 3
  4488. "%.200s() got an unexpected keyword argument '%.200s'",
  4489. function_name, PyString_AsString(key));
  4490. #else
  4491. "%s() got an unexpected keyword argument '%U'",
  4492. function_name, key);
  4493. #endif
  4494. bad:
  4495. return -1;
  4496. }
  4497. /* PyObjectCallNoArg */
  4498. #if CYTHON_COMPILING_IN_CPYTHON
  4499. static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
  4500. #if CYTHON_FAST_PYCALL
  4501. if (PyFunction_Check(func)) {
  4502. return __Pyx_PyFunction_FastCall(func, NULL, 0);
  4503. }
  4504. #endif
  4505. #ifdef __Pyx_CyFunction_USED
  4506. if (likely(PyCFunction_Check(func) || __Pyx_CyFunction_Check(func)))
  4507. #else
  4508. if (likely(PyCFunction_Check(func)))
  4509. #endif
  4510. {
  4511. if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) {
  4512. return __Pyx_PyObject_CallMethO(func, NULL);
  4513. }
  4514. }
  4515. return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL);
  4516. }
  4517. #endif
  4518. /* RaiseException */
  4519. #if PY_MAJOR_VERSION < 3
  4520. static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
  4521. CYTHON_UNUSED PyObject *cause) {
  4522. __Pyx_PyThreadState_declare
  4523. Py_XINCREF(type);
  4524. if (!value || value == Py_None)
  4525. value = NULL;
  4526. else
  4527. Py_INCREF(value);
  4528. if (!tb || tb == Py_None)
  4529. tb = NULL;
  4530. else {
  4531. Py_INCREF(tb);
  4532. if (!PyTraceBack_Check(tb)) {
  4533. PyErr_SetString(PyExc_TypeError,
  4534. "raise: arg 3 must be a traceback or None");
  4535. goto raise_error;
  4536. }
  4537. }
  4538. if (PyType_Check(type)) {
  4539. #if CYTHON_COMPILING_IN_PYPY
  4540. if (!value) {
  4541. Py_INCREF(Py_None);
  4542. value = Py_None;
  4543. }
  4544. #endif
  4545. PyErr_NormalizeException(&type, &value, &tb);
  4546. } else {
  4547. if (value) {
  4548. PyErr_SetString(PyExc_TypeError,
  4549. "instance exception may not have a separate value");
  4550. goto raise_error;
  4551. }
  4552. value = type;
  4553. type = (PyObject*) Py_TYPE(type);
  4554. Py_INCREF(type);
  4555. if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
  4556. PyErr_SetString(PyExc_TypeError,
  4557. "raise: exception class must be a subclass of BaseException");
  4558. goto raise_error;
  4559. }
  4560. }
  4561. __Pyx_PyThreadState_assign
  4562. __Pyx_ErrRestore(type, value, tb);
  4563. return;
  4564. raise_error:
  4565. Py_XDECREF(value);
  4566. Py_XDECREF(type);
  4567. Py_XDECREF(tb);
  4568. return;
  4569. }
  4570. #else
  4571. static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
  4572. PyObject* owned_instance = NULL;
  4573. if (tb == Py_None) {
  4574. tb = 0;
  4575. } else if (tb && !PyTraceBack_Check(tb)) {
  4576. PyErr_SetString(PyExc_TypeError,
  4577. "raise: arg 3 must be a traceback or None");
  4578. goto bad;
  4579. }
  4580. if (value == Py_None)
  4581. value = 0;
  4582. if (PyExceptionInstance_Check(type)) {
  4583. if (value) {
  4584. PyErr_SetString(PyExc_TypeError,
  4585. "instance exception may not have a separate value");
  4586. goto bad;
  4587. }
  4588. value = type;
  4589. type = (PyObject*) Py_TYPE(value);
  4590. } else if (PyExceptionClass_Check(type)) {
  4591. PyObject *instance_class = NULL;
  4592. if (value && PyExceptionInstance_Check(value)) {
  4593. instance_class = (PyObject*) Py_TYPE(value);
  4594. if (instance_class != type) {
  4595. int is_subclass = PyObject_IsSubclass(instance_class, type);
  4596. if (!is_subclass) {
  4597. instance_class = NULL;
  4598. } else if (unlikely(is_subclass == -1)) {
  4599. goto bad;
  4600. } else {
  4601. type = instance_class;
  4602. }
  4603. }
  4604. }
  4605. if (!instance_class) {
  4606. PyObject *args;
  4607. if (!value)
  4608. args = PyTuple_New(0);
  4609. else if (PyTuple_Check(value)) {
  4610. Py_INCREF(value);
  4611. args = value;
  4612. } else
  4613. args = PyTuple_Pack(1, value);
  4614. if (!args)
  4615. goto bad;
  4616. owned_instance = PyObject_Call(type, args, NULL);
  4617. Py_DECREF(args);
  4618. if (!owned_instance)
  4619. goto bad;
  4620. value = owned_instance;
  4621. if (!PyExceptionInstance_Check(value)) {
  4622. PyErr_Format(PyExc_TypeError,
  4623. "calling %R should have returned an instance of "
  4624. "BaseException, not %R",
  4625. type, Py_TYPE(value));
  4626. goto bad;
  4627. }
  4628. }
  4629. } else {
  4630. PyErr_SetString(PyExc_TypeError,
  4631. "raise: exception class must be a subclass of BaseException");
  4632. goto bad;
  4633. }
  4634. if (cause) {
  4635. PyObject *fixed_cause;
  4636. if (cause == Py_None) {
  4637. fixed_cause = NULL;
  4638. } else if (PyExceptionClass_Check(cause)) {
  4639. fixed_cause = PyObject_CallObject(cause, NULL);
  4640. if (fixed_cause == NULL)
  4641. goto bad;
  4642. } else if (PyExceptionInstance_Check(cause)) {
  4643. fixed_cause = cause;
  4644. Py_INCREF(fixed_cause);
  4645. } else {
  4646. PyErr_SetString(PyExc_TypeError,
  4647. "exception causes must derive from "
  4648. "BaseException");
  4649. goto bad;
  4650. }
  4651. PyException_SetCause(value, fixed_cause);
  4652. }
  4653. PyErr_SetObject(type, value);
  4654. if (tb) {
  4655. #if CYTHON_COMPILING_IN_PYPY
  4656. PyObject *tmp_type, *tmp_value, *tmp_tb;
  4657. PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
  4658. Py_INCREF(tb);
  4659. PyErr_Restore(tmp_type, tmp_value, tb);
  4660. Py_XDECREF(tmp_tb);
  4661. #else
  4662. PyThreadState *tstate = __Pyx_PyThreadState_Current;
  4663. PyObject* tmp_tb = tstate->curexc_traceback;
  4664. if (tb != tmp_tb) {
  4665. Py_INCREF(tb);
  4666. tstate->curexc_traceback = tb;
  4667. Py_XDECREF(tmp_tb);
  4668. }
  4669. #endif
  4670. }
  4671. bad:
  4672. Py_XDECREF(owned_instance);
  4673. return;
  4674. }
  4675. #endif
  4676. /* PyObject_GenericGetAttrNoDict */
  4677. #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
  4678. static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) {
  4679. PyErr_Format(PyExc_AttributeError,
  4680. #if PY_MAJOR_VERSION >= 3
  4681. "'%.50s' object has no attribute '%U'",
  4682. tp->tp_name, attr_name);
  4683. #else
  4684. "'%.50s' object has no attribute '%.400s'",
  4685. tp->tp_name, PyString_AS_STRING(attr_name));
  4686. #endif
  4687. return NULL;
  4688. }
  4689. static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) {
  4690. PyObject *descr;
  4691. PyTypeObject *tp = Py_TYPE(obj);
  4692. if (unlikely(!PyString_Check(attr_name))) {
  4693. return PyObject_GenericGetAttr(obj, attr_name);
  4694. }
  4695. assert(!tp->tp_dictoffset);
  4696. descr = _PyType_Lookup(tp, attr_name);
  4697. if (unlikely(!descr)) {
  4698. return __Pyx_RaiseGenericGetAttributeError(tp, attr_name);
  4699. }
  4700. Py_INCREF(descr);
  4701. #if PY_MAJOR_VERSION < 3
  4702. if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS)))
  4703. #endif
  4704. {
  4705. descrgetfunc f = Py_TYPE(descr)->tp_descr_get;
  4706. if (unlikely(f)) {
  4707. PyObject *res = f(descr, obj, (PyObject *)tp);
  4708. Py_DECREF(descr);
  4709. return res;
  4710. }
  4711. }
  4712. return descr;
  4713. }
  4714. #endif
  4715. /* PyObject_GenericGetAttr */
  4716. #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
  4717. static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) {
  4718. if (unlikely(Py_TYPE(obj)->tp_dictoffset)) {
  4719. return PyObject_GenericGetAttr(obj, attr_name);
  4720. }
  4721. return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name);
  4722. }
  4723. #endif
  4724. /* SetVTable */
  4725. static int __Pyx_SetVtable(PyObject *dict, void *vtable) {
  4726. #if PY_VERSION_HEX >= 0x02070000
  4727. PyObject *ob = PyCapsule_New(vtable, 0, 0);
  4728. #else
  4729. PyObject *ob = PyCObject_FromVoidPtr(vtable, 0);
  4730. #endif
  4731. if (!ob)
  4732. goto bad;
  4733. if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0)
  4734. goto bad;
  4735. Py_DECREF(ob);
  4736. return 0;
  4737. bad:
  4738. Py_XDECREF(ob);
  4739. return -1;
  4740. }
  4741. /* PyErrExceptionMatches */
  4742. #if CYTHON_FAST_THREAD_STATE
  4743. static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
  4744. Py_ssize_t i, n;
  4745. n = PyTuple_GET_SIZE(tuple);
  4746. #if PY_MAJOR_VERSION >= 3
  4747. for (i=0; i<n; i++) {
  4748. if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
  4749. }
  4750. #endif
  4751. for (i=0; i<n; i++) {
  4752. if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1;
  4753. }
  4754. return 0;
  4755. }
  4756. static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
  4757. PyObject *exc_type = tstate->curexc_type;
  4758. if (exc_type == err) return 1;
  4759. if (unlikely(!exc_type)) return 0;
  4760. if (unlikely(PyTuple_Check(err)))
  4761. return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
  4762. return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
  4763. }
  4764. #endif
  4765. /* PyObjectGetAttrStrNoError */
  4766. static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) {
  4767. __Pyx_PyThreadState_declare
  4768. __Pyx_PyThreadState_assign
  4769. if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
  4770. __Pyx_PyErr_Clear();
  4771. }
  4772. static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) {
  4773. PyObject *result;
  4774. #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1
  4775. PyTypeObject* tp = Py_TYPE(obj);
  4776. if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) {
  4777. return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1);
  4778. }
  4779. #endif
  4780. result = __Pyx_PyObject_GetAttrStr(obj, attr_name);
  4781. if (unlikely(!result)) {
  4782. __Pyx_PyObject_GetAttrStr_ClearAttributeError();
  4783. }
  4784. return result;
  4785. }
  4786. /* SetupReduce */
  4787. static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
  4788. int ret;
  4789. PyObject *name_attr;
  4790. name_attr = __Pyx_PyObject_GetAttrStr(meth, __pyx_n_s_name);
  4791. if (likely(name_attr)) {
  4792. ret = PyObject_RichCompareBool(name_attr, name, Py_EQ);
  4793. } else {
  4794. ret = -1;
  4795. }
  4796. if (unlikely(ret < 0)) {
  4797. PyErr_Clear();
  4798. ret = 0;
  4799. }
  4800. Py_XDECREF(name_attr);
  4801. return ret;
  4802. }
  4803. static int __Pyx_setup_reduce(PyObject* type_obj) {
  4804. int ret = 0;
  4805. PyObject *object_reduce = NULL;
  4806. PyObject *object_reduce_ex = NULL;
  4807. PyObject *reduce = NULL;
  4808. PyObject *reduce_ex = NULL;
  4809. PyObject *reduce_cython = NULL;
  4810. PyObject *setstate = NULL;
  4811. PyObject *setstate_cython = NULL;
  4812. #if CYTHON_USE_PYTYPE_LOOKUP
  4813. if (_PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate)) goto __PYX_GOOD;
  4814. #else
  4815. if (PyObject_HasAttr(type_obj, __pyx_n_s_getstate)) goto __PYX_GOOD;
  4816. #endif
  4817. #if CYTHON_USE_PYTYPE_LOOKUP
  4818. object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;
  4819. #else
  4820. object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;
  4821. #endif
  4822. reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto __PYX_BAD;
  4823. if (reduce_ex == object_reduce_ex) {
  4824. #if CYTHON_USE_PYTYPE_LOOKUP
  4825. object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD;
  4826. #else
  4827. object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD;
  4828. #endif
  4829. reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto __PYX_BAD;
  4830. if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) {
  4831. reduce_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_reduce_cython);
  4832. if (likely(reduce_cython)) {
  4833. ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
  4834. ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
  4835. } else if (reduce == object_reduce || PyErr_Occurred()) {
  4836. goto __PYX_BAD;
  4837. }
  4838. setstate = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate);
  4839. if (!setstate) PyErr_Clear();
  4840. if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) {
  4841. setstate_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate_cython);
  4842. if (likely(setstate_cython)) {
  4843. ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
  4844. ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
  4845. } else if (!setstate || PyErr_Occurred()) {
  4846. goto __PYX_BAD;
  4847. }
  4848. }
  4849. PyType_Modified((PyTypeObject*)type_obj);
  4850. }
  4851. }
  4852. goto __PYX_GOOD;
  4853. __PYX_BAD:
  4854. if (!PyErr_Occurred())
  4855. PyErr_Format(PyExc_RuntimeError, "Unable to initialize pickling for %s", ((PyTypeObject*)type_obj)->tp_name);
  4856. ret = -1;
  4857. __PYX_GOOD:
  4858. #if !CYTHON_USE_PYTYPE_LOOKUP
  4859. Py_XDECREF(object_reduce);
  4860. Py_XDECREF(object_reduce_ex);
  4861. #endif
  4862. Py_XDECREF(reduce);
  4863. Py_XDECREF(reduce_ex);
  4864. Py_XDECREF(reduce_cython);
  4865. Py_XDECREF(setstate);
  4866. Py_XDECREF(setstate_cython);
  4867. return ret;
  4868. }
  4869. /* Import */
  4870. static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
  4871. PyObject *empty_list = 0;
  4872. PyObject *module = 0;
  4873. PyObject *global_dict = 0;
  4874. PyObject *empty_dict = 0;
  4875. PyObject *list;
  4876. #if PY_MAJOR_VERSION < 3
  4877. PyObject *py_import;
  4878. py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
  4879. if (!py_import)
  4880. goto bad;
  4881. #endif
  4882. if (from_list)
  4883. list = from_list;
  4884. else {
  4885. empty_list = PyList_New(0);
  4886. if (!empty_list)
  4887. goto bad;
  4888. list = empty_list;
  4889. }
  4890. global_dict = PyModule_GetDict(__pyx_m);
  4891. if (!global_dict)
  4892. goto bad;
  4893. empty_dict = PyDict_New();
  4894. if (!empty_dict)
  4895. goto bad;
  4896. {
  4897. #if PY_MAJOR_VERSION >= 3
  4898. if (level == -1) {
  4899. if ((1) && (strchr(__Pyx_MODULE_NAME, '.'))) {
  4900. module = PyImport_ImportModuleLevelObject(
  4901. name, global_dict, empty_dict, list, 1);
  4902. if (!module) {
  4903. if (!PyErr_ExceptionMatches(PyExc_ImportError))
  4904. goto bad;
  4905. PyErr_Clear();
  4906. }
  4907. }
  4908. level = 0;
  4909. }
  4910. #endif
  4911. if (!module) {
  4912. #if PY_MAJOR_VERSION < 3
  4913. PyObject *py_level = PyInt_FromLong(level);
  4914. if (!py_level)
  4915. goto bad;
  4916. module = PyObject_CallFunctionObjArgs(py_import,
  4917. name, global_dict, empty_dict, list, py_level, (PyObject *)NULL);
  4918. Py_DECREF(py_level);
  4919. #else
  4920. module = PyImport_ImportModuleLevelObject(
  4921. name, global_dict, empty_dict, list, level);
  4922. #endif
  4923. }
  4924. }
  4925. bad:
  4926. #if PY_MAJOR_VERSION < 3
  4927. Py_XDECREF(py_import);
  4928. #endif
  4929. Py_XDECREF(empty_list);
  4930. Py_XDECREF(empty_dict);
  4931. return module;
  4932. }
  4933. /* ImportFrom */
  4934. static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
  4935. PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
  4936. if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
  4937. PyErr_Format(PyExc_ImportError,
  4938. #if PY_MAJOR_VERSION < 3
  4939. "cannot import name %.230s", PyString_AS_STRING(name));
  4940. #else
  4941. "cannot import name %S", name);
  4942. #endif
  4943. }
  4944. return value;
  4945. }
  4946. /* CLineInTraceback */
  4947. #ifndef CYTHON_CLINE_IN_TRACEBACK
  4948. static int __Pyx_CLineForTraceback(CYTHON_NCP_UNUSED PyThreadState *tstate, int c_line) {
  4949. PyObject *use_cline;
  4950. PyObject *ptype, *pvalue, *ptraceback;
  4951. #if CYTHON_COMPILING_IN_CPYTHON
  4952. PyObject **cython_runtime_dict;
  4953. #endif
  4954. if (unlikely(!__pyx_cython_runtime)) {
  4955. return c_line;
  4956. }
  4957. __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
  4958. #if CYTHON_COMPILING_IN_CPYTHON
  4959. cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
  4960. if (likely(cython_runtime_dict)) {
  4961. __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
  4962. use_cline, *cython_runtime_dict,
  4963. __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback))
  4964. } else
  4965. #endif
  4966. {
  4967. PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
  4968. if (use_cline_obj) {
  4969. use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
  4970. Py_DECREF(use_cline_obj);
  4971. } else {
  4972. PyErr_Clear();
  4973. use_cline = NULL;
  4974. }
  4975. }
  4976. if (!use_cline) {
  4977. c_line = 0;
  4978. PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
  4979. }
  4980. else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
  4981. c_line = 0;
  4982. }
  4983. __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
  4984. return c_line;
  4985. }
  4986. #endif
  4987. /* CodeObjectCache */
  4988. static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
  4989. int start = 0, mid = 0, end = count - 1;
  4990. if (end >= 0 && code_line > entries[end].code_line) {
  4991. return count;
  4992. }
  4993. while (start < end) {
  4994. mid = start + (end - start) / 2;
  4995. if (code_line < entries[mid].code_line) {
  4996. end = mid;
  4997. } else if (code_line > entries[mid].code_line) {
  4998. start = mid + 1;
  4999. } else {
  5000. return mid;
  5001. }
  5002. }
  5003. if (code_line <= entries[mid].code_line) {
  5004. return mid;
  5005. } else {
  5006. return mid + 1;
  5007. }
  5008. }
  5009. static PyCodeObject *__pyx_find_code_object(int code_line) {
  5010. PyCodeObject* code_object;
  5011. int pos;
  5012. if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
  5013. return NULL;
  5014. }
  5015. pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
  5016. if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
  5017. return NULL;
  5018. }
  5019. code_object = __pyx_code_cache.entries[pos].code_object;
  5020. Py_INCREF(code_object);
  5021. return code_object;
  5022. }
  5023. static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
  5024. int pos, i;
  5025. __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
  5026. if (unlikely(!code_line)) {
  5027. return;
  5028. }
  5029. if (unlikely(!entries)) {
  5030. entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
  5031. if (likely(entries)) {
  5032. __pyx_code_cache.entries = entries;
  5033. __pyx_code_cache.max_count = 64;
  5034. __pyx_code_cache.count = 1;
  5035. entries[0].code_line = code_line;
  5036. entries[0].code_object = code_object;
  5037. Py_INCREF(code_object);
  5038. }
  5039. return;
  5040. }
  5041. pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
  5042. if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
  5043. PyCodeObject* tmp = entries[pos].code_object;
  5044. entries[pos].code_object = code_object;
  5045. Py_DECREF(tmp);
  5046. return;
  5047. }
  5048. if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
  5049. int new_max = __pyx_code_cache.max_count + 64;
  5050. entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
  5051. __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry));
  5052. if (unlikely(!entries)) {
  5053. return;
  5054. }
  5055. __pyx_code_cache.entries = entries;
  5056. __pyx_code_cache.max_count = new_max;
  5057. }
  5058. for (i=__pyx_code_cache.count; i>pos; i--) {
  5059. entries[i] = entries[i-1];
  5060. }
  5061. entries[pos].code_line = code_line;
  5062. entries[pos].code_object = code_object;
  5063. __pyx_code_cache.count++;
  5064. Py_INCREF(code_object);
  5065. }
  5066. /* AddTraceback */
  5067. #include "compile.h"
  5068. #include "frameobject.h"
  5069. #include "traceback.h"
  5070. static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
  5071. const char *funcname, int c_line,
  5072. int py_line, const char *filename) {
  5073. PyCodeObject *py_code = 0;
  5074. PyObject *py_srcfile = 0;
  5075. PyObject *py_funcname = 0;
  5076. #if PY_MAJOR_VERSION < 3
  5077. py_srcfile = PyString_FromString(filename);
  5078. #else
  5079. py_srcfile = PyUnicode_FromString(filename);
  5080. #endif
  5081. if (!py_srcfile) goto bad;
  5082. if (c_line) {
  5083. #if PY_MAJOR_VERSION < 3
  5084. py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
  5085. #else
  5086. py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
  5087. #endif
  5088. }
  5089. else {
  5090. #if PY_MAJOR_VERSION < 3
  5091. py_funcname = PyString_FromString(funcname);
  5092. #else
  5093. py_funcname = PyUnicode_FromString(funcname);
  5094. #endif
  5095. }
  5096. if (!py_funcname) goto bad;
  5097. py_code = __Pyx_PyCode_New(
  5098. 0,
  5099. 0,
  5100. 0,
  5101. 0,
  5102. 0,
  5103. __pyx_empty_bytes, /*PyObject *code,*/
  5104. __pyx_empty_tuple, /*PyObject *consts,*/
  5105. __pyx_empty_tuple, /*PyObject *names,*/
  5106. __pyx_empty_tuple, /*PyObject *varnames,*/
  5107. __pyx_empty_tuple, /*PyObject *freevars,*/
  5108. __pyx_empty_tuple, /*PyObject *cellvars,*/
  5109. py_srcfile, /*PyObject *filename,*/
  5110. py_funcname, /*PyObject *name,*/
  5111. py_line,
  5112. __pyx_empty_bytes /*PyObject *lnotab*/
  5113. );
  5114. Py_DECREF(py_srcfile);
  5115. Py_DECREF(py_funcname);
  5116. return py_code;
  5117. bad:
  5118. Py_XDECREF(py_srcfile);
  5119. Py_XDECREF(py_funcname);
  5120. return NULL;
  5121. }
  5122. static void __Pyx_AddTraceback(const char *funcname, int c_line,
  5123. int py_line, const char *filename) {
  5124. PyCodeObject *py_code = 0;
  5125. PyFrameObject *py_frame = 0;
  5126. PyThreadState *tstate = __Pyx_PyThreadState_Current;
  5127. if (c_line) {
  5128. c_line = __Pyx_CLineForTraceback(tstate, c_line);
  5129. }
  5130. py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
  5131. if (!py_code) {
  5132. py_code = __Pyx_CreateCodeObjectForTraceback(
  5133. funcname, c_line, py_line, filename);
  5134. if (!py_code) goto bad;
  5135. __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
  5136. }
  5137. py_frame = PyFrame_New(
  5138. tstate, /*PyThreadState *tstate,*/
  5139. py_code, /*PyCodeObject *code,*/
  5140. __pyx_d, /*PyObject *globals,*/
  5141. 0 /*PyObject *locals*/
  5142. );
  5143. if (!py_frame) goto bad;
  5144. __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
  5145. PyTraceBack_Here(py_frame);
  5146. bad:
  5147. Py_XDECREF(py_code);
  5148. Py_XDECREF(py_frame);
  5149. }
  5150. /* CIntFromPyVerify */
  5151. #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
  5152. __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
  5153. #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
  5154. __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
  5155. #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
  5156. {\
  5157. func_type value = func_value;\
  5158. if (sizeof(target_type) < sizeof(func_type)) {\
  5159. if (unlikely(value != (func_type) (target_type) value)) {\
  5160. func_type zero = 0;\
  5161. if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
  5162. return (target_type) -1;\
  5163. if (is_unsigned && unlikely(value < zero))\
  5164. goto raise_neg_overflow;\
  5165. else\
  5166. goto raise_overflow;\
  5167. }\
  5168. }\
  5169. return (target_type) value;\
  5170. }
  5171. /* CIntToPy */
  5172. static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
  5173. const int neg_one = (int) ((int) 0 - (int) 1), const_zero = (int) 0;
  5174. const int is_unsigned = neg_one > const_zero;
  5175. if (is_unsigned) {
  5176. if (sizeof(int) < sizeof(long)) {
  5177. return PyInt_FromLong((long) value);
  5178. } else if (sizeof(int) <= sizeof(unsigned long)) {
  5179. return PyLong_FromUnsignedLong((unsigned long) value);
  5180. #ifdef HAVE_LONG_LONG
  5181. } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
  5182. return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
  5183. #endif
  5184. }
  5185. } else {
  5186. if (sizeof(int) <= sizeof(long)) {
  5187. return PyInt_FromLong((long) value);
  5188. #ifdef HAVE_LONG_LONG
  5189. } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
  5190. return PyLong_FromLongLong((PY_LONG_LONG) value);
  5191. #endif
  5192. }
  5193. }
  5194. {
  5195. int one = 1; int little = (int)*(unsigned char *)&one;
  5196. unsigned char *bytes = (unsigned char *)&value;
  5197. return _PyLong_FromByteArray(bytes, sizeof(int),
  5198. little, !is_unsigned);
  5199. }
  5200. }
  5201. /* CIntFromPy */
  5202. static CYTHON_INLINE uint32_t __Pyx_PyInt_As_uint32_t(PyObject *x) {
  5203. const uint32_t neg_one = (uint32_t) ((uint32_t) 0 - (uint32_t) 1), const_zero = (uint32_t) 0;
  5204. const int is_unsigned = neg_one > const_zero;
  5205. #if PY_MAJOR_VERSION < 3
  5206. if (likely(PyInt_Check(x))) {
  5207. if (sizeof(uint32_t) < sizeof(long)) {
  5208. __PYX_VERIFY_RETURN_INT(uint32_t, long, PyInt_AS_LONG(x))
  5209. } else {
  5210. long val = PyInt_AS_LONG(x);
  5211. if (is_unsigned && unlikely(val < 0)) {
  5212. goto raise_neg_overflow;
  5213. }
  5214. return (uint32_t) val;
  5215. }
  5216. } else
  5217. #endif
  5218. if (likely(PyLong_Check(x))) {
  5219. if (is_unsigned) {
  5220. #if CYTHON_USE_PYLONG_INTERNALS
  5221. const digit* digits = ((PyLongObject*)x)->ob_digit;
  5222. switch (Py_SIZE(x)) {
  5223. case 0: return (uint32_t) 0;
  5224. case 1: __PYX_VERIFY_RETURN_INT(uint32_t, digit, digits[0])
  5225. case 2:
  5226. if (8 * sizeof(uint32_t) > 1 * PyLong_SHIFT) {
  5227. if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
  5228. __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
  5229. } else if (8 * sizeof(uint32_t) >= 2 * PyLong_SHIFT) {
  5230. return (uint32_t) (((((uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]));
  5231. }
  5232. }
  5233. break;
  5234. case 3:
  5235. if (8 * sizeof(uint32_t) > 2 * PyLong_SHIFT) {
  5236. if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
  5237. __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
  5238. } else if (8 * sizeof(uint32_t) >= 3 * PyLong_SHIFT) {
  5239. return (uint32_t) (((((((uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]));
  5240. }
  5241. }
  5242. break;
  5243. case 4:
  5244. if (8 * sizeof(uint32_t) > 3 * PyLong_SHIFT) {
  5245. if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
  5246. __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
  5247. } else if (8 * sizeof(uint32_t) >= 4 * PyLong_SHIFT) {
  5248. return (uint32_t) (((((((((uint32_t)digits[3]) << PyLong_SHIFT) | (uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]));
  5249. }
  5250. }
  5251. break;
  5252. }
  5253. #endif
  5254. #if CYTHON_COMPILING_IN_CPYTHON
  5255. if (unlikely(Py_SIZE(x) < 0)) {
  5256. goto raise_neg_overflow;
  5257. }
  5258. #else
  5259. {
  5260. int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
  5261. if (unlikely(result < 0))
  5262. return (uint32_t) -1;
  5263. if (unlikely(result == 1))
  5264. goto raise_neg_overflow;
  5265. }
  5266. #endif
  5267. if (sizeof(uint32_t) <= sizeof(unsigned long)) {
  5268. __PYX_VERIFY_RETURN_INT_EXC(uint32_t, unsigned long, PyLong_AsUnsignedLong(x))
  5269. #ifdef HAVE_LONG_LONG
  5270. } else if (sizeof(uint32_t) <= sizeof(unsigned PY_LONG_LONG)) {
  5271. __PYX_VERIFY_RETURN_INT_EXC(uint32_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
  5272. #endif
  5273. }
  5274. } else {
  5275. #if CYTHON_USE_PYLONG_INTERNALS
  5276. const digit* digits = ((PyLongObject*)x)->ob_digit;
  5277. switch (Py_SIZE(x)) {
  5278. case 0: return (uint32_t) 0;
  5279. case -1: __PYX_VERIFY_RETURN_INT(uint32_t, sdigit, (sdigit) (-(sdigit)digits[0]))
  5280. case 1: __PYX_VERIFY_RETURN_INT(uint32_t, digit, +digits[0])
  5281. case -2:
  5282. if (8 * sizeof(uint32_t) - 1 > 1 * PyLong_SHIFT) {
  5283. if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
  5284. __PYX_VERIFY_RETURN_INT(uint32_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
  5285. } else if (8 * sizeof(uint32_t) - 1 > 2 * PyLong_SHIFT) {
  5286. return (uint32_t) (((uint32_t)-1)*(((((uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0])));
  5287. }
  5288. }
  5289. break;
  5290. case 2:
  5291. if (8 * sizeof(uint32_t) > 1 * PyLong_SHIFT) {
  5292. if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
  5293. __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
  5294. } else if (8 * sizeof(uint32_t) - 1 > 2 * PyLong_SHIFT) {
  5295. return (uint32_t) ((((((uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0])));
  5296. }
  5297. }
  5298. break;
  5299. case -3:
  5300. if (8 * sizeof(uint32_t) - 1 > 2 * PyLong_SHIFT) {
  5301. if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
  5302. __PYX_VERIFY_RETURN_INT(uint32_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
  5303. } else if (8 * sizeof(uint32_t) - 1 > 3 * PyLong_SHIFT) {
  5304. return (uint32_t) (((uint32_t)-1)*(((((((uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0])));
  5305. }
  5306. }
  5307. break;
  5308. case 3:
  5309. if (8 * sizeof(uint32_t) > 2 * PyLong_SHIFT) {
  5310. if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
  5311. __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
  5312. } else if (8 * sizeof(uint32_t) - 1 > 3 * PyLong_SHIFT) {
  5313. return (uint32_t) ((((((((uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0])));
  5314. }
  5315. }
  5316. break;
  5317. case -4:
  5318. if (8 * sizeof(uint32_t) - 1 > 3 * PyLong_SHIFT) {
  5319. if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
  5320. __PYX_VERIFY_RETURN_INT(uint32_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
  5321. } else if (8 * sizeof(uint32_t) - 1 > 4 * PyLong_SHIFT) {
  5322. return (uint32_t) (((uint32_t)-1)*(((((((((uint32_t)digits[3]) << PyLong_SHIFT) | (uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0])));
  5323. }
  5324. }
  5325. break;
  5326. case 4:
  5327. if (8 * sizeof(uint32_t) > 3 * PyLong_SHIFT) {
  5328. if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
  5329. __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
  5330. } else if (8 * sizeof(uint32_t) - 1 > 4 * PyLong_SHIFT) {
  5331. return (uint32_t) ((((((((((uint32_t)digits[3]) << PyLong_SHIFT) | (uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0])));
  5332. }
  5333. }
  5334. break;
  5335. }
  5336. #endif
  5337. if (sizeof(uint32_t) <= sizeof(long)) {
  5338. __PYX_VERIFY_RETURN_INT_EXC(uint32_t, long, PyLong_AsLong(x))
  5339. #ifdef HAVE_LONG_LONG
  5340. } else if (sizeof(uint32_t) <= sizeof(PY_LONG_LONG)) {
  5341. __PYX_VERIFY_RETURN_INT_EXC(uint32_t, PY_LONG_LONG, PyLong_AsLongLong(x))
  5342. #endif
  5343. }
  5344. }
  5345. {
  5346. #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
  5347. PyErr_SetString(PyExc_RuntimeError,
  5348. "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
  5349. #else
  5350. uint32_t val;
  5351. PyObject *v = __Pyx_PyNumber_IntOrLong(x);
  5352. #if PY_MAJOR_VERSION < 3
  5353. if (likely(v) && !PyLong_Check(v)) {
  5354. PyObject *tmp = v;
  5355. v = PyNumber_Long(tmp);
  5356. Py_DECREF(tmp);
  5357. }
  5358. #endif
  5359. if (likely(v)) {
  5360. int one = 1; int is_little = (int)*(unsigned char *)&one;
  5361. unsigned char *bytes = (unsigned char *)&val;
  5362. int ret = _PyLong_AsByteArray((PyLongObject *)v,
  5363. bytes, sizeof(val),
  5364. is_little, !is_unsigned);
  5365. Py_DECREF(v);
  5366. if (likely(!ret))
  5367. return val;
  5368. }
  5369. #endif
  5370. return (uint32_t) -1;
  5371. }
  5372. } else {
  5373. uint32_t val;
  5374. PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
  5375. if (!tmp) return (uint32_t) -1;
  5376. val = __Pyx_PyInt_As_uint32_t(tmp);
  5377. Py_DECREF(tmp);
  5378. return val;
  5379. }
  5380. raise_overflow:
  5381. PyErr_SetString(PyExc_OverflowError,
  5382. "value too large to convert to uint32_t");
  5383. return (uint32_t) -1;
  5384. raise_neg_overflow:
  5385. PyErr_SetString(PyExc_OverflowError,
  5386. "can't convert negative value to uint32_t");
  5387. return (uint32_t) -1;
  5388. }
  5389. /* CIntToPy */
  5390. static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
  5391. const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0;
  5392. const int is_unsigned = neg_one > const_zero;
  5393. if (is_unsigned) {
  5394. if (sizeof(long) < sizeof(long)) {
  5395. return PyInt_FromLong((long) value);
  5396. } else if (sizeof(long) <= sizeof(unsigned long)) {
  5397. return PyLong_FromUnsignedLong((unsigned long) value);
  5398. #ifdef HAVE_LONG_LONG
  5399. } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
  5400. return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
  5401. #endif
  5402. }
  5403. } else {
  5404. if (sizeof(long) <= sizeof(long)) {
  5405. return PyInt_FromLong((long) value);
  5406. #ifdef HAVE_LONG_LONG
  5407. } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
  5408. return PyLong_FromLongLong((PY_LONG_LONG) value);
  5409. #endif
  5410. }
  5411. }
  5412. {
  5413. int one = 1; int little = (int)*(unsigned char *)&one;
  5414. unsigned char *bytes = (unsigned char *)&value;
  5415. return _PyLong_FromByteArray(bytes, sizeof(long),
  5416. little, !is_unsigned);
  5417. }
  5418. }
  5419. /* CIntFromPy */
  5420. static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
  5421. const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0;
  5422. const int is_unsigned = neg_one > const_zero;
  5423. #if PY_MAJOR_VERSION < 3
  5424. if (likely(PyInt_Check(x))) {
  5425. if (sizeof(long) < sizeof(long)) {
  5426. __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
  5427. } else {
  5428. long val = PyInt_AS_LONG(x);
  5429. if (is_unsigned && unlikely(val < 0)) {
  5430. goto raise_neg_overflow;
  5431. }
  5432. return (long) val;
  5433. }
  5434. } else
  5435. #endif
  5436. if (likely(PyLong_Check(x))) {
  5437. if (is_unsigned) {
  5438. #if CYTHON_USE_PYLONG_INTERNALS
  5439. const digit* digits = ((PyLongObject*)x)->ob_digit;
  5440. switch (Py_SIZE(x)) {
  5441. case 0: return (long) 0;
  5442. case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0])
  5443. case 2:
  5444. if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
  5445. if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
  5446. __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
  5447. } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) {
  5448. return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
  5449. }
  5450. }
  5451. break;
  5452. case 3:
  5453. if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
  5454. if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
  5455. __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
  5456. } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) {
  5457. return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
  5458. }
  5459. }
  5460. break;
  5461. case 4:
  5462. if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
  5463. if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
  5464. __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
  5465. } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) {
  5466. return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
  5467. }
  5468. }
  5469. break;
  5470. }
  5471. #endif
  5472. #if CYTHON_COMPILING_IN_CPYTHON
  5473. if (unlikely(Py_SIZE(x) < 0)) {
  5474. goto raise_neg_overflow;
  5475. }
  5476. #else
  5477. {
  5478. int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
  5479. if (unlikely(result < 0))
  5480. return (long) -1;
  5481. if (unlikely(result == 1))
  5482. goto raise_neg_overflow;
  5483. }
  5484. #endif
  5485. if (sizeof(long) <= sizeof(unsigned long)) {
  5486. __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
  5487. #ifdef HAVE_LONG_LONG
  5488. } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
  5489. __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
  5490. #endif
  5491. }
  5492. } else {
  5493. #if CYTHON_USE_PYLONG_INTERNALS
  5494. const digit* digits = ((PyLongObject*)x)->ob_digit;
  5495. switch (Py_SIZE(x)) {
  5496. case 0: return (long) 0;
  5497. case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0]))
  5498. case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0])
  5499. case -2:
  5500. if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) {
  5501. if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
  5502. __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
  5503. } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
  5504. return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
  5505. }
  5506. }
  5507. break;
  5508. case 2:
  5509. if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
  5510. if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
  5511. __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
  5512. } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
  5513. return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
  5514. }
  5515. }
  5516. break;
  5517. case -3:
  5518. if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
  5519. if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
  5520. __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
  5521. } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
  5522. return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
  5523. }
  5524. }
  5525. break;
  5526. case 3:
  5527. if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
  5528. if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
  5529. __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
  5530. } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
  5531. return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
  5532. }
  5533. }
  5534. break;
  5535. case -4:
  5536. if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
  5537. if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
  5538. __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
  5539. } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
  5540. return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
  5541. }
  5542. }
  5543. break;
  5544. case 4:
  5545. if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
  5546. if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
  5547. __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
  5548. } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
  5549. return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
  5550. }
  5551. }
  5552. break;
  5553. }
  5554. #endif
  5555. if (sizeof(long) <= sizeof(long)) {
  5556. __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
  5557. #ifdef HAVE_LONG_LONG
  5558. } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
  5559. __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
  5560. #endif
  5561. }
  5562. }
  5563. {
  5564. #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
  5565. PyErr_SetString(PyExc_RuntimeError,
  5566. "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
  5567. #else
  5568. long val;
  5569. PyObject *v = __Pyx_PyNumber_IntOrLong(x);
  5570. #if PY_MAJOR_VERSION < 3
  5571. if (likely(v) && !PyLong_Check(v)) {
  5572. PyObject *tmp = v;
  5573. v = PyNumber_Long(tmp);
  5574. Py_DECREF(tmp);
  5575. }
  5576. #endif
  5577. if (likely(v)) {
  5578. int one = 1; int is_little = (int)*(unsigned char *)&one;
  5579. unsigned char *bytes = (unsigned char *)&val;
  5580. int ret = _PyLong_AsByteArray((PyLongObject *)v,
  5581. bytes, sizeof(val),
  5582. is_little, !is_unsigned);
  5583. Py_DECREF(v);
  5584. if (likely(!ret))
  5585. return val;
  5586. }
  5587. #endif
  5588. return (long) -1;
  5589. }
  5590. } else {
  5591. long val;
  5592. PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
  5593. if (!tmp) return (long) -1;
  5594. val = __Pyx_PyInt_As_long(tmp);
  5595. Py_DECREF(tmp);
  5596. return val;
  5597. }
  5598. raise_overflow:
  5599. PyErr_SetString(PyExc_OverflowError,
  5600. "value too large to convert to long");
  5601. return (long) -1;
  5602. raise_neg_overflow:
  5603. PyErr_SetString(PyExc_OverflowError,
  5604. "can't convert negative value to long");
  5605. return (long) -1;
  5606. }
  5607. /* CIntFromPy */
  5608. static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
  5609. const int neg_one = (int) ((int) 0 - (int) 1), const_zero = (int) 0;
  5610. const int is_unsigned = neg_one > const_zero;
  5611. #if PY_MAJOR_VERSION < 3
  5612. if (likely(PyInt_Check(x))) {
  5613. if (sizeof(int) < sizeof(long)) {
  5614. __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
  5615. } else {
  5616. long val = PyInt_AS_LONG(x);
  5617. if (is_unsigned && unlikely(val < 0)) {
  5618. goto raise_neg_overflow;
  5619. }
  5620. return (int) val;
  5621. }
  5622. } else
  5623. #endif
  5624. if (likely(PyLong_Check(x))) {
  5625. if (is_unsigned) {
  5626. #if CYTHON_USE_PYLONG_INTERNALS
  5627. const digit* digits = ((PyLongObject*)x)->ob_digit;
  5628. switch (Py_SIZE(x)) {
  5629. case 0: return (int) 0;
  5630. case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0])
  5631. case 2:
  5632. if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
  5633. if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
  5634. __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
  5635. } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) {
  5636. return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
  5637. }
  5638. }
  5639. break;
  5640. case 3:
  5641. if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
  5642. if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
  5643. __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
  5644. } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) {
  5645. return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
  5646. }
  5647. }
  5648. break;
  5649. case 4:
  5650. if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
  5651. if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
  5652. __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
  5653. } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) {
  5654. return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
  5655. }
  5656. }
  5657. break;
  5658. }
  5659. #endif
  5660. #if CYTHON_COMPILING_IN_CPYTHON
  5661. if (unlikely(Py_SIZE(x) < 0)) {
  5662. goto raise_neg_overflow;
  5663. }
  5664. #else
  5665. {
  5666. int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
  5667. if (unlikely(result < 0))
  5668. return (int) -1;
  5669. if (unlikely(result == 1))
  5670. goto raise_neg_overflow;
  5671. }
  5672. #endif
  5673. if (sizeof(int) <= sizeof(unsigned long)) {
  5674. __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
  5675. #ifdef HAVE_LONG_LONG
  5676. } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
  5677. __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
  5678. #endif
  5679. }
  5680. } else {
  5681. #if CYTHON_USE_PYLONG_INTERNALS
  5682. const digit* digits = ((PyLongObject*)x)->ob_digit;
  5683. switch (Py_SIZE(x)) {
  5684. case 0: return (int) 0;
  5685. case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0]))
  5686. case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0])
  5687. case -2:
  5688. if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) {
  5689. if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
  5690. __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
  5691. } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
  5692. return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
  5693. }
  5694. }
  5695. break;
  5696. case 2:
  5697. if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
  5698. if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
  5699. __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
  5700. } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
  5701. return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
  5702. }
  5703. }
  5704. break;
  5705. case -3:
  5706. if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
  5707. if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
  5708. __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
  5709. } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
  5710. return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
  5711. }
  5712. }
  5713. break;
  5714. case 3:
  5715. if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
  5716. if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
  5717. __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
  5718. } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
  5719. return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
  5720. }
  5721. }
  5722. break;
  5723. case -4:
  5724. if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
  5725. if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
  5726. __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
  5727. } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
  5728. return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
  5729. }
  5730. }
  5731. break;
  5732. case 4:
  5733. if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
  5734. if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
  5735. __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
  5736. } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
  5737. return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
  5738. }
  5739. }
  5740. break;
  5741. }
  5742. #endif
  5743. if (sizeof(int) <= sizeof(long)) {
  5744. __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
  5745. #ifdef HAVE_LONG_LONG
  5746. } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
  5747. __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
  5748. #endif
  5749. }
  5750. }
  5751. {
  5752. #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
  5753. PyErr_SetString(PyExc_RuntimeError,
  5754. "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
  5755. #else
  5756. int val;
  5757. PyObject *v = __Pyx_PyNumber_IntOrLong(x);
  5758. #if PY_MAJOR_VERSION < 3
  5759. if (likely(v) && !PyLong_Check(v)) {
  5760. PyObject *tmp = v;
  5761. v = PyNumber_Long(tmp);
  5762. Py_DECREF(tmp);
  5763. }
  5764. #endif
  5765. if (likely(v)) {
  5766. int one = 1; int is_little = (int)*(unsigned char *)&one;
  5767. unsigned char *bytes = (unsigned char *)&val;
  5768. int ret = _PyLong_AsByteArray((PyLongObject *)v,
  5769. bytes, sizeof(val),
  5770. is_little, !is_unsigned);
  5771. Py_DECREF(v);
  5772. if (likely(!ret))
  5773. return val;
  5774. }
  5775. #endif
  5776. return (int) -1;
  5777. }
  5778. } else {
  5779. int val;
  5780. PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
  5781. if (!tmp) return (int) -1;
  5782. val = __Pyx_PyInt_As_int(tmp);
  5783. Py_DECREF(tmp);
  5784. return val;
  5785. }
  5786. raise_overflow:
  5787. PyErr_SetString(PyExc_OverflowError,
  5788. "value too large to convert to int");
  5789. return (int) -1;
  5790. raise_neg_overflow:
  5791. PyErr_SetString(PyExc_OverflowError,
  5792. "can't convert negative value to int");
  5793. return (int) -1;
  5794. }
  5795. /* FastTypeChecks */
  5796. #if CYTHON_COMPILING_IN_CPYTHON
  5797. static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
  5798. while (a) {
  5799. a = a->tp_base;
  5800. if (a == b)
  5801. return 1;
  5802. }
  5803. return b == &PyBaseObject_Type;
  5804. }
  5805. static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
  5806. PyObject *mro;
  5807. if (a == b) return 1;
  5808. mro = a->tp_mro;
  5809. if (likely(mro)) {
  5810. Py_ssize_t i, n;
  5811. n = PyTuple_GET_SIZE(mro);
  5812. for (i = 0; i < n; i++) {
  5813. if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
  5814. return 1;
  5815. }
  5816. return 0;
  5817. }
  5818. return __Pyx_InBases(a, b);
  5819. }
  5820. #if PY_MAJOR_VERSION == 2
  5821. static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
  5822. PyObject *exception, *value, *tb;
  5823. int res;
  5824. __Pyx_PyThreadState_declare
  5825. __Pyx_PyThreadState_assign
  5826. __Pyx_ErrFetch(&exception, &value, &tb);
  5827. res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
  5828. if (unlikely(res == -1)) {
  5829. PyErr_WriteUnraisable(err);
  5830. res = 0;
  5831. }
  5832. if (!res) {
  5833. res = PyObject_IsSubclass(err, exc_type2);
  5834. if (unlikely(res == -1)) {
  5835. PyErr_WriteUnraisable(err);
  5836. res = 0;
  5837. }
  5838. }
  5839. __Pyx_ErrRestore(exception, value, tb);
  5840. return res;
  5841. }
  5842. #else
  5843. static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
  5844. int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
  5845. if (!res) {
  5846. res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
  5847. }
  5848. return res;
  5849. }
  5850. #endif
  5851. static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
  5852. Py_ssize_t i, n;
  5853. assert(PyExceptionClass_Check(exc_type));
  5854. n = PyTuple_GET_SIZE(tuple);
  5855. #if PY_MAJOR_VERSION >= 3
  5856. for (i=0; i<n; i++) {
  5857. if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
  5858. }
  5859. #endif
  5860. for (i=0; i<n; i++) {
  5861. PyObject *t = PyTuple_GET_ITEM(tuple, i);
  5862. #if PY_MAJOR_VERSION < 3
  5863. if (likely(exc_type == t)) return 1;
  5864. #endif
  5865. if (likely(PyExceptionClass_Check(t))) {
  5866. if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
  5867. } else {
  5868. }
  5869. }
  5870. return 0;
  5871. }
  5872. static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
  5873. if (likely(err == exc_type)) return 1;
  5874. if (likely(PyExceptionClass_Check(err))) {
  5875. if (likely(PyExceptionClass_Check(exc_type))) {
  5876. return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
  5877. } else if (likely(PyTuple_Check(exc_type))) {
  5878. return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
  5879. } else {
  5880. }
  5881. }
  5882. return PyErr_GivenExceptionMatches(err, exc_type);
  5883. }
  5884. static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
  5885. assert(PyExceptionClass_Check(exc_type1));
  5886. assert(PyExceptionClass_Check(exc_type2));
  5887. if (likely(err == exc_type1 || err == exc_type2)) return 1;
  5888. if (likely(PyExceptionClass_Check(err))) {
  5889. return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
  5890. }
  5891. return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
  5892. }
  5893. #endif
  5894. /* CheckBinaryVersion */
  5895. static int __Pyx_check_binary_version(void) {
  5896. char ctversion[4], rtversion[4];
  5897. PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
  5898. PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
  5899. if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
  5900. char message[200];
  5901. PyOS_snprintf(message, sizeof(message),
  5902. "compiletime version %s of module '%.100s' "
  5903. "does not match runtime version %s",
  5904. ctversion, __Pyx_MODULE_NAME, rtversion);
  5905. return PyErr_WarnEx(NULL, message, 1);
  5906. }
  5907. return 0;
  5908. }
  5909. /* InitStrings */
  5910. static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
  5911. while (t->p) {
  5912. #if PY_MAJOR_VERSION < 3
  5913. if (t->is_unicode) {
  5914. *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
  5915. } else if (t->intern) {
  5916. *t->p = PyString_InternFromString(t->s);
  5917. } else {
  5918. *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
  5919. }
  5920. #else
  5921. if (t->is_unicode | t->is_str) {
  5922. if (t->intern) {
  5923. *t->p = PyUnicode_InternFromString(t->s);
  5924. } else if (t->encoding) {
  5925. *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
  5926. } else {
  5927. *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
  5928. }
  5929. } else {
  5930. *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
  5931. }
  5932. #endif
  5933. if (!*t->p)
  5934. return -1;
  5935. if (PyObject_Hash(*t->p) == -1)
  5936. return -1;
  5937. ++t;
  5938. }
  5939. return 0;
  5940. }
  5941. static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
  5942. return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
  5943. }
  5944. static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
  5945. Py_ssize_t ignore;
  5946. return __Pyx_PyObject_AsStringAndSize(o, &ignore);
  5947. }
  5948. #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
  5949. #if !CYTHON_PEP393_ENABLED
  5950. static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
  5951. char* defenc_c;
  5952. PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
  5953. if (!defenc) return NULL;
  5954. defenc_c = PyBytes_AS_STRING(defenc);
  5955. #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
  5956. {
  5957. char* end = defenc_c + PyBytes_GET_SIZE(defenc);
  5958. char* c;
  5959. for (c = defenc_c; c < end; c++) {
  5960. if ((unsigned char) (*c) >= 128) {
  5961. PyUnicode_AsASCIIString(o);
  5962. return NULL;
  5963. }
  5964. }
  5965. }
  5966. #endif
  5967. *length = PyBytes_GET_SIZE(defenc);
  5968. return defenc_c;
  5969. }
  5970. #else
  5971. static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
  5972. if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
  5973. #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
  5974. if (likely(PyUnicode_IS_ASCII(o))) {
  5975. *length = PyUnicode_GET_LENGTH(o);
  5976. return PyUnicode_AsUTF8(o);
  5977. } else {
  5978. PyUnicode_AsASCIIString(o);
  5979. return NULL;
  5980. }
  5981. #else
  5982. return PyUnicode_AsUTF8AndSize(o, length);
  5983. #endif
  5984. }
  5985. #endif
  5986. #endif
  5987. static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
  5988. #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
  5989. if (
  5990. #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
  5991. __Pyx_sys_getdefaultencoding_not_ascii &&
  5992. #endif
  5993. PyUnicode_Check(o)) {
  5994. return __Pyx_PyUnicode_AsStringAndSize(o, length);
  5995. } else
  5996. #endif
  5997. #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
  5998. if (PyByteArray_Check(o)) {
  5999. *length = PyByteArray_GET_SIZE(o);
  6000. return PyByteArray_AS_STRING(o);
  6001. } else
  6002. #endif
  6003. {
  6004. char* result;
  6005. int r = PyBytes_AsStringAndSize(o, &result, length);
  6006. if (unlikely(r < 0)) {
  6007. return NULL;
  6008. } else {
  6009. return result;
  6010. }
  6011. }
  6012. }
  6013. static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
  6014. int is_true = x == Py_True;
  6015. if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
  6016. else return PyObject_IsTrue(x);
  6017. }
  6018. static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
  6019. int retval;
  6020. if (unlikely(!x)) return -1;
  6021. retval = __Pyx_PyObject_IsTrue(x);
  6022. Py_DECREF(x);
  6023. return retval;
  6024. }
  6025. static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) {
  6026. #if PY_MAJOR_VERSION >= 3
  6027. if (PyLong_Check(result)) {
  6028. if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
  6029. "__int__ returned non-int (type %.200s). "
  6030. "The ability to return an instance of a strict subclass of int "
  6031. "is deprecated, and may be removed in a future version of Python.",
  6032. Py_TYPE(result)->tp_name)) {
  6033. Py_DECREF(result);
  6034. return NULL;
  6035. }
  6036. return result;
  6037. }
  6038. #endif
  6039. PyErr_Format(PyExc_TypeError,
  6040. "__%.4s__ returned non-%.4s (type %.200s)",
  6041. type_name, type_name, Py_TYPE(result)->tp_name);
  6042. Py_DECREF(result);
  6043. return NULL;
  6044. }
  6045. static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
  6046. #if CYTHON_USE_TYPE_SLOTS
  6047. PyNumberMethods *m;
  6048. #endif
  6049. const char *name = NULL;
  6050. PyObject *res = NULL;
  6051. #if PY_MAJOR_VERSION < 3
  6052. if (likely(PyInt_Check(x) || PyLong_Check(x)))
  6053. #else
  6054. if (likely(PyLong_Check(x)))
  6055. #endif
  6056. return __Pyx_NewRef(x);
  6057. #if CYTHON_USE_TYPE_SLOTS
  6058. m = Py_TYPE(x)->tp_as_number;
  6059. #if PY_MAJOR_VERSION < 3
  6060. if (m && m->nb_int) {
  6061. name = "int";
  6062. res = m->nb_int(x);
  6063. }
  6064. else if (m && m->nb_long) {
  6065. name = "long";
  6066. res = m->nb_long(x);
  6067. }
  6068. #else
  6069. if (likely(m && m->nb_int)) {
  6070. name = "int";
  6071. res = m->nb_int(x);
  6072. }
  6073. #endif
  6074. #else
  6075. if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
  6076. res = PyNumber_Int(x);
  6077. }
  6078. #endif
  6079. if (likely(res)) {
  6080. #if PY_MAJOR_VERSION < 3
  6081. if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
  6082. #else
  6083. if (unlikely(!PyLong_CheckExact(res))) {
  6084. #endif
  6085. return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
  6086. }
  6087. }
  6088. else if (!PyErr_Occurred()) {
  6089. PyErr_SetString(PyExc_TypeError,
  6090. "an integer is required");
  6091. }
  6092. return res;
  6093. }
  6094. static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
  6095. Py_ssize_t ival;
  6096. PyObject *x;
  6097. #if PY_MAJOR_VERSION < 3
  6098. if (likely(PyInt_CheckExact(b))) {
  6099. if (sizeof(Py_ssize_t) >= sizeof(long))
  6100. return PyInt_AS_LONG(b);
  6101. else
  6102. return PyInt_AsSsize_t(b);
  6103. }
  6104. #endif
  6105. if (likely(PyLong_CheckExact(b))) {
  6106. #if CYTHON_USE_PYLONG_INTERNALS
  6107. const digit* digits = ((PyLongObject*)b)->ob_digit;
  6108. const Py_ssize_t size = Py_SIZE(b);
  6109. if (likely(__Pyx_sst_abs(size) <= 1)) {
  6110. ival = likely(size) ? digits[0] : 0;
  6111. if (size == -1) ival = -ival;
  6112. return ival;
  6113. } else {
  6114. switch (size) {
  6115. case 2:
  6116. if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
  6117. return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
  6118. }
  6119. break;
  6120. case -2:
  6121. if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
  6122. return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
  6123. }
  6124. break;
  6125. case 3:
  6126. if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
  6127. return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
  6128. }
  6129. break;
  6130. case -3:
  6131. if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
  6132. return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
  6133. }
  6134. break;
  6135. case 4:
  6136. if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
  6137. return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
  6138. }
  6139. break;
  6140. case -4:
  6141. if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
  6142. return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
  6143. }
  6144. break;
  6145. }
  6146. }
  6147. #endif
  6148. return PyLong_AsSsize_t(b);
  6149. }
  6150. x = PyNumber_Index(b);
  6151. if (!x) return -1;
  6152. ival = PyInt_AsSsize_t(x);
  6153. Py_DECREF(x);
  6154. return ival;
  6155. }
  6156. static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) {
  6157. if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) {
  6158. return __Pyx_PyIndex_AsSsize_t(o);
  6159. #if PY_MAJOR_VERSION < 3
  6160. } else if (likely(PyInt_CheckExact(o))) {
  6161. return PyInt_AS_LONG(o);
  6162. #endif
  6163. } else {
  6164. Py_ssize_t ival;
  6165. PyObject *x;
  6166. x = PyNumber_Index(o);
  6167. if (!x) return -1;
  6168. ival = PyInt_AsLong(x);
  6169. Py_DECREF(x);
  6170. return ival;
  6171. }
  6172. }
  6173. static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
  6174. return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
  6175. }
  6176. static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
  6177. return PyInt_FromSize_t(ival);
  6178. }
  6179. #endif /* Py_PYTHON_H */