ppport.h 171 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063
  1. #if 0
  2. <<'SKIP';
  3. #endif
  4. /*
  5. ----------------------------------------------------------------------
  6. ppport.h -- Perl/Pollution/Portability Version 3.19
  7. Automatically created by Devel::PPPort running under perl 5.010000.
  8. Do NOT edit this file directly! -- Edit PPPort_pm.PL and the
  9. includes in parts/inc/ instead.
  10. Use 'perldoc ppport.h' to view the documentation below.
  11. ----------------------------------------------------------------------
  12. SKIP
  13. =pod
  14. =head1 NAME
  15. ppport.h - Perl/Pollution/Portability version 3.19
  16. =head1 SYNOPSIS
  17. perl ppport.h [options] [source files]
  18. Searches current directory for files if no [source files] are given
  19. --help show short help
  20. --version show version
  21. --patch=file write one patch file with changes
  22. --copy=suffix write changed copies with suffix
  23. --diff=program use diff program and options
  24. --compat-version=version provide compatibility with Perl version
  25. --cplusplus accept C++ comments
  26. --quiet don't output anything except fatal errors
  27. --nodiag don't show diagnostics
  28. --nohints don't show hints
  29. --nochanges don't suggest changes
  30. --nofilter don't filter input files
  31. --strip strip all script and doc functionality from
  32. ppport.h
  33. --list-provided list provided API
  34. --list-unsupported list unsupported API
  35. --api-info=name show Perl API portability information
  36. =head1 COMPATIBILITY
  37. This version of F<ppport.h> is designed to support operation with Perl
  38. installations back to 5.003, and has been tested up to 5.10.0.
  39. =head1 OPTIONS
  40. =head2 --help
  41. Display a brief usage summary.
  42. =head2 --version
  43. Display the version of F<ppport.h>.
  44. =head2 --patch=I<file>
  45. If this option is given, a single patch file will be created if
  46. any changes are suggested. This requires a working diff program
  47. to be installed on your system.
  48. =head2 --copy=I<suffix>
  49. If this option is given, a copy of each file will be saved with
  50. the given suffix that contains the suggested changes. This does
  51. not require any external programs. Note that this does not
  52. automagially add a dot between the original filename and the
  53. suffix. If you want the dot, you have to include it in the option
  54. argument.
  55. If neither C<--patch> or C<--copy> are given, the default is to
  56. simply print the diffs for each file. This requires either
  57. C<Text::Diff> or a C<diff> program to be installed.
  58. =head2 --diff=I<program>
  59. Manually set the diff program and options to use. The default
  60. is to use C<Text::Diff>, when installed, and output unified
  61. context diffs.
  62. =head2 --compat-version=I<version>
  63. Tell F<ppport.h> to check for compatibility with the given
  64. Perl version. The default is to check for compatibility with Perl
  65. version 5.003. You can use this option to reduce the output
  66. of F<ppport.h> if you intend to be backward compatible only
  67. down to a certain Perl version.
  68. =head2 --cplusplus
  69. Usually, F<ppport.h> will detect C++ style comments and
  70. replace them with C style comments for portability reasons.
  71. Using this option instructs F<ppport.h> to leave C++
  72. comments untouched.
  73. =head2 --quiet
  74. Be quiet. Don't print anything except fatal errors.
  75. =head2 --nodiag
  76. Don't output any diagnostic messages. Only portability
  77. alerts will be printed.
  78. =head2 --nohints
  79. Don't output any hints. Hints often contain useful portability
  80. notes. Warnings will still be displayed.
  81. =head2 --nochanges
  82. Don't suggest any changes. Only give diagnostic output and hints
  83. unless these are also deactivated.
  84. =head2 --nofilter
  85. Don't filter the list of input files. By default, files not looking
  86. like source code (i.e. not *.xs, *.c, *.cc, *.cpp or *.h) are skipped.
  87. =head2 --strip
  88. Strip all script and documentation functionality from F<ppport.h>.
  89. This reduces the size of F<ppport.h> dramatically and may be useful
  90. if you want to include F<ppport.h> in smaller modules without
  91. increasing their distribution size too much.
  92. The stripped F<ppport.h> will have a C<--unstrip> option that allows
  93. you to undo the stripping, but only if an appropriate C<Devel::PPPort>
  94. module is installed.
  95. =head2 --list-provided
  96. Lists the API elements for which compatibility is provided by
  97. F<ppport.h>. Also lists if it must be explicitly requested,
  98. if it has dependencies, and if there are hints or warnings for it.
  99. =head2 --list-unsupported
  100. Lists the API elements that are known not to be supported by
  101. F<ppport.h> and below which version of Perl they probably
  102. won't be available or work.
  103. =head2 --api-info=I<name>
  104. Show portability information for API elements matching I<name>.
  105. If I<name> is surrounded by slashes, it is interpreted as a regular
  106. expression.
  107. =head1 DESCRIPTION
  108. In order for a Perl extension (XS) module to be as portable as possible
  109. across differing versions of Perl itself, certain steps need to be taken.
  110. =over 4
  111. =item *
  112. Including this header is the first major one. This alone will give you
  113. access to a large part of the Perl API that hasn't been available in
  114. earlier Perl releases. Use
  115. perl ppport.h --list-provided
  116. to see which API elements are provided by ppport.h.
  117. =item *
  118. You should avoid using deprecated parts of the API. For example, using
  119. global Perl variables without the C<PL_> prefix is deprecated. Also,
  120. some API functions used to have a C<perl_> prefix. Using this form is
  121. also deprecated. You can safely use the supported API, as F<ppport.h>
  122. will provide wrappers for older Perl versions.
  123. =item *
  124. If you use one of a few functions or variables that were not present in
  125. earlier versions of Perl, and that can't be provided using a macro, you
  126. have to explicitly request support for these functions by adding one or
  127. more C<#define>s in your source code before the inclusion of F<ppport.h>.
  128. These functions or variables will be marked C<explicit> in the list shown
  129. by C<--list-provided>.
  130. Depending on whether you module has a single or multiple files that
  131. use such functions or variables, you want either C<static> or global
  132. variants.
  133. For a C<static> function or variable (used only in a single source
  134. file), use:
  135. #define NEED_function
  136. #define NEED_variable
  137. For a global function or variable (used in multiple source files),
  138. use:
  139. #define NEED_function_GLOBAL
  140. #define NEED_variable_GLOBAL
  141. Note that you mustn't have more than one global request for the
  142. same function or variable in your project.
  143. Function / Variable Static Request Global Request
  144. -----------------------------------------------------------------------------------------
  145. PL_parser NEED_PL_parser NEED_PL_parser_GLOBAL
  146. PL_signals NEED_PL_signals NEED_PL_signals_GLOBAL
  147. eval_pv() NEED_eval_pv NEED_eval_pv_GLOBAL
  148. grok_bin() NEED_grok_bin NEED_grok_bin_GLOBAL
  149. grok_hex() NEED_grok_hex NEED_grok_hex_GLOBAL
  150. grok_number() NEED_grok_number NEED_grok_number_GLOBAL
  151. grok_numeric_radix() NEED_grok_numeric_radix NEED_grok_numeric_radix_GLOBAL
  152. grok_oct() NEED_grok_oct NEED_grok_oct_GLOBAL
  153. load_module() NEED_load_module NEED_load_module_GLOBAL
  154. my_snprintf() NEED_my_snprintf NEED_my_snprintf_GLOBAL
  155. my_sprintf() NEED_my_sprintf NEED_my_sprintf_GLOBAL
  156. my_strlcat() NEED_my_strlcat NEED_my_strlcat_GLOBAL
  157. my_strlcpy() NEED_my_strlcpy NEED_my_strlcpy_GLOBAL
  158. newCONSTSUB() NEED_newCONSTSUB NEED_newCONSTSUB_GLOBAL
  159. newRV_noinc() NEED_newRV_noinc NEED_newRV_noinc_GLOBAL
  160. newSV_type() NEED_newSV_type NEED_newSV_type_GLOBAL
  161. newSVpvn_flags() NEED_newSVpvn_flags NEED_newSVpvn_flags_GLOBAL
  162. newSVpvn_share() NEED_newSVpvn_share NEED_newSVpvn_share_GLOBAL
  163. pv_display() NEED_pv_display NEED_pv_display_GLOBAL
  164. pv_escape() NEED_pv_escape NEED_pv_escape_GLOBAL
  165. pv_pretty() NEED_pv_pretty NEED_pv_pretty_GLOBAL
  166. sv_2pv_flags() NEED_sv_2pv_flags NEED_sv_2pv_flags_GLOBAL
  167. sv_2pvbyte() NEED_sv_2pvbyte NEED_sv_2pvbyte_GLOBAL
  168. sv_catpvf_mg() NEED_sv_catpvf_mg NEED_sv_catpvf_mg_GLOBAL
  169. sv_catpvf_mg_nocontext() NEED_sv_catpvf_mg_nocontext NEED_sv_catpvf_mg_nocontext_GLOBAL
  170. sv_pvn_force_flags() NEED_sv_pvn_force_flags NEED_sv_pvn_force_flags_GLOBAL
  171. sv_setpvf_mg() NEED_sv_setpvf_mg NEED_sv_setpvf_mg_GLOBAL
  172. sv_setpvf_mg_nocontext() NEED_sv_setpvf_mg_nocontext NEED_sv_setpvf_mg_nocontext_GLOBAL
  173. vload_module() NEED_vload_module NEED_vload_module_GLOBAL
  174. vnewSVpvf() NEED_vnewSVpvf NEED_vnewSVpvf_GLOBAL
  175. warner() NEED_warner NEED_warner_GLOBAL
  176. To avoid namespace conflicts, you can change the namespace of the
  177. explicitly exported functions / variables using the C<DPPP_NAMESPACE>
  178. macro. Just C<#define> the macro before including C<ppport.h>:
  179. #define DPPP_NAMESPACE MyOwnNamespace_
  180. #include "ppport.h"
  181. The default namespace is C<DPPP_>.
  182. =back
  183. The good thing is that most of the above can be checked by running
  184. F<ppport.h> on your source code. See the next section for
  185. details.
  186. =head1 EXAMPLES
  187. To verify whether F<ppport.h> is needed for your module, whether you
  188. should make any changes to your code, and whether any special defines
  189. should be used, F<ppport.h> can be run as a Perl script to check your
  190. source code. Simply say:
  191. perl ppport.h
  192. The result will usually be a list of patches suggesting changes
  193. that should at least be acceptable, if not necessarily the most
  194. efficient solution, or a fix for all possible problems.
  195. If you know that your XS module uses features only available in
  196. newer Perl releases, if you're aware that it uses C++ comments,
  197. and if you want all suggestions as a single patch file, you could
  198. use something like this:
  199. perl ppport.h --compat-version=5.6.0 --cplusplus --patch=test.diff
  200. If you only want your code to be scanned without any suggestions
  201. for changes, use:
  202. perl ppport.h --nochanges
  203. You can specify a different C<diff> program or options, using
  204. the C<--diff> option:
  205. perl ppport.h --diff='diff -C 10'
  206. This would output context diffs with 10 lines of context.
  207. If you want to create patched copies of your files instead, use:
  208. perl ppport.h --copy=.new
  209. To display portability information for the C<newSVpvn> function,
  210. use:
  211. perl ppport.h --api-info=newSVpvn
  212. Since the argument to C<--api-info> can be a regular expression,
  213. you can use
  214. perl ppport.h --api-info=/_nomg$/
  215. to display portability information for all C<_nomg> functions or
  216. perl ppport.h --api-info=/./
  217. to display information for all known API elements.
  218. =head1 BUGS
  219. If this version of F<ppport.h> is causing failure during
  220. the compilation of this module, please check if newer versions
  221. of either this module or C<Devel::PPPort> are available on CPAN
  222. before sending a bug report.
  223. If F<ppport.h> was generated using the latest version of
  224. C<Devel::PPPort> and is causing failure of this module, please
  225. file a bug report using the CPAN Request Tracker at L<http://rt.cpan.org/>.
  226. Please include the following information:
  227. =over 4
  228. =item 1.
  229. The complete output from running "perl -V"
  230. =item 2.
  231. This file.
  232. =item 3.
  233. The name and version of the module you were trying to build.
  234. =item 4.
  235. A full log of the build that failed.
  236. =item 5.
  237. Any other information that you think could be relevant.
  238. =back
  239. For the latest version of this code, please get the C<Devel::PPPort>
  240. module from CPAN.
  241. =head1 COPYRIGHT
  242. Version 3.x, Copyright (c) 2004-2009, Marcus Holland-Moritz.
  243. Version 2.x, Copyright (C) 2001, Paul Marquess.
  244. Version 1.x, Copyright (C) 1999, Kenneth Albanowski.
  245. This program is free software; you can redistribute it and/or
  246. modify it under the same terms as Perl itself.
  247. =head1 SEE ALSO
  248. See L<Devel::PPPort>.
  249. =cut
  250. use strict;
  251. # Disable broken TRIE-optimization
  252. BEGIN { eval '${^RE_TRIE_MAXBUF} = -1' if $] >= 5.009004 && $] <= 5.009005 }
  253. my $VERSION = 3.19;
  254. my %opt = (
  255. quiet => 0,
  256. diag => 1,
  257. hints => 1,
  258. changes => 1,
  259. cplusplus => 0,
  260. filter => 1,
  261. strip => 0,
  262. version => 0,
  263. );
  264. my($ppport) = $0 =~ /([\w.]+)$/;
  265. my $LF = '(?:\r\n|[\r\n])'; # line feed
  266. my $HS = "[ \t]"; # horizontal whitespace
  267. # Never use C comments in this file!
  268. my $ccs = '/'.'*';
  269. my $cce = '*'.'/';
  270. my $rccs = quotemeta $ccs;
  271. my $rcce = quotemeta $cce;
  272. eval {
  273. require Getopt::Long;
  274. Getopt::Long::GetOptions(\%opt, qw(
  275. help quiet diag! filter! hints! changes! cplusplus strip version
  276. patch=s copy=s diff=s compat-version=s
  277. list-provided list-unsupported api-info=s
  278. )) or usage();
  279. };
  280. if ($@ and grep /^-/, @ARGV) {
  281. usage() if "@ARGV" =~ /^--?h(?:elp)?$/;
  282. die "Getopt::Long not found. Please don't use any options.\n";
  283. }
  284. if ($opt{version}) {
  285. print "This is $0 $VERSION.\n";
  286. exit 0;
  287. }
  288. usage() if $opt{help};
  289. strip() if $opt{strip};
  290. if (exists $opt{'compat-version'}) {
  291. my($r,$v,$s) = eval { parse_version($opt{'compat-version'}) };
  292. if ($@) {
  293. die "Invalid version number format: '$opt{'compat-version'}'\n";
  294. }
  295. die "Only Perl 5 is supported\n" if $r != 5;
  296. die "Invalid version number: $opt{'compat-version'}\n" if $v >= 1000 || $s >= 1000;
  297. $opt{'compat-version'} = sprintf "%d.%03d%03d", $r, $v, $s;
  298. }
  299. else {
  300. $opt{'compat-version'} = 5;
  301. }
  302. my %API = map { /^(\w+)\|([^|]*)\|([^|]*)\|(\w*)$/
  303. ? ( $1 => {
  304. ($2 ? ( base => $2 ) : ()),
  305. ($3 ? ( todo => $3 ) : ()),
  306. (index($4, 'v') >= 0 ? ( varargs => 1 ) : ()),
  307. (index($4, 'p') >= 0 ? ( provided => 1 ) : ()),
  308. (index($4, 'n') >= 0 ? ( nothxarg => 1 ) : ()),
  309. } )
  310. : die "invalid spec: $_" } qw(
  311. AvFILLp|5.004050||p
  312. AvFILL|||
  313. CLASS|||n
  314. CPERLscope|5.005000||p
  315. CX_CURPAD_SAVE|||
  316. CX_CURPAD_SV|||
  317. CopFILEAV|5.006000||p
  318. CopFILEGV_set|5.006000||p
  319. CopFILEGV|5.006000||p
  320. CopFILESV|5.006000||p
  321. CopFILE_set|5.006000||p
  322. CopFILE|5.006000||p
  323. CopSTASHPV_set|5.006000||p
  324. CopSTASHPV|5.006000||p
  325. CopSTASH_eq|5.006000||p
  326. CopSTASH_set|5.006000||p
  327. CopSTASH|5.006000||p
  328. CopyD|5.009002||p
  329. Copy|||
  330. CvPADLIST|||
  331. CvSTASH|||
  332. CvWEAKOUTSIDE|||
  333. DEFSV_set|5.011000||p
  334. DEFSV|5.004050||p
  335. END_EXTERN_C|5.005000||p
  336. ENTER|||
  337. ERRSV|5.004050||p
  338. EXTEND|||
  339. EXTERN_C|5.005000||p
  340. F0convert|||n
  341. FREETMPS|||
  342. GIMME_V||5.004000|n
  343. GIMME|||n
  344. GROK_NUMERIC_RADIX|5.007002||p
  345. G_ARRAY|||
  346. G_DISCARD|||
  347. G_EVAL|||
  348. G_METHOD|5.006001||p
  349. G_NOARGS|||
  350. G_SCALAR|||
  351. G_VOID||5.004000|
  352. GetVars|||
  353. GvSVn|5.009003||p
  354. GvSV|||
  355. Gv_AMupdate|||
  356. HEf_SVKEY||5.004000|
  357. HeHASH||5.004000|
  358. HeKEY||5.004000|
  359. HeKLEN||5.004000|
  360. HePV||5.004000|
  361. HeSVKEY_force||5.004000|
  362. HeSVKEY_set||5.004000|
  363. HeSVKEY||5.004000|
  364. HeUTF8||5.011000|
  365. HeVAL||5.004000|
  366. HvNAMELEN_get|5.009003||p
  367. HvNAME_get|5.009003||p
  368. HvNAME|||
  369. INT2PTR|5.006000||p
  370. IN_LOCALE_COMPILETIME|5.007002||p
  371. IN_LOCALE_RUNTIME|5.007002||p
  372. IN_LOCALE|5.007002||p
  373. IN_PERL_COMPILETIME|5.008001||p
  374. IS_NUMBER_GREATER_THAN_UV_MAX|5.007002||p
  375. IS_NUMBER_INFINITY|5.007002||p
  376. IS_NUMBER_IN_UV|5.007002||p
  377. IS_NUMBER_NAN|5.007003||p
  378. IS_NUMBER_NEG|5.007002||p
  379. IS_NUMBER_NOT_INT|5.007002||p
  380. IVSIZE|5.006000||p
  381. IVTYPE|5.006000||p
  382. IVdf|5.006000||p
  383. LEAVE|||
  384. LVRET|||
  385. MARK|||
  386. MULTICALL||5.011000|
  387. MY_CXT_CLONE|5.009002||p
  388. MY_CXT_INIT|5.007003||p
  389. MY_CXT|5.007003||p
  390. MoveD|5.009002||p
  391. Move|||
  392. NOOP|5.005000||p
  393. NUM2PTR|5.006000||p
  394. NVTYPE|5.006000||p
  395. NVef|5.006001||p
  396. NVff|5.006001||p
  397. NVgf|5.006001||p
  398. Newxc|5.009003||p
  399. Newxz|5.009003||p
  400. Newx|5.009003||p
  401. Nullav|||
  402. Nullch|||
  403. Nullcv|||
  404. Nullhv|||
  405. Nullsv|||
  406. ORIGMARK|||
  407. PAD_BASE_SV|||
  408. PAD_CLONE_VARS|||
  409. PAD_COMPNAME_FLAGS|||
  410. PAD_COMPNAME_GEN_set|||
  411. PAD_COMPNAME_GEN|||
  412. PAD_COMPNAME_OURSTASH|||
  413. PAD_COMPNAME_PV|||
  414. PAD_COMPNAME_TYPE|||
  415. PAD_DUP|||
  416. PAD_RESTORE_LOCAL|||
  417. PAD_SAVE_LOCAL|||
  418. PAD_SAVE_SETNULLPAD|||
  419. PAD_SETSV|||
  420. PAD_SET_CUR_NOSAVE|||
  421. PAD_SET_CUR|||
  422. PAD_SVl|||
  423. PAD_SV|||
  424. PERLIO_FUNCS_CAST|5.009003||p
  425. PERLIO_FUNCS_DECL|5.009003||p
  426. PERL_ABS|5.008001||p
  427. PERL_BCDVERSION|5.011000||p
  428. PERL_GCC_BRACE_GROUPS_FORBIDDEN|5.008001||p
  429. PERL_HASH|5.004000||p
  430. PERL_INT_MAX|5.004000||p
  431. PERL_INT_MIN|5.004000||p
  432. PERL_LONG_MAX|5.004000||p
  433. PERL_LONG_MIN|5.004000||p
  434. PERL_MAGIC_arylen|5.007002||p
  435. PERL_MAGIC_backref|5.007002||p
  436. PERL_MAGIC_bm|5.007002||p
  437. PERL_MAGIC_collxfrm|5.007002||p
  438. PERL_MAGIC_dbfile|5.007002||p
  439. PERL_MAGIC_dbline|5.007002||p
  440. PERL_MAGIC_defelem|5.007002||p
  441. PERL_MAGIC_envelem|5.007002||p
  442. PERL_MAGIC_env|5.007002||p
  443. PERL_MAGIC_ext|5.007002||p
  444. PERL_MAGIC_fm|5.007002||p
  445. PERL_MAGIC_glob|5.011000||p
  446. PERL_MAGIC_isaelem|5.007002||p
  447. PERL_MAGIC_isa|5.007002||p
  448. PERL_MAGIC_mutex|5.011000||p
  449. PERL_MAGIC_nkeys|5.007002||p
  450. PERL_MAGIC_overload_elem|5.007002||p
  451. PERL_MAGIC_overload_table|5.007002||p
  452. PERL_MAGIC_overload|5.007002||p
  453. PERL_MAGIC_pos|5.007002||p
  454. PERL_MAGIC_qr|5.007002||p
  455. PERL_MAGIC_regdata|5.007002||p
  456. PERL_MAGIC_regdatum|5.007002||p
  457. PERL_MAGIC_regex_global|5.007002||p
  458. PERL_MAGIC_shared_scalar|5.007003||p
  459. PERL_MAGIC_shared|5.007003||p
  460. PERL_MAGIC_sigelem|5.007002||p
  461. PERL_MAGIC_sig|5.007002||p
  462. PERL_MAGIC_substr|5.007002||p
  463. PERL_MAGIC_sv|5.007002||p
  464. PERL_MAGIC_taint|5.007002||p
  465. PERL_MAGIC_tiedelem|5.007002||p
  466. PERL_MAGIC_tiedscalar|5.007002||p
  467. PERL_MAGIC_tied|5.007002||p
  468. PERL_MAGIC_utf8|5.008001||p
  469. PERL_MAGIC_uvar_elem|5.007003||p
  470. PERL_MAGIC_uvar|5.007002||p
  471. PERL_MAGIC_vec|5.007002||p
  472. PERL_MAGIC_vstring|5.008001||p
  473. PERL_PV_ESCAPE_ALL|5.009004||p
  474. PERL_PV_ESCAPE_FIRSTCHAR|5.009004||p
  475. PERL_PV_ESCAPE_NOBACKSLASH|5.009004||p
  476. PERL_PV_ESCAPE_NOCLEAR|5.009004||p
  477. PERL_PV_ESCAPE_QUOTE|5.009004||p
  478. PERL_PV_ESCAPE_RE|5.009005||p
  479. PERL_PV_ESCAPE_UNI_DETECT|5.009004||p
  480. PERL_PV_ESCAPE_UNI|5.009004||p
  481. PERL_PV_PRETTY_DUMP|5.009004||p
  482. PERL_PV_PRETTY_ELLIPSES|5.010000||p
  483. PERL_PV_PRETTY_LTGT|5.009004||p
  484. PERL_PV_PRETTY_NOCLEAR|5.010000||p
  485. PERL_PV_PRETTY_QUOTE|5.009004||p
  486. PERL_PV_PRETTY_REGPROP|5.009004||p
  487. PERL_QUAD_MAX|5.004000||p
  488. PERL_QUAD_MIN|5.004000||p
  489. PERL_REVISION|5.006000||p
  490. PERL_SCAN_ALLOW_UNDERSCORES|5.007003||p
  491. PERL_SCAN_DISALLOW_PREFIX|5.007003||p
  492. PERL_SCAN_GREATER_THAN_UV_MAX|5.007003||p
  493. PERL_SCAN_SILENT_ILLDIGIT|5.008001||p
  494. PERL_SHORT_MAX|5.004000||p
  495. PERL_SHORT_MIN|5.004000||p
  496. PERL_SIGNALS_UNSAFE_FLAG|5.008001||p
  497. PERL_SUBVERSION|5.006000||p
  498. PERL_SYS_INIT3||5.006000|
  499. PERL_SYS_INIT|||
  500. PERL_SYS_TERM||5.011000|
  501. PERL_UCHAR_MAX|5.004000||p
  502. PERL_UCHAR_MIN|5.004000||p
  503. PERL_UINT_MAX|5.004000||p
  504. PERL_UINT_MIN|5.004000||p
  505. PERL_ULONG_MAX|5.004000||p
  506. PERL_ULONG_MIN|5.004000||p
  507. PERL_UNUSED_ARG|5.009003||p
  508. PERL_UNUSED_CONTEXT|5.009004||p
  509. PERL_UNUSED_DECL|5.007002||p
  510. PERL_UNUSED_VAR|5.007002||p
  511. PERL_UQUAD_MAX|5.004000||p
  512. PERL_UQUAD_MIN|5.004000||p
  513. PERL_USE_GCC_BRACE_GROUPS|5.009004||p
  514. PERL_USHORT_MAX|5.004000||p
  515. PERL_USHORT_MIN|5.004000||p
  516. PERL_VERSION|5.006000||p
  517. PL_DBsignal|5.005000||p
  518. PL_DBsingle|||pn
  519. PL_DBsub|||pn
  520. PL_DBtrace|||pn
  521. PL_Sv|5.005000||p
  522. PL_bufend|5.011000||p
  523. PL_bufptr|5.011000||p
  524. PL_compiling|5.004050||p
  525. PL_copline|5.011000||p
  526. PL_curcop|5.004050||p
  527. PL_curstash|5.004050||p
  528. PL_debstash|5.004050||p
  529. PL_defgv|5.004050||p
  530. PL_diehook|5.004050||p
  531. PL_dirty|5.004050||p
  532. PL_dowarn|||pn
  533. PL_errgv|5.004050||p
  534. PL_error_count|5.011000||p
  535. PL_expect|5.011000||p
  536. PL_hexdigit|5.005000||p
  537. PL_hints|5.005000||p
  538. PL_in_my_stash|5.011000||p
  539. PL_in_my|5.011000||p
  540. PL_last_in_gv|||n
  541. PL_laststatval|5.005000||p
  542. PL_lex_state|5.011000||p
  543. PL_lex_stuff|5.011000||p
  544. PL_linestr|5.011000||p
  545. PL_modglobal||5.005000|n
  546. PL_na|5.004050||pn
  547. PL_no_modify|5.006000||p
  548. PL_ofsgv|||n
  549. PL_parser|5.009005||p
  550. PL_perl_destruct_level|5.004050||p
  551. PL_perldb|5.004050||p
  552. PL_ppaddr|5.006000||p
  553. PL_rsfp_filters|5.004050||p
  554. PL_rsfp|5.004050||p
  555. PL_rs|||n
  556. PL_signals|5.008001||p
  557. PL_stack_base|5.004050||p
  558. PL_stack_sp|5.004050||p
  559. PL_statcache|5.005000||p
  560. PL_stdingv|5.004050||p
  561. PL_sv_arenaroot|5.004050||p
  562. PL_sv_no|5.004050||pn
  563. PL_sv_undef|5.004050||pn
  564. PL_sv_yes|5.004050||pn
  565. PL_tainted|5.004050||p
  566. PL_tainting|5.004050||p
  567. PL_tokenbuf|5.011000||p
  568. POP_MULTICALL||5.011000|
  569. POPi|||n
  570. POPl|||n
  571. POPn|||n
  572. POPpbytex||5.007001|n
  573. POPpx||5.005030|n
  574. POPp|||n
  575. POPs|||n
  576. PTR2IV|5.006000||p
  577. PTR2NV|5.006000||p
  578. PTR2UV|5.006000||p
  579. PTR2nat|5.009003||p
  580. PTR2ul|5.007001||p
  581. PTRV|5.006000||p
  582. PUSHMARK|||
  583. PUSH_MULTICALL||5.011000|
  584. PUSHi|||
  585. PUSHmortal|5.009002||p
  586. PUSHn|||
  587. PUSHp|||
  588. PUSHs|||
  589. PUSHu|5.004000||p
  590. PUTBACK|||
  591. PerlIO_clearerr||5.007003|
  592. PerlIO_close||5.007003|
  593. PerlIO_context_layers||5.009004|
  594. PerlIO_eof||5.007003|
  595. PerlIO_error||5.007003|
  596. PerlIO_fileno||5.007003|
  597. PerlIO_fill||5.007003|
  598. PerlIO_flush||5.007003|
  599. PerlIO_get_base||5.007003|
  600. PerlIO_get_bufsiz||5.007003|
  601. PerlIO_get_cnt||5.007003|
  602. PerlIO_get_ptr||5.007003|
  603. PerlIO_read||5.007003|
  604. PerlIO_seek||5.007003|
  605. PerlIO_set_cnt||5.007003|
  606. PerlIO_set_ptrcnt||5.007003|
  607. PerlIO_setlinebuf||5.007003|
  608. PerlIO_stderr||5.007003|
  609. PerlIO_stdin||5.007003|
  610. PerlIO_stdout||5.007003|
  611. PerlIO_tell||5.007003|
  612. PerlIO_unread||5.007003|
  613. PerlIO_write||5.007003|
  614. Perl_signbit||5.009005|n
  615. PoisonFree|5.009004||p
  616. PoisonNew|5.009004||p
  617. PoisonWith|5.009004||p
  618. Poison|5.008000||p
  619. RETVAL|||n
  620. Renewc|||
  621. Renew|||
  622. SAVECLEARSV|||
  623. SAVECOMPPAD|||
  624. SAVEPADSV|||
  625. SAVETMPS|||
  626. SAVE_DEFSV|5.004050||p
  627. SPAGAIN|||
  628. SP|||
  629. START_EXTERN_C|5.005000||p
  630. START_MY_CXT|5.007003||p
  631. STMT_END|||p
  632. STMT_START|||p
  633. STR_WITH_LEN|5.009003||p
  634. ST|||
  635. SV_CONST_RETURN|5.009003||p
  636. SV_COW_DROP_PV|5.008001||p
  637. SV_COW_SHARED_HASH_KEYS|5.009005||p
  638. SV_GMAGIC|5.007002||p
  639. SV_HAS_TRAILING_NUL|5.009004||p
  640. SV_IMMEDIATE_UNREF|5.007001||p
  641. SV_MUTABLE_RETURN|5.009003||p
  642. SV_NOSTEAL|5.009002||p
  643. SV_SMAGIC|5.009003||p
  644. SV_UTF8_NO_ENCODING|5.008001||p
  645. SVfARG|5.009005||p
  646. SVf_UTF8|5.006000||p
  647. SVf|5.006000||p
  648. SVt_IV|||
  649. SVt_NV|||
  650. SVt_PVAV|||
  651. SVt_PVCV|||
  652. SVt_PVHV|||
  653. SVt_PVMG|||
  654. SVt_PV|||
  655. Safefree|||
  656. Slab_Alloc|||
  657. Slab_Free|||
  658. Slab_to_rw|||
  659. StructCopy|||
  660. SvCUR_set|||
  661. SvCUR|||
  662. SvEND|||
  663. SvGAMAGIC||5.006001|
  664. SvGETMAGIC|5.004050||p
  665. SvGROW|||
  666. SvIOK_UV||5.006000|
  667. SvIOK_notUV||5.006000|
  668. SvIOK_off|||
  669. SvIOK_only_UV||5.006000|
  670. SvIOK_only|||
  671. SvIOK_on|||
  672. SvIOKp|||
  673. SvIOK|||
  674. SvIVX|||
  675. SvIV_nomg|5.009001||p
  676. SvIV_set|||
  677. SvIVx|||
  678. SvIV|||
  679. SvIsCOW_shared_hash||5.008003|
  680. SvIsCOW||5.008003|
  681. SvLEN_set|||
  682. SvLEN|||
  683. SvLOCK||5.007003|
  684. SvMAGIC_set|5.009003||p
  685. SvNIOK_off|||
  686. SvNIOKp|||
  687. SvNIOK|||
  688. SvNOK_off|||
  689. SvNOK_only|||
  690. SvNOK_on|||
  691. SvNOKp|||
  692. SvNOK|||
  693. SvNVX|||
  694. SvNV_set|||
  695. SvNVx|||
  696. SvNV|||
  697. SvOK|||
  698. SvOOK_offset||5.011000|
  699. SvOOK|||
  700. SvPOK_off|||
  701. SvPOK_only_UTF8||5.006000|
  702. SvPOK_only|||
  703. SvPOK_on|||
  704. SvPOKp|||
  705. SvPOK|||
  706. SvPVX_const|5.009003||p
  707. SvPVX_mutable|5.009003||p
  708. SvPVX|||
  709. SvPV_const|5.009003||p
  710. SvPV_flags_const_nolen|5.009003||p
  711. SvPV_flags_const|5.009003||p
  712. SvPV_flags_mutable|5.009003||p
  713. SvPV_flags|5.007002||p
  714. SvPV_force_flags_mutable|5.009003||p
  715. SvPV_force_flags_nolen|5.009003||p
  716. SvPV_force_flags|5.007002||p
  717. SvPV_force_mutable|5.009003||p
  718. SvPV_force_nolen|5.009003||p
  719. SvPV_force_nomg_nolen|5.009003||p
  720. SvPV_force_nomg|5.007002||p
  721. SvPV_force|||p
  722. SvPV_mutable|5.009003||p
  723. SvPV_nolen_const|5.009003||p
  724. SvPV_nolen|5.006000||p
  725. SvPV_nomg_const_nolen|5.009003||p
  726. SvPV_nomg_const|5.009003||p
  727. SvPV_nomg|5.007002||p
  728. SvPV_renew|5.009003||p
  729. SvPV_set|||
  730. SvPVbyte_force||5.009002|
  731. SvPVbyte_nolen||5.006000|
  732. SvPVbytex_force||5.006000|
  733. SvPVbytex||5.006000|
  734. SvPVbyte|5.006000||p
  735. SvPVutf8_force||5.006000|
  736. SvPVutf8_nolen||5.006000|
  737. SvPVutf8x_force||5.006000|
  738. SvPVutf8x||5.006000|
  739. SvPVutf8||5.006000|
  740. SvPVx|||
  741. SvPV|||
  742. SvREFCNT_dec|||
  743. SvREFCNT_inc_NN|5.009004||p
  744. SvREFCNT_inc_simple_NN|5.009004||p
  745. SvREFCNT_inc_simple_void_NN|5.009004||p
  746. SvREFCNT_inc_simple_void|5.009004||p
  747. SvREFCNT_inc_simple|5.009004||p
  748. SvREFCNT_inc_void_NN|5.009004||p
  749. SvREFCNT_inc_void|5.009004||p
  750. SvREFCNT_inc|||p
  751. SvREFCNT|||
  752. SvROK_off|||
  753. SvROK_on|||
  754. SvROK|||
  755. SvRV_set|5.009003||p
  756. SvRV|||
  757. SvRXOK||5.009005|
  758. SvRX||5.009005|
  759. SvSETMAGIC|||
  760. SvSHARED_HASH|5.009003||p
  761. SvSHARE||5.007003|
  762. SvSTASH_set|5.009003||p
  763. SvSTASH|||
  764. SvSetMagicSV_nosteal||5.004000|
  765. SvSetMagicSV||5.004000|
  766. SvSetSV_nosteal||5.004000|
  767. SvSetSV|||
  768. SvTAINTED_off||5.004000|
  769. SvTAINTED_on||5.004000|
  770. SvTAINTED||5.004000|
  771. SvTAINT|||
  772. SvTRUE|||
  773. SvTYPE|||
  774. SvUNLOCK||5.007003|
  775. SvUOK|5.007001|5.006000|p
  776. SvUPGRADE|||
  777. SvUTF8_off||5.006000|
  778. SvUTF8_on||5.006000|
  779. SvUTF8||5.006000|
  780. SvUVXx|5.004000||p
  781. SvUVX|5.004000||p
  782. SvUV_nomg|5.009001||p
  783. SvUV_set|5.009003||p
  784. SvUVx|5.004000||p
  785. SvUV|5.004000||p
  786. SvVOK||5.008001|
  787. SvVSTRING_mg|5.009004||p
  788. THIS|||n
  789. UNDERBAR|5.009002||p
  790. UTF8_MAXBYTES|5.009002||p
  791. UVSIZE|5.006000||p
  792. UVTYPE|5.006000||p
  793. UVXf|5.007001||p
  794. UVof|5.006000||p
  795. UVuf|5.006000||p
  796. UVxf|5.006000||p
  797. WARN_ALL|5.006000||p
  798. WARN_AMBIGUOUS|5.006000||p
  799. WARN_ASSERTIONS|5.011000||p
  800. WARN_BAREWORD|5.006000||p
  801. WARN_CLOSED|5.006000||p
  802. WARN_CLOSURE|5.006000||p
  803. WARN_DEBUGGING|5.006000||p
  804. WARN_DEPRECATED|5.006000||p
  805. WARN_DIGIT|5.006000||p
  806. WARN_EXEC|5.006000||p
  807. WARN_EXITING|5.006000||p
  808. WARN_GLOB|5.006000||p
  809. WARN_INPLACE|5.006000||p
  810. WARN_INTERNAL|5.006000||p
  811. WARN_IO|5.006000||p
  812. WARN_LAYER|5.008000||p
  813. WARN_MALLOC|5.006000||p
  814. WARN_MISC|5.006000||p
  815. WARN_NEWLINE|5.006000||p
  816. WARN_NUMERIC|5.006000||p
  817. WARN_ONCE|5.006000||p
  818. WARN_OVERFLOW|5.006000||p
  819. WARN_PACK|5.006000||p
  820. WARN_PARENTHESIS|5.006000||p
  821. WARN_PIPE|5.006000||p
  822. WARN_PORTABLE|5.006000||p
  823. WARN_PRECEDENCE|5.006000||p
  824. WARN_PRINTF|5.006000||p
  825. WARN_PROTOTYPE|5.006000||p
  826. WARN_QW|5.006000||p
  827. WARN_RECURSION|5.006000||p
  828. WARN_REDEFINE|5.006000||p
  829. WARN_REGEXP|5.006000||p
  830. WARN_RESERVED|5.006000||p
  831. WARN_SEMICOLON|5.006000||p
  832. WARN_SEVERE|5.006000||p
  833. WARN_SIGNAL|5.006000||p
  834. WARN_SUBSTR|5.006000||p
  835. WARN_SYNTAX|5.006000||p
  836. WARN_TAINT|5.006000||p
  837. WARN_THREADS|5.008000||p
  838. WARN_UNINITIALIZED|5.006000||p
  839. WARN_UNOPENED|5.006000||p
  840. WARN_UNPACK|5.006000||p
  841. WARN_UNTIE|5.006000||p
  842. WARN_UTF8|5.006000||p
  843. WARN_VOID|5.006000||p
  844. XCPT_CATCH|5.009002||p
  845. XCPT_RETHROW|5.009002||p
  846. XCPT_TRY_END|5.009002||p
  847. XCPT_TRY_START|5.009002||p
  848. XPUSHi|||
  849. XPUSHmortal|5.009002||p
  850. XPUSHn|||
  851. XPUSHp|||
  852. XPUSHs|||
  853. XPUSHu|5.004000||p
  854. XSPROTO|5.010000||p
  855. XSRETURN_EMPTY|||
  856. XSRETURN_IV|||
  857. XSRETURN_NO|||
  858. XSRETURN_NV|||
  859. XSRETURN_PV|||
  860. XSRETURN_UNDEF|||
  861. XSRETURN_UV|5.008001||p
  862. XSRETURN_YES|||
  863. XSRETURN|||p
  864. XST_mIV|||
  865. XST_mNO|||
  866. XST_mNV|||
  867. XST_mPV|||
  868. XST_mUNDEF|||
  869. XST_mUV|5.008001||p
  870. XST_mYES|||
  871. XS_VERSION_BOOTCHECK|||
  872. XS_VERSION|||
  873. XSprePUSH|5.006000||p
  874. XS|||
  875. ZeroD|5.009002||p
  876. Zero|||
  877. _aMY_CXT|5.007003||p
  878. _pMY_CXT|5.007003||p
  879. aMY_CXT_|5.007003||p
  880. aMY_CXT|5.007003||p
  881. aTHXR_|5.011000||p
  882. aTHXR|5.011000||p
  883. aTHX_|5.006000||p
  884. aTHX|5.006000||p
  885. add_data|||n
  886. addmad|||
  887. allocmy|||
  888. amagic_call|||
  889. amagic_cmp_locale|||
  890. amagic_cmp|||
  891. amagic_i_ncmp|||
  892. amagic_ncmp|||
  893. any_dup|||
  894. ao|||
  895. append_elem|||
  896. append_list|||
  897. append_madprops|||
  898. apply_attrs_my|||
  899. apply_attrs_string||5.006001|
  900. apply_attrs|||
  901. apply|||
  902. atfork_lock||5.007003|n
  903. atfork_unlock||5.007003|n
  904. av_arylen_p||5.009003|
  905. av_clear|||
  906. av_create_and_push||5.009005|
  907. av_create_and_unshift_one||5.009005|
  908. av_delete||5.006000|
  909. av_exists||5.006000|
  910. av_extend|||
  911. av_fetch|||
  912. av_fill|||
  913. av_iter_p||5.011000|
  914. av_len|||
  915. av_make|||
  916. av_pop|||
  917. av_push|||
  918. av_reify|||
  919. av_shift|||
  920. av_store|||
  921. av_undef|||
  922. av_unshift|||
  923. ax|||n
  924. bad_type|||
  925. bind_match|||
  926. block_end|||
  927. block_gimme||5.004000|
  928. block_start|||
  929. boolSV|5.004000||p
  930. boot_core_PerlIO|||
  931. boot_core_UNIVERSAL|||
  932. boot_core_mro|||
  933. bytes_from_utf8||5.007001|
  934. bytes_to_uni|||n
  935. bytes_to_utf8||5.006001|
  936. call_argv|5.006000||p
  937. call_atexit||5.006000|
  938. call_list||5.004000|
  939. call_method|5.006000||p
  940. call_pv|5.006000||p
  941. call_sv|5.006000||p
  942. calloc||5.007002|n
  943. cando|||
  944. cast_i32||5.006000|
  945. cast_iv||5.006000|
  946. cast_ulong||5.006000|
  947. cast_uv||5.006000|
  948. check_type_and_open|||
  949. check_uni|||
  950. checkcomma|||
  951. checkposixcc|||
  952. ckWARN|5.006000||p
  953. ck_anoncode|||
  954. ck_bitop|||
  955. ck_concat|||
  956. ck_defined|||
  957. ck_delete|||
  958. ck_die|||
  959. ck_each|||
  960. ck_eof|||
  961. ck_eval|||
  962. ck_exec|||
  963. ck_exists|||
  964. ck_exit|||
  965. ck_ftst|||
  966. ck_fun|||
  967. ck_glob|||
  968. ck_grep|||
  969. ck_index|||
  970. ck_join|||
  971. ck_lfun|||
  972. ck_listiob|||
  973. ck_match|||
  974. ck_method|||
  975. ck_null|||
  976. ck_open|||
  977. ck_readline|||
  978. ck_repeat|||
  979. ck_require|||
  980. ck_return|||
  981. ck_rfun|||
  982. ck_rvconst|||
  983. ck_sassign|||
  984. ck_select|||
  985. ck_shift|||
  986. ck_sort|||
  987. ck_spair|||
  988. ck_split|||
  989. ck_subr|||
  990. ck_substr|||
  991. ck_svconst|||
  992. ck_trunc|||
  993. ck_unpack|||
  994. ckwarn_d||5.009003|
  995. ckwarn||5.009003|
  996. cl_and|||n
  997. cl_anything|||n
  998. cl_init_zero|||n
  999. cl_init|||n
  1000. cl_is_anything|||n
  1001. cl_or|||n
  1002. clear_placeholders|||
  1003. closest_cop|||
  1004. convert|||
  1005. cop_free|||
  1006. cr_textfilter|||
  1007. create_eval_scope|||
  1008. croak_nocontext|||vn
  1009. croak_xs_usage||5.011000|
  1010. croak|||v
  1011. csighandler||5.009003|n
  1012. curmad|||
  1013. custom_op_desc||5.007003|
  1014. custom_op_name||5.007003|
  1015. cv_ckproto_len|||
  1016. cv_clone|||
  1017. cv_const_sv||5.004000|
  1018. cv_dump|||
  1019. cv_undef|||
  1020. cx_dump||5.005000|
  1021. cx_dup|||
  1022. cxinc|||
  1023. dAXMARK|5.009003||p
  1024. dAX|5.007002||p
  1025. dITEMS|5.007002||p
  1026. dMARK|||
  1027. dMULTICALL||5.009003|
  1028. dMY_CXT_SV|5.007003||p
  1029. dMY_CXT|5.007003||p
  1030. dNOOP|5.006000||p
  1031. dORIGMARK|||
  1032. dSP|||
  1033. dTHR|5.004050||p
  1034. dTHXR|5.011000||p
  1035. dTHXa|5.006000||p
  1036. dTHXoa|5.006000||p
  1037. dTHX|5.006000||p
  1038. dUNDERBAR|5.009002||p
  1039. dVAR|5.009003||p
  1040. dXCPT|5.009002||p
  1041. dXSARGS|||
  1042. dXSI32|||
  1043. dXSTARG|5.006000||p
  1044. deb_curcv|||
  1045. deb_nocontext|||vn
  1046. deb_stack_all|||
  1047. deb_stack_n|||
  1048. debop||5.005000|
  1049. debprofdump||5.005000|
  1050. debprof|||
  1051. debstackptrs||5.007003|
  1052. debstack||5.007003|
  1053. debug_start_match|||
  1054. deb||5.007003|v
  1055. del_sv|||
  1056. delete_eval_scope|||
  1057. delimcpy||5.004000|
  1058. deprecate_old|||
  1059. deprecate|||
  1060. despatch_signals||5.007001|
  1061. destroy_matcher|||
  1062. die_nocontext|||vn
  1063. die_where|||
  1064. die|||v
  1065. dirp_dup|||
  1066. div128|||
  1067. djSP|||
  1068. do_aexec5|||
  1069. do_aexec|||
  1070. do_aspawn|||
  1071. do_binmode||5.004050|
  1072. do_chomp|||
  1073. do_chop|||
  1074. do_close|||
  1075. do_dump_pad|||
  1076. do_eof|||
  1077. do_exec3|||
  1078. do_execfree|||
  1079. do_exec|||
  1080. do_gv_dump||5.006000|
  1081. do_gvgv_dump||5.006000|
  1082. do_hv_dump||5.006000|
  1083. do_ipcctl|||
  1084. do_ipcget|||
  1085. do_join|||
  1086. do_kv|||
  1087. do_magic_dump||5.006000|
  1088. do_msgrcv|||
  1089. do_msgsnd|||
  1090. do_oddball|||
  1091. do_op_dump||5.006000|
  1092. do_op_xmldump|||
  1093. do_open9||5.006000|
  1094. do_openn||5.007001|
  1095. do_open||5.004000|
  1096. do_pmop_dump||5.006000|
  1097. do_pmop_xmldump|||
  1098. do_print|||
  1099. do_readline|||
  1100. do_seek|||
  1101. do_semop|||
  1102. do_shmio|||
  1103. do_smartmatch|||
  1104. do_spawn_nowait|||
  1105. do_spawn|||
  1106. do_sprintf|||
  1107. do_sv_dump||5.006000|
  1108. do_sysseek|||
  1109. do_tell|||
  1110. do_trans_complex_utf8|||
  1111. do_trans_complex|||
  1112. do_trans_count_utf8|||
  1113. do_trans_count|||
  1114. do_trans_simple_utf8|||
  1115. do_trans_simple|||
  1116. do_trans|||
  1117. do_vecget|||
  1118. do_vecset|||
  1119. do_vop|||
  1120. docatch|||
  1121. doeval|||
  1122. dofile|||
  1123. dofindlabel|||
  1124. doform|||
  1125. doing_taint||5.008001|n
  1126. dooneliner|||
  1127. doopen_pm|||
  1128. doparseform|||
  1129. dopoptoeval|||
  1130. dopoptogiven|||
  1131. dopoptolabel|||
  1132. dopoptoloop|||
  1133. dopoptosub_at|||
  1134. dopoptowhen|||
  1135. doref||5.009003|
  1136. dounwind|||
  1137. dowantarray|||
  1138. dump_all||5.006000|
  1139. dump_eval||5.006000|
  1140. dump_exec_pos|||
  1141. dump_fds|||
  1142. dump_form||5.006000|
  1143. dump_indent||5.006000|v
  1144. dump_mstats|||
  1145. dump_packsubs||5.006000|
  1146. dump_sub||5.006000|
  1147. dump_sv_child|||
  1148. dump_trie_interim_list|||
  1149. dump_trie_interim_table|||
  1150. dump_trie|||
  1151. dump_vindent||5.006000|
  1152. dumpuntil|||
  1153. dup_attrlist|||
  1154. emulate_cop_io|||
  1155. eval_pv|5.006000||p
  1156. eval_sv|5.006000||p
  1157. exec_failed|||
  1158. expect_number|||
  1159. fbm_compile||5.005000|
  1160. fbm_instr||5.005000|
  1161. feature_is_enabled|||
  1162. fetch_cop_label||5.011000|
  1163. filter_add|||
  1164. filter_del|||
  1165. filter_gets|||
  1166. filter_read|||
  1167. find_and_forget_pmops|||
  1168. find_array_subscript|||
  1169. find_beginning|||
  1170. find_byclass|||
  1171. find_hash_subscript|||
  1172. find_in_my_stash|||
  1173. find_runcv||5.008001|
  1174. find_rundefsvoffset||5.009002|
  1175. find_script|||
  1176. find_uninit_var|||
  1177. first_symbol|||n
  1178. fold_constants|||
  1179. forbid_setid|||
  1180. force_ident|||
  1181. force_list|||
  1182. force_next|||
  1183. force_version|||
  1184. force_word|||
  1185. forget_pmop|||
  1186. form_nocontext|||vn
  1187. form||5.004000|v
  1188. fp_dup|||
  1189. fprintf_nocontext|||vn
  1190. free_global_struct|||
  1191. free_tied_hv_pool|||
  1192. free_tmps|||
  1193. gen_constant_list|||
  1194. get_arena|||
  1195. get_aux_mg|||
  1196. get_av|5.006000||p
  1197. get_context||5.006000|n
  1198. get_cvn_flags||5.009005|
  1199. get_cv|5.006000||p
  1200. get_db_sub|||
  1201. get_debug_opts|||
  1202. get_hash_seed|||
  1203. get_hv|5.006000||p
  1204. get_isa_hash|||
  1205. get_mstats|||
  1206. get_no_modify|||
  1207. get_num|||
  1208. get_op_descs||5.005000|
  1209. get_op_names||5.005000|
  1210. get_opargs|||
  1211. get_ppaddr||5.006000|
  1212. get_re_arg|||
  1213. get_sv|5.006000||p
  1214. get_vtbl||5.005030|
  1215. getcwd_sv||5.007002|
  1216. getenv_len|||
  1217. glob_2number|||
  1218. glob_assign_glob|||
  1219. glob_assign_ref|||
  1220. gp_dup|||
  1221. gp_free|||
  1222. gp_ref|||
  1223. grok_bin|5.007003||p
  1224. grok_hex|5.007003||p
  1225. grok_number|5.007002||p
  1226. grok_numeric_radix|5.007002||p
  1227. grok_oct|5.007003||p
  1228. group_end|||
  1229. gv_AVadd|||
  1230. gv_HVadd|||
  1231. gv_IOadd|||
  1232. gv_SVadd|||
  1233. gv_autoload4||5.004000|
  1234. gv_check|||
  1235. gv_const_sv||5.009003|
  1236. gv_dump||5.006000|
  1237. gv_efullname3||5.004000|
  1238. gv_efullname4||5.006001|
  1239. gv_efullname|||
  1240. gv_ename|||
  1241. gv_fetchfile_flags||5.009005|
  1242. gv_fetchfile|||
  1243. gv_fetchmeth_autoload||5.007003|
  1244. gv_fetchmethod_autoload||5.004000|
  1245. gv_fetchmethod_flags||5.011000|
  1246. gv_fetchmethod|||
  1247. gv_fetchmeth|||
  1248. gv_fetchpvn_flags|5.009002||p
  1249. gv_fetchpvs|5.009004||p
  1250. gv_fetchpv|||
  1251. gv_fetchsv||5.009002|
  1252. gv_fullname3||5.004000|
  1253. gv_fullname4||5.006001|
  1254. gv_fullname|||
  1255. gv_get_super_pkg|||
  1256. gv_handler||5.007001|
  1257. gv_init_sv|||
  1258. gv_init|||
  1259. gv_name_set||5.009004|
  1260. gv_stashpvn|5.004000||p
  1261. gv_stashpvs|5.009003||p
  1262. gv_stashpv|||
  1263. gv_stashsv|||
  1264. he_dup|||
  1265. hek_dup|||
  1266. hfreeentries|||
  1267. hsplit|||
  1268. hv_assert||5.011000|
  1269. hv_auxinit|||n
  1270. hv_backreferences_p|||
  1271. hv_clear_placeholders||5.009001|
  1272. hv_clear|||
  1273. hv_common_key_len||5.010000|
  1274. hv_common||5.010000|
  1275. hv_copy_hints_hv|||
  1276. hv_delayfree_ent||5.004000|
  1277. hv_delete_common|||
  1278. hv_delete_ent||5.004000|
  1279. hv_delete|||
  1280. hv_eiter_p||5.009003|
  1281. hv_eiter_set||5.009003|
  1282. hv_exists_ent||5.004000|
  1283. hv_exists|||
  1284. hv_fetch_ent||5.004000|
  1285. hv_fetchs|5.009003||p
  1286. hv_fetch|||
  1287. hv_free_ent||5.004000|
  1288. hv_iterinit|||
  1289. hv_iterkeysv||5.004000|
  1290. hv_iterkey|||
  1291. hv_iternext_flags||5.008000|
  1292. hv_iternextsv|||
  1293. hv_iternext|||
  1294. hv_iterval|||
  1295. hv_kill_backrefs|||
  1296. hv_ksplit||5.004000|
  1297. hv_magic_check|||n
  1298. hv_magic|||
  1299. hv_name_set||5.009003|
  1300. hv_notallowed|||
  1301. hv_placeholders_get||5.009003|
  1302. hv_placeholders_p||5.009003|
  1303. hv_placeholders_set||5.009003|
  1304. hv_riter_p||5.009003|
  1305. hv_riter_set||5.009003|
  1306. hv_scalar||5.009001|
  1307. hv_store_ent||5.004000|
  1308. hv_store_flags||5.008000|
  1309. hv_stores|5.009004||p
  1310. hv_store|||
  1311. hv_undef|||
  1312. ibcmp_locale||5.004000|
  1313. ibcmp_utf8||5.007003|
  1314. ibcmp|||
  1315. incline|||
  1316. incpush_if_exists|||
  1317. incpush_use_sep|||
  1318. incpush|||
  1319. ingroup|||
  1320. init_argv_symbols|||
  1321. init_debugger|||
  1322. init_global_struct|||
  1323. init_i18nl10n||5.006000|
  1324. init_i18nl14n||5.006000|
  1325. init_ids|||
  1326. init_interp|||
  1327. init_main_stash|||
  1328. init_perllib|||
  1329. init_postdump_symbols|||
  1330. init_predump_symbols|||
  1331. init_stacks||5.005000|
  1332. init_tm||5.007002|
  1333. instr|||
  1334. intro_my|||
  1335. intuit_method|||
  1336. intuit_more|||
  1337. invert|||
  1338. io_close|||
  1339. isALNUMC|5.006000||p
  1340. isALNUM|||
  1341. isALPHA|||
  1342. isASCII|5.006000||p
  1343. isBLANK|5.006001||p
  1344. isCNTRL|5.006000||p
  1345. isDIGIT|||
  1346. isGRAPH|5.006000||p
  1347. isGV_with_GP|5.009004||p
  1348. isLOWER|||
  1349. isPRINT|5.004000||p
  1350. isPSXSPC|5.006001||p
  1351. isPUNCT|5.006000||p
  1352. isSPACE|||
  1353. isUPPER|||
  1354. isXDIGIT|5.006000||p
  1355. is_an_int|||
  1356. is_gv_magical_sv|||
  1357. is_handle_constructor|||n
  1358. is_list_assignment|||
  1359. is_lvalue_sub||5.007001|
  1360. is_uni_alnum_lc||5.006000|
  1361. is_uni_alnumc_lc||5.006000|
  1362. is_uni_alnumc||5.006000|
  1363. is_uni_alnum||5.006000|
  1364. is_uni_alpha_lc||5.006000|
  1365. is_uni_alpha||5.006000|
  1366. is_uni_ascii_lc||5.006000|
  1367. is_uni_ascii||5.006000|
  1368. is_uni_cntrl_lc||5.006000|
  1369. is_uni_cntrl||5.006000|
  1370. is_uni_digit_lc||5.006000|
  1371. is_uni_digit||5.006000|
  1372. is_uni_graph_lc||5.006000|
  1373. is_uni_graph||5.006000|
  1374. is_uni_idfirst_lc||5.006000|
  1375. is_uni_idfirst||5.006000|
  1376. is_uni_lower_lc||5.006000|
  1377. is_uni_lower||5.006000|
  1378. is_uni_print_lc||5.006000|
  1379. is_uni_print||5.006000|
  1380. is_uni_punct_lc||5.006000|
  1381. is_uni_punct||5.006000|
  1382. is_uni_space_lc||5.006000|
  1383. is_uni_space||5.006000|
  1384. is_uni_upper_lc||5.006000|
  1385. is_uni_upper||5.006000|
  1386. is_uni_xdigit_lc||5.006000|
  1387. is_uni_xdigit||5.006000|
  1388. is_utf8_alnumc||5.006000|
  1389. is_utf8_alnum||5.006000|
  1390. is_utf8_alpha||5.006000|
  1391. is_utf8_ascii||5.006000|
  1392. is_utf8_char_slow|||n
  1393. is_utf8_char||5.006000|
  1394. is_utf8_cntrl||5.006000|
  1395. is_utf8_common|||
  1396. is_utf8_digit||5.006000|
  1397. is_utf8_graph||5.006000|
  1398. is_utf8_idcont||5.008000|
  1399. is_utf8_idfirst||5.006000|
  1400. is_utf8_lower||5.006000|
  1401. is_utf8_mark||5.006000|
  1402. is_utf8_print||5.006000|
  1403. is_utf8_punct||5.006000|
  1404. is_utf8_space||5.006000|
  1405. is_utf8_string_loclen||5.009003|
  1406. is_utf8_string_loc||5.008001|
  1407. is_utf8_string||5.006001|
  1408. is_utf8_upper||5.006000|
  1409. is_utf8_xdigit||5.006000|
  1410. isa_lookup|||
  1411. items|||n
  1412. ix|||n
  1413. jmaybe|||
  1414. join_exact|||
  1415. keyword|||
  1416. leave_scope|||
  1417. lex_end|||
  1418. lex_start|||
  1419. linklist|||
  1420. listkids|||
  1421. list|||
  1422. load_module_nocontext|||vn
  1423. load_module|5.006000||pv
  1424. localize|||
  1425. looks_like_bool|||
  1426. looks_like_number|||
  1427. lop|||
  1428. mPUSHi|5.009002||p
  1429. mPUSHn|5.009002||p
  1430. mPUSHp|5.009002||p
  1431. mPUSHs|5.011000||p
  1432. mPUSHu|5.009002||p
  1433. mXPUSHi|5.009002||p
  1434. mXPUSHn|5.009002||p
  1435. mXPUSHp|5.009002||p
  1436. mXPUSHs|5.011000||p
  1437. mXPUSHu|5.009002||p
  1438. mad_free|||
  1439. madlex|||
  1440. madparse|||
  1441. magic_clear_all_env|||
  1442. magic_clearenv|||
  1443. magic_clearhint|||
  1444. magic_clearisa|||
  1445. magic_clearpack|||
  1446. magic_clearsig|||
  1447. magic_dump||5.006000|
  1448. magic_existspack|||
  1449. magic_freearylen_p|||
  1450. magic_freeovrld|||
  1451. magic_getarylen|||
  1452. magic_getdefelem|||
  1453. magic_getnkeys|||
  1454. magic_getpack|||
  1455. magic_getpos|||
  1456. magic_getsig|||
  1457. magic_getsubstr|||
  1458. magic_gettaint|||
  1459. magic_getuvar|||
  1460. magic_getvec|||
  1461. magic_get|||
  1462. magic_killbackrefs|||
  1463. magic_len|||
  1464. magic_methcall|||
  1465. magic_methpack|||
  1466. magic_nextpack|||
  1467. magic_regdata_cnt|||
  1468. magic_regdatum_get|||
  1469. magic_regdatum_set|||
  1470. magic_scalarpack|||
  1471. magic_set_all_env|||
  1472. magic_setamagic|||
  1473. magic_setarylen|||
  1474. magic_setcollxfrm|||
  1475. magic_setdbline|||
  1476. magic_setdefelem|||
  1477. magic_setenv|||
  1478. magic_sethint|||
  1479. magic_setisa|||
  1480. magic_setmglob|||
  1481. magic_setnkeys|||
  1482. magic_setpack|||
  1483. magic_setpos|||
  1484. magic_setregexp|||
  1485. magic_setsig|||
  1486. magic_setsubstr|||
  1487. magic_settaint|||
  1488. magic_setutf8|||
  1489. magic_setuvar|||
  1490. magic_setvec|||
  1491. magic_set|||
  1492. magic_sizepack|||
  1493. magic_wipepack|||
  1494. make_matcher|||
  1495. make_trie_failtable|||
  1496. make_trie|||
  1497. malloc_good_size|||n
  1498. malloced_size|||n
  1499. malloc||5.007002|n
  1500. markstack_grow|||
  1501. matcher_matches_sv|||
  1502. measure_struct|||
  1503. memEQ|5.004000||p
  1504. memNE|5.004000||p
  1505. mem_collxfrm|||
  1506. mem_log_common|||n
  1507. mess_alloc|||
  1508. mess_nocontext|||vn
  1509. mess||5.006000|v
  1510. method_common|||
  1511. mfree||5.007002|n
  1512. mg_clear|||
  1513. mg_copy|||
  1514. mg_dup|||
  1515. mg_find|||
  1516. mg_free|||
  1517. mg_get|||
  1518. mg_length||5.005000|
  1519. mg_localize|||
  1520. mg_magical|||
  1521. mg_set|||
  1522. mg_size||5.005000|
  1523. mini_mktime||5.007002|
  1524. missingterm|||
  1525. mode_from_discipline|||
  1526. modkids|||
  1527. mod|||
  1528. more_bodies|||
  1529. more_sv|||
  1530. moreswitches|||
  1531. mro_get_from_name||5.011000|
  1532. mro_get_linear_isa_dfs|||
  1533. mro_get_linear_isa||5.009005|
  1534. mro_get_private_data||5.011000|
  1535. mro_isa_changed_in|||
  1536. mro_meta_dup|||
  1537. mro_meta_init|||
  1538. mro_method_changed_in||5.009005|
  1539. mro_register||5.011000|
  1540. mro_set_mro||5.011000|
  1541. mro_set_private_data||5.011000|
  1542. mul128|||
  1543. mulexp10|||n
  1544. my_atof2||5.007002|
  1545. my_atof||5.006000|
  1546. my_attrs|||
  1547. my_bcopy|||n
  1548. my_betoh16|||n
  1549. my_betoh32|||n
  1550. my_betoh64|||n
  1551. my_betohi|||n
  1552. my_betohl|||n
  1553. my_betohs|||n
  1554. my_bzero|||n
  1555. my_chsize|||
  1556. my_clearenv|||
  1557. my_cxt_index|||
  1558. my_cxt_init|||
  1559. my_dirfd||5.009005|
  1560. my_exit_jump|||
  1561. my_exit|||
  1562. my_failure_exit||5.004000|
  1563. my_fflush_all||5.006000|
  1564. my_fork||5.007003|n
  1565. my_htobe16|||n
  1566. my_htobe32|||n
  1567. my_htobe64|||n
  1568. my_htobei|||n
  1569. my_htobel|||n
  1570. my_htobes|||n
  1571. my_htole16|||n
  1572. my_htole32|||n
  1573. my_htole64|||n
  1574. my_htolei|||n
  1575. my_htolel|||n
  1576. my_htoles|||n
  1577. my_htonl|||
  1578. my_kid|||
  1579. my_letoh16|||n
  1580. my_letoh32|||n
  1581. my_letoh64|||n
  1582. my_letohi|||n
  1583. my_letohl|||n
  1584. my_letohs|||n
  1585. my_lstat|||
  1586. my_memcmp||5.004000|n
  1587. my_memset|||n
  1588. my_ntohl|||
  1589. my_pclose||5.004000|
  1590. my_popen_list||5.007001|
  1591. my_popen||5.004000|
  1592. my_setenv|||
  1593. my_snprintf|5.009004||pvn
  1594. my_socketpair||5.007003|n
  1595. my_sprintf|5.009003||pvn
  1596. my_stat|||
  1597. my_strftime||5.007002|
  1598. my_strlcat|5.009004||pn
  1599. my_strlcpy|5.009004||pn
  1600. my_swabn|||n
  1601. my_swap|||
  1602. my_unexec|||
  1603. my_vsnprintf||5.009004|n
  1604. need_utf8|||n
  1605. newANONATTRSUB||5.006000|
  1606. newANONHASH|||
  1607. newANONLIST|||
  1608. newANONSUB|||
  1609. newASSIGNOP|||
  1610. newATTRSUB||5.006000|
  1611. newAVREF|||
  1612. newAV|||
  1613. newBINOP|||
  1614. newCONDOP|||
  1615. newCONSTSUB|5.004050||p
  1616. newCVREF|||
  1617. newDEFSVOP|||
  1618. newFORM|||
  1619. newFOROP|||
  1620. newGIVENOP||5.009003|
  1621. newGIVWHENOP|||
  1622. newGP|||
  1623. newGVOP|||
  1624. newGVREF|||
  1625. newGVgen|||
  1626. newHVREF|||
  1627. newHVhv||5.005000|
  1628. newHV|||
  1629. newIO|||
  1630. newLISTOP|||
  1631. newLOGOP|||
  1632. newLOOPEX|||
  1633. newLOOPOP|||
  1634. newMADPROP|||
  1635. newMADsv|||
  1636. newMYSUB|||
  1637. newNULLLIST|||
  1638. newOP|||
  1639. newPADOP|||
  1640. newPMOP|||
  1641. newPROG|||
  1642. newPVOP|||
  1643. newRANGE|||
  1644. newRV_inc|5.004000||p
  1645. newRV_noinc|5.004000||p
  1646. newRV|||
  1647. newSLICEOP|||
  1648. newSTATEOP|||
  1649. newSUB|||
  1650. newSVOP|||
  1651. newSVREF|||
  1652. newSV_type|5.009005||p
  1653. newSVhek||5.009003|
  1654. newSViv|||
  1655. newSVnv|||
  1656. newSVpvf_nocontext|||vn
  1657. newSVpvf||5.004000|v
  1658. newSVpvn_flags|5.011000||p
  1659. newSVpvn_share|5.007001||p
  1660. newSVpvn_utf8|5.011000||p
  1661. newSVpvn|5.004050||p
  1662. newSVpvs_flags|5.011000||p
  1663. newSVpvs_share||5.009003|
  1664. newSVpvs|5.009003||p
  1665. newSVpv|||
  1666. newSVrv|||
  1667. newSVsv|||
  1668. newSVuv|5.006000||p
  1669. newSV|||
  1670. newTOKEN|||
  1671. newUNOP|||
  1672. newWHENOP||5.009003|
  1673. newWHILEOP||5.009003|
  1674. newXS_flags||5.009004|
  1675. newXSproto||5.006000|
  1676. newXS||5.006000|
  1677. new_collate||5.006000|
  1678. new_constant|||
  1679. new_ctype||5.006000|
  1680. new_he|||
  1681. new_logop|||
  1682. new_numeric||5.006000|
  1683. new_stackinfo||5.005000|
  1684. new_version||5.009000|
  1685. new_warnings_bitfield|||
  1686. next_symbol|||
  1687. nextargv|||
  1688. nextchar|||
  1689. ninstr|||
  1690. no_bareword_allowed|||
  1691. no_fh_allowed|||
  1692. no_op|||
  1693. not_a_number|||
  1694. nothreadhook||5.008000|
  1695. nuke_stacks|||
  1696. num_overflow|||n
  1697. offer_nice_chunk|||
  1698. oopsAV|||
  1699. oopsHV|||
  1700. op_clear|||
  1701. op_const_sv|||
  1702. op_dump||5.006000|
  1703. op_free|||
  1704. op_getmad_weak|||
  1705. op_getmad|||
  1706. op_null||5.007002|
  1707. op_refcnt_dec|||
  1708. op_refcnt_inc|||
  1709. op_refcnt_lock||5.009002|
  1710. op_refcnt_unlock||5.009002|
  1711. op_xmldump|||
  1712. open_script|||
  1713. pMY_CXT_|5.007003||p
  1714. pMY_CXT|5.007003||p
  1715. pTHX_|5.006000||p
  1716. pTHX|5.006000||p
  1717. packWARN|5.007003||p
  1718. pack_cat||5.007003|
  1719. pack_rec|||
  1720. package|||
  1721. packlist||5.008001|
  1722. pad_add_anon|||
  1723. pad_add_name|||
  1724. pad_alloc|||
  1725. pad_block_start|||
  1726. pad_check_dup|||
  1727. pad_compname_type|||
  1728. pad_findlex|||
  1729. pad_findmy|||
  1730. pad_fixup_inner_anons|||
  1731. pad_free|||
  1732. pad_leavemy|||
  1733. pad_new|||
  1734. pad_peg|||n
  1735. pad_push|||
  1736. pad_reset|||
  1737. pad_setsv|||
  1738. pad_sv||5.011000|
  1739. pad_swipe|||
  1740. pad_tidy|||
  1741. pad_undef|||
  1742. parse_body|||
  1743. parse_unicode_opts|||
  1744. parser_dup|||
  1745. parser_free|||
  1746. path_is_absolute|||n
  1747. peep|||
  1748. pending_Slabs_to_ro|||
  1749. perl_alloc_using|||n
  1750. perl_alloc|||n
  1751. perl_clone_using|||n
  1752. perl_clone|||n
  1753. perl_construct|||n
  1754. perl_destruct||5.007003|n
  1755. perl_free|||n
  1756. perl_parse||5.006000|n
  1757. perl_run|||n
  1758. pidgone|||
  1759. pm_description|||
  1760. pmflag|||
  1761. pmop_dump||5.006000|
  1762. pmop_xmldump|||
  1763. pmruntime|||
  1764. pmtrans|||
  1765. pop_scope|||
  1766. pregcomp||5.009005|
  1767. pregexec|||
  1768. pregfree2||5.011000|
  1769. pregfree|||
  1770. prepend_elem|||
  1771. prepend_madprops|||
  1772. printbuf|||
  1773. printf_nocontext|||vn
  1774. process_special_blocks|||
  1775. ptr_table_clear||5.009005|
  1776. ptr_table_fetch||5.009005|
  1777. ptr_table_find|||n
  1778. ptr_table_free||5.009005|
  1779. ptr_table_new||5.009005|
  1780. ptr_table_split||5.009005|
  1781. ptr_table_store||5.009005|
  1782. push_scope|||
  1783. put_byte|||
  1784. pv_display|5.006000||p
  1785. pv_escape|5.009004||p
  1786. pv_pretty|5.009004||p
  1787. pv_uni_display||5.007003|
  1788. qerror|||
  1789. qsortsvu|||
  1790. re_compile||5.009005|
  1791. re_croak2|||
  1792. re_dup_guts|||
  1793. re_intuit_start||5.009005|
  1794. re_intuit_string||5.006000|
  1795. readpipe_override|||
  1796. realloc||5.007002|n
  1797. reentrant_free|||
  1798. reentrant_init|||
  1799. reentrant_retry|||vn
  1800. reentrant_size|||
  1801. ref_array_or_hash|||
  1802. refcounted_he_chain_2hv|||
  1803. refcounted_he_fetch|||
  1804. refcounted_he_free|||
  1805. refcounted_he_new_common|||
  1806. refcounted_he_new|||
  1807. refcounted_he_value|||
  1808. refkids|||
  1809. refto|||
  1810. ref||5.011000|
  1811. reg_check_named_buff_matched|||
  1812. reg_named_buff_all||5.009005|
  1813. reg_named_buff_exists||5.009005|
  1814. reg_named_buff_fetch||5.009005|
  1815. reg_named_buff_firstkey||5.009005|
  1816. reg_named_buff_iter|||
  1817. reg_named_buff_nextkey||5.009005|
  1818. reg_named_buff_scalar||5.009005|
  1819. reg_named_buff|||
  1820. reg_namedseq|||
  1821. reg_node|||
  1822. reg_numbered_buff_fetch|||
  1823. reg_numbered_buff_length|||
  1824. reg_numbered_buff_store|||
  1825. reg_qr_package|||
  1826. reg_recode|||
  1827. reg_scan_name|||
  1828. reg_skipcomment|||
  1829. reg_temp_copy|||
  1830. reganode|||
  1831. regatom|||
  1832. regbranch|||
  1833. regclass_swash||5.009004|
  1834. regclass|||
  1835. regcppop|||
  1836. regcppush|||
  1837. regcurly|||n
  1838. regdump_extflags|||
  1839. regdump||5.005000|
  1840. regdupe_internal|||
  1841. regexec_flags||5.005000|
  1842. regfree_internal||5.009005|
  1843. reghop3|||n
  1844. reghop4|||n
  1845. reghopmaybe3|||n
  1846. reginclass|||
  1847. reginitcolors||5.006000|
  1848. reginsert|||
  1849. regmatch|||
  1850. regnext||5.005000|
  1851. regpiece|||
  1852. regpposixcc|||
  1853. regprop|||
  1854. regrepeat|||
  1855. regtail_study|||
  1856. regtail|||
  1857. regtry|||
  1858. reguni|||
  1859. regwhite|||n
  1860. reg|||
  1861. repeatcpy|||
  1862. report_evil_fh|||
  1863. report_uninit|||
  1864. require_pv||5.006000|
  1865. require_tie_mod|||
  1866. restore_magic|||
  1867. rninstr|||
  1868. rsignal_restore|||
  1869. rsignal_save|||
  1870. rsignal_state||5.004000|
  1871. rsignal||5.004000|
  1872. run_body|||
  1873. run_user_filter|||
  1874. runops_debug||5.005000|
  1875. runops_standard||5.005000|
  1876. rvpv_dup|||
  1877. rxres_free|||
  1878. rxres_restore|||
  1879. rxres_save|||
  1880. safesyscalloc||5.006000|n
  1881. safesysfree||5.006000|n
  1882. safesysmalloc||5.006000|n
  1883. safesysrealloc||5.006000|n
  1884. same_dirent|||
  1885. save_I16||5.004000|
  1886. save_I32|||
  1887. save_I8||5.006000|
  1888. save_adelete||5.011000|
  1889. save_aelem||5.004050|
  1890. save_alloc||5.006000|
  1891. save_aptr|||
  1892. save_ary|||
  1893. save_bool||5.008001|
  1894. save_clearsv|||
  1895. save_delete|||
  1896. save_destructor_x||5.006000|
  1897. save_destructor||5.006000|
  1898. save_freeop|||
  1899. save_freepv|||
  1900. save_freesv|||
  1901. save_generic_pvref||5.006001|
  1902. save_generic_svref||5.005030|
  1903. save_gp||5.004000|
  1904. save_hash|||
  1905. save_hek_flags|||n
  1906. save_helem_flags||5.011000|
  1907. save_helem||5.004050|
  1908. save_hints|||
  1909. save_hptr|||
  1910. save_int|||
  1911. save_item|||
  1912. save_iv||5.005000|
  1913. save_lines|||
  1914. save_list|||
  1915. save_long|||
  1916. save_magic|||
  1917. save_mortalizesv||5.007001|
  1918. save_nogv|||
  1919. save_op|||
  1920. save_padsv_and_mortalize||5.011000|
  1921. save_pptr|||
  1922. save_pushi32ptr|||
  1923. save_pushptri32ptr|||
  1924. save_pushptrptr|||
  1925. save_pushptr||5.011000|
  1926. save_re_context||5.006000|
  1927. save_scalar_at|||
  1928. save_scalar|||
  1929. save_set_svflags||5.009000|
  1930. save_shared_pvref||5.007003|
  1931. save_sptr|||
  1932. save_svref|||
  1933. save_vptr||5.006000|
  1934. savepvn|||
  1935. savepvs||5.009003|
  1936. savepv|||
  1937. savesharedpvn||5.009005|
  1938. savesharedpv||5.007003|
  1939. savestack_grow_cnt||5.008001|
  1940. savestack_grow|||
  1941. savesvpv||5.009002|
  1942. sawparens|||
  1943. scalar_mod_type|||n
  1944. scalarboolean|||
  1945. scalarkids|||
  1946. scalarseq|||
  1947. scalarvoid|||
  1948. scalar|||
  1949. scan_bin||5.006000|
  1950. scan_commit|||
  1951. scan_const|||
  1952. scan_formline|||
  1953. scan_heredoc|||
  1954. scan_hex|||
  1955. scan_ident|||
  1956. scan_inputsymbol|||
  1957. scan_num||5.007001|
  1958. scan_oct|||
  1959. scan_pat|||
  1960. scan_str|||
  1961. scan_subst|||
  1962. scan_trans|||
  1963. scan_version||5.009001|
  1964. scan_vstring||5.009005|
  1965. scan_word|||
  1966. scope|||
  1967. screaminstr||5.005000|
  1968. search_const|||
  1969. seed||5.008001|
  1970. sequence_num|||
  1971. sequence_tail|||
  1972. sequence|||
  1973. set_context||5.006000|n
  1974. set_numeric_local||5.006000|
  1975. set_numeric_radix||5.006000|
  1976. set_numeric_standard||5.006000|
  1977. setdefout|||
  1978. share_hek_flags|||
  1979. share_hek||5.004000|
  1980. si_dup|||
  1981. sighandler|||n
  1982. simplify_sort|||
  1983. skipspace0|||
  1984. skipspace1|||
  1985. skipspace2|||
  1986. skipspace|||
  1987. softref2xv|||
  1988. sortcv_stacked|||
  1989. sortcv_xsub|||
  1990. sortcv|||
  1991. sortsv_flags||5.009003|
  1992. sortsv||5.007003|
  1993. space_join_names_mortal|||
  1994. ss_dup|||
  1995. stack_grow|||
  1996. start_force|||
  1997. start_glob|||
  1998. start_subparse||5.004000|
  1999. stashpv_hvname_match||5.011000|
  2000. stdize_locale|||
  2001. store_cop_label|||
  2002. strEQ|||
  2003. strGE|||
  2004. strGT|||
  2005. strLE|||
  2006. strLT|||
  2007. strNE|||
  2008. str_to_version||5.006000|
  2009. strip_return|||
  2010. strnEQ|||
  2011. strnNE|||
  2012. study_chunk|||
  2013. sub_crush_depth|||
  2014. sublex_done|||
  2015. sublex_push|||
  2016. sublex_start|||
  2017. sv_2bool|||
  2018. sv_2cv|||
  2019. sv_2io|||
  2020. sv_2iuv_common|||
  2021. sv_2iuv_non_preserve|||
  2022. sv_2iv_flags||5.009001|
  2023. sv_2iv|||
  2024. sv_2mortal|||
  2025. sv_2num|||
  2026. sv_2nv|||
  2027. sv_2pv_flags|5.007002||p
  2028. sv_2pv_nolen|5.006000||p
  2029. sv_2pvbyte_nolen|5.006000||p
  2030. sv_2pvbyte|5.006000||p
  2031. sv_2pvutf8_nolen||5.006000|
  2032. sv_2pvutf8||5.006000|
  2033. sv_2pv|||
  2034. sv_2uv_flags||5.009001|
  2035. sv_2uv|5.004000||p
  2036. sv_add_arena|||
  2037. sv_add_backref|||
  2038. sv_backoff|||
  2039. sv_bless|||
  2040. sv_cat_decode||5.008001|
  2041. sv_catpv_mg|5.004050||p
  2042. sv_catpvf_mg_nocontext|||pvn
  2043. sv_catpvf_mg|5.006000|5.004000|pv
  2044. sv_catpvf_nocontext|||vn
  2045. sv_catpvf||5.004000|v
  2046. sv_catpvn_flags||5.007002|
  2047. sv_catpvn_mg|5.004050||p
  2048. sv_catpvn_nomg|5.007002||p
  2049. sv_catpvn|||
  2050. sv_catpvs|5.009003||p
  2051. sv_catpv|||
  2052. sv_catsv_flags||5.007002|
  2053. sv_catsv_mg|5.004050||p
  2054. sv_catsv_nomg|5.007002||p
  2055. sv_catsv|||
  2056. sv_catxmlpvn|||
  2057. sv_catxmlsv|||
  2058. sv_chop|||
  2059. sv_clean_all|||
  2060. sv_clean_objs|||
  2061. sv_clear|||
  2062. sv_cmp_locale||5.004000|
  2063. sv_cmp|||
  2064. sv_collxfrm|||
  2065. sv_compile_2op||5.008001|
  2066. sv_copypv||5.007003|
  2067. sv_dec|||
  2068. sv_del_backref|||
  2069. sv_derived_from||5.004000|
  2070. sv_destroyable||5.010000|
  2071. sv_does||5.009004|
  2072. sv_dump|||
  2073. sv_dup_inc_multiple|||
  2074. sv_dup|||
  2075. sv_eq|||
  2076. sv_exp_grow|||
  2077. sv_force_normal_flags||5.007001|
  2078. sv_force_normal||5.006000|
  2079. sv_free2|||
  2080. sv_free_arenas|||
  2081. sv_free|||
  2082. sv_gets||5.004000|
  2083. sv_grow|||
  2084. sv_i_ncmp|||
  2085. sv_inc|||
  2086. sv_insert_flags||5.011000|
  2087. sv_insert|||
  2088. sv_isa|||
  2089. sv_isobject|||
  2090. sv_iv||5.005000|
  2091. sv_kill_backrefs|||
  2092. sv_len_utf8||5.006000|
  2093. sv_len|||
  2094. sv_magic_portable|5.011000|5.004000|p
  2095. sv_magicext||5.007003|
  2096. sv_magic|||
  2097. sv_mortalcopy|||
  2098. sv_ncmp|||
  2099. sv_newmortal|||
  2100. sv_newref|||
  2101. sv_nolocking||5.007003|
  2102. sv_nosharing||5.007003|
  2103. sv_nounlocking|||
  2104. sv_nv||5.005000|
  2105. sv_peek||5.005000|
  2106. sv_pos_b2u_midway|||
  2107. sv_pos_b2u||5.006000|
  2108. sv_pos_u2b_cached|||
  2109. sv_pos_u2b_forwards|||n
  2110. sv_pos_u2b_midway|||n
  2111. sv_pos_u2b||5.006000|
  2112. sv_pvbyten_force||5.006000|
  2113. sv_pvbyten||5.006000|
  2114. sv_pvbyte||5.006000|
  2115. sv_pvn_force_flags|5.007002||p
  2116. sv_pvn_force|||
  2117. sv_pvn_nomg|5.007003|5.005000|p
  2118. sv_pvn||5.005000|
  2119. sv_pvutf8n_force||5.006000|
  2120. sv_pvutf8n||5.006000|
  2121. sv_pvutf8||5.006000|
  2122. sv_pv||5.006000|
  2123. sv_recode_to_utf8||5.007003|
  2124. sv_reftype|||
  2125. sv_release_COW|||
  2126. sv_replace|||
  2127. sv_report_used|||
  2128. sv_reset|||
  2129. sv_rvweaken||5.006000|
  2130. sv_setiv_mg|5.004050||p
  2131. sv_setiv|||
  2132. sv_setnv_mg|5.006000||p
  2133. sv_setnv|||
  2134. sv_setpv_mg|5.004050||p
  2135. sv_setpvf_mg_nocontext|||pvn
  2136. sv_setpvf_mg|5.006000|5.004000|pv
  2137. sv_setpvf_nocontext|||vn
  2138. sv_setpvf||5.004000|v
  2139. sv_setpviv_mg||5.008001|
  2140. sv_setpviv||5.008001|
  2141. sv_setpvn_mg|5.004050||p
  2142. sv_setpvn|||
  2143. sv_setpvs|5.009004||p
  2144. sv_setpv|||
  2145. sv_setref_iv|||
  2146. sv_setref_nv|||
  2147. sv_setref_pvn|||
  2148. sv_setref_pv|||
  2149. sv_setref_uv||5.007001|
  2150. sv_setsv_cow|||
  2151. sv_setsv_flags||5.007002|
  2152. sv_setsv_mg|5.004050||p
  2153. sv_setsv_nomg|5.007002||p
  2154. sv_setsv|||
  2155. sv_setuv_mg|5.004050||p
  2156. sv_setuv|5.004000||p
  2157. sv_tainted||5.004000|
  2158. sv_taint||5.004000|
  2159. sv_true||5.005000|
  2160. sv_unglob|||
  2161. sv_uni_display||5.007003|
  2162. sv_unmagic|||
  2163. sv_unref_flags||5.007001|
  2164. sv_unref|||
  2165. sv_untaint||5.004000|
  2166. sv_upgrade|||
  2167. sv_usepvn_flags||5.009004|
  2168. sv_usepvn_mg|5.004050||p
  2169. sv_usepvn|||
  2170. sv_utf8_decode||5.006000|
  2171. sv_utf8_downgrade||5.006000|
  2172. sv_utf8_encode||5.006000|
  2173. sv_utf8_upgrade_flags_grow||5.011000|
  2174. sv_utf8_upgrade_flags||5.007002|
  2175. sv_utf8_upgrade_nomg||5.007002|
  2176. sv_utf8_upgrade||5.007001|
  2177. sv_uv|5.005000||p
  2178. sv_vcatpvf_mg|5.006000|5.004000|p
  2179. sv_vcatpvfn||5.004000|
  2180. sv_vcatpvf|5.006000|5.004000|p
  2181. sv_vsetpvf_mg|5.006000|5.004000|p
  2182. sv_vsetpvfn||5.004000|
  2183. sv_vsetpvf|5.006000|5.004000|p
  2184. sv_xmlpeek|||
  2185. svtype|||
  2186. swallow_bom|||
  2187. swap_match_buff|||
  2188. swash_fetch||5.007002|
  2189. swash_get|||
  2190. swash_init||5.006000|
  2191. sys_init3||5.010000|n
  2192. sys_init||5.010000|n
  2193. sys_intern_clear|||
  2194. sys_intern_dup|||
  2195. sys_intern_init|||
  2196. sys_term||5.010000|n
  2197. taint_env|||
  2198. taint_proper|||
  2199. tmps_grow||5.006000|
  2200. toLOWER|||
  2201. toUPPER|||
  2202. to_byte_substr|||
  2203. to_uni_fold||5.007003|
  2204. to_uni_lower_lc||5.006000|
  2205. to_uni_lower||5.007003|
  2206. to_uni_title_lc||5.006000|
  2207. to_uni_title||5.007003|
  2208. to_uni_upper_lc||5.006000|
  2209. to_uni_upper||5.007003|
  2210. to_utf8_case||5.007003|
  2211. to_utf8_fold||5.007003|
  2212. to_utf8_lower||5.007003|
  2213. to_utf8_substr|||
  2214. to_utf8_title||5.007003|
  2215. to_utf8_upper||5.007003|
  2216. token_free|||
  2217. token_getmad|||
  2218. tokenize_use|||
  2219. tokeq|||
  2220. tokereport|||
  2221. too_few_arguments|||
  2222. too_many_arguments|||
  2223. uiv_2buf|||n
  2224. unlnk|||
  2225. unpack_rec|||
  2226. unpack_str||5.007003|
  2227. unpackstring||5.008001|
  2228. unshare_hek_or_pvn|||
  2229. unshare_hek|||
  2230. unsharepvn||5.004000|
  2231. unwind_handler_stack|||
  2232. update_debugger_info|||
  2233. upg_version||5.009005|
  2234. usage|||
  2235. utf16_to_utf8_reversed||5.006001|
  2236. utf16_to_utf8||5.006001|
  2237. utf8_distance||5.006000|
  2238. utf8_hop||5.006000|
  2239. utf8_length||5.007001|
  2240. utf8_mg_pos_cache_update|||
  2241. utf8_to_bytes||5.006001|
  2242. utf8_to_uvchr||5.007001|
  2243. utf8_to_uvuni||5.007001|
  2244. utf8n_to_uvchr|||
  2245. utf8n_to_uvuni||5.007001|
  2246. utilize|||
  2247. uvchr_to_utf8_flags||5.007003|
  2248. uvchr_to_utf8|||
  2249. uvuni_to_utf8_flags||5.007003|
  2250. uvuni_to_utf8||5.007001|
  2251. validate_suid|||
  2252. varname|||
  2253. vcmp||5.009000|
  2254. vcroak||5.006000|
  2255. vdeb||5.007003|
  2256. vdie_common|||
  2257. vdie_croak_common|||
  2258. vdie|||
  2259. vform||5.006000|
  2260. visit|||
  2261. vivify_defelem|||
  2262. vivify_ref|||
  2263. vload_module|5.006000||p
  2264. vmess||5.006000|
  2265. vnewSVpvf|5.006000|5.004000|p
  2266. vnormal||5.009002|
  2267. vnumify||5.009000|
  2268. vstringify||5.009000|
  2269. vverify||5.009003|
  2270. vwarner||5.006000|
  2271. vwarn||5.006000|
  2272. wait4pid|||
  2273. warn_nocontext|||vn
  2274. warner_nocontext|||vn
  2275. warner|5.006000|5.004000|pv
  2276. warn|||v
  2277. watch|||
  2278. whichsig|||
  2279. write_no_mem|||
  2280. write_to_stderr|||
  2281. xmldump_all|||
  2282. xmldump_attr|||
  2283. xmldump_eval|||
  2284. xmldump_form|||
  2285. xmldump_indent|||v
  2286. xmldump_packsubs|||
  2287. xmldump_sub|||
  2288. xmldump_vindent|||
  2289. yyerror|||
  2290. yylex|||
  2291. yyparse|||
  2292. yywarn|||
  2293. );
  2294. if (exists $opt{'list-unsupported'}) {
  2295. my $f;
  2296. for $f (sort { lc $a cmp lc $b } keys %API) {
  2297. next unless $API{$f}{todo};
  2298. print "$f ", '.'x(40-length($f)), " ", format_version($API{$f}{todo}), "\n";
  2299. }
  2300. exit 0;
  2301. }
  2302. # Scan for possible replacement candidates
  2303. my(%replace, %need, %hints, %warnings, %depends);
  2304. my $replace = 0;
  2305. my($hint, $define, $function);
  2306. sub find_api
  2307. {
  2308. my $code = shift;
  2309. $code =~ s{
  2310. / (?: \*[^*]*\*+(?:[^$ccs][^*]*\*+)* / | /[^\r\n]*)
  2311. | "[^"\\]*(?:\\.[^"\\]*)*"
  2312. | '[^'\\]*(?:\\.[^'\\]*)*' }{}egsx;
  2313. grep { exists $API{$_} } $code =~ /(\w+)/mg;
  2314. }
  2315. while (<DATA>) {
  2316. if ($hint) {
  2317. my $h = $hint->[0] eq 'Hint' ? \%hints : \%warnings;
  2318. if (m{^\s*\*\s(.*?)\s*$}) {
  2319. for (@{$hint->[1]}) {
  2320. $h->{$_} ||= ''; # suppress warning with older perls
  2321. $h->{$_} .= "$1\n";
  2322. }
  2323. }
  2324. else { undef $hint }
  2325. }
  2326. $hint = [$1, [split /,?\s+/, $2]]
  2327. if m{^\s*$rccs\s+(Hint|Warning):\s+(\w+(?:,?\s+\w+)*)\s*$};
  2328. if ($define) {
  2329. if ($define->[1] =~ /\\$/) {
  2330. $define->[1] .= $_;
  2331. }
  2332. else {
  2333. if (exists $API{$define->[0]} && $define->[1] !~ /^DPPP_\(/) {
  2334. my @n = find_api($define->[1]);
  2335. push @{$depends{$define->[0]}}, @n if @n
  2336. }
  2337. undef $define;
  2338. }
  2339. }
  2340. $define = [$1, $2] if m{^\s*#\s*define\s+(\w+)(?:\([^)]*\))?\s+(.*)};
  2341. if ($function) {
  2342. if (/^}/) {
  2343. if (exists $API{$function->[0]}) {
  2344. my @n = find_api($function->[1]);
  2345. push @{$depends{$function->[0]}}, @n if @n
  2346. }
  2347. undef $function;
  2348. }
  2349. else {
  2350. $function->[1] .= $_;
  2351. }
  2352. }
  2353. $function = [$1, ''] if m{^DPPP_\(my_(\w+)\)};
  2354. $replace = $1 if m{^\s*$rccs\s+Replace:\s+(\d+)\s+$rcce\s*$};
  2355. $replace{$2} = $1 if $replace and m{^\s*#\s*define\s+(\w+)(?:\([^)]*\))?\s+(\w+)};
  2356. $replace{$2} = $1 if m{^\s*#\s*define\s+(\w+)(?:\([^)]*\))?\s+(\w+).*$rccs\s+Replace\s+$rcce};
  2357. $replace{$1} = $2 if m{^\s*$rccs\s+Replace (\w+) with (\w+)\s+$rcce\s*$};
  2358. if (m{^\s*$rccs\s+(\w+(\s*,\s*\w+)*)\s+depends\s+on\s+(\w+(\s*,\s*\w+)*)\s+$rcce\s*$}) {
  2359. my @deps = map { s/\s+//g; $_ } split /,/, $3;
  2360. my $d;
  2361. for $d (map { s/\s+//g; $_ } split /,/, $1) {
  2362. push @{$depends{$d}}, @deps;
  2363. }
  2364. }
  2365. $need{$1} = 1 if m{^#if\s+defined\(NEED_(\w+)(?:_GLOBAL)?\)};
  2366. }
  2367. for (values %depends) {
  2368. my %s;
  2369. $_ = [sort grep !$s{$_}++, @$_];
  2370. }
  2371. if (exists $opt{'api-info'}) {
  2372. my $f;
  2373. my $count = 0;
  2374. my $match = $opt{'api-info'} =~ m!^/(.*)/$! ? $1 : "^\Q$opt{'api-info'}\E\$";
  2375. for $f (sort { lc $a cmp lc $b } keys %API) {
  2376. next unless $f =~ /$match/;
  2377. print "\n=== $f ===\n\n";
  2378. my $info = 0;
  2379. if ($API{$f}{base} || $API{$f}{todo}) {
  2380. my $base = format_version($API{$f}{base} || $API{$f}{todo});
  2381. print "Supported at least starting from perl-$base.\n";
  2382. $info++;
  2383. }
  2384. if ($API{$f}{provided}) {
  2385. my $todo = $API{$f}{todo} ? format_version($API{$f}{todo}) : "5.003";
  2386. print "Support by $ppport provided back to perl-$todo.\n";
  2387. print "Support needs to be explicitly requested by NEED_$f.\n" if exists $need{$f};
  2388. print "Depends on: ", join(', ', @{$depends{$f}}), ".\n" if exists $depends{$f};
  2389. print "\n$hints{$f}" if exists $hints{$f};
  2390. print "\nWARNING:\n$warnings{$f}" if exists $warnings{$f};
  2391. $info++;
  2392. }
  2393. print "No portability information available.\n" unless $info;
  2394. $count++;
  2395. }
  2396. $count or print "Found no API matching '$opt{'api-info'}'.";
  2397. print "\n";
  2398. exit 0;
  2399. }
  2400. if (exists $opt{'list-provided'}) {
  2401. my $f;
  2402. for $f (sort { lc $a cmp lc $b } keys %API) {
  2403. next unless $API{$f}{provided};
  2404. my @flags;
  2405. push @flags, 'explicit' if exists $need{$f};
  2406. push @flags, 'depend' if exists $depends{$f};
  2407. push @flags, 'hint' if exists $hints{$f};
  2408. push @flags, 'warning' if exists $warnings{$f};
  2409. my $flags = @flags ? ' ['.join(', ', @flags).']' : '';
  2410. print "$f$flags\n";
  2411. }
  2412. exit 0;
  2413. }
  2414. my @files;
  2415. my @srcext = qw( .xs .c .h .cc .cpp -c.inc -xs.inc );
  2416. my $srcext = join '|', map { quotemeta $_ } @srcext;
  2417. if (@ARGV) {
  2418. my %seen;
  2419. for (@ARGV) {
  2420. if (-e) {
  2421. if (-f) {
  2422. push @files, $_ unless $seen{$_}++;
  2423. }
  2424. else { warn "'$_' is not a file.\n" }
  2425. }
  2426. else {
  2427. my @new = grep { -f } glob $_
  2428. or warn "'$_' does not exist.\n";
  2429. push @files, grep { !$seen{$_}++ } @new;
  2430. }
  2431. }
  2432. }
  2433. else {
  2434. eval {
  2435. require File::Find;
  2436. File::Find::find(sub {
  2437. $File::Find::name =~ /($srcext)$/i
  2438. and push @files, $File::Find::name;
  2439. }, '.');
  2440. };
  2441. if ($@) {
  2442. @files = map { glob "*$_" } @srcext;
  2443. }
  2444. }
  2445. if (!@ARGV || $opt{filter}) {
  2446. my(@in, @out);
  2447. my %xsc = map { /(.*)\.xs$/ ? ("$1.c" => 1, "$1.cc" => 1) : () } @files;
  2448. for (@files) {
  2449. my $out = exists $xsc{$_} || /\b\Q$ppport\E$/i || !/($srcext)$/i;
  2450. push @{ $out ? \@out : \@in }, $_;
  2451. }
  2452. if (@ARGV && @out) {
  2453. warning("Skipping the following files (use --nofilter to avoid this):\n| ", join "\n| ", @out);
  2454. }
  2455. @files = @in;
  2456. }
  2457. die "No input files given!\n" unless @files;
  2458. my(%files, %global, %revreplace);
  2459. %revreplace = reverse %replace;
  2460. my $filename;
  2461. my $patch_opened = 0;
  2462. for $filename (@files) {
  2463. unless (open IN, "<$filename") {
  2464. warn "Unable to read from $filename: $!\n";
  2465. next;
  2466. }
  2467. info("Scanning $filename ...");
  2468. my $c = do { local $/; <IN> };
  2469. close IN;
  2470. my %file = (orig => $c, changes => 0);
  2471. # Temporarily remove C/XS comments and strings from the code
  2472. my @ccom;
  2473. $c =~ s{
  2474. ( ^$HS*\#$HS*include\b[^\r\n]+\b(?:\Q$ppport\E|XSUB\.h)\b[^\r\n]*
  2475. | ^$HS*\#$HS*(?:define|elif|if(?:def)?)\b[^\r\n]* )
  2476. | ( ^$HS*\#[^\r\n]*
  2477. | "[^"\\]*(?:\\.[^"\\]*)*"
  2478. | '[^'\\]*(?:\\.[^'\\]*)*'
  2479. | / (?: \*[^*]*\*+(?:[^$ccs][^*]*\*+)* / | /[^\r\n]* ) )
  2480. }{ defined $2 and push @ccom, $2;
  2481. defined $1 ? $1 : "$ccs$#ccom$cce" }mgsex;
  2482. $file{ccom} = \@ccom;
  2483. $file{code} = $c;
  2484. $file{has_inc_ppport} = $c =~ /^$HS*#$HS*include[^\r\n]+\b\Q$ppport\E\b/m;
  2485. my $func;
  2486. for $func (keys %API) {
  2487. my $match = $func;
  2488. $match .= "|$revreplace{$func}" if exists $revreplace{$func};
  2489. if ($c =~ /\b(?:Perl_)?($match)\b/) {
  2490. $file{uses_replace}{$1}++ if exists $revreplace{$func} && $1 eq $revreplace{$func};
  2491. $file{uses_Perl}{$func}++ if $c =~ /\bPerl_$func\b/;
  2492. if (exists $API{$func}{provided}) {
  2493. $file{uses_provided}{$func}++;
  2494. if (!exists $API{$func}{base} || $API{$func}{base} > $opt{'compat-version'}) {
  2495. $file{uses}{$func}++;
  2496. my @deps = rec_depend($func);
  2497. if (@deps) {
  2498. $file{uses_deps}{$func} = \@deps;
  2499. for (@deps) {
  2500. $file{uses}{$_} = 0 unless exists $file{uses}{$_};
  2501. }
  2502. }
  2503. for ($func, @deps) {
  2504. $file{needs}{$_} = 'static' if exists $need{$_};
  2505. }
  2506. }
  2507. }
  2508. if (exists $API{$func}{todo} && $API{$func}{todo} > $opt{'compat-version'}) {
  2509. if ($c =~ /\b$func\b/) {
  2510. $file{uses_todo}{$func}++;
  2511. }
  2512. }
  2513. }
  2514. }
  2515. while ($c =~ /^$HS*#$HS*define$HS+(NEED_(\w+?)(_GLOBAL)?)\b/mg) {
  2516. if (exists $need{$2}) {
  2517. $file{defined $3 ? 'needed_global' : 'needed_static'}{$2}++;
  2518. }
  2519. else { warning("Possibly wrong #define $1 in $filename") }
  2520. }
  2521. for (qw(uses needs uses_todo needed_global needed_static)) {
  2522. for $func (keys %{$file{$_}}) {
  2523. push @{$global{$_}{$func}}, $filename;
  2524. }
  2525. }
  2526. $files{$filename} = \%file;
  2527. }
  2528. # Globally resolve NEED_'s
  2529. my $need;
  2530. for $need (keys %{$global{needs}}) {
  2531. if (@{$global{needs}{$need}} > 1) {
  2532. my @targets = @{$global{needs}{$need}};
  2533. my @t = grep $files{$_}{needed_global}{$need}, @targets;
  2534. @targets = @t if @t;
  2535. @t = grep /\.xs$/i, @targets;
  2536. @targets = @t if @t;
  2537. my $target = shift @targets;
  2538. $files{$target}{needs}{$need} = 'global';
  2539. for (@{$global{needs}{$need}}) {
  2540. $files{$_}{needs}{$need} = 'extern' if $_ ne $target;
  2541. }
  2542. }
  2543. }
  2544. for $filename (@files) {
  2545. exists $files{$filename} or next;
  2546. info("=== Analyzing $filename ===");
  2547. my %file = %{$files{$filename}};
  2548. my $func;
  2549. my $c = $file{code};
  2550. my $warnings = 0;
  2551. for $func (sort keys %{$file{uses_Perl}}) {
  2552. if ($API{$func}{varargs}) {
  2553. unless ($API{$func}{nothxarg}) {
  2554. my $changes = ($c =~ s{\b(Perl_$func\s*\(\s*)(?!aTHX_?)(\)|[^\s)]*\))}
  2555. { $1 . ($2 eq ')' ? 'aTHX' : 'aTHX_ ') . $2 }ge);
  2556. if ($changes) {
  2557. warning("Doesn't pass interpreter argument aTHX to Perl_$func");
  2558. $file{changes} += $changes;
  2559. }
  2560. }
  2561. }
  2562. else {
  2563. warning("Uses Perl_$func instead of $func");
  2564. $file{changes} += ($c =~ s{\bPerl_$func(\s*)\((\s*aTHX_?)?\s*}
  2565. {$func$1(}g);
  2566. }
  2567. }
  2568. for $func (sort keys %{$file{uses_replace}}) {
  2569. warning("Uses $func instead of $replace{$func}");
  2570. $file{changes} += ($c =~ s/\b$func\b/$replace{$func}/g);
  2571. }
  2572. for $func (sort keys %{$file{uses_provided}}) {
  2573. if ($file{uses}{$func}) {
  2574. if (exists $file{uses_deps}{$func}) {
  2575. diag("Uses $func, which depends on ", join(', ', @{$file{uses_deps}{$func}}));
  2576. }
  2577. else {
  2578. diag("Uses $func");
  2579. }
  2580. }
  2581. $warnings += hint($func);
  2582. }
  2583. unless ($opt{quiet}) {
  2584. for $func (sort keys %{$file{uses_todo}}) {
  2585. print "*** WARNING: Uses $func, which may not be portable below perl ",
  2586. format_version($API{$func}{todo}), ", even with '$ppport'\n";
  2587. $warnings++;
  2588. }
  2589. }
  2590. for $func (sort keys %{$file{needed_static}}) {
  2591. my $message = '';
  2592. if (not exists $file{uses}{$func}) {
  2593. $message = "No need to define NEED_$func if $func is never used";
  2594. }
  2595. elsif (exists $file{needs}{$func} && $file{needs}{$func} ne 'static') {
  2596. $message = "No need to define NEED_$func when already needed globally";
  2597. }
  2598. if ($message) {
  2599. diag($message);
  2600. $file{changes} += ($c =~ s/^$HS*#$HS*define$HS+NEED_$func\b.*$LF//mg);
  2601. }
  2602. }
  2603. for $func (sort keys %{$file{needed_global}}) {
  2604. my $message = '';
  2605. if (not exists $global{uses}{$func}) {
  2606. $message = "No need to define NEED_${func}_GLOBAL if $func is never used";
  2607. }
  2608. elsif (exists $file{needs}{$func}) {
  2609. if ($file{needs}{$func} eq 'extern') {
  2610. $message = "No need to define NEED_${func}_GLOBAL when already needed globally";
  2611. }
  2612. elsif ($file{needs}{$func} eq 'static') {
  2613. $message = "No need to define NEED_${func}_GLOBAL when only used in this file";
  2614. }
  2615. }
  2616. if ($message) {
  2617. diag($message);
  2618. $file{changes} += ($c =~ s/^$HS*#$HS*define$HS+NEED_${func}_GLOBAL\b.*$LF//mg);
  2619. }
  2620. }
  2621. $file{needs_inc_ppport} = keys %{$file{uses}};
  2622. if ($file{needs_inc_ppport}) {
  2623. my $pp = '';
  2624. for $func (sort keys %{$file{needs}}) {
  2625. my $type = $file{needs}{$func};
  2626. next if $type eq 'extern';
  2627. my $suffix = $type eq 'global' ? '_GLOBAL' : '';
  2628. unless (exists $file{"needed_$type"}{$func}) {
  2629. if ($type eq 'global') {
  2630. diag("Files [@{$global{needs}{$func}}] need $func, adding global request");
  2631. }
  2632. else {
  2633. diag("File needs $func, adding static request");
  2634. }
  2635. $pp .= "#define NEED_$func$suffix\n";
  2636. }
  2637. }
  2638. if ($pp && ($c =~ s/^(?=$HS*#$HS*define$HS+NEED_\w+)/$pp/m)) {
  2639. $pp = '';
  2640. $file{changes}++;
  2641. }
  2642. unless ($file{has_inc_ppport}) {
  2643. diag("Needs to include '$ppport'");
  2644. $pp .= qq(#include "$ppport"\n)
  2645. }
  2646. if ($pp) {
  2647. $file{changes} += ($c =~ s/^($HS*#$HS*define$HS+NEED_\w+.*?)^/$1$pp/ms)
  2648. || ($c =~ s/^(?=$HS*#$HS*include.*\Q$ppport\E)/$pp/m)
  2649. || ($c =~ s/^($HS*#$HS*include.*XSUB.*\s*?)^/$1$pp/m)
  2650. || ($c =~ s/^/$pp/);
  2651. }
  2652. }
  2653. else {
  2654. if ($file{has_inc_ppport}) {
  2655. diag("No need to include '$ppport'");
  2656. $file{changes} += ($c =~ s/^$HS*?#$HS*include.*\Q$ppport\E.*?$LF//m);
  2657. }
  2658. }
  2659. # put back in our C comments
  2660. my $ix;
  2661. my $cppc = 0;
  2662. my @ccom = @{$file{ccom}};
  2663. for $ix (0 .. $#ccom) {
  2664. if (!$opt{cplusplus} && $ccom[$ix] =~ s!^//!!) {
  2665. $cppc++;
  2666. $file{changes} += $c =~ s/$rccs$ix$rcce/$ccs$ccom[$ix] $cce/;
  2667. }
  2668. else {
  2669. $c =~ s/$rccs$ix$rcce/$ccom[$ix]/;
  2670. }
  2671. }
  2672. if ($cppc) {
  2673. my $s = $cppc != 1 ? 's' : '';
  2674. warning("Uses $cppc C++ style comment$s, which is not portable");
  2675. }
  2676. my $s = $warnings != 1 ? 's' : '';
  2677. my $warn = $warnings ? " ($warnings warning$s)" : '';
  2678. info("Analysis completed$warn");
  2679. if ($file{changes}) {
  2680. if (exists $opt{copy}) {
  2681. my $newfile = "$filename$opt{copy}";
  2682. if (-e $newfile) {
  2683. error("'$newfile' already exists, refusing to write copy of '$filename'");
  2684. }
  2685. else {
  2686. local *F;
  2687. if (open F, ">$newfile") {
  2688. info("Writing copy of '$filename' with changes to '$newfile'");
  2689. print F $c;
  2690. close F;
  2691. }
  2692. else {
  2693. error("Cannot open '$newfile' for writing: $!");
  2694. }
  2695. }
  2696. }
  2697. elsif (exists $opt{patch} || $opt{changes}) {
  2698. if (exists $opt{patch}) {
  2699. unless ($patch_opened) {
  2700. if (open PATCH, ">$opt{patch}") {
  2701. $patch_opened = 1;
  2702. }
  2703. else {
  2704. error("Cannot open '$opt{patch}' for writing: $!");
  2705. delete $opt{patch};
  2706. $opt{changes} = 1;
  2707. goto fallback;
  2708. }
  2709. }
  2710. mydiff(\*PATCH, $filename, $c);
  2711. }
  2712. else {
  2713. fallback:
  2714. info("Suggested changes:");
  2715. mydiff(\*STDOUT, $filename, $c);
  2716. }
  2717. }
  2718. else {
  2719. my $s = $file{changes} == 1 ? '' : 's';
  2720. info("$file{changes} potentially required change$s detected");
  2721. }
  2722. }
  2723. else {
  2724. info("Looks good");
  2725. }
  2726. }
  2727. close PATCH if $patch_opened;
  2728. exit 0;
  2729. sub try_use { eval "use @_;"; return $@ eq '' }
  2730. sub mydiff
  2731. {
  2732. local *F = shift;
  2733. my($file, $str) = @_;
  2734. my $diff;
  2735. if (exists $opt{diff}) {
  2736. $diff = run_diff($opt{diff}, $file, $str);
  2737. }
  2738. if (!defined $diff and try_use('Text::Diff')) {
  2739. $diff = Text::Diff::diff($file, \$str, { STYLE => 'Unified' });
  2740. $diff = <<HEADER . $diff;
  2741. --- $file
  2742. +++ $file.patched
  2743. HEADER
  2744. }
  2745. if (!defined $diff) {
  2746. $diff = run_diff('diff -u', $file, $str);
  2747. }
  2748. if (!defined $diff) {
  2749. $diff = run_diff('diff', $file, $str);
  2750. }
  2751. if (!defined $diff) {
  2752. error("Cannot generate a diff. Please install Text::Diff or use --copy.");
  2753. return;
  2754. }
  2755. print F $diff;
  2756. }
  2757. sub run_diff
  2758. {
  2759. my($prog, $file, $str) = @_;
  2760. my $tmp = 'dppptemp';
  2761. my $suf = 'aaa';
  2762. my $diff = '';
  2763. local *F;
  2764. while (-e "$tmp.$suf") { $suf++ }
  2765. $tmp = "$tmp.$suf";
  2766. if (open F, ">$tmp") {
  2767. print F $str;
  2768. close F;
  2769. if (open F, "$prog $file $tmp |") {
  2770. while (<F>) {
  2771. s/\Q$tmp\E/$file.patched/;
  2772. $diff .= $_;
  2773. }
  2774. close F;
  2775. unlink $tmp;
  2776. return $diff;
  2777. }
  2778. unlink $tmp;
  2779. }
  2780. else {
  2781. error("Cannot open '$tmp' for writing: $!");
  2782. }
  2783. return undef;
  2784. }
  2785. sub rec_depend
  2786. {
  2787. my($func, $seen) = @_;
  2788. return () unless exists $depends{$func};
  2789. $seen = {%{$seen||{}}};
  2790. return () if $seen->{$func}++;
  2791. my %s;
  2792. grep !$s{$_}++, map { ($_, rec_depend($_, $seen)) } @{$depends{$func}};
  2793. }
  2794. sub parse_version
  2795. {
  2796. my $ver = shift;
  2797. if ($ver =~ /^(\d+)\.(\d+)\.(\d+)$/) {
  2798. return ($1, $2, $3);
  2799. }
  2800. elsif ($ver !~ /^\d+\.[\d_]+$/) {
  2801. die "cannot parse version '$ver'\n";
  2802. }
  2803. $ver =~ s/_//g;
  2804. $ver =~ s/$/000000/;
  2805. my($r,$v,$s) = $ver =~ /(\d+)\.(\d{3})(\d{3})/;
  2806. $v = int $v;
  2807. $s = int $s;
  2808. if ($r < 5 || ($r == 5 && $v < 6)) {
  2809. if ($s % 10) {
  2810. die "cannot parse version '$ver'\n";
  2811. }
  2812. }
  2813. return ($r, $v, $s);
  2814. }
  2815. sub format_version
  2816. {
  2817. my $ver = shift;
  2818. $ver =~ s/$/000000/;
  2819. my($r,$v,$s) = $ver =~ /(\d+)\.(\d{3})(\d{3})/;
  2820. $v = int $v;
  2821. $s = int $s;
  2822. if ($r < 5 || ($r == 5 && $v < 6)) {
  2823. if ($s % 10) {
  2824. die "invalid version '$ver'\n";
  2825. }
  2826. $s /= 10;
  2827. $ver = sprintf "%d.%03d", $r, $v;
  2828. $s > 0 and $ver .= sprintf "_%02d", $s;
  2829. return $ver;
  2830. }
  2831. return sprintf "%d.%d.%d", $r, $v, $s;
  2832. }
  2833. sub info
  2834. {
  2835. $opt{quiet} and return;
  2836. print @_, "\n";
  2837. }
  2838. sub diag
  2839. {
  2840. $opt{quiet} and return;
  2841. $opt{diag} and print @_, "\n";
  2842. }
  2843. sub warning
  2844. {
  2845. $opt{quiet} and return;
  2846. print "*** ", @_, "\n";
  2847. }
  2848. sub error
  2849. {
  2850. print "*** ERROR: ", @_, "\n";
  2851. }
  2852. my %given_hints;
  2853. my %given_warnings;
  2854. sub hint
  2855. {
  2856. $opt{quiet} and return;
  2857. my $func = shift;
  2858. my $rv = 0;
  2859. if (exists $warnings{$func} && !$given_warnings{$func}++) {
  2860. my $warn = $warnings{$func};
  2861. $warn =~ s!^!*** !mg;
  2862. print "*** WARNING: $func\n", $warn;
  2863. $rv++;
  2864. }
  2865. if ($opt{hints} && exists $hints{$func} && !$given_hints{$func}++) {
  2866. my $hint = $hints{$func};
  2867. $hint =~ s/^/ /mg;
  2868. print " --- hint for $func ---\n", $hint;
  2869. }
  2870. $rv;
  2871. }
  2872. sub usage
  2873. {
  2874. my($usage) = do { local(@ARGV,$/)=($0); <> } =~ /^=head\d$HS+SYNOPSIS\s*^(.*?)\s*^=/ms;
  2875. my %M = ( 'I' => '*' );
  2876. $usage =~ s/^\s*perl\s+\S+/$^X $0/;
  2877. $usage =~ s/([A-Z])<([^>]+)>/$M{$1}$2$M{$1}/g;
  2878. print <<ENDUSAGE;
  2879. Usage: $usage
  2880. See perldoc $0 for details.
  2881. ENDUSAGE
  2882. exit 2;
  2883. }
  2884. sub strip
  2885. {
  2886. my $self = do { local(@ARGV,$/)=($0); <> };
  2887. my($copy) = $self =~ /^=head\d\s+COPYRIGHT\s*^(.*?)^=\w+/ms;
  2888. $copy =~ s/^(?=\S+)/ /gms;
  2889. $self =~ s/^$HS+Do NOT edit.*?(?=^-)/$copy/ms;
  2890. $self =~ s/^SKIP.*(?=^__DATA__)/SKIP
  2891. if (\@ARGV && \$ARGV[0] eq '--unstrip') {
  2892. eval { require Devel::PPPort };
  2893. \$@ and die "Cannot require Devel::PPPort, please install.\\n";
  2894. if (eval \$Devel::PPPort::VERSION < $VERSION) {
  2895. die "$0 was originally generated with Devel::PPPort $VERSION.\\n"
  2896. . "Your Devel::PPPort is only version \$Devel::PPPort::VERSION.\\n"
  2897. . "Please install a newer version, or --unstrip will not work.\\n";
  2898. }
  2899. Devel::PPPort::WriteFile(\$0);
  2900. exit 0;
  2901. }
  2902. print <<END;
  2903. Sorry, but this is a stripped version of \$0.
  2904. To be able to use its original script and doc functionality,
  2905. please try to regenerate this file using:
  2906. \$^X \$0 --unstrip
  2907. END
  2908. /ms;
  2909. my($pl, $c) = $self =~ /(.*^__DATA__)(.*)/ms;
  2910. $c =~ s{
  2911. / (?: \*[^*]*\*+(?:[^$ccs][^*]*\*+)* / | /[^\r\n]*)
  2912. | ( "[^"\\]*(?:\\.[^"\\]*)*"
  2913. | '[^'\\]*(?:\\.[^'\\]*)*' )
  2914. | ($HS+) }{ defined $2 ? ' ' : ($1 || '') }gsex;
  2915. $c =~ s!\s+$!!mg;
  2916. $c =~ s!^$LF!!mg;
  2917. $c =~ s!^\s*#\s*!#!mg;
  2918. $c =~ s!^\s+!!mg;
  2919. open OUT, ">$0" or die "cannot strip $0: $!\n";
  2920. print OUT "$pl$c\n";
  2921. exit 0;
  2922. }
  2923. __DATA__
  2924. */
  2925. #ifndef _P_P_PORTABILITY_H_
  2926. #define _P_P_PORTABILITY_H_
  2927. #ifndef DPPP_NAMESPACE
  2928. # define DPPP_NAMESPACE DPPP_
  2929. #endif
  2930. #define DPPP_CAT2(x,y) CAT2(x,y)
  2931. #define DPPP_(name) DPPP_CAT2(DPPP_NAMESPACE, name)
  2932. #ifndef PERL_REVISION
  2933. # if !defined(__PATCHLEVEL_H_INCLUDED__) && !(defined(PATCHLEVEL) && defined(SUBVERSION))
  2934. # define PERL_PATCHLEVEL_H_IMPLICIT
  2935. # include <patchlevel.h>
  2936. # endif
  2937. # if !(defined(PERL_VERSION) || (defined(SUBVERSION) && defined(PATCHLEVEL)))
  2938. # include <could_not_find_Perl_patchlevel.h>
  2939. # endif
  2940. # ifndef PERL_REVISION
  2941. # define PERL_REVISION (5)
  2942. /* Replace: 1 */
  2943. # define PERL_VERSION PATCHLEVEL
  2944. # define PERL_SUBVERSION SUBVERSION
  2945. /* Replace PERL_PATCHLEVEL with PERL_VERSION */
  2946. /* Replace: 0 */
  2947. # endif
  2948. #endif
  2949. #define _dpppDEC2BCD(dec) ((((dec)/100)<<8)|((((dec)%100)/10)<<4)|((dec)%10))
  2950. #define PERL_BCDVERSION ((_dpppDEC2BCD(PERL_REVISION)<<24)|(_dpppDEC2BCD(PERL_VERSION)<<12)|_dpppDEC2BCD(PERL_SUBVERSION))
  2951. /* It is very unlikely that anyone will try to use this with Perl 6
  2952. (or greater), but who knows.
  2953. */
  2954. #if PERL_REVISION != 5
  2955. # error ppport.h only works with Perl version 5
  2956. #endif /* PERL_REVISION != 5 */
  2957. #ifndef dTHR
  2958. # define dTHR dNOOP
  2959. #endif
  2960. #ifndef dTHX
  2961. # define dTHX dNOOP
  2962. #endif
  2963. #ifndef dTHXa
  2964. # define dTHXa(x) dNOOP
  2965. #endif
  2966. #ifndef pTHX
  2967. # define pTHX void
  2968. #endif
  2969. #ifndef pTHX_
  2970. # define pTHX_
  2971. #endif
  2972. #ifndef aTHX
  2973. # define aTHX
  2974. #endif
  2975. #ifndef aTHX_
  2976. # define aTHX_
  2977. #endif
  2978. #if (PERL_BCDVERSION < 0x5006000)
  2979. # ifdef USE_THREADS
  2980. # define aTHXR thr
  2981. # define aTHXR_ thr,
  2982. # else
  2983. # define aTHXR
  2984. # define aTHXR_
  2985. # endif
  2986. # define dTHXR dTHR
  2987. #else
  2988. # define aTHXR aTHX
  2989. # define aTHXR_ aTHX_
  2990. # define dTHXR dTHX
  2991. #endif
  2992. #ifndef dTHXoa
  2993. # define dTHXoa(x) dTHXa(x)
  2994. #endif
  2995. #ifdef I_LIMITS
  2996. # include <limits.h>
  2997. #endif
  2998. #ifndef PERL_UCHAR_MIN
  2999. # define PERL_UCHAR_MIN ((unsigned char)0)
  3000. #endif
  3001. #ifndef PERL_UCHAR_MAX
  3002. # ifdef UCHAR_MAX
  3003. # define PERL_UCHAR_MAX ((unsigned char)UCHAR_MAX)
  3004. # else
  3005. # ifdef MAXUCHAR
  3006. # define PERL_UCHAR_MAX ((unsigned char)MAXUCHAR)
  3007. # else
  3008. # define PERL_UCHAR_MAX ((unsigned char)~(unsigned)0)
  3009. # endif
  3010. # endif
  3011. #endif
  3012. #ifndef PERL_USHORT_MIN
  3013. # define PERL_USHORT_MIN ((unsigned short)0)
  3014. #endif
  3015. #ifndef PERL_USHORT_MAX
  3016. # ifdef USHORT_MAX
  3017. # define PERL_USHORT_MAX ((unsigned short)USHORT_MAX)
  3018. # else
  3019. # ifdef MAXUSHORT
  3020. # define PERL_USHORT_MAX ((unsigned short)MAXUSHORT)
  3021. # else
  3022. # ifdef USHRT_MAX
  3023. # define PERL_USHORT_MAX ((unsigned short)USHRT_MAX)
  3024. # else
  3025. # define PERL_USHORT_MAX ((unsigned short)~(unsigned)0)
  3026. # endif
  3027. # endif
  3028. # endif
  3029. #endif
  3030. #ifndef PERL_SHORT_MAX
  3031. # ifdef SHORT_MAX
  3032. # define PERL_SHORT_MAX ((short)SHORT_MAX)
  3033. # else
  3034. # ifdef MAXSHORT /* Often used in <values.h> */
  3035. # define PERL_SHORT_MAX ((short)MAXSHORT)
  3036. # else
  3037. # ifdef SHRT_MAX
  3038. # define PERL_SHORT_MAX ((short)SHRT_MAX)
  3039. # else
  3040. # define PERL_SHORT_MAX ((short) (PERL_USHORT_MAX >> 1))
  3041. # endif
  3042. # endif
  3043. # endif
  3044. #endif
  3045. #ifndef PERL_SHORT_MIN
  3046. # ifdef SHORT_MIN
  3047. # define PERL_SHORT_MIN ((short)SHORT_MIN)
  3048. # else
  3049. # ifdef MINSHORT
  3050. # define PERL_SHORT_MIN ((short)MINSHORT)
  3051. # else
  3052. # ifdef SHRT_MIN
  3053. # define PERL_SHORT_MIN ((short)SHRT_MIN)
  3054. # else
  3055. # define PERL_SHORT_MIN (-PERL_SHORT_MAX - ((3 & -1) == 3))
  3056. # endif
  3057. # endif
  3058. # endif
  3059. #endif
  3060. #ifndef PERL_UINT_MAX
  3061. # ifdef UINT_MAX
  3062. # define PERL_UINT_MAX ((unsigned int)UINT_MAX)
  3063. # else
  3064. # ifdef MAXUINT
  3065. # define PERL_UINT_MAX ((unsigned int)MAXUINT)
  3066. # else
  3067. # define PERL_UINT_MAX (~(unsigned int)0)
  3068. # endif
  3069. # endif
  3070. #endif
  3071. #ifndef PERL_UINT_MIN
  3072. # define PERL_UINT_MIN ((unsigned int)0)
  3073. #endif
  3074. #ifndef PERL_INT_MAX
  3075. # ifdef INT_MAX
  3076. # define PERL_INT_MAX ((int)INT_MAX)
  3077. # else
  3078. # ifdef MAXINT /* Often used in <values.h> */
  3079. # define PERL_INT_MAX ((int)MAXINT)
  3080. # else
  3081. # define PERL_INT_MAX ((int)(PERL_UINT_MAX >> 1))
  3082. # endif
  3083. # endif
  3084. #endif
  3085. #ifndef PERL_INT_MIN
  3086. # ifdef INT_MIN
  3087. # define PERL_INT_MIN ((int)INT_MIN)
  3088. # else
  3089. # ifdef MININT
  3090. # define PERL_INT_MIN ((int)MININT)
  3091. # else
  3092. # define PERL_INT_MIN (-PERL_INT_MAX - ((3 & -1) == 3))
  3093. # endif
  3094. # endif
  3095. #endif
  3096. #ifndef PERL_ULONG_MAX
  3097. # ifdef ULONG_MAX
  3098. # define PERL_ULONG_MAX ((unsigned long)ULONG_MAX)
  3099. # else
  3100. # ifdef MAXULONG
  3101. # define PERL_ULONG_MAX ((unsigned long)MAXULONG)
  3102. # else
  3103. # define PERL_ULONG_MAX (~(unsigned long)0)
  3104. # endif
  3105. # endif
  3106. #endif
  3107. #ifndef PERL_ULONG_MIN
  3108. # define PERL_ULONG_MIN ((unsigned long)0L)
  3109. #endif
  3110. #ifndef PERL_LONG_MAX
  3111. # ifdef LONG_MAX
  3112. # define PERL_LONG_MAX ((long)LONG_MAX)
  3113. # else
  3114. # ifdef MAXLONG
  3115. # define PERL_LONG_MAX ((long)MAXLONG)
  3116. # else
  3117. # define PERL_LONG_MAX ((long) (PERL_ULONG_MAX >> 1))
  3118. # endif
  3119. # endif
  3120. #endif
  3121. #ifndef PERL_LONG_MIN
  3122. # ifdef LONG_MIN
  3123. # define PERL_LONG_MIN ((long)LONG_MIN)
  3124. # else
  3125. # ifdef MINLONG
  3126. # define PERL_LONG_MIN ((long)MINLONG)
  3127. # else
  3128. # define PERL_LONG_MIN (-PERL_LONG_MAX - ((3 & -1) == 3))
  3129. # endif
  3130. # endif
  3131. #endif
  3132. #if defined(HAS_QUAD) && (defined(convex) || defined(uts))
  3133. # ifndef PERL_UQUAD_MAX
  3134. # ifdef ULONGLONG_MAX
  3135. # define PERL_UQUAD_MAX ((unsigned long long)ULONGLONG_MAX)
  3136. # else
  3137. # ifdef MAXULONGLONG
  3138. # define PERL_UQUAD_MAX ((unsigned long long)MAXULONGLONG)
  3139. # else
  3140. # define PERL_UQUAD_MAX (~(unsigned long long)0)
  3141. # endif
  3142. # endif
  3143. # endif
  3144. # ifndef PERL_UQUAD_MIN
  3145. # define PERL_UQUAD_MIN ((unsigned long long)0L)
  3146. # endif
  3147. # ifndef PERL_QUAD_MAX
  3148. # ifdef LONGLONG_MAX
  3149. # define PERL_QUAD_MAX ((long long)LONGLONG_MAX)
  3150. # else
  3151. # ifdef MAXLONGLONG
  3152. # define PERL_QUAD_MAX ((long long)MAXLONGLONG)
  3153. # else
  3154. # define PERL_QUAD_MAX ((long long) (PERL_UQUAD_MAX >> 1))
  3155. # endif
  3156. # endif
  3157. # endif
  3158. # ifndef PERL_QUAD_MIN
  3159. # ifdef LONGLONG_MIN
  3160. # define PERL_QUAD_MIN ((long long)LONGLONG_MIN)
  3161. # else
  3162. # ifdef MINLONGLONG
  3163. # define PERL_QUAD_MIN ((long long)MINLONGLONG)
  3164. # else
  3165. # define PERL_QUAD_MIN (-PERL_QUAD_MAX - ((3 & -1) == 3))
  3166. # endif
  3167. # endif
  3168. # endif
  3169. #endif
  3170. /* This is based on code from 5.003 perl.h */
  3171. #ifdef HAS_QUAD
  3172. # ifdef cray
  3173. #ifndef IVTYPE
  3174. # define IVTYPE int
  3175. #endif
  3176. #ifndef IV_MIN
  3177. # define IV_MIN PERL_INT_MIN
  3178. #endif
  3179. #ifndef IV_MAX
  3180. # define IV_MAX PERL_INT_MAX
  3181. #endif
  3182. #ifndef UV_MIN
  3183. # define UV_MIN PERL_UINT_MIN
  3184. #endif
  3185. #ifndef UV_MAX
  3186. # define UV_MAX PERL_UINT_MAX
  3187. #endif
  3188. # ifdef INTSIZE
  3189. #ifndef IVSIZE
  3190. # define IVSIZE INTSIZE
  3191. #endif
  3192. # endif
  3193. # else
  3194. # if defined(convex) || defined(uts)
  3195. #ifndef IVTYPE
  3196. # define IVTYPE long long
  3197. #endif
  3198. #ifndef IV_MIN
  3199. # define IV_MIN PERL_QUAD_MIN
  3200. #endif
  3201. #ifndef IV_MAX
  3202. # define IV_MAX PERL_QUAD_MAX
  3203. #endif
  3204. #ifndef UV_MIN
  3205. # define UV_MIN PERL_UQUAD_MIN
  3206. #endif
  3207. #ifndef UV_MAX
  3208. # define UV_MAX PERL_UQUAD_MAX
  3209. #endif
  3210. # ifdef LONGLONGSIZE
  3211. #ifndef IVSIZE
  3212. # define IVSIZE LONGLONGSIZE
  3213. #endif
  3214. # endif
  3215. # else
  3216. #ifndef IVTYPE
  3217. # define IVTYPE long
  3218. #endif
  3219. #ifndef IV_MIN
  3220. # define IV_MIN PERL_LONG_MIN
  3221. #endif
  3222. #ifndef IV_MAX
  3223. # define IV_MAX PERL_LONG_MAX
  3224. #endif
  3225. #ifndef UV_MIN
  3226. # define UV_MIN PERL_ULONG_MIN
  3227. #endif
  3228. #ifndef UV_MAX
  3229. # define UV_MAX PERL_ULONG_MAX
  3230. #endif
  3231. # ifdef LONGSIZE
  3232. #ifndef IVSIZE
  3233. # define IVSIZE LONGSIZE
  3234. #endif
  3235. # endif
  3236. # endif
  3237. # endif
  3238. #ifndef IVSIZE
  3239. # define IVSIZE 8
  3240. #endif
  3241. #ifndef PERL_QUAD_MIN
  3242. # define PERL_QUAD_MIN IV_MIN
  3243. #endif
  3244. #ifndef PERL_QUAD_MAX
  3245. # define PERL_QUAD_MAX IV_MAX
  3246. #endif
  3247. #ifndef PERL_UQUAD_MIN
  3248. # define PERL_UQUAD_MIN UV_MIN
  3249. #endif
  3250. #ifndef PERL_UQUAD_MAX
  3251. # define PERL_UQUAD_MAX UV_MAX
  3252. #endif
  3253. #else
  3254. #ifndef IVTYPE
  3255. # define IVTYPE long
  3256. #endif
  3257. #ifndef IV_MIN
  3258. # define IV_MIN PERL_LONG_MIN
  3259. #endif
  3260. #ifndef IV_MAX
  3261. # define IV_MAX PERL_LONG_MAX
  3262. #endif
  3263. #ifndef UV_MIN
  3264. # define UV_MIN PERL_ULONG_MIN
  3265. #endif
  3266. #ifndef UV_MAX
  3267. # define UV_MAX PERL_ULONG_MAX
  3268. #endif
  3269. #endif
  3270. #ifndef IVSIZE
  3271. # ifdef LONGSIZE
  3272. # define IVSIZE LONGSIZE
  3273. # else
  3274. # define IVSIZE 4 /* A bold guess, but the best we can make. */
  3275. # endif
  3276. #endif
  3277. #ifndef UVTYPE
  3278. # define UVTYPE unsigned IVTYPE
  3279. #endif
  3280. #ifndef UVSIZE
  3281. # define UVSIZE IVSIZE
  3282. #endif
  3283. #ifndef sv_setuv
  3284. # define sv_setuv(sv, uv) \
  3285. STMT_START { \
  3286. UV TeMpUv = uv; \
  3287. if (TeMpUv <= IV_MAX) \
  3288. sv_setiv(sv, TeMpUv); \
  3289. else \
  3290. sv_setnv(sv, (double)TeMpUv); \
  3291. } STMT_END
  3292. #endif
  3293. #ifndef newSVuv
  3294. # define newSVuv(uv) ((uv) <= IV_MAX ? newSViv((IV)uv) : newSVnv((NV)uv))
  3295. #endif
  3296. #ifndef sv_2uv
  3297. # define sv_2uv(sv) ((PL_Sv = (sv)), (UV) (SvNOK(PL_Sv) ? SvNV(PL_Sv) : sv_2nv(PL_Sv)))
  3298. #endif
  3299. #ifndef SvUVX
  3300. # define SvUVX(sv) ((UV)SvIVX(sv))
  3301. #endif
  3302. #ifndef SvUVXx
  3303. # define SvUVXx(sv) SvUVX(sv)
  3304. #endif
  3305. #ifndef SvUV
  3306. # define SvUV(sv) (SvIOK(sv) ? SvUVX(sv) : sv_2uv(sv))
  3307. #endif
  3308. #ifndef SvUVx
  3309. # define SvUVx(sv) ((PL_Sv = (sv)), SvUV(PL_Sv))
  3310. #endif
  3311. /* Hint: sv_uv
  3312. * Always use the SvUVx() macro instead of sv_uv().
  3313. */
  3314. #ifndef sv_uv
  3315. # define sv_uv(sv) SvUVx(sv)
  3316. #endif
  3317. #if !defined(SvUOK) && defined(SvIOK_UV)
  3318. # define SvUOK(sv) SvIOK_UV(sv)
  3319. #endif
  3320. #ifndef XST_mUV
  3321. # define XST_mUV(i,v) (ST(i) = sv_2mortal(newSVuv(v)) )
  3322. #endif
  3323. #ifndef XSRETURN_UV
  3324. # define XSRETURN_UV(v) STMT_START { XST_mUV(0,v); XSRETURN(1); } STMT_END
  3325. #endif
  3326. #ifndef PUSHu
  3327. # define PUSHu(u) STMT_START { sv_setuv(TARG, (UV)(u)); PUSHTARG; } STMT_END
  3328. #endif
  3329. #ifndef XPUSHu
  3330. # define XPUSHu(u) STMT_START { sv_setuv(TARG, (UV)(u)); XPUSHTARG; } STMT_END
  3331. #endif
  3332. #ifdef HAS_MEMCMP
  3333. #ifndef memNE
  3334. # define memNE(s1,s2,l) (memcmp(s1,s2,l))
  3335. #endif
  3336. #ifndef memEQ
  3337. # define memEQ(s1,s2,l) (!memcmp(s1,s2,l))
  3338. #endif
  3339. #else
  3340. #ifndef memNE
  3341. # define memNE(s1,s2,l) (bcmp(s1,s2,l))
  3342. #endif
  3343. #ifndef memEQ
  3344. # define memEQ(s1,s2,l) (!bcmp(s1,s2,l))
  3345. #endif
  3346. #endif
  3347. #ifndef MoveD
  3348. # define MoveD(s,d,n,t) memmove((char*)(d),(char*)(s), (n) * sizeof(t))
  3349. #endif
  3350. #ifndef CopyD
  3351. # define CopyD(s,d,n,t) memcpy((char*)(d),(char*)(s), (n) * sizeof(t))
  3352. #endif
  3353. #ifdef HAS_MEMSET
  3354. #ifndef ZeroD
  3355. # define ZeroD(d,n,t) memzero((char*)(d), (n) * sizeof(t))
  3356. #endif
  3357. #else
  3358. #ifndef ZeroD
  3359. # define ZeroD(d,n,t) ((void)memzero((char*)(d), (n) * sizeof(t)), d)
  3360. #endif
  3361. #endif
  3362. #ifndef PoisonWith
  3363. # define PoisonWith(d,n,t,b) (void)memset((char*)(d), (U8)(b), (n) * sizeof(t))
  3364. #endif
  3365. #ifndef PoisonNew
  3366. # define PoisonNew(d,n,t) PoisonWith(d,n,t,0xAB)
  3367. #endif
  3368. #ifndef PoisonFree
  3369. # define PoisonFree(d,n,t) PoisonWith(d,n,t,0xEF)
  3370. #endif
  3371. #ifndef Poison
  3372. # define Poison(d,n,t) PoisonFree(d,n,t)
  3373. #endif
  3374. #ifndef Newx
  3375. # define Newx(v,n,t) New(0,v,n,t)
  3376. #endif
  3377. #ifndef Newxc
  3378. # define Newxc(v,n,t,c) Newc(0,v,n,t,c)
  3379. #endif
  3380. #ifndef Newxz
  3381. # define Newxz(v,n,t) Newz(0,v,n,t)
  3382. #endif
  3383. #ifndef PERL_UNUSED_DECL
  3384. # ifdef HASATTRIBUTE
  3385. # if (defined(__GNUC__) && defined(__cplusplus)) || defined(__INTEL_COMPILER)
  3386. # define PERL_UNUSED_DECL
  3387. # else
  3388. # define PERL_UNUSED_DECL __attribute__((unused))
  3389. # endif
  3390. # else
  3391. # define PERL_UNUSED_DECL
  3392. # endif
  3393. #endif
  3394. #ifndef PERL_UNUSED_ARG
  3395. # if defined(lint) && defined(S_SPLINT_S) /* www.splint.org */
  3396. # include <note.h>
  3397. # define PERL_UNUSED_ARG(x) NOTE(ARGUNUSED(x))
  3398. # else
  3399. # define PERL_UNUSED_ARG(x) ((void)x)
  3400. # endif
  3401. #endif
  3402. #ifndef PERL_UNUSED_VAR
  3403. # define PERL_UNUSED_VAR(x) ((void)x)
  3404. #endif
  3405. #ifndef PERL_UNUSED_CONTEXT
  3406. # ifdef USE_ITHREADS
  3407. # define PERL_UNUSED_CONTEXT PERL_UNUSED_ARG(my_perl)
  3408. # else
  3409. # define PERL_UNUSED_CONTEXT
  3410. # endif
  3411. #endif
  3412. #ifndef NOOP
  3413. # define NOOP /*EMPTY*/(void)0
  3414. #endif
  3415. #ifndef dNOOP
  3416. # define dNOOP extern int /*@unused@*/ Perl___notused PERL_UNUSED_DECL
  3417. #endif
  3418. #ifndef NVTYPE
  3419. # if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
  3420. # define NVTYPE long double
  3421. # else
  3422. # define NVTYPE double
  3423. # endif
  3424. typedef NVTYPE NV;
  3425. #endif
  3426. #ifndef INT2PTR
  3427. # if (IVSIZE == PTRSIZE) && (UVSIZE == PTRSIZE)
  3428. # define PTRV UV
  3429. # define INT2PTR(any,d) (any)(d)
  3430. # else
  3431. # if PTRSIZE == LONGSIZE
  3432. # define PTRV unsigned long
  3433. # else
  3434. # define PTRV unsigned
  3435. # endif
  3436. # define INT2PTR(any,d) (any)(PTRV)(d)
  3437. # endif
  3438. #endif
  3439. #ifndef PTR2ul
  3440. # if PTRSIZE == LONGSIZE
  3441. # define PTR2ul(p) (unsigned long)(p)
  3442. # else
  3443. # define PTR2ul(p) INT2PTR(unsigned long,p)
  3444. # endif
  3445. #endif
  3446. #ifndef PTR2nat
  3447. # define PTR2nat(p) (PTRV)(p)
  3448. #endif
  3449. #ifndef NUM2PTR
  3450. # define NUM2PTR(any,d) (any)PTR2nat(d)
  3451. #endif
  3452. #ifndef PTR2IV
  3453. # define PTR2IV(p) INT2PTR(IV,p)
  3454. #endif
  3455. #ifndef PTR2UV
  3456. # define PTR2UV(p) INT2PTR(UV,p)
  3457. #endif
  3458. #ifndef PTR2NV
  3459. # define PTR2NV(p) NUM2PTR(NV,p)
  3460. #endif
  3461. #undef START_EXTERN_C
  3462. #undef END_EXTERN_C
  3463. #undef EXTERN_C
  3464. #ifdef __cplusplus
  3465. # define START_EXTERN_C extern "C" {
  3466. # define END_EXTERN_C }
  3467. # define EXTERN_C extern "C"
  3468. #else
  3469. # define START_EXTERN_C
  3470. # define END_EXTERN_C
  3471. # define EXTERN_C extern
  3472. #endif
  3473. #if defined(PERL_GCC_PEDANTIC)
  3474. # ifndef PERL_GCC_BRACE_GROUPS_FORBIDDEN
  3475. # define PERL_GCC_BRACE_GROUPS_FORBIDDEN
  3476. # endif
  3477. #endif
  3478. #if defined(__GNUC__) && !defined(PERL_GCC_BRACE_GROUPS_FORBIDDEN) && !defined(__cplusplus)
  3479. # ifndef PERL_USE_GCC_BRACE_GROUPS
  3480. # define PERL_USE_GCC_BRACE_GROUPS
  3481. # endif
  3482. #endif
  3483. #undef STMT_START
  3484. #undef STMT_END
  3485. #ifdef PERL_USE_GCC_BRACE_GROUPS
  3486. # define STMT_START (void)( /* gcc supports ``({ STATEMENTS; })'' */
  3487. # define STMT_END )
  3488. #else
  3489. # if defined(VOIDFLAGS) && (VOIDFLAGS) && (defined(sun) || defined(__sun__)) && !defined(__GNUC__)
  3490. # define STMT_START if (1)
  3491. # define STMT_END else (void)0
  3492. # else
  3493. # define STMT_START do
  3494. # define STMT_END while (0)
  3495. # endif
  3496. #endif
  3497. #ifndef boolSV
  3498. # define boolSV(b) ((b) ? &PL_sv_yes : &PL_sv_no)
  3499. #endif
  3500. /* DEFSV appears first in 5.004_56 */
  3501. #ifndef DEFSV
  3502. # define DEFSV GvSV(PL_defgv)
  3503. #endif
  3504. #ifndef SAVE_DEFSV
  3505. # define SAVE_DEFSV SAVESPTR(GvSV(PL_defgv))
  3506. #endif
  3507. #ifndef DEFSV_set
  3508. # define DEFSV_set(sv) (DEFSV = (sv))
  3509. #endif
  3510. /* Older perls (<=5.003) lack AvFILLp */
  3511. #ifndef AvFILLp
  3512. # define AvFILLp AvFILL
  3513. #endif
  3514. #ifndef ERRSV
  3515. # define ERRSV get_sv("@",FALSE)
  3516. #endif
  3517. /* Hint: gv_stashpvn
  3518. * This function's backport doesn't support the length parameter, but
  3519. * rather ignores it. Portability can only be ensured if the length
  3520. * parameter is used for speed reasons, but the length can always be
  3521. * correctly computed from the string argument.
  3522. */
  3523. #ifndef gv_stashpvn
  3524. # define gv_stashpvn(str,len,create) gv_stashpv(str,create)
  3525. #endif
  3526. /* Replace: 1 */
  3527. #ifndef get_cv
  3528. # define get_cv perl_get_cv
  3529. #endif
  3530. #ifndef get_sv
  3531. # define get_sv perl_get_sv
  3532. #endif
  3533. #ifndef get_av
  3534. # define get_av perl_get_av
  3535. #endif
  3536. #ifndef get_hv
  3537. # define get_hv perl_get_hv
  3538. #endif
  3539. /* Replace: 0 */
  3540. #ifndef dUNDERBAR
  3541. # define dUNDERBAR dNOOP
  3542. #endif
  3543. #ifndef UNDERBAR
  3544. # define UNDERBAR DEFSV
  3545. #endif
  3546. #ifndef dAX
  3547. # define dAX I32 ax = MARK - PL_stack_base + 1
  3548. #endif
  3549. #ifndef dITEMS
  3550. # define dITEMS I32 items = SP - MARK
  3551. #endif
  3552. #ifndef dXSTARG
  3553. # define dXSTARG SV * targ = sv_newmortal()
  3554. #endif
  3555. #ifndef dAXMARK
  3556. # define dAXMARK I32 ax = POPMARK; \
  3557. register SV ** const mark = PL_stack_base + ax++
  3558. #endif
  3559. #ifndef XSprePUSH
  3560. # define XSprePUSH (sp = PL_stack_base + ax - 1)
  3561. #endif
  3562. #if (PERL_BCDVERSION < 0x5005000)
  3563. # undef XSRETURN
  3564. # define XSRETURN(off) \
  3565. STMT_START { \
  3566. PL_stack_sp = PL_stack_base + ax + ((off) - 1); \
  3567. return; \
  3568. } STMT_END
  3569. #endif
  3570. #ifndef XSPROTO
  3571. # define XSPROTO(name) void name(pTHX_ CV* cv)
  3572. #endif
  3573. #ifndef SVfARG
  3574. # define SVfARG(p) ((void*)(p))
  3575. #endif
  3576. #ifndef PERL_ABS
  3577. # define PERL_ABS(x) ((x) < 0 ? -(x) : (x))
  3578. #endif
  3579. #ifndef dVAR
  3580. # define dVAR dNOOP
  3581. #endif
  3582. #ifndef SVf
  3583. # define SVf "_"
  3584. #endif
  3585. #ifndef UTF8_MAXBYTES
  3586. # define UTF8_MAXBYTES UTF8_MAXLEN
  3587. #endif
  3588. #ifndef CPERLscope
  3589. # define CPERLscope(x) x
  3590. #endif
  3591. #ifndef PERL_HASH
  3592. # define PERL_HASH(hash,str,len) \
  3593. STMT_START { \
  3594. const char *s_PeRlHaSh = str; \
  3595. I32 i_PeRlHaSh = len; \
  3596. U32 hash_PeRlHaSh = 0; \
  3597. while (i_PeRlHaSh--) \
  3598. hash_PeRlHaSh = hash_PeRlHaSh * 33 + *s_PeRlHaSh++; \
  3599. (hash) = hash_PeRlHaSh; \
  3600. } STMT_END
  3601. #endif
  3602. #ifndef PERLIO_FUNCS_DECL
  3603. # ifdef PERLIO_FUNCS_CONST
  3604. # define PERLIO_FUNCS_DECL(funcs) const PerlIO_funcs funcs
  3605. # define PERLIO_FUNCS_CAST(funcs) (PerlIO_funcs*)(funcs)
  3606. # else
  3607. # define PERLIO_FUNCS_DECL(funcs) PerlIO_funcs funcs
  3608. # define PERLIO_FUNCS_CAST(funcs) (funcs)
  3609. # endif
  3610. #endif
  3611. /* provide these typedefs for older perls */
  3612. #if (PERL_BCDVERSION < 0x5009003)
  3613. # ifdef ARGSproto
  3614. typedef OP* (CPERLscope(*Perl_ppaddr_t))(ARGSproto);
  3615. # else
  3616. typedef OP* (CPERLscope(*Perl_ppaddr_t))(pTHX);
  3617. # endif
  3618. typedef OP* (CPERLscope(*Perl_check_t)) (pTHX_ OP*);
  3619. #endif
  3620. #ifndef isPSXSPC
  3621. # define isPSXSPC(c) (isSPACE(c) || (c) == '\v')
  3622. #endif
  3623. #ifndef isBLANK
  3624. # define isBLANK(c) ((c) == ' ' || (c) == '\t')
  3625. #endif
  3626. #ifdef EBCDIC
  3627. #ifndef isALNUMC
  3628. # define isALNUMC(c) isalnum(c)
  3629. #endif
  3630. #ifndef isASCII
  3631. # define isASCII(c) isascii(c)
  3632. #endif
  3633. #ifndef isCNTRL
  3634. # define isCNTRL(c) iscntrl(c)
  3635. #endif
  3636. #ifndef isGRAPH
  3637. # define isGRAPH(c) isgraph(c)
  3638. #endif
  3639. #ifndef isPRINT
  3640. # define isPRINT(c) isprint(c)
  3641. #endif
  3642. #ifndef isPUNCT
  3643. # define isPUNCT(c) ispunct(c)
  3644. #endif
  3645. #ifndef isXDIGIT
  3646. # define isXDIGIT(c) isxdigit(c)
  3647. #endif
  3648. #else
  3649. # if (PERL_BCDVERSION < 0x5010000)
  3650. /* Hint: isPRINT
  3651. * The implementation in older perl versions includes all of the
  3652. * isSPACE() characters, which is wrong. The version provided by
  3653. * Devel::PPPort always overrides a present buggy version.
  3654. */
  3655. # undef isPRINT
  3656. # endif
  3657. #ifndef isALNUMC
  3658. # define isALNUMC(c) (isALPHA(c) || isDIGIT(c))
  3659. #endif
  3660. #ifndef isASCII
  3661. # define isASCII(c) ((c) <= 127)
  3662. #endif
  3663. #ifndef isCNTRL
  3664. # define isCNTRL(c) ((c) < ' ' || (c) == 127)
  3665. #endif
  3666. #ifndef isGRAPH
  3667. # define isGRAPH(c) (isALNUM(c) || isPUNCT(c))
  3668. #endif
  3669. #ifndef isPRINT
  3670. # define isPRINT(c) (((c) >= 32 && (c) < 127))
  3671. #endif
  3672. #ifndef isPUNCT
  3673. # define isPUNCT(c) (((c) >= 33 && (c) <= 47) || ((c) >= 58 && (c) <= 64) || ((c) >= 91 && (c) <= 96) || ((c) >= 123 && (c) <= 126))
  3674. #endif
  3675. #ifndef isXDIGIT
  3676. # define isXDIGIT(c) (isDIGIT(c) || ((c) >= 'a' && (c) <= 'f') || ((c) >= 'A' && (c) <= 'F'))
  3677. #endif
  3678. #endif
  3679. #ifndef PERL_SIGNALS_UNSAFE_FLAG
  3680. #define PERL_SIGNALS_UNSAFE_FLAG 0x0001
  3681. #if (PERL_BCDVERSION < 0x5008000)
  3682. # define D_PPP_PERL_SIGNALS_INIT PERL_SIGNALS_UNSAFE_FLAG
  3683. #else
  3684. # define D_PPP_PERL_SIGNALS_INIT 0
  3685. #endif
  3686. #if defined(NEED_PL_signals)
  3687. static U32 DPPP_(my_PL_signals) = D_PPP_PERL_SIGNALS_INIT;
  3688. #elif defined(NEED_PL_signals_GLOBAL)
  3689. U32 DPPP_(my_PL_signals) = D_PPP_PERL_SIGNALS_INIT;
  3690. #else
  3691. extern U32 DPPP_(my_PL_signals);
  3692. #endif
  3693. #define PL_signals DPPP_(my_PL_signals)
  3694. #endif
  3695. /* Hint: PL_ppaddr
  3696. * Calling an op via PL_ppaddr requires passing a context argument
  3697. * for threaded builds. Since the context argument is different for
  3698. * 5.005 perls, you can use aTHXR (supplied by ppport.h), which will
  3699. * automatically be defined as the correct argument.
  3700. */
  3701. #if (PERL_BCDVERSION <= 0x5005005)
  3702. /* Replace: 1 */
  3703. # define PL_ppaddr ppaddr
  3704. # define PL_no_modify no_modify
  3705. /* Replace: 0 */
  3706. #endif
  3707. #if (PERL_BCDVERSION <= 0x5004005)
  3708. /* Replace: 1 */
  3709. # define PL_DBsignal DBsignal
  3710. # define PL_DBsingle DBsingle
  3711. # define PL_DBsub DBsub
  3712. # define PL_DBtrace DBtrace
  3713. # define PL_Sv Sv
  3714. # define PL_bufend bufend
  3715. # define PL_bufptr bufptr
  3716. # define PL_compiling compiling
  3717. # define PL_copline copline
  3718. # define PL_curcop curcop
  3719. # define PL_curstash curstash
  3720. # define PL_debstash debstash
  3721. # define PL_defgv defgv
  3722. # define PL_diehook diehook
  3723. # define PL_dirty dirty
  3724. # define PL_dowarn dowarn
  3725. # define PL_errgv errgv
  3726. # define PL_error_count error_count
  3727. # define PL_expect expect
  3728. # define PL_hexdigit hexdigit
  3729. # define PL_hints hints
  3730. # define PL_in_my in_my
  3731. # define PL_laststatval laststatval
  3732. # define PL_lex_state lex_state
  3733. # define PL_lex_stuff lex_stuff
  3734. # define PL_linestr linestr
  3735. # define PL_na na
  3736. # define PL_perl_destruct_level perl_destruct_level
  3737. # define PL_perldb perldb
  3738. # define PL_rsfp_filters rsfp_filters
  3739. # define PL_rsfp rsfp
  3740. # define PL_stack_base stack_base
  3741. # define PL_stack_sp stack_sp
  3742. # define PL_statcache statcache
  3743. # define PL_stdingv stdingv
  3744. # define PL_sv_arenaroot sv_arenaroot
  3745. # define PL_sv_no sv_no
  3746. # define PL_sv_undef sv_undef
  3747. # define PL_sv_yes sv_yes
  3748. # define PL_tainted tainted
  3749. # define PL_tainting tainting
  3750. # define PL_tokenbuf tokenbuf
  3751. /* Replace: 0 */
  3752. #endif
  3753. /* Warning: PL_parser
  3754. * For perl versions earlier than 5.9.5, this is an always
  3755. * non-NULL dummy. Also, it cannot be dereferenced. Don't
  3756. * use it if you can avoid is and unless you absolutely know
  3757. * what you're doing.
  3758. * If you always check that PL_parser is non-NULL, you can
  3759. * define DPPP_PL_parser_NO_DUMMY to avoid the creation of
  3760. * a dummy parser structure.
  3761. */
  3762. #if (PERL_BCDVERSION >= 0x5009005)
  3763. # ifdef DPPP_PL_parser_NO_DUMMY
  3764. # define D_PPP_my_PL_parser_var(var) ((PL_parser ? PL_parser : \
  3765. (croak("panic: PL_parser == NULL in %s:%d", \
  3766. __FILE__, __LINE__), (yy_parser *) NULL))->var)
  3767. # else
  3768. # ifdef DPPP_PL_parser_NO_DUMMY_WARNING
  3769. # define D_PPP_parser_dummy_warning(var)
  3770. # else
  3771. # define D_PPP_parser_dummy_warning(var) \
  3772. warn("warning: dummy PL_" #var " used in %s:%d", __FILE__, __LINE__),
  3773. # endif
  3774. # define D_PPP_my_PL_parser_var(var) ((PL_parser ? PL_parser : \
  3775. (D_PPP_parser_dummy_warning(var) &DPPP_(dummy_PL_parser)))->var)
  3776. #if defined(NEED_PL_parser)
  3777. static yy_parser DPPP_(dummy_PL_parser);
  3778. #elif defined(NEED_PL_parser_GLOBAL)
  3779. yy_parser DPPP_(dummy_PL_parser);
  3780. #else
  3781. extern yy_parser DPPP_(dummy_PL_parser);
  3782. #endif
  3783. # endif
  3784. /* PL_expect, PL_copline, PL_rsfp, PL_rsfp_filters, PL_linestr, PL_bufptr, PL_bufend, PL_lex_state, PL_lex_stuff, PL_tokenbuf depends on PL_parser */
  3785. /* Warning: PL_expect, PL_copline, PL_rsfp, PL_rsfp_filters, PL_linestr, PL_bufptr, PL_bufend, PL_lex_state, PL_lex_stuff, PL_tokenbuf
  3786. * Do not use this variable unless you know exactly what you're
  3787. * doint. It is internal to the perl parser and may change or even
  3788. * be removed in the future. As of perl 5.9.5, you have to check
  3789. * for (PL_parser != NULL) for this variable to have any effect.
  3790. * An always non-NULL PL_parser dummy is provided for earlier
  3791. * perl versions.
  3792. * If PL_parser is NULL when you try to access this variable, a
  3793. * dummy is being accessed instead and a warning is issued unless
  3794. * you define DPPP_PL_parser_NO_DUMMY_WARNING.
  3795. * If DPPP_PL_parser_NO_DUMMY is defined, the code trying to access
  3796. * this variable will croak with a panic message.
  3797. */
  3798. # define PL_expect D_PPP_my_PL_parser_var(expect)
  3799. # define PL_copline D_PPP_my_PL_parser_var(copline)
  3800. # define PL_rsfp D_PPP_my_PL_parser_var(rsfp)
  3801. # define PL_rsfp_filters D_PPP_my_PL_parser_var(rsfp_filters)
  3802. # define PL_linestr D_PPP_my_PL_parser_var(linestr)
  3803. # define PL_bufptr D_PPP_my_PL_parser_var(bufptr)
  3804. # define PL_bufend D_PPP_my_PL_parser_var(bufend)
  3805. # define PL_lex_state D_PPP_my_PL_parser_var(lex_state)
  3806. # define PL_lex_stuff D_PPP_my_PL_parser_var(lex_stuff)
  3807. # define PL_tokenbuf D_PPP_my_PL_parser_var(tokenbuf)
  3808. # define PL_in_my D_PPP_my_PL_parser_var(in_my)
  3809. # define PL_in_my_stash D_PPP_my_PL_parser_var(in_my_stash)
  3810. # define PL_error_count D_PPP_my_PL_parser_var(error_count)
  3811. #else
  3812. /* ensure that PL_parser != NULL and cannot be dereferenced */
  3813. # define PL_parser ((void *) 1)
  3814. #endif
  3815. #ifndef mPUSHs
  3816. # define mPUSHs(s) PUSHs(sv_2mortal(s))
  3817. #endif
  3818. #ifndef PUSHmortal
  3819. # define PUSHmortal PUSHs(sv_newmortal())
  3820. #endif
  3821. #ifndef mPUSHp
  3822. # define mPUSHp(p,l) sv_setpvn(PUSHmortal, (p), (l))
  3823. #endif
  3824. #ifndef mPUSHn
  3825. # define mPUSHn(n) sv_setnv(PUSHmortal, (NV)(n))
  3826. #endif
  3827. #ifndef mPUSHi
  3828. # define mPUSHi(i) sv_setiv(PUSHmortal, (IV)(i))
  3829. #endif
  3830. #ifndef mPUSHu
  3831. # define mPUSHu(u) sv_setuv(PUSHmortal, (UV)(u))
  3832. #endif
  3833. #ifndef mXPUSHs
  3834. # define mXPUSHs(s) XPUSHs(sv_2mortal(s))
  3835. #endif
  3836. #ifndef XPUSHmortal
  3837. # define XPUSHmortal XPUSHs(sv_newmortal())
  3838. #endif
  3839. #ifndef mXPUSHp
  3840. # define mXPUSHp(p,l) STMT_START { EXTEND(sp,1); sv_setpvn(PUSHmortal, (p), (l)); } STMT_END
  3841. #endif
  3842. #ifndef mXPUSHn
  3843. # define mXPUSHn(n) STMT_START { EXTEND(sp,1); sv_setnv(PUSHmortal, (NV)(n)); } STMT_END
  3844. #endif
  3845. #ifndef mXPUSHi
  3846. # define mXPUSHi(i) STMT_START { EXTEND(sp,1); sv_setiv(PUSHmortal, (IV)(i)); } STMT_END
  3847. #endif
  3848. #ifndef mXPUSHu
  3849. # define mXPUSHu(u) STMT_START { EXTEND(sp,1); sv_setuv(PUSHmortal, (UV)(u)); } STMT_END
  3850. #endif
  3851. /* Replace: 1 */
  3852. #ifndef call_sv
  3853. # define call_sv perl_call_sv
  3854. #endif
  3855. #ifndef call_pv
  3856. # define call_pv perl_call_pv
  3857. #endif
  3858. #ifndef call_argv
  3859. # define call_argv perl_call_argv
  3860. #endif
  3861. #ifndef call_method
  3862. # define call_method perl_call_method
  3863. #endif
  3864. #ifndef eval_sv
  3865. # define eval_sv perl_eval_sv
  3866. #endif
  3867. /* Replace: 0 */
  3868. #ifndef PERL_LOADMOD_DENY
  3869. # define PERL_LOADMOD_DENY 0x1
  3870. #endif
  3871. #ifndef PERL_LOADMOD_NOIMPORT
  3872. # define PERL_LOADMOD_NOIMPORT 0x2
  3873. #endif
  3874. #ifndef PERL_LOADMOD_IMPORT_OPS
  3875. # define PERL_LOADMOD_IMPORT_OPS 0x4
  3876. #endif
  3877. #ifndef G_METHOD
  3878. # define G_METHOD 64
  3879. # ifdef call_sv
  3880. # undef call_sv
  3881. # endif
  3882. # if (PERL_BCDVERSION < 0x5006000)
  3883. # define call_sv(sv, flags) ((flags) & G_METHOD ? perl_call_method((char *) SvPV_nolen_const(sv), \
  3884. (flags) & ~G_METHOD) : perl_call_sv(sv, flags))
  3885. # else
  3886. # define call_sv(sv, flags) ((flags) & G_METHOD ? Perl_call_method(aTHX_ (char *) SvPV_nolen_const(sv), \
  3887. (flags) & ~G_METHOD) : Perl_call_sv(aTHX_ sv, flags))
  3888. # endif
  3889. #endif
  3890. /* Replace perl_eval_pv with eval_pv */
  3891. #ifndef eval_pv
  3892. #if defined(NEED_eval_pv)
  3893. static SV* DPPP_(my_eval_pv)(char *p, I32 croak_on_error);
  3894. static
  3895. #else
  3896. extern SV* DPPP_(my_eval_pv)(char *p, I32 croak_on_error);
  3897. #endif
  3898. #ifdef eval_pv
  3899. # undef eval_pv
  3900. #endif
  3901. #define eval_pv(a,b) DPPP_(my_eval_pv)(aTHX_ a,b)
  3902. #define Perl_eval_pv DPPP_(my_eval_pv)
  3903. #if defined(NEED_eval_pv) || defined(NEED_eval_pv_GLOBAL)
  3904. SV*
  3905. DPPP_(my_eval_pv)(char *p, I32 croak_on_error)
  3906. {
  3907. dSP;
  3908. SV* sv = newSVpv(p, 0);
  3909. PUSHMARK(sp);
  3910. eval_sv(sv, G_SCALAR);
  3911. SvREFCNT_dec(sv);
  3912. SPAGAIN;
  3913. sv = POPs;
  3914. PUTBACK;
  3915. if (croak_on_error && SvTRUE(GvSV(errgv)))
  3916. croak(SvPVx(GvSV(errgv), na));
  3917. return sv;
  3918. }
  3919. #endif
  3920. #endif
  3921. #ifndef vload_module
  3922. #if defined(NEED_vload_module)
  3923. static void DPPP_(my_vload_module)(U32 flags, SV *name, SV *ver, va_list *args);
  3924. static
  3925. #else
  3926. extern void DPPP_(my_vload_module)(U32 flags, SV *name, SV *ver, va_list *args);
  3927. #endif
  3928. #ifdef vload_module
  3929. # undef vload_module
  3930. #endif
  3931. #define vload_module(a,b,c,d) DPPP_(my_vload_module)(aTHX_ a,b,c,d)
  3932. #define Perl_vload_module DPPP_(my_vload_module)
  3933. #if defined(NEED_vload_module) || defined(NEED_vload_module_GLOBAL)
  3934. void
  3935. DPPP_(my_vload_module)(U32 flags, SV *name, SV *ver, va_list *args)
  3936. {
  3937. dTHR;
  3938. dVAR;
  3939. OP *veop, *imop;
  3940. OP * const modname = newSVOP(OP_CONST, 0, name);
  3941. /* 5.005 has a somewhat hacky force_normal that doesn't croak on
  3942. SvREADONLY() if PL_compling is true. Current perls take care in
  3943. ck_require() to correctly turn off SvREADONLY before calling
  3944. force_normal_flags(). This seems a better fix than fudging PL_compling
  3945. */
  3946. SvREADONLY_off(((SVOP*)modname)->op_sv);
  3947. modname->op_private |= OPpCONST_BARE;
  3948. if (ver) {
  3949. veop = newSVOP(OP_CONST, 0, ver);
  3950. }
  3951. else
  3952. veop = NULL;
  3953. if (flags & PERL_LOADMOD_NOIMPORT) {
  3954. imop = sawparens(newNULLLIST());
  3955. }
  3956. else if (flags & PERL_LOADMOD_IMPORT_OPS) {
  3957. imop = va_arg(*args, OP*);
  3958. }
  3959. else {
  3960. SV *sv;
  3961. imop = NULL;
  3962. sv = va_arg(*args, SV*);
  3963. while (sv) {
  3964. imop = append_elem(OP_LIST, imop, newSVOP(OP_CONST, 0, sv));
  3965. sv = va_arg(*args, SV*);
  3966. }
  3967. }
  3968. {
  3969. const line_t ocopline = PL_copline;
  3970. COP * const ocurcop = PL_curcop;
  3971. const int oexpect = PL_expect;
  3972. #if (PERL_BCDVERSION >= 0x5004000)
  3973. utilize(!(flags & PERL_LOADMOD_DENY), start_subparse(FALSE, 0),
  3974. veop, modname, imop);
  3975. #else
  3976. utilize(!(flags & PERL_LOADMOD_DENY), start_subparse(),
  3977. modname, imop);
  3978. #endif
  3979. PL_expect = oexpect;
  3980. PL_copline = ocopline;
  3981. PL_curcop = ocurcop;
  3982. }
  3983. }
  3984. #endif
  3985. #endif
  3986. #ifndef load_module
  3987. #if defined(NEED_load_module)
  3988. static void DPPP_(my_load_module)(U32 flags, SV *name, SV *ver, ...);
  3989. static
  3990. #else
  3991. extern void DPPP_(my_load_module)(U32 flags, SV *name, SV *ver, ...);
  3992. #endif
  3993. #ifdef load_module
  3994. # undef load_module
  3995. #endif
  3996. #define load_module DPPP_(my_load_module)
  3997. #define Perl_load_module DPPP_(my_load_module)
  3998. #if defined(NEED_load_module) || defined(NEED_load_module_GLOBAL)
  3999. void
  4000. DPPP_(my_load_module)(U32 flags, SV *name, SV *ver, ...)
  4001. {
  4002. va_list args;
  4003. va_start(args, ver);
  4004. vload_module(flags, name, ver, &args);
  4005. va_end(args);
  4006. }
  4007. #endif
  4008. #endif
  4009. #ifndef newRV_inc
  4010. # define newRV_inc(sv) newRV(sv) /* Replace */
  4011. #endif
  4012. #ifndef newRV_noinc
  4013. #if defined(NEED_newRV_noinc)
  4014. static SV * DPPP_(my_newRV_noinc)(SV *sv);
  4015. static
  4016. #else
  4017. extern SV * DPPP_(my_newRV_noinc)(SV *sv);
  4018. #endif
  4019. #ifdef newRV_noinc
  4020. # undef newRV_noinc
  4021. #endif
  4022. #define newRV_noinc(a) DPPP_(my_newRV_noinc)(aTHX_ a)
  4023. #define Perl_newRV_noinc DPPP_(my_newRV_noinc)
  4024. #if defined(NEED_newRV_noinc) || defined(NEED_newRV_noinc_GLOBAL)
  4025. SV *
  4026. DPPP_(my_newRV_noinc)(SV *sv)
  4027. {
  4028. SV *rv = (SV *)newRV(sv);
  4029. SvREFCNT_dec(sv);
  4030. return rv;
  4031. }
  4032. #endif
  4033. #endif
  4034. /* Hint: newCONSTSUB
  4035. * Returns a CV* as of perl-5.7.1. This return value is not supported
  4036. * by Devel::PPPort.
  4037. */
  4038. /* newCONSTSUB from IO.xs is in the core starting with 5.004_63 */
  4039. #if (PERL_BCDVERSION < 0x5004063) && (PERL_BCDVERSION != 0x5004005)
  4040. #if defined(NEED_newCONSTSUB)
  4041. static void DPPP_(my_newCONSTSUB)(HV *stash, const char *name, SV *sv);
  4042. static
  4043. #else
  4044. extern void DPPP_(my_newCONSTSUB)(HV *stash, const char *name, SV *sv);
  4045. #endif
  4046. #ifdef newCONSTSUB
  4047. # undef newCONSTSUB
  4048. #endif
  4049. #define newCONSTSUB(a,b,c) DPPP_(my_newCONSTSUB)(aTHX_ a,b,c)
  4050. #define Perl_newCONSTSUB DPPP_(my_newCONSTSUB)
  4051. #if defined(NEED_newCONSTSUB) || defined(NEED_newCONSTSUB_GLOBAL)
  4052. /* This is just a trick to avoid a dependency of newCONSTSUB on PL_parser */
  4053. /* (There's no PL_parser in perl < 5.005, so this is completely safe) */
  4054. #define D_PPP_PL_copline PL_copline
  4055. void
  4056. DPPP_(my_newCONSTSUB)(HV *stash, const char *name, SV *sv)
  4057. {
  4058. U32 oldhints = PL_hints;
  4059. HV *old_cop_stash = PL_curcop->cop_stash;
  4060. HV *old_curstash = PL_curstash;
  4061. line_t oldline = PL_curcop->cop_line;
  4062. PL_curcop->cop_line = D_PPP_PL_copline;
  4063. PL_hints &= ~HINT_BLOCK_SCOPE;
  4064. if (stash)
  4065. PL_curstash = PL_curcop->cop_stash = stash;
  4066. newSUB(
  4067. #if (PERL_BCDVERSION < 0x5003022)
  4068. start_subparse(),
  4069. #elif (PERL_BCDVERSION == 0x5003022)
  4070. start_subparse(0),
  4071. #else /* 5.003_23 onwards */
  4072. start_subparse(FALSE, 0),
  4073. #endif
  4074. newSVOP(OP_CONST, 0, newSVpv((char *) name, 0)),
  4075. newSVOP(OP_CONST, 0, &PL_sv_no), /* SvPV(&PL_sv_no) == "" -- GMB */
  4076. newSTATEOP(0, Nullch, newSVOP(OP_CONST, 0, sv))
  4077. );
  4078. PL_hints = oldhints;
  4079. PL_curcop->cop_stash = old_cop_stash;
  4080. PL_curstash = old_curstash;
  4081. PL_curcop->cop_line = oldline;
  4082. }
  4083. #endif
  4084. #endif
  4085. /*
  4086. * Boilerplate macros for initializing and accessing interpreter-local
  4087. * data from C. All statics in extensions should be reworked to use
  4088. * this, if you want to make the extension thread-safe. See ext/re/re.xs
  4089. * for an example of the use of these macros.
  4090. *
  4091. * Code that uses these macros is responsible for the following:
  4092. * 1. #define MY_CXT_KEY to a unique string, e.g. "DynaLoader_guts"
  4093. * 2. Declare a typedef named my_cxt_t that is a structure that contains
  4094. * all the data that needs to be interpreter-local.
  4095. * 3. Use the START_MY_CXT macro after the declaration of my_cxt_t.
  4096. * 4. Use the MY_CXT_INIT macro such that it is called exactly once
  4097. * (typically put in the BOOT: section).
  4098. * 5. Use the members of the my_cxt_t structure everywhere as
  4099. * MY_CXT.member.
  4100. * 6. Use the dMY_CXT macro (a declaration) in all the functions that
  4101. * access MY_CXT.
  4102. */
  4103. #if defined(MULTIPLICITY) || defined(PERL_OBJECT) || \
  4104. defined(PERL_CAPI) || defined(PERL_IMPLICIT_CONTEXT)
  4105. #ifndef START_MY_CXT
  4106. /* This must appear in all extensions that define a my_cxt_t structure,
  4107. * right after the definition (i.e. at file scope). The non-threads
  4108. * case below uses it to declare the data as static. */
  4109. #define START_MY_CXT
  4110. #if (PERL_BCDVERSION < 0x5004068)
  4111. /* Fetches the SV that keeps the per-interpreter data. */
  4112. #define dMY_CXT_SV \
  4113. SV *my_cxt_sv = get_sv(MY_CXT_KEY, FALSE)
  4114. #else /* >= perl5.004_68 */
  4115. #define dMY_CXT_SV \
  4116. SV *my_cxt_sv = *hv_fetch(PL_modglobal, MY_CXT_KEY, \
  4117. sizeof(MY_CXT_KEY)-1, TRUE)
  4118. #endif /* < perl5.004_68 */
  4119. /* This declaration should be used within all functions that use the
  4120. * interpreter-local data. */
  4121. #define dMY_CXT \
  4122. dMY_CXT_SV; \
  4123. my_cxt_t *my_cxtp = INT2PTR(my_cxt_t*,SvUV(my_cxt_sv))
  4124. /* Creates and zeroes the per-interpreter data.
  4125. * (We allocate my_cxtp in a Perl SV so that it will be released when
  4126. * the interpreter goes away.) */
  4127. #define MY_CXT_INIT \
  4128. dMY_CXT_SV; \
  4129. /* newSV() allocates one more than needed */ \
  4130. my_cxt_t *my_cxtp = (my_cxt_t*)SvPVX(newSV(sizeof(my_cxt_t)-1));\
  4131. Zero(my_cxtp, 1, my_cxt_t); \
  4132. sv_setuv(my_cxt_sv, PTR2UV(my_cxtp))
  4133. /* This macro must be used to access members of the my_cxt_t structure.
  4134. * e.g. MYCXT.some_data */
  4135. #define MY_CXT (*my_cxtp)
  4136. /* Judicious use of these macros can reduce the number of times dMY_CXT
  4137. * is used. Use is similar to pTHX, aTHX etc. */
  4138. #define pMY_CXT my_cxt_t *my_cxtp
  4139. #define pMY_CXT_ pMY_CXT,
  4140. #define _pMY_CXT ,pMY_CXT
  4141. #define aMY_CXT my_cxtp
  4142. #define aMY_CXT_ aMY_CXT,
  4143. #define _aMY_CXT ,aMY_CXT
  4144. #endif /* START_MY_CXT */
  4145. #ifndef MY_CXT_CLONE
  4146. /* Clones the per-interpreter data. */
  4147. #define MY_CXT_CLONE \
  4148. dMY_CXT_SV; \
  4149. my_cxt_t *my_cxtp = (my_cxt_t*)SvPVX(newSV(sizeof(my_cxt_t)-1));\
  4150. Copy(INT2PTR(my_cxt_t*, SvUV(my_cxt_sv)), my_cxtp, 1, my_cxt_t);\
  4151. sv_setuv(my_cxt_sv, PTR2UV(my_cxtp))
  4152. #endif
  4153. #else /* single interpreter */
  4154. #ifndef START_MY_CXT
  4155. #define START_MY_CXT static my_cxt_t my_cxt;
  4156. #define dMY_CXT_SV dNOOP
  4157. #define dMY_CXT dNOOP
  4158. #define MY_CXT_INIT NOOP
  4159. #define MY_CXT my_cxt
  4160. #define pMY_CXT void
  4161. #define pMY_CXT_
  4162. #define _pMY_CXT
  4163. #define aMY_CXT
  4164. #define aMY_CXT_
  4165. #define _aMY_CXT
  4166. #endif /* START_MY_CXT */
  4167. #ifndef MY_CXT_CLONE
  4168. #define MY_CXT_CLONE NOOP
  4169. #endif
  4170. #endif
  4171. #ifndef IVdf
  4172. # if IVSIZE == LONGSIZE
  4173. # define IVdf "ld"
  4174. # define UVuf "lu"
  4175. # define UVof "lo"
  4176. # define UVxf "lx"
  4177. # define UVXf "lX"
  4178. # else
  4179. # if IVSIZE == INTSIZE
  4180. # define IVdf "d"
  4181. # define UVuf "u"
  4182. # define UVof "o"
  4183. # define UVxf "x"
  4184. # define UVXf "X"
  4185. # endif
  4186. # endif
  4187. #endif
  4188. #ifndef NVef
  4189. # if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE) && \
  4190. defined(PERL_PRIfldbl) && (PERL_BCDVERSION != 0x5006000)
  4191. /* Not very likely, but let's try anyway. */
  4192. # define NVef PERL_PRIeldbl
  4193. # define NVff PERL_PRIfldbl
  4194. # define NVgf PERL_PRIgldbl
  4195. # else
  4196. # define NVef "e"
  4197. # define NVff "f"
  4198. # define NVgf "g"
  4199. # endif
  4200. #endif
  4201. #ifndef SvREFCNT_inc
  4202. # ifdef PERL_USE_GCC_BRACE_GROUPS
  4203. # define SvREFCNT_inc(sv) \
  4204. ({ \
  4205. SV * const _sv = (SV*)(sv); \
  4206. if (_sv) \
  4207. (SvREFCNT(_sv))++; \
  4208. _sv; \
  4209. })
  4210. # else
  4211. # define SvREFCNT_inc(sv) \
  4212. ((PL_Sv=(SV*)(sv)) ? (++(SvREFCNT(PL_Sv)),PL_Sv) : NULL)
  4213. # endif
  4214. #endif
  4215. #ifndef SvREFCNT_inc_simple
  4216. # ifdef PERL_USE_GCC_BRACE_GROUPS
  4217. # define SvREFCNT_inc_simple(sv) \
  4218. ({ \
  4219. if (sv) \
  4220. (SvREFCNT(sv))++; \
  4221. (SV *)(sv); \
  4222. })
  4223. # else
  4224. # define SvREFCNT_inc_simple(sv) \
  4225. ((sv) ? (SvREFCNT(sv)++,(SV*)(sv)) : NULL)
  4226. # endif
  4227. #endif
  4228. #ifndef SvREFCNT_inc_NN
  4229. # ifdef PERL_USE_GCC_BRACE_GROUPS
  4230. # define SvREFCNT_inc_NN(sv) \
  4231. ({ \
  4232. SV * const _sv = (SV*)(sv); \
  4233. SvREFCNT(_sv)++; \
  4234. _sv; \
  4235. })
  4236. # else
  4237. # define SvREFCNT_inc_NN(sv) \
  4238. (PL_Sv=(SV*)(sv),++(SvREFCNT(PL_Sv)),PL_Sv)
  4239. # endif
  4240. #endif
  4241. #ifndef SvREFCNT_inc_void
  4242. # ifdef PERL_USE_GCC_BRACE_GROUPS
  4243. # define SvREFCNT_inc_void(sv) \
  4244. ({ \
  4245. SV * const _sv = (SV*)(sv); \
  4246. if (_sv) \
  4247. (void)(SvREFCNT(_sv)++); \
  4248. })
  4249. # else
  4250. # define SvREFCNT_inc_void(sv) \
  4251. (void)((PL_Sv=(SV*)(sv)) ? ++(SvREFCNT(PL_Sv)) : 0)
  4252. # endif
  4253. #endif
  4254. #ifndef SvREFCNT_inc_simple_void
  4255. # define SvREFCNT_inc_simple_void(sv) STMT_START { if (sv) SvREFCNT(sv)++; } STMT_END
  4256. #endif
  4257. #ifndef SvREFCNT_inc_simple_NN
  4258. # define SvREFCNT_inc_simple_NN(sv) (++SvREFCNT(sv), (SV*)(sv))
  4259. #endif
  4260. #ifndef SvREFCNT_inc_void_NN
  4261. # define SvREFCNT_inc_void_NN(sv) (void)(++SvREFCNT((SV*)(sv)))
  4262. #endif
  4263. #ifndef SvREFCNT_inc_simple_void_NN
  4264. # define SvREFCNT_inc_simple_void_NN(sv) (void)(++SvREFCNT((SV*)(sv)))
  4265. #endif
  4266. #ifndef newSV_type
  4267. #if defined(NEED_newSV_type)
  4268. static SV* DPPP_(my_newSV_type)(pTHX_ svtype const t);
  4269. static
  4270. #else
  4271. extern SV* DPPP_(my_newSV_type)(pTHX_ svtype const t);
  4272. #endif
  4273. #ifdef newSV_type
  4274. # undef newSV_type
  4275. #endif
  4276. #define newSV_type(a) DPPP_(my_newSV_type)(aTHX_ a)
  4277. #define Perl_newSV_type DPPP_(my_newSV_type)
  4278. #if defined(NEED_newSV_type) || defined(NEED_newSV_type_GLOBAL)
  4279. SV*
  4280. DPPP_(my_newSV_type)(pTHX_ svtype const t)
  4281. {
  4282. SV* const sv = newSV(0);
  4283. sv_upgrade(sv, t);
  4284. return sv;
  4285. }
  4286. #endif
  4287. #endif
  4288. #if (PERL_BCDVERSION < 0x5006000)
  4289. # define D_PPP_CONSTPV_ARG(x) ((char *) (x))
  4290. #else
  4291. # define D_PPP_CONSTPV_ARG(x) (x)
  4292. #endif
  4293. #ifndef newSVpvn
  4294. # define newSVpvn(data,len) ((data) \
  4295. ? ((len) ? newSVpv((data), (len)) : newSVpv("", 0)) \
  4296. : newSV(0))
  4297. #endif
  4298. #ifndef newSVpvn_utf8
  4299. # define newSVpvn_utf8(s, len, u) newSVpvn_flags((s), (len), (u) ? SVf_UTF8 : 0)
  4300. #endif
  4301. #ifndef SVf_UTF8
  4302. # define SVf_UTF8 0
  4303. #endif
  4304. #ifndef newSVpvn_flags
  4305. #if defined(NEED_newSVpvn_flags)
  4306. static SV * DPPP_(my_newSVpvn_flags)(pTHX_ const char *s, STRLEN len, U32 flags);
  4307. static
  4308. #else
  4309. extern SV * DPPP_(my_newSVpvn_flags)(pTHX_ const char *s, STRLEN len, U32 flags);
  4310. #endif
  4311. #ifdef newSVpvn_flags
  4312. # undef newSVpvn_flags
  4313. #endif
  4314. #define newSVpvn_flags(a,b,c) DPPP_(my_newSVpvn_flags)(aTHX_ a,b,c)
  4315. #define Perl_newSVpvn_flags DPPP_(my_newSVpvn_flags)
  4316. #if defined(NEED_newSVpvn_flags) || defined(NEED_newSVpvn_flags_GLOBAL)
  4317. SV *
  4318. DPPP_(my_newSVpvn_flags)(pTHX_ const char *s, STRLEN len, U32 flags)
  4319. {
  4320. SV *sv = newSVpvn(D_PPP_CONSTPV_ARG(s), len);
  4321. SvFLAGS(sv) |= (flags & SVf_UTF8);
  4322. return (flags & SVs_TEMP) ? sv_2mortal(sv) : sv;
  4323. }
  4324. #endif
  4325. #endif
  4326. /* Backwards compatibility stuff... :-( */
  4327. #if !defined(NEED_sv_2pv_flags) && defined(NEED_sv_2pv_nolen)
  4328. # define NEED_sv_2pv_flags
  4329. #endif
  4330. #if !defined(NEED_sv_2pv_flags_GLOBAL) && defined(NEED_sv_2pv_nolen_GLOBAL)
  4331. # define NEED_sv_2pv_flags_GLOBAL
  4332. #endif
  4333. /* Hint: sv_2pv_nolen
  4334. * Use the SvPV_nolen() or SvPV_nolen_const() macros instead of sv_2pv_nolen().
  4335. */
  4336. #ifndef sv_2pv_nolen
  4337. # define sv_2pv_nolen(sv) SvPV_nolen(sv)
  4338. #endif
  4339. #ifdef SvPVbyte
  4340. /* Hint: SvPVbyte
  4341. * Does not work in perl-5.6.1, ppport.h implements a version
  4342. * borrowed from perl-5.7.3.
  4343. */
  4344. #if (PERL_BCDVERSION < 0x5007000)
  4345. #if defined(NEED_sv_2pvbyte)
  4346. static char * DPPP_(my_sv_2pvbyte)(pTHX_ SV *sv, STRLEN *lp);
  4347. static
  4348. #else
  4349. extern char * DPPP_(my_sv_2pvbyte)(pTHX_ SV *sv, STRLEN *lp);
  4350. #endif
  4351. #ifdef sv_2pvbyte
  4352. # undef sv_2pvbyte
  4353. #endif
  4354. #define sv_2pvbyte(a,b) DPPP_(my_sv_2pvbyte)(aTHX_ a,b)
  4355. #define Perl_sv_2pvbyte DPPP_(my_sv_2pvbyte)
  4356. #if defined(NEED_sv_2pvbyte) || defined(NEED_sv_2pvbyte_GLOBAL)
  4357. char *
  4358. DPPP_(my_sv_2pvbyte)(pTHX_ SV *sv, STRLEN *lp)
  4359. {
  4360. sv_utf8_downgrade(sv,0);
  4361. return SvPV(sv,*lp);
  4362. }
  4363. #endif
  4364. /* Hint: sv_2pvbyte
  4365. * Use the SvPVbyte() macro instead of sv_2pvbyte().
  4366. */
  4367. #undef SvPVbyte
  4368. #define SvPVbyte(sv, lp) \
  4369. ((SvFLAGS(sv) & (SVf_POK|SVf_UTF8)) == (SVf_POK) \
  4370. ? ((lp = SvCUR(sv)), SvPVX(sv)) : sv_2pvbyte(sv, &lp))
  4371. #endif
  4372. #else
  4373. # define SvPVbyte SvPV
  4374. # define sv_2pvbyte sv_2pv
  4375. #endif
  4376. #ifndef sv_2pvbyte_nolen
  4377. # define sv_2pvbyte_nolen(sv) sv_2pv_nolen(sv)
  4378. #endif
  4379. /* Hint: sv_pvn
  4380. * Always use the SvPV() macro instead of sv_pvn().
  4381. */
  4382. /* Hint: sv_pvn_force
  4383. * Always use the SvPV_force() macro instead of sv_pvn_force().
  4384. */
  4385. /* If these are undefined, they're not handled by the core anyway */
  4386. #ifndef SV_IMMEDIATE_UNREF
  4387. # define SV_IMMEDIATE_UNREF 0
  4388. #endif
  4389. #ifndef SV_GMAGIC
  4390. # define SV_GMAGIC 0
  4391. #endif
  4392. #ifndef SV_COW_DROP_PV
  4393. # define SV_COW_DROP_PV 0
  4394. #endif
  4395. #ifndef SV_UTF8_NO_ENCODING
  4396. # define SV_UTF8_NO_ENCODING 0
  4397. #endif
  4398. #ifndef SV_NOSTEAL
  4399. # define SV_NOSTEAL 0
  4400. #endif
  4401. #ifndef SV_CONST_RETURN
  4402. # define SV_CONST_RETURN 0
  4403. #endif
  4404. #ifndef SV_MUTABLE_RETURN
  4405. # define SV_MUTABLE_RETURN 0
  4406. #endif
  4407. #ifndef SV_SMAGIC
  4408. # define SV_SMAGIC 0
  4409. #endif
  4410. #ifndef SV_HAS_TRAILING_NUL
  4411. # define SV_HAS_TRAILING_NUL 0
  4412. #endif
  4413. #ifndef SV_COW_SHARED_HASH_KEYS
  4414. # define SV_COW_SHARED_HASH_KEYS 0
  4415. #endif
  4416. #if (PERL_BCDVERSION < 0x5007002)
  4417. #if defined(NEED_sv_2pv_flags)
  4418. static char * DPPP_(my_sv_2pv_flags)(pTHX_ SV *sv, STRLEN *lp, I32 flags);
  4419. static
  4420. #else
  4421. extern char * DPPP_(my_sv_2pv_flags)(pTHX_ SV *sv, STRLEN *lp, I32 flags);
  4422. #endif
  4423. #ifdef sv_2pv_flags
  4424. # undef sv_2pv_flags
  4425. #endif
  4426. #define sv_2pv_flags(a,b,c) DPPP_(my_sv_2pv_flags)(aTHX_ a,b,c)
  4427. #define Perl_sv_2pv_flags DPPP_(my_sv_2pv_flags)
  4428. #if defined(NEED_sv_2pv_flags) || defined(NEED_sv_2pv_flags_GLOBAL)
  4429. char *
  4430. DPPP_(my_sv_2pv_flags)(pTHX_ SV *sv, STRLEN *lp, I32 flags)
  4431. {
  4432. STRLEN n_a = (STRLEN) flags;
  4433. return sv_2pv(sv, lp ? lp : &n_a);
  4434. }
  4435. #endif
  4436. #if defined(NEED_sv_pvn_force_flags)
  4437. static char * DPPP_(my_sv_pvn_force_flags)(pTHX_ SV *sv, STRLEN *lp, I32 flags);
  4438. static
  4439. #else
  4440. extern char * DPPP_(my_sv_pvn_force_flags)(pTHX_ SV *sv, STRLEN *lp, I32 flags);
  4441. #endif
  4442. #ifdef sv_pvn_force_flags
  4443. # undef sv_pvn_force_flags
  4444. #endif
  4445. #define sv_pvn_force_flags(a,b,c) DPPP_(my_sv_pvn_force_flags)(aTHX_ a,b,c)
  4446. #define Perl_sv_pvn_force_flags DPPP_(my_sv_pvn_force_flags)
  4447. #if defined(NEED_sv_pvn_force_flags) || defined(NEED_sv_pvn_force_flags_GLOBAL)
  4448. char *
  4449. DPPP_(my_sv_pvn_force_flags)(pTHX_ SV *sv, STRLEN *lp, I32 flags)
  4450. {
  4451. STRLEN n_a = (STRLEN) flags;
  4452. return sv_pvn_force(sv, lp ? lp : &n_a);
  4453. }
  4454. #endif
  4455. #endif
  4456. #if (PERL_BCDVERSION < 0x5008008) || ( (PERL_BCDVERSION >= 0x5009000) && (PERL_BCDVERSION < 0x5009003) )
  4457. # define DPPP_SVPV_NOLEN_LP_ARG &PL_na
  4458. #else
  4459. # define DPPP_SVPV_NOLEN_LP_ARG 0
  4460. #endif
  4461. #ifndef SvPV_const
  4462. # define SvPV_const(sv, lp) SvPV_flags_const(sv, lp, SV_GMAGIC)
  4463. #endif
  4464. #ifndef SvPV_mutable
  4465. # define SvPV_mutable(sv, lp) SvPV_flags_mutable(sv, lp, SV_GMAGIC)
  4466. #endif
  4467. #ifndef SvPV_flags
  4468. # define SvPV_flags(sv, lp, flags) \
  4469. ((SvFLAGS(sv) & (SVf_POK)) == SVf_POK \
  4470. ? ((lp = SvCUR(sv)), SvPVX(sv)) : sv_2pv_flags(sv, &lp, flags))
  4471. #endif
  4472. #ifndef SvPV_flags_const
  4473. # define SvPV_flags_const(sv, lp, flags) \
  4474. ((SvFLAGS(sv) & (SVf_POK)) == SVf_POK \
  4475. ? ((lp = SvCUR(sv)), SvPVX_const(sv)) : \
  4476. (const char*) sv_2pv_flags(sv, &lp, flags|SV_CONST_RETURN))
  4477. #endif
  4478. #ifndef SvPV_flags_const_nolen
  4479. # define SvPV_flags_const_nolen(sv, flags) \
  4480. ((SvFLAGS(sv) & (SVf_POK)) == SVf_POK \
  4481. ? SvPVX_const(sv) : \
  4482. (const char*) sv_2pv_flags(sv, DPPP_SVPV_NOLEN_LP_ARG, flags|SV_CONST_RETURN))
  4483. #endif
  4484. #ifndef SvPV_flags_mutable
  4485. # define SvPV_flags_mutable(sv, lp, flags) \
  4486. ((SvFLAGS(sv) & (SVf_POK)) == SVf_POK \
  4487. ? ((lp = SvCUR(sv)), SvPVX_mutable(sv)) : \
  4488. sv_2pv_flags(sv, &lp, flags|SV_MUTABLE_RETURN))
  4489. #endif
  4490. #ifndef SvPV_force
  4491. # define SvPV_force(sv, lp) SvPV_force_flags(sv, lp, SV_GMAGIC)
  4492. #endif
  4493. #ifndef SvPV_force_nolen
  4494. # define SvPV_force_nolen(sv) SvPV_force_flags_nolen(sv, SV_GMAGIC)
  4495. #endif
  4496. #ifndef SvPV_force_mutable
  4497. # define SvPV_force_mutable(sv, lp) SvPV_force_flags_mutable(sv, lp, SV_GMAGIC)
  4498. #endif
  4499. #ifndef SvPV_force_nomg
  4500. # define SvPV_force_nomg(sv, lp) SvPV_force_flags(sv, lp, 0)
  4501. #endif
  4502. #ifndef SvPV_force_nomg_nolen
  4503. # define SvPV_force_nomg_nolen(sv) SvPV_force_flags_nolen(sv, 0)
  4504. #endif
  4505. #ifndef SvPV_force_flags
  4506. # define SvPV_force_flags(sv, lp, flags) \
  4507. ((SvFLAGS(sv) & (SVf_POK|SVf_THINKFIRST)) == SVf_POK \
  4508. ? ((lp = SvCUR(sv)), SvPVX(sv)) : sv_pvn_force_flags(sv, &lp, flags))
  4509. #endif
  4510. #ifndef SvPV_force_flags_nolen
  4511. # define SvPV_force_flags_nolen(sv, flags) \
  4512. ((SvFLAGS(sv) & (SVf_POK|SVf_THINKFIRST)) == SVf_POK \
  4513. ? SvPVX(sv) : sv_pvn_force_flags(sv, DPPP_SVPV_NOLEN_LP_ARG, flags))
  4514. #endif
  4515. #ifndef SvPV_force_flags_mutable
  4516. # define SvPV_force_flags_mutable(sv, lp, flags) \
  4517. ((SvFLAGS(sv) & (SVf_POK|SVf_THINKFIRST)) == SVf_POK \
  4518. ? ((lp = SvCUR(sv)), SvPVX_mutable(sv)) \
  4519. : sv_pvn_force_flags(sv, &lp, flags|SV_MUTABLE_RETURN))
  4520. #endif
  4521. #ifndef SvPV_nolen
  4522. # define SvPV_nolen(sv) \
  4523. ((SvFLAGS(sv) & (SVf_POK)) == SVf_POK \
  4524. ? SvPVX(sv) : sv_2pv_flags(sv, DPPP_SVPV_NOLEN_LP_ARG, SV_GMAGIC))
  4525. #endif
  4526. #ifndef SvPV_nolen_const
  4527. # define SvPV_nolen_const(sv) \
  4528. ((SvFLAGS(sv) & (SVf_POK)) == SVf_POK \
  4529. ? SvPVX_const(sv) : sv_2pv_flags(sv, DPPP_SVPV_NOLEN_LP_ARG, SV_GMAGIC|SV_CONST_RETURN))
  4530. #endif
  4531. #ifndef SvPV_nomg
  4532. # define SvPV_nomg(sv, lp) SvPV_flags(sv, lp, 0)
  4533. #endif
  4534. #ifndef SvPV_nomg_const
  4535. # define SvPV_nomg_const(sv, lp) SvPV_flags_const(sv, lp, 0)
  4536. #endif
  4537. #ifndef SvPV_nomg_const_nolen
  4538. # define SvPV_nomg_const_nolen(sv) SvPV_flags_const_nolen(sv, 0)
  4539. #endif
  4540. #ifndef SvPV_renew
  4541. # define SvPV_renew(sv,n) STMT_START { SvLEN_set(sv, n); \
  4542. SvPV_set((sv), (char *) saferealloc( \
  4543. (Malloc_t)SvPVX(sv), (MEM_SIZE)((n)))); \
  4544. } STMT_END
  4545. #endif
  4546. #ifndef SvMAGIC_set
  4547. # define SvMAGIC_set(sv, val) \
  4548. STMT_START { assert(SvTYPE(sv) >= SVt_PVMG); \
  4549. (((XPVMG*) SvANY(sv))->xmg_magic = (val)); } STMT_END
  4550. #endif
  4551. #if (PERL_BCDVERSION < 0x5009003)
  4552. #ifndef SvPVX_const
  4553. # define SvPVX_const(sv) ((const char*) (0 + SvPVX(sv)))
  4554. #endif
  4555. #ifndef SvPVX_mutable
  4556. # define SvPVX_mutable(sv) (0 + SvPVX(sv))
  4557. #endif
  4558. #ifndef SvRV_set
  4559. # define SvRV_set(sv, val) \
  4560. STMT_START { assert(SvTYPE(sv) >= SVt_RV); \
  4561. (((XRV*) SvANY(sv))->xrv_rv = (val)); } STMT_END
  4562. #endif
  4563. #else
  4564. #ifndef SvPVX_const
  4565. # define SvPVX_const(sv) ((const char*)((sv)->sv_u.svu_pv))
  4566. #endif
  4567. #ifndef SvPVX_mutable
  4568. # define SvPVX_mutable(sv) ((sv)->sv_u.svu_pv)
  4569. #endif
  4570. #ifndef SvRV_set
  4571. # define SvRV_set(sv, val) \
  4572. STMT_START { assert(SvTYPE(sv) >= SVt_RV); \
  4573. ((sv)->sv_u.svu_rv = (val)); } STMT_END
  4574. #endif
  4575. #endif
  4576. #ifndef SvSTASH_set
  4577. # define SvSTASH_set(sv, val) \
  4578. STMT_START { assert(SvTYPE(sv) >= SVt_PVMG); \
  4579. (((XPVMG*) SvANY(sv))->xmg_stash = (val)); } STMT_END
  4580. #endif
  4581. #if (PERL_BCDVERSION < 0x5004000)
  4582. #ifndef SvUV_set
  4583. # define SvUV_set(sv, val) \
  4584. STMT_START { assert(SvTYPE(sv) == SVt_IV || SvTYPE(sv) >= SVt_PVIV); \
  4585. (((XPVIV*) SvANY(sv))->xiv_iv = (IV) (val)); } STMT_END
  4586. #endif
  4587. #else
  4588. #ifndef SvUV_set
  4589. # define SvUV_set(sv, val) \
  4590. STMT_START { assert(SvTYPE(sv) == SVt_IV || SvTYPE(sv) >= SVt_PVIV); \
  4591. (((XPVUV*) SvANY(sv))->xuv_uv = (val)); } STMT_END
  4592. #endif
  4593. #endif
  4594. #if (PERL_BCDVERSION >= 0x5004000) && !defined(vnewSVpvf)
  4595. #if defined(NEED_vnewSVpvf)
  4596. static SV * DPPP_(my_vnewSVpvf)(pTHX_ const char *pat, va_list *args);
  4597. static
  4598. #else
  4599. extern SV * DPPP_(my_vnewSVpvf)(pTHX_ const char *pat, va_list *args);
  4600. #endif
  4601. #ifdef vnewSVpvf
  4602. # undef vnewSVpvf
  4603. #endif
  4604. #define vnewSVpvf(a,b) DPPP_(my_vnewSVpvf)(aTHX_ a,b)
  4605. #define Perl_vnewSVpvf DPPP_(my_vnewSVpvf)
  4606. #if defined(NEED_vnewSVpvf) || defined(NEED_vnewSVpvf_GLOBAL)
  4607. SV *
  4608. DPPP_(my_vnewSVpvf)(pTHX_ const char *pat, va_list *args)
  4609. {
  4610. register SV *sv = newSV(0);
  4611. sv_vsetpvfn(sv, pat, strlen(pat), args, Null(SV**), 0, Null(bool*));
  4612. return sv;
  4613. }
  4614. #endif
  4615. #endif
  4616. #if (PERL_BCDVERSION >= 0x5004000) && !defined(sv_vcatpvf)
  4617. # define sv_vcatpvf(sv, pat, args) sv_vcatpvfn(sv, pat, strlen(pat), args, Null(SV**), 0, Null(bool*))
  4618. #endif
  4619. #if (PERL_BCDVERSION >= 0x5004000) && !defined(sv_vsetpvf)
  4620. # define sv_vsetpvf(sv, pat, args) sv_vsetpvfn(sv, pat, strlen(pat), args, Null(SV**), 0, Null(bool*))
  4621. #endif
  4622. #if (PERL_BCDVERSION >= 0x5004000) && !defined(sv_catpvf_mg)
  4623. #if defined(NEED_sv_catpvf_mg)
  4624. static void DPPP_(my_sv_catpvf_mg)(pTHX_ SV *sv, const char *pat, ...);
  4625. static
  4626. #else
  4627. extern void DPPP_(my_sv_catpvf_mg)(pTHX_ SV *sv, const char *pat, ...);
  4628. #endif
  4629. #define Perl_sv_catpvf_mg DPPP_(my_sv_catpvf_mg)
  4630. #if defined(NEED_sv_catpvf_mg) || defined(NEED_sv_catpvf_mg_GLOBAL)
  4631. void
  4632. DPPP_(my_sv_catpvf_mg)(pTHX_ SV *sv, const char *pat, ...)
  4633. {
  4634. va_list args;
  4635. va_start(args, pat);
  4636. sv_vcatpvfn(sv, pat, strlen(pat), &args, Null(SV**), 0, Null(bool*));
  4637. SvSETMAGIC(sv);
  4638. va_end(args);
  4639. }
  4640. #endif
  4641. #endif
  4642. #ifdef PERL_IMPLICIT_CONTEXT
  4643. #if (PERL_BCDVERSION >= 0x5004000) && !defined(sv_catpvf_mg_nocontext)
  4644. #if defined(NEED_sv_catpvf_mg_nocontext)
  4645. static void DPPP_(my_sv_catpvf_mg_nocontext)(SV *sv, const char *pat, ...);
  4646. static
  4647. #else
  4648. extern void DPPP_(my_sv_catpvf_mg_nocontext)(SV *sv, const char *pat, ...);
  4649. #endif
  4650. #define sv_catpvf_mg_nocontext DPPP_(my_sv_catpvf_mg_nocontext)
  4651. #define Perl_sv_catpvf_mg_nocontext DPPP_(my_sv_catpvf_mg_nocontext)
  4652. #if defined(NEED_sv_catpvf_mg_nocontext) || defined(NEED_sv_catpvf_mg_nocontext_GLOBAL)
  4653. void
  4654. DPPP_(my_sv_catpvf_mg_nocontext)(SV *sv, const char *pat, ...)
  4655. {
  4656. dTHX;
  4657. va_list args;
  4658. va_start(args, pat);
  4659. sv_vcatpvfn(sv, pat, strlen(pat), &args, Null(SV**), 0, Null(bool*));
  4660. SvSETMAGIC(sv);
  4661. va_end(args);
  4662. }
  4663. #endif
  4664. #endif
  4665. #endif
  4666. /* sv_catpvf_mg depends on sv_catpvf_mg_nocontext */
  4667. #ifndef sv_catpvf_mg
  4668. # ifdef PERL_IMPLICIT_CONTEXT
  4669. # define sv_catpvf_mg Perl_sv_catpvf_mg_nocontext
  4670. # else
  4671. # define sv_catpvf_mg Perl_sv_catpvf_mg
  4672. # endif
  4673. #endif
  4674. #if (PERL_BCDVERSION >= 0x5004000) && !defined(sv_vcatpvf_mg)
  4675. # define sv_vcatpvf_mg(sv, pat, args) \
  4676. STMT_START { \
  4677. sv_vcatpvfn(sv, pat, strlen(pat), args, Null(SV**), 0, Null(bool*)); \
  4678. SvSETMAGIC(sv); \
  4679. } STMT_END
  4680. #endif
  4681. #if (PERL_BCDVERSION >= 0x5004000) && !defined(sv_setpvf_mg)
  4682. #if defined(NEED_sv_setpvf_mg)
  4683. static void DPPP_(my_sv_setpvf_mg)(pTHX_ SV *sv, const char *pat, ...);
  4684. static
  4685. #else
  4686. extern void DPPP_(my_sv_setpvf_mg)(pTHX_ SV *sv, const char *pat, ...);
  4687. #endif
  4688. #define Perl_sv_setpvf_mg DPPP_(my_sv_setpvf_mg)
  4689. #if defined(NEED_sv_setpvf_mg) || defined(NEED_sv_setpvf_mg_GLOBAL)
  4690. void
  4691. DPPP_(my_sv_setpvf_mg)(pTHX_ SV *sv, const char *pat, ...)
  4692. {
  4693. va_list args;
  4694. va_start(args, pat);
  4695. sv_vsetpvfn(sv, pat, strlen(pat), &args, Null(SV**), 0, Null(bool*));
  4696. SvSETMAGIC(sv);
  4697. va_end(args);
  4698. }
  4699. #endif
  4700. #endif
  4701. #ifdef PERL_IMPLICIT_CONTEXT
  4702. #if (PERL_BCDVERSION >= 0x5004000) && !defined(sv_setpvf_mg_nocontext)
  4703. #if defined(NEED_sv_setpvf_mg_nocontext)
  4704. static void DPPP_(my_sv_setpvf_mg_nocontext)(SV *sv, const char *pat, ...);
  4705. static
  4706. #else
  4707. extern void DPPP_(my_sv_setpvf_mg_nocontext)(SV *sv, const char *pat, ...);
  4708. #endif
  4709. #define sv_setpvf_mg_nocontext DPPP_(my_sv_setpvf_mg_nocontext)
  4710. #define Perl_sv_setpvf_mg_nocontext DPPP_(my_sv_setpvf_mg_nocontext)
  4711. #if defined(NEED_sv_setpvf_mg_nocontext) || defined(NEED_sv_setpvf_mg_nocontext_GLOBAL)
  4712. void
  4713. DPPP_(my_sv_setpvf_mg_nocontext)(SV *sv, const char *pat, ...)
  4714. {
  4715. dTHX;
  4716. va_list args;
  4717. va_start(args, pat);
  4718. sv_vsetpvfn(sv, pat, strlen(pat), &args, Null(SV**), 0, Null(bool*));
  4719. SvSETMAGIC(sv);
  4720. va_end(args);
  4721. }
  4722. #endif
  4723. #endif
  4724. #endif
  4725. /* sv_setpvf_mg depends on sv_setpvf_mg_nocontext */
  4726. #ifndef sv_setpvf_mg
  4727. # ifdef PERL_IMPLICIT_CONTEXT
  4728. # define sv_setpvf_mg Perl_sv_setpvf_mg_nocontext
  4729. # else
  4730. # define sv_setpvf_mg Perl_sv_setpvf_mg
  4731. # endif
  4732. #endif
  4733. #if (PERL_BCDVERSION >= 0x5004000) && !defined(sv_vsetpvf_mg)
  4734. # define sv_vsetpvf_mg(sv, pat, args) \
  4735. STMT_START { \
  4736. sv_vsetpvfn(sv, pat, strlen(pat), args, Null(SV**), 0, Null(bool*)); \
  4737. SvSETMAGIC(sv); \
  4738. } STMT_END
  4739. #endif
  4740. #ifndef newSVpvn_share
  4741. #if defined(NEED_newSVpvn_share)
  4742. static SV * DPPP_(my_newSVpvn_share)(pTHX_ const char *src, I32 len, U32 hash);
  4743. static
  4744. #else
  4745. extern SV * DPPP_(my_newSVpvn_share)(pTHX_ const char *src, I32 len, U32 hash);
  4746. #endif
  4747. #ifdef newSVpvn_share
  4748. # undef newSVpvn_share
  4749. #endif
  4750. #define newSVpvn_share(a,b,c) DPPP_(my_newSVpvn_share)(aTHX_ a,b,c)
  4751. #define Perl_newSVpvn_share DPPP_(my_newSVpvn_share)
  4752. #if defined(NEED_newSVpvn_share) || defined(NEED_newSVpvn_share_GLOBAL)
  4753. SV *
  4754. DPPP_(my_newSVpvn_share)(pTHX_ const char *src, I32 len, U32 hash)
  4755. {
  4756. SV *sv;
  4757. if (len < 0)
  4758. len = -len;
  4759. if (!hash)
  4760. PERL_HASH(hash, (char*) src, len);
  4761. sv = newSVpvn((char *) src, len);
  4762. sv_upgrade(sv, SVt_PVIV);
  4763. SvIVX(sv) = hash;
  4764. SvREADONLY_on(sv);
  4765. SvPOK_on(sv);
  4766. return sv;
  4767. }
  4768. #endif
  4769. #endif
  4770. #ifndef SvSHARED_HASH
  4771. # define SvSHARED_HASH(sv) (0 + SvUVX(sv))
  4772. #endif
  4773. #ifndef HvNAME_get
  4774. # define HvNAME_get(hv) HvNAME(hv)
  4775. #endif
  4776. #ifndef HvNAMELEN_get
  4777. # define HvNAMELEN_get(hv) (HvNAME_get(hv) ? (I32)strlen(HvNAME_get(hv)) : 0)
  4778. #endif
  4779. #ifndef GvSVn
  4780. # define GvSVn(gv) GvSV(gv)
  4781. #endif
  4782. #ifndef isGV_with_GP
  4783. # define isGV_with_GP(gv) isGV(gv)
  4784. #endif
  4785. #ifndef WARN_ALL
  4786. # define WARN_ALL 0
  4787. #endif
  4788. #ifndef WARN_CLOSURE
  4789. # define WARN_CLOSURE 1
  4790. #endif
  4791. #ifndef WARN_DEPRECATED
  4792. # define WARN_DEPRECATED 2
  4793. #endif
  4794. #ifndef WARN_EXITING
  4795. # define WARN_EXITING 3
  4796. #endif
  4797. #ifndef WARN_GLOB
  4798. # define WARN_GLOB 4
  4799. #endif
  4800. #ifndef WARN_IO
  4801. # define WARN_IO 5
  4802. #endif
  4803. #ifndef WARN_CLOSED
  4804. # define WARN_CLOSED 6
  4805. #endif
  4806. #ifndef WARN_EXEC
  4807. # define WARN_EXEC 7
  4808. #endif
  4809. #ifndef WARN_LAYER
  4810. # define WARN_LAYER 8
  4811. #endif
  4812. #ifndef WARN_NEWLINE
  4813. # define WARN_NEWLINE 9
  4814. #endif
  4815. #ifndef WARN_PIPE
  4816. # define WARN_PIPE 10
  4817. #endif
  4818. #ifndef WARN_UNOPENED
  4819. # define WARN_UNOPENED 11
  4820. #endif
  4821. #ifndef WARN_MISC
  4822. # define WARN_MISC 12
  4823. #endif
  4824. #ifndef WARN_NUMERIC
  4825. # define WARN_NUMERIC 13
  4826. #endif
  4827. #ifndef WARN_ONCE
  4828. # define WARN_ONCE 14
  4829. #endif
  4830. #ifndef WARN_OVERFLOW
  4831. # define WARN_OVERFLOW 15
  4832. #endif
  4833. #ifndef WARN_PACK
  4834. # define WARN_PACK 16
  4835. #endif
  4836. #ifndef WARN_PORTABLE
  4837. # define WARN_PORTABLE 17
  4838. #endif
  4839. #ifndef WARN_RECURSION
  4840. # define WARN_RECURSION 18
  4841. #endif
  4842. #ifndef WARN_REDEFINE
  4843. # define WARN_REDEFINE 19
  4844. #endif
  4845. #ifndef WARN_REGEXP
  4846. # define WARN_REGEXP 20
  4847. #endif
  4848. #ifndef WARN_SEVERE
  4849. # define WARN_SEVERE 21
  4850. #endif
  4851. #ifndef WARN_DEBUGGING
  4852. # define WARN_DEBUGGING 22
  4853. #endif
  4854. #ifndef WARN_INPLACE
  4855. # define WARN_INPLACE 23
  4856. #endif
  4857. #ifndef WARN_INTERNAL
  4858. # define WARN_INTERNAL 24
  4859. #endif
  4860. #ifndef WARN_MALLOC
  4861. # define WARN_MALLOC 25
  4862. #endif
  4863. #ifndef WARN_SIGNAL
  4864. # define WARN_SIGNAL 26
  4865. #endif
  4866. #ifndef WARN_SUBSTR
  4867. # define WARN_SUBSTR 27
  4868. #endif
  4869. #ifndef WARN_SYNTAX
  4870. # define WARN_SYNTAX 28
  4871. #endif
  4872. #ifndef WARN_AMBIGUOUS
  4873. # define WARN_AMBIGUOUS 29
  4874. #endif
  4875. #ifndef WARN_BAREWORD
  4876. # define WARN_BAREWORD 30
  4877. #endif
  4878. #ifndef WARN_DIGIT
  4879. # define WARN_DIGIT 31
  4880. #endif
  4881. #ifndef WARN_PARENTHESIS
  4882. # define WARN_PARENTHESIS 32
  4883. #endif
  4884. #ifndef WARN_PRECEDENCE
  4885. # define WARN_PRECEDENCE 33
  4886. #endif
  4887. #ifndef WARN_PRINTF
  4888. # define WARN_PRINTF 34
  4889. #endif
  4890. #ifndef WARN_PROTOTYPE
  4891. # define WARN_PROTOTYPE 35
  4892. #endif
  4893. #ifndef WARN_QW
  4894. # define WARN_QW 36
  4895. #endif
  4896. #ifndef WARN_RESERVED
  4897. # define WARN_RESERVED 37
  4898. #endif
  4899. #ifndef WARN_SEMICOLON
  4900. # define WARN_SEMICOLON 38
  4901. #endif
  4902. #ifndef WARN_TAINT
  4903. # define WARN_TAINT 39
  4904. #endif
  4905. #ifndef WARN_THREADS
  4906. # define WARN_THREADS 40
  4907. #endif
  4908. #ifndef WARN_UNINITIALIZED
  4909. # define WARN_UNINITIALIZED 41
  4910. #endif
  4911. #ifndef WARN_UNPACK
  4912. # define WARN_UNPACK 42
  4913. #endif
  4914. #ifndef WARN_UNTIE
  4915. # define WARN_UNTIE 43
  4916. #endif
  4917. #ifndef WARN_UTF8
  4918. # define WARN_UTF8 44
  4919. #endif
  4920. #ifndef WARN_VOID
  4921. # define WARN_VOID 45
  4922. #endif
  4923. #ifndef WARN_ASSERTIONS
  4924. # define WARN_ASSERTIONS 46
  4925. #endif
  4926. #ifndef packWARN
  4927. # define packWARN(a) (a)
  4928. #endif
  4929. #ifndef ckWARN
  4930. # ifdef G_WARN_ON
  4931. # define ckWARN(a) (PL_dowarn & G_WARN_ON)
  4932. # else
  4933. # define ckWARN(a) PL_dowarn
  4934. # endif
  4935. #endif
  4936. #if (PERL_BCDVERSION >= 0x5004000) && !defined(warner)
  4937. #if defined(NEED_warner)
  4938. static void DPPP_(my_warner)(U32 err, const char *pat, ...);
  4939. static
  4940. #else
  4941. extern void DPPP_(my_warner)(U32 err, const char *pat, ...);
  4942. #endif
  4943. #define Perl_warner DPPP_(my_warner)
  4944. #if defined(NEED_warner) || defined(NEED_warner_GLOBAL)
  4945. void
  4946. DPPP_(my_warner)(U32 err, const char *pat, ...)
  4947. {
  4948. SV *sv;
  4949. va_list args;
  4950. PERL_UNUSED_ARG(err);
  4951. va_start(args, pat);
  4952. sv = vnewSVpvf(pat, &args);
  4953. va_end(args);
  4954. sv_2mortal(sv);
  4955. warn("%s", SvPV_nolen(sv));
  4956. }
  4957. #define warner Perl_warner
  4958. #define Perl_warner_nocontext Perl_warner
  4959. #endif
  4960. #endif
  4961. /* concatenating with "" ensures that only literal strings are accepted as argument
  4962. * note that STR_WITH_LEN() can't be used as argument to macros or functions that
  4963. * under some configurations might be macros
  4964. */
  4965. #ifndef STR_WITH_LEN
  4966. # define STR_WITH_LEN(s) (s ""), (sizeof(s)-1)
  4967. #endif
  4968. #ifndef newSVpvs
  4969. # define newSVpvs(str) newSVpvn(str "", sizeof(str) - 1)
  4970. #endif
  4971. #ifndef newSVpvs_flags
  4972. # define newSVpvs_flags(str, flags) newSVpvn_flags(str "", sizeof(str) - 1, flags)
  4973. #endif
  4974. #ifndef sv_catpvs
  4975. # define sv_catpvs(sv, str) sv_catpvn(sv, str "", sizeof(str) - 1)
  4976. #endif
  4977. #ifndef sv_setpvs
  4978. # define sv_setpvs(sv, str) sv_setpvn(sv, str "", sizeof(str) - 1)
  4979. #endif
  4980. #ifndef hv_fetchs
  4981. # define hv_fetchs(hv, key, lval) hv_fetch(hv, key "", sizeof(key) - 1, lval)
  4982. #endif
  4983. #ifndef hv_stores
  4984. # define hv_stores(hv, key, val) hv_store(hv, key "", sizeof(key) - 1, val, 0)
  4985. #endif
  4986. #ifndef gv_fetchpvn_flags
  4987. # define gv_fetchpvn_flags(name, len, flags, svt) gv_fetchpv(name, flags, svt)
  4988. #endif
  4989. #ifndef gv_fetchpvs
  4990. # define gv_fetchpvs(name, flags, svt) gv_fetchpvn_flags(name "", sizeof(name) - 1, flags, svt)
  4991. #endif
  4992. #ifndef gv_stashpvs
  4993. # define gv_stashpvs(name, flags) gv_stashpvn(name "", sizeof(name) - 1, flags)
  4994. #endif
  4995. #ifndef SvGETMAGIC
  4996. # define SvGETMAGIC(x) STMT_START { if (SvGMAGICAL(x)) mg_get(x); } STMT_END
  4997. #endif
  4998. #ifndef PERL_MAGIC_sv
  4999. # define PERL_MAGIC_sv '\0'
  5000. #endif
  5001. #ifndef PERL_MAGIC_overload
  5002. # define PERL_MAGIC_overload 'A'
  5003. #endif
  5004. #ifndef PERL_MAGIC_overload_elem
  5005. # define PERL_MAGIC_overload_elem 'a'
  5006. #endif
  5007. #ifndef PERL_MAGIC_overload_table
  5008. # define PERL_MAGIC_overload_table 'c'
  5009. #endif
  5010. #ifndef PERL_MAGIC_bm
  5011. # define PERL_MAGIC_bm 'B'
  5012. #endif
  5013. #ifndef PERL_MAGIC_regdata
  5014. # define PERL_MAGIC_regdata 'D'
  5015. #endif
  5016. #ifndef PERL_MAGIC_regdatum
  5017. # define PERL_MAGIC_regdatum 'd'
  5018. #endif
  5019. #ifndef PERL_MAGIC_env
  5020. # define PERL_MAGIC_env 'E'
  5021. #endif
  5022. #ifndef PERL_MAGIC_envelem
  5023. # define PERL_MAGIC_envelem 'e'
  5024. #endif
  5025. #ifndef PERL_MAGIC_fm
  5026. # define PERL_MAGIC_fm 'f'
  5027. #endif
  5028. #ifndef PERL_MAGIC_regex_global
  5029. # define PERL_MAGIC_regex_global 'g'
  5030. #endif
  5031. #ifndef PERL_MAGIC_isa
  5032. # define PERL_MAGIC_isa 'I'
  5033. #endif
  5034. #ifndef PERL_MAGIC_isaelem
  5035. # define PERL_MAGIC_isaelem 'i'
  5036. #endif
  5037. #ifndef PERL_MAGIC_nkeys
  5038. # define PERL_MAGIC_nkeys 'k'
  5039. #endif
  5040. #ifndef PERL_MAGIC_dbfile
  5041. # define PERL_MAGIC_dbfile 'L'
  5042. #endif
  5043. #ifndef PERL_MAGIC_dbline
  5044. # define PERL_MAGIC_dbline 'l'
  5045. #endif
  5046. #ifndef PERL_MAGIC_mutex
  5047. # define PERL_MAGIC_mutex 'm'
  5048. #endif
  5049. #ifndef PERL_MAGIC_shared
  5050. # define PERL_MAGIC_shared 'N'
  5051. #endif
  5052. #ifndef PERL_MAGIC_shared_scalar
  5053. # define PERL_MAGIC_shared_scalar 'n'
  5054. #endif
  5055. #ifndef PERL_MAGIC_collxfrm
  5056. # define PERL_MAGIC_collxfrm 'o'
  5057. #endif
  5058. #ifndef PERL_MAGIC_tied
  5059. # define PERL_MAGIC_tied 'P'
  5060. #endif
  5061. #ifndef PERL_MAGIC_tiedelem
  5062. # define PERL_MAGIC_tiedelem 'p'
  5063. #endif
  5064. #ifndef PERL_MAGIC_tiedscalar
  5065. # define PERL_MAGIC_tiedscalar 'q'
  5066. #endif
  5067. #ifndef PERL_MAGIC_qr
  5068. # define PERL_MAGIC_qr 'r'
  5069. #endif
  5070. #ifndef PERL_MAGIC_sig
  5071. # define PERL_MAGIC_sig 'S'
  5072. #endif
  5073. #ifndef PERL_MAGIC_sigelem
  5074. # define PERL_MAGIC_sigelem 's'
  5075. #endif
  5076. #ifndef PERL_MAGIC_taint
  5077. # define PERL_MAGIC_taint 't'
  5078. #endif
  5079. #ifndef PERL_MAGIC_uvar
  5080. # define PERL_MAGIC_uvar 'U'
  5081. #endif
  5082. #ifndef PERL_MAGIC_uvar_elem
  5083. # define PERL_MAGIC_uvar_elem 'u'
  5084. #endif
  5085. #ifndef PERL_MAGIC_vstring
  5086. # define PERL_MAGIC_vstring 'V'
  5087. #endif
  5088. #ifndef PERL_MAGIC_vec
  5089. # define PERL_MAGIC_vec 'v'
  5090. #endif
  5091. #ifndef PERL_MAGIC_utf8
  5092. # define PERL_MAGIC_utf8 'w'
  5093. #endif
  5094. #ifndef PERL_MAGIC_substr
  5095. # define PERL_MAGIC_substr 'x'
  5096. #endif
  5097. #ifndef PERL_MAGIC_defelem
  5098. # define PERL_MAGIC_defelem 'y'
  5099. #endif
  5100. #ifndef PERL_MAGIC_glob
  5101. # define PERL_MAGIC_glob '*'
  5102. #endif
  5103. #ifndef PERL_MAGIC_arylen
  5104. # define PERL_MAGIC_arylen '#'
  5105. #endif
  5106. #ifndef PERL_MAGIC_pos
  5107. # define PERL_MAGIC_pos '.'
  5108. #endif
  5109. #ifndef PERL_MAGIC_backref
  5110. # define PERL_MAGIC_backref '<'
  5111. #endif
  5112. #ifndef PERL_MAGIC_ext
  5113. # define PERL_MAGIC_ext '~'
  5114. #endif
  5115. /* That's the best we can do... */
  5116. #ifndef sv_catpvn_nomg
  5117. # define sv_catpvn_nomg sv_catpvn
  5118. #endif
  5119. #ifndef sv_catsv_nomg
  5120. # define sv_catsv_nomg sv_catsv
  5121. #endif
  5122. #ifndef sv_setsv_nomg
  5123. # define sv_setsv_nomg sv_setsv
  5124. #endif
  5125. #ifndef sv_pvn_nomg
  5126. # define sv_pvn_nomg sv_pvn
  5127. #endif
  5128. #ifndef SvIV_nomg
  5129. # define SvIV_nomg SvIV
  5130. #endif
  5131. #ifndef SvUV_nomg
  5132. # define SvUV_nomg SvUV
  5133. #endif
  5134. #ifndef sv_catpv_mg
  5135. # define sv_catpv_mg(sv, ptr) \
  5136. STMT_START { \
  5137. SV *TeMpSv = sv; \
  5138. sv_catpv(TeMpSv,ptr); \
  5139. SvSETMAGIC(TeMpSv); \
  5140. } STMT_END
  5141. #endif
  5142. #ifndef sv_catpvn_mg
  5143. # define sv_catpvn_mg(sv, ptr, len) \
  5144. STMT_START { \
  5145. SV *TeMpSv = sv; \
  5146. sv_catpvn(TeMpSv,ptr,len); \
  5147. SvSETMAGIC(TeMpSv); \
  5148. } STMT_END
  5149. #endif
  5150. #ifndef sv_catsv_mg
  5151. # define sv_catsv_mg(dsv, ssv) \
  5152. STMT_START { \
  5153. SV *TeMpSv = dsv; \
  5154. sv_catsv(TeMpSv,ssv); \
  5155. SvSETMAGIC(TeMpSv); \
  5156. } STMT_END
  5157. #endif
  5158. #ifndef sv_setiv_mg
  5159. # define sv_setiv_mg(sv, i) \
  5160. STMT_START { \
  5161. SV *TeMpSv = sv; \
  5162. sv_setiv(TeMpSv,i); \
  5163. SvSETMAGIC(TeMpSv); \
  5164. } STMT_END
  5165. #endif
  5166. #ifndef sv_setnv_mg
  5167. # define sv_setnv_mg(sv, num) \
  5168. STMT_START { \
  5169. SV *TeMpSv = sv; \
  5170. sv_setnv(TeMpSv,num); \
  5171. SvSETMAGIC(TeMpSv); \
  5172. } STMT_END
  5173. #endif
  5174. #ifndef sv_setpv_mg
  5175. # define sv_setpv_mg(sv, ptr) \
  5176. STMT_START { \
  5177. SV *TeMpSv = sv; \
  5178. sv_setpv(TeMpSv,ptr); \
  5179. SvSETMAGIC(TeMpSv); \
  5180. } STMT_END
  5181. #endif
  5182. #ifndef sv_setpvn_mg
  5183. # define sv_setpvn_mg(sv, ptr, len) \
  5184. STMT_START { \
  5185. SV *TeMpSv = sv; \
  5186. sv_setpvn(TeMpSv,ptr,len); \
  5187. SvSETMAGIC(TeMpSv); \
  5188. } STMT_END
  5189. #endif
  5190. #ifndef sv_setsv_mg
  5191. # define sv_setsv_mg(dsv, ssv) \
  5192. STMT_START { \
  5193. SV *TeMpSv = dsv; \
  5194. sv_setsv(TeMpSv,ssv); \
  5195. SvSETMAGIC(TeMpSv); \
  5196. } STMT_END
  5197. #endif
  5198. #ifndef sv_setuv_mg
  5199. # define sv_setuv_mg(sv, i) \
  5200. STMT_START { \
  5201. SV *TeMpSv = sv; \
  5202. sv_setuv(TeMpSv,i); \
  5203. SvSETMAGIC(TeMpSv); \
  5204. } STMT_END
  5205. #endif
  5206. #ifndef sv_usepvn_mg
  5207. # define sv_usepvn_mg(sv, ptr, len) \
  5208. STMT_START { \
  5209. SV *TeMpSv = sv; \
  5210. sv_usepvn(TeMpSv,ptr,len); \
  5211. SvSETMAGIC(TeMpSv); \
  5212. } STMT_END
  5213. #endif
  5214. #ifndef SvVSTRING_mg
  5215. # define SvVSTRING_mg(sv) (SvMAGICAL(sv) ? mg_find(sv, PERL_MAGIC_vstring) : NULL)
  5216. #endif
  5217. /* Hint: sv_magic_portable
  5218. * This is a compatibility function that is only available with
  5219. * Devel::PPPort. It is NOT in the perl core.
  5220. * Its purpose is to mimic the 5.8.0 behaviour of sv_magic() when
  5221. * it is being passed a name pointer with namlen == 0. In that
  5222. * case, perl 5.8.0 and later store the pointer, not a copy of it.
  5223. * The compatibility can be provided back to perl 5.004. With
  5224. * earlier versions, the code will not compile.
  5225. */
  5226. #if (PERL_BCDVERSION < 0x5004000)
  5227. /* code that uses sv_magic_portable will not compile */
  5228. #elif (PERL_BCDVERSION < 0x5008000)
  5229. # define sv_magic_portable(sv, obj, how, name, namlen) \
  5230. STMT_START { \
  5231. SV *SvMp_sv = (sv); \
  5232. char *SvMp_name = (char *) (name); \
  5233. I32 SvMp_namlen = (namlen); \
  5234. if (SvMp_name && SvMp_namlen == 0) \
  5235. { \
  5236. MAGIC *mg; \
  5237. sv_magic(SvMp_sv, obj, how, 0, 0); \
  5238. mg = SvMAGIC(SvMp_sv); \
  5239. mg->mg_len = -42; /* XXX: this is the tricky part */ \
  5240. mg->mg_ptr = SvMp_name; \
  5241. } \
  5242. else \
  5243. { \
  5244. sv_magic(SvMp_sv, obj, how, SvMp_name, SvMp_namlen); \
  5245. } \
  5246. } STMT_END
  5247. #else
  5248. # define sv_magic_portable(a, b, c, d, e) sv_magic(a, b, c, d, e)
  5249. #endif
  5250. #ifdef USE_ITHREADS
  5251. #ifndef CopFILE
  5252. # define CopFILE(c) ((c)->cop_file)
  5253. #endif
  5254. #ifndef CopFILEGV
  5255. # define CopFILEGV(c) (CopFILE(c) ? gv_fetchfile(CopFILE(c)) : Nullgv)
  5256. #endif
  5257. #ifndef CopFILE_set
  5258. # define CopFILE_set(c,pv) ((c)->cop_file = savepv(pv))
  5259. #endif
  5260. #ifndef CopFILESV
  5261. # define CopFILESV(c) (CopFILE(c) ? GvSV(gv_fetchfile(CopFILE(c))) : Nullsv)
  5262. #endif
  5263. #ifndef CopFILEAV
  5264. # define CopFILEAV(c) (CopFILE(c) ? GvAV(gv_fetchfile(CopFILE(c))) : Nullav)
  5265. #endif
  5266. #ifndef CopSTASHPV
  5267. # define CopSTASHPV(c) ((c)->cop_stashpv)
  5268. #endif
  5269. #ifndef CopSTASHPV_set
  5270. # define CopSTASHPV_set(c,pv) ((c)->cop_stashpv = ((pv) ? savepv(pv) : Nullch))
  5271. #endif
  5272. #ifndef CopSTASH
  5273. # define CopSTASH(c) (CopSTASHPV(c) ? gv_stashpv(CopSTASHPV(c),GV_ADD) : Nullhv)
  5274. #endif
  5275. #ifndef CopSTASH_set
  5276. # define CopSTASH_set(c,hv) CopSTASHPV_set(c, (hv) ? HvNAME(hv) : Nullch)
  5277. #endif
  5278. #ifndef CopSTASH_eq
  5279. # define CopSTASH_eq(c,hv) ((hv) && (CopSTASHPV(c) == HvNAME(hv) \
  5280. || (CopSTASHPV(c) && HvNAME(hv) \
  5281. && strEQ(CopSTASHPV(c), HvNAME(hv)))))
  5282. #endif
  5283. #else
  5284. #ifndef CopFILEGV
  5285. # define CopFILEGV(c) ((c)->cop_filegv)
  5286. #endif
  5287. #ifndef CopFILEGV_set
  5288. # define CopFILEGV_set(c,gv) ((c)->cop_filegv = (GV*)SvREFCNT_inc(gv))
  5289. #endif
  5290. #ifndef CopFILE_set
  5291. # define CopFILE_set(c,pv) CopFILEGV_set((c), gv_fetchfile(pv))
  5292. #endif
  5293. #ifndef CopFILESV
  5294. # define CopFILESV(c) (CopFILEGV(c) ? GvSV(CopFILEGV(c)) : Nullsv)
  5295. #endif
  5296. #ifndef CopFILEAV
  5297. # define CopFILEAV(c) (CopFILEGV(c) ? GvAV(CopFILEGV(c)) : Nullav)
  5298. #endif
  5299. #ifndef CopFILE
  5300. # define CopFILE(c) (CopFILESV(c) ? SvPVX(CopFILESV(c)) : Nullch)
  5301. #endif
  5302. #ifndef CopSTASH
  5303. # define CopSTASH(c) ((c)->cop_stash)
  5304. #endif
  5305. #ifndef CopSTASH_set
  5306. # define CopSTASH_set(c,hv) ((c)->cop_stash = (hv))
  5307. #endif
  5308. #ifndef CopSTASHPV
  5309. # define CopSTASHPV(c) (CopSTASH(c) ? HvNAME(CopSTASH(c)) : Nullch)
  5310. #endif
  5311. #ifndef CopSTASHPV_set
  5312. # define CopSTASHPV_set(c,pv) CopSTASH_set((c), gv_stashpv(pv,GV_ADD))
  5313. #endif
  5314. #ifndef CopSTASH_eq
  5315. # define CopSTASH_eq(c,hv) (CopSTASH(c) == (hv))
  5316. #endif
  5317. #endif /* USE_ITHREADS */
  5318. #ifndef IN_PERL_COMPILETIME
  5319. # define IN_PERL_COMPILETIME (PL_curcop == &PL_compiling)
  5320. #endif
  5321. #ifndef IN_LOCALE_RUNTIME
  5322. # define IN_LOCALE_RUNTIME (PL_curcop->op_private & HINT_LOCALE)
  5323. #endif
  5324. #ifndef IN_LOCALE_COMPILETIME
  5325. # define IN_LOCALE_COMPILETIME (PL_hints & HINT_LOCALE)
  5326. #endif
  5327. #ifndef IN_LOCALE
  5328. # define IN_LOCALE (IN_PERL_COMPILETIME ? IN_LOCALE_COMPILETIME : IN_LOCALE_RUNTIME)
  5329. #endif
  5330. #ifndef IS_NUMBER_IN_UV
  5331. # define IS_NUMBER_IN_UV 0x01
  5332. #endif
  5333. #ifndef IS_NUMBER_GREATER_THAN_UV_MAX
  5334. # define IS_NUMBER_GREATER_THAN_UV_MAX 0x02
  5335. #endif
  5336. #ifndef IS_NUMBER_NOT_INT
  5337. # define IS_NUMBER_NOT_INT 0x04
  5338. #endif
  5339. #ifndef IS_NUMBER_NEG
  5340. # define IS_NUMBER_NEG 0x08
  5341. #endif
  5342. #ifndef IS_NUMBER_INFINITY
  5343. # define IS_NUMBER_INFINITY 0x10
  5344. #endif
  5345. #ifndef IS_NUMBER_NAN
  5346. # define IS_NUMBER_NAN 0x20
  5347. #endif
  5348. #ifndef GROK_NUMERIC_RADIX
  5349. # define GROK_NUMERIC_RADIX(sp, send) grok_numeric_radix(sp, send)
  5350. #endif
  5351. #ifndef PERL_SCAN_GREATER_THAN_UV_MAX
  5352. # define PERL_SCAN_GREATER_THAN_UV_MAX 0x02
  5353. #endif
  5354. #ifndef PERL_SCAN_SILENT_ILLDIGIT
  5355. # define PERL_SCAN_SILENT_ILLDIGIT 0x04
  5356. #endif
  5357. #ifndef PERL_SCAN_ALLOW_UNDERSCORES
  5358. # define PERL_SCAN_ALLOW_UNDERSCORES 0x01
  5359. #endif
  5360. #ifndef PERL_SCAN_DISALLOW_PREFIX
  5361. # define PERL_SCAN_DISALLOW_PREFIX 0x02
  5362. #endif
  5363. #ifndef grok_numeric_radix
  5364. #if defined(NEED_grok_numeric_radix)
  5365. static bool DPPP_(my_grok_numeric_radix)(pTHX_ const char ** sp, const char * send);
  5366. static
  5367. #else
  5368. extern bool DPPP_(my_grok_numeric_radix)(pTHX_ const char ** sp, const char * send);
  5369. #endif
  5370. #ifdef grok_numeric_radix
  5371. # undef grok_numeric_radix
  5372. #endif
  5373. #define grok_numeric_radix(a,b) DPPP_(my_grok_numeric_radix)(aTHX_ a,b)
  5374. #define Perl_grok_numeric_radix DPPP_(my_grok_numeric_radix)
  5375. #if defined(NEED_grok_numeric_radix) || defined(NEED_grok_numeric_radix_GLOBAL)
  5376. bool
  5377. DPPP_(my_grok_numeric_radix)(pTHX_ const char **sp, const char *send)
  5378. {
  5379. #ifdef USE_LOCALE_NUMERIC
  5380. #ifdef PL_numeric_radix_sv
  5381. if (PL_numeric_radix_sv && IN_LOCALE) {
  5382. STRLEN len;
  5383. char* radix = SvPV(PL_numeric_radix_sv, len);
  5384. if (*sp + len <= send && memEQ(*sp, radix, len)) {
  5385. *sp += len;
  5386. return TRUE;
  5387. }
  5388. }
  5389. #else
  5390. /* older perls don't have PL_numeric_radix_sv so the radix
  5391. * must manually be requested from locale.h
  5392. */
  5393. #include <locale.h>
  5394. dTHR; /* needed for older threaded perls */
  5395. struct lconv *lc = localeconv();
  5396. char *radix = lc->decimal_point;
  5397. if (radix && IN_LOCALE) {
  5398. STRLEN len = strlen(radix);
  5399. if (*sp + len <= send && memEQ(*sp, radix, len)) {
  5400. *sp += len;
  5401. return TRUE;
  5402. }
  5403. }
  5404. #endif
  5405. #endif /* USE_LOCALE_NUMERIC */
  5406. /* always try "." if numeric radix didn't match because
  5407. * we may have data from different locales mixed */
  5408. if (*sp < send && **sp == '.') {
  5409. ++*sp;
  5410. return TRUE;
  5411. }
  5412. return FALSE;
  5413. }
  5414. #endif
  5415. #endif
  5416. #ifndef grok_number
  5417. #if defined(NEED_grok_number)
  5418. static int DPPP_(my_grok_number)(pTHX_ const char * pv, STRLEN len, UV * valuep);
  5419. static
  5420. #else
  5421. extern int DPPP_(my_grok_number)(pTHX_ const char * pv, STRLEN len, UV * valuep);
  5422. #endif
  5423. #ifdef grok_number
  5424. # undef grok_number
  5425. #endif
  5426. #define grok_number(a,b,c) DPPP_(my_grok_number)(aTHX_ a,b,c)
  5427. #define Perl_grok_number DPPP_(my_grok_number)
  5428. #if defined(NEED_grok_number) || defined(NEED_grok_number_GLOBAL)
  5429. int
  5430. DPPP_(my_grok_number)(pTHX_ const char *pv, STRLEN len, UV *valuep)
  5431. {
  5432. const char *s = pv;
  5433. const char *send = pv + len;
  5434. const UV max_div_10 = UV_MAX / 10;
  5435. const char max_mod_10 = UV_MAX % 10;
  5436. int numtype = 0;
  5437. int sawinf = 0;
  5438. int sawnan = 0;
  5439. while (s < send && isSPACE(*s))
  5440. s++;
  5441. if (s == send) {
  5442. return 0;
  5443. } else if (*s == '-') {
  5444. s++;
  5445. numtype = IS_NUMBER_NEG;
  5446. }
  5447. else if (*s == '+')
  5448. s++;
  5449. if (s == send)
  5450. return 0;
  5451. /* next must be digit or the radix separator or beginning of infinity */
  5452. if (isDIGIT(*s)) {
  5453. /* UVs are at least 32 bits, so the first 9 decimal digits cannot
  5454. overflow. */
  5455. UV value = *s - '0';
  5456. /* This construction seems to be more optimiser friendly.
  5457. (without it gcc does the isDIGIT test and the *s - '0' separately)
  5458. With it gcc on arm is managing 6 instructions (6 cycles) per digit.
  5459. In theory the optimiser could deduce how far to unroll the loop
  5460. before checking for overflow. */
  5461. if (++s < send) {
  5462. int digit = *s - '0';
  5463. if (digit >= 0 && digit <= 9) {
  5464. value = value * 10 + digit;
  5465. if (++s < send) {
  5466. digit = *s - '0';
  5467. if (digit >= 0 && digit <= 9) {
  5468. value = value * 10 + digit;
  5469. if (++s < send) {
  5470. digit = *s - '0';
  5471. if (digit >= 0 && digit <= 9) {
  5472. value = value * 10 + digit;
  5473. if (++s < send) {
  5474. digit = *s - '0';
  5475. if (digit >= 0 && digit <= 9) {
  5476. value = value * 10 + digit;
  5477. if (++s < send) {
  5478. digit = *s - '0';
  5479. if (digit >= 0 && digit <= 9) {
  5480. value = value * 10 + digit;
  5481. if (++s < send) {
  5482. digit = *s - '0';
  5483. if (digit >= 0 && digit <= 9) {
  5484. value = value * 10 + digit;
  5485. if (++s < send) {
  5486. digit = *s - '0';
  5487. if (digit >= 0 && digit <= 9) {
  5488. value = value * 10 + digit;
  5489. if (++s < send) {
  5490. digit = *s - '0';
  5491. if (digit >= 0 && digit <= 9) {
  5492. value = value * 10 + digit;
  5493. if (++s < send) {
  5494. /* Now got 9 digits, so need to check
  5495. each time for overflow. */
  5496. digit = *s - '0';
  5497. while (digit >= 0 && digit <= 9
  5498. && (value < max_div_10
  5499. || (value == max_div_10
  5500. && digit <= max_mod_10))) {
  5501. value = value * 10 + digit;
  5502. if (++s < send)
  5503. digit = *s - '0';
  5504. else
  5505. break;
  5506. }
  5507. if (digit >= 0 && digit <= 9
  5508. && (s < send)) {
  5509. /* value overflowed.
  5510. skip the remaining digits, don't
  5511. worry about setting *valuep. */
  5512. do {
  5513. s++;
  5514. } while (s < send && isDIGIT(*s));
  5515. numtype |=
  5516. IS_NUMBER_GREATER_THAN_UV_MAX;
  5517. goto skip_value;
  5518. }
  5519. }
  5520. }
  5521. }
  5522. }
  5523. }
  5524. }
  5525. }
  5526. }
  5527. }
  5528. }
  5529. }
  5530. }
  5531. }
  5532. }
  5533. }
  5534. }
  5535. }
  5536. numtype |= IS_NUMBER_IN_UV;
  5537. if (valuep)
  5538. *valuep = value;
  5539. skip_value:
  5540. if (GROK_NUMERIC_RADIX(&s, send)) {
  5541. numtype |= IS_NUMBER_NOT_INT;
  5542. while (s < send && isDIGIT(*s)) /* optional digits after the radix */
  5543. s++;
  5544. }
  5545. }
  5546. else if (GROK_NUMERIC_RADIX(&s, send)) {
  5547. numtype |= IS_NUMBER_NOT_INT | IS_NUMBER_IN_UV; /* valuep assigned below */
  5548. /* no digits before the radix means we need digits after it */
  5549. if (s < send && isDIGIT(*s)) {
  5550. do {
  5551. s++;
  5552. } while (s < send && isDIGIT(*s));
  5553. if (valuep) {
  5554. /* integer approximation is valid - it's 0. */
  5555. *valuep = 0;
  5556. }
  5557. }
  5558. else
  5559. return 0;
  5560. } else if (*s == 'I' || *s == 'i') {
  5561. s++; if (s == send || (*s != 'N' && *s != 'n')) return 0;
  5562. s++; if (s == send || (*s != 'F' && *s != 'f')) return 0;
  5563. s++; if (s < send && (*s == 'I' || *s == 'i')) {
  5564. s++; if (s == send || (*s != 'N' && *s != 'n')) return 0;
  5565. s++; if (s == send || (*s != 'I' && *s != 'i')) return 0;
  5566. s++; if (s == send || (*s != 'T' && *s != 't')) return 0;
  5567. s++; if (s == send || (*s != 'Y' && *s != 'y')) return 0;
  5568. s++;
  5569. }
  5570. sawinf = 1;
  5571. } else if (*s == 'N' || *s == 'n') {
  5572. /* XXX TODO: There are signaling NaNs and quiet NaNs. */
  5573. s++; if (s == send || (*s != 'A' && *s != 'a')) return 0;
  5574. s++; if (s == send || (*s != 'N' && *s != 'n')) return 0;
  5575. s++;
  5576. sawnan = 1;
  5577. } else
  5578. return 0;
  5579. if (sawinf) {
  5580. numtype &= IS_NUMBER_NEG; /* Keep track of sign */
  5581. numtype |= IS_NUMBER_INFINITY | IS_NUMBER_NOT_INT;
  5582. } else if (sawnan) {
  5583. numtype &= IS_NUMBER_NEG; /* Keep track of sign */
  5584. numtype |= IS_NUMBER_NAN | IS_NUMBER_NOT_INT;
  5585. } else if (s < send) {
  5586. /* we can have an optional exponent part */
  5587. if (*s == 'e' || *s == 'E') {
  5588. /* The only flag we keep is sign. Blow away any "it's UV" */
  5589. numtype &= IS_NUMBER_NEG;
  5590. numtype |= IS_NUMBER_NOT_INT;
  5591. s++;
  5592. if (s < send && (*s == '-' || *s == '+'))
  5593. s++;
  5594. if (s < send && isDIGIT(*s)) {
  5595. do {
  5596. s++;
  5597. } while (s < send && isDIGIT(*s));
  5598. }
  5599. else
  5600. return 0;
  5601. }
  5602. }
  5603. while (s < send && isSPACE(*s))
  5604. s++;
  5605. if (s >= send)
  5606. return numtype;
  5607. if (len == 10 && memEQ(pv, "0 but true", 10)) {
  5608. if (valuep)
  5609. *valuep = 0;
  5610. return IS_NUMBER_IN_UV;
  5611. }
  5612. return 0;
  5613. }
  5614. #endif
  5615. #endif
  5616. /*
  5617. * The grok_* routines have been modified to use warn() instead of
  5618. * Perl_warner(). Also, 'hexdigit' was the former name of PL_hexdigit,
  5619. * which is why the stack variable has been renamed to 'xdigit'.
  5620. */
  5621. #ifndef grok_bin
  5622. #if defined(NEED_grok_bin)
  5623. static UV DPPP_(my_grok_bin)(pTHX_ const char * start, STRLEN * len_p, I32 * flags, NV * result);
  5624. static
  5625. #else
  5626. extern UV DPPP_(my_grok_bin)(pTHX_ const char * start, STRLEN * len_p, I32 * flags, NV * result);
  5627. #endif
  5628. #ifdef grok_bin
  5629. # undef grok_bin
  5630. #endif
  5631. #define grok_bin(a,b,c,d) DPPP_(my_grok_bin)(aTHX_ a,b,c,d)
  5632. #define Perl_grok_bin DPPP_(my_grok_bin)
  5633. #if defined(NEED_grok_bin) || defined(NEED_grok_bin_GLOBAL)
  5634. UV
  5635. DPPP_(my_grok_bin)(pTHX_ const char *start, STRLEN *len_p, I32 *flags, NV *result)
  5636. {
  5637. const char *s = start;
  5638. STRLEN len = *len_p;
  5639. UV value = 0;
  5640. NV value_nv = 0;
  5641. const UV max_div_2 = UV_MAX / 2;
  5642. bool allow_underscores = *flags & PERL_SCAN_ALLOW_UNDERSCORES;
  5643. bool overflowed = FALSE;
  5644. if (!(*flags & PERL_SCAN_DISALLOW_PREFIX)) {
  5645. /* strip off leading b or 0b.
  5646. for compatibility silently suffer "b" and "0b" as valid binary
  5647. numbers. */
  5648. if (len >= 1) {
  5649. if (s[0] == 'b') {
  5650. s++;
  5651. len--;
  5652. }
  5653. else if (len >= 2 && s[0] == '0' && s[1] == 'b') {
  5654. s+=2;
  5655. len-=2;
  5656. }
  5657. }
  5658. }
  5659. for (; len-- && *s; s++) {
  5660. char bit = *s;
  5661. if (bit == '0' || bit == '1') {
  5662. /* Write it in this wonky order with a goto to attempt to get the
  5663. compiler to make the common case integer-only loop pretty tight.
  5664. With gcc seems to be much straighter code than old scan_bin. */
  5665. redo:
  5666. if (!overflowed) {
  5667. if (value <= max_div_2) {
  5668. value = (value << 1) | (bit - '0');
  5669. continue;
  5670. }
  5671. /* Bah. We're just overflowed. */
  5672. warn("Integer overflow in binary number");
  5673. overflowed = TRUE;
  5674. value_nv = (NV) value;
  5675. }
  5676. value_nv *= 2.0;
  5677. /* If an NV has not enough bits in its mantissa to
  5678. * represent a UV this summing of small low-order numbers
  5679. * is a waste of time (because the NV cannot preserve
  5680. * the low-order bits anyway): we could just remember when
  5681. * did we overflow and in the end just multiply value_nv by the
  5682. * right amount. */
  5683. value_nv += (NV)(bit - '0');
  5684. continue;
  5685. }
  5686. if (bit == '_' && len && allow_underscores && (bit = s[1])
  5687. && (bit == '0' || bit == '1'))
  5688. {
  5689. --len;
  5690. ++s;
  5691. goto redo;
  5692. }
  5693. if (!(*flags & PERL_SCAN_SILENT_ILLDIGIT))
  5694. warn("Illegal binary digit '%c' ignored", *s);
  5695. break;
  5696. }
  5697. if ( ( overflowed && value_nv > 4294967295.0)
  5698. #if UVSIZE > 4
  5699. || (!overflowed && value > 0xffffffff )
  5700. #endif
  5701. ) {
  5702. warn("Binary number > 0b11111111111111111111111111111111 non-portable");
  5703. }
  5704. *len_p = s - start;
  5705. if (!overflowed) {
  5706. *flags = 0;
  5707. return value;
  5708. }
  5709. *flags = PERL_SCAN_GREATER_THAN_UV_MAX;
  5710. if (result)
  5711. *result = value_nv;
  5712. return UV_MAX;
  5713. }
  5714. #endif
  5715. #endif
  5716. #ifndef grok_hex
  5717. #if defined(NEED_grok_hex)
  5718. static UV DPPP_(my_grok_hex)(pTHX_ const char * start, STRLEN * len_p, I32 * flags, NV * result);
  5719. static
  5720. #else
  5721. extern UV DPPP_(my_grok_hex)(pTHX_ const char * start, STRLEN * len_p, I32 * flags, NV * result);
  5722. #endif
  5723. #ifdef grok_hex
  5724. # undef grok_hex
  5725. #endif
  5726. #define grok_hex(a,b,c,d) DPPP_(my_grok_hex)(aTHX_ a,b,c,d)
  5727. #define Perl_grok_hex DPPP_(my_grok_hex)
  5728. #if defined(NEED_grok_hex) || defined(NEED_grok_hex_GLOBAL)
  5729. UV
  5730. DPPP_(my_grok_hex)(pTHX_ const char *start, STRLEN *len_p, I32 *flags, NV *result)
  5731. {
  5732. const char *s = start;
  5733. STRLEN len = *len_p;
  5734. UV value = 0;
  5735. NV value_nv = 0;
  5736. const UV max_div_16 = UV_MAX / 16;
  5737. bool allow_underscores = *flags & PERL_SCAN_ALLOW_UNDERSCORES;
  5738. bool overflowed = FALSE;
  5739. const char *xdigit;
  5740. if (!(*flags & PERL_SCAN_DISALLOW_PREFIX)) {
  5741. /* strip off leading x or 0x.
  5742. for compatibility silently suffer "x" and "0x" as valid hex numbers.
  5743. */
  5744. if (len >= 1) {
  5745. if (s[0] == 'x') {
  5746. s++;
  5747. len--;
  5748. }
  5749. else if (len >= 2 && s[0] == '0' && s[1] == 'x') {
  5750. s+=2;
  5751. len-=2;
  5752. }
  5753. }
  5754. }
  5755. for (; len-- && *s; s++) {
  5756. xdigit = strchr((char *) PL_hexdigit, *s);
  5757. if (xdigit) {
  5758. /* Write it in this wonky order with a goto to attempt to get the
  5759. compiler to make the common case integer-only loop pretty tight.
  5760. With gcc seems to be much straighter code than old scan_hex. */
  5761. redo:
  5762. if (!overflowed) {
  5763. if (value <= max_div_16) {
  5764. value = (value << 4) | ((xdigit - PL_hexdigit) & 15);
  5765. continue;
  5766. }
  5767. warn("Integer overflow in hexadecimal number");
  5768. overflowed = TRUE;
  5769. value_nv = (NV) value;
  5770. }
  5771. value_nv *= 16.0;
  5772. /* If an NV has not enough bits in its mantissa to
  5773. * represent a UV this summing of small low-order numbers
  5774. * is a waste of time (because the NV cannot preserve
  5775. * the low-order bits anyway): we could just remember when
  5776. * did we overflow and in the end just multiply value_nv by the
  5777. * right amount of 16-tuples. */
  5778. value_nv += (NV)((xdigit - PL_hexdigit) & 15);
  5779. continue;
  5780. }
  5781. if (*s == '_' && len && allow_underscores && s[1]
  5782. && (xdigit = strchr((char *) PL_hexdigit, s[1])))
  5783. {
  5784. --len;
  5785. ++s;
  5786. goto redo;
  5787. }
  5788. if (!(*flags & PERL_SCAN_SILENT_ILLDIGIT))
  5789. warn("Illegal hexadecimal digit '%c' ignored", *s);
  5790. break;
  5791. }
  5792. if ( ( overflowed && value_nv > 4294967295.0)
  5793. #if UVSIZE > 4
  5794. || (!overflowed && value > 0xffffffff )
  5795. #endif
  5796. ) {
  5797. warn("Hexadecimal number > 0xffffffff non-portable");
  5798. }
  5799. *len_p = s - start;
  5800. if (!overflowed) {
  5801. *flags = 0;
  5802. return value;
  5803. }
  5804. *flags = PERL_SCAN_GREATER_THAN_UV_MAX;
  5805. if (result)
  5806. *result = value_nv;
  5807. return UV_MAX;
  5808. }
  5809. #endif
  5810. #endif
  5811. #ifndef grok_oct
  5812. #if defined(NEED_grok_oct)
  5813. static UV DPPP_(my_grok_oct)(pTHX_ const char * start, STRLEN * len_p, I32 * flags, NV * result);
  5814. static
  5815. #else
  5816. extern UV DPPP_(my_grok_oct)(pTHX_ const char * start, STRLEN * len_p, I32 * flags, NV * result);
  5817. #endif
  5818. #ifdef grok_oct
  5819. # undef grok_oct
  5820. #endif
  5821. #define grok_oct(a,b,c,d) DPPP_(my_grok_oct)(aTHX_ a,b,c,d)
  5822. #define Perl_grok_oct DPPP_(my_grok_oct)
  5823. #if defined(NEED_grok_oct) || defined(NEED_grok_oct_GLOBAL)
  5824. UV
  5825. DPPP_(my_grok_oct)(pTHX_ const char *start, STRLEN *len_p, I32 *flags, NV *result)
  5826. {
  5827. const char *s = start;
  5828. STRLEN len = *len_p;
  5829. UV value = 0;
  5830. NV value_nv = 0;
  5831. const UV max_div_8 = UV_MAX / 8;
  5832. bool allow_underscores = *flags & PERL_SCAN_ALLOW_UNDERSCORES;
  5833. bool overflowed = FALSE;
  5834. for (; len-- && *s; s++) {
  5835. /* gcc 2.95 optimiser not smart enough to figure that this subtraction
  5836. out front allows slicker code. */
  5837. int digit = *s - '0';
  5838. if (digit >= 0 && digit <= 7) {
  5839. /* Write it in this wonky order with a goto to attempt to get the
  5840. compiler to make the common case integer-only loop pretty tight.
  5841. */
  5842. redo:
  5843. if (!overflowed) {
  5844. if (value <= max_div_8) {
  5845. value = (value << 3) | digit;
  5846. continue;
  5847. }
  5848. /* Bah. We're just overflowed. */
  5849. warn("Integer overflow in octal number");
  5850. overflowed = TRUE;
  5851. value_nv = (NV) value;
  5852. }
  5853. value_nv *= 8.0;
  5854. /* If an NV has not enough bits in its mantissa to
  5855. * represent a UV this summing of small low-order numbers
  5856. * is a waste of time (because the NV cannot preserve
  5857. * the low-order bits anyway): we could just remember when
  5858. * did we overflow and in the end just multiply value_nv by the
  5859. * right amount of 8-tuples. */
  5860. value_nv += (NV)digit;
  5861. continue;
  5862. }
  5863. if (digit == ('_' - '0') && len && allow_underscores
  5864. && (digit = s[1] - '0') && (digit >= 0 && digit <= 7))
  5865. {
  5866. --len;
  5867. ++s;
  5868. goto redo;
  5869. }
  5870. /* Allow \octal to work the DWIM way (that is, stop scanning
  5871. * as soon as non-octal characters are seen, complain only iff
  5872. * someone seems to want to use the digits eight and nine). */
  5873. if (digit == 8 || digit == 9) {
  5874. if (!(*flags & PERL_SCAN_SILENT_ILLDIGIT))
  5875. warn("Illegal octal digit '%c' ignored", *s);
  5876. }
  5877. break;
  5878. }
  5879. if ( ( overflowed && value_nv > 4294967295.0)
  5880. #if UVSIZE > 4
  5881. || (!overflowed && value > 0xffffffff )
  5882. #endif
  5883. ) {
  5884. warn("Octal number > 037777777777 non-portable");
  5885. }
  5886. *len_p = s - start;
  5887. if (!overflowed) {
  5888. *flags = 0;
  5889. return value;
  5890. }
  5891. *flags = PERL_SCAN_GREATER_THAN_UV_MAX;
  5892. if (result)
  5893. *result = value_nv;
  5894. return UV_MAX;
  5895. }
  5896. #endif
  5897. #endif
  5898. #if !defined(my_snprintf)
  5899. #if defined(NEED_my_snprintf)
  5900. static int DPPP_(my_my_snprintf)(char * buffer, const Size_t len, const char * format, ...);
  5901. static
  5902. #else
  5903. extern int DPPP_(my_my_snprintf)(char * buffer, const Size_t len, const char * format, ...);
  5904. #endif
  5905. #define my_snprintf DPPP_(my_my_snprintf)
  5906. #define Perl_my_snprintf DPPP_(my_my_snprintf)
  5907. #if defined(NEED_my_snprintf) || defined(NEED_my_snprintf_GLOBAL)
  5908. int
  5909. DPPP_(my_my_snprintf)(char *buffer, const Size_t len, const char *format, ...)
  5910. {
  5911. dTHX;
  5912. int retval;
  5913. va_list ap;
  5914. va_start(ap, format);
  5915. #ifdef HAS_VSNPRINTF
  5916. retval = vsnprintf(buffer, len, format, ap);
  5917. #else
  5918. retval = vsprintf(buffer, format, ap);
  5919. #endif
  5920. va_end(ap);
  5921. if (retval < 0 || (len > 0 && (Size_t)retval >= len))
  5922. Perl_croak(aTHX_ "panic: my_snprintf buffer overflow");
  5923. return retval;
  5924. }
  5925. #endif
  5926. #endif
  5927. #if !defined(my_sprintf)
  5928. #if defined(NEED_my_sprintf)
  5929. static int DPPP_(my_my_sprintf)(char * buffer, const char * pat, ...);
  5930. static
  5931. #else
  5932. extern int DPPP_(my_my_sprintf)(char * buffer, const char * pat, ...);
  5933. #endif
  5934. #define my_sprintf DPPP_(my_my_sprintf)
  5935. #define Perl_my_sprintf DPPP_(my_my_sprintf)
  5936. #if defined(NEED_my_sprintf) || defined(NEED_my_sprintf_GLOBAL)
  5937. int
  5938. DPPP_(my_my_sprintf)(char *buffer, const char* pat, ...)
  5939. {
  5940. va_list args;
  5941. va_start(args, pat);
  5942. vsprintf(buffer, pat, args);
  5943. va_end(args);
  5944. return strlen(buffer);
  5945. }
  5946. #endif
  5947. #endif
  5948. #ifdef NO_XSLOCKS
  5949. # ifdef dJMPENV
  5950. # define dXCPT dJMPENV; int rEtV = 0
  5951. # define XCPT_TRY_START JMPENV_PUSH(rEtV); if (rEtV == 0)
  5952. # define XCPT_TRY_END JMPENV_POP;
  5953. # define XCPT_CATCH if (rEtV != 0)
  5954. # define XCPT_RETHROW JMPENV_JUMP(rEtV)
  5955. # else
  5956. # define dXCPT Sigjmp_buf oldTOP; int rEtV = 0
  5957. # define XCPT_TRY_START Copy(top_env, oldTOP, 1, Sigjmp_buf); rEtV = Sigsetjmp(top_env, 1); if (rEtV == 0)
  5958. # define XCPT_TRY_END Copy(oldTOP, top_env, 1, Sigjmp_buf);
  5959. # define XCPT_CATCH if (rEtV != 0)
  5960. # define XCPT_RETHROW Siglongjmp(top_env, rEtV)
  5961. # endif
  5962. #endif
  5963. #if !defined(my_strlcat)
  5964. #if defined(NEED_my_strlcat)
  5965. static Size_t DPPP_(my_my_strlcat)(char * dst, const char * src, Size_t size);
  5966. static
  5967. #else
  5968. extern Size_t DPPP_(my_my_strlcat)(char * dst, const char * src, Size_t size);
  5969. #endif
  5970. #define my_strlcat DPPP_(my_my_strlcat)
  5971. #define Perl_my_strlcat DPPP_(my_my_strlcat)
  5972. #if defined(NEED_my_strlcat) || defined(NEED_my_strlcat_GLOBAL)
  5973. Size_t
  5974. DPPP_(my_my_strlcat)(char *dst, const char *src, Size_t size)
  5975. {
  5976. Size_t used, length, copy;
  5977. used = strlen(dst);
  5978. length = strlen(src);
  5979. if (size > 0 && used < size - 1) {
  5980. copy = (length >= size - used) ? size - used - 1 : length;
  5981. memcpy(dst + used, src, copy);
  5982. dst[used + copy] = '\0';
  5983. }
  5984. return used + length;
  5985. }
  5986. #endif
  5987. #endif
  5988. #if !defined(my_strlcpy)
  5989. #if defined(NEED_my_strlcpy)
  5990. static Size_t DPPP_(my_my_strlcpy)(char * dst, const char * src, Size_t size);
  5991. static
  5992. #else
  5993. extern Size_t DPPP_(my_my_strlcpy)(char * dst, const char * src, Size_t size);
  5994. #endif
  5995. #define my_strlcpy DPPP_(my_my_strlcpy)
  5996. #define Perl_my_strlcpy DPPP_(my_my_strlcpy)
  5997. #if defined(NEED_my_strlcpy) || defined(NEED_my_strlcpy_GLOBAL)
  5998. Size_t
  5999. DPPP_(my_my_strlcpy)(char *dst, const char *src, Size_t size)
  6000. {
  6001. Size_t length, copy;
  6002. length = strlen(src);
  6003. if (size > 0) {
  6004. copy = (length >= size) ? size - 1 : length;
  6005. memcpy(dst, src, copy);
  6006. dst[copy] = '\0';
  6007. }
  6008. return length;
  6009. }
  6010. #endif
  6011. #endif
  6012. #ifndef PERL_PV_ESCAPE_QUOTE
  6013. # define PERL_PV_ESCAPE_QUOTE 0x0001
  6014. #endif
  6015. #ifndef PERL_PV_PRETTY_QUOTE
  6016. # define PERL_PV_PRETTY_QUOTE PERL_PV_ESCAPE_QUOTE
  6017. #endif
  6018. #ifndef PERL_PV_PRETTY_ELLIPSES
  6019. # define PERL_PV_PRETTY_ELLIPSES 0x0002
  6020. #endif
  6021. #ifndef PERL_PV_PRETTY_LTGT
  6022. # define PERL_PV_PRETTY_LTGT 0x0004
  6023. #endif
  6024. #ifndef PERL_PV_ESCAPE_FIRSTCHAR
  6025. # define PERL_PV_ESCAPE_FIRSTCHAR 0x0008
  6026. #endif
  6027. #ifndef PERL_PV_ESCAPE_UNI
  6028. # define PERL_PV_ESCAPE_UNI 0x0100
  6029. #endif
  6030. #ifndef PERL_PV_ESCAPE_UNI_DETECT
  6031. # define PERL_PV_ESCAPE_UNI_DETECT 0x0200
  6032. #endif
  6033. #ifndef PERL_PV_ESCAPE_ALL
  6034. # define PERL_PV_ESCAPE_ALL 0x1000
  6035. #endif
  6036. #ifndef PERL_PV_ESCAPE_NOBACKSLASH
  6037. # define PERL_PV_ESCAPE_NOBACKSLASH 0x2000
  6038. #endif
  6039. #ifndef PERL_PV_ESCAPE_NOCLEAR
  6040. # define PERL_PV_ESCAPE_NOCLEAR 0x4000
  6041. #endif
  6042. #ifndef PERL_PV_ESCAPE_RE
  6043. # define PERL_PV_ESCAPE_RE 0x8000
  6044. #endif
  6045. #ifndef PERL_PV_PRETTY_NOCLEAR
  6046. # define PERL_PV_PRETTY_NOCLEAR PERL_PV_ESCAPE_NOCLEAR
  6047. #endif
  6048. #ifndef PERL_PV_PRETTY_DUMP
  6049. # define PERL_PV_PRETTY_DUMP PERL_PV_PRETTY_ELLIPSES|PERL_PV_PRETTY_QUOTE
  6050. #endif
  6051. #ifndef PERL_PV_PRETTY_REGPROP
  6052. # define PERL_PV_PRETTY_REGPROP PERL_PV_PRETTY_ELLIPSES|PERL_PV_PRETTY_LTGT|PERL_PV_ESCAPE_RE
  6053. #endif
  6054. /* Hint: pv_escape
  6055. * Note that unicode functionality is only backported to
  6056. * those perl versions that support it. For older perl
  6057. * versions, the implementation will fall back to bytes.
  6058. */
  6059. #ifndef pv_escape
  6060. #if defined(NEED_pv_escape)
  6061. static char * DPPP_(my_pv_escape)(pTHX_ SV * dsv, char const * const str, const STRLEN count, const STRLEN max, STRLEN * const escaped, const U32 flags);
  6062. static
  6063. #else
  6064. extern char * DPPP_(my_pv_escape)(pTHX_ SV * dsv, char const * const str, const STRLEN count, const STRLEN max, STRLEN * const escaped, const U32 flags);
  6065. #endif
  6066. #ifdef pv_escape
  6067. # undef pv_escape
  6068. #endif
  6069. #define pv_escape(a,b,c,d,e,f) DPPP_(my_pv_escape)(aTHX_ a,b,c,d,e,f)
  6070. #define Perl_pv_escape DPPP_(my_pv_escape)
  6071. #if defined(NEED_pv_escape) || defined(NEED_pv_escape_GLOBAL)
  6072. char *
  6073. DPPP_(my_pv_escape)(pTHX_ SV *dsv, char const * const str,
  6074. const STRLEN count, const STRLEN max,
  6075. STRLEN * const escaped, const U32 flags)
  6076. {
  6077. const char esc = flags & PERL_PV_ESCAPE_RE ? '%' : '\\';
  6078. const char dq = flags & PERL_PV_ESCAPE_QUOTE ? '"' : esc;
  6079. char octbuf[32] = "%123456789ABCDF";
  6080. STRLEN wrote = 0;
  6081. STRLEN chsize = 0;
  6082. STRLEN readsize = 1;
  6083. #if defined(is_utf8_string) && defined(utf8_to_uvchr)
  6084. bool isuni = flags & PERL_PV_ESCAPE_UNI ? 1 : 0;
  6085. #endif
  6086. const char *pv = str;
  6087. const char * const end = pv + count;
  6088. octbuf[0] = esc;
  6089. if (!(flags & PERL_PV_ESCAPE_NOCLEAR))
  6090. sv_setpvs(dsv, "");
  6091. #if defined(is_utf8_string) && defined(utf8_to_uvchr)
  6092. if ((flags & PERL_PV_ESCAPE_UNI_DETECT) && is_utf8_string((U8*)pv, count))
  6093. isuni = 1;
  6094. #endif
  6095. for (; pv < end && (!max || wrote < max) ; pv += readsize) {
  6096. const UV u =
  6097. #if defined(is_utf8_string) && defined(utf8_to_uvchr)
  6098. isuni ? utf8_to_uvchr((U8*)pv, &readsize) :
  6099. #endif
  6100. (U8)*pv;
  6101. const U8 c = (U8)u & 0xFF;
  6102. if (u > 255 || (flags & PERL_PV_ESCAPE_ALL)) {
  6103. if (flags & PERL_PV_ESCAPE_FIRSTCHAR)
  6104. chsize = my_snprintf(octbuf, sizeof octbuf,
  6105. "%"UVxf, u);
  6106. else
  6107. chsize = my_snprintf(octbuf, sizeof octbuf,
  6108. "%cx{%"UVxf"}", esc, u);
  6109. } else if (flags & PERL_PV_ESCAPE_NOBACKSLASH) {
  6110. chsize = 1;
  6111. } else {
  6112. if (c == dq || c == esc || !isPRINT(c)) {
  6113. chsize = 2;
  6114. switch (c) {
  6115. case '\\' : /* fallthrough */
  6116. case '%' : if (c == esc)
  6117. octbuf[1] = esc;
  6118. else
  6119. chsize = 1;
  6120. break;
  6121. case '\v' : octbuf[1] = 'v'; break;
  6122. case '\t' : octbuf[1] = 't'; break;
  6123. case '\r' : octbuf[1] = 'r'; break;
  6124. case '\n' : octbuf[1] = 'n'; break;
  6125. case '\f' : octbuf[1] = 'f'; break;
  6126. case '"' : if (dq == '"')
  6127. octbuf[1] = '"';
  6128. else
  6129. chsize = 1;
  6130. break;
  6131. default: chsize = my_snprintf(octbuf, sizeof octbuf,
  6132. pv < end && isDIGIT((U8)*(pv+readsize))
  6133. ? "%c%03o" : "%c%o", esc, c);
  6134. }
  6135. } else {
  6136. chsize = 1;
  6137. }
  6138. }
  6139. if (max && wrote + chsize > max) {
  6140. break;
  6141. } else if (chsize > 1) {
  6142. sv_catpvn(dsv, octbuf, chsize);
  6143. wrote += chsize;
  6144. } else {
  6145. char tmp[2];
  6146. my_snprintf(tmp, sizeof tmp, "%c", c);
  6147. sv_catpvn(dsv, tmp, 1);
  6148. wrote++;
  6149. }
  6150. if (flags & PERL_PV_ESCAPE_FIRSTCHAR)
  6151. break;
  6152. }
  6153. if (escaped != NULL)
  6154. *escaped= pv - str;
  6155. return SvPVX(dsv);
  6156. }
  6157. #endif
  6158. #endif
  6159. #ifndef pv_pretty
  6160. #if defined(NEED_pv_pretty)
  6161. static char * DPPP_(my_pv_pretty)(pTHX_ SV * dsv, char const * const str, const STRLEN count, const STRLEN max, char const * const start_color, char const * const end_color, const U32 flags);
  6162. static
  6163. #else
  6164. extern char * DPPP_(my_pv_pretty)(pTHX_ SV * dsv, char const * const str, const STRLEN count, const STRLEN max, char const * const start_color, char const * const end_color, const U32 flags);
  6165. #endif
  6166. #ifdef pv_pretty
  6167. # undef pv_pretty
  6168. #endif
  6169. #define pv_pretty(a,b,c,d,e,f,g) DPPP_(my_pv_pretty)(aTHX_ a,b,c,d,e,f,g)
  6170. #define Perl_pv_pretty DPPP_(my_pv_pretty)
  6171. #if defined(NEED_pv_pretty) || defined(NEED_pv_pretty_GLOBAL)
  6172. char *
  6173. DPPP_(my_pv_pretty)(pTHX_ SV *dsv, char const * const str, const STRLEN count,
  6174. const STRLEN max, char const * const start_color, char const * const end_color,
  6175. const U32 flags)
  6176. {
  6177. const U8 dq = (flags & PERL_PV_PRETTY_QUOTE) ? '"' : '%';
  6178. STRLEN escaped;
  6179. if (!(flags & PERL_PV_PRETTY_NOCLEAR))
  6180. sv_setpvs(dsv, "");
  6181. if (dq == '"')
  6182. sv_catpvs(dsv, "\"");
  6183. else if (flags & PERL_PV_PRETTY_LTGT)
  6184. sv_catpvs(dsv, "<");
  6185. if (start_color != NULL)
  6186. sv_catpv(dsv, D_PPP_CONSTPV_ARG(start_color));
  6187. pv_escape(dsv, str, count, max, &escaped, flags | PERL_PV_ESCAPE_NOCLEAR);
  6188. if (end_color != NULL)
  6189. sv_catpv(dsv, D_PPP_CONSTPV_ARG(end_color));
  6190. if (dq == '"')
  6191. sv_catpvs(dsv, "\"");
  6192. else if (flags & PERL_PV_PRETTY_LTGT)
  6193. sv_catpvs(dsv, ">");
  6194. if ((flags & PERL_PV_PRETTY_ELLIPSES) && escaped < count)
  6195. sv_catpvs(dsv, "...");
  6196. return SvPVX(dsv);
  6197. }
  6198. #endif
  6199. #endif
  6200. #ifndef pv_display
  6201. #if defined(NEED_pv_display)
  6202. static char * DPPP_(my_pv_display)(pTHX_ SV * dsv, const char * pv, STRLEN cur, STRLEN len, STRLEN pvlim);
  6203. static
  6204. #else
  6205. extern char * DPPP_(my_pv_display)(pTHX_ SV * dsv, const char * pv, STRLEN cur, STRLEN len, STRLEN pvlim);
  6206. #endif
  6207. #ifdef pv_display
  6208. # undef pv_display
  6209. #endif
  6210. #define pv_display(a,b,c,d,e) DPPP_(my_pv_display)(aTHX_ a,b,c,d,e)
  6211. #define Perl_pv_display DPPP_(my_pv_display)
  6212. #if defined(NEED_pv_display) || defined(NEED_pv_display_GLOBAL)
  6213. char *
  6214. DPPP_(my_pv_display)(pTHX_ SV *dsv, const char *pv, STRLEN cur, STRLEN len, STRLEN pvlim)
  6215. {
  6216. pv_pretty(dsv, pv, cur, pvlim, NULL, NULL, PERL_PV_PRETTY_DUMP);
  6217. if (len > cur && pv[cur] == '\0')
  6218. sv_catpvs(dsv, "\\0");
  6219. return SvPVX(dsv);
  6220. }
  6221. #endif
  6222. #endif
  6223. #endif /* _P_P_PORTABILITY_H_ */
  6224. /* End of File ppport.h */