| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034 |
- This is libc.info, produced by makeinfo version 7.3 from libc.texinfo.
- This is ‘The GNU C Library Reference Manual’, for version 2.43.
- Copyright © 1993-2026 Free Software Foundation, Inc.
- Permission is granted to copy, distribute and/or modify this document
- under the terms of the GNU Free Documentation License, Version 1.3 or
- any later version published by the Free Software Foundation; with the
- Invariant Sections being "Free Software Needs Free Documentation" and
- "GNU Lesser General Public License", the Front-Cover texts being "A GNU
- Manual", and with the Back-Cover Texts as in (a) below. A copy of the
- license is included in the section entitled "GNU Free Documentation
- License".
- (a) The FSF's Back-Cover Text is: "You have the freedom to copy and
- modify this GNU manual. Buying copies from the FSF supports it in
- developing GNU and promoting software freedom."
- INFO-DIR-SECTION Software libraries
- START-INFO-DIR-ENTRY
- * Libc: (libc). C library.
- END-INFO-DIR-ENTRY
- INFO-DIR-SECTION GNU C library functions and macros
- START-INFO-DIR-ENTRY
- * ALTWERASE: (libc)Local Modes.
- * ARGP_ERR_UNKNOWN: (libc)Argp Parser Functions.
- * ARG_MAX: (libc)General Limits.
- * BAUD_MAX: (libc)Line Speed.
- * BC_BASE_MAX: (libc)Utility Limits.
- * BC_DIM_MAX: (libc)Utility Limits.
- * BC_SCALE_MAX: (libc)Utility Limits.
- * BC_STRING_MAX: (libc)Utility Limits.
- * BRKINT: (libc)Input Modes.
- * BUFSIZ: (libc)Controlling Buffering.
- * CCTS_OFLOW: (libc)Control Modes.
- * CHAR_BIT: (libc)Width of Type.
- * CHILD_MAX: (libc)General Limits.
- * CIGNORE: (libc)Control Modes.
- * CLK_TCK: (libc)Processor Time.
- * CLOCAL: (libc)Control Modes.
- * CLOCKS_PER_SEC: (libc)CPU Time.
- * CLOCK_BOOTTIME: (libc)Getting the Time.
- * CLOCK_BOOTTIME_ALARM: (libc)Getting the Time.
- * CLOCK_MONOTONIC: (libc)Getting the Time.
- * CLOCK_MONOTONIC_COARSE: (libc)Getting the Time.
- * CLOCK_MONOTONIC_RAW: (libc)Getting the Time.
- * CLOCK_PROCESS_CPUTIME_ID: (libc)Getting the Time.
- * CLOCK_REALTIME: (libc)Getting the Time.
- * CLOCK_REALTIME_ALARM: (libc)Getting the Time.
- * CLOCK_REALTIME_COARSE: (libc)Getting the Time.
- * CLOCK_TAI: (libc)Getting the Time.
- * CLOCK_THREAD_CPUTIME_ID: (libc)Getting the Time.
- * COLL_WEIGHTS_MAX: (libc)Utility Limits.
- * CPU_ALLOC: (libc)CPU Affinity.
- * CPU_ALLOC_SIZE: (libc)CPU Affinity.
- * CPU_AND: (libc)CPU Affinity.
- * CPU_AND_S: (libc)CPU Affinity.
- * CPU_CLR: (libc)CPU Affinity.
- * CPU_CLR_S: (libc)CPU Affinity.
- * CPU_COUNT: (libc)CPU Affinity.
- * CPU_COUNT_S: (libc)CPU Affinity.
- * CPU_EQUAL: (libc)CPU Affinity.
- * CPU_EQUAL_S: (libc)CPU Affinity.
- * CPU_FEATURE_ACTIVE: (libc)X86.
- * CPU_FEATURE_PRESENT: (libc)X86.
- * CPU_FREE: (libc)CPU Affinity.
- * CPU_ISSET: (libc)CPU Affinity.
- * CPU_ISSET_S: (libc)CPU Affinity.
- * CPU_OR: (libc)CPU Affinity.
- * CPU_OR_S: (libc)CPU Affinity.
- * CPU_SET: (libc)CPU Affinity.
- * CPU_SETSIZE: (libc)CPU Affinity.
- * CPU_SET_S: (libc)CPU Affinity.
- * CPU_XOR: (libc)CPU Affinity.
- * CPU_XOR_S: (libc)CPU Affinity.
- * CPU_ZERO: (libc)CPU Affinity.
- * CPU_ZERO_S: (libc)CPU Affinity.
- * CREAD: (libc)Control Modes.
- * CRTS_IFLOW: (libc)Control Modes.
- * CS5: (libc)Control Modes.
- * CS6: (libc)Control Modes.
- * CS7: (libc)Control Modes.
- * CS8: (libc)Control Modes.
- * CSIZE: (libc)Control Modes.
- * CSTOPB: (libc)Control Modes.
- * DLFO_EH_SEGMENT_TYPE: (libc)Dynamic Linker Introspection.
- * DLFO_STRUCT_HAS_EH_COUNT: (libc)Dynamic Linker Introspection.
- * DLFO_STRUCT_HAS_EH_DBASE: (libc)Dynamic Linker Introspection.
- * DTTOIF: (libc)Directory Entries.
- * E2BIG: (libc)Error Codes.
- * EACCES: (libc)Error Codes.
- * EADDRINUSE: (libc)Error Codes.
- * EADDRNOTAVAIL: (libc)Error Codes.
- * EADV: (libc)Error Codes.
- * EAFNOSUPPORT: (libc)Error Codes.
- * EAGAIN: (libc)Error Codes.
- * EALREADY: (libc)Error Codes.
- * EAUTH: (libc)Error Codes.
- * EBACKGROUND: (libc)Error Codes.
- * EBADE: (libc)Error Codes.
- * EBADF: (libc)Error Codes.
- * EBADFD: (libc)Error Codes.
- * EBADMSG: (libc)Error Codes.
- * EBADR: (libc)Error Codes.
- * EBADRPC: (libc)Error Codes.
- * EBADRQC: (libc)Error Codes.
- * EBADSLT: (libc)Error Codes.
- * EBFONT: (libc)Error Codes.
- * EBUSY: (libc)Error Codes.
- * ECANCELED: (libc)Error Codes.
- * ECHILD: (libc)Error Codes.
- * ECHO: (libc)Local Modes.
- * ECHOCTL: (libc)Local Modes.
- * ECHOE: (libc)Local Modes.
- * ECHOK: (libc)Local Modes.
- * ECHOKE: (libc)Local Modes.
- * ECHONL: (libc)Local Modes.
- * ECHOPRT: (libc)Local Modes.
- * ECHRNG: (libc)Error Codes.
- * ECOMM: (libc)Error Codes.
- * ECONNABORTED: (libc)Error Codes.
- * ECONNREFUSED: (libc)Error Codes.
- * ECONNRESET: (libc)Error Codes.
- * ED: (libc)Error Codes.
- * EDEADLK: (libc)Error Codes.
- * EDEADLOCK: (libc)Error Codes.
- * EDESTADDRREQ: (libc)Error Codes.
- * EDIED: (libc)Error Codes.
- * EDOM: (libc)Error Codes.
- * EDOTDOT: (libc)Error Codes.
- * EDQUOT: (libc)Error Codes.
- * EEXIST: (libc)Error Codes.
- * EFAULT: (libc)Error Codes.
- * EFBIG: (libc)Error Codes.
- * EFTYPE: (libc)Error Codes.
- * EGRATUITOUS: (libc)Error Codes.
- * EGREGIOUS: (libc)Error Codes.
- * EHOSTDOWN: (libc)Error Codes.
- * EHOSTUNREACH: (libc)Error Codes.
- * EHWPOISON: (libc)Error Codes.
- * EIDRM: (libc)Error Codes.
- * EIEIO: (libc)Error Codes.
- * EILSEQ: (libc)Error Codes.
- * EINPROGRESS: (libc)Error Codes.
- * EINTR: (libc)Error Codes.
- * EINVAL: (libc)Error Codes.
- * EIO: (libc)Error Codes.
- * EISCONN: (libc)Error Codes.
- * EISDIR: (libc)Error Codes.
- * EISNAM: (libc)Error Codes.
- * EKEYEXPIRED: (libc)Error Codes.
- * EKEYREJECTED: (libc)Error Codes.
- * EKEYREVOKED: (libc)Error Codes.
- * EL2HLT: (libc)Error Codes.
- * EL2NSYNC: (libc)Error Codes.
- * EL3HLT: (libc)Error Codes.
- * EL3RST: (libc)Error Codes.
- * ELIBACC: (libc)Error Codes.
- * ELIBBAD: (libc)Error Codes.
- * ELIBEXEC: (libc)Error Codes.
- * ELIBMAX: (libc)Error Codes.
- * ELIBSCN: (libc)Error Codes.
- * ELNRNG: (libc)Error Codes.
- * ELOOP: (libc)Error Codes.
- * EMEDIUMTYPE: (libc)Error Codes.
- * EMFILE: (libc)Error Codes.
- * EMLINK: (libc)Error Codes.
- * EMSGSIZE: (libc)Error Codes.
- * EMULTIHOP: (libc)Error Codes.
- * ENAMETOOLONG: (libc)Error Codes.
- * ENAVAIL: (libc)Error Codes.
- * ENEEDAUTH: (libc)Error Codes.
- * ENETDOWN: (libc)Error Codes.
- * ENETRESET: (libc)Error Codes.
- * ENETUNREACH: (libc)Error Codes.
- * ENFILE: (libc)Error Codes.
- * ENOANO: (libc)Error Codes.
- * ENOBUFS: (libc)Error Codes.
- * ENOCSI: (libc)Error Codes.
- * ENODATA: (libc)Error Codes.
- * ENODEV: (libc)Error Codes.
- * ENOENT: (libc)Error Codes.
- * ENOEXEC: (libc)Error Codes.
- * ENOKEY: (libc)Error Codes.
- * ENOLCK: (libc)Error Codes.
- * ENOLINK: (libc)Error Codes.
- * ENOMEDIUM: (libc)Error Codes.
- * ENOMEM: (libc)Error Codes.
- * ENOMSG: (libc)Error Codes.
- * ENONET: (libc)Error Codes.
- * ENOPKG: (libc)Error Codes.
- * ENOPROTOOPT: (libc)Error Codes.
- * ENOSPC: (libc)Error Codes.
- * ENOSR: (libc)Error Codes.
- * ENOSTR: (libc)Error Codes.
- * ENOSYS: (libc)Error Codes.
- * ENOTBLK: (libc)Error Codes.
- * ENOTCONN: (libc)Error Codes.
- * ENOTDIR: (libc)Error Codes.
- * ENOTEMPTY: (libc)Error Codes.
- * ENOTNAM: (libc)Error Codes.
- * ENOTRECOVERABLE: (libc)Error Codes.
- * ENOTSOCK: (libc)Error Codes.
- * ENOTSUP: (libc)Error Codes.
- * ENOTTY: (libc)Error Codes.
- * ENOTUNIQ: (libc)Error Codes.
- * ENXIO: (libc)Error Codes.
- * EOF: (libc)EOF and Errors.
- * EOPNOTSUPP: (libc)Error Codes.
- * EOVERFLOW: (libc)Error Codes.
- * EOWNERDEAD: (libc)Error Codes.
- * EPERM: (libc)Error Codes.
- * EPFNOSUPPORT: (libc)Error Codes.
- * EPIPE: (libc)Error Codes.
- * EPROCLIM: (libc)Error Codes.
- * EPROCUNAVAIL: (libc)Error Codes.
- * EPROGMISMATCH: (libc)Error Codes.
- * EPROGUNAVAIL: (libc)Error Codes.
- * EPROTO: (libc)Error Codes.
- * EPROTONOSUPPORT: (libc)Error Codes.
- * EPROTOTYPE: (libc)Error Codes.
- * EQUIV_CLASS_MAX: (libc)Utility Limits.
- * ERANGE: (libc)Error Codes.
- * EREMCHG: (libc)Error Codes.
- * EREMOTE: (libc)Error Codes.
- * EREMOTEIO: (libc)Error Codes.
- * ERESTART: (libc)Error Codes.
- * ERFKILL: (libc)Error Codes.
- * EROFS: (libc)Error Codes.
- * ERPCMISMATCH: (libc)Error Codes.
- * ESHUTDOWN: (libc)Error Codes.
- * ESOCKTNOSUPPORT: (libc)Error Codes.
- * ESPIPE: (libc)Error Codes.
- * ESRCH: (libc)Error Codes.
- * ESRMNT: (libc)Error Codes.
- * ESTALE: (libc)Error Codes.
- * ESTRPIPE: (libc)Error Codes.
- * ETIME: (libc)Error Codes.
- * ETIMEDOUT: (libc)Error Codes.
- * ETOOMANYREFS: (libc)Error Codes.
- * ETXTBSY: (libc)Error Codes.
- * EUCLEAN: (libc)Error Codes.
- * EUNATCH: (libc)Error Codes.
- * EUSERS: (libc)Error Codes.
- * EWOULDBLOCK: (libc)Error Codes.
- * EXDEV: (libc)Error Codes.
- * EXFULL: (libc)Error Codes.
- * EXIT_FAILURE: (libc)Exit Status.
- * EXIT_SUCCESS: (libc)Exit Status.
- * EXPR_NEST_MAX: (libc)Utility Limits.
- * FD_CLOEXEC: (libc)Descriptor Flags.
- * FD_CLR: (libc)Waiting for I/O.
- * FD_ISSET: (libc)Waiting for I/O.
- * FD_SET: (libc)Waiting for I/O.
- * FD_SETSIZE: (libc)Waiting for I/O.
- * FD_ZERO: (libc)Waiting for I/O.
- * FE_SNANS_ALWAYS_SIGNAL: (libc)Infinity and NaN.
- * FILENAME_MAX: (libc)Limits for Files.
- * FLUSHO: (libc)Local Modes.
- * FOPEN_MAX: (libc)Opening Streams.
- * FP_ILOGB0: (libc)Exponents and Logarithms.
- * FP_ILOGBNAN: (libc)Exponents and Logarithms.
- * FP_LLOGB0: (libc)Exponents and Logarithms.
- * FP_LLOGBNAN: (libc)Exponents and Logarithms.
- * F_DUPFD: (libc)Duplicating Descriptors.
- * F_GETFD: (libc)Descriptor Flags.
- * F_GETFL: (libc)Getting File Status Flags.
- * F_GETLK: (libc)File Locks.
- * F_GETOWN: (libc)Interrupt Input.
- * F_OFD_GETLK: (libc)Open File Description Locks.
- * F_OFD_SETLK: (libc)Open File Description Locks.
- * F_OFD_SETLKW: (libc)Open File Description Locks.
- * F_OK: (libc)Testing File Access.
- * F_SETFD: (libc)Descriptor Flags.
- * F_SETFL: (libc)Getting File Status Flags.
- * F_SETLK: (libc)File Locks.
- * F_SETLKW: (libc)File Locks.
- * F_SETOWN: (libc)Interrupt Input.
- * HUGE_VAL: (libc)Math Error Reporting.
- * HUGE_VALF: (libc)Math Error Reporting.
- * HUGE_VALL: (libc)Math Error Reporting.
- * HUGE_VAL_FN: (libc)Math Error Reporting.
- * HUGE_VAL_FNx: (libc)Math Error Reporting.
- * HUPCL: (libc)Control Modes.
- * I: (libc)Complex Numbers.
- * ICANON: (libc)Local Modes.
- * ICRNL: (libc)Input Modes.
- * IEXTEN: (libc)Local Modes.
- * IFNAMSIZ: (libc)Interface Naming.
- * IFTODT: (libc)Directory Entries.
- * IGNBRK: (libc)Input Modes.
- * IGNCR: (libc)Input Modes.
- * IGNPAR: (libc)Input Modes.
- * IMAXBEL: (libc)Input Modes.
- * INADDR_ANY: (libc)Host Address Data Type.
- * INADDR_BROADCAST: (libc)Host Address Data Type.
- * INADDR_LOOPBACK: (libc)Host Address Data Type.
- * INADDR_NONE: (libc)Host Address Data Type.
- * INFINITY: (libc)Infinity and NaN.
- * INLCR: (libc)Input Modes.
- * INPCK: (libc)Input Modes.
- * IPPORT_RESERVED: (libc)Ports.
- * IPPORT_USERRESERVED: (libc)Ports.
- * ISIG: (libc)Local Modes.
- * ISTRIP: (libc)Input Modes.
- * IXANY: (libc)Input Modes.
- * IXOFF: (libc)Input Modes.
- * IXON: (libc)Input Modes.
- * LINE_MAX: (libc)Utility Limits.
- * LINK_MAX: (libc)Limits for Files.
- * L_ctermid: (libc)Identifying the Terminal.
- * L_cuserid: (libc)Who Logged In.
- * L_tmpnam: (libc)Temporary Files.
- * MAXNAMLEN: (libc)Limits for Files.
- * MAXSYMLINKS: (libc)Symbolic Links.
- * MAX_CANON: (libc)Limits for Files.
- * MAX_INPUT: (libc)Limits for Files.
- * MB_CUR_MAX: (libc)Selecting the Conversion.
- * MB_LEN_MAX: (libc)Selecting the Conversion.
- * MDMBUF: (libc)Control Modes.
- * MSG_DONTROUTE: (libc)Socket Data Options.
- * MSG_OOB: (libc)Socket Data Options.
- * MSG_PEEK: (libc)Socket Data Options.
- * NAME_MAX: (libc)Limits for Files.
- * NAN: (libc)Infinity and NaN.
- * NCCS: (libc)Mode Data Types.
- * NGROUPS_MAX: (libc)General Limits.
- * NOFLSH: (libc)Local Modes.
- * NOKERNINFO: (libc)Local Modes.
- * NSIG: (libc)Standard Signals.
- * NULL: (libc)Null Pointer Constant.
- * ONLCR: (libc)Output Modes.
- * ONOEOT: (libc)Output Modes.
- * OPEN_MAX: (libc)General Limits.
- * OPOST: (libc)Output Modes.
- * OXTABS: (libc)Output Modes.
- * O_ACCMODE: (libc)Access Modes.
- * O_APPEND: (libc)Operating Modes.
- * O_ASYNC: (libc)Operating Modes.
- * O_CREAT: (libc)Open-time Flags.
- * O_DIRECTORY: (libc)Open-time Flags.
- * O_EXCL: (libc)Open-time Flags.
- * O_EXEC: (libc)Access Modes.
- * O_EXLOCK: (libc)Open-time Flags.
- * O_FSYNC: (libc)Operating Modes.
- * O_IGNORE_CTTY: (libc)Open-time Flags.
- * O_NDELAY: (libc)Operating Modes.
- * O_NOATIME: (libc)Operating Modes.
- * O_NOCTTY: (libc)Open-time Flags.
- * O_NOFOLLOW: (libc)Open-time Flags.
- * O_NOLINK: (libc)Open-time Flags.
- * O_NONBLOCK: (libc)Open-time Flags.
- * O_NONBLOCK: (libc)Operating Modes.
- * O_NOTRANS: (libc)Open-time Flags.
- * O_PATH: (libc)Access Modes.
- * O_RDONLY: (libc)Access Modes.
- * O_RDWR: (libc)Access Modes.
- * O_READ: (libc)Access Modes.
- * O_SHLOCK: (libc)Open-time Flags.
- * O_SYNC: (libc)Operating Modes.
- * O_TMPFILE: (libc)Open-time Flags.
- * O_TRUNC: (libc)Open-time Flags.
- * O_WRITE: (libc)Access Modes.
- * O_WRONLY: (libc)Access Modes.
- * PARENB: (libc)Control Modes.
- * PARMRK: (libc)Input Modes.
- * PARODD: (libc)Control Modes.
- * PATH_MAX: (libc)Limits for Files.
- * PA_FLAG_MASK: (libc)Parsing a Template String.
- * PENDIN: (libc)Local Modes.
- * PF_FILE: (libc)Local Namespace Details.
- * PF_INET6: (libc)Internet Namespace.
- * PF_INET: (libc)Internet Namespace.
- * PF_LOCAL: (libc)Local Namespace Details.
- * PF_UNIX: (libc)Local Namespace Details.
- * PIPE_BUF: (libc)Limits for Files.
- * PTHREAD_ATTR_NO_SIGMASK_NP: (libc)Initial Thread Signal Mask.
- * P_tmpdir: (libc)Temporary Files.
- * RAND_MAX: (libc)ISO Random.
- * RE_DUP_MAX: (libc)General Limits.
- * RLIM_INFINITY: (libc)Limits on Resources.
- * RSEQ_SIG: (libc)Restartable Sequences.
- * R_OK: (libc)Testing File Access.
- * SA_NOCLDSTOP: (libc)Flags for Sigaction.
- * SA_NOCLDWAIT: (libc)Flags for Sigaction.
- * SA_NODEFER: (libc)Flags for Sigaction.
- * SA_ONSTACK: (libc)Flags for Sigaction.
- * SA_RESETHAND: (libc)Flags for Sigaction.
- * SA_RESTART: (libc)Flags for Sigaction.
- * SA_SIGINFO: (libc)Flags for Sigaction.
- * SEEK_CUR: (libc)File Positioning.
- * SEEK_END: (libc)File Positioning.
- * SEEK_SET: (libc)File Positioning.
- * SIGABRT: (libc)Program Error Signals.
- * SIGALRM: (libc)Alarm Signals.
- * SIGBUS: (libc)Program Error Signals.
- * SIGCHLD: (libc)Job Control Signals.
- * SIGCLD: (libc)Job Control Signals.
- * SIGCONT: (libc)Job Control Signals.
- * SIGEMT: (libc)Program Error Signals.
- * SIGFPE: (libc)Program Error Signals.
- * SIGHUP: (libc)Termination Signals.
- * SIGILL: (libc)Program Error Signals.
- * SIGINFO: (libc)Miscellaneous Signals.
- * SIGINT: (libc)Termination Signals.
- * SIGIO: (libc)Asynchronous I/O Signals.
- * SIGIOT: (libc)Program Error Signals.
- * SIGKILL: (libc)Termination Signals.
- * SIGLOST: (libc)Operation Error Signals.
- * SIGPIPE: (libc)Operation Error Signals.
- * SIGPOLL: (libc)Asynchronous I/O Signals.
- * SIGPROF: (libc)Alarm Signals.
- * SIGPWR: (libc)Miscellaneous Signals.
- * SIGQUIT: (libc)Termination Signals.
- * SIGSEGV: (libc)Program Error Signals.
- * SIGSTKFLT: (libc)Program Error Signals.
- * SIGSTOP: (libc)Job Control Signals.
- * SIGSYS: (libc)Program Error Signals.
- * SIGTERM: (libc)Termination Signals.
- * SIGTRAP: (libc)Program Error Signals.
- * SIGTSTP: (libc)Job Control Signals.
- * SIGTTIN: (libc)Job Control Signals.
- * SIGTTOU: (libc)Job Control Signals.
- * SIGURG: (libc)Asynchronous I/O Signals.
- * SIGUSR1: (libc)Miscellaneous Signals.
- * SIGUSR2: (libc)Miscellaneous Signals.
- * SIGVTALRM: (libc)Alarm Signals.
- * SIGWINCH: (libc)Miscellaneous Signals.
- * SIGXCPU: (libc)Operation Error Signals.
- * SIGXFSZ: (libc)Operation Error Signals.
- * SIG_ERR: (libc)Basic Signal Handling.
- * SNAN: (libc)Infinity and NaN.
- * SNANF: (libc)Infinity and NaN.
- * SNANFN: (libc)Infinity and NaN.
- * SNANFNx: (libc)Infinity and NaN.
- * SNANL: (libc)Infinity and NaN.
- * SOCK_DGRAM: (libc)Communication Styles.
- * SOCK_RAW: (libc)Communication Styles.
- * SOCK_RDM: (libc)Communication Styles.
- * SOCK_SEQPACKET: (libc)Communication Styles.
- * SOCK_STREAM: (libc)Communication Styles.
- * SOL_SOCKET: (libc)Socket-Level Options.
- * SPEED_MAX: (libc)Line Speed.
- * SSIZE_MAX: (libc)General Limits.
- * STREAM_MAX: (libc)General Limits.
- * SUN_LEN: (libc)Local Namespace Details.
- * S_IFMT: (libc)Testing File Type.
- * S_ISBLK: (libc)Testing File Type.
- * S_ISCHR: (libc)Testing File Type.
- * S_ISDIR: (libc)Testing File Type.
- * S_ISFIFO: (libc)Testing File Type.
- * S_ISLNK: (libc)Testing File Type.
- * S_ISREG: (libc)Testing File Type.
- * S_ISSOCK: (libc)Testing File Type.
- * S_TYPEISMQ: (libc)Testing File Type.
- * S_TYPEISSEM: (libc)Testing File Type.
- * S_TYPEISSHM: (libc)Testing File Type.
- * TIME_UTC: (libc)Getting the Time.
- * TMP_MAX: (libc)Temporary Files.
- * TOSTOP: (libc)Local Modes.
- * TZNAME_MAX: (libc)General Limits.
- * VDISCARD: (libc)Other Special.
- * VDSUSP: (libc)Signal Characters.
- * VEOF: (libc)Editing Characters.
- * VEOL2: (libc)Editing Characters.
- * VEOL: (libc)Editing Characters.
- * VERASE: (libc)Editing Characters.
- * VINTR: (libc)Signal Characters.
- * VKILL: (libc)Editing Characters.
- * VLNEXT: (libc)Other Special.
- * VMIN: (libc)Noncanonical Input.
- * VQUIT: (libc)Signal Characters.
- * VREPRINT: (libc)Editing Characters.
- * VSTART: (libc)Start/Stop Characters.
- * VSTATUS: (libc)Other Special.
- * VSTOP: (libc)Start/Stop Characters.
- * VSUSP: (libc)Signal Characters.
- * VTIME: (libc)Noncanonical Input.
- * VWERASE: (libc)Editing Characters.
- * WCHAR_MAX: (libc)Extended Char Intro.
- * WCHAR_MIN: (libc)Extended Char Intro.
- * WCOREDUMP: (libc)Process Completion Status.
- * WEOF: (libc)EOF and Errors.
- * WEOF: (libc)Extended Char Intro.
- * WEXITSTATUS: (libc)Process Completion Status.
- * WIFEXITED: (libc)Process Completion Status.
- * WIFSIGNALED: (libc)Process Completion Status.
- * WIFSTOPPED: (libc)Process Completion Status.
- * WSTOPSIG: (libc)Process Completion Status.
- * WTERMSIG: (libc)Process Completion Status.
- * W_OK: (libc)Testing File Access.
- * X_OK: (libc)Testing File Access.
- * _Complex_I: (libc)Complex Numbers.
- * _Exit: (libc)Termination Internals.
- * _Fork: (libc)Creating a Process.
- * _IOFBF: (libc)Controlling Buffering.
- * _IOLBF: (libc)Controlling Buffering.
- * _IONBF: (libc)Controlling Buffering.
- * _Imaginary_I: (libc)Complex Numbers.
- * _PATH_UTMP: (libc)Manipulating the Database.
- * _PATH_WTMP: (libc)Manipulating the Database.
- * _POSIX2_C_DEV: (libc)System Options.
- * _POSIX2_C_VERSION: (libc)Version Supported.
- * _POSIX2_FORT_DEV: (libc)System Options.
- * _POSIX2_FORT_RUN: (libc)System Options.
- * _POSIX2_LOCALEDEF: (libc)System Options.
- * _POSIX2_SW_DEV: (libc)System Options.
- * _POSIX_CHOWN_RESTRICTED: (libc)Options for Files.
- * _POSIX_JOB_CONTROL: (libc)System Options.
- * _POSIX_NO_TRUNC: (libc)Options for Files.
- * _POSIX_SAVED_IDS: (libc)System Options.
- * _POSIX_VDISABLE: (libc)Options for Files.
- * _POSIX_VERSION: (libc)Version Supported.
- * __fbufsize: (libc)Controlling Buffering.
- * __flbf: (libc)Controlling Buffering.
- * __fpending: (libc)Controlling Buffering.
- * __fpurge: (libc)Flushing Buffers.
- * __freadable: (libc)Opening Streams.
- * __freading: (libc)Opening Streams.
- * __fsetlocking: (libc)Streams and Threads.
- * __fwritable: (libc)Opening Streams.
- * __fwriting: (libc)Opening Streams.
- * __gconv_end_fct: (libc)glibc iconv Implementation.
- * __gconv_fct: (libc)glibc iconv Implementation.
- * __gconv_init_fct: (libc)glibc iconv Implementation.
- * __ppc_get_timebase: (libc)PowerPC.
- * __ppc_get_timebase_freq: (libc)PowerPC.
- * __ppc_mdoio: (libc)PowerPC.
- * __ppc_mdoom: (libc)PowerPC.
- * __ppc_set_ppr_low: (libc)PowerPC.
- * __ppc_set_ppr_med: (libc)PowerPC.
- * __ppc_set_ppr_med_high: (libc)PowerPC.
- * __ppc_set_ppr_med_low: (libc)PowerPC.
- * __ppc_set_ppr_very_low: (libc)PowerPC.
- * __ppc_yield: (libc)PowerPC.
- * __riscv_flush_icache: (libc)RISC-V.
- * __va_copy: (libc)Argument Macros.
- * __x86_get_cpuid_feature_leaf: (libc)X86.
- * _dl_find_object: (libc)Dynamic Linker Introspection.
- * _exit: (libc)Termination Internals.
- * _flushlbf: (libc)Flushing Buffers.
- * _tolower: (libc)Case Conversion.
- * _toupper: (libc)Case Conversion.
- * a64l: (libc)Encode Binary Data.
- * abort: (libc)Aborting a Program.
- * abs: (libc)Absolute Value.
- * accept: (libc)Accepting Connections.
- * access: (libc)Testing File Access.
- * acos: (libc)Inverse Trig Functions.
- * acosf: (libc)Inverse Trig Functions.
- * acosfN: (libc)Inverse Trig Functions.
- * acosfNx: (libc)Inverse Trig Functions.
- * acosh: (libc)Hyperbolic Functions.
- * acoshf: (libc)Hyperbolic Functions.
- * acoshfN: (libc)Hyperbolic Functions.
- * acoshfNx: (libc)Hyperbolic Functions.
- * acoshl: (libc)Hyperbolic Functions.
- * acosl: (libc)Inverse Trig Functions.
- * acospi: (libc)Inverse Trig Functions.
- * acospif: (libc)Inverse Trig Functions.
- * acospifN: (libc)Inverse Trig Functions.
- * acospifNx: (libc)Inverse Trig Functions.
- * acospil: (libc)Inverse Trig Functions.
- * addmntent: (libc)mtab.
- * addseverity: (libc)Adding Severity Classes.
- * adjtime: (libc)Setting and Adjusting the Time.
- * adjtimex: (libc)Setting and Adjusting the Time.
- * aio_cancel64: (libc)Cancel AIO Operations.
- * aio_cancel: (libc)Cancel AIO Operations.
- * aio_error64: (libc)Status of AIO Operations.
- * aio_error: (libc)Status of AIO Operations.
- * aio_fsync64: (libc)Synchronizing AIO Operations.
- * aio_fsync: (libc)Synchronizing AIO Operations.
- * aio_init: (libc)Configuration of AIO.
- * aio_read64: (libc)Asynchronous Reads/Writes.
- * aio_read: (libc)Asynchronous Reads/Writes.
- * aio_return64: (libc)Status of AIO Operations.
- * aio_return: (libc)Status of AIO Operations.
- * aio_suspend64: (libc)Synchronizing AIO Operations.
- * aio_suspend: (libc)Synchronizing AIO Operations.
- * aio_write64: (libc)Asynchronous Reads/Writes.
- * aio_write: (libc)Asynchronous Reads/Writes.
- * alarm: (libc)Setting an Alarm.
- * aligned_alloc: (libc)Aligned Memory Blocks.
- * alloca: (libc)Variable Size Automatic.
- * alphasort64: (libc)Scanning Directory Content.
- * alphasort: (libc)Scanning Directory Content.
- * arc4random: (libc)High Quality Random.
- * arc4random_buf: (libc)High Quality Random.
- * arc4random_uniform: (libc)High Quality Random.
- * argp_error: (libc)Argp Helper Functions.
- * argp_failure: (libc)Argp Helper Functions.
- * argp_help: (libc)Argp Help.
- * argp_parse: (libc)Argp.
- * argp_state_help: (libc)Argp Helper Functions.
- * argp_usage: (libc)Argp Helper Functions.
- * argz_add: (libc)Argz Functions.
- * argz_add_sep: (libc)Argz Functions.
- * argz_append: (libc)Argz Functions.
- * argz_count: (libc)Argz Functions.
- * argz_create: (libc)Argz Functions.
- * argz_create_sep: (libc)Argz Functions.
- * argz_delete: (libc)Argz Functions.
- * argz_extract: (libc)Argz Functions.
- * argz_insert: (libc)Argz Functions.
- * argz_next: (libc)Argz Functions.
- * argz_replace: (libc)Argz Functions.
- * argz_stringify: (libc)Argz Functions.
- * asctime: (libc)Formatting Calendar Time.
- * asctime_r: (libc)Formatting Calendar Time.
- * asin: (libc)Inverse Trig Functions.
- * asinf: (libc)Inverse Trig Functions.
- * asinfN: (libc)Inverse Trig Functions.
- * asinfNx: (libc)Inverse Trig Functions.
- * asinh: (libc)Hyperbolic Functions.
- * asinhf: (libc)Hyperbolic Functions.
- * asinhfN: (libc)Hyperbolic Functions.
- * asinhfNx: (libc)Hyperbolic Functions.
- * asinhl: (libc)Hyperbolic Functions.
- * asinl: (libc)Inverse Trig Functions.
- * asinpi: (libc)Inverse Trig Functions.
- * asinpif: (libc)Inverse Trig Functions.
- * asinpifN: (libc)Inverse Trig Functions.
- * asinpifNx: (libc)Inverse Trig Functions.
- * asinpil: (libc)Inverse Trig Functions.
- * asprintf: (libc)Dynamic Output.
- * assert: (libc)Consistency Checking.
- * assert_perror: (libc)Consistency Checking.
- * atan2: (libc)Inverse Trig Functions.
- * atan2f: (libc)Inverse Trig Functions.
- * atan2fN: (libc)Inverse Trig Functions.
- * atan2fNx: (libc)Inverse Trig Functions.
- * atan2l: (libc)Inverse Trig Functions.
- * atan2pi: (libc)Inverse Trig Functions.
- * atan2pif: (libc)Inverse Trig Functions.
- * atan2pifN: (libc)Inverse Trig Functions.
- * atan2pifNx: (libc)Inverse Trig Functions.
- * atan2pil: (libc)Inverse Trig Functions.
- * atan: (libc)Inverse Trig Functions.
- * atanf: (libc)Inverse Trig Functions.
- * atanfN: (libc)Inverse Trig Functions.
- * atanfNx: (libc)Inverse Trig Functions.
- * atanh: (libc)Hyperbolic Functions.
- * atanhf: (libc)Hyperbolic Functions.
- * atanhfN: (libc)Hyperbolic Functions.
- * atanhfNx: (libc)Hyperbolic Functions.
- * atanhl: (libc)Hyperbolic Functions.
- * atanl: (libc)Inverse Trig Functions.
- * atanpi: (libc)Inverse Trig Functions.
- * atanpif: (libc)Inverse Trig Functions.
- * atanpifN: (libc)Inverse Trig Functions.
- * atanpifNx: (libc)Inverse Trig Functions.
- * atanpil: (libc)Inverse Trig Functions.
- * atexit: (libc)Cleanups on Exit.
- * atof: (libc)Parsing of Floats.
- * atoi: (libc)Parsing of Integers.
- * atol: (libc)Parsing of Integers.
- * atoll: (libc)Parsing of Integers.
- * backtrace: (libc)Backtraces.
- * backtrace_symbols: (libc)Backtraces.
- * backtrace_symbols_fd: (libc)Backtraces.
- * basename: (libc)Finding Tokens in a String.
- * basename: (libc)Finding Tokens in a String.
- * bcmp: (libc)String/Array Comparison.
- * bcopy: (libc)Copying Strings and Arrays.
- * bind: (libc)Setting Address.
- * bind_textdomain_codeset: (libc)Charset conversion in gettext.
- * bindtextdomain: (libc)Locating gettext catalog.
- * brk: (libc)Resizing the Data Segment.
- * bsearch: (libc)Array Search Function.
- * btowc: (libc)Converting a Character.
- * bzero: (libc)Copying Strings and Arrays.
- * cabs: (libc)Absolute Value.
- * cabsf: (libc)Absolute Value.
- * cabsfN: (libc)Absolute Value.
- * cabsfNx: (libc)Absolute Value.
- * cabsl: (libc)Absolute Value.
- * cacos: (libc)Inverse Trig Functions.
- * cacosf: (libc)Inverse Trig Functions.
- * cacosfN: (libc)Inverse Trig Functions.
- * cacosfNx: (libc)Inverse Trig Functions.
- * cacosh: (libc)Hyperbolic Functions.
- * cacoshf: (libc)Hyperbolic Functions.
- * cacoshfN: (libc)Hyperbolic Functions.
- * cacoshfNx: (libc)Hyperbolic Functions.
- * cacoshl: (libc)Hyperbolic Functions.
- * cacosl: (libc)Inverse Trig Functions.
- * call_once: (libc)Call Once.
- * calloc: (libc)Allocating Cleared Space.
- * canonicalize: (libc)FP Bit Twiddling.
- * canonicalize_file_name: (libc)Symbolic Links.
- * canonicalizef: (libc)FP Bit Twiddling.
- * canonicalizefN: (libc)FP Bit Twiddling.
- * canonicalizefNx: (libc)FP Bit Twiddling.
- * canonicalizel: (libc)FP Bit Twiddling.
- * carg: (libc)Operations on Complex.
- * cargf: (libc)Operations on Complex.
- * cargfN: (libc)Operations on Complex.
- * cargfNx: (libc)Operations on Complex.
- * cargl: (libc)Operations on Complex.
- * casin: (libc)Inverse Trig Functions.
- * casinf: (libc)Inverse Trig Functions.
- * casinfN: (libc)Inverse Trig Functions.
- * casinfNx: (libc)Inverse Trig Functions.
- * casinh: (libc)Hyperbolic Functions.
- * casinhf: (libc)Hyperbolic Functions.
- * casinhfN: (libc)Hyperbolic Functions.
- * casinhfNx: (libc)Hyperbolic Functions.
- * casinhl: (libc)Hyperbolic Functions.
- * casinl: (libc)Inverse Trig Functions.
- * catan: (libc)Inverse Trig Functions.
- * catanf: (libc)Inverse Trig Functions.
- * catanfN: (libc)Inverse Trig Functions.
- * catanfNx: (libc)Inverse Trig Functions.
- * catanh: (libc)Hyperbolic Functions.
- * catanhf: (libc)Hyperbolic Functions.
- * catanhfN: (libc)Hyperbolic Functions.
- * catanhfNx: (libc)Hyperbolic Functions.
- * catanhl: (libc)Hyperbolic Functions.
- * catanl: (libc)Inverse Trig Functions.
- * catclose: (libc)The catgets Functions.
- * catgets: (libc)The catgets Functions.
- * catopen: (libc)The catgets Functions.
- * cbrt: (libc)Exponents and Logarithms.
- * cbrtf: (libc)Exponents and Logarithms.
- * cbrtfN: (libc)Exponents and Logarithms.
- * cbrtfNx: (libc)Exponents and Logarithms.
- * cbrtl: (libc)Exponents and Logarithms.
- * ccos: (libc)Trig Functions.
- * ccosf: (libc)Trig Functions.
- * ccosfN: (libc)Trig Functions.
- * ccosfNx: (libc)Trig Functions.
- * ccosh: (libc)Hyperbolic Functions.
- * ccoshf: (libc)Hyperbolic Functions.
- * ccoshfN: (libc)Hyperbolic Functions.
- * ccoshfNx: (libc)Hyperbolic Functions.
- * ccoshl: (libc)Hyperbolic Functions.
- * ccosl: (libc)Trig Functions.
- * ceil: (libc)Rounding Functions.
- * ceilf: (libc)Rounding Functions.
- * ceilfN: (libc)Rounding Functions.
- * ceilfNx: (libc)Rounding Functions.
- * ceill: (libc)Rounding Functions.
- * cexp: (libc)Exponents and Logarithms.
- * cexpf: (libc)Exponents and Logarithms.
- * cexpfN: (libc)Exponents and Logarithms.
- * cexpfNx: (libc)Exponents and Logarithms.
- * cexpl: (libc)Exponents and Logarithms.
- * cfgetibaud: (libc)Line Speed.
- * cfgetispeed: (libc)Line Speed.
- * cfgetobaud: (libc)Line Speed.
- * cfgetospeed: (libc)Line Speed.
- * cfmakeraw: (libc)Noncanonical Input.
- * cfsetbaud: (libc)Line Speed.
- * cfsetibaud: (libc)Line Speed.
- * cfsetispeed: (libc)Line Speed.
- * cfsetobaud: (libc)Line Speed.
- * cfsetospeed: (libc)Line Speed.
- * cfsetspeed: (libc)Line Speed.
- * chdir: (libc)Working Directory.
- * chmod: (libc)Setting Permissions.
- * chown: (libc)File Owner.
- * cimag: (libc)Operations on Complex.
- * cimagf: (libc)Operations on Complex.
- * cimagfN: (libc)Operations on Complex.
- * cimagfNx: (libc)Operations on Complex.
- * cimagl: (libc)Operations on Complex.
- * clearenv: (libc)Environment Access.
- * clearerr: (libc)Error Recovery.
- * clearerr_unlocked: (libc)Error Recovery.
- * clock: (libc)CPU Time.
- * clock_getres: (libc)Getting the Time.
- * clock_gettime: (libc)Getting the Time.
- * clock_nanosleep: (libc)Sleeping.
- * clock_settime: (libc)Setting and Adjusting the Time.
- * clog10: (libc)Exponents and Logarithms.
- * clog10f: (libc)Exponents and Logarithms.
- * clog10fN: (libc)Exponents and Logarithms.
- * clog10fNx: (libc)Exponents and Logarithms.
- * clog10l: (libc)Exponents and Logarithms.
- * clog: (libc)Exponents and Logarithms.
- * clogf: (libc)Exponents and Logarithms.
- * clogfN: (libc)Exponents and Logarithms.
- * clogfNx: (libc)Exponents and Logarithms.
- * clogl: (libc)Exponents and Logarithms.
- * close: (libc)Opening and Closing Files.
- * close_range: (libc)Opening and Closing Files.
- * closedir: (libc)Reading/Closing Directory.
- * closefrom: (libc)Opening and Closing Files.
- * closelog: (libc)closelog.
- * cnd_broadcast: (libc)ISO C Condition Variables.
- * cnd_destroy: (libc)ISO C Condition Variables.
- * cnd_init: (libc)ISO C Condition Variables.
- * cnd_signal: (libc)ISO C Condition Variables.
- * cnd_timedwait: (libc)ISO C Condition Variables.
- * cnd_wait: (libc)ISO C Condition Variables.
- * compoundn: (libc)Exponents and Logarithms.
- * compoundnf: (libc)Exponents and Logarithms.
- * compoundnfN: (libc)Exponents and Logarithms.
- * compoundnfNx: (libc)Exponents and Logarithms.
- * compoundnl: (libc)Exponents and Logarithms.
- * confstr: (libc)String Parameters.
- * conj: (libc)Operations on Complex.
- * conjf: (libc)Operations on Complex.
- * conjfN: (libc)Operations on Complex.
- * conjfNx: (libc)Operations on Complex.
- * conjl: (libc)Operations on Complex.
- * connect: (libc)Connecting.
- * copy_file_range: (libc)Copying File Data.
- * copysign: (libc)FP Bit Twiddling.
- * copysignf: (libc)FP Bit Twiddling.
- * copysignfN: (libc)FP Bit Twiddling.
- * copysignfNx: (libc)FP Bit Twiddling.
- * copysignl: (libc)FP Bit Twiddling.
- * cos: (libc)Trig Functions.
- * cosf: (libc)Trig Functions.
- * cosfN: (libc)Trig Functions.
- * cosfNx: (libc)Trig Functions.
- * cosh: (libc)Hyperbolic Functions.
- * coshf: (libc)Hyperbolic Functions.
- * coshfN: (libc)Hyperbolic Functions.
- * coshfNx: (libc)Hyperbolic Functions.
- * coshl: (libc)Hyperbolic Functions.
- * cosl: (libc)Trig Functions.
- * cospi: (libc)Trig Functions.
- * cospif: (libc)Trig Functions.
- * cospifN: (libc)Trig Functions.
- * cospifNx: (libc)Trig Functions.
- * cospil: (libc)Trig Functions.
- * cpow: (libc)Exponents and Logarithms.
- * cpowf: (libc)Exponents and Logarithms.
- * cpowfN: (libc)Exponents and Logarithms.
- * cpowfNx: (libc)Exponents and Logarithms.
- * cpowl: (libc)Exponents and Logarithms.
- * cproj: (libc)Operations on Complex.
- * cprojf: (libc)Operations on Complex.
- * cprojfN: (libc)Operations on Complex.
- * cprojfNx: (libc)Operations on Complex.
- * cprojl: (libc)Operations on Complex.
- * creal: (libc)Operations on Complex.
- * crealf: (libc)Operations on Complex.
- * crealfN: (libc)Operations on Complex.
- * crealfNx: (libc)Operations on Complex.
- * creall: (libc)Operations on Complex.
- * creat64: (libc)Opening and Closing Files.
- * creat: (libc)Opening and Closing Files.
- * csin: (libc)Trig Functions.
- * csinf: (libc)Trig Functions.
- * csinfN: (libc)Trig Functions.
- * csinfNx: (libc)Trig Functions.
- * csinh: (libc)Hyperbolic Functions.
- * csinhf: (libc)Hyperbolic Functions.
- * csinhfN: (libc)Hyperbolic Functions.
- * csinhfNx: (libc)Hyperbolic Functions.
- * csinhl: (libc)Hyperbolic Functions.
- * csinl: (libc)Trig Functions.
- * csqrt: (libc)Exponents and Logarithms.
- * csqrtf: (libc)Exponents and Logarithms.
- * csqrtfN: (libc)Exponents and Logarithms.
- * csqrtfNx: (libc)Exponents and Logarithms.
- * csqrtl: (libc)Exponents and Logarithms.
- * ctan: (libc)Trig Functions.
- * ctanf: (libc)Trig Functions.
- * ctanfN: (libc)Trig Functions.
- * ctanfNx: (libc)Trig Functions.
- * ctanh: (libc)Hyperbolic Functions.
- * ctanhf: (libc)Hyperbolic Functions.
- * ctanhfN: (libc)Hyperbolic Functions.
- * ctanhfNx: (libc)Hyperbolic Functions.
- * ctanhl: (libc)Hyperbolic Functions.
- * ctanl: (libc)Trig Functions.
- * ctermid: (libc)Identifying the Terminal.
- * ctime: (libc)Formatting Calendar Time.
- * ctime_r: (libc)Formatting Calendar Time.
- * cuserid: (libc)Who Logged In.
- * daddl: (libc)Misc FP Arithmetic.
- * dcgettext: (libc)Translation with gettext.
- * dcngettext: (libc)Advanced gettext functions.
- * ddivl: (libc)Misc FP Arithmetic.
- * dfmal: (libc)Misc FP Arithmetic.
- * dgettext: (libc)Translation with gettext.
- * difftime: (libc)Calculating Elapsed Time.
- * dirfd: (libc)Opening a Directory.
- * dirname: (libc)Finding Tokens in a String.
- * div: (libc)Integer Division.
- * dlinfo: (libc)Dynamic Linker Introspection.
- * dmull: (libc)Misc FP Arithmetic.
- * dngettext: (libc)Advanced gettext functions.
- * dprintf: (libc)Formatted Output Functions.
- * drand48: (libc)SVID Random.
- * drand48_r: (libc)SVID Random.
- * drem: (libc)Remainder Functions.
- * dremf: (libc)Remainder Functions.
- * dreml: (libc)Remainder Functions.
- * dsqrtl: (libc)Misc FP Arithmetic.
- * dsubl: (libc)Misc FP Arithmetic.
- * dup2: (libc)Duplicating Descriptors.
- * dup3: (libc)Duplicating Descriptors.
- * dup: (libc)Duplicating Descriptors.
- * ecvt: (libc)System V Number Conversion.
- * ecvt_r: (libc)System V Number Conversion.
- * endfsent: (libc)fstab.
- * endgrent: (libc)Scanning All Groups.
- * endhostent: (libc)Host Names.
- * endmntent: (libc)mtab.
- * endnetent: (libc)Networks Database.
- * endnetgrent: (libc)Lookup Netgroup.
- * endprotoent: (libc)Protocols Database.
- * endpwent: (libc)Scanning All Users.
- * endservent: (libc)Services Database.
- * endutent: (libc)Manipulating the Database.
- * endutxent: (libc)XPG Functions.
- * envz_add: (libc)Envz Functions.
- * envz_entry: (libc)Envz Functions.
- * envz_get: (libc)Envz Functions.
- * envz_merge: (libc)Envz Functions.
- * envz_remove: (libc)Envz Functions.
- * envz_strip: (libc)Envz Functions.
- * epoll_create: (libc)Other Low-Level I/O APIs.
- * epoll_wait: (libc)Other Low-Level I/O APIs.
- * erand48: (libc)SVID Random.
- * erand48_r: (libc)SVID Random.
- * erf: (libc)Special Functions.
- * erfc: (libc)Special Functions.
- * erfcf: (libc)Special Functions.
- * erfcfN: (libc)Special Functions.
- * erfcfNx: (libc)Special Functions.
- * erfcl: (libc)Special Functions.
- * erff: (libc)Special Functions.
- * erffN: (libc)Special Functions.
- * erffNx: (libc)Special Functions.
- * erfl: (libc)Special Functions.
- * err: (libc)Error Messages.
- * errno: (libc)Checking for Errors.
- * error: (libc)Error Messages.
- * error_at_line: (libc)Error Messages.
- * errx: (libc)Error Messages.
- * execl: (libc)Executing a File.
- * execle: (libc)Executing a File.
- * execlp: (libc)Executing a File.
- * execv: (libc)Executing a File.
- * execve: (libc)Executing a File.
- * execvp: (libc)Executing a File.
- * exit: (libc)Normal Termination.
- * exp10: (libc)Exponents and Logarithms.
- * exp10f: (libc)Exponents and Logarithms.
- * exp10fN: (libc)Exponents and Logarithms.
- * exp10fNx: (libc)Exponents and Logarithms.
- * exp10l: (libc)Exponents and Logarithms.
- * exp10m1: (libc)Exponents and Logarithms.
- * exp10m1f: (libc)Exponents and Logarithms.
- * exp10m1fN: (libc)Exponents and Logarithms.
- * exp10m1fNx: (libc)Exponents and Logarithms.
- * exp10m1l: (libc)Exponents and Logarithms.
- * exp2: (libc)Exponents and Logarithms.
- * exp2f: (libc)Exponents and Logarithms.
- * exp2fN: (libc)Exponents and Logarithms.
- * exp2fNx: (libc)Exponents and Logarithms.
- * exp2l: (libc)Exponents and Logarithms.
- * exp2m1: (libc)Exponents and Logarithms.
- * exp2m1f: (libc)Exponents and Logarithms.
- * exp2m1fN: (libc)Exponents and Logarithms.
- * exp2m1fNx: (libc)Exponents and Logarithms.
- * exp2m1l: (libc)Exponents and Logarithms.
- * exp: (libc)Exponents and Logarithms.
- * expf: (libc)Exponents and Logarithms.
- * expfN: (libc)Exponents and Logarithms.
- * expfNx: (libc)Exponents and Logarithms.
- * expl: (libc)Exponents and Logarithms.
- * explicit_bzero: (libc)Erasing Sensitive Data.
- * expm1: (libc)Exponents and Logarithms.
- * expm1f: (libc)Exponents and Logarithms.
- * expm1fN: (libc)Exponents and Logarithms.
- * expm1fNx: (libc)Exponents and Logarithms.
- * expm1l: (libc)Exponents and Logarithms.
- * fMaddfN: (libc)Misc FP Arithmetic.
- * fMaddfNx: (libc)Misc FP Arithmetic.
- * fMdivfN: (libc)Misc FP Arithmetic.
- * fMdivfNx: (libc)Misc FP Arithmetic.
- * fMfmafN: (libc)Misc FP Arithmetic.
- * fMfmafNx: (libc)Misc FP Arithmetic.
- * fMmulfN: (libc)Misc FP Arithmetic.
- * fMmulfNx: (libc)Misc FP Arithmetic.
- * fMsqrtfN: (libc)Misc FP Arithmetic.
- * fMsqrtfNx: (libc)Misc FP Arithmetic.
- * fMsubfN: (libc)Misc FP Arithmetic.
- * fMsubfNx: (libc)Misc FP Arithmetic.
- * fMxaddfN: (libc)Misc FP Arithmetic.
- * fMxaddfNx: (libc)Misc FP Arithmetic.
- * fMxdivfN: (libc)Misc FP Arithmetic.
- * fMxdivfNx: (libc)Misc FP Arithmetic.
- * fMxfmafN: (libc)Misc FP Arithmetic.
- * fMxfmafNx: (libc)Misc FP Arithmetic.
- * fMxmulfN: (libc)Misc FP Arithmetic.
- * fMxmulfNx: (libc)Misc FP Arithmetic.
- * fMxsqrtfN: (libc)Misc FP Arithmetic.
- * fMxsqrtfNx: (libc)Misc FP Arithmetic.
- * fMxsubfN: (libc)Misc FP Arithmetic.
- * fMxsubfNx: (libc)Misc FP Arithmetic.
- * fabs: (libc)Absolute Value.
- * fabsf: (libc)Absolute Value.
- * fabsfN: (libc)Absolute Value.
- * fabsfNx: (libc)Absolute Value.
- * fabsl: (libc)Absolute Value.
- * faccessat: (libc)Testing File Access.
- * fadd: (libc)Misc FP Arithmetic.
- * faddl: (libc)Misc FP Arithmetic.
- * fchdir: (libc)Working Directory.
- * fchmod: (libc)Setting Permissions.
- * fchown: (libc)File Owner.
- * fclose: (libc)Closing Streams.
- * fcloseall: (libc)Closing Streams.
- * fcntl: (libc)Control Operations.
- * fcvt: (libc)System V Number Conversion.
- * fcvt_r: (libc)System V Number Conversion.
- * fdatasync: (libc)Synchronizing I/O.
- * fdim: (libc)Misc FP Arithmetic.
- * fdimf: (libc)Misc FP Arithmetic.
- * fdimfN: (libc)Misc FP Arithmetic.
- * fdimfNx: (libc)Misc FP Arithmetic.
- * fdiml: (libc)Misc FP Arithmetic.
- * fdiv: (libc)Misc FP Arithmetic.
- * fdivl: (libc)Misc FP Arithmetic.
- * fdopen: (libc)Descriptors and Streams.
- * fdopendir: (libc)Opening a Directory.
- * feclearexcept: (libc)Status bit operations.
- * fedisableexcept: (libc)Control Functions.
- * feenableexcept: (libc)Control Functions.
- * fegetenv: (libc)Control Functions.
- * fegetexcept: (libc)Control Functions.
- * fegetexceptflag: (libc)Status bit operations.
- * fegetmode: (libc)Control Functions.
- * fegetround: (libc)Rounding.
- * feholdexcept: (libc)Control Functions.
- * feof: (libc)EOF and Errors.
- * feof_unlocked: (libc)EOF and Errors.
- * feraiseexcept: (libc)Status bit operations.
- * ferror: (libc)EOF and Errors.
- * ferror_unlocked: (libc)EOF and Errors.
- * fesetenv: (libc)Control Functions.
- * fesetexcept: (libc)Status bit operations.
- * fesetexceptflag: (libc)Status bit operations.
- * fesetmode: (libc)Control Functions.
- * fesetround: (libc)Rounding.
- * fetestexcept: (libc)Status bit operations.
- * fetestexceptflag: (libc)Status bit operations.
- * feupdateenv: (libc)Control Functions.
- * fexecve: (libc)Executing a File.
- * fflush: (libc)Flushing Buffers.
- * fflush_unlocked: (libc)Flushing Buffers.
- * ffma: (libc)Misc FP Arithmetic.
- * ffmal: (libc)Misc FP Arithmetic.
- * fgetc: (libc)Character Input.
- * fgetc_unlocked: (libc)Character Input.
- * fgetgrent: (libc)Scanning All Groups.
- * fgetgrent_r: (libc)Scanning All Groups.
- * fgetpos64: (libc)Portable Positioning.
- * fgetpos: (libc)Portable Positioning.
- * fgetpwent: (libc)Scanning All Users.
- * fgetpwent_r: (libc)Scanning All Users.
- * fgets: (libc)Line Input.
- * fgets_unlocked: (libc)Line Input.
- * fgetwc: (libc)Character Input.
- * fgetwc_unlocked: (libc)Character Input.
- * fgetws: (libc)Line Input.
- * fgetws_unlocked: (libc)Line Input.
- * fileno: (libc)Descriptors and Streams.
- * fileno_unlocked: (libc)Descriptors and Streams.
- * finite: (libc)Floating Point Classes.
- * finitef: (libc)Floating Point Classes.
- * finitel: (libc)Floating Point Classes.
- * flockfile: (libc)Streams and Threads.
- * floor: (libc)Rounding Functions.
- * floorf: (libc)Rounding Functions.
- * floorfN: (libc)Rounding Functions.
- * floorfNx: (libc)Rounding Functions.
- * floorl: (libc)Rounding Functions.
- * fma: (libc)Misc FP Arithmetic.
- * fmaf: (libc)Misc FP Arithmetic.
- * fmafN: (libc)Misc FP Arithmetic.
- * fmafNx: (libc)Misc FP Arithmetic.
- * fmal: (libc)Misc FP Arithmetic.
- * fmax: (libc)Misc FP Arithmetic.
- * fmaxf: (libc)Misc FP Arithmetic.
- * fmaxfN: (libc)Misc FP Arithmetic.
- * fmaxfNx: (libc)Misc FP Arithmetic.
- * fmaximum: (libc)Misc FP Arithmetic.
- * fmaximum_mag: (libc)Misc FP Arithmetic.
- * fmaximum_mag_num: (libc)Misc FP Arithmetic.
- * fmaximum_mag_numf: (libc)Misc FP Arithmetic.
- * fmaximum_mag_numfN: (libc)Misc FP Arithmetic.
- * fmaximum_mag_numfNx: (libc)Misc FP Arithmetic.
- * fmaximum_mag_numl: (libc)Misc FP Arithmetic.
- * fmaximum_magf: (libc)Misc FP Arithmetic.
- * fmaximum_magfN: (libc)Misc FP Arithmetic.
- * fmaximum_magfNx: (libc)Misc FP Arithmetic.
- * fmaximum_magl: (libc)Misc FP Arithmetic.
- * fmaximum_num: (libc)Misc FP Arithmetic.
- * fmaximum_numf: (libc)Misc FP Arithmetic.
- * fmaximum_numfN: (libc)Misc FP Arithmetic.
- * fmaximum_numfNx: (libc)Misc FP Arithmetic.
- * fmaximum_numl: (libc)Misc FP Arithmetic.
- * fmaximumf: (libc)Misc FP Arithmetic.
- * fmaximumfN: (libc)Misc FP Arithmetic.
- * fmaximumfNx: (libc)Misc FP Arithmetic.
- * fmaximuml: (libc)Misc FP Arithmetic.
- * fmaxl: (libc)Misc FP Arithmetic.
- * fmaxmag: (libc)Misc FP Arithmetic.
- * fmaxmagf: (libc)Misc FP Arithmetic.
- * fmaxmagfN: (libc)Misc FP Arithmetic.
- * fmaxmagfNx: (libc)Misc FP Arithmetic.
- * fmaxmagl: (libc)Misc FP Arithmetic.
- * fmemopen: (libc)String Streams.
- * fmin: (libc)Misc FP Arithmetic.
- * fminf: (libc)Misc FP Arithmetic.
- * fminfN: (libc)Misc FP Arithmetic.
- * fminfNx: (libc)Misc FP Arithmetic.
- * fminimum: (libc)Misc FP Arithmetic.
- * fminimum_mag: (libc)Misc FP Arithmetic.
- * fminimum_mag_num: (libc)Misc FP Arithmetic.
- * fminimum_mag_numf: (libc)Misc FP Arithmetic.
- * fminimum_mag_numfN: (libc)Misc FP Arithmetic.
- * fminimum_mag_numfNx: (libc)Misc FP Arithmetic.
- * fminimum_mag_numl: (libc)Misc FP Arithmetic.
- * fminimum_magf: (libc)Misc FP Arithmetic.
- * fminimum_magfN: (libc)Misc FP Arithmetic.
- * fminimum_magfNx: (libc)Misc FP Arithmetic.
- * fminimum_magl: (libc)Misc FP Arithmetic.
- * fminimum_num: (libc)Misc FP Arithmetic.
- * fminimum_numf: (libc)Misc FP Arithmetic.
- * fminimum_numfN: (libc)Misc FP Arithmetic.
- * fminimum_numfNx: (libc)Misc FP Arithmetic.
- * fminimum_numl: (libc)Misc FP Arithmetic.
- * fminimumf: (libc)Misc FP Arithmetic.
- * fminimumfN: (libc)Misc FP Arithmetic.
- * fminimumfNx: (libc)Misc FP Arithmetic.
- * fminimuml: (libc)Misc FP Arithmetic.
- * fminl: (libc)Misc FP Arithmetic.
- * fminmag: (libc)Misc FP Arithmetic.
- * fminmagf: (libc)Misc FP Arithmetic.
- * fminmagfN: (libc)Misc FP Arithmetic.
- * fminmagfNx: (libc)Misc FP Arithmetic.
- * fminmagl: (libc)Misc FP Arithmetic.
- * fmod: (libc)Remainder Functions.
- * fmodf: (libc)Remainder Functions.
- * fmodfN: (libc)Remainder Functions.
- * fmodfNx: (libc)Remainder Functions.
- * fmodl: (libc)Remainder Functions.
- * fmtmsg: (libc)Printing Formatted Messages.
- * fmul: (libc)Misc FP Arithmetic.
- * fmull: (libc)Misc FP Arithmetic.
- * fnmatch: (libc)Wildcard Matching.
- * fopen64: (libc)Opening Streams.
- * fopen: (libc)Opening Streams.
- * fopencookie: (libc)Streams and Cookies.
- * fork: (libc)Creating a Process.
- * forkpty: (libc)Pseudo-Terminal Pairs.
- * fpathconf: (libc)Pathconf.
- * fpclassify: (libc)Floating Point Classes.
- * fprintf: (libc)Formatted Output Functions.
- * fputc: (libc)Simple Output.
- * fputc_unlocked: (libc)Simple Output.
- * fputs: (libc)Simple Output.
- * fputs_unlocked: (libc)Simple Output.
- * fputwc: (libc)Simple Output.
- * fputwc_unlocked: (libc)Simple Output.
- * fputws: (libc)Simple Output.
- * fputws_unlocked: (libc)Simple Output.
- * fread: (libc)Block Input/Output.
- * fread_unlocked: (libc)Block Input/Output.
- * free: (libc)Freeing after Malloc.
- * free_aligned_sized: (libc)Freeing after Malloc.
- * free_sized: (libc)Freeing after Malloc.
- * freopen64: (libc)Opening Streams.
- * freopen: (libc)Opening Streams.
- * frexp: (libc)Normalization Functions.
- * frexpf: (libc)Normalization Functions.
- * frexpfN: (libc)Normalization Functions.
- * frexpfNx: (libc)Normalization Functions.
- * frexpl: (libc)Normalization Functions.
- * fromfp: (libc)Rounding Functions.
- * fromfpf: (libc)Rounding Functions.
- * fromfpfN: (libc)Rounding Functions.
- * fromfpfNx: (libc)Rounding Functions.
- * fromfpl: (libc)Rounding Functions.
- * fromfpx: (libc)Rounding Functions.
- * fromfpxf: (libc)Rounding Functions.
- * fromfpxfN: (libc)Rounding Functions.
- * fromfpxfNx: (libc)Rounding Functions.
- * fromfpxl: (libc)Rounding Functions.
- * fscanf: (libc)Formatted Input Functions.
- * fseek: (libc)File Positioning.
- * fseeko64: (libc)File Positioning.
- * fseeko: (libc)File Positioning.
- * fsetpos64: (libc)Portable Positioning.
- * fsetpos: (libc)Portable Positioning.
- * fsqrt: (libc)Misc FP Arithmetic.
- * fsqrtl: (libc)Misc FP Arithmetic.
- * fstat64: (libc)Reading Attributes.
- * fstat: (libc)Reading Attributes.
- * fstatat64: (libc)Reading Attributes.
- * fstatat: (libc)Reading Attributes.
- * fsub: (libc)Misc FP Arithmetic.
- * fsubl: (libc)Misc FP Arithmetic.
- * fsync: (libc)Synchronizing I/O.
- * ftell: (libc)File Positioning.
- * ftello64: (libc)File Positioning.
- * ftello: (libc)File Positioning.
- * ftruncate64: (libc)File Size.
- * ftruncate: (libc)File Size.
- * ftrylockfile: (libc)Streams and Threads.
- * ftw64: (libc)Working with Directory Trees.
- * ftw: (libc)Working with Directory Trees.
- * funlockfile: (libc)Streams and Threads.
- * futimens: (libc)File Times.
- * futimes: (libc)File Times.
- * fwide: (libc)Streams and I18N.
- * fwprintf: (libc)Formatted Output Functions.
- * fwrite: (libc)Block Input/Output.
- * fwrite_unlocked: (libc)Block Input/Output.
- * fwscanf: (libc)Formatted Input Functions.
- * gamma: (libc)Special Functions.
- * gammaf: (libc)Special Functions.
- * gammal: (libc)Special Functions.
- * gcvt: (libc)System V Number Conversion.
- * get_avphys_pages: (libc)Query Memory Parameters.
- * get_current_dir_name: (libc)Working Directory.
- * get_nprocs: (libc)Processor Resources.
- * get_nprocs_conf: (libc)Processor Resources.
- * get_phys_pages: (libc)Query Memory Parameters.
- * getauxval: (libc)Auxiliary Vector.
- * getc: (libc)Character Input.
- * getc_unlocked: (libc)Character Input.
- * getchar: (libc)Character Input.
- * getchar_unlocked: (libc)Character Input.
- * getcontext: (libc)System V contexts.
- * getcpu: (libc)CPU Affinity.
- * getcwd: (libc)Working Directory.
- * getdate: (libc)General Time String Parsing.
- * getdate_r: (libc)General Time String Parsing.
- * getdelim: (libc)Line Input.
- * getdents64: (libc)Low-level Directory Access.
- * getdomainname: (libc)Host Identification.
- * getegid: (libc)Reading Persona.
- * getentropy: (libc)Unpredictable Bytes.
- * getenv: (libc)Environment Access.
- * geteuid: (libc)Reading Persona.
- * getfsent: (libc)fstab.
- * getfsfile: (libc)fstab.
- * getfsspec: (libc)fstab.
- * getgid: (libc)Reading Persona.
- * getgrent: (libc)Scanning All Groups.
- * getgrent_r: (libc)Scanning All Groups.
- * getgrgid: (libc)Lookup Group.
- * getgrgid_r: (libc)Lookup Group.
- * getgrnam: (libc)Lookup Group.
- * getgrnam_r: (libc)Lookup Group.
- * getgrouplist: (libc)Setting Groups.
- * getgroups: (libc)Reading Persona.
- * gethostbyaddr: (libc)Host Names.
- * gethostbyaddr_r: (libc)Host Names.
- * gethostbyname2: (libc)Host Names.
- * gethostbyname2_r: (libc)Host Names.
- * gethostbyname: (libc)Host Names.
- * gethostbyname_r: (libc)Host Names.
- * gethostent: (libc)Host Names.
- * gethostid: (libc)Host Identification.
- * gethostname: (libc)Host Identification.
- * getitimer: (libc)Setting an Alarm.
- * getline: (libc)Line Input.
- * getloadavg: (libc)Processor Resources.
- * getlogin: (libc)Who Logged In.
- * getmntent: (libc)mtab.
- * getmntent_r: (libc)mtab.
- * getnetbyaddr: (libc)Networks Database.
- * getnetbyname: (libc)Networks Database.
- * getnetent: (libc)Networks Database.
- * getnetgrent: (libc)Lookup Netgroup.
- * getnetgrent_r: (libc)Lookup Netgroup.
- * getopt: (libc)Using Getopt.
- * getopt_long: (libc)Getopt Long Options.
- * getopt_long_only: (libc)Getopt Long Options.
- * getpagesize: (libc)Query Memory Parameters.
- * getpass: (libc)getpass.
- * getpayload: (libc)FP Bit Twiddling.
- * getpayloadf: (libc)FP Bit Twiddling.
- * getpayloadfN: (libc)FP Bit Twiddling.
- * getpayloadfNx: (libc)FP Bit Twiddling.
- * getpayloadl: (libc)FP Bit Twiddling.
- * getpeername: (libc)Who is Connected.
- * getpgid: (libc)Process Group Functions.
- * getpgrp: (libc)Process Group Functions.
- * getpid: (libc)Process Identification.
- * getppid: (libc)Process Identification.
- * getpriority: (libc)Traditional Scheduling Functions.
- * getprotobyname: (libc)Protocols Database.
- * getprotobynumber: (libc)Protocols Database.
- * getprotoent: (libc)Protocols Database.
- * getpt: (libc)Allocation.
- * getpwent: (libc)Scanning All Users.
- * getpwent_r: (libc)Scanning All Users.
- * getpwnam: (libc)Lookup User.
- * getpwnam_r: (libc)Lookup User.
- * getpwuid: (libc)Lookup User.
- * getpwuid_r: (libc)Lookup User.
- * getrandom: (libc)Unpredictable Bytes.
- * getrlimit64: (libc)Limits on Resources.
- * getrlimit: (libc)Limits on Resources.
- * getrusage: (libc)Resource Usage.
- * gets: (libc)Line Input.
- * getservbyname: (libc)Services Database.
- * getservbyport: (libc)Services Database.
- * getservent: (libc)Services Database.
- * getsid: (libc)Process Group Functions.
- * getsockname: (libc)Reading Address.
- * getsockopt: (libc)Socket Option Functions.
- * getsubopt: (libc)Suboptions.
- * gettext: (libc)Translation with gettext.
- * gettid: (libc)Process Identification.
- * gettimeofday: (libc)Getting the Time.
- * getuid: (libc)Reading Persona.
- * getumask: (libc)Setting Permissions.
- * getutent: (libc)Manipulating the Database.
- * getutent_r: (libc)Manipulating the Database.
- * getutid: (libc)Manipulating the Database.
- * getutid_r: (libc)Manipulating the Database.
- * getutline: (libc)Manipulating the Database.
- * getutline_r: (libc)Manipulating the Database.
- * getutmp: (libc)XPG Functions.
- * getutmpx: (libc)XPG Functions.
- * getutxent: (libc)XPG Functions.
- * getutxid: (libc)XPG Functions.
- * getutxline: (libc)XPG Functions.
- * getw: (libc)Character Input.
- * getwc: (libc)Character Input.
- * getwc_unlocked: (libc)Character Input.
- * getwchar: (libc)Character Input.
- * getwchar_unlocked: (libc)Character Input.
- * getwd: (libc)Working Directory.
- * glob64: (libc)Calling Glob.
- * glob: (libc)Calling Glob.
- * globfree64: (libc)More Flags for Globbing.
- * globfree: (libc)More Flags for Globbing.
- * gmtime: (libc)Broken-down Time.
- * gmtime_r: (libc)Broken-down Time.
- * grantpt: (libc)Allocation.
- * gsignal: (libc)Signaling Yourself.
- * gtty: (libc)BSD Terminal Modes.
- * hasmntopt: (libc)mtab.
- * hcreate: (libc)Hash Search Function.
- * hcreate_r: (libc)Hash Search Function.
- * hdestroy: (libc)Hash Search Function.
- * hdestroy_r: (libc)Hash Search Function.
- * hsearch: (libc)Hash Search Function.
- * hsearch_r: (libc)Hash Search Function.
- * htonl: (libc)Byte Order.
- * htons: (libc)Byte Order.
- * hypot: (libc)Exponents and Logarithms.
- * hypotf: (libc)Exponents and Logarithms.
- * hypotfN: (libc)Exponents and Logarithms.
- * hypotfNx: (libc)Exponents and Logarithms.
- * hypotl: (libc)Exponents and Logarithms.
- * iconv: (libc)Generic Conversion Interface.
- * iconv_close: (libc)Generic Conversion Interface.
- * iconv_open: (libc)Generic Conversion Interface.
- * if_freenameindex: (libc)Interface Naming.
- * if_indextoname: (libc)Interface Naming.
- * if_nameindex: (libc)Interface Naming.
- * if_nametoindex: (libc)Interface Naming.
- * ilogb: (libc)Exponents and Logarithms.
- * ilogbf: (libc)Exponents and Logarithms.
- * ilogbfN: (libc)Exponents and Logarithms.
- * ilogbfNx: (libc)Exponents and Logarithms.
- * ilogbl: (libc)Exponents and Logarithms.
- * imaxabs: (libc)Absolute Value.
- * imaxdiv: (libc)Integer Division.
- * in6addr_any: (libc)Host Address Data Type.
- * in6addr_loopback: (libc)Host Address Data Type.
- * index: (libc)Search Functions.
- * inet_addr: (libc)Host Address Functions.
- * inet_aton: (libc)Host Address Functions.
- * inet_lnaof: (libc)Host Address Functions.
- * inet_makeaddr: (libc)Host Address Functions.
- * inet_netof: (libc)Host Address Functions.
- * inet_network: (libc)Host Address Functions.
- * inet_ntoa: (libc)Host Address Functions.
- * inet_ntop: (libc)Host Address Functions.
- * inet_pton: (libc)Host Address Functions.
- * initgroups: (libc)Setting Groups.
- * initstate: (libc)BSD Random.
- * initstate_r: (libc)BSD Random.
- * innetgr: (libc)Netgroup Membership.
- * ioctl: (libc)IOCTLs.
- * isalnum: (libc)Classification of Characters.
- * isalpha: (libc)Classification of Characters.
- * isascii: (libc)Classification of Characters.
- * isatty: (libc)Is It a Terminal.
- * isblank: (libc)Classification of Characters.
- * iscanonical: (libc)Floating Point Classes.
- * iscntrl: (libc)Classification of Characters.
- * isdigit: (libc)Classification of Characters.
- * iseqsig: (libc)FP Comparison Functions.
- * isfinite: (libc)Floating Point Classes.
- * isgraph: (libc)Classification of Characters.
- * isgreater: (libc)FP Comparison Functions.
- * isgreaterequal: (libc)FP Comparison Functions.
- * isinf: (libc)Floating Point Classes.
- * isinff: (libc)Floating Point Classes.
- * isinfl: (libc)Floating Point Classes.
- * isless: (libc)FP Comparison Functions.
- * islessequal: (libc)FP Comparison Functions.
- * islessgreater: (libc)FP Comparison Functions.
- * islower: (libc)Classification of Characters.
- * isnan: (libc)Floating Point Classes.
- * isnan: (libc)Floating Point Classes.
- * isnanf: (libc)Floating Point Classes.
- * isnanl: (libc)Floating Point Classes.
- * isnormal: (libc)Floating Point Classes.
- * isprint: (libc)Classification of Characters.
- * ispunct: (libc)Classification of Characters.
- * issignaling: (libc)Floating Point Classes.
- * isspace: (libc)Classification of Characters.
- * issubnormal: (libc)Floating Point Classes.
- * isunordered: (libc)FP Comparison Functions.
- * isupper: (libc)Classification of Characters.
- * iswalnum: (libc)Classification of Wide Characters.
- * iswalpha: (libc)Classification of Wide Characters.
- * iswblank: (libc)Classification of Wide Characters.
- * iswcntrl: (libc)Classification of Wide Characters.
- * iswctype: (libc)Classification of Wide Characters.
- * iswdigit: (libc)Classification of Wide Characters.
- * iswgraph: (libc)Classification of Wide Characters.
- * iswlower: (libc)Classification of Wide Characters.
- * iswprint: (libc)Classification of Wide Characters.
- * iswpunct: (libc)Classification of Wide Characters.
- * iswspace: (libc)Classification of Wide Characters.
- * iswupper: (libc)Classification of Wide Characters.
- * iswxdigit: (libc)Classification of Wide Characters.
- * isxdigit: (libc)Classification of Characters.
- * iszero: (libc)Floating Point Classes.
- * j0: (libc)Special Functions.
- * j0f: (libc)Special Functions.
- * j0fN: (libc)Special Functions.
- * j0fNx: (libc)Special Functions.
- * j0l: (libc)Special Functions.
- * j1: (libc)Special Functions.
- * j1f: (libc)Special Functions.
- * j1fN: (libc)Special Functions.
- * j1fNx: (libc)Special Functions.
- * j1l: (libc)Special Functions.
- * jn: (libc)Special Functions.
- * jnf: (libc)Special Functions.
- * jnfN: (libc)Special Functions.
- * jnfNx: (libc)Special Functions.
- * jnl: (libc)Special Functions.
- * jrand48: (libc)SVID Random.
- * jrand48_r: (libc)SVID Random.
- * kill: (libc)Signaling Another Process.
- * killpg: (libc)Signaling Another Process.
- * l64a: (libc)Encode Binary Data.
- * labs: (libc)Absolute Value.
- * lcong48: (libc)SVID Random.
- * lcong48_r: (libc)SVID Random.
- * ldexp: (libc)Normalization Functions.
- * ldexpf: (libc)Normalization Functions.
- * ldexpfN: (libc)Normalization Functions.
- * ldexpfNx: (libc)Normalization Functions.
- * ldexpl: (libc)Normalization Functions.
- * ldiv: (libc)Integer Division.
- * lfind: (libc)Array Search Function.
- * lgamma: (libc)Special Functions.
- * lgamma_r: (libc)Special Functions.
- * lgammaf: (libc)Special Functions.
- * lgammafN: (libc)Special Functions.
- * lgammafN_r: (libc)Special Functions.
- * lgammafNx: (libc)Special Functions.
- * lgammafNx_r: (libc)Special Functions.
- * lgammaf_r: (libc)Special Functions.
- * lgammal: (libc)Special Functions.
- * lgammal_r: (libc)Special Functions.
- * link: (libc)Hard Links.
- * linkat: (libc)Hard Links.
- * lio_listio64: (libc)Asynchronous Reads/Writes.
- * lio_listio: (libc)Asynchronous Reads/Writes.
- * listen: (libc)Listening.
- * llabs: (libc)Absolute Value.
- * lldiv: (libc)Integer Division.
- * llogb: (libc)Exponents and Logarithms.
- * llogbf: (libc)Exponents and Logarithms.
- * llogbfN: (libc)Exponents and Logarithms.
- * llogbfNx: (libc)Exponents and Logarithms.
- * llogbl: (libc)Exponents and Logarithms.
- * llrint: (libc)Rounding Functions.
- * llrintf: (libc)Rounding Functions.
- * llrintfN: (libc)Rounding Functions.
- * llrintfNx: (libc)Rounding Functions.
- * llrintl: (libc)Rounding Functions.
- * llround: (libc)Rounding Functions.
- * llroundf: (libc)Rounding Functions.
- * llroundfN: (libc)Rounding Functions.
- * llroundfNx: (libc)Rounding Functions.
- * llroundl: (libc)Rounding Functions.
- * localeconv: (libc)The Lame Way to Locale Data.
- * localtime: (libc)Broken-down Time.
- * localtime_r: (libc)Broken-down Time.
- * log10: (libc)Exponents and Logarithms.
- * log10f: (libc)Exponents and Logarithms.
- * log10fN: (libc)Exponents and Logarithms.
- * log10fNx: (libc)Exponents and Logarithms.
- * log10l: (libc)Exponents and Logarithms.
- * log10p1: (libc)Exponents and Logarithms.
- * log10p1f: (libc)Exponents and Logarithms.
- * log10p1fN: (libc)Exponents and Logarithms.
- * log10p1fNx: (libc)Exponents and Logarithms.
- * log10p1l: (libc)Exponents and Logarithms.
- * log1p: (libc)Exponents and Logarithms.
- * log1pf: (libc)Exponents and Logarithms.
- * log1pfN: (libc)Exponents and Logarithms.
- * log1pfNx: (libc)Exponents and Logarithms.
- * log1pl: (libc)Exponents and Logarithms.
- * log2: (libc)Exponents and Logarithms.
- * log2f: (libc)Exponents and Logarithms.
- * log2fN: (libc)Exponents and Logarithms.
- * log2fNx: (libc)Exponents and Logarithms.
- * log2l: (libc)Exponents and Logarithms.
- * log2p1: (libc)Exponents and Logarithms.
- * log2p1f: (libc)Exponents and Logarithms.
- * log2p1fN: (libc)Exponents and Logarithms.
- * log2p1fNx: (libc)Exponents and Logarithms.
- * log2p1l: (libc)Exponents and Logarithms.
- * log: (libc)Exponents and Logarithms.
- * logb: (libc)Exponents and Logarithms.
- * logbf: (libc)Exponents and Logarithms.
- * logbfN: (libc)Exponents and Logarithms.
- * logbfNx: (libc)Exponents and Logarithms.
- * logbl: (libc)Exponents and Logarithms.
- * logf: (libc)Exponents and Logarithms.
- * logfN: (libc)Exponents and Logarithms.
- * logfNx: (libc)Exponents and Logarithms.
- * login: (libc)Logging In and Out.
- * login_tty: (libc)Logging In and Out.
- * logl: (libc)Exponents and Logarithms.
- * logout: (libc)Logging In and Out.
- * logp1: (libc)Exponents and Logarithms.
- * logp1f: (libc)Exponents and Logarithms.
- * logp1fN: (libc)Exponents and Logarithms.
- * logp1fNx: (libc)Exponents and Logarithms.
- * logp1l: (libc)Exponents and Logarithms.
- * logwtmp: (libc)Logging In and Out.
- * longjmp: (libc)Non-Local Details.
- * lrand48: (libc)SVID Random.
- * lrand48_r: (libc)SVID Random.
- * lrint: (libc)Rounding Functions.
- * lrintf: (libc)Rounding Functions.
- * lrintfN: (libc)Rounding Functions.
- * lrintfNx: (libc)Rounding Functions.
- * lrintl: (libc)Rounding Functions.
- * lround: (libc)Rounding Functions.
- * lroundf: (libc)Rounding Functions.
- * lroundfN: (libc)Rounding Functions.
- * lroundfNx: (libc)Rounding Functions.
- * lroundl: (libc)Rounding Functions.
- * lsearch: (libc)Array Search Function.
- * lseek64: (libc)File Position Primitive.
- * lseek: (libc)File Position Primitive.
- * lstat64: (libc)Reading Attributes.
- * lstat: (libc)Reading Attributes.
- * lutimes: (libc)File Times.
- * madvise: (libc)Memory-mapped I/O.
- * makecontext: (libc)System V contexts.
- * mallinfo2: (libc)Statistics of Malloc.
- * malloc: (libc)Basic Allocation.
- * mallopt: (libc)Malloc Tunable Parameters.
- * mblen: (libc)Non-reentrant Character Conversion.
- * mbrlen: (libc)Converting a Character.
- * mbrtowc: (libc)Converting a Character.
- * mbsinit: (libc)Keeping the state.
- * mbsnrtowcs: (libc)Converting Strings.
- * mbsrtowcs: (libc)Converting Strings.
- * mbstowcs: (libc)Non-reentrant String Conversion.
- * mbtowc: (libc)Non-reentrant Character Conversion.
- * mcheck: (libc)Heap Consistency Checking.
- * memalign: (libc)Aligned Memory Blocks.
- * memalignment: (libc)Aligned Memory Blocks.
- * memccpy: (libc)Copying Strings and Arrays.
- * memchr: (libc)Search Functions.
- * memcmp: (libc)String/Array Comparison.
- * memcpy: (libc)Copying Strings and Arrays.
- * memfd_create: (libc)Memory-mapped I/O.
- * memfrob: (libc)Obfuscating Data.
- * memmem: (libc)Search Functions.
- * memmove: (libc)Copying Strings and Arrays.
- * mempcpy: (libc)Copying Strings and Arrays.
- * memrchr: (libc)Search Functions.
- * memset: (libc)Copying Strings and Arrays.
- * memset_explicit: (libc)Erasing Sensitive Data.
- * mkdir: (libc)Creating Directories.
- * mkdirat: (libc)Creating Directories.
- * mkdtemp: (libc)Temporary Files.
- * mkfifo: (libc)FIFO Special Files.
- * mknod: (libc)Making Special Files.
- * mkstemp: (libc)Temporary Files.
- * mktemp: (libc)Temporary Files.
- * mktime: (libc)Broken-down Time.
- * mlock2: (libc)Page Lock Functions.
- * mlock: (libc)Page Lock Functions.
- * mlockall: (libc)Page Lock Functions.
- * mmap64: (libc)Memory-mapped I/O.
- * mmap: (libc)Memory-mapped I/O.
- * modf: (libc)Rounding Functions.
- * modff: (libc)Rounding Functions.
- * modffN: (libc)Rounding Functions.
- * modffNx: (libc)Rounding Functions.
- * modfl: (libc)Rounding Functions.
- * mount: (libc)Mount-Unmount-Remount.
- * mprobe: (libc)Heap Consistency Checking.
- * mprotect: (libc)Memory Protection.
- * mrand48: (libc)SVID Random.
- * mrand48_r: (libc)SVID Random.
- * mremap: (libc)Memory-mapped I/O.
- * mseal: (libc)Memory Protection.
- * msync: (libc)Memory-mapped I/O.
- * mtrace: (libc)Tracing malloc.
- * mtx_destroy: (libc)ISO C Mutexes.
- * mtx_init: (libc)ISO C Mutexes.
- * mtx_lock: (libc)ISO C Mutexes.
- * mtx_timedlock: (libc)ISO C Mutexes.
- * mtx_trylock: (libc)ISO C Mutexes.
- * mtx_unlock: (libc)ISO C Mutexes.
- * munlock: (libc)Page Lock Functions.
- * munlockall: (libc)Page Lock Functions.
- * munmap: (libc)Memory-mapped I/O.
- * muntrace: (libc)Tracing malloc.
- * nan: (libc)FP Bit Twiddling.
- * nanf: (libc)FP Bit Twiddling.
- * nanfN: (libc)FP Bit Twiddling.
- * nanfNx: (libc)FP Bit Twiddling.
- * nanl: (libc)FP Bit Twiddling.
- * nanosleep: (libc)Sleeping.
- * nearbyint: (libc)Rounding Functions.
- * nearbyintf: (libc)Rounding Functions.
- * nearbyintfN: (libc)Rounding Functions.
- * nearbyintfNx: (libc)Rounding Functions.
- * nearbyintl: (libc)Rounding Functions.
- * nextafter: (libc)FP Bit Twiddling.
- * nextafterf: (libc)FP Bit Twiddling.
- * nextafterfN: (libc)FP Bit Twiddling.
- * nextafterfNx: (libc)FP Bit Twiddling.
- * nextafterl: (libc)FP Bit Twiddling.
- * nextdown: (libc)FP Bit Twiddling.
- * nextdownf: (libc)FP Bit Twiddling.
- * nextdownfN: (libc)FP Bit Twiddling.
- * nextdownfNx: (libc)FP Bit Twiddling.
- * nextdownl: (libc)FP Bit Twiddling.
- * nexttoward: (libc)FP Bit Twiddling.
- * nexttowardf: (libc)FP Bit Twiddling.
- * nexttowardl: (libc)FP Bit Twiddling.
- * nextup: (libc)FP Bit Twiddling.
- * nextupf: (libc)FP Bit Twiddling.
- * nextupfN: (libc)FP Bit Twiddling.
- * nextupfNx: (libc)FP Bit Twiddling.
- * nextupl: (libc)FP Bit Twiddling.
- * nftw64: (libc)Working with Directory Trees.
- * nftw: (libc)Working with Directory Trees.
- * ngettext: (libc)Advanced gettext functions.
- * nice: (libc)Traditional Scheduling Functions.
- * nl_langinfo: (libc)The Elegant and Fast Way.
- * nrand48: (libc)SVID Random.
- * nrand48_r: (libc)SVID Random.
- * ntohl: (libc)Byte Order.
- * ntohs: (libc)Byte Order.
- * ntp_adjtime: (libc)Setting and Adjusting the Time.
- * ntp_gettime: (libc)Setting and Adjusting the Time.
- * obstack_1grow: (libc)Growing Objects.
- * obstack_1grow_fast: (libc)Extra Fast Growing.
- * obstack_alignment_mask: (libc)Obstacks Data Alignment.
- * obstack_alloc: (libc)Allocation in an Obstack.
- * obstack_base: (libc)Status of an Obstack.
- * obstack_blank: (libc)Growing Objects.
- * obstack_blank_fast: (libc)Extra Fast Growing.
- * obstack_chunk_size: (libc)Obstack Chunks.
- * obstack_copy0: (libc)Allocation in an Obstack.
- * obstack_copy: (libc)Allocation in an Obstack.
- * obstack_finish: (libc)Growing Objects.
- * obstack_free: (libc)Freeing Obstack Objects.
- * obstack_grow0: (libc)Growing Objects.
- * obstack_grow: (libc)Growing Objects.
- * obstack_init: (libc)Preparing for Obstacks.
- * obstack_int_grow: (libc)Growing Objects.
- * obstack_int_grow_fast: (libc)Extra Fast Growing.
- * obstack_next_free: (libc)Status of an Obstack.
- * obstack_object_size: (libc)Growing Objects.
- * obstack_object_size: (libc)Status of an Obstack.
- * obstack_printf: (libc)Dynamic Output.
- * obstack_ptr_grow: (libc)Growing Objects.
- * obstack_ptr_grow_fast: (libc)Extra Fast Growing.
- * obstack_room: (libc)Extra Fast Growing.
- * obstack_vprintf: (libc)Variable Arguments Output.
- * offsetof: (libc)Structure Measurement.
- * on_exit: (libc)Cleanups on Exit.
- * open64: (libc)Opening and Closing Files.
- * open: (libc)Opening and Closing Files.
- * open_memstream: (libc)String Streams.
- * openat2: (libc)Opening and Closing Files.
- * openat64: (libc)Opening and Closing Files.
- * openat: (libc)Opening and Closing Files.
- * opendir: (libc)Opening a Directory.
- * openlog: (libc)openlog.
- * openpty: (libc)Pseudo-Terminal Pairs.
- * parse_printf_format: (libc)Parsing a Template String.
- * pathconf: (libc)Pathconf.
- * pause: (libc)Using Pause.
- * pclose: (libc)Pipe to a Subprocess.
- * perror: (libc)Error Messages.
- * pidfd_getpid: (libc)Querying a Process.
- * pipe: (libc)Creating a Pipe.
- * pkey_alloc: (libc)Memory Protection.
- * pkey_free: (libc)Memory Protection.
- * pkey_get: (libc)Memory Protection.
- * pkey_mprotect: (libc)Memory Protection.
- * pkey_set: (libc)Memory Protection.
- * poll: (libc)Other Low-Level I/O APIs.
- * popen: (libc)Pipe to a Subprocess.
- * posix_fallocate64: (libc)Storage Allocation.
- * posix_fallocate: (libc)Storage Allocation.
- * posix_memalign: (libc)Aligned Memory Blocks.
- * posix_openpt: (libc)Allocation.
- * pow: (libc)Exponents and Logarithms.
- * powf: (libc)Exponents and Logarithms.
- * powfN: (libc)Exponents and Logarithms.
- * powfNx: (libc)Exponents and Logarithms.
- * powl: (libc)Exponents and Logarithms.
- * pown: (libc)Exponents and Logarithms.
- * pownf: (libc)Exponents and Logarithms.
- * pownfN: (libc)Exponents and Logarithms.
- * pownfNx: (libc)Exponents and Logarithms.
- * pownl: (libc)Exponents and Logarithms.
- * powr: (libc)Exponents and Logarithms.
- * powrf: (libc)Exponents and Logarithms.
- * powrfN: (libc)Exponents and Logarithms.
- * powrfNx: (libc)Exponents and Logarithms.
- * powrl: (libc)Exponents and Logarithms.
- * pread64: (libc)I/O Primitives.
- * pread: (libc)I/O Primitives.
- * preadv2: (libc)Scatter-Gather.
- * preadv64: (libc)Scatter-Gather.
- * preadv64v2: (libc)Scatter-Gather.
- * preadv: (libc)Scatter-Gather.
- * printf: (libc)Formatted Output Functions.
- * printf_size: (libc)Predefined Printf Handlers.
- * printf_size_info: (libc)Predefined Printf Handlers.
- * psignal: (libc)Signal Messages.
- * pthread_attr_destroy: (libc)Creating and Destroying Threads.
- * pthread_attr_getaffinity_np: (libc)Thread CPU Affinity.
- * pthread_attr_getdetachstate: (libc)Creating and Destroying Threads.
- * pthread_attr_getsigmask_np: (libc)Initial Thread Signal Mask.
- * pthread_attr_init: (libc)Creating and Destroying Threads.
- * pthread_attr_setaffinity_np: (libc)Thread CPU Affinity.
- * pthread_attr_setdetachstate: (libc)Creating and Destroying Threads.
- * pthread_attr_setsigmask_np: (libc)Initial Thread Signal Mask.
- * pthread_barrier_destroy: (libc)POSIX Barriers.
- * pthread_barrier_init: (libc)POSIX Barriers.
- * pthread_barrier_wait: (libc)POSIX Barriers.
- * pthread_clockjoin_np: (libc)Joining Threads.
- * pthread_cond_clockwait: (libc)Waiting with Explicit Clocks.
- * pthread_create: (libc)Creating and Destroying Threads.
- * pthread_detach: (libc)Creating and Destroying Threads.
- * pthread_equal: (libc)POSIX Threads Other APIs.
- * pthread_getaffinity_np: (libc)Thread CPU Affinity.
- * pthread_getattr_default_np: (libc)Default Thread Attributes.
- * pthread_getcpuclockid: (libc)POSIX Threads Other APIs.
- * pthread_getname_np: (libc)Thread Names.
- * pthread_getspecific: (libc)Thread-specific Data.
- * pthread_gettid_np: (libc)Process Identification.
- * pthread_join: (libc)Creating and Destroying Threads.
- * pthread_key_create: (libc)Thread-specific Data.
- * pthread_key_delete: (libc)Thread-specific Data.
- * pthread_kill: (libc)Creating and Destroying Threads.
- * pthread_mutex_clocklock: (libc)POSIX Mutexes.
- * pthread_mutex_destroy: (libc)POSIX Mutexes.
- * pthread_mutex_init: (libc)POSIX Mutexes.
- * pthread_mutex_lock: (libc)POSIX Mutexes.
- * pthread_mutex_timedlock: (libc)POSIX Mutexes.
- * pthread_mutex_trylock: (libc)POSIX Mutexes.
- * pthread_mutex_unlock: (libc)POSIX Mutexes.
- * pthread_mutexattr_destroy: (libc)POSIX Mutexes.
- * pthread_mutexattr_gettype: (libc)POSIX Mutexes.
- * pthread_mutexattr_init: (libc)POSIX Mutexes.
- * pthread_mutexattr_settype: (libc)POSIX Mutexes.
- * pthread_once: (libc)POSIX Threads Other APIs.
- * pthread_rwlock_clockrdlock: (libc)Waiting with Explicit Clocks.
- * pthread_rwlock_clockwrlock: (libc)Waiting with Explicit Clocks.
- * pthread_self: (libc)Creating and Destroying Threads.
- * pthread_setaffinity_np: (libc)Thread CPU Affinity.
- * pthread_setattr_default_np: (libc)Default Thread Attributes.
- * pthread_setname_np: (libc)Thread Names.
- * pthread_setspecific: (libc)Thread-specific Data.
- * pthread_sigmask: (libc)POSIX Threads Other APIs.
- * pthread_spin_destroy: (libc)POSIX Spin Locks.
- * pthread_spin_init: (libc)POSIX Spin Locks.
- * pthread_spin_lock: (libc)POSIX Spin Locks.
- * pthread_spin_trylock: (libc)POSIX Spin Locks.
- * pthread_spin_unlock: (libc)POSIX Spin Locks.
- * pthread_timedjoin_np: (libc)Joining Threads.
- * pthread_tryjoin_np: (libc)Joining Threads.
- * ptsname: (libc)Allocation.
- * ptsname_r: (libc)Allocation.
- * putc: (libc)Simple Output.
- * putc_unlocked: (libc)Simple Output.
- * putchar: (libc)Simple Output.
- * putchar_unlocked: (libc)Simple Output.
- * putenv: (libc)Environment Access.
- * putpwent: (libc)Writing a User Entry.
- * puts: (libc)Simple Output.
- * pututline: (libc)Manipulating the Database.
- * pututxline: (libc)XPG Functions.
- * putw: (libc)Simple Output.
- * putwc: (libc)Simple Output.
- * putwc_unlocked: (libc)Simple Output.
- * putwchar: (libc)Simple Output.
- * putwchar_unlocked: (libc)Simple Output.
- * pwrite64: (libc)I/O Primitives.
- * pwrite: (libc)I/O Primitives.
- * pwritev2: (libc)Scatter-Gather.
- * pwritev64: (libc)Scatter-Gather.
- * pwritev64v2: (libc)Scatter-Gather.
- * pwritev: (libc)Scatter-Gather.
- * qecvt: (libc)System V Number Conversion.
- * qecvt_r: (libc)System V Number Conversion.
- * qfcvt: (libc)System V Number Conversion.
- * qfcvt_r: (libc)System V Number Conversion.
- * qgcvt: (libc)System V Number Conversion.
- * qsort: (libc)Array Sort Function.
- * raise: (libc)Signaling Yourself.
- * rand: (libc)ISO Random.
- * rand_r: (libc)ISO Random.
- * random: (libc)BSD Random.
- * random_r: (libc)BSD Random.
- * rawmemchr: (libc)Search Functions.
- * read: (libc)I/O Primitives.
- * readdir64: (libc)Reading/Closing Directory.
- * readdir64_r: (libc)Reading/Closing Directory.
- * readdir: (libc)Reading/Closing Directory.
- * readdir_r: (libc)Reading/Closing Directory.
- * readlink: (libc)Symbolic Links.
- * readv: (libc)Scatter-Gather.
- * realloc: (libc)Changing Block Size.
- * reallocarray: (libc)Changing Block Size.
- * realpath: (libc)Symbolic Links.
- * recv: (libc)Receiving Data.
- * recvfrom: (libc)Receiving Datagrams.
- * recvmsg: (libc)Other Socket APIs.
- * regcomp: (libc)POSIX Regexp Compilation.
- * regerror: (libc)Regexp Cleanup.
- * regexec: (libc)Matching POSIX Regexps.
- * regfree: (libc)Regexp Cleanup.
- * register_printf_function: (libc)Registering New Conversions.
- * remainder: (libc)Remainder Functions.
- * remainderf: (libc)Remainder Functions.
- * remainderfN: (libc)Remainder Functions.
- * remainderfNx: (libc)Remainder Functions.
- * remainderl: (libc)Remainder Functions.
- * remove: (libc)Deleting Files.
- * rename: (libc)Renaming Files.
- * renameat: (libc)Renaming Files.
- * rewind: (libc)File Positioning.
- * rewinddir: (libc)Random Access Directory.
- * rindex: (libc)Search Functions.
- * rint: (libc)Rounding Functions.
- * rintf: (libc)Rounding Functions.
- * rintfN: (libc)Rounding Functions.
- * rintfNx: (libc)Rounding Functions.
- * rintl: (libc)Rounding Functions.
- * rmdir: (libc)Deleting Files.
- * rootn: (libc)Exponents and Logarithms.
- * rootnf: (libc)Exponents and Logarithms.
- * rootnfN: (libc)Exponents and Logarithms.
- * rootnfNx: (libc)Exponents and Logarithms.
- * rootnl: (libc)Exponents and Logarithms.
- * round: (libc)Rounding Functions.
- * roundeven: (libc)Rounding Functions.
- * roundevenf: (libc)Rounding Functions.
- * roundevenfN: (libc)Rounding Functions.
- * roundevenfNx: (libc)Rounding Functions.
- * roundevenl: (libc)Rounding Functions.
- * roundf: (libc)Rounding Functions.
- * roundfN: (libc)Rounding Functions.
- * roundfNx: (libc)Rounding Functions.
- * roundl: (libc)Rounding Functions.
- * rpmatch: (libc)Yes-or-No Questions.
- * rsqrt: (libc)Exponents and Logarithms.
- * rsqrtf: (libc)Exponents and Logarithms.
- * rsqrtfN: (libc)Exponents and Logarithms.
- * rsqrtfNx: (libc)Exponents and Logarithms.
- * rsqrtl: (libc)Exponents and Logarithms.
- * sbrk: (libc)Resizing the Data Segment.
- * scalb: (libc)Normalization Functions.
- * scalbf: (libc)Normalization Functions.
- * scalbl: (libc)Normalization Functions.
- * scalbln: (libc)Normalization Functions.
- * scalblnf: (libc)Normalization Functions.
- * scalblnfN: (libc)Normalization Functions.
- * scalblnfNx: (libc)Normalization Functions.
- * scalblnl: (libc)Normalization Functions.
- * scalbn: (libc)Normalization Functions.
- * scalbnf: (libc)Normalization Functions.
- * scalbnfN: (libc)Normalization Functions.
- * scalbnfNx: (libc)Normalization Functions.
- * scalbnl: (libc)Normalization Functions.
- * scandir64: (libc)Scanning Directory Content.
- * scandir: (libc)Scanning Directory Content.
- * scanf: (libc)Formatted Input Functions.
- * sched_get_priority_max: (libc)Basic Scheduling Functions.
- * sched_get_priority_min: (libc)Basic Scheduling Functions.
- * sched_getaffinity: (libc)CPU Affinity.
- * sched_getattr: (libc)Extensible Scheduling.
- * sched_getcpu: (libc)CPU Affinity.
- * sched_getparam: (libc)Basic Scheduling Functions.
- * sched_getscheduler: (libc)Basic Scheduling Functions.
- * sched_rr_get_interval: (libc)Basic Scheduling Functions.
- * sched_setaffinity: (libc)CPU Affinity.
- * sched_setattr: (libc)Extensible Scheduling.
- * sched_setparam: (libc)Basic Scheduling Functions.
- * sched_setscheduler: (libc)Basic Scheduling Functions.
- * sched_yield: (libc)Basic Scheduling Functions.
- * secure_getenv: (libc)Environment Access.
- * seed48: (libc)SVID Random.
- * seed48_r: (libc)SVID Random.
- * seekdir: (libc)Random Access Directory.
- * select: (libc)Waiting for I/O.
- * sem_clockwait: (libc)POSIX Semaphores.
- * sem_close: (libc)POSIX Semaphores.
- * sem_destroy: (libc)POSIX Semaphores.
- * sem_getvalue: (libc)POSIX Semaphores.
- * sem_init: (libc)POSIX Semaphores.
- * sem_open: (libc)POSIX Semaphores.
- * sem_post: (libc)POSIX Semaphores.
- * sem_timedwait: (libc)POSIX Semaphores.
- * sem_trywait: (libc)POSIX Semaphores.
- * sem_unlink: (libc)POSIX Semaphores.
- * sem_wait: (libc)POSIX Semaphores.
- * semctl: (libc)Semaphores.
- * semget: (libc)Semaphores.
- * semop: (libc)Semaphores.
- * semtimedop: (libc)Semaphores.
- * send: (libc)Sending Data.
- * sendmsg: (libc)Other Socket APIs.
- * sendto: (libc)Sending Datagrams.
- * setbuf: (libc)Controlling Buffering.
- * setbuffer: (libc)Controlling Buffering.
- * setcontext: (libc)System V contexts.
- * setdomainname: (libc)Host Identification.
- * setegid: (libc)Setting Groups.
- * setenv: (libc)Environment Access.
- * seteuid: (libc)Setting User ID.
- * setfsent: (libc)fstab.
- * setgid: (libc)Setting Groups.
- * setgrent: (libc)Scanning All Groups.
- * setgroups: (libc)Setting Groups.
- * sethostent: (libc)Host Names.
- * sethostid: (libc)Host Identification.
- * sethostname: (libc)Host Identification.
- * setitimer: (libc)Setting an Alarm.
- * setjmp: (libc)Non-Local Details.
- * setlinebuf: (libc)Controlling Buffering.
- * setlocale: (libc)Setting the Locale.
- * setlogmask: (libc)setlogmask.
- * setmntent: (libc)mtab.
- * setnetent: (libc)Networks Database.
- * setnetgrent: (libc)Lookup Netgroup.
- * setpayload: (libc)FP Bit Twiddling.
- * setpayloadf: (libc)FP Bit Twiddling.
- * setpayloadfN: (libc)FP Bit Twiddling.
- * setpayloadfNx: (libc)FP Bit Twiddling.
- * setpayloadl: (libc)FP Bit Twiddling.
- * setpayloadsig: (libc)FP Bit Twiddling.
- * setpayloadsigf: (libc)FP Bit Twiddling.
- * setpayloadsigfN: (libc)FP Bit Twiddling.
- * setpayloadsigfNx: (libc)FP Bit Twiddling.
- * setpayloadsigl: (libc)FP Bit Twiddling.
- * setpgid: (libc)Process Group Functions.
- * setpgrp: (libc)Process Group Functions.
- * setpriority: (libc)Traditional Scheduling Functions.
- * setprotoent: (libc)Protocols Database.
- * setpwent: (libc)Scanning All Users.
- * setregid: (libc)Setting Groups.
- * setreuid: (libc)Setting User ID.
- * setrlimit64: (libc)Limits on Resources.
- * setrlimit: (libc)Limits on Resources.
- * setservent: (libc)Services Database.
- * setsid: (libc)Process Group Functions.
- * setsockopt: (libc)Socket Option Functions.
- * setstate: (libc)BSD Random.
- * setstate_r: (libc)BSD Random.
- * settimeofday: (libc)Setting and Adjusting the Time.
- * setuid: (libc)Setting User ID.
- * setutent: (libc)Manipulating the Database.
- * setutxent: (libc)XPG Functions.
- * setvbuf: (libc)Controlling Buffering.
- * shm_open: (libc)Memory-mapped I/O.
- * shm_unlink: (libc)Memory-mapped I/O.
- * shutdown: (libc)Closing a Socket.
- * sigabbrev_np: (libc)Signal Messages.
- * sigaction: (libc)Advanced Signal Handling.
- * sigaddset: (libc)Signal Sets.
- * sigaltstack: (libc)Signal Stack.
- * sigblock: (libc)BSD Signal Handling.
- * sigdelset: (libc)Signal Sets.
- * sigdescr_np: (libc)Signal Messages.
- * sigemptyset: (libc)Signal Sets.
- * sigfillset: (libc)Signal Sets.
- * siginterrupt: (libc)BSD Signal Handling.
- * sigismember: (libc)Signal Sets.
- * siglongjmp: (libc)Non-Local Exits and Signals.
- * sigmask: (libc)BSD Signal Handling.
- * signal: (libc)Basic Signal Handling.
- * signbit: (libc)FP Bit Twiddling.
- * significand: (libc)Normalization Functions.
- * significandf: (libc)Normalization Functions.
- * significandl: (libc)Normalization Functions.
- * sigpause: (libc)BSD Signal Handling.
- * sigpending: (libc)Checking for Pending Signals.
- * sigprocmask: (libc)Process Signal Mask.
- * sigsetjmp: (libc)Non-Local Exits and Signals.
- * sigsetmask: (libc)BSD Signal Handling.
- * sigstack: (libc)Signal Stack.
- * sigsuspend: (libc)Sigsuspend.
- * sin: (libc)Trig Functions.
- * sincos: (libc)Trig Functions.
- * sincosf: (libc)Trig Functions.
- * sincosfN: (libc)Trig Functions.
- * sincosfNx: (libc)Trig Functions.
- * sincosl: (libc)Trig Functions.
- * sinf: (libc)Trig Functions.
- * sinfN: (libc)Trig Functions.
- * sinfNx: (libc)Trig Functions.
- * sinh: (libc)Hyperbolic Functions.
- * sinhf: (libc)Hyperbolic Functions.
- * sinhfN: (libc)Hyperbolic Functions.
- * sinhfNx: (libc)Hyperbolic Functions.
- * sinhl: (libc)Hyperbolic Functions.
- * sinl: (libc)Trig Functions.
- * sinpi: (libc)Trig Functions.
- * sinpif: (libc)Trig Functions.
- * sinpifN: (libc)Trig Functions.
- * sinpifNx: (libc)Trig Functions.
- * sinpil: (libc)Trig Functions.
- * sleep: (libc)Sleeping.
- * snprintf: (libc)Formatted Output Functions.
- * socket: (libc)Creating a Socket.
- * socketpair: (libc)Socket Pairs.
- * sprintf: (libc)Formatted Output Functions.
- * sqrt: (libc)Exponents and Logarithms.
- * sqrtf: (libc)Exponents and Logarithms.
- * sqrtfN: (libc)Exponents and Logarithms.
- * sqrtfNx: (libc)Exponents and Logarithms.
- * sqrtl: (libc)Exponents and Logarithms.
- * srand48: (libc)SVID Random.
- * srand48_r: (libc)SVID Random.
- * srand: (libc)ISO Random.
- * srandom: (libc)BSD Random.
- * srandom_r: (libc)BSD Random.
- * sscanf: (libc)Formatted Input Functions.
- * ssignal: (libc)Basic Signal Handling.
- * stat64: (libc)Reading Attributes.
- * stat: (libc)Reading Attributes.
- * stdc_bit_ceil_uc: (libc)Bit Manipulation.
- * stdc_bit_ceil_ui: (libc)Bit Manipulation.
- * stdc_bit_ceil_ul: (libc)Bit Manipulation.
- * stdc_bit_ceil_ull: (libc)Bit Manipulation.
- * stdc_bit_ceil_us: (libc)Bit Manipulation.
- * stdc_bit_floor_uc: (libc)Bit Manipulation.
- * stdc_bit_floor_ui: (libc)Bit Manipulation.
- * stdc_bit_floor_ul: (libc)Bit Manipulation.
- * stdc_bit_floor_ull: (libc)Bit Manipulation.
- * stdc_bit_floor_us: (libc)Bit Manipulation.
- * stdc_bit_width_uc: (libc)Bit Manipulation.
- * stdc_bit_width_ui: (libc)Bit Manipulation.
- * stdc_bit_width_ul: (libc)Bit Manipulation.
- * stdc_bit_width_ull: (libc)Bit Manipulation.
- * stdc_bit_width_us: (libc)Bit Manipulation.
- * stdc_count_ones_uc: (libc)Bit Manipulation.
- * stdc_count_ones_ui: (libc)Bit Manipulation.
- * stdc_count_ones_ul: (libc)Bit Manipulation.
- * stdc_count_ones_ull: (libc)Bit Manipulation.
- * stdc_count_ones_us: (libc)Bit Manipulation.
- * stdc_count_zeros_uc: (libc)Bit Manipulation.
- * stdc_count_zeros_ui: (libc)Bit Manipulation.
- * stdc_count_zeros_ul: (libc)Bit Manipulation.
- * stdc_count_zeros_ull: (libc)Bit Manipulation.
- * stdc_count_zeros_us: (libc)Bit Manipulation.
- * stdc_first_leading_one_uc: (libc)Bit Manipulation.
- * stdc_first_leading_one_ui: (libc)Bit Manipulation.
- * stdc_first_leading_one_ul: (libc)Bit Manipulation.
- * stdc_first_leading_one_ull: (libc)Bit Manipulation.
- * stdc_first_leading_one_us: (libc)Bit Manipulation.
- * stdc_first_leading_zero_uc: (libc)Bit Manipulation.
- * stdc_first_leading_zero_ui: (libc)Bit Manipulation.
- * stdc_first_leading_zero_ul: (libc)Bit Manipulation.
- * stdc_first_leading_zero_ull: (libc)Bit Manipulation.
- * stdc_first_leading_zero_us: (libc)Bit Manipulation.
- * stdc_first_trailing_one_uc: (libc)Bit Manipulation.
- * stdc_first_trailing_one_ui: (libc)Bit Manipulation.
- * stdc_first_trailing_one_ul: (libc)Bit Manipulation.
- * stdc_first_trailing_one_ull: (libc)Bit Manipulation.
- * stdc_first_trailing_one_us: (libc)Bit Manipulation.
- * stdc_first_trailing_zero_uc: (libc)Bit Manipulation.
- * stdc_first_trailing_zero_ui: (libc)Bit Manipulation.
- * stdc_first_trailing_zero_ul: (libc)Bit Manipulation.
- * stdc_first_trailing_zero_ull: (libc)Bit Manipulation.
- * stdc_first_trailing_zero_us: (libc)Bit Manipulation.
- * stdc_has_single_bit_uc: (libc)Bit Manipulation.
- * stdc_has_single_bit_ui: (libc)Bit Manipulation.
- * stdc_has_single_bit_ul: (libc)Bit Manipulation.
- * stdc_has_single_bit_ull: (libc)Bit Manipulation.
- * stdc_has_single_bit_us: (libc)Bit Manipulation.
- * stdc_leading_ones_uc: (libc)Bit Manipulation.
- * stdc_leading_ones_ui: (libc)Bit Manipulation.
- * stdc_leading_ones_ul: (libc)Bit Manipulation.
- * stdc_leading_ones_ull: (libc)Bit Manipulation.
- * stdc_leading_ones_us: (libc)Bit Manipulation.
- * stdc_leading_zeros_uc: (libc)Bit Manipulation.
- * stdc_leading_zeros_ui: (libc)Bit Manipulation.
- * stdc_leading_zeros_ul: (libc)Bit Manipulation.
- * stdc_leading_zeros_ull: (libc)Bit Manipulation.
- * stdc_leading_zeros_us: (libc)Bit Manipulation.
- * stdc_trailing_ones_uc: (libc)Bit Manipulation.
- * stdc_trailing_ones_ui: (libc)Bit Manipulation.
- * stdc_trailing_ones_ul: (libc)Bit Manipulation.
- * stdc_trailing_ones_ull: (libc)Bit Manipulation.
- * stdc_trailing_ones_us: (libc)Bit Manipulation.
- * stdc_trailing_zeros_uc: (libc)Bit Manipulation.
- * stdc_trailing_zeros_ui: (libc)Bit Manipulation.
- * stdc_trailing_zeros_ul: (libc)Bit Manipulation.
- * stdc_trailing_zeros_ull: (libc)Bit Manipulation.
- * stdc_trailing_zeros_us: (libc)Bit Manipulation.
- * stime: (libc)Setting and Adjusting the Time.
- * stpcpy: (libc)Copying Strings and Arrays.
- * stpncpy: (libc)Truncating Strings.
- * strcasecmp: (libc)String/Array Comparison.
- * strcasestr: (libc)Search Functions.
- * strcat: (libc)Concatenating Strings.
- * strchr: (libc)Search Functions.
- * strchrnul: (libc)Search Functions.
- * strcmp: (libc)String/Array Comparison.
- * strcoll: (libc)Collation Functions.
- * strcpy: (libc)Copying Strings and Arrays.
- * strcspn: (libc)Search Functions.
- * strdup: (libc)Copying Strings and Arrays.
- * strdupa: (libc)Copying Strings and Arrays.
- * strerror: (libc)Error Messages.
- * strerror_l: (libc)Error Messages.
- * strerror_r: (libc)Error Messages.
- * strerror_r: (libc)Error Messages.
- * strerrordesc_np: (libc)Error Messages.
- * strerrorname_np: (libc)Error Messages.
- * strfmon: (libc)Formatting Numbers.
- * strfromd: (libc)Printing of Floats.
- * strfromf: (libc)Printing of Floats.
- * strfromfN: (libc)Printing of Floats.
- * strfromfNx: (libc)Printing of Floats.
- * strfroml: (libc)Printing of Floats.
- * strfry: (libc)Shuffling Bytes.
- * strftime: (libc)Formatting Calendar Time.
- * strftime_l: (libc)Formatting Calendar Time.
- * strlcat: (libc)Truncating Strings.
- * strlcpy: (libc)Truncating Strings.
- * strlen: (libc)String Length.
- * strncasecmp: (libc)String/Array Comparison.
- * strncat: (libc)Truncating Strings.
- * strncmp: (libc)String/Array Comparison.
- * strncpy: (libc)Truncating Strings.
- * strndup: (libc)Truncating Strings.
- * strndupa: (libc)Truncating Strings.
- * strnlen: (libc)String Length.
- * strpbrk: (libc)Search Functions.
- * strptime: (libc)Low-Level Time String Parsing.
- * strrchr: (libc)Search Functions.
- * strsep: (libc)Finding Tokens in a String.
- * strsignal: (libc)Signal Messages.
- * strspn: (libc)Search Functions.
- * strstr: (libc)Search Functions.
- * strtod: (libc)Parsing of Floats.
- * strtof: (libc)Parsing of Floats.
- * strtofN: (libc)Parsing of Floats.
- * strtofNx: (libc)Parsing of Floats.
- * strtoimax: (libc)Parsing of Integers.
- * strtok: (libc)Finding Tokens in a String.
- * strtok_r: (libc)Finding Tokens in a String.
- * strtol: (libc)Parsing of Integers.
- * strtold: (libc)Parsing of Floats.
- * strtoll: (libc)Parsing of Integers.
- * strtoq: (libc)Parsing of Integers.
- * strtoul: (libc)Parsing of Integers.
- * strtoull: (libc)Parsing of Integers.
- * strtoumax: (libc)Parsing of Integers.
- * strtouq: (libc)Parsing of Integers.
- * strverscmp: (libc)String/Array Comparison.
- * strxfrm: (libc)Collation Functions.
- * stty: (libc)BSD Terminal Modes.
- * swapcontext: (libc)System V contexts.
- * swprintf: (libc)Formatted Output Functions.
- * swscanf: (libc)Formatted Input Functions.
- * symlink: (libc)Symbolic Links.
- * sync: (libc)Synchronizing I/O.
- * syscall: (libc)System Calls.
- * sysconf: (libc)Sysconf Definition.
- * syslog: (libc)syslog; vsyslog.
- * system: (libc)Running a Command.
- * sysv_signal: (libc)Basic Signal Handling.
- * tan: (libc)Trig Functions.
- * tanf: (libc)Trig Functions.
- * tanfN: (libc)Trig Functions.
- * tanfNx: (libc)Trig Functions.
- * tanh: (libc)Hyperbolic Functions.
- * tanhf: (libc)Hyperbolic Functions.
- * tanhfN: (libc)Hyperbolic Functions.
- * tanhfNx: (libc)Hyperbolic Functions.
- * tanhl: (libc)Hyperbolic Functions.
- * tanl: (libc)Trig Functions.
- * tanpi: (libc)Trig Functions.
- * tanpif: (libc)Trig Functions.
- * tanpifN: (libc)Trig Functions.
- * tanpifNx: (libc)Trig Functions.
- * tanpil: (libc)Trig Functions.
- * tcdrain: (libc)Line Control.
- * tcflow: (libc)Line Control.
- * tcflush: (libc)Line Control.
- * tcgetattr: (libc)Mode Functions.
- * tcgetpgrp: (libc)Terminal Access Functions.
- * tcgetsid: (libc)Terminal Access Functions.
- * tcsendbreak: (libc)Line Control.
- * tcsetattr: (libc)Mode Functions.
- * tcsetpgrp: (libc)Terminal Access Functions.
- * tdelete: (libc)Tree Search Function.
- * tdestroy: (libc)Tree Search Function.
- * telldir: (libc)Random Access Directory.
- * tempnam: (libc)Temporary Files.
- * textdomain: (libc)Locating gettext catalog.
- * tfind: (libc)Tree Search Function.
- * tgamma: (libc)Special Functions.
- * tgammaf: (libc)Special Functions.
- * tgammafN: (libc)Special Functions.
- * tgammafNx: (libc)Special Functions.
- * tgammal: (libc)Special Functions.
- * tgkill: (libc)Signaling Another Process.
- * thrd_create: (libc)ISO C Thread Management.
- * thrd_current: (libc)ISO C Thread Management.
- * thrd_detach: (libc)ISO C Thread Management.
- * thrd_equal: (libc)ISO C Thread Management.
- * thrd_exit: (libc)ISO C Thread Management.
- * thrd_join: (libc)ISO C Thread Management.
- * thrd_sleep: (libc)ISO C Thread Management.
- * thrd_yield: (libc)ISO C Thread Management.
- * time: (libc)Getting the Time.
- * timegm: (libc)Broken-down Time.
- * timelocal: (libc)Broken-down Time.
- * times: (libc)Processor Time.
- * timespec_get: (libc)Getting the Time.
- * timespec_getres: (libc)Getting the Time.
- * tmpfile64: (libc)Temporary Files.
- * tmpfile: (libc)Temporary Files.
- * tmpnam: (libc)Temporary Files.
- * tmpnam_r: (libc)Temporary Files.
- * toascii: (libc)Case Conversion.
- * tolower: (libc)Case Conversion.
- * totalorder: (libc)FP Comparison Functions.
- * totalorderf: (libc)FP Comparison Functions.
- * totalorderfN: (libc)FP Comparison Functions.
- * totalorderfNx: (libc)FP Comparison Functions.
- * totalorderl: (libc)FP Comparison Functions.
- * totalordermag: (libc)FP Comparison Functions.
- * totalordermagf: (libc)FP Comparison Functions.
- * totalordermagfN: (libc)FP Comparison Functions.
- * totalordermagfNx: (libc)FP Comparison Functions.
- * totalordermagl: (libc)FP Comparison Functions.
- * toupper: (libc)Case Conversion.
- * towctrans: (libc)Wide Character Case Conversion.
- * towlower: (libc)Wide Character Case Conversion.
- * towupper: (libc)Wide Character Case Conversion.
- * trunc: (libc)Rounding Functions.
- * truncate64: (libc)File Size.
- * truncate: (libc)File Size.
- * truncf: (libc)Rounding Functions.
- * truncfN: (libc)Rounding Functions.
- * truncfNx: (libc)Rounding Functions.
- * truncl: (libc)Rounding Functions.
- * tsearch: (libc)Tree Search Function.
- * tss_create: (libc)ISO C Thread-local Storage.
- * tss_delete: (libc)ISO C Thread-local Storage.
- * tss_get: (libc)ISO C Thread-local Storage.
- * tss_set: (libc)ISO C Thread-local Storage.
- * ttyname: (libc)Is It a Terminal.
- * ttyname_r: (libc)Is It a Terminal.
- * twalk: (libc)Tree Search Function.
- * twalk_r: (libc)Tree Search Function.
- * tzset: (libc)Time Zone State.
- * uabs: (libc)Absolute Value.
- * ufromfp: (libc)Rounding Functions.
- * ufromfpf: (libc)Rounding Functions.
- * ufromfpfN: (libc)Rounding Functions.
- * ufromfpfNx: (libc)Rounding Functions.
- * ufromfpl: (libc)Rounding Functions.
- * ufromfpx: (libc)Rounding Functions.
- * ufromfpxf: (libc)Rounding Functions.
- * ufromfpxfN: (libc)Rounding Functions.
- * ufromfpxfNx: (libc)Rounding Functions.
- * ufromfpxl: (libc)Rounding Functions.
- * ulabs: (libc)Absolute Value.
- * ulimit: (libc)Limits on Resources.
- * ullabs: (libc)Absolute Value.
- * umask: (libc)Setting Permissions.
- * umaxabs: (libc)Absolute Value.
- * umount2: (libc)Mount-Unmount-Remount.
- * umount: (libc)Mount-Unmount-Remount.
- * uname: (libc)Platform Type.
- * ungetc: (libc)How Unread.
- * ungetwc: (libc)How Unread.
- * unlink: (libc)Deleting Files.
- * unlinkat: (libc)Deleting Files.
- * unlockpt: (libc)Allocation.
- * unsetenv: (libc)Environment Access.
- * updwtmp: (libc)Manipulating the Database.
- * utime: (libc)File Times.
- * utimensat: (libc)File Times.
- * utimes: (libc)File Times.
- * utmpname: (libc)Manipulating the Database.
- * utmpxname: (libc)XPG Functions.
- * va_arg: (libc)Argument Macros.
- * va_copy: (libc)Argument Macros.
- * va_end: (libc)Argument Macros.
- * va_start: (libc)Argument Macros.
- * valloc: (libc)Aligned Memory Blocks.
- * vasprintf: (libc)Variable Arguments Output.
- * vdprintf: (libc)Variable Arguments Output.
- * verr: (libc)Error Messages.
- * verrx: (libc)Error Messages.
- * versionsort64: (libc)Scanning Directory Content.
- * versionsort: (libc)Scanning Directory Content.
- * vfork: (libc)Creating a Process.
- * vfprintf: (libc)Variable Arguments Output.
- * vfscanf: (libc)Variable Arguments Input.
- * vfwprintf: (libc)Variable Arguments Output.
- * vfwscanf: (libc)Variable Arguments Input.
- * vlimit: (libc)Limits on Resources.
- * vprintf: (libc)Variable Arguments Output.
- * vscanf: (libc)Variable Arguments Input.
- * vsnprintf: (libc)Variable Arguments Output.
- * vsprintf: (libc)Variable Arguments Output.
- * vsscanf: (libc)Variable Arguments Input.
- * vswprintf: (libc)Variable Arguments Output.
- * vswscanf: (libc)Variable Arguments Input.
- * vsyslog: (libc)syslog; vsyslog.
- * vwarn: (libc)Error Messages.
- * vwarnx: (libc)Error Messages.
- * vwprintf: (libc)Variable Arguments Output.
- * vwscanf: (libc)Variable Arguments Input.
- * wait3: (libc)BSD Wait Functions.
- * wait4: (libc)Process Completion.
- * wait: (libc)Process Completion.
- * waitpid: (libc)Process Completion.
- * warn: (libc)Error Messages.
- * warnx: (libc)Error Messages.
- * wcpcpy: (libc)Copying Strings and Arrays.
- * wcpncpy: (libc)Truncating Strings.
- * wcrtomb: (libc)Converting a Character.
- * wcscasecmp: (libc)String/Array Comparison.
- * wcscat: (libc)Concatenating Strings.
- * wcschr: (libc)Search Functions.
- * wcschrnul: (libc)Search Functions.
- * wcscmp: (libc)String/Array Comparison.
- * wcscoll: (libc)Collation Functions.
- * wcscpy: (libc)Copying Strings and Arrays.
- * wcscspn: (libc)Search Functions.
- * wcsdup: (libc)Copying Strings and Arrays.
- * wcsftime: (libc)Formatting Calendar Time.
- * wcslcat: (libc)Truncating Strings.
- * wcslcpy: (libc)Truncating Strings.
- * wcslen: (libc)String Length.
- * wcsncasecmp: (libc)String/Array Comparison.
- * wcsncat: (libc)Truncating Strings.
- * wcsncmp: (libc)String/Array Comparison.
- * wcsncpy: (libc)Truncating Strings.
- * wcsnlen: (libc)String Length.
- * wcsnrtombs: (libc)Converting Strings.
- * wcspbrk: (libc)Search Functions.
- * wcsrchr: (libc)Search Functions.
- * wcsrtombs: (libc)Converting Strings.
- * wcsspn: (libc)Search Functions.
- * wcsstr: (libc)Search Functions.
- * wcstod: (libc)Parsing of Floats.
- * wcstof: (libc)Parsing of Floats.
- * wcstofN: (libc)Parsing of Floats.
- * wcstofNx: (libc)Parsing of Floats.
- * wcstoimax: (libc)Parsing of Integers.
- * wcstok: (libc)Finding Tokens in a String.
- * wcstol: (libc)Parsing of Integers.
- * wcstold: (libc)Parsing of Floats.
- * wcstoll: (libc)Parsing of Integers.
- * wcstombs: (libc)Non-reentrant String Conversion.
- * wcstoq: (libc)Parsing of Integers.
- * wcstoul: (libc)Parsing of Integers.
- * wcstoull: (libc)Parsing of Integers.
- * wcstoumax: (libc)Parsing of Integers.
- * wcstouq: (libc)Parsing of Integers.
- * wcswcs: (libc)Search Functions.
- * wcsxfrm: (libc)Collation Functions.
- * wctob: (libc)Converting a Character.
- * wctomb: (libc)Non-reentrant Character Conversion.
- * wctrans: (libc)Wide Character Case Conversion.
- * wctype: (libc)Classification of Wide Characters.
- * wmemchr: (libc)Search Functions.
- * wmemcmp: (libc)String/Array Comparison.
- * wmemcpy: (libc)Copying Strings and Arrays.
- * wmemmove: (libc)Copying Strings and Arrays.
- * wmempcpy: (libc)Copying Strings and Arrays.
- * wmemset: (libc)Copying Strings and Arrays.
- * wordexp: (libc)Calling Wordexp.
- * wordfree: (libc)Calling Wordexp.
- * wprintf: (libc)Formatted Output Functions.
- * write: (libc)I/O Primitives.
- * writev: (libc)Scatter-Gather.
- * wscanf: (libc)Formatted Input Functions.
- * y0: (libc)Special Functions.
- * y0f: (libc)Special Functions.
- * y0fN: (libc)Special Functions.
- * y0fNx: (libc)Special Functions.
- * y0l: (libc)Special Functions.
- * y1: (libc)Special Functions.
- * y1f: (libc)Special Functions.
- * y1fN: (libc)Special Functions.
- * y1fNx: (libc)Special Functions.
- * y1l: (libc)Special Functions.
- * yn: (libc)Special Functions.
- * ynf: (libc)Special Functions.
- * ynfN: (libc)Special Functions.
- * ynfNx: (libc)Special Functions.
- * ynl: (libc)Special Functions.
- END-INFO-DIR-ENTRY
- File: libc.info, Node: Locales, Next: Message Translation, Prev: Character Set Handling, Up: Top
- 7 Locales and Internationalization
- **********************************
- Different countries and cultures have varying conventions for how to
- communicate. These conventions range from very simple ones, such as the
- format for representing dates and times, to very complex ones, such as
- the language spoken.
- “Internationalization” of software means programming it to be able to
- adapt to the user's favorite conventions. In ISO C,
- internationalization works by means of “locales”. Each locale specifies
- a collection of conventions, one convention for each purpose. The user
- chooses a set of conventions by specifying a locale (via environment
- variables).
- All programs inherit the chosen locale as part of their environment.
- Provided the programs are written to obey the choice of locale, they
- will follow the conventions preferred by the user.
- * Menu:
- * Effects of Locale:: Actions affected by the choice of
- locale.
- * Choosing Locale:: How the user specifies a locale.
- * Locale Categories:: Different purposes for which you can
- select a locale.
- * Setting the Locale:: How a program specifies the locale
- with library functions.
- * Standard Locales:: Locale names available on all systems.
- * Locale Names:: Format of system-specific locale names.
- * Locale Information:: How to access the information for the locale.
- * Formatting Numbers:: A dedicated function to format numbers.
- * Yes-or-No Questions:: Check a Response against the locale.
- File: libc.info, Node: Effects of Locale, Next: Choosing Locale, Up: Locales
- 7.1 What Effects a Locale Has
- =============================
- Each locale specifies conventions for several purposes, including the
- following:
- • What multibyte character sequences are valid, and how they are
- interpreted (*note Character Set Handling::).
- • Classification of which characters in the local character set are
- considered alphabetic, and upper- and lower-case conversion
- conventions (*note Character Handling::).
- • The collating sequence for the local language and character set
- (*note Collation Functions::).
- • Formatting of numbers and currency amounts (*note General
- Numeric::).
- • Formatting of dates and times (*note Formatting Calendar Time::).
- • What language to use for output, including error messages (*note
- Message Translation::).
- • What language to use for user answers to yes-or-no questions (*note
- Yes-or-No Questions::).
- • What language to use for more complex user input. (The C library
- doesn't yet help you implement this.)
- Some aspects of adapting to the specified locale are handled
- automatically by the library subroutines. For example, all your program
- needs to do in order to use the collating sequence of the chosen locale
- is to use ‘strcoll’ or ‘strxfrm’ to compare strings.
- Other aspects of locales are beyond the comprehension of the library.
- For example, the library can't automatically translate your program's
- output messages into other languages. The only way you can support
- output in the user's favorite language is to program this more or less
- by hand. The C library provides functions to handle translations for
- multiple languages easily.
- This chapter discusses the mechanism by which you can modify the
- current locale. The effects of the current locale on specific library
- functions are discussed in more detail in the descriptions of those
- functions.
- File: libc.info, Node: Choosing Locale, Next: Locale Categories, Prev: Effects of Locale, Up: Locales
- 7.2 Choosing a Locale
- =====================
- The simplest way for the user to choose a locale is to set the
- environment variable ‘LANG’. This specifies a single locale to use for
- all purposes. For example, a user could specify a hypothetical locale
- named ‘espana-castellano’ to use the standard conventions of most of
- Spain.
- The set of locales supported depends on the operating system you are
- using, and so do their names, except that the standard locale called ‘C’
- or ‘POSIX’ always exist. *Note Locale Names::.
- In order to force the system to always use the default locale, the
- user can set the ‘LC_ALL’ environment variable to ‘C’.
- A user also has the option of specifying different locales for
- different purposes--in effect, choosing a mixture of multiple locales.
- *Note Locale Categories::.
- For example, the user might specify the locale ‘espana-castellano’
- for most purposes, but specify the locale ‘usa-english’ for currency
- formatting. This might make sense if the user is a Spanish-speaking
- American, working in Spanish, but representing monetary amounts in US
- dollars.
- Note that both locales ‘espana-castellano’ and ‘usa-english’, like
- all locales, would include conventions for all of the purposes to which
- locales apply. However, the user can choose to use each locale for a
- particular subset of those purposes.
- File: libc.info, Node: Locale Categories, Next: Setting the Locale, Prev: Choosing Locale, Up: Locales
- 7.3 Locale Categories
- =====================
- The purposes that locales serve are grouped into “categories”, so that a
- user or a program can choose the locale for each category independently.
- Here is a table of categories; each name is both an environment variable
- that a user can set, and a macro name that you can use as the first
- argument to ‘setlocale’.
- The contents of the environment variable (or the string in the second
- argument to ‘setlocale’) has to be a valid locale name. *Note Locale
- Names::.
- ‘LC_COLLATE’
- This category applies to collation of strings (functions ‘strcoll’
- and ‘strxfrm’); see *note Collation Functions::.
- ‘LC_CTYPE’
- This category applies to classification and conversion of
- characters, and to multibyte and wide characters; see *note
- Character Handling::, and *note Character Set Handling::.
- ‘LC_MONETARY’
- This category applies to formatting monetary values; see *note
- General Numeric::.
- ‘LC_NUMERIC’
- This category applies to formatting numeric values that are not
- monetary; see *note General Numeric::.
- ‘LC_TIME’
- This category applies to formatting date and time values; see *note
- Formatting Calendar Time::.
- ‘LC_MESSAGES’
- This category applies to selecting the language used in the user
- interface for message translation (*note The Uniforum approach::;
- *note Message catalogs a la X/Open::) and contains regular
- expressions for affirmative and negative responses.
- ‘LC_ALL’
- This is not a category; it is only a macro that you can use with
- ‘setlocale’ to set a single locale for all purposes. Setting this
- environment variable overwrites all selections by the other ‘LC_*’
- variables or ‘LANG’.
- ‘LANG’
- If this environment variable is defined, its value specifies the
- locale to use for all purposes except as overridden by the
- variables above.
- When developing the message translation functions it was felt that
- the functionality provided by the variables above is not sufficient.
- For example, it should be possible to specify more than one locale name.
- Take a Swedish user who better speaks German than English, and a program
- whose messages are output in English by default. It should be possible
- to specify that the first choice of language is Swedish, the second
- German, and if this also fails to use English. This is possible with
- the variable ‘LANGUAGE’. For further description of this GNU extension
- see *note Using gettextized software::.
- File: libc.info, Node: Setting the Locale, Next: Standard Locales, Prev: Locale Categories, Up: Locales
- 7.4 How Programs Set the Locale
- ===============================
- A C program inherits its locale environment variables when it starts up.
- This happens automatically. However, these variables do not
- automatically control the locale used by the library functions, because
- ISO C says that all programs start by default in the standard ‘C’
- locale. To use the locales specified by the environment, you must call
- ‘setlocale’. Call it as follows:
- setlocale (LC_ALL, "");
- to select a locale based on the user choice of the appropriate
- environment variables.
- You can also use ‘setlocale’ to specify a particular locale, for
- general use or for a specific category.
- The symbols in this section are defined in the header file
- ‘locale.h’.
- -- Function: char * setlocale (int CATEGORY, const char *LOCALE)
- Preliminary: | MT-Unsafe const:locale env | AS-Unsafe init lock
- heap corrupt | AC-Unsafe init corrupt lock mem fd | *Note POSIX
- Safety Concepts::.
- The function ‘setlocale’ sets the current locale for category
- CATEGORY to LOCALE.
- If CATEGORY is ‘LC_ALL’, this specifies the locale for all
- purposes. The other possible values of CATEGORY specify a single
- purpose (*note Locale Categories::).
- You can also use this function to find out the current locale by
- passing a null pointer as the LOCALE argument. In this case,
- ‘setlocale’ returns a string that is the name of the locale
- currently selected for category CATEGORY.
- The string returned by ‘setlocale’ can be overwritten by subsequent
- calls, so you should make a copy of the string (*note Copying
- Strings and Arrays::) if you want to save it past any further calls
- to ‘setlocale’. (The standard library is guaranteed never to call
- ‘setlocale’ itself.)
- You should not modify the string returned by ‘setlocale’. It might
- be the same string that was passed as an argument in a previous
- call to ‘setlocale’. One requirement is that the CATEGORY must be
- the same in the call the string was returned and the one when the
- string is passed in as LOCALE parameter.
- When you read the current locale for category ‘LC_ALL’, the value
- encodes the entire combination of selected locales for all
- categories. If you specify the same "locale name" with ‘LC_ALL’ in
- a subsequent call to ‘setlocale’, it restores the same combination
- of locale selections.
- To be sure you can use the returned string encoding the currently
- selected locale at a later time, you must make a copy of the
- string. It is not guaranteed that the returned pointer remains
- valid over time.
- When the LOCALE argument is not a null pointer, the string returned
- by ‘setlocale’ reflects the newly-modified locale.
- If you specify an empty string for LOCALE, this means to read the
- appropriate environment variable and use its value to select the
- locale for CATEGORY.
- If a nonempty string is given for LOCALE, then the locale of that
- name is used if possible.
- The effective locale name (either the second argument to
- ‘setlocale’, or if the argument is an empty string, the name
- obtained from the process environment) must be a valid locale name.
- *Note Locale Names::.
- If you specify an invalid locale name, ‘setlocale’ returns a null
- pointer and leaves the current locale unchanged.
- Here is an example showing how you might use ‘setlocale’ to
- temporarily switch to a new locale.
- #include <stddef.h>
- #include <locale.h>
- #include <stdlib.h>
- #include <string.h>
- void
- with_other_locale (char *new_locale,
- void (*subroutine) (int),
- int argument)
- {
- char *old_locale, *saved_locale;
- /* Get the name of the current locale. */
- old_locale = setlocale (LC_ALL, NULL);
- /* Copy the name so it won't be clobbered by ‘setlocale’. */
- saved_locale = strdup (old_locale);
- if (saved_locale == NULL)
- fatal ("Out of memory");
- /* Now change the locale and do some stuff with it. */
- setlocale (LC_ALL, new_locale);
- (*subroutine) (argument);
- /* Restore the original locale. */
- setlocale (LC_ALL, saved_locale);
- free (saved_locale);
- }
- *Portability Note:* Some ISO C systems may define additional locale
- categories, and future versions of the library will do so. For
- portability, assume that any symbol beginning with ‘LC_’ might be
- defined in ‘locale.h’.
- File: libc.info, Node: Standard Locales, Next: Locale Names, Prev: Setting the Locale, Up: Locales
- 7.5 Standard Locales
- ====================
- The only locale names you can count on finding on all operating systems
- are these three standard ones:
- ‘"C"’
- This is the standard C locale. The attributes and behavior it
- provides are specified in the ISO C standard. When your program
- starts up, it initially uses this locale by default.
- ‘"POSIX"’
- This is the standard POSIX locale. Currently, it is an alias for
- the standard C locale.
- ‘""’
- The empty name says to select a locale based on environment
- variables. *Note Locale Categories::.
- Defining and installing named locales is normally a responsibility of
- the system administrator at your site (or the person who installed the
- GNU C Library). It is also possible for the user to create private
- locales. All this will be discussed later when describing the tool to
- do so.
- If your program needs to use something other than the ‘C’ locale, it
- will be more portable if you use whatever locale the user specifies with
- the environment, rather than trying to specify some non-standard locale
- explicitly by name. Remember, different machines might have different
- sets of locales installed.
- File: libc.info, Node: Locale Names, Next: Locale Information, Prev: Standard Locales, Up: Locales
- 7.6 Locale Names
- ================
- The following command prints a list of locales supported by the system:
- locale -a
- *Portability Note:* With the notable exception of the standard locale
- names ‘C’ and ‘POSIX’, locale names are system-specific.
- Most locale names follow XPG syntax and consist of up to four parts:
- LANGUAGE[_TERRITORY[.CODESET]][@MODIFIER]
- Beside the first part, all of them are allowed to be missing. If the
- full specified locale is not found, less specific ones are looked for.
- The various parts will be stripped off, in the following order:
- 1. codeset
- 2. normalized codeset
- 3. territory
- 4. modifier
- For example, the locale name ‘de_AT.iso885915@euro’ denotes a
- German-language locale for use in Austria, using the ISO-8859-15
- (Latin-9) character set, and with the Euro as the currency symbol.
- In addition to locale names which follow XPG syntax, systems may
- provide aliases such as ‘german’. Both categories of names must not
- contain the slash character ‘/’.
- If the locale name starts with a slash ‘/’, it is treated as a path
- relative to the configured locale directories; see ‘LOCPATH’ below. The
- specified path must not contain a component ‘..’, or the name is
- invalid, and ‘setlocale’ will fail.
- *Portability Note:* POSIX suggests that if a locale name starts with
- a slash ‘/’, it is resolved as an absolute path. However, the GNU C
- Library treats it as a relative path under the directories listed in
- ‘LOCPATH’ (or the default locale directory if ‘LOCPATH’ is unset).
- Locale names which are longer than an implementation-defined limit
- are invalid and cause ‘setlocale’ to fail.
- As a special case, locale names used with ‘LC_ALL’ can combine
- several locales, reflecting different locale settings for different
- categories. For example, you might want to use a U.S. locale with ISO
- A4 paper format, so you set ‘LANG’ to ‘en_US.UTF-8’, and ‘LC_PAPER’ to
- ‘de_DE.UTF-8’. In this case, the ‘LC_ALL’-style combined locale name is
- LC_CTYPE=en_US.UTF-8;LC_TIME=en_US.UTF-8;LC_PAPER=de_DE.UTF-8;...
- followed by other category settings not shown here.
- The path used for finding locale data can be set using the ‘LOCPATH’
- environment variable. This variable lists the directories in which to
- search for locale definitions, separated by a colon ‘:’.
- The default path for finding locale data is system specific. A
- typical value for the ‘LOCPATH’ default is:
- /usr/share/locale
- The value of ‘LOCPATH’ is ignored by privileged programs for security
- reasons, and only the default directory is used.
- File: libc.info, Node: Locale Information, Next: Formatting Numbers, Prev: Locale Names, Up: Locales
- 7.7 Accessing Locale Information
- ================================
- There are several ways to access locale information. The simplest way
- is to let the C library itself do the work. Several of the functions in
- this library implicitly access the locale data, and use what information
- is provided by the currently selected locale. This is how the locale
- model is meant to work normally.
- As an example take the ‘strftime’ function, which is meant to nicely
- format date and time information (*note Formatting Calendar Time::).
- Part of the standard information contained in the ‘LC_TIME’ category is
- the names of the months. Instead of requiring the programmer to take
- care of providing the translations the ‘strftime’ function does this all
- by itself. ‘%A’ in the format string is replaced by the appropriate
- weekday name of the locale currently selected by ‘LC_TIME’. This is an
- easy example, and wherever possible functions do things automatically in
- this way.
- But there are quite often situations when there is simply no function
- to perform the task, or it is simply not possible to do the work
- automatically. For these cases it is necessary to access the
- information in the locale directly. To do this the C library provides
- two functions: ‘localeconv’ and ‘nl_langinfo’. The former is part of
- ISO C and therefore portable, but has a brain-damaged interface. The
- second is part of the Unix interface and is portable in as far as the
- system follows the Unix standards.
- * Menu:
- * The Lame Way to Locale Data:: ISO C's ‘localeconv’.
- * The Elegant and Fast Way:: X/Open's ‘nl_langinfo’.
- File: libc.info, Node: The Lame Way to Locale Data, Next: The Elegant and Fast Way, Up: Locale Information
- 7.7.1 ‘localeconv’: It is portable but ...
- ------------------------------------------
- Together with the ‘setlocale’ function the ISO C people invented the
- ‘localeconv’ function. It is a masterpiece of poor design. It is
- expensive to use, not extensible, and not generally usable as it
- provides access to only ‘LC_MONETARY’ and ‘LC_NUMERIC’ related
- information. Nevertheless, if it is applicable to a given situation it
- should be used since it is very portable. The function ‘strfmon’
- formats monetary amounts according to the selected locale using this
- information.
- -- Function: struct lconv * localeconv (void)
- Preliminary: | MT-Unsafe race:localeconv locale | AS-Unsafe |
- AC-Safe | *Note POSIX Safety Concepts::.
- The ‘localeconv’ function returns a pointer to a structure whose
- components contain information about how numeric and monetary
- values should be formatted in the current locale.
- You should not modify the structure or its contents. The structure
- might be overwritten by subsequent calls to ‘localeconv’, or by
- calls to ‘setlocale’, but no other function in the library
- overwrites this value.
- -- Data Type: struct lconv
- ‘localeconv’'s return value is of this data type. Its elements are
- described in the following subsections.
- If a member of the structure ‘struct lconv’ has type ‘char’, and the
- value is ‘CHAR_MAX’, it means that the current locale has no value for
- that parameter.
- * Menu:
- * General Numeric:: Parameters for formatting numbers and
- currency amounts.
- * Currency Symbol:: How to print the symbol that identifies an
- amount of money (e.g. ‘$’).
- * Sign of Money Amount:: How to print the (positive or negative) sign
- for a monetary amount, if one exists.
- File: libc.info, Node: General Numeric, Next: Currency Symbol, Up: The Lame Way to Locale Data
- 7.7.1.1 Generic Numeric Formatting Parameters
- .............................................
- These are the standard members of ‘struct lconv’; there may be others.
- ‘char *decimal_point’
- ‘char *mon_decimal_point’
- These are the decimal-point separators used in formatting
- non-monetary and monetary quantities, respectively. In the ‘C’
- locale, the value of ‘decimal_point’ is ‘"."’, and the value of
- ‘mon_decimal_point’ is ‘""’.
- ‘char *thousands_sep’
- ‘char *mon_thousands_sep’
- These are the separators used to delimit groups of digits to the
- left of the decimal point in formatting non-monetary and monetary
- quantities, respectively. In the ‘C’ locale, both members have a
- value of ‘""’ (the empty string).
- ‘char *grouping’
- ‘char *mon_grouping’
- These are strings that specify how to group the digits to the left
- of the decimal point. ‘grouping’ applies to non-monetary
- quantities and ‘mon_grouping’ applies to monetary quantities. Use
- either ‘thousands_sep’ or ‘mon_thousands_sep’ to separate the digit
- groups.
- Each member of these strings is to be interpreted as an integer
- value of type ‘char’. Successive numbers (from left to right) give
- the sizes of successive groups (from right to left, starting at the
- decimal point.) The last member is either ‘0’, in which case the
- previous member is used over and over again for all the remaining
- groups, or ‘CHAR_MAX’, in which case there is no more grouping--or,
- put another way, any remaining digits form one large group without
- separators.
- For example, if ‘grouping’ is ‘"\04\03\02"’, the correct grouping
- for the number ‘123456787654321’ is ‘12’, ‘34’, ‘56’, ‘78’, ‘765’,
- ‘4321’. This uses a group of 4 digits at the end, preceded by a
- group of 3 digits, preceded by groups of 2 digits (as many as
- needed). With a separator of ‘,’, the number would be printed as
- ‘12,34,56,78,765,4321’.
- A value of ‘"\03"’ indicates repeated groups of three digits, as
- normally used in the U.S.
- In the standard ‘C’ locale, both ‘grouping’ and ‘mon_grouping’ have
- a value of ‘""’. This value specifies no grouping at all.
- ‘char int_frac_digits’
- ‘char frac_digits’
- These are small integers indicating how many fractional digits (to
- the right of the decimal point) should be displayed in a monetary
- value in international and local formats, respectively. (Most
- often, both members have the same value.)
- In the standard ‘C’ locale, both of these members have the value
- ‘CHAR_MAX’, meaning "unspecified". The ISO standard doesn't say
- what to do when you find this value; we recommend printing no
- fractional digits. (This locale also specifies the empty string
- for ‘mon_decimal_point’, so printing any fractional digits would be
- confusing!)
- File: libc.info, Node: Currency Symbol, Next: Sign of Money Amount, Prev: General Numeric, Up: The Lame Way to Locale Data
- 7.7.1.2 Printing the Currency Symbol
- ....................................
- These members of the ‘struct lconv’ structure specify how to print the
- symbol to identify a monetary value--the international analog of ‘$’ for
- US dollars.
- Each country has two standard currency symbols. The “local currency
- symbol” is used commonly within the country, while the “international
- currency symbol” is used internationally to refer to that country's
- currency when it is necessary to indicate the country unambiguously.
- For example, many countries use the dollar as their monetary unit,
- and when dealing with international currencies it's important to specify
- that one is dealing with (say) Canadian dollars instead of U.S. dollars
- or Australian dollars. But when the context is known to be Canada,
- there is no need to make this explicit--dollar amounts are implicitly
- assumed to be in Canadian dollars.
- ‘char *currency_symbol’
- The local currency symbol for the selected locale.
- In the standard ‘C’ locale, this member has a value of ‘""’ (the
- empty string), meaning "unspecified". The ISO standard doesn't say
- what to do when you find this value; we recommend you simply print
- the empty string as you would print any other string pointed to by
- this variable.
- ‘char *int_curr_symbol’
- The international currency symbol for the selected locale.
- The value of ‘int_curr_symbol’ should normally consist of a
- three-letter abbreviation determined by the international standard
- ‘ISO 4217 Codes for the Representation of Currency and Funds’,
- followed by a one-character separator (often a space).
- In the standard ‘C’ locale, this member has a value of ‘""’ (the
- empty string), meaning "unspecified". We recommend you simply
- print the empty string as you would print any other string pointed
- to by this variable.
- ‘char p_cs_precedes’
- ‘char n_cs_precedes’
- ‘char int_p_cs_precedes’
- ‘char int_n_cs_precedes’
- These members are ‘1’ if the ‘currency_symbol’ or ‘int_curr_symbol’
- strings should precede the value of a monetary amount, or ‘0’ if
- the strings should follow the value. The ‘p_cs_precedes’ and
- ‘int_p_cs_precedes’ members apply to positive amounts (or zero),
- and the ‘n_cs_precedes’ and ‘int_n_cs_precedes’ members apply to
- negative amounts.
- In the standard ‘C’ locale, all of these members have a value of
- ‘CHAR_MAX’, meaning "unspecified". The ISO standard doesn't say
- what to do when you find this value. We recommend printing the
- currency symbol before the amount, which is right for most
- countries. In other words, treat all nonzero values alike in these
- members.
- The members with the ‘int_’ prefix apply to the ‘int_curr_symbol’
- while the other two apply to ‘currency_symbol’.
- ‘char p_sep_by_space’
- ‘char n_sep_by_space’
- ‘char int_p_sep_by_space’
- ‘char int_n_sep_by_space’
- These members are ‘1’ if a space should appear between the
- ‘currency_symbol’ or ‘int_curr_symbol’ strings and the amount, or
- ‘0’ if no space should appear. The ‘p_sep_by_space’ and
- ‘int_p_sep_by_space’ members apply to positive amounts (or zero),
- and the ‘n_sep_by_space’ and ‘int_n_sep_by_space’ members apply to
- negative amounts.
- In the standard ‘C’ locale, all of these members have a value of
- ‘CHAR_MAX’, meaning "unspecified". The ISO standard doesn't say
- what you should do when you find this value; we suggest you treat
- it as 1 (print a space). In other words, treat all nonzero values
- alike in these members.
- The members with the ‘int_’ prefix apply to the ‘int_curr_symbol’
- while the other two apply to ‘currency_symbol’. There is one
- specialty with the ‘int_curr_symbol’, though. Since all legal
- values contain a space at the end of the string one either prints
- this space (if the currency symbol must appear in front and must be
- separated) or one has to avoid printing this character at all
- (especially when at the end of the string).
- File: libc.info, Node: Sign of Money Amount, Prev: Currency Symbol, Up: The Lame Way to Locale Data
- 7.7.1.3 Printing the Sign of a Monetary Amount
- ..............................................
- These members of the ‘struct lconv’ structure specify how to print the
- sign (if any) of a monetary value.
- ‘char *positive_sign’
- ‘char *negative_sign’
- These are strings used to indicate positive (or zero) and negative
- monetary quantities, respectively.
- In the standard ‘C’ locale, both of these members have a value of
- ‘""’ (the empty string), meaning "unspecified".
- The ISO standard doesn't say what to do when you find this value;
- we recommend printing ‘positive_sign’ as you find it, even if it is
- empty. For a negative value, print ‘negative_sign’ as you find it
- unless both it and ‘positive_sign’ are empty, in which case print
- ‘-’ instead. (Failing to indicate the sign at all seems rather
- unreasonable.)
- ‘char p_sign_posn’
- ‘char n_sign_posn’
- ‘char int_p_sign_posn’
- ‘char int_n_sign_posn’
- These members are small integers that indicate how to position the
- sign for nonnegative and negative monetary quantities,
- respectively. (The string used for the sign is what was specified
- with ‘positive_sign’ or ‘negative_sign’.) The possible values are
- as follows:
- ‘0’
- The currency symbol and quantity should be surrounded by
- parentheses.
- ‘1’
- Print the sign string before the quantity and currency symbol.
- ‘2’
- Print the sign string after the quantity and currency symbol.
- ‘3’
- Print the sign string right before the currency symbol.
- ‘4’
- Print the sign string right after the currency symbol.
- ‘CHAR_MAX’
- "Unspecified". Both members have this value in the standard
- ‘C’ locale.
- The ISO standard doesn't say what you should do when the value is
- ‘CHAR_MAX’. We recommend you print the sign after the currency
- symbol.
- The members with the ‘int_’ prefix apply to the ‘int_curr_symbol’
- while the other two apply to ‘currency_symbol’.
- File: libc.info, Node: The Elegant and Fast Way, Prev: The Lame Way to Locale Data, Up: Locale Information
- 7.7.2 Pinpoint Access to Locale Data
- ------------------------------------
- When writing the X/Open Portability Guide the authors realized that the
- ‘localeconv’ function is not enough to provide reasonable access to
- locale information. The information which was meant to be available in
- the locale (as later specified in the POSIX.1 standard) requires more
- ways to access it. Therefore the ‘nl_langinfo’ function was introduced.
- -- Function: char * nl_langinfo (nl_item ITEM)
- Preliminary: | MT-Safe locale | AS-Safe | AC-Safe | *Note POSIX
- Safety Concepts::.
- The ‘nl_langinfo’ function can be used to access individual
- elements of the locale categories. Unlike the ‘localeconv’
- function, which returns all the information, ‘nl_langinfo’ lets the
- caller select what information it requires. This is very fast and
- it is not a problem to call this function multiple times.
- A second advantage is that in addition to the numeric and monetary
- formatting information, information from the ‘LC_TIME’ and
- ‘LC_MESSAGES’ categories is available.
- The type ‘nl_item’ is defined in ‘nl_types.h’. The argument ITEM
- is a numeric value defined in the header ‘langinfo.h’. The X/Open
- standard defines the following values:
- ‘CODESET’
- ‘nl_langinfo’ returns a string with the name of the coded
- character set used in the selected locale.
- ‘ABDAY_1’
- ‘ABDAY_2’
- ‘ABDAY_3’
- ‘ABDAY_4’
- ‘ABDAY_5’
- ‘ABDAY_6’
- ‘ABDAY_7’
- ‘nl_langinfo’ returns the abbreviated weekday name. ‘ABDAY_1’
- corresponds to Sunday.
- ‘DAY_1’
- ‘DAY_2’
- ‘DAY_3’
- ‘DAY_4’
- ‘DAY_5’
- ‘DAY_6’
- ‘DAY_7’
- Similar to ‘ABDAY_1’, etc., but here the return value is the
- unabbreviated weekday name.
- ‘ABMON_1’
- ‘ABMON_2’
- ‘ABMON_3’
- ‘ABMON_4’
- ‘ABMON_5’
- ‘ABMON_6’
- ‘ABMON_7’
- ‘ABMON_8’
- ‘ABMON_9’
- ‘ABMON_10’
- ‘ABMON_11’
- ‘ABMON_12’
- The return value is the abbreviated name of the month, in the
- grammatical form used when the month forms part of a complete
- date. ‘ABMON_1’ corresponds to January.
- ‘MON_1’
- ‘MON_2’
- ‘MON_3’
- ‘MON_4’
- ‘MON_5’
- ‘MON_6’
- ‘MON_7’
- ‘MON_8’
- ‘MON_9’
- ‘MON_10’
- ‘MON_11’
- ‘MON_12’
- Similar to ‘ABMON_1’, etc., but here the month names are not
- abbreviated. Here the first value ‘MON_1’ also corresponds to
- January.
- ‘ALTMON_1’
- ‘ALTMON_2’
- ‘ALTMON_3’
- ‘ALTMON_4’
- ‘ALTMON_5’
- ‘ALTMON_6’
- ‘ALTMON_7’
- ‘ALTMON_8’
- ‘ALTMON_9’
- ‘ALTMON_10’
- ‘ALTMON_11’
- ‘ALTMON_12’
- Similar to ‘MON_1’, etc., but here the month names are in the
- grammatical form used when the month is named by itself. The
- ‘strftime’ functions use these month names for the conversion
- specifier ‘%OB’ (*note Formatting Calendar Time::).
- Note that not all languages need two different forms of the
- month names, so the strings returned for ‘MON_...’ and
- ‘ALTMON_...’ may or may not be the same, depending on the
- locale.
- *NB:* ‘ABALTMON_...’ constants corresponding to the ‘%Ob’
- conversion specifier are not currently provided, but are
- expected to be in a future release. In the meantime, it is
- possible to use ‘_NL_ABALTMON_...’.
- ‘AM_STR’
- ‘PM_STR’
- The return values are strings which can be used in the
- representation of time as an hour from 1 to 12 plus an am/pm
- specifier.
- Note that in locales which do not use this time representation
- these strings might be empty, in which case the am/pm format
- cannot be used at all.
- ‘D_T_FMT’
- The return value can be used as a format string for ‘strftime’
- to represent time and date in a locale-specific way.
- ‘D_FMT’
- The return value can be used as a format string for ‘strftime’
- to represent a date in a locale-specific way.
- ‘T_FMT’
- The return value can be used as a format string for ‘strftime’
- to represent time in a locale-specific way.
- ‘T_FMT_AMPM’
- The return value can be used as a format string for ‘strftime’
- to represent time in the am/pm format.
- Note that if the am/pm format does not make any sense for the
- selected locale, the return value might be the same as the one
- for ‘T_FMT’.
- ‘ERA’
- The return value represents the era used in the current
- locale.
- Most locales do not define this value. An example of a locale
- which does define this value is the Japanese one. In Japan,
- the traditional representation of dates includes the name of
- the era corresponding to the then-emperor's reign.
- Normally it should not be necessary to use this value
- directly. Specifying the ‘E’ modifier in their format strings
- causes the ‘strftime’ functions to use this information. The
- format of the returned string is not specified, and therefore
- you should not assume knowledge of it on different systems.
- ‘ERA_YEAR’
- The return value gives the year in the relevant era of the
- locale. As for ‘ERA’ it should not be necessary to use this
- value directly.
- ‘ERA_D_T_FMT’
- This return value can be used as a format string for
- ‘strftime’ to represent dates and times in a locale-specific
- era-based way.
- ‘ERA_D_FMT’
- This return value can be used as a format string for
- ‘strftime’ to represent a date in a locale-specific era-based
- way.
- ‘ERA_T_FMT’
- This return value can be used as a format string for
- ‘strftime’ to represent time in a locale-specific era-based
- way.
- ‘ALT_DIGITS’
- The return value is a representation of up to 100 values used
- to represent the values 0 to 99. As for ‘ERA’ this value is
- not intended to be used directly, but instead indirectly
- through the ‘strftime’ function. When the modifier ‘O’ is
- used in a format which would otherwise use numerals to
- represent hours, minutes, seconds, weekdays, months, or weeks,
- the appropriate value for the locale is used instead.
- ‘INT_CURR_SYMBOL’
- The same as the value returned by ‘localeconv’ in the
- ‘int_curr_symbol’ element of the ‘struct lconv’.
- ‘CURRENCY_SYMBOL’
- ‘CRNCYSTR’
- The same as the value returned by ‘localeconv’ in the
- ‘currency_symbol’ element of the ‘struct lconv’.
- ‘CRNCYSTR’ is a deprecated alias still required by Unix98.
- ‘MON_DECIMAL_POINT’
- The same as the value returned by ‘localeconv’ in the
- ‘mon_decimal_point’ element of the ‘struct lconv’.
- ‘MON_THOUSANDS_SEP’
- The same as the value returned by ‘localeconv’ in the
- ‘mon_thousands_sep’ element of the ‘struct lconv’.
- ‘MON_GROUPING’
- The same as the value returned by ‘localeconv’ in the
- ‘mon_grouping’ element of the ‘struct lconv’.
- ‘POSITIVE_SIGN’
- The same as the value returned by ‘localeconv’ in the
- ‘positive_sign’ element of the ‘struct lconv’.
- ‘NEGATIVE_SIGN’
- The same as the value returned by ‘localeconv’ in the
- ‘negative_sign’ element of the ‘struct lconv’.
- ‘INT_FRAC_DIGITS’
- The same as the value returned by ‘localeconv’ in the
- ‘int_frac_digits’ element of the ‘struct lconv’.
- ‘FRAC_DIGITS’
- The same as the value returned by ‘localeconv’ in the
- ‘frac_digits’ element of the ‘struct lconv’.
- ‘P_CS_PRECEDES’
- The same as the value returned by ‘localeconv’ in the
- ‘p_cs_precedes’ element of the ‘struct lconv’.
- ‘P_SEP_BY_SPACE’
- The same as the value returned by ‘localeconv’ in the
- ‘p_sep_by_space’ element of the ‘struct lconv’.
- ‘N_CS_PRECEDES’
- The same as the value returned by ‘localeconv’ in the
- ‘n_cs_precedes’ element of the ‘struct lconv’.
- ‘N_SEP_BY_SPACE’
- The same as the value returned by ‘localeconv’ in the
- ‘n_sep_by_space’ element of the ‘struct lconv’.
- ‘P_SIGN_POSN’
- The same as the value returned by ‘localeconv’ in the
- ‘p_sign_posn’ element of the ‘struct lconv’.
- ‘N_SIGN_POSN’
- The same as the value returned by ‘localeconv’ in the
- ‘n_sign_posn’ element of the ‘struct lconv’.
- ‘INT_P_CS_PRECEDES’
- The same as the value returned by ‘localeconv’ in the
- ‘int_p_cs_precedes’ element of the ‘struct lconv’.
- ‘INT_P_SEP_BY_SPACE’
- The same as the value returned by ‘localeconv’ in the
- ‘int_p_sep_by_space’ element of the ‘struct lconv’.
- ‘INT_N_CS_PRECEDES’
- The same as the value returned by ‘localeconv’ in the
- ‘int_n_cs_precedes’ element of the ‘struct lconv’.
- ‘INT_N_SEP_BY_SPACE’
- The same as the value returned by ‘localeconv’ in the
- ‘int_n_sep_by_space’ element of the ‘struct lconv’.
- ‘INT_P_SIGN_POSN’
- The same as the value returned by ‘localeconv’ in the
- ‘int_p_sign_posn’ element of the ‘struct lconv’.
- ‘INT_N_SIGN_POSN’
- The same as the value returned by ‘localeconv’ in the
- ‘int_n_sign_posn’ element of the ‘struct lconv’.
- ‘DECIMAL_POINT’
- ‘RADIXCHAR’
- The same as the value returned by ‘localeconv’ in the
- ‘decimal_point’ element of the ‘struct lconv’.
- The name ‘RADIXCHAR’ is a deprecated alias still used in
- Unix98.
- ‘THOUSANDS_SEP’
- ‘THOUSEP’
- The same as the value returned by ‘localeconv’ in the
- ‘thousands_sep’ element of the ‘struct lconv’.
- The name ‘THOUSEP’ is a deprecated alias still used in Unix98.
- ‘GROUPING’
- The same as the value returned by ‘localeconv’ in the
- ‘grouping’ element of the ‘struct lconv’.
- ‘YESEXPR’
- The return value is a regular expression which can be used
- with the ‘regex’ function to recognize a positive response to
- a yes/no question. The GNU C Library provides the ‘rpmatch’
- function for easier handling in applications.
- ‘NOEXPR’
- The return value is a regular expression which can be used
- with the ‘regex’ function to recognize a negative response to
- a yes/no question.
- ‘YESSTR’
- The return value is a locale-specific translation of the
- positive response to a yes/no question.
- Using this value is deprecated since it is a very special case
- of message translation, and is better handled by the message
- translation functions (*note Message Translation::).
- The use of this symbol is deprecated. Instead message
- translation should be used.
- ‘NOSTR’
- The return value is a locale-specific translation of the
- negative response to a yes/no question. What is said for
- ‘YESSTR’ is also true here.
- The use of this symbol is deprecated. Instead message
- translation should be used.
- The file ‘langinfo.h’ defines a lot more symbols but none of them
- are official. Using them is not portable, and the format of the
- return values might change. Therefore we recommended you not use
- them.
- Note that the return value for any valid argument can be used in
- all situations (with the possible exception of the am/pm time
- formatting codes). If the user has not selected any locale for the
- appropriate category, ‘nl_langinfo’ returns the information from
- the ‘"C"’ locale. It is therefore possible to use this function as
- shown in the example below.
- If the argument ITEM is not valid, a pointer to an empty string is
- returned.
- An example of ‘nl_langinfo’ usage is a function which has to print a
- given date and time in a locale-specific way. At first one might think
- that, since ‘strftime’ internally uses the locale information, writing
- something like the following is enough:
- size_t
- i18n_time_n_data (char *s, size_t len, const struct tm *tp)
- {
- return strftime (s, len, "%X %D", tp);
- }
- The format contains no weekday or month names and therefore is
- internationally usable. Wrong! The output produced is something like
- ‘"hh:mm:ss MM/DD/YY"’. This format is only recognizable in the USA.
- Other countries use different formats. Therefore the function should be
- rewritten like this:
- size_t
- i18n_time_n_data (char *s, size_t len, const struct tm *tp)
- {
- return strftime (s, len, nl_langinfo (D_T_FMT), tp);
- }
- Now it uses the date and time format of the locale selected when the
- program runs. If the user selects the locale correctly there should
- never be a misunderstanding over the time and date format.
- File: libc.info, Node: Formatting Numbers, Next: Yes-or-No Questions, Prev: Locale Information, Up: Locales
- 7.8 A dedicated function to format numbers
- ==========================================
- We have seen that the structure returned by ‘localeconv’ as well as the
- values given to ‘nl_langinfo’ allow you to retrieve the various pieces
- of locale-specific information to format numbers and monetary amounts.
- We have also seen that the underlying rules are quite complex.
- Therefore the X/Open standards introduce a function which uses such
- locale information, making it easier for the user to format numbers
- according to these rules.
- -- Function: ssize_t strfmon (char *S, size_t MAXSIZE, const char
- *FORMAT, ...)
- Preliminary: | MT-Safe locale | AS-Unsafe heap | AC-Unsafe mem |
- *Note POSIX Safety Concepts::.
- The ‘strfmon’ function is similar to the ‘strftime’ function in
- that it takes a buffer, its size, a format string, and values to
- write into the buffer as text in a form specified by the format
- string. Like ‘strftime’, the function also returns the number of
- bytes written into the buffer.
- There are two differences: ‘strfmon’ can take more than one
- argument, and, of course, the format specification is different.
- Like ‘strftime’, the format string consists of normal text, which
- is output as is, and format specifiers, which are indicated by a
- ‘%’. Immediately after the ‘%’, you can optionally specify various
- flags and formatting information before the main formatting
- character, in a similar way to ‘printf’:
- • Immediately following the ‘%’ there can be one or more of the
- following flags:
- ‘=F’
- The single byte character F is used for this field as the
- numeric fill character. By default this character is a
- space character. Filling with this character is only
- performed if a left precision is specified. It is not
- just to fill to the given field width.
- ‘^’
- The number is printed without grouping the digits
- according to the rules of the current locale. By default
- grouping is enabled.
- ‘+’, ‘(’
- At most one of these flags can be used. They select
- which format to represent the sign of a currency amount.
- By default, and if ‘+’ is given, the locale equivalent of
- +/- is used. If ‘(’ is given, negative amounts are
- enclosed in parentheses. The exact format is determined
- by the values of the ‘LC_MONETARY’ category of the locale
- selected at program runtime.
- ‘!’
- The output will not contain the currency symbol.
- ‘-’
- The output will be formatted left-justified instead of
- right-justified if it does not fill the entire field
- width.
- The next part of the specification is an optional field width. If
- no width is specified 0 is taken. During output, the function
- first determines how much space is required. If it requires at
- least as many characters as given by the field width, it is output
- using as much space as necessary. Otherwise, it is extended to use
- the full width by filling with the space character. The presence
- or absence of the ‘-’ flag determines the side at which such
- padding occurs. If present, the spaces are added at the right
- making the output left-justified, and vice versa.
- So far the format looks familiar, being similar to the ‘printf’ and
- ‘strftime’ formats. However, the next two optional fields
- introduce something new. The first one is a ‘#’ character followed
- by a decimal digit string. The value of the digit string specifies
- the number of _digit_ positions to the left of the decimal point
- (or equivalent). This does _not_ include the grouping character
- when the ‘^’ flag is not given. If the space needed to print the
- number does not fill the whole width, the field is padded at the
- left side with the fill character, which can be selected using the
- ‘=’ flag and by default is a space. For example, if the field
- width is selected as 6 and the number is 123, the fill character is
- ‘*’ the result will be ‘***123’.
- The second optional field starts with a ‘.’ (period) and consists
- of another decimal digit string. Its value describes the number of
- characters printed after the decimal point. The default is
- selected from the current locale (‘frac_digits’, ‘int_frac_digits’,
- see *note General Numeric::). If the exact representation needs
- more digits than given by the field width, the displayed value is
- rounded. If the number of fractional digits is selected to be
- zero, no decimal point is printed.
- As a GNU extension, the ‘strfmon’ implementation in the GNU C
- Library allows an optional ‘L’ next as a format modifier. If this
- modifier is given, the argument is expected to be a ‘long double’
- instead of a ‘double’ value.
- Finally, the last component is a format specifier. There are three
- specifiers defined:
- ‘i’
- Use the locale's rules for formatting an international
- currency value.
- ‘n’
- Use the locale's rules for formatting a national currency
- value.
- ‘%’
- Place a ‘%’ in the output. There must be no flag, width
- specifier or modifier given, only ‘%%’ is allowed.
- As for ‘printf’, the function reads the format string from left to
- right and uses the values passed to the function following the
- format string. The values are expected to be either of type
- ‘double’ or ‘long double’, depending on the presence of the
- modifier ‘L’. The result is stored in the buffer pointed to by S.
- At most MAXSIZE characters are stored.
- The return value of the function is the number of characters stored
- in S, including the terminating ‘NULL’ byte. If the number of
- characters stored would exceed MAXSIZE, the function returns -1 and
- the content of the buffer S is unspecified. In this case ‘errno’
- is set to ‘E2BIG’.
- A few examples should make clear how the function works. It is
- assumed that all the following pieces of code are executed in a program
- which uses the USA locale (‘en_US’). The simplest form of the format is
- this:
- strfmon (buf, 100, "@%n@%n@%n@", 123.45, -567.89, 12345.678);
- The output produced is
- "@$123.45@-$567.89@$12,345.68@"
- We can notice several things here. First, the widths of the output
- numbers are different. We have not specified a width in the format
- string, and so this is no wonder. Second, the third number is printed
- using thousands separators. The thousands separator for the ‘en_US’
- locale is a comma. The number is also rounded. .678 is rounded to .68
- since the format does not specify a precision and the default value in
- the locale is 2. Finally, note that the national currency symbol is
- printed since ‘%n’ was used, not ‘i’. The next example shows how we can
- align the output.
- strfmon (buf, 100, "@%=*11n@%=*11n@%=*11n@", 123.45, -567.89, 12345.678);
- The output this time is:
- "@ $123.45@ -$567.89@ $12,345.68@"
- Two things stand out. Firstly, all fields have the same width
- (eleven characters) since this is the width given in the format and
- since no number required more characters to be printed. The second
- important point is that the fill character is not used. This is correct
- since the white space was not used to achieve a precision given by a ‘#’
- modifier, but instead to fill to the given width. The difference
- becomes obvious if we now add a width specification.
- strfmon (buf, 100, "@%=*11#5n@%=*11#5n@%=*11#5n@",
- 123.45, -567.89, 12345.678);
- The output is
- "@ $***123.45@-$***567.89@ $12,456.68@"
- Here we can see that all the currency symbols are now aligned, and
- that the space between the currency sign and the number is filled with
- the selected fill character. Note that although the width is selected
- to be 5 and 123.45 has three digits left of the decimal point, the space
- is filled with three asterisks. This is correct since, as explained
- above, the width does not include the positions used to store thousands
- separators. One last example should explain the remaining
- functionality.
- strfmon (buf, 100, "@%=0(16#5.3i@%=0(16#5.3i@%=0(16#5.3i@",
- 123.45, -567.89, 12345.678);
- This rather complex format string produces the following output:
- "@ USD 000123,450 @(USD 000567.890)@ USD 12,345.678 @"
- The most noticeable change is the alternative way of representing
- negative numbers. In financial circles this is often done using
- parentheses, and this is what the ‘(’ flag selected. The fill character
- is now ‘0’. Note that this ‘0’ character is not regarded as a numeric
- zero, and therefore the first and second numbers are not printed using a
- thousands separator. Since we used the format specifier ‘i’ instead of
- ‘n’, the international form of the currency symbol is used. This is a
- four letter string, in this case ‘"USD "’. The last point is that since
- the precision right of the decimal point is selected to be three, the
- first and second numbers are printed with an extra zero at the end and
- the third number is printed without rounding.
- File: libc.info, Node: Yes-or-No Questions, Prev: Formatting Numbers, Up: Locales
- 7.9 Yes-or-No Questions
- =======================
- Some non GUI programs ask a yes-or-no question. If the messages
- (especially the questions) are translated into foreign languages, be
- sure that you localize the answers too. It would be very bad habit to
- ask a question in one language and request the answer in another, often
- English.
- The GNU C Library contains ‘rpmatch’ to give applications easy access
- to the corresponding locale definitions.
- -- Function: int rpmatch (const char *RESPONSE)
- Preliminary: | MT-Safe locale | AS-Unsafe corrupt heap lock dlopen
- | AC-Unsafe corrupt lock mem fd | *Note POSIX Safety Concepts::.
- The function ‘rpmatch’ checks the string in RESPONSE for whether or
- not it is a correct yes-or-no answer and if yes, which one. The
- check uses the ‘YESEXPR’ and ‘NOEXPR’ data in the ‘LC_MESSAGES’
- category of the currently selected locale. The return value is as
- follows:
- ‘1’
- The user entered an affirmative answer.
- ‘0’
- The user entered a negative answer.
- ‘-1’
- The answer matched neither the ‘YESEXPR’ nor the ‘NOEXPR’
- regular expression.
- This function is not standardized but available beside in the GNU C
- Library at least also in the IBM AIX library.
- This function would normally be used like this:
- ...
- /* Use a safe default. */
- _Bool doit = false;
- fputs (gettext ("Do you really want to do this? "), stdout);
- fflush (stdout);
- /* Prepare the ‘getline’ call. */
- line = NULL;
- len = 0;
- while (getline (&line, &len, stdin) >= 0)
- {
- /* Check the response. */
- int res = rpmatch (line);
- if (res >= 0)
- {
- /* We got a definitive answer. */
- if (res > 0)
- doit = true;
- break;
- }
- }
- /* Free what ‘getline’ allocated. */
- free (line);
- Note that the loop continues until a read error is detected or until
- a definitive (positive or negative) answer is read.
- File: libc.info, Node: Message Translation, Next: Searching and Sorting, Prev: Locales, Up: Top
- 8 Message Translation
- *********************
- The program's interface with the user should be designed to ease the
- user's task. One way to ease the user's task is to use messages in
- whatever language the user prefers.
- Printing messages in different languages can be implemented in
- different ways. One could add all the different languages in the source
- code and choose among the variants every time a message has to be
- printed. This is certainly not a good solution since extending the set
- of languages is cumbersome (the code must be changed) and the code
- itself can become really big with dozens of message sets.
- A better solution is to keep the message sets for each language in
- separate files which are loaded at runtime depending on the language
- selection of the user.
- The GNU C Library provides two different sets of functions to support
- message translation. The ‘catgets’ family of functions were previously
- the only family defined in the X/Open standard but they were derived
- from industry decisions and therefore not necessarily based on
- reasonable decisions. However, the preferable ‘gettext’ family of
- functions was standardized in POSIX-1.2024.
- As mentioned above, the message catalog handling provides easy
- extendability by using external data files which contain the message
- translations. I.e., these files contain for each of the messages used
- in the program a translation for the appropriate language. So the tasks
- of the message handling functions are
- • locate the external data file with the appropriate translations
- • load the data and make it possible to address the messages
- • map a given key to the translated message
- The two approaches mainly differ in the implementation of this last
- step. Decisions made in the last step influence the rest of the design.
- * Menu:
- * Message catalogs a la X/Open:: The ‘catgets’ family of functions.
- * The Uniforum approach:: The ‘gettext’ family of functions.
- File: libc.info, Node: Message catalogs a la X/Open, Next: The Uniforum approach, Up: Message Translation
- 8.1 X/Open Message Catalog Handling
- ===================================
- The ‘catgets’ functions are based on the simple scheme:
- Associate every message to translate in the source code with a
- unique identifier. To retrieve a message from a catalog file
- solely the identifier is used.
- This means for the author of the program that s/he will have to make
- sure the meaning of the identifier in the program code and in the
- message catalogs is always the same.
- Before a message can be translated the catalog file must be located.
- The user of the program must be able to guide the responsible function
- to find whatever catalog the user wants. This is separated from what
- the programmer had in mind.
- All the types, constants and functions for the ‘catgets’ functions
- are defined/declared in the ‘nl_types.h’ header file.
- * Menu:
- * The catgets Functions:: The ‘catgets’ function family.
- * The message catalog files:: Format of the message catalog files.
- * The gencat program:: How to generate message catalogs files which
- can be used by the functions.
- * Common Usage:: How to use the ‘catgets’ interface.
- File: libc.info, Node: The catgets Functions, Next: The message catalog files, Up: Message catalogs a la X/Open
- 8.1.1 The ‘catgets’ function family
- -----------------------------------
- -- Function: nl_catd catopen (const char *CAT_NAME, int FLAG)
- Preliminary: | MT-Safe env | AS-Unsafe heap | AC-Unsafe mem | *Note
- POSIX Safety Concepts::.
- The ‘catopen’ function tries to locate the message data file named
- CAT_NAME and loads it when found. The return value is of an opaque
- type and can be used in calls to the other functions to refer to
- this loaded catalog.
- The return value is ‘(nl_catd) -1’ in case the function failed and
- no catalog was loaded. The global variable ‘errno’ contains a code
- for the error causing the failure. But even if the function call
- succeeded this does not mean that all messages can be translated.
- Locating the catalog file must happen in a way which lets the user
- of the program influence the decision. It is up to the user to
- decide about the language to use and sometimes it is useful to use
- alternate catalog files. All this can be specified by the user by
- setting some environment variables.
- The first problem is to find out where all the message catalogs are
- stored. Every program could have its own place to keep all the
- different files but usually the catalog files are grouped by
- languages and the catalogs for all programs are kept in the same
- place.
- To tell the ‘catopen’ function where the catalog for the program
- can be found the user can set the environment variable ‘NLSPATH’ to
- a value which describes her/his choice. Since this value must be
- usable for different languages and locales it cannot be a simple
- string. Instead it is a format string (similar to ‘printf’'s). An
- example is
- /usr/share/locale/%L/%N:/usr/share/locale/%L/LC_MESSAGES/%N
- First one can see that more than one directory can be specified
- (with the usual syntax of separating them by colons). The next
- things to observe are the format string, ‘%L’ and ‘%N’ in this
- case. The ‘catopen’ function knows about several of them and the
- replacement for all of them is of course different.
- ‘%N’
- This format element is substituted with the name of the
- catalog file. This is the value of the CAT_NAME argument
- given to ‘catgets’.
- ‘%L’
- This format element is substituted with the name of the
- currently selected locale for translating messages. How this
- is determined is explained below.
- ‘%l’
- (This is the lowercase ell.) This format element is
- substituted with the language element of the locale name. The
- string describing the selected locale is expected to have the
- form ‘LANG[_TERR[.CODESET]]’ and this format uses the first
- part LANG.
- ‘%t’
- This format element is substituted by the territory part TERR
- of the name of the currently selected locale. See the
- explanation of the format above.
- ‘%c’
- This format element is substituted by the codeset part CODESET
- of the name of the currently selected locale. See the
- explanation of the format above.
- ‘%%’
- Since ‘%’ is used as a meta character there must be a way to
- express the ‘%’ character in the result itself. Using ‘%%’
- does this just like it works for ‘printf’.
- Using ‘NLSPATH’ allows arbitrary directories to be searched for
- message catalogs while still allowing different languages to be
- used. If the ‘NLSPATH’ environment variable is not set, the
- default value is
- PREFIX/share/locale/%L/%N:PREFIX/share/locale/%L/LC_MESSAGES/%N
- where PREFIX is given to ‘configure’ while installing the GNU C
- Library (this value is in many cases ‘/usr’ or the empty string).
- The remaining problem is to decide which must be used. The value
- decides about the substitution of the format elements mentioned
- above. First of all the user can specify a path in the message
- catalog name (i.e., the name contains a slash character). In this
- situation the ‘NLSPATH’ environment variable is not used. The
- catalog must exist as specified in the program, perhaps relative to
- the current working directory. This situation in not desirable and
- catalogs names never should be written this way. Beside this, this
- behavior is not portable to all other platforms providing the
- ‘catgets’ interface.
- Otherwise the values of environment variables from the standard
- environment are examined (*note Standard Environment::). Which
- variables are examined is decided by the FLAG parameter of
- ‘catopen’. If the value is ‘NL_CAT_LOCALE’ (which is defined in
- ‘nl_types.h’) then the ‘catopen’ function uses the name of the
- locale currently selected for the ‘LC_MESSAGES’ category.
- If FLAG is zero the ‘LANG’ environment variable is examined. This
- is a left-over from the early days when the concept of locales had
- not even reached the level of POSIX locales.
- The environment variable and the locale name should have a value of
- the form ‘LANG[_TERR[.CODESET]]’ as explained above. If no
- environment variable is set the ‘"C"’ locale is used which prevents
- any translation.
- The return value of the function is in any case a valid string.
- Either it is a translation from a message catalog or it is the same
- as the STRING parameter. So a piece of code to decide whether a
- translation actually happened must look like this:
- {
- char *trans = catgets (desc, set, msg, input_string);
- if (trans == input_string)
- {
- /* Something went wrong. */
- }
- }
- When an error occurs the global variable ‘errno’ is set to
- EBADF
- The catalog does not exist.
- ENOMSG
- The set/message tuple does not name an existing element in the
- message catalog.
- While it sometimes can be useful to test for errors programs
- normally will avoid any test. If the translation is not available
- it is no big problem if the original, untranslated message is
- printed. Either the user understands this as well or s/he will
- look for the reason why the messages are not translated.
- Please note that the currently selected locale does not depend on a
- call to the ‘setlocale’ function. It is not necessary that the locale
- data files for this locale exist and calling ‘setlocale’ succeeds. The
- ‘catopen’ function directly reads the values of the environment
- variables.
- -- Function: char * catgets (nl_catd CATALOG_DESC, int SET, int
- MESSAGE, const char *STRING)
- Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
- Concepts::.
- The function ‘catgets’ has to be used to access the message catalog
- previously opened using the ‘catopen’ function. The CATALOG_DESC
- parameter must be a value previously returned by ‘catopen’.
- The next two parameters, SET and MESSAGE, reflect the internal
- organization of the message catalog files. This will be explained
- in detail below. For now it is interesting to know that a catalog
- can consist of several sets and the messages in each thread are
- individually numbered using numbers. Neither the set number nor
- the message number must be consecutive. They can be arbitrarily
- chosen. But each message (unless equal to another one) must have
- its own unique pair of set and message numbers.
- Since it is not guaranteed that the message catalog for the
- language selected by the user exists the last parameter STRING
- helps to handle this case gracefully. If no matching string can be
- found STRING is returned. This means for the programmer that
- • the STRING parameters should contain reasonable text (this
- also helps to understand the program seems otherwise there
- would be no hint on the string which is expected to be
- returned.
- • all STRING arguments should be written in the same language.
- It is somewhat uncomfortable to write a program using the ‘catgets’
- functions if no supporting functionality is available. Since each
- set/message number tuple must be unique the programmer must keep lists
- of the messages at the same time the code is written. And the work
- between several people working on the same project must be coordinated.
- We will see how some of these problems can be relaxed a bit (*note
- Common Usage::).
- -- Function: int catclose (nl_catd CATALOG_DESC)
- Preliminary: | MT-Safe | AS-Unsafe heap | AC-Unsafe corrupt mem |
- *Note POSIX Safety Concepts::.
- The ‘catclose’ function can be used to free the resources
- associated with a message catalog which previously was opened by a
- call to ‘catopen’. If the resources can be successfully freed the
- function returns ‘0’. Otherwise it returns ‘−1’ and the global
- variable ‘errno’ is set. Errors can occur if the catalog
- descriptor CATALOG_DESC is not valid in which case ‘errno’ is set
- to ‘EBADF’.
- File: libc.info, Node: The message catalog files, Next: The gencat program, Prev: The catgets Functions, Up: Message catalogs a la X/Open
- 8.1.2 Format of the message catalog files
- -----------------------------------------
- The only reasonable way to translate all the messages of a function and
- store the result in a message catalog file which can be read by the
- ‘catopen’ function is to write all the message text to the translator
- and let her/him translate them all. I.e., we must have a file with
- entries which associate the set/message tuple with a specific
- translation. This file format is specified in the X/Open standard and
- is as follows:
- • Lines containing only whitespace characters or empty lines are
- ignored.
- • Lines which contain as the first non-whitespace character a ‘$’
- followed by a whitespace character are comment and are also
- ignored.
- • If a line contains as the first non-whitespace characters the
- sequence ‘$set’ followed by a whitespace character an additional
- argument is required to follow. This argument can either be:
- − a number. In this case the value of this number determines
- the set to which the following messages are added.
- − an identifier consisting of alphanumeric characters plus the
- underscore character. In this case the set get automatically
- a number assigned. This value is one added to the largest set
- number which so far appeared.
- How to use the symbolic names is explained in section *note
- Common Usage::.
- It is an error if a symbol name appears more than once. All
- following messages are placed in a set with this number.
- • If a line contains as the first non-whitespace characters the
- sequence ‘$delset’ followed by a whitespace character an additional
- argument is required to follow. This argument can either be:
- − a number. In this case the value of this number determines
- the set which will be deleted.
- − an identifier consisting of alphanumeric characters plus the
- underscore character. This symbolic identifier must match a
- name for a set which previously was defined. It is an error
- if the name is unknown.
- In both cases all messages in the specified set will be removed.
- They will not appear in the output. But if this set is later again
- selected with a ‘$set’ command again messages could be added and
- these messages will appear in the output.
- • If a line contains after leading whitespaces the sequence ‘$quote’,
- the quoting character used for this input file is changed to the
- first non-whitespace character following ‘$quote’. If no
- non-whitespace character is present before the line ends quoting is
- disabled.
- By default no quoting character is used. In this mode strings are
- terminated with the first unescaped line break. If there is a
- ‘$quote’ sequence present newline need not be escaped. Instead a
- string is terminated with the first unescaped appearance of the
- quote character.
- A common usage of this feature would be to set the quote character
- to ‘"’. Then any appearance of the ‘"’ in the strings must be
- escaped using the backslash (i.e., ‘\"’ must be written).
- • Any other line must start with a number or an alphanumeric
- identifier (with the underscore character included). The following
- characters (starting after the first whitespace character) will
- form the string which gets associated with the currently selected
- set and the message number represented by the number and identifier
- respectively.
- If the start of the line is a number the message number is obvious.
- It is an error if the same message number already appeared for this
- set.
- If the leading token was an identifier the message number gets
- automatically assigned. The value is the current maximum message
- number for this set plus one. It is an error if the identifier was
- already used for a message in this set. It is OK to reuse the
- identifier for a message in another thread. How to use the
- symbolic identifiers will be explained below (*note Common
- Usage::). There is one limitation with the identifier: it must not
- be ‘Set’. The reason will be explained below.
- The text of the messages can contain escape characters. The usual
- bunch of characters known from the ISO C language are recognized
- (‘\n’, ‘\t’, ‘\v’, ‘\b’, ‘\r’, ‘\f’, ‘\\’, and ‘\NNN’, where NNN is
- the octal coding of a character code).
- *Important:* The handling of identifiers instead of numbers for the
- set and messages is a GNU extension. Systems strictly following the
- X/Open specification do not have this feature. An example for a message
- catalog file is this:
- $ This is a leading comment.
- $quote "
- $set SetOne
- 1 Message with ID 1.
- two " Message with ID \"two\", which gets the value 2 assigned"
- $set SetTwo
- $ Since the last set got the number 1 assigned this set has number 2.
- 4000 "The numbers can be arbitrary, they need not start at one."
- This small example shows various aspects:
- • Lines 1 and 9 are comments since they start with ‘$’ followed by a
- whitespace.
- • The quoting character is set to ‘"’. Otherwise the quotes in the
- message definition would have to be omitted and in this case the
- message with the identifier ‘two’ would lose its leading
- whitespace.
- • Mixing numbered messages with messages having symbolic names is no
- problem and the numbering happens automatically.
- While this file format is pretty easy it is not the best possible for
- use in a running program. The ‘catopen’ function would have to parse
- the file and handle syntactic errors gracefully. This is not so easy
- and the whole process is pretty slow. Therefore the ‘catgets’ functions
- expect the data in another more compact and ready-to-use file format.
- There is a special program ‘gencat’ which is explained in detail in the
- next section.
- Files in this other format are not human readable. To be easy to use
- by programs it is a binary file. But the format is byte order
- independent so translation files can be shared by systems of arbitrary
- architecture (as long as they use the GNU C Library).
- Details about the binary file format are not important to know since
- these files are always created by the ‘gencat’ program. The sources of
- the GNU C Library also provide the sources for the ‘gencat’ program and
- so the interested reader can look through these source files to learn
- about the file format.
- File: libc.info, Node: The gencat program, Next: Common Usage, Prev: The message catalog files, Up: Message catalogs a la X/Open
- 8.1.3 Generate Message Catalogs files
- -------------------------------------
- The ‘gencat’ program is specified in the X/Open standard and the GNU
- implementation follows this specification and so processes all correctly
- formed input files. Additionally some extension are implemented which
- help to work in a more reasonable way with the ‘catgets’ functions.
- The ‘gencat’ program can be invoked in two ways:
- `gencat [OPTION ...] [OUTPUT-FILE [INPUT-FILE ...]]`
- This is the interface defined in the X/Open standard. If no
- INPUT-FILE parameter is given, input will be read from standard input.
- Multiple input files will be read as if they were concatenated. If
- OUTPUT-FILE is also missing, the output will be written to standard
- output. To provide the interface one is used to from other programs a
- second interface is provided.
- `gencat [OPTION ...] -o OUTPUT-FILE [INPUT-FILE ...]`
- The option ‘-o’ is used to specify the output file and all file
- arguments are used as input files.
- Beside this one can use ‘-’ or ‘/dev/stdin’ for INPUT-FILE to denote
- the standard input. Corresponding one can use ‘-’ and ‘/dev/stdout’ for
- OUTPUT-FILE to denote standard output. Using ‘-’ as a file name is
- allowed in X/Open while using the device names is a GNU extension.
- The ‘gencat’ program works by concatenating all input files and then
- *merging* the resulting collection of message sets with a possibly
- existing output file. This is done by removing all messages with
- set/message number tuples matching any of the generated messages from
- the output file and then adding all the new messages. To regenerate a
- catalog file while ignoring the old contents therefore requires removing
- the output file if it exists. If the output is written to standard
- output no merging takes place.
- The following table shows the options understood by the ‘gencat’
- program. The X/Open standard does not specify any options for the
- program so all of these are GNU extensions.
- ‘-V’
- ‘--version’
- Print the version information and exit.
- ‘-h’
- ‘--help’
- Print a usage message listing all available options, then exit
- successfully.
- ‘--new’
- Do not merge the new messages from the input files with the old
- content of the output file. The old content of the output file is
- discarded.
- ‘-H’
- ‘--header=name’
- This option is used to emit the symbolic names given to sets and
- messages in the input files for use in the program. Details about
- how to use this are given in the next section. The NAME parameter
- to this option specifies the name of the output file. It will
- contain a number of C preprocessor ‘#define’s to associate a name
- with a number.
- Please note that the generated file only contains the symbols from
- the input files. If the output is merged with the previous content
- of the output file the possibly existing symbols from the file(s)
- which generated the old output files are not in the generated
- header file.
- File: libc.info, Node: Common Usage, Prev: The gencat program, Up: Message catalogs a la X/Open
- 8.1.4 How to use the ‘catgets’ interface
- ----------------------------------------
- The ‘catgets’ functions can be used in two different ways. By following
- slavishly the X/Open specs and not relying on the extension and by using
- the GNU extensions. We will take a look at the former method first to
- understand the benefits of extensions.
- 8.1.4.1 Not using symbolic names
- ................................
- Since the X/Open format of the message catalog files does not allow
- symbol names we have to work with numbers all the time. When we start
- writing a program we have to replace all appearances of translatable
- strings with something like
- catgets (catdesc, set, msg, "string")
- CATGETS is retrieved from a call to ‘catopen’ which is normally done
- once at the program start. The ‘"string"’ is the string we want to
- translate. The problems start with the set and message numbers.
- In a bigger program several programmers usually work at the same time
- on the program and so coordinating the number allocation is crucial.
- Though no two different strings must be indexed by the same tuple of
- numbers it is highly desirable to reuse the numbers for equal strings
- with equal translations (please note that there might be strings which
- are equal in one language but have different translations due to
- difference contexts).
- The allocation process can be relaxed a bit by different set numbers
- for different parts of the program. So the number of developers who
- have to coordinate the allocation can be reduced. But still lists must
- be keep track of the allocation and errors can easily happen. These
- errors cannot be discovered by the compiler or the ‘catgets’ functions.
- Only the user of the program might see wrong messages printed. In the
- worst cases the messages are so irritating that they cannot be
- recognized as wrong. Think about the translations for ‘"true"’ and
- ‘"false"’ being exchanged. This could result in a disaster.
- 8.1.4.2 Using symbolic names
- ............................
- The problems mentioned in the last section derive from the fact that:
- 1. the numbers are allocated once and due to the possibly frequent use
- of them it is difficult to change a number later.
- 2. the numbers do not allow guessing anything about the string and
- therefore collisions can easily happen.
- By constantly using symbolic names and by providing a method which
- maps the string content to a symbolic name (however this will happen)
- one can prevent both problems above. The cost of this is that the
- programmer has to write a complete message catalog file while s/he is
- writing the program itself.
- This is necessary since the symbolic names must be mapped to numbers
- before the program sources can be compiled. In the last section it was
- described how to generate a header containing the mapping of the names.
- E.g., for the example message file given in the last section we could
- call the ‘gencat’ program as follows (assume ‘ex.msg’ contains the
- sources).
- gencat -H ex.h -o ex.cat ex.msg
- This generates a header file with the following content:
- #define SetTwoSet 0x2 /* ex.msg:8 */
- #define SetOneSet 0x1 /* ex.msg:4 */
- #define SetOnetwo 0x2 /* ex.msg:6 */
- As can be seen the various symbols given in the source file are
- mangled to generate unique identifiers and these identifiers get numbers
- assigned. Reading the source file and knowing about the rules will
- allow to predict the content of the header file (it is deterministic)
- but this is not necessary. The ‘gencat’ program can take care for
- everything. All the programmer has to do is to put the generated header
- file in the dependency list of the source files of her/his project and
- add a rule to regenerate the header if any of the input files change.
- One word about the symbol mangling. Every symbol consists of two
- parts: the name of the message set plus the name of the message or the
- special string ‘Set’. So ‘SetOnetwo’ means this macro can be used to
- access the translation with identifier ‘two’ in the message set
- ‘SetOne’.
- The other names denote the names of the message sets. The special
- string ‘Set’ is used in the place of the message identifier.
- If in the code the second string of the set ‘SetOne’ is used the C
- code should look like this:
- catgets (catdesc, SetOneSet, SetOnetwo,
- " Message with ID \"two\", which gets the value 2 assigned")
- Writing the function this way will allow to change the message number
- and even the set number without requiring any change in the C source
- code. (The text of the string is normally not the same; this is only
- for this example.)
- 8.1.4.3 How does to this allow to develop
- .........................................
- To illustrate the usual way to work with the symbolic version numbers
- here is a little example. Assume we want to write the very complex and
- famous greeting program. We start by writing the code as usual:
- #include <stdio.h>
- int
- main (void)
- {
- printf ("Hello, world!\n");
- return 0;
- }
- Now we want to internationalize the message and therefore replace the
- message with whatever the user wants.
- #include <nl_types.h>
- #include <stdio.h>
- #include "msgnrs.h"
- int
- main (void)
- {
- nl_catd catdesc = catopen ("hello.cat", NL_CAT_LOCALE);
- printf (catgets (catdesc, SetMainSet, SetMainHello,
- "Hello, world!\n"));
- catclose (catdesc);
- return 0;
- }
- We see how the catalog object is opened and the returned descriptor
- used in the other function calls. It is not really necessary to check
- for failure of any of the functions since even in these situations the
- functions will behave reasonable. They simply will be return a
- translation.
- What remains unspecified here are the constants ‘SetMainSet’ and
- ‘SetMainHello’. These are the symbolic names describing the message.
- To get the actual definitions which match the information in the catalog
- file we have to create the message catalog source file and process it
- using the ‘gencat’ program.
- $ Messages for the famous greeting program.
- $quote "
- $set Main
- Hello "Hallo, Welt!\n"
- Now we can start building the program (assume the message catalog
- source file is named ‘hello.msg’ and the program source file ‘hello.c’):
- % gencat -H msgnrs.h -o hello.cat hello.msg
- % cat msgnrs.h
- #define MainSet 0x1 /* hello.msg:4 */
- #define MainHello 0x1 /* hello.msg:5 */
- % gcc -o hello hello.c -I.
- % cp hello.cat /usr/share/locale/de/LC_MESSAGES
- % echo $LC_ALL
- de
- % ./hello
- Hallo, Welt!
- %
- The call of the ‘gencat’ program creates the missing header file
- ‘msgnrs.h’ as well as the message catalog binary. The former is used in
- the compilation of ‘hello.c’ while the later is placed in a directory in
- which the ‘catopen’ function will try to locate it. Please check the
- ‘LC_ALL’ environment variable and the default path for ‘catopen’
- presented in the description above.
- File: libc.info, Node: The Uniforum approach, Prev: Message catalogs a la X/Open, Up: Message Translation
- 8.2 The Uniforum approach to Message Translation
- ================================================
- Sun Microsystems tried to standardize a different approach to message
- translation in the Uniforum group. There never was a real standard
- defined but still the interface was used in Sun's operating systems.
- Since this approach fits better in the development process of free
- software it is also used throughout the GNU project and the GNU
- ‘gettext’ package provides support for this outside the GNU C Library.
- The code of the ‘libintl’ from GNU ‘gettext’ is the same as the code
- in the GNU C Library. So the documentation in the GNU ‘gettext’ manual
- is also valid for the functionality here. The following text will
- describe the library functions in detail. But the numerous helper
- programs are not described in this manual. Instead people should read
- the GNU ‘gettext’ manual (*note GNU gettext utilities: (gettext)Top.).
- We will only give a short overview.
- Though the ‘catgets’ functions are available by default on more
- systems the ‘gettext’ interface is at least as portable as the former.
- The GNU ‘gettext’ package can be used wherever the functions are not
- available.
- * Menu:
- * Message catalogs with gettext:: The ‘gettext’ family of functions.
- * Helper programs for gettext:: Programs to handle message catalogs
- for ‘gettext’.
- File: libc.info, Node: Message catalogs with gettext, Next: Helper programs for gettext, Up: The Uniforum approach
- 8.2.1 The ‘gettext’ family of functions
- ---------------------------------------
- The paradigms underlying the ‘gettext’ approach to message translations
- is different from that of the ‘catgets’ functions the basic functionally
- is equivalent. There are functions of the following categories:
- * Menu:
- * Translation with gettext:: What has to be done to translate a message.
- * Locating gettext catalog:: How to determine which catalog to be used.
- * Advanced gettext functions:: Additional functions for more complicated
- situations.
- * Charset conversion in gettext:: How to specify the output character set
- ‘gettext’ uses.
- * GUI program problems:: How to use ‘gettext’ in GUI programs.
- * Using gettextized software:: The possibilities of the user to influence
- the way ‘gettext’ works.
- File: libc.info, Node: Translation with gettext, Next: Locating gettext catalog, Up: Message catalogs with gettext
- 8.2.1.1 What has to be done to translate a message?
- ...................................................
- The ‘gettext’ functions have a very simple interface. The most basic
- function just takes the string which shall be translated as the argument
- and it returns the translation. This is fundamentally different from
- the ‘catgets’ approach where an extra key is necessary and the original
- string is only used for the error case.
- If the string which has to be translated is the only argument this of
- course means the string itself is the key. I.e., the translation will
- be selected based on the original string. The message catalogs must
- therefore contain the original strings plus one translation for any such
- string. The task of the ‘gettext’ function is to compare the argument
- string with the available strings in the catalog and return the
- appropriate translation. Of course this process is optimized so that
- this process is not more expensive than an access using an atomic key
- like in ‘catgets’.
- The ‘gettext’ approach has some advantages but also some
- disadvantages. Please see the GNU ‘gettext’ manual for a detailed
- discussion of the pros and cons.
- All the definitions and declarations for ‘gettext’ can be found in
- the ‘libintl.h’ header file. On systems where these functions are not
- part of the C library they can be found in a separate library named
- ‘libintl.a’ (or accordingly different for shared libraries).
- -- Function: char * gettext (const char *MSGID)
- Preliminary: | MT-Safe env | AS-Unsafe corrupt heap lock dlopen |
- AC-Unsafe corrupt lock fd mem | *Note POSIX Safety Concepts::.
- The ‘gettext’ function searches the currently selected message
- catalogs for a string which is equal to MSGID. If there is such a
- string available it is returned. Otherwise the argument string
- MSGID is returned.
- Please note that although the return value is ‘char *’ the returned
- string must not be changed. This broken type results from the
- history of the function and does not reflect the way the function
- should be used.
- Please note that above we wrote "message catalogs" (plural). This
- is a specialty of the GNU implementation of these functions and we
- will say more about this when we talk about the ways message
- catalogs are selected (*note Locating gettext catalog::).
- The ‘gettext’ function does not modify the value of the global
- ‘errno’ variable. This is necessary to make it possible to write
- something like
- printf (gettext ("Operation failed: %m\n"));
- Here the ‘errno’ value is used in the ‘printf’ function while
- processing the ‘%m’ format element and if the ‘gettext’ function
- would change this value (it is called before ‘printf’ is called) we
- would get a wrong message.
- So there is no easy way to detect a missing message catalog besides
- comparing the argument string with the result. But it is normally
- the task of the user to react on missing catalogs. The program
- cannot guess when a message catalog is really necessary since for a
- user who speaks the language the program was developed in, the
- message does not need any translation.
- The remaining two functions to access the message catalog add some
- functionality to select a message catalog which is not the default one.
- This is important if parts of the program are developed independently.
- Every part can have its own message catalog and all of them can be used
- at the same time. The C library itself is an example: internally it
- uses the ‘gettext’ functions but since it must not depend on a currently
- selected default message catalog it must specify all ambiguous
- information.
- -- Function: char * dgettext (const char *DOMAINNAME, const char
- *MSGID)
- Preliminary: | MT-Safe env | AS-Unsafe corrupt heap lock dlopen |
- AC-Unsafe corrupt lock fd mem | *Note POSIX Safety Concepts::.
- The ‘dgettext’ function acts just like the ‘gettext’ function. It
- only takes an additional first argument DOMAINNAME which guides the
- selection of the message catalogs which are searched for the
- translation. If the DOMAINNAME parameter is the null pointer the
- ‘dgettext’ function is exactly equivalent to ‘gettext’ since the
- default value for the domain name is used.
- As for ‘gettext’ the return value type is ‘char *’ which is an
- anachronism. The returned string must never be modified.
- -- Function: char * dcgettext (const char *DOMAINNAME, const char
- *MSGID, int CATEGORY)
- Preliminary: | MT-Safe env | AS-Unsafe corrupt heap lock dlopen |
- AC-Unsafe corrupt lock fd mem | *Note POSIX Safety Concepts::.
- The ‘dcgettext’ adds another argument to those which ‘dgettext’
- takes. This argument CATEGORY specifies the last piece of
- information needed to localize the message catalog. I.e., the
- domain name and the locale category exactly specify which message
- catalog has to be used (relative to a given directory, see below).
- The ‘dgettext’ function can be expressed in terms of ‘dcgettext’ by
- using
- dcgettext (domain, string, LC_MESSAGES)
- instead of
- dgettext (domain, string)
- This also shows which values are expected for the third parameter.
- One has to use the available selectors for the categories available
- in ‘locale.h’. Normally the available values are ‘LC_CTYPE’,
- ‘LC_COLLATE’, ‘LC_MESSAGES’, ‘LC_MONETARY’, ‘LC_NUMERIC’, and
- ‘LC_TIME’. Please note that ‘LC_ALL’ must not be used and even
- though the names might suggest this, there is no relation to the
- environment variable of this name.
- The ‘dcgettext’ function is only implemented for compatibility with
- other systems which have ‘gettext’ functions. There is not really
- any situation where it is necessary (or useful) to use a different
- value than ‘LC_MESSAGES’ for the CATEGORY parameter. We are
- dealing with messages here and any other choice can only be
- irritating.
- As for ‘gettext’ the return value type is ‘char *’ which is an
- anachronism. The returned string must never be modified.
- When using the three functions above in a program it is a frequent
- case that the MSGID argument is a constant string. So it is worthwhile
- to optimize this case. Thinking shortly about this one will realize
- that as long as no new message catalog is loaded the translation of a
- message will not change. This optimization is actually implemented by
- the ‘gettext’, ‘dgettext’ and ‘dcgettext’ functions.
- File: libc.info, Node: Locating gettext catalog, Next: Advanced gettext functions, Prev: Translation with gettext, Up: Message catalogs with gettext
- 8.2.1.2 How to determine which catalog to be used
- .................................................
- The functions to retrieve the translations for a given message have a
- remarkable simple interface. But to provide the user of the program
- still the opportunity to select exactly the translation s/he wants and
- also to provide the programmer the possibility to influence the way to
- locate the search for catalogs files there is a quite complicated
- underlying mechanism which controls all this. The code is complicated
- the use is easy.
- Basically we have two different tasks to perform which can also be
- performed by the ‘catgets’ functions:
- 1. Locate the set of message catalogs. There are a number of files
- for different languages which all belong to the package. Usually
- they are all stored in the filesystem below a certain directory.
- There can be arbitrarily many packages installed and they can
- follow different guidelines for the placement of their files.
- 2. Relative to the location specified by the package the actual
- translation files must be searched, based on the wishes of the
- user. I.e., for each language the user selects the program should
- be able to locate the appropriate file.
- This is the functionality required by the specifications for
- ‘gettext’ and this is also what the ‘catgets’ functions are able to do.
- But there are some problems unresolved:
- • The language to be used can be specified in several different ways.
- There is no generally accepted standard for this and the user
- always expects the program to understand what s/he means. E.g., to
- select the German translation one could write ‘de’, ‘german’, or
- ‘deutsch’ and the program should always react the same.
- • Sometimes the specification of the user is too detailed. If s/he,
- e.g., specifies ‘de_DE.ISO-8859-1’ which means German, spoken in
- Germany, coded using the ISO 8859-1 character set there is the
- possibility that a message catalog matching this exactly is not
- available. But there could be a catalog matching ‘de’ and if the
- character set used on the machine is always ISO 8859-1 there is no
- reason why this later message catalog should not be used. (We call
- this “message inheritance”.)
- • If a catalog for a wanted language is not available it is not
- always the second best choice to fall back on the language of the
- developer and simply not translate any message. Instead a user
- might be better able to read the messages in another language and
- so the user of the program should be able to define a precedence
- order of languages.
- We can divide the configuration actions in two parts: the one is
- performed by the programmer, the other by the user. We will start with
- the functions the programmer can use since the user configuration will
- be based on this.
- As the functions described in the last sections already mention
- separate sets of messages can be selected by a “domain name”. This is a
- simple string which should be unique for each program part that uses a
- separate domain. It is possible to use in one program arbitrarily many
- domains at the same time. E.g., the GNU C Library itself uses a domain
- named ‘libc’ while the program using the C Library could use a domain
- named ‘foo’. The important point is that at any time exactly one domain
- is active. This is controlled with the following function.
- -- Function: char * textdomain (const char *DOMAINNAME)
- Preliminary: | MT-Safe | AS-Unsafe lock heap | AC-Unsafe lock mem |
- *Note POSIX Safety Concepts::.
- The ‘textdomain’ function sets the default domain, which is used in
- all future ‘gettext’ calls, to DOMAINNAME. Please note that
- ‘dgettext’ and ‘dcgettext’ calls are not influenced if the
- DOMAINNAME parameter of these functions is not the null pointer.
- Before the first call to ‘textdomain’ the default domain is
- ‘messages’. This is the name specified in the specification of the
- ‘gettext’ API. This name is as good as any other name. No program
- should ever really use a domain with this name since this can only
- lead to problems.
- The function returns the value which is from now on taken as the
- default domain. If the system went out of memory the returned
- value is ‘NULL’ and the global variable ‘errno’ is set to ‘ENOMEM’.
- Despite the return value type being ‘char *’ the return string must
- not be changed. It is allocated internally by the ‘textdomain’
- function.
- If the DOMAINNAME parameter is the null pointer no new default
- domain is set. Instead the currently selected default domain is
- returned.
- If the DOMAINNAME parameter is the empty string the default domain
- is reset to its initial value, the domain with the name ‘messages’.
- This possibility is questionable to use since the domain ‘messages’
- really never should be used.
- -- Function: char * bindtextdomain (const char *DOMAINNAME, const char
- *DIRNAME)
- Preliminary: | MT-Safe | AS-Unsafe heap | AC-Unsafe mem | *Note
- POSIX Safety Concepts::.
- The ‘bindtextdomain’ function can be used to specify the directory
- which contains the message catalogs for domain DOMAINNAME for the
- different languages. To be correct, this is the directory where
- the hierarchy of directories is expected. Details are explained
- below.
- For the programmer it is important to note that the translations
- which come with the program have to be placed in a directory
- hierarchy starting at, say, ‘/foo/bar’. Then the program should
- make a ‘bindtextdomain’ call to bind the domain for the current
- program to this directory. So it is made sure the catalogs are
- found. A correctly running program does not depend on the user
- setting an environment variable.
- The ‘bindtextdomain’ function can be used several times and if the
- DOMAINNAME argument is different the previously bound domains will
- not be overwritten.
- If the program which wish to use ‘bindtextdomain’ at some point of
- time use the ‘chdir’ function to change the current working
- directory it is important that the DIRNAME strings ought to be an
- absolute pathname. Otherwise the addressed directory might vary
- with the time.
- If the DIRNAME parameter is the null pointer ‘bindtextdomain’
- returns the currently selected directory for the domain with the
- name DOMAINNAME.
- The ‘bindtextdomain’ function returns a pointer to a string
- containing the name of the selected directory name. The string is
- allocated internally in the function and must not be changed by the
- user. If the system went out of core during the execution of
- ‘bindtextdomain’ the return value is ‘NULL’ and the global variable
- ‘errno’ is set accordingly.
- File: libc.info, Node: Advanced gettext functions, Next: Charset conversion in gettext, Prev: Locating gettext catalog, Up: Message catalogs with gettext
- 8.2.1.3 Additional functions for more complicated situations
- ............................................................
- The functions of the ‘gettext’ family described so far (and all the
- ‘catgets’ functions as well) have one problem in the real world which
- has been neglected completely in all existing approaches. What is meant
- here is the handling of plural forms.
- Looking through Unix source code before the time anybody thought
- about internationalization (and, sadly, even afterwards) one can often
- find code similar to the following:
- printf ("%d file%s deleted", n, n == 1 ? "" : "s");
- After the first complaints from people internationalizing the code
- people either completely avoided formulations like this or used strings
- like ‘"file(s)"’. Both look unnatural and should be avoided. First
- tries to solve the problem correctly looked like this:
- if (n == 1)
- printf ("%d file deleted", n);
- else
- printf ("%d files deleted", n);
- But this does not solve the problem. It helps languages where the
- plural form of a noun is not simply constructed by adding an 's' but
- that is all. Once again people fell into the trap of believing the
- rules their language uses are universal. But the handling of plural
- forms differs widely between the language families. There are two
- things we can differ between (and even inside language families);
- • The form how plural forms are build differs. This is a problem
- with language which have many irregularities. German, for
- instance, is a drastic case. Though English and German are part of
- the same language family (Germanic), the almost regular forming of
- plural noun forms (appending an 's') is hardly found in German.
- • The number of plural forms differ. This is somewhat surprising for
- those who only have experiences with Romanic and Germanic languages
- since here the number is the same (there are two).
- But other language families have only one form or many forms. More
- information on this in an extra section.
- The consequence of this is that application writers should not try to
- solve the problem in their code. This would be localization since it is
- only usable for certain, hardcoded language environments. Instead the
- extended ‘gettext’ interface should be used.
- These extra functions are taking instead of the one key string two
- strings and a numerical argument. The idea behind this is that using
- the numerical argument and the first string as a key, the implementation
- can select using rules specified by the translator the right plural
- form. The two string arguments then will be used to provide a return
- value in case no message catalog is found (similar to the normal
- ‘gettext’ behavior). In this case the rules for Germanic language are
- used and it is assumed that the first string argument is the singular
- form, the second the plural form.
- This has the consequence that programs without language catalogs can
- display the correct strings only if the program itself is written using
- a Germanic language. This is a limitation but since the GNU C Library
- (as well as the GNU ‘gettext’ package) is written as part of the GNU
- package and the coding standards for the GNU project require programs to
- be written in English, this solution nevertheless fulfills its purpose.
- -- Function: char * ngettext (const char *MSGID1, const char *MSGID2,
- unsigned long int N)
- Preliminary: | MT-Safe env | AS-Unsafe corrupt heap lock dlopen |
- AC-Unsafe corrupt lock fd mem | *Note POSIX Safety Concepts::.
- The ‘ngettext’ function is similar to the ‘gettext’ function as it
- finds the message catalogs in the same way. But it takes two extra
- arguments. The MSGID1 parameter must contain the singular form of
- the string to be converted. It is also used as the key for the
- search in the catalog. The MSGID2 parameter is the plural form.
- The parameter N is used to determine the plural form. If no
- message catalog is found MSGID1 is returned if ‘n == 1’, otherwise
- ‘msgid2’.
- An example for the use of this function is:
- printf (ngettext ("%d file removed", "%d files removed", n), n);
- Please note that the numeric value N has to be passed to the
- ‘printf’ function as well. It is not sufficient to pass it only to
- ‘ngettext’.
- -- Function: char * dngettext (const char *DOMAIN, const char *MSGID1,
- const char *MSGID2, unsigned long int N)
- Preliminary: | MT-Safe env | AS-Unsafe corrupt heap lock dlopen |
- AC-Unsafe corrupt lock fd mem | *Note POSIX Safety Concepts::.
- The ‘dngettext’ is similar to the ‘dgettext’ function in the way
- the message catalog is selected. The difference is that it takes
- two extra parameters to provide the correct plural form. These two
- parameters are handled in the same way ‘ngettext’ handles them.
- -- Function: char * dcngettext (const char *DOMAIN, const char *MSGID1,
- const char *MSGID2, unsigned long int N, int CATEGORY)
- Preliminary: | MT-Safe env | AS-Unsafe corrupt heap lock dlopen |
- AC-Unsafe corrupt lock fd mem | *Note POSIX Safety Concepts::.
- The ‘dcngettext’ is similar to the ‘dcgettext’ function in the way
- the message catalog is selected. The difference is that it takes
- two extra parameters to provide the correct plural form. These two
- parameters are handled in the same way ‘ngettext’ handles them.
- The problem of plural forms
- ...........................
- A description of the problem can be found at the beginning of the last
- section. Now there is the question how to solve it. Without the input
- of linguists (which was not available) it was not possible to determine
- whether there are only a few different forms in which plural forms are
- formed or whether the number can increase with every new supported
- language.
- Therefore the solution implemented is to allow the translator to
- specify the rules of how to select the plural form. Since the formula
- varies with every language this is the only viable solution except for
- hardcoding the information in the code (which still would require the
- possibility of extensions to not prevent the use of new languages). The
- details are explained in the GNU ‘gettext’ manual. Here only a bit of
- information is provided.
- The information about the plural form selection has to be stored in
- the header entry (the one with the empty ‘msgid’ string). It looks like
- this:
- Plural-Forms: nplurals=2; plural=n == 1 ? 0 : 1;
- The ‘nplurals’ value must be a decimal number which specifies how
- many different plural forms exist for this language. The string
- following ‘plural’ is an expression using the C language syntax.
- Exceptions are that no negative numbers are allowed, numbers must be
- decimal, and the only variable allowed is ‘n’. This expression will be
- evaluated whenever one of the functions ‘ngettext’, ‘dngettext’, or
- ‘dcngettext’ is called. The numeric value passed to these functions is
- then substituted for all uses of the variable ‘n’ in the expression.
- The resulting value then must be greater or equal to zero and smaller
- than the value given as the value of ‘nplurals’.
- The following rules are known at this point. The language with families
- are listed. But this does not necessarily mean the information can be
- generalized for the whole family (as can be easily seen in the table
- below).(1)
- Only one form:
- Some languages only require one single form. There is no
- distinction between the singular and plural form. An appropriate
- header entry would look like this:
- Plural-Forms: nplurals=1; plural=0;
- Languages with this property include:
- Finno-Ugric family
- Hungarian
- Asian family
- Japanese, Korean
- Turkic/Altaic family
- Turkish
- Two forms, singular used for one only
- This is the form used in most existing programs since it is what
- English uses. A header entry would look like this:
- Plural-Forms: nplurals=2; plural=n != 1;
- (Note: this uses the feature of C expressions that boolean
- expressions have to value zero or one.)
- Languages with this property include:
- Germanic family
- Danish, Dutch, English, German, Norwegian, Swedish
- Finno-Ugric family
- Estonian, Finnish
- Latin/Greek family
- Greek
- Semitic family
- Hebrew
- Romance family
- Italian, Portuguese, Spanish
- Artificial
- Esperanto
- Two forms, singular used for zero and one
- Exceptional case in the language family. The header entry would
- be:
- Plural-Forms: nplurals=2; plural=n>1;
- Languages with this property include:
- Romanic family
- French, Brazilian Portuguese
- Three forms, special case for zero
- The header entry would be:
- Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n != 0 ? 1 : 2;
- Languages with this property include:
- Baltic family
- Latvian
- Three forms, special cases for one and two
- The header entry would be:
- Plural-Forms: nplurals=3; plural=n==1 ? 0 : n==2 ? 1 : 2;
- Languages with this property include:
- Celtic
- Gaeilge (Irish)
- Three forms, special case for numbers ending in 1[2-9]
- The header entry would look like this:
- Plural-Forms: nplurals=3; \
- plural=n%10==1 && n%100!=11 ? 0 : \
- n%10>=2 && (n%100<10 || n%100>=20) ? 1 : 2;
- Languages with this property include:
- Baltic family
- Lithuanian
- Three forms, special cases for numbers ending in 1 and 2, 3, 4, except those ending in 1[1-4]
- The header entry would look like this:
- Plural-Forms: nplurals=3; \
- plural=n%100/10==1 ? 2 : n%10==1 ? 0 : (n+9)%10>3 ? 2 : 1;
- Languages with this property include:
- Slavic family
- Croatian, Czech, Russian, Ukrainian
- Three forms, special cases for 1 and 2, 3, 4
- The header entry would look like this:
- Plural-Forms: nplurals=3; \
- plural=(n==1) ? 1 : (n>=2 && n<=4) ? 2 : 0;
- Languages with this property include:
- Slavic family
- Slovak
- Three forms, special case for one and some numbers ending in 2, 3, or 4
- The header entry would look like this:
- Plural-Forms: nplurals=3; \
- plural=n==1 ? 0 : \
- n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;
- Languages with this property include:
- Slavic family
- Polish
- Four forms, special case for one and all numbers ending in 02, 03, or 04
- The header entry would look like this:
- Plural-Forms: nplurals=4; \
- plural=n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n%100==4 ? 2 : 3;
- Languages with this property include:
- Slavic family
- Slovenian
- ---------- Footnotes ----------
- (1) Additions are welcome. Send appropriate information to
- <libc-alpha@sourceware.org>.
- File: libc.info, Node: Charset conversion in gettext, Next: GUI program problems, Prev: Advanced gettext functions, Up: Message catalogs with gettext
- 8.2.1.4 How to specify the output character set ‘gettext’ uses
- ..............................................................
- ‘gettext’ not only looks up a translation in a message catalog, it also
- converts the translation on the fly to the desired output character set.
- This is useful if the user is working in a different character set than
- the translator who created the message catalog, because it avoids
- distributing variants of message catalogs which differ only in the
- character set.
- The output character set is, by default, the value of ‘nl_langinfo
- (CODESET)’, which depends on the ‘LC_CTYPE’ part of the current locale.
- But programs which store strings in a locale independent way (e.g.
- UTF-8) can request that ‘gettext’ and related functions return the
- translations in that encoding, by use of the ‘bind_textdomain_codeset’
- function.
- Note that the MSGID argument to ‘gettext’ is not subject to character
- set conversion. Also, when ‘gettext’ does not find a translation for
- MSGID, it returns MSGID unchanged - independently of the current output
- character set. It is therefore recommended that all MSGIDs be US-ASCII
- strings.
- -- Function: char * bind_textdomain_codeset (const char *DOMAINNAME,
- const char *CODESET)
- Preliminary: | MT-Safe | AS-Unsafe heap | AC-Unsafe mem | *Note
- POSIX Safety Concepts::.
- The ‘bind_textdomain_codeset’ function can be used to specify the
- output character set for message catalogs for domain DOMAINNAME.
- The CODESET argument must be a valid codeset name which can be used
- for the ‘iconv_open’ function, or a null pointer.
- If the CODESET parameter is the null pointer,
- ‘bind_textdomain_codeset’ returns the currently selected codeset
- for the domain with the name DOMAINNAME. It returns ‘NULL’ if no
- codeset has yet been selected.
- The ‘bind_textdomain_codeset’ function can be used several times.
- If used multiple times with the same DOMAINNAME argument, the later
- call overrides the settings made by the earlier one.
- The ‘bind_textdomain_codeset’ function returns a pointer to a
- string containing the name of the selected codeset. The string is
- allocated internally in the function and must not be changed by the
- user. If the system went out of core during the execution of
- ‘bind_textdomain_codeset’, the return value is ‘NULL’ and the
- global variable ‘errno’ is set accordingly.
- File: libc.info, Node: GUI program problems, Next: Using gettextized software, Prev: Charset conversion in gettext, Up: Message catalogs with gettext
- 8.2.1.5 How to use ‘gettext’ in GUI programs
- ............................................
- One place where the ‘gettext’ functions, if used normally, have big
- problems is within programs with graphical user interfaces (GUIs). The
- problem is that many of the strings which have to be translated are very
- short. They have to appear in pull-down menus which restricts the
- length. But strings which are not containing entire sentences or at
- least large fragments of a sentence may appear in more than one
- situation in the program but might have different translations. This is
- especially true for the one-word strings which are frequently used in
- GUI programs.
- As a consequence many people say that the ‘gettext’ approach is wrong
- and instead ‘catgets’ should be used which indeed does not have this
- problem. But there is a very simple and powerful method to handle these
- kind of problems with the ‘gettext’ functions.
- As an example consider the following fictional situation. A GUI program
- has a menu bar with the following entries:
- +------------+------------+--------------------------------------+
- | File | Printer | |
- +------------+------------+--------------------------------------+
- | Open | | Select |
- | New | | Open |
- +----------+ | Connect |
- +----------+
- To have the strings ‘File’, ‘Printer’, ‘Open’, ‘New’, ‘Select’, and
- ‘Connect’ translated there has to be at some point in the code a call to
- a function of the ‘gettext’ family. But in two places the string passed
- into the function would be ‘Open’. The translations might not be the
- same and therefore we are in the dilemma described above.
- One solution to this problem is to artificially extend the strings to
- make them unambiguous. But what would the program do if no translation
- is available? The extended string is not what should be printed. So we
- should use a slightly modified version of the functions.
- To extend the strings a uniform method should be used. E.g., in the
- example above, the strings could be chosen as
- Menu|File
- Menu|Printer
- Menu|File|Open
- Menu|File|New
- Menu|Printer|Select
- Menu|Printer|Open
- Menu|Printer|Connect
- Now all the strings are different and if now instead of ‘gettext’ the
- following little wrapper function is used, everything works just fine:
- char *
- sgettext (const char *msgid)
- {
- char *msgval = gettext (msgid);
- if (msgval == msgid)
- msgval = strrchr (msgid, '|') + 1;
- return msgval;
- }
- What this little function does is to recognize the case when no
- translation is available. This can be done very efficiently by a
- pointer comparison since the return value is the input value. If there
- is no translation we know that the input string is in the format we used
- for the Menu entries and therefore contains a ‘|’ character. We simply
- search for the last occurrence of this character and return a pointer to
- the character following it. That's it!
- If one now consistently uses the extended string form and replaces
- the ‘gettext’ calls with calls to ‘sgettext’ (this is normally limited
- to very few places in the GUI implementation) then it is possible to
- produce a program which can be internationalized.
- With advanced compilers (such as GNU C) one can write the ‘sgettext’
- functions as an inline function or as a macro like this:
- #define sgettext(msgid) \
- ({ const char *__msgid = (msgid); \
- char *__msgstr = gettext (__msgid); \
- if (__msgval == __msgid) \
- __msgval = strrchr (__msgid, '|') + 1; \
- __msgval; })
- The other ‘gettext’ functions (‘dgettext’, ‘dcgettext’ and the
- ‘ngettext’ equivalents) can and should have corresponding functions as
- well which look almost identical, except for the parameters and the call
- to the underlying function.
- Now there is of course the question why such functions do not exist
- in the GNU C Library? There are two parts of the answer to this
- question.
- • They are easy to write and therefore can be provided by the project
- they are used in. This is not an answer by itself and must be seen
- together with the second part which is:
- • There is no way the C library can contain a version which can work
- everywhere. The problem is the selection of the character to
- separate the prefix from the actual string in the extended string.
- The examples above used ‘|’ which is a quite good choice because it
- resembles a notation frequently used in this context and it also is
- a character not often used in message strings.
- But what if the character is used in message strings. Or if the
- chose character is not available in the character set on the
- machine one compiles (e.g., ‘|’ is not required to exist for ISO C;
- this is why the ‘iso646.h’ file exists in ISO C programming
- environments).
- There is only one more comment to make left. The wrapper function
- above requires that the translations strings are not extended
- themselves. This is only logical. There is no need to disambiguate the
- strings (since they are never used as keys for a search) and one also
- saves quite some memory and disk space by doing this.
- File: libc.info, Node: Using gettextized software, Prev: GUI program problems, Up: Message catalogs with gettext
- 8.2.1.6 User influence on ‘gettext’
- ...................................
- The last sections described what the programmer can do to
- internationalize the messages of the program. But it is finally up to
- the user to select the message s/he wants to see. S/He must understand
- them.
- The POSIX locale model uses the environment variables ‘LC_COLLATE’,
- ‘LC_CTYPE’, ‘LC_MESSAGES’, ‘LC_MONETARY’, ‘LC_NUMERIC’, and ‘LC_TIME’ to
- select the locale which is to be used. This way the user can influence
- lots of functions. As we mentioned above, the ‘gettext’ functions also
- take advantage of this.
- To understand how this happens it is necessary to take a look at the
- various components of the filename which gets computed to locate a
- message catalog. It is composed as follows:
- DIR_NAME/LOCALE/LC_CATEGORY/DOMAIN_NAME.mo
- The default value for DIR_NAME is system specific. It is computed
- from the value given as the prefix while configuring the C library.
- This value normally is ‘/usr’ or ‘/’. For the former the complete
- DIR_NAME is:
- /usr/share/locale
- We can use ‘/usr/share’ since the ‘.mo’ files containing the message
- catalogs are system independent, so all systems can use the same files.
- If the program executed the ‘bindtextdomain’ function for the message
- domain that is currently handled, the ‘dir_name’ component is exactly
- the value which was given to the function as the second parameter.
- I.e., ‘bindtextdomain’ allows overwriting the only system dependent and
- fixed value to make it possible to address files anywhere in the
- filesystem.
- The CATEGORY is the name of the locale category which was selected in
- the program code. For ‘gettext’ and ‘dgettext’ this is always
- ‘LC_MESSAGES’, for ‘dcgettext’ this is selected by the value of the
- third parameter. As said above it should be avoided to ever use a
- category other than ‘LC_MESSAGES’.
- The LOCALE component is computed based on the category used. Just
- like for the ‘setlocale’ function here comes the user selection into the
- play. Some environment variables are examined in a fixed order and the
- first environment variable set determines the return value of the lookup
- process. In detail, for the category ‘LC_xxx’ the following variables
- in this order are examined:
- ‘LANGUAGE’
- ‘LC_ALL’
- ‘LC_xxx’
- ‘LANG’
- This looks very familiar. With the exception of the ‘LANGUAGE’
- environment variable this is exactly the lookup order the ‘setlocale’
- function uses. But why introduce the ‘LANGUAGE’ variable?
- The reason is that the syntax of the values these variables can have
- is different to what is expected by the ‘setlocale’ function. If we
- would set ‘LC_ALL’ to a value following the extended syntax that would
- mean the ‘setlocale’ function will never be able to use the value of
- this variable as well. An additional variable removes this problem plus
- we can select the language independently of the locale setting which
- sometimes is useful.
- While for the ‘LC_xxx’ variables the value should consist of exactly
- one specification of a locale the ‘LANGUAGE’ variable's value can
- consist of a colon separated list of locale names. The attentive reader
- will realize that this is the way we manage to implement one of our
- additional demands above: we want to be able to specify an ordered list
- of languages.
- Back to the constructed filename we have only one component missing.
- The DOMAIN_NAME part is the name which was either registered using the
- ‘textdomain’ function or which was given to ‘dgettext’ or ‘dcgettext’ as
- the first parameter. Now it becomes obvious that a good choice for the
- domain name in the program code is a string which is closely related to
- the program/package name. E.g., for the GNU C Library the domain name
- is ‘libc’.
- A limited piece of example code should show how the program is supposed
- to work:
- {
- setlocale (LC_ALL, "");
- textdomain ("test-package");
- bindtextdomain ("test-package", "/usr/local/share/locale");
- puts (gettext ("Hello, world!"));
- }
- At the program start the default domain is ‘messages’, and the
- default locale is "C". The ‘setlocale’ call sets the locale according to
- the user's environment variables; remember that correct functioning of
- ‘gettext’ relies on the correct setting of the ‘LC_MESSAGES’ locale (for
- looking up the message catalog) and of the ‘LC_CTYPE’ locale (for the
- character set conversion). The ‘textdomain’ call changes the default
- domain to ‘test-package’. The ‘bindtextdomain’ call specifies that the
- message catalogs for the domain ‘test-package’ can be found below the
- directory ‘/usr/local/share/locale’.
- If the user sets in her/his environment the variable ‘LANGUAGE’ to
- ‘de’ the ‘gettext’ function will try to use the translations from the
- file
- /usr/local/share/locale/de/LC_MESSAGES/test-package.mo
- From the above descriptions it should be clear which component of
- this filename is determined by which source.
- In the above example we assumed the ‘LANGUAGE’ environment variable
- to be ‘de’. This might be an appropriate selection but what happens if
- the user wants to use ‘LC_ALL’ because of the wider usability and here
- the required value is ‘de_DE.ISO-8859-1’? We already mentioned above
- that a situation like this is not infrequent. E.g., a person might
- prefer reading a dialect and if this is not available fall back on the
- standard language.
- The ‘gettext’ functions know about situations like this and can
- handle them gracefully. The functions recognize the format of the value
- of the environment variable. It can split the value is different pieces
- and by leaving out the only or the other part it can construct new
- values. This happens of course in a predictable way. To understand
- this one must know the format of the environment variable value. There
- is one more or less standardized form, originally from the X/Open
- specification:
- ‘language[_territory[.codeset]][@modifier]’
- Less specific locale names will be stripped in the order of the
- following list:
- 1. ‘codeset’
- 2. ‘normalized codeset’
- 3. ‘territory’
- 4. ‘modifier’
- The ‘language’ field will never be dropped for obvious reasons.
- The only new thing is the ‘normalized codeset’ entry. This is
- another goodie which is introduced to help reduce the chaos which
- derives from the inability of people to standardize the names of
- character sets. Instead of ISO-8859-1 one can often see 8859-1, 88591,
- iso8859-1, or iso_8859-1. The ‘normalized codeset’ value is generated
- from the user-provided character set name by applying the following
- rules:
- 1. Remove all characters besides numbers and letters.
- 2. Fold letters to lowercase.
- 3. If the same only contains digits prepend the string ‘"iso"’.
- So all of the above names will be normalized to ‘iso88591’. This allows
- the program user much more freedom in choosing the locale name.
- Even this extended functionality still does not help to solve the
- problem that completely different names can be used to denote the same
- locale (e.g., ‘de’ and ‘german’). To be of help in this situation the
- locale implementation and also the ‘gettext’ functions know about
- aliases.
- The file ‘/usr/share/locale/locale.alias’ (replace ‘/usr’ with
- whatever prefix you used for configuring the C library) contains a
- mapping of alternative names to more regular names. The system manager
- is free to add new entries to fill her/his own needs. The selected
- locale from the environment is compared with the entries in the first
- column of this file ignoring the case. If they match, the value of the
- second column is used instead for the further handling.
- In the description of the format of the environment variables we
- already mentioned the character set as a factor in the selection of the
- message catalog. In fact, only catalogs which contain text written
- using the character set of the system/program can be used (directly;
- there will come a solution for this some day). This means for the user
- that s/he will always have to take care of this. If in the collection
- of the message catalogs there are files for the same language but coded
- using different character sets the user has to be careful.
- File: libc.info, Node: Helper programs for gettext, Prev: Message catalogs with gettext, Up: The Uniforum approach
- 8.2.2 Programs to handle message catalogs for ‘gettext’
- -------------------------------------------------------
- The GNU C Library does not contain the source code for the programs to
- handle message catalogs for the ‘gettext’ functions. As part of the GNU
- project the GNU gettext package contains everything the developer needs.
- The functionality provided by the tools in this package by far exceeds
- the abilities of the ‘gencat’ program described above for the ‘catgets’
- functions.
- There is a program ‘msgfmt’ which is the equivalent program to the
- ‘gencat’ program. It generates from the human-readable and -editable
- form of the message catalog a binary file which can be used by the
- ‘gettext’ functions. But there are several more programs available.
- The ‘xgettext’ program can be used to automatically extract the
- translatable messages from a source file. I.e., the programmer need not
- take care of the translations and the list of messages which have to be
- translated. S/He will simply wrap the translatable string in calls to
- ‘gettext’ et.al and the rest will be done by ‘xgettext’. This program
- has a lot of options which help to customize the output or help to
- understand the input better.
- Other programs help to manage the development cycle when new messages
- appear in the source files or when a new translation of the messages
- appears. Here it should only be noted that using all the tools in GNU
- gettext it is possible to _completely_ automate the handling of message
- catalogs. Besides marking the translatable strings in the source code
- and generating the translations the developers do not have anything to
- do themselves.
- File: libc.info, Node: Searching and Sorting, Next: Pattern Matching, Prev: Message Translation, Up: Top
- 9 Searching and Sorting
- ***********************
- This chapter describes functions for searching and sorting arrays of
- arbitrary objects. You pass the appropriate comparison function to be
- applied as an argument, along with the size of the objects in the array
- and the total number of elements.
- * Menu:
- * Comparison Functions:: Defining how to compare two objects.
- Since the sort and search facilities
- are general, you have to specify the
- ordering.
- * Array Search Function:: The ‘bsearch’ function.
- * Array Sort Function:: The ‘qsort’ function.
- * Search/Sort Example:: An example program.
- * Hash Search Function:: The ‘hsearch’ function.
- * Tree Search Function:: The ‘tsearch’ function.
- File: libc.info, Node: Comparison Functions, Next: Array Search Function, Up: Searching and Sorting
- 9.1 Defining the Comparison Function
- ====================================
- In order to use the sorted array library functions, you have to describe
- how to compare the elements of the array.
- To do this, you supply a comparison function to compare two elements
- of the array. The library will call this function, passing as arguments
- pointers to two array elements to be compared. Your comparison function
- should return a value the way ‘strcmp’ (*note String/Array Comparison::)
- does: negative if the first argument is "less" than the second, zero if
- they are "equal", and positive if the first argument is "greater".
- Here is an example of a comparison function which works with an array
- of numbers of type ‘long int’:
- int
- compare_long_ints (const void *a, const void *b)
- {
- const long int *la = a;
- const long int *lb = b;
- return (*la > *lb) - (*la < *lb);
- }
- (The code would have to be more complicated for an array of ‘double’,
- to handle NaNs correctly.)
- The header file ‘stdlib.h’ defines a name for the data type of
- comparison functions. This type is a GNU extension.
- int comparison_fn_t (const void *, const void *);
- File: libc.info, Node: Array Search Function, Next: Array Sort Function, Prev: Comparison Functions, Up: Searching and Sorting
- 9.2 Array Search Function
- =========================
- Generally searching for a specific element in an array means that
- potentially all elements must be checked. The GNU C Library contains
- functions to perform linear search. The prototypes for the following
- two functions can be found in ‘search.h’.
- -- Function: void * lfind (const void *KEY, const void *BASE, size_t
- *NMEMB, size_t SIZE, comparison_fn_t COMPAR)
- Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
- Concepts::.
- The ‘lfind’ function searches in the array with ‘*NMEMB’ elements
- of SIZE bytes pointed to by BASE for an element which matches the
- one pointed to by KEY. The function pointed to by COMPAR is used
- to decide whether two elements match.
- The return value is a pointer to the matching element in the array
- starting at BASE if it is found. If no matching element is
- available ‘NULL’ is returned.
- The mean runtime of this function is proportional to ‘*NMEMB/2’,
- assuming random elements of the array are searched for. This
- function should be used only if elements often get added to or
- deleted from the array in which case it might not be useful to sort
- the array before searching.
- -- Function: void * lsearch (const void *KEY, void *BASE, size_t
- *NMEMB, size_t SIZE, comparison_fn_t COMPAR)
- Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
- Concepts::.
- The ‘lsearch’ function is similar to the ‘lfind’ function. It
- searches the given array for an element and returns it if found.
- The difference is that if no matching element is found the
- ‘lsearch’ function adds the object pointed to by KEY (with a size
- of SIZE bytes) at the end of the array and it increments the value
- of ‘*NMEMB’ to reflect this addition.
- This means for the caller that if it is not sure that the array
- contains the element one is searching for the memory allocated for
- the array starting at BASE must have room for at least SIZE more
- bytes. If one is sure the element is in the array it is better to
- use ‘lfind’ so having more room in the array is always necessary
- when calling ‘lsearch’.
- To search a sorted or partially sorted array for an element matching
- the key, use the ‘bsearch’ function. The prototype for this function is
- in the header file ‘stdlib.h’.
- -- Function: void * bsearch (const void *KEY, const void *ARRAY, size_t
- COUNT, size_t SIZE, comparison_fn_t COMPARE)
- Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety
- Concepts::.
- The ‘bsearch’ function searches ARRAY for an element that is
- equivalent to KEY. The array contains COUNT elements, each of
- which is of size SIZE bytes.
- The COMPARE function is used to perform the comparison. This
- function is called with arguments that point to the key and to an
- array element, in that order, and should return an integer less
- than, equal to, or greater than zero corresponding to whether the
- key is considered less than, equal to, or greater than the array
- element. The function should not alter the array's contents, and
- the same array element should always compare the same way with the
- key.
- Although the array need not be completely sorted, it should be
- partially sorted with respect to KEY. That is, the array should
- begin with elements that compare less than KEY, followed by
- elements that compare equal to KEY, and ending with elements that
- compare greater than KEY. Any or all of these element sequences
- can be empty.
- The return value is a pointer to a matching array element, or a
- null pointer if no match is found. If the array contains more than
- one element that matches, the one that is returned is unspecified.
- This function derives its name from the fact that it is implemented
- using the binary search algorithm.
- In ISO C23 and later, this function is qualifier-generic: that is,
- it is also implemented as a function-like macro, and when the macro
- is used and ARRAY has a type that is a pointer to a
- ‘const’-qualified object type, ‘bsearch’ returns ‘const void *’.
- As an obsolescent feature, if the macro is suppressed the external
- function returns ‘void *’ regardless.
- File: libc.info, Node: Array Sort Function, Next: Search/Sort Example, Prev: Array Search Function, Up: Searching and Sorting
- 9.3 Array Sort Function
- =======================
- To sort an array using an arbitrary comparison function, use the ‘qsort’
- function. The prototype for this function is in ‘stdlib.h’.
- -- Function: void qsort (void *ARRAY, size_t COUNT, size_t SIZE,
- comparison_fn_t COMPARE)
- Preliminary: | MT-Safe | AS-Safe | AC-Unsafe corrupt | *Note POSIX
- Safety Concepts::.
- The ‘qsort’ function sorts the array ARRAY. The array contains
- COUNT elements, each of which is of size SIZE.
- The COMPARE function is used to perform the comparison on the array
- elements. This function is called with two pointer arguments and
- should return an integer less than, equal to, or greater than zero
- corresponding to whether its first argument is considered less
- than, equal to, or greater than its second argument. The function
- must not alter the array's contents, and must define a total
- ordering on the array elements, including any unusual values such
- as floating-point NaN (*note Infinity and NaN::). Because the
- sorting process can move elements, the function's return value must
- not depend on the element addresses or the relative positions of
- elements within the array, as these are meaningless while ‘qsort’
- is running.
- *Warning:* If two elements compare equal, their order after sorting
- is unpredictable. That is to say, the sorting is not stable. This
- can make a difference when the comparison considers only part of
- the elements and two elements that compare equal may differ in
- other respects. To ensure a stable sort in this situation, you can
- augment each element with an appropriate tie-breaking value, such
- as its original array index.
- Here is a simple example of sorting an array of ‘long int’ in
- numerical order, using the comparison function defined above (*note
- Comparison Functions::):
- {
- long int *array;
- size_t nmemb;
- ...
- qsort (array, nmemb, sizeof *array, compare_long_ints);
- }
- The ‘qsort’ function derives its name from the fact that it was
- originally implemented using the "quick sort" algorithm.
- The implementation of ‘qsort’ attempts to allocate auxiliary memory
- and use the merge sort algorithm, without violating C standard
- requirement that arguments passed to the comparison function point
- within the array. If the memory allocation fails, ‘qsort’ resorts
- to a slower algorithm.
- File: libc.info, Node: Search/Sort Example, Next: Hash Search Function, Prev: Array Sort Function, Up: Searching and Sorting
- 9.4 Searching and Sorting Example
- =================================
- Here is an example showing the use of ‘qsort’ and ‘bsearch’ with an
- array of structures. The elements of the array are sorted by comparing
- their ‘name’ fields with the ‘strcmp’ function. Then, we can look up
- individual elements based on their names.
- #include <stdlib.h>
- #include <stdio.h>
- #include <string.h>
- /* Define an array of critters to sort. */
- struct critter
- {
- const char *name;
- const char *species;
- };
- struct critter muppets[] =
- {
- {"Kermit", "frog"},
- {"Piggy", "pig"},
- {"Gonzo", "whatever"},
- {"Fozzie", "bear"},
- {"Sam", "eagle"},
- {"Robin", "frog"},
- {"Animal", "animal"},
- {"Camilla", "chicken"},
- {"Sweetums", "monster"},
- {"Dr. Strangepork", "pig"},
- {"Link Hogthrob", "pig"},
- {"Zoot", "human"},
- {"Dr. Bunsen Honeydew", "human"},
- {"Beaker", "human"},
- {"Swedish Chef", "human"}
- };
- int count = sizeof (muppets) / sizeof (struct critter);
- /* This is the comparison function used for sorting and searching. */
- int
- critter_cmp (const void *v1, const void *v2)
- {
- const struct critter *c1 = v1;
- const struct critter *c2 = v2;
- return strcmp (c1->name, c2->name);
- }
- /* Print information about a critter. */
- void
- print_critter (const struct critter *c)
- {
- printf ("%s, the %s\n", c->name, c->species);
- }
- /* Do the lookup into the sorted array. */
- void
- find_critter (const char *name)
- {
- struct critter target, *result;
- target.name = name;
- result = bsearch (&target, muppets, count, sizeof (struct critter),
- critter_cmp);
- if (result)
- print_critter (result);
- else
- printf ("Couldn't find %s.\n", name);
- }
- /* Main program. */
- int
- main (void)
- {
- int i;
- for (i = 0; i < count; i++)
- print_critter (&muppets[i]);
- printf ("\n");
- qsort (muppets, count, sizeof (struct critter), critter_cmp);
- for (i = 0; i < count; i++)
- print_critter (&muppets[i]);
- printf ("\n");
- find_critter ("Kermit");
- find_critter ("Gonzo");
- find_critter ("Janice");
- return 0;
- }
- The output from this program looks like:
- Kermit, the frog
- Piggy, the pig
- Gonzo, the whatever
- Fozzie, the bear
- Sam, the eagle
- Robin, the frog
- Animal, the animal
- Camilla, the chicken
- Sweetums, the monster
- Dr. Strangepork, the pig
- Link Hogthrob, the pig
- Zoot, the human
- Dr. Bunsen Honeydew, the human
- Beaker, the human
- Swedish Chef, the human
- Animal, the animal
- Beaker, the human
- Camilla, the chicken
- Dr. Bunsen Honeydew, the human
- Dr. Strangepork, the pig
- Fozzie, the bear
- Gonzo, the whatever
- Kermit, the frog
- Link Hogthrob, the pig
- Piggy, the pig
- Robin, the frog
- Sam, the eagle
- Swedish Chef, the human
- Sweetums, the monster
- Zoot, the human
- Kermit, the frog
- Gonzo, the whatever
- Couldn't find Janice.
- File: libc.info, Node: Hash Search Function, Next: Tree Search Function, Prev: Search/Sort Example, Up: Searching and Sorting
- 9.5 The ‘hsearch’ function.
- ===========================
- The functions mentioned so far in this chapter are for searching in a
- sorted or unsorted array. There are other methods to organize
- information which later should be searched. The costs of insert, delete
- and search differ. One possible implementation is using hashing tables.
- The following functions are declared in the header file ‘search.h’.
- -- Function: int hcreate (size_t NEL)
- Preliminary: | MT-Unsafe race:hsearch | AS-Unsafe heap | AC-Unsafe
- corrupt mem | *Note POSIX Safety Concepts::.
- The ‘hcreate’ function creates a hashing table which can contain at
- least NEL elements. There is no possibility to grow this table so
- it is necessary to choose the value for NEL wisely. The method
- used to implement this function might make it necessary to make the
- number of elements in the hashing table larger than the expected
- maximal number of elements. Hashing tables usually work
- inefficiently if they are filled 80% or more. The constant access
- time guaranteed by hashing can only be achieved if few collisions
- exist. See Knuth's "The Art of Computer Programming, Part 3:
- Searching and Sorting" for more information.
- The weakest aspect of this function is that there can be at most
- one hashing table used through the whole program. The table is
- allocated in local memory out of control of the programmer. As an
- extension the GNU C Library provides an additional set of functions
- with a reentrant interface which provides a similar interface but
- which allows keeping arbitrarily many hashing tables.
- It is possible to use more than one hashing table in the program
- run if the former table is first destroyed by a call to ‘hdestroy’.
- The function returns a non-zero value if successful. If it returns
- zero, something went wrong. This could either mean there is
- already a hashing table in use or the program ran out of memory.
- -- Function: void hdestroy (void)
- Preliminary: | MT-Unsafe race:hsearch | AS-Unsafe heap | AC-Unsafe
- corrupt mem | *Note POSIX Safety Concepts::.
- The ‘hdestroy’ function can be used to free all the resources
- allocated in a previous call of ‘hcreate’. After a call to this
- function it is again possible to call ‘hcreate’ and allocate a new
- table with possibly different size.
- It is important to remember that the elements contained in the
- hashing table at the time ‘hdestroy’ is called are _not_ freed by
- this function. It is the responsibility of the program code to
- free those strings (if necessary at all). Freeing all the element
- memory is not possible without extra, separately kept information
- since there is no function to iterate through all available
- elements in the hashing table. If it is really necessary to free a
- table and all elements the programmer has to keep a list of all
- table elements and before calling ‘hdestroy’ s/he has to free all
- element's data using this list. This is a very unpleasant
- mechanism and it also shows that this kind of hashing table is
- mainly meant for tables which are created once and used until the
- end of the program run.
- Entries of the hashing table and keys for the search are defined
- using this type:
- -- Data type: ENTRY
- ‘char *key’
- Pointer to a zero-terminated string of characters describing
- the key for the search or the element in the hashing table.
- This is a limiting restriction of the functionality of the
- ‘hsearch’ functions: They can only be used for data sets which
- use the NUL character always and solely to terminate keys. It
- is not possible to handle general binary data for keys.
- ‘void *data’
- Generic pointer for use by the application. The hashing table
- implementation preserves this pointer in entries, but does not
- use it in any way otherwise.
- -- Data type: struct entry
- The underlying type of ‘ENTRY’.
- -- Function: ENTRY * hsearch (ENTRY ITEM, ACTION ACTION)
- Preliminary: | MT-Unsafe race:hsearch | AS-Unsafe | AC-Unsafe
- corrupt/action==ENTER | *Note POSIX Safety Concepts::.
- To search in a hashing table created using ‘hcreate’ the ‘hsearch’
- function must be used. This function can perform a simple search
- for an element (if ACTION has the value ‘FIND’) or it can
- alternatively insert the key element into the hashing table.
- Entries are never replaced.
- The key is denoted by a pointer to an object of type ‘ENTRY’. For
- locating the corresponding position in the hashing table only the
- ‘key’ element of the structure is used.
- If an entry with a matching key is found the ACTION parameter is
- irrelevant. The found entry is returned. If no matching entry is
- found and the ACTION parameter has the value ‘FIND’ the function
- returns a ‘NULL’ pointer. If no entry is found and the ACTION
- parameter has the value ‘ENTER’ a new entry is added to the hashing
- table which is initialized with the parameter ITEM. A pointer to
- the newly added entry is returned.
- As mentioned before, the hashing table used by the functions
- described so far is global and there can be at any time at most one
- hashing table in the program. A solution is to use the following
- functions which are a GNU extension. All have in common that they
- operate on a hashing table which is described by the content of an
- object of the type ‘struct hsearch_data’. This type should be treated
- as opaque, none of its members should be changed directly.
- -- Function: int hcreate_r (size_t NEL, struct hsearch_data *HTAB)
- Preliminary: | MT-Safe race:htab | AS-Unsafe heap | AC-Unsafe
- corrupt mem | *Note POSIX Safety Concepts::.
- The ‘hcreate_r’ function initializes the object pointed to by HTAB
- to contain a hashing table with at least NEL elements. So this
- function is equivalent to the ‘hcreate’ function except that the
- initialized data structure is controlled by the user.
- This allows having more than one hashing table at one time. The
- memory necessary for the ‘struct hsearch_data’ object can be
- allocated dynamically. It must be initialized with zero before
- calling this function.
- The return value is non-zero if the operation was successful. If
- the return value is zero, something went wrong, which probably
- means the program ran out of memory.
- -- Function: void hdestroy_r (struct hsearch_data *HTAB)
- Preliminary: | MT-Safe race:htab | AS-Unsafe heap | AC-Unsafe
- corrupt mem | *Note POSIX Safety Concepts::.
- The ‘hdestroy_r’ function frees all resources allocated by the
- ‘hcreate_r’ function for this very same object HTAB. As for
- ‘hdestroy’ it is the program's responsibility to free the strings
- for the elements of the table.
- -- Function: int hsearch_r (ENTRY ITEM, ACTION ACTION, ENTRY **RETVAL,
- struct hsearch_data *HTAB)
- Preliminary: | MT-Safe race:htab | AS-Safe | AC-Unsafe
- corrupt/action==ENTER | *Note POSIX Safety Concepts::.
- The ‘hsearch_r’ function is equivalent to ‘hsearch’. The meaning
- of the first two arguments is identical. But instead of operating
- on a single global hashing table the function works on the table
- described by the object pointed to by HTAB (which is initialized by
- a call to ‘hcreate_r’).
- Another difference to ‘hcreate’ is that the pointer to the found
- entry in the table is not the return value of the function. It is
- returned by storing it in a pointer variable pointed to by the
- RETVAL parameter. The return value of the function is an integer
- value indicating success if it is non-zero and failure if it is
- zero. In the latter case the global variable ‘errno’ signals the
- reason for the failure.
- ‘ENOMEM’
- The table is filled and ‘hsearch_r’ was called with a so far
- unknown key and ACTION set to ‘ENTER’.
- ‘ESRCH’
- The ACTION parameter is ‘FIND’ and no corresponding element is
- found in the table.
- File: libc.info, Node: Tree Search Function, Prev: Hash Search Function, Up: Searching and Sorting
- 9.6 The ‘tsearch’ function.
- ===========================
- Another common form to organize data for efficient search is to use
- trees. The ‘tsearch’ function family provides a nice interface to
- functions to organize possibly large amounts of data by providing a mean
- access time proportional to the logarithm of the number of elements.
- The GNU C Library implementation even guarantees that this bound is
- never exceeded even for input data which cause problems for simple
- binary tree implementations.
- The functions described in the chapter are all described in the
- System V and X/Open specifications and are therefore quite portable.
- In contrast to the ‘hsearch’ functions the ‘tsearch’ functions can be
- used with arbitrary data and not only zero-terminated strings.
- The ‘tsearch’ functions have the advantage that no function to
- initialize data structures is necessary. A simple pointer of type ‘void
- *’ initialized to ‘NULL’ is a valid tree and can be extended or
- searched. The prototypes for these functions can be found in the header
- file ‘search.h’.
- -- Function: void * tsearch (const void *KEY, void **ROOTP,
- comparison_fn_t COMPAR)
- Preliminary: | MT-Safe race:rootp | AS-Unsafe heap | AC-Unsafe
- corrupt mem | *Note POSIX Safety Concepts::.
- The ‘tsearch’ function searches in the tree pointed to by ‘*ROOTP’
- for an element matching KEY. The function pointed to by COMPAR is
- used to determine whether two elements match. *Note Comparison
- Functions::, for a specification of the functions which can be used
- for the COMPAR parameter.
- If the tree does not contain a matching entry the KEY value will be
- added to the tree. ‘tsearch’ does not make a copy of the object
- pointed to by KEY (how could it since the size is unknown).
- Instead it adds a reference to this object which means the object
- must be available as long as the tree data structure is used.
- The tree is represented by a pointer to a pointer since it is
- sometimes necessary to change the root node of the tree. So it
- must not be assumed that the variable pointed to by ROOTP has the
- same value after the call. This also shows that it is not safe to
- call the ‘tsearch’ function more than once at the same time using
- the same tree. It is no problem to run it more than once at a time
- on different trees.
- The return value is a pointer to the matching element in the tree.
- If a new element was created the pointer points to the new data
- (which is in fact KEY). If an entry had to be created and the
- program ran out of space ‘NULL’ is returned.
- -- Function: void * tfind (const void *KEY, void *const *ROOTP,
- comparison_fn_t COMPAR)
- Preliminary: | MT-Safe race:rootp | AS-Safe | AC-Safe | *Note POSIX
- Safety Concepts::.
- The ‘tfind’ function is similar to the ‘tsearch’ function. It
- locates an element matching the one pointed to by KEY and returns a
- pointer to this element. But if no matching element is available
- no new element is entered (note that the ROOTP parameter points to
- a constant pointer). Instead the function returns ‘NULL’.
- Another advantage of the ‘tsearch’ functions in contrast to the
- ‘hsearch’ functions is that there is an easy way to remove elements.
- -- Function: void * tdelete (const void *KEY, void **ROOTP,
- comparison_fn_t COMPAR)
- Preliminary: | MT-Safe race:rootp | AS-Unsafe heap | AC-Unsafe
- corrupt mem | *Note POSIX Safety Concepts::.
- To remove a specific element matching KEY from the tree ‘tdelete’
- can be used. It locates the matching element using the same method
- as ‘tfind’. The corresponding element is then removed and a
- pointer to the parent of the deleted node is returned by the
- function. If there is no matching entry in the tree nothing can be
- deleted and the function returns ‘NULL’. If the root of the tree
- is deleted ‘tdelete’ returns some unspecified value not equal to
- ‘NULL’.
- -- Function: void tdestroy (void *VROOT, __free_fn_t FREEFCT)
- Preliminary: | MT-Safe | AS-Unsafe heap | AC-Unsafe mem | *Note
- POSIX Safety Concepts::.
- If the complete search tree has to be removed one can use
- ‘tdestroy’. It frees all resources allocated by the ‘tsearch’
- functions to generate the tree pointed to by VROOT.
- For the data in each tree node the function FREEFCT is called. The
- pointer to the data is passed as the argument to the function. If
- no such work is necessary FREEFCT must point to a function doing
- nothing. It is called in any case.
- This function is a GNU extension and not covered by the System V or
- X/Open specifications.
- In addition to the functions to create and destroy the tree data
- structure, there is another function which allows you to apply a
- function to all elements of the tree. The function must have this type:
- void __action_fn_t (const void *nodep, VISIT value, int level);
- The NODEP is the data value of the current node (once given as the
- KEY argument to ‘tsearch’). LEVEL is a numeric value which corresponds
- to the depth of the current node in the tree. The root node has the
- depth 0 and its children have a depth of 1 and so on. The ‘VISIT’ type
- is an enumeration type.
- -- Data Type: VISIT
- The ‘VISIT’ value indicates the status of the current node in the
- tree and how the function is called. The status of a node is
- either 'leaf' or 'internal node'. For each leaf node the function
- is called exactly once, for each internal node it is called three
- times: before the first child is processed, after the first child
- is processed and after both children are processed. This makes it
- possible to handle all three methods of tree traversal (or even a
- combination of them).
- ‘preorder’
- The current node is an internal node and the function is
- called before the first child was processed.
- ‘postorder’
- The current node is an internal node and the function is
- called after the first child was processed.
- ‘endorder’
- The current node is an internal node and the function is
- called after the second child was processed.
- ‘leaf’
- The current node is a leaf.
- -- Function: void twalk (const void *ROOT, __action_fn_t ACTION)
- Preliminary: | MT-Safe race:root | AS-Safe | AC-Safe | *Note POSIX
- Safety Concepts::.
- For each node in the tree with a node pointed to by ROOT, the
- ‘twalk’ function calls the function provided by the parameter
- ACTION. For leaf nodes the function is called exactly once with
- VALUE set to ‘leaf’. For internal nodes the function is called
- three times, setting the VALUE parameter or ACTION to the
- appropriate value. The LEVEL argument for the ACTION function is
- computed while descending the tree by increasing the value by one
- for each descent to a child, starting with the value 0 for the root
- node.
- Since the functions used for the ACTION parameter to ‘twalk’ must
- not modify the tree data, it is safe to run ‘twalk’ in more than
- one thread at the same time, working on the same tree. It is also
- safe to call ‘tfind’ in parallel. Functions which modify the tree
- must not be used, otherwise the behavior is undefined. However, it
- is difficult to pass data external to the tree to the callback
- function without resorting to global variables (and thread safety
- issues), so see the ‘twalk_r’ function below.
- -- Function: void twalk_r (const void *ROOT, void (*ACTION) (const void
- *KEY, VISIT WHICH, void *CLOSURE), void *CLOSURE)
- Preliminary: | MT-Safe race:root | AS-Safe | AC-Safe | *Note POSIX
- Safety Concepts::.
- For each node in the tree with a node pointed to by ROOT, the
- ‘twalk_r’ function calls the function provided by the parameter
- ACTION. For leaf nodes the function is called exactly once with
- WHICH set to ‘leaf’. For internal nodes the function is called
- three times, setting the WHICH parameter of ACTION to the
- appropriate value. The CLOSURE parameter is passed down to each
- call of the ACTION function, unmodified.
- It is possible to implement the ‘twalk’ function on top of the
- ‘twalk_r’ function, which is why there is no separate level
- parameter.
- #define _GNU_SOURCE 1
- #include <search.h>
- struct twalk_with_twalk_r_closure
- {
- void (*action) (const void *, VISIT, int);
- int depth;
- };
- static void
- twalk_with_twalk_r_action (const void *nodep, VISIT which, void *closure0)
- {
- struct twalk_with_twalk_r_closure *closure = closure0;
- switch (which)
- {
- case leaf:
- closure->action (nodep, which, closure->depth);
- break;
- case preorder:
- closure->action (nodep, which, closure->depth);
- ++closure->depth;
- break;
- case postorder:
- /* The preorder action incremented the depth. */
- closure->action (nodep, which, closure->depth - 1);
- break;
- case endorder:
- --closure->depth;
- closure->action (nodep, which, closure->depth);
- break;
- }
- }
- void
- twalk (const void *root, void (*action) (const void *, VISIT, int))
- {
- struct twalk_with_twalk_r_closure closure = { action, 0 };
- twalk_r (root, twalk_with_twalk_r_action, &closure);
- }
- File: libc.info, Node: Pattern Matching, Next: I/O Overview, Prev: Searching and Sorting, Up: Top
- 10 Pattern Matching
- *******************
- The GNU C Library provides pattern matching facilities for two kinds of
- patterns: regular expressions and file-name wildcards. The library also
- provides a facility for expanding variable and command references and
- parsing text into words in the way the shell does.
- * Menu:
- * Wildcard Matching:: Matching a wildcard pattern against a single string.
- * Globbing:: Finding the files that match a wildcard pattern.
- * Regular Expressions:: Matching regular expressions against strings.
- * Word Expansion:: Expanding shell variables, nested commands,
- arithmetic, and wildcards.
- This is what the shell does with shell commands.
- File: libc.info, Node: Wildcard Matching, Next: Globbing, Up: Pattern Matching
- 10.1 Wildcard Matching
- ======================
- This section describes how to match a wildcard pattern against a
- particular string. The result is a yes or no answer: does the string
- fit the pattern or not. The symbols described here are all declared in
- ‘fnmatch.h’.
- -- Function: int fnmatch (const char *PATTERN, const char *STRING, int
- FLAGS)
- Preliminary: | MT-Safe env locale | AS-Unsafe heap | AC-Unsafe mem
- | *Note POSIX Safety Concepts::.
- This function tests whether the string STRING matches the pattern
- PATTERN. It returns ‘0’ if they do match; otherwise, it returns
- the nonzero value ‘FNM_NOMATCH’. The arguments PATTERN and STRING
- are both strings.
- The argument FLAGS is a combination of flag bits that alter the
- details of matching. See below for a list of the defined flags.
- In the GNU C Library, ‘fnmatch’ might sometimes report "errors" by
- returning nonzero values that are not equal to ‘FNM_NOMATCH’.
- These are the available flags for the FLAGS argument:
- ‘FNM_FILE_NAME’
- Treat the ‘/’ character specially, for matching file names. If
- this flag is set, wildcard constructs in PATTERN cannot match ‘/’
- in STRING. Thus, the only way to match ‘/’ is with an explicit ‘/’
- in PATTERN.
- ‘FNM_PATHNAME’
- This is an alias for ‘FNM_FILE_NAME’; it comes from POSIX.2. We
- don't recommend this name because we don't use the term "pathname"
- for file names.
- ‘FNM_PERIOD’
- Treat the ‘.’ character specially if it appears at the beginning of
- STRING. If this flag is set, wildcard constructs in PATTERN cannot
- match ‘.’ as the first character of STRING.
- If you set both ‘FNM_PERIOD’ and ‘FNM_FILE_NAME’, then the special
- treatment applies to ‘.’ following ‘/’ as well as to ‘.’ at the
- beginning of STRING. (The shell uses the ‘FNM_PERIOD’ and
- ‘FNM_FILE_NAME’ flags together for matching file names.)
- ‘FNM_NOESCAPE’
- Don't treat the ‘\’ character specially in patterns. Normally, ‘\’
- quotes the following character, turning off its special meaning (if
- any) so that it matches only itself. When quoting is enabled, the
- pattern ‘\?’ matches only the string ‘?’, because the question mark
- in the pattern acts like an ordinary character.
- If you use ‘FNM_NOESCAPE’, then ‘\’ is an ordinary character.
- ‘FNM_LEADING_DIR’
- Ignore a trailing sequence of characters starting with a ‘/’ in
- STRING; that is to say, test whether STRING starts with a directory
- name that PATTERN matches.
- If this flag is set, either ‘foo*’ or ‘foobar’ as a pattern would
- match the string ‘foobar/frobozz’.
- ‘FNM_CASEFOLD’
- Ignore case in comparing STRING to PATTERN.
- This macro was originally a GNU extension, but was added in
- POSIX.1-2024.
- ‘FNM_EXTMATCH’
- Besides the normal patterns, also recognize the extended patterns
- introduced in ‘ksh’. The patterns are written in the form
- explained in the following table where PATTERN-LIST is a ‘|’
- separated list of patterns.
- ‘?(PATTERN-LIST)’
- The pattern matches if zero or one occurrences of any of the
- patterns in the PATTERN-LIST allow matching the input string.
- ‘*(PATTERN-LIST)’
- The pattern matches if zero or more occurrences of any of the
- patterns in the PATTERN-LIST allow matching the input string.
- ‘+(PATTERN-LIST)’
- The pattern matches if one or more occurrences of any of the
- patterns in the PATTERN-LIST allow matching the input string.
- ‘@(PATTERN-LIST)’
- The pattern matches if exactly one occurrence of any of the
- patterns in the PATTERN-LIST allows matching the input string.
- ‘!(PATTERN-LIST)’
- The pattern matches if the input string cannot be matched with
- any of the patterns in the PATTERN-LIST.
- File: libc.info, Node: Globbing, Next: Regular Expressions, Prev: Wildcard Matching, Up: Pattern Matching
- 10.2 Globbing
- =============
- The archetypal use of wildcards is for matching against the files in a
- directory, and making a list of all the matches. This is called
- “globbing”.
- You could do this using ‘fnmatch’, by reading the directory entries
- one by one and testing each one with ‘fnmatch’. But that would be slow
- (and complex, since you would have to handle subdirectories by hand).
- The library provides a function ‘glob’ to make this particular use of
- wildcards convenient. ‘glob’ and the other symbols in this section are
- declared in ‘glob.h’.
- * Menu:
- * Calling Glob:: Basic use of ‘glob’.
- * Flags for Globbing:: Flags that enable various options in ‘glob’.
- * More Flags for Globbing:: GNU specific extensions to ‘glob’.
- File: libc.info, Node: Calling Glob, Next: Flags for Globbing, Up: Globbing
- 10.2.1 Calling ‘glob’
- ---------------------
- The result of globbing is a vector of file names (strings). To return
- this vector, ‘glob’ uses a special data type, ‘glob_t’, which is a
- structure. You pass ‘glob’ the address of the structure, and it fills
- in the structure's fields to tell you about the results.
- -- Data Type: glob_t
- This data type holds a pointer to a word vector. More precisely,
- it records both the address of the word vector and its size. The
- GNU implementation contains some more fields which are non-standard
- extensions.
- ‘gl_pathc’
- The number of elements in the vector, excluding the initial
- null entries if the GLOB_DOOFFS flag is used (see gl_offs
- below).
- ‘gl_pathv’
- The address of the vector. This field has type ‘char **’.
- ‘gl_offs’
- The offset of the first real element of the vector, from its
- nominal address in the ‘gl_pathv’ field. Unlike the other
- fields, this is always an input to ‘glob’, rather than an
- output from it.
- If you use a nonzero offset, then that many elements at the
- beginning of the vector are left empty. (The ‘glob’ function
- fills them with null pointers.)
- The ‘gl_offs’ field is meaningful only if you use the
- ‘GLOB_DOOFFS’ flag. Otherwise, the offset is always zero
- regardless of what is in this field, and the first real
- element comes at the beginning of the vector.
- ‘gl_closedir’
- The address of an alternative implementation of the ‘closedir’
- function. It is used if the ‘GLOB_ALTDIRFUNC’ bit is set in
- the flag parameter. The type of this field is
- ‘void (*) (void *)’.
- This is a GNU extension.
- ‘gl_readdir’
- The address of an alternative implementation of the ‘readdir’
- function used to read the contents of a directory. It is used
- if the ‘GLOB_ALTDIRFUNC’ bit is set in the flag parameter.
- The type of this field is ‘struct dirent *(*) (void *)’.
- An implementation of ‘gl_readdir’ needs to initialize the
- following members of the ‘struct dirent’ object:
- ‘d_type’
- This member should be set to the file type of the entry
- if it is known. Otherwise, the value ‘DT_UNKNOWN’ can be
- used. The ‘glob’ function may use the specified file
- type to avoid callbacks in cases where the file type
- indicates that the data is not required.
- ‘d_ino’
- This member needs to be non-zero, otherwise ‘glob’ may
- skip the current entry and call the ‘gl_readdir’ callback
- function again to retrieve another entry.
- ‘d_name’
- This member must be set to the name of the entry. It
- must be null-terminated.
- The example below shows how to allocate a ‘struct dirent’
- object containing a given name.
- #include <dirent.h>
- #include <errno.h>
- #include <stddef.h>
- #include <stdlib.h>
- #include <string.h>
- struct dirent *
- mkdirent (const char *name)
- {
- size_t dirent_size = offsetof (struct dirent, d_name) + 1;
- size_t name_length = strlen (name);
- size_t total_size = dirent_size + name_length;
- if (total_size < dirent_size)
- {
- errno = ENOMEM;
- return NULL;
- }
- struct dirent *result = malloc (total_size);
- if (result == NULL)
- return NULL;
- result->d_type = DT_UNKNOWN;
- result->d_ino = 1; /* Do not skip this entry. */
- memcpy (result->d_name, name, name_length + 1);
- return result;
- }
- The ‘glob’ function reads the ‘struct dirent’ members listed
- above and makes a copy of the file name in the ‘d_name’ member
- immediately after the ‘gl_readdir’ callback function returns.
- Future invocations of any of the callback functions may
- deallocate or reuse the buffer. It is the responsibility of
- the caller of the ‘glob’ function to allocate and deallocate
- the buffer, around the call to ‘glob’ or using the callback
- functions. For example, an application could allocate the
- buffer in the ‘gl_readdir’ callback function, and deallocate
- it in the ‘gl_closedir’ callback function.
- The ‘gl_readdir’ member is a GNU extension.
- ‘gl_opendir’
- The address of an alternative implementation of the ‘opendir’
- function. It is used if the ‘GLOB_ALTDIRFUNC’ bit is set in
- the flag parameter. The type of this field is
- ‘void *(*) (const char *)’.
- This is a GNU extension.
- ‘gl_stat’
- The address of an alternative implementation of the ‘stat’
- function to get information about an object in the filesystem.
- It is used if the ‘GLOB_ALTDIRFUNC’ bit is set in the flag
- parameter. The type of this field is
- ‘int (*) (const char *, struct stat *)’.
- This is a GNU extension.
- ‘gl_lstat’
- The address of an alternative implementation of the ‘lstat’
- function to get information about an object in the
- filesystems, not following symbolic links. It is used if the
- ‘GLOB_ALTDIRFUNC’ bit is set in the flag parameter. The type
- of this field is ‘int (*) (const char *, struct stat *)’.
- This is a GNU extension.
- ‘gl_flags’
- The flags used when ‘glob’ was called. In addition,
- ‘GLOB_MAGCHAR’ might be set. See *note Flags for Globbing::
- for more details.
- This is a GNU extension.
- For use in the ‘glob64’ function ‘glob.h’ contains another definition
- for a very similar type. ‘glob64_t’ differs from ‘glob_t’ only in the
- types of the members ‘gl_readdir’, ‘gl_stat’, and ‘gl_lstat’.
- -- Data Type: glob64_t
- This data type holds a pointer to a word vector. More precisely,
- it records both the address of the word vector and its size. The
- GNU implementation contains some more fields which are non-standard
- extensions.
- ‘gl_pathc’
- The number of elements in the vector, excluding the initial
- null entries if the GLOB_DOOFFS flag is used (see gl_offs
- below).
- ‘gl_pathv’
- The address of the vector. This field has type ‘char **’.
- ‘gl_offs’
- The offset of the first real element of the vector, from its
- nominal address in the ‘gl_pathv’ field. Unlike the other
- fields, this is always an input to ‘glob’, rather than an
- output from it.
- If you use a nonzero offset, then that many elements at the
- beginning of the vector are left empty. (The ‘glob’ function
- fills them with null pointers.)
- The ‘gl_offs’ field is meaningful only if you use the
- ‘GLOB_DOOFFS’ flag. Otherwise, the offset is always zero
- regardless of what is in this field, and the first real
- element comes at the beginning of the vector.
- ‘gl_closedir’
- The address of an alternative implementation of the ‘closedir’
- function. It is used if the ‘GLOB_ALTDIRFUNC’ bit is set in
- the flag parameter. The type of this field is
- ‘void (*) (void *)’.
- This is a GNU extension.
- ‘gl_readdir’
- The address of an alternative implementation of the
- ‘readdir64’ function used to read the contents of a directory.
- It is used if the ‘GLOB_ALTDIRFUNC’ bit is set in the flag
- parameter. The type of this field is
- ‘struct dirent64 *(*) (void *)’.
- This is a GNU extension.
- ‘gl_opendir’
- The address of an alternative implementation of the ‘opendir’
- function. It is used if the ‘GLOB_ALTDIRFUNC’ bit is set in
- the flag parameter. The type of this field is
- ‘void *(*) (const char *)’.
- This is a GNU extension.
- ‘gl_stat’
- The address of an alternative implementation of the ‘stat64’
- function to get information about an object in the filesystem.
- It is used if the ‘GLOB_ALTDIRFUNC’ bit is set in the flag
- parameter. The type of this field is
- ‘int (*) (const char *, struct stat64 *)’.
- This is a GNU extension.
- ‘gl_lstat’
- The address of an alternative implementation of the ‘lstat64’
- function to get information about an object in the
- filesystems, not following symbolic links. It is used if the
- ‘GLOB_ALTDIRFUNC’ bit is set in the flag parameter. The type
- of this field is ‘int (*) (const char *, struct stat64 *)’.
- This is a GNU extension.
- ‘gl_flags’
- The flags used when ‘glob’ was called. In addition,
- ‘GLOB_MAGCHAR’ might be set. See *note Flags for Globbing::
- for more details.
- This is a GNU extension.
- -- Function: int glob (const char *PATTERN, int FLAGS, int (*ERRFUNC)
- (const char *FILENAME, int ERROR-CODE), glob_t *VECTOR-PTR)
- Preliminary: | MT-Unsafe race:utent env sig:ALRM timer locale |
- AS-Unsafe dlopen plugin corrupt heap lock | AC-Unsafe corrupt lock
- fd mem | *Note POSIX Safety Concepts::.
- The function ‘glob’ does globbing using the pattern PATTERN in the
- current directory. It puts the result in a newly allocated vector,
- and stores the size and address of this vector into ‘*VECTOR-PTR’.
- The argument FLAGS is a combination of bit flags; see *note Flags
- for Globbing::, for details of the flags.
- The result of globbing is a sequence of file names. The function
- ‘glob’ allocates a string for each resulting word, then allocates a
- vector of type ‘char **’ to store the addresses of these strings.
- The last element of the vector is a null pointer. This vector is
- called the “word vector”.
- To return this vector, ‘glob’ stores both its address and its
- length (number of elements, not counting the terminating null
- pointer) into ‘*VECTOR-PTR’.
- Normally, ‘glob’ sorts the file names alphabetically before
- returning them. You can turn this off with the flag ‘GLOB_NOSORT’
- if you want to get the information as fast as possible. Usually
- it's a good idea to let ‘glob’ sort them--if you process the files
- in alphabetical order, the users will have a feel for the rate of
- progress that your application is making.
- If ‘glob’ succeeds, it returns 0. Otherwise, it returns one of
- these error codes:
- ‘GLOB_ABORTED’
- There was an error opening a directory, and you used the flag
- ‘GLOB_ERR’ or your specified ERRFUNC returned a nonzero value.
- *Note Flags for Globbing::, for an explanation of the
- ‘GLOB_ERR’ flag and ERRFUNC.
- ‘GLOB_NOMATCH’
- The pattern didn't match any existing files. If you use the
- ‘GLOB_NOCHECK’ flag, then you never get this error code,
- because that flag tells ‘glob’ to _pretend_ that the pattern
- matched at least one file.
- ‘GLOB_NOSPACE’
- It was impossible to allocate memory to hold the result.
- In the event of an error, ‘glob’ stores information in
- ‘*VECTOR-PTR’ about all the matches it has found so far.
- It is important to notice that the ‘glob’ function will not fail if
- it encounters directories or files which cannot be handled without
- the LFS interfaces. The implementation of ‘glob’ is supposed to
- use these functions internally. This at least is the assumption
- made by the Unix standard. The GNU extension of allowing the user
- to provide their own directory handling and ‘stat’ functions
- complicates things a bit. If these callback functions are used and
- a large file or directory is encountered ‘glob’ _can_ fail.
- -- Function: int glob64 (const char *PATTERN, int FLAGS, int (*ERRFUNC)
- (const char *FILENAME, int ERROR-CODE), glob64_t *VECTOR-PTR)
- Preliminary: | MT-Unsafe race:utent env sig:ALRM timer locale |
- AS-Unsafe dlopen corrupt heap lock | AC-Unsafe corrupt lock fd mem
- | *Note POSIX Safety Concepts::.
- The ‘glob64’ function was added as part of the Large File Summit
- extensions but is not part of the original LFS proposal. The
- reason for this is simple: it is not necessary. The necessity for
- a ‘glob64’ function is added by the extensions of the GNU ‘glob’
- implementation which allows the user to provide their own directory
- handling and ‘stat’ functions. The ‘readdir’ and ‘stat’ functions
- do depend on the choice of ‘_FILE_OFFSET_BITS’ since the definition
- of the types ‘struct dirent’ and ‘struct stat’ will change
- depending on the choice.
- Besides this difference, ‘glob64’ works just like ‘glob’ in all
- aspects.
- This function is a GNU extension.
- File: libc.info, Node: Flags for Globbing, Next: More Flags for Globbing, Prev: Calling Glob, Up: Globbing
- 10.2.2 Flags for Globbing
- -------------------------
- This section describes the standard flags that you can specify in the
- FLAGS argument to ‘glob’. Choose the flags you want, and combine them
- with the C bitwise OR operator ‘|’.
- Note that there are *note More Flags for Globbing:: available as GNU
- extensions.
- ‘GLOB_APPEND’
- Append the words from this expansion to the vector of words
- produced by previous calls to ‘glob’. This way you can effectively
- expand several words as if they were concatenated with spaces
- between them.
- In order for appending to work, you must not modify the contents of
- the word vector structure between calls to ‘glob’. And, if you set
- ‘GLOB_DOOFFS’ in the first call to ‘glob’, you must also set it
- when you append to the results.
- Note that the pointer stored in ‘gl_pathv’ may no longer be valid
- after you call ‘glob’ the second time, because ‘glob’ might have
- relocated the vector. So always fetch ‘gl_pathv’ from the ‘glob_t’
- structure after each ‘glob’ call; *never* save the pointer across
- calls.
- ‘GLOB_DOOFFS’
- Leave blank slots at the beginning of the vector of words. The
- ‘gl_offs’ field says how many slots to leave. The blank slots
- contain null pointers.
- ‘GLOB_ERR’
- Give up right away and report an error if there is any difficulty
- reading the directories that must be read in order to expand
- PATTERN fully. Such difficulties might include a directory in
- which you don't have the requisite access. Normally, ‘glob’ tries
- its best to keep on going despite any errors, reading whatever
- directories it can.
- You can exercise even more control than this by specifying an
- error-handler function ERRFUNC when you call ‘glob’. If ERRFUNC is
- not a null pointer, then ‘glob’ doesn't give up right away when it
- can't read a directory; instead, it calls ERRFUNC with two
- arguments, like this:
- (*ERRFUNC) (FILENAME, ERROR-CODE)
- The argument FILENAME is the name of the directory that ‘glob’
- couldn't open or couldn't read, and ERROR-CODE is the ‘errno’ value
- that was reported to ‘glob’.
- If the error handler function returns nonzero, then ‘glob’ gives up
- right away. Otherwise, it continues.
- ‘GLOB_MARK’
- If the pattern matches the name of a directory, append ‘/’ to the
- directory's name when returning it.
- ‘GLOB_NOCHECK’
- If the pattern doesn't match any file names, return the pattern
- itself as if it were a file name that had been matched. (Normally,
- when the pattern doesn't match anything, ‘glob’ returns that there
- were no matches.)
- ‘GLOB_NOESCAPE’
- Don't treat the ‘\’ character specially in patterns. Normally, ‘\’
- quotes the following character, turning off its special meaning (if
- any) so that it matches only itself. When quoting is enabled, the
- pattern ‘\?’ matches only the string ‘?’, because the question mark
- in the pattern acts like an ordinary character.
- If you use ‘GLOB_NOESCAPE’, then ‘\’ is an ordinary character.
- ‘glob’ does its work by calling the function ‘fnmatch’ repeatedly.
- It handles the flag ‘GLOB_NOESCAPE’ by turning on the
- ‘FNM_NOESCAPE’ flag in calls to ‘fnmatch’.
- ‘GLOB_NOSORT’
- Don't sort the file names; return them in no particular order. (In
- practice, the order will depend on the order of the entries in the
- directory.) The only reason _not_ to sort is to save time.
- File: libc.info, Node: More Flags for Globbing, Prev: Flags for Globbing, Up: Globbing
- 10.2.3 More Flags for Globbing
- ------------------------------
- Beside the flags described in the last section, the GNU implementation
- of ‘glob’ allows a few more flags which are also defined in the ‘glob.h’
- file. Some of the extensions implement functionality which is available
- in modern shell implementations.
- ‘GLOB_PERIOD’
- The ‘.’ character (period) is treated special. It cannot be
- matched by wildcards. *Note Wildcard Matching::, ‘FNM_PERIOD’.
- ‘GLOB_MAGCHAR’
- The ‘GLOB_MAGCHAR’ value is not to be given to ‘glob’ in the FLAGS
- parameter. Instead, ‘glob’ sets this bit in the GL_FLAGS element
- of the GLOB_T structure provided as the result if the pattern used
- for matching contains any wildcard character.
- ‘GLOB_ALTDIRFUNC’
- Instead of using the normal functions for accessing the filesystem
- the ‘glob’ implementation uses the user-supplied functions
- specified in the structure pointed to by PGLOB parameter. For more
- information about the functions refer to the sections about
- directory handling see *note Accessing Directories::, and *note
- Reading Attributes::.
- ‘GLOB_BRACE’
- If this flag is given, the handling of braces in the pattern is
- changed. It is now required that braces appear correctly grouped.
- I.e., for each opening brace there must be a closing one. Braces
- can be used recursively. So it is possible to define one brace
- expression in another one. It is important to note that the range
- of each brace expression is completely contained in the outer brace
- expression (if there is one).
- The string between the matching braces is separated into single
- expressions by splitting at ‘,’ (comma) characters. The commas
- themselves are discarded. Please note what we said above about
- recursive brace expressions. The commas used to separate the
- subexpressions must be at the same level. Commas in brace
- subexpressions are not matched. They are used during expansion of
- the brace expression of the deeper level. The example below shows
- this
- glob ("{foo/{,bar,biz},baz}", GLOB_BRACE, NULL, &result)
- is equivalent to the sequence
- glob ("foo/", GLOB_BRACE, NULL, &result)
- glob ("foo/bar", GLOB_BRACE|GLOB_APPEND, NULL, &result)
- glob ("foo/biz", GLOB_BRACE|GLOB_APPEND, NULL, &result)
- glob ("baz", GLOB_BRACE|GLOB_APPEND, NULL, &result)
- if we leave aside error handling.
- ‘GLOB_NOMAGIC’
- If the pattern contains no wildcard constructs (it is a literal
- file name), return it as the sole "matching" word, even if no file
- exists by that name.
- ‘GLOB_TILDE’
- If this flag is used the character ‘~’ (tilde) is handled specially
- if it appears at the beginning of the pattern. Instead of being
- taken verbatim it is used to represent the home directory of a
- known user.
- If ‘~’ is the only character in pattern or it is followed by a ‘/’
- (slash), the home directory of the process owner is substituted.
- Using ‘getlogin’ and ‘getpwnam’ the information is read from the
- system databases. As an example take user ‘bart’ with his home
- directory at ‘/home/bart’. For him a call like
- glob ("~/bin/*", GLOB_TILDE, NULL, &result)
- would return the contents of the directory ‘/home/bart/bin’.
- Instead of referring to the own home directory it is also possible
- to name the home directory of other users. To do so one has to
- append the user name after the tilde character. So the contents of
- user ‘homer’'s ‘bin’ directory can be retrieved by
- glob ("~homer/bin/*", GLOB_TILDE, NULL, &result)
- If the user name is not valid or the home directory cannot be
- determined for some reason the pattern is left untouched and itself
- used as the result. I.e., if in the last example ‘home’ is not
- available the tilde expansion yields to ‘"~homer/bin/*"’ and ‘glob’
- is not looking for a directory named ‘~homer’.
- This functionality is equivalent to what is available in C-shells
- if the ‘nonomatch’ flag is set.
- ‘GLOB_TILDE_CHECK’
- If this flag is used ‘glob’ behaves as if ‘GLOB_TILDE’ is given.
- The only difference is that if the user name is not available or
- the home directory cannot be determined for other reasons this
- leads to an error. ‘glob’ will return ‘GLOB_NOMATCH’ instead of
- using the pattern itself as the name.
- This functionality is equivalent to what is available in C-shells
- if the ‘nonomatch’ flag is not set.
- ‘GLOB_ONLYDIR’
- If this flag is used the globbing function takes this as a *hint*
- that the caller is only interested in directories matching the
- pattern. If the information about the type of the file is easily
- available non-directories will be rejected but no extra work will
- be done to determine the information for each file. I.e., the
- caller must still be able to filter directories out.
- This functionality is only available with the GNU ‘glob’
- implementation. It is mainly used internally to increase the
- performance but might be useful for a user as well and therefore is
- documented here.
- Calling ‘glob’ will in most cases allocate resources which are used
- to represent the result of the function call. If the same object of
- type ‘glob_t’ is used in multiple call to ‘glob’ the resources are freed
- or reused so that no leaks appear. But this does not include the time
- when all ‘glob’ calls are done.
- -- Function: void globfree (glob_t *PGLOB)
- Preliminary: | MT-Safe | AS-Unsafe corrupt heap | AC-Unsafe corrupt
- mem | *Note POSIX Safety Concepts::.
- The ‘globfree’ function frees all resources allocated by previous
- calls to ‘glob’ associated with the object pointed to by PGLOB.
- This function should be called whenever the currently used ‘glob_t’
- typed object isn't used anymore.
- -- Function: void globfree64 (glob64_t *PGLOB)
- Preliminary: | MT-Safe | AS-Unsafe corrupt lock | AC-Unsafe corrupt
- lock fd mem | *Note POSIX Safety Concepts::.
- This function is equivalent to ‘globfree’ but it frees records of
- type ‘glob64_t’ which were allocated by ‘glob64’.
- File: libc.info, Node: Regular Expressions, Next: Word Expansion, Prev: Globbing, Up: Pattern Matching
- 10.3 Regular Expression Matching
- ================================
- The GNU C Library supports two interfaces for matching regular
- expressions. One is the standard POSIX.2 interface, and the other is
- what the GNU C Library has had for many years.
- Both interfaces are declared in the header file ‘regex.h’. If you
- define ‘_POSIX_C_SOURCE’, then only the POSIX.2 functions, structures,
- and constants are declared.
- * Menu:
- * POSIX Regexp Compilation:: Using ‘regcomp’ to prepare to match.
- * Flags for POSIX Regexps:: Syntax variations for ‘regcomp’.
- * Matching POSIX Regexps:: Using ‘regexec’ to match the compiled
- pattern that you get from ‘regcomp’.
- * Regexp Subexpressions:: Finding which parts of the string were matched.
- * Subexpression Complications:: Find points of which parts were matched.
- * Regexp Cleanup:: Freeing storage; reporting errors.
- File: libc.info, Node: POSIX Regexp Compilation, Next: Flags for POSIX Regexps, Up: Regular Expressions
- 10.3.1 POSIX Regular Expression Compilation
- -------------------------------------------
- Before you can actually match a regular expression, you must “compile”
- it. This is not true compilation--it produces a special data structure,
- not machine instructions. But it is like ordinary compilation in that
- its purpose is to enable you to "execute" the pattern fast. (*Note
- Matching POSIX Regexps::, for how to use the compiled regular expression
- for matching.)
- There is a special data type for compiled regular expressions:
- -- Data Type: regex_t
- This type of object holds a compiled regular expression. It is
- actually a structure. It has just one field that your programs
- should look at:
- ‘re_nsub’
- This field holds the number of parenthetical subexpressions in
- the regular expression that was compiled.
- There are several other fields, but we don't describe them here,
- because only the functions in the library should use them.
- After you create a ‘regex_t’ object, you can compile a regular
- expression into it by calling ‘regcomp’.
- -- Function: int regcomp (regex_t *restrict COMPILED, const char
- *restrict PATTERN, int CFLAGS)
- Preliminary: | MT-Safe locale | AS-Unsafe corrupt heap lock dlopen
- | AC-Unsafe corrupt lock mem fd | *Note POSIX Safety Concepts::.
- The function ‘regcomp’ "compiles" a regular expression into a data
- structure that you can use with ‘regexec’ to match against a
- string. The compiled regular expression format is designed for
- efficient matching. ‘regcomp’ stores it into ‘*COMPILED’.
- It's up to you to allocate an object of type ‘regex_t’ and pass its
- address to ‘regcomp’.
- The argument CFLAGS lets you specify various options that control
- the syntax and semantics of regular expressions. *Note Flags for
- POSIX Regexps::.
- If you use the flag ‘REG_NOSUB’, then ‘regcomp’ omits from the
- compiled regular expression the information necessary to record how
- subexpressions actually match. In this case, you might as well
- pass ‘0’ for the MATCHPTR and NMATCH arguments when you call
- ‘regexec’.
- If you don't use ‘REG_NOSUB’, then the compiled regular expression
- does have the capacity to record how subexpressions match. Also,
- ‘regcomp’ tells you how many subexpressions PATTERN has, by storing
- the number in ‘COMPILED->re_nsub’. You can use that value to
- decide how long an array to allocate to hold information about
- subexpression matches.
- ‘regcomp’ returns ‘0’ if it succeeds in compiling the regular
- expression; otherwise, it returns a nonzero error code (see the
- table below). You can use ‘regerror’ to produce an error message
- string describing the reason for a nonzero value; see *note Regexp
- Cleanup::.
- Here are the possible nonzero values that ‘regcomp’ can return:
- ‘REG_BADBR’
- There was an invalid ‘\{...\}’ construct in the regular expression.
- A valid ‘\{...\}’ construct must contain either a single number, or
- two numbers in increasing order separated by a comma.
- ‘REG_BADPAT’
- There was a syntax error in the regular expression.
- ‘REG_BADRPT’
- A repetition operator such as ‘?’ or ‘*’ appeared in a bad position
- (with no preceding subexpression to act on).
- ‘REG_ECOLLATE’
- The regular expression referred to an invalid collating element
- (one not defined in the current locale for string collation).
- *Note Locale Categories::.
- ‘REG_ECTYPE’
- The regular expression referred to an invalid character class name.
- ‘REG_EESCAPE’
- The regular expression ended with ‘\’.
- ‘REG_ESUBREG’
- There was an invalid number in the ‘\DIGIT’ construct.
- ‘REG_EBRACK’
- There were unbalanced square brackets in the regular expression.
- ‘REG_EPAREN’
- An extended regular expression had unbalanced parentheses, or a
- basic regular expression had unbalanced ‘\(’ and ‘\)’.
- ‘REG_EBRACE’
- The regular expression had unbalanced ‘\{’ and ‘\}’.
- ‘REG_ERANGE’
- One of the endpoints in a range expression was invalid.
- ‘REG_ESPACE’
- ‘regcomp’ ran out of memory.
|